Test method of storage device, electronic equipment and storage medium
By simulating the behavior of the test host to obtain interaction data and configure test parameter files, the problems of high difficulty and high cost in storage device testing are solved, efficient batch testing is achieved, and the performance and life of the storage device are optimized.
Patent Information
- Application Number
- CN202410434223.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-10
- Publication Date
- 2025-10-17
AI Technical Summary
Testing storage devices is difficult and the test terminals are expensive. Existing technologies require repeated verification on multiple terminals, resulting in long analysis cycles and inconsistent results.
By simulating the behavior of the test host, the interaction data between the storage device and the test host is obtained, key features are analyzed, and test parameter files are configured. Multiple storage devices are tested using the simulated test host behavior.
It improves the test efficiency of storage devices, reduces the number of test hosts used, reduces the investment cost of real equipment, shortens the analysis cycle, and optimizes the performance and life of storage devices.
Smart Images

Figure CN120808856A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of storage technology, and in particular to a storage device testing method, electronic equipment, and storage medium. Background Art
[0002] High-end application products have stringent requirements on storage device compatibility, performance, and lifespan. Therefore, when designing storage devices, extensive verification on actual application platforms is usually required to ensure product reliability.
[0003] As storage devices are widely used in various terminal solutions, their compatibility, performance, and lifespan requirements are becoming increasingly stringent, and the design requirements for storage devices are also increasing accordingly. During the storage device design phase, to ensure product compatibility, it is often necessary to use a large number of terminals to verify various functions, which requires a significant investment in equipment.
[0004] When troubleshooting on a terminal, it is often necessary to perform a large number of reproductions directly on the terminal and capture the abnormal scene for analysis using a protocol analyzer or oscilloscope. This will greatly prolong the analysis cycle. Even if the operation process is the same, the test results may often have large deviations, causing the storage device to need to repeatedly verify the reliability of parameter data during the development and testing phase. Summary of the Invention
[0005] The main technical problem solved by this application is to provide a storage device testing method, electronic equipment and storage medium to solve the problems of high difficulty in testing storage devices and high cost of test terminals.
[0006] In order to solve the above problems, the present application provides a storage device testing method, including: obtaining data of the interaction between a test host and a target storage device; simulating the test behavior of the test host based on the data to test multiple storage devices to be tested separately.
[0007] Among them, the steps of simulating the test behavior of the test host based on data to test multiple storage devices to be tested separately include: parsing the data to obtain the key features of the data; configuring the test parameter file based on the key features; using the test device to run the test parameter file to simulate the test behavior of the test host and test multiple storage devices to be tested separately.
[0008] The step of analyzing the data to obtain the key features of the data comprises: analyzing the data to obtain host data, storage device data and time data of the interaction between the test host and the storage device; in response to the host data being target host data, setting a queue depth of the target host data based on a completion state of the target host data; and obtaining the key features of the data based on the host data, the target host data and the queue depth thereof, the storage device data and the time data.
[0009] The data comprises a plurality of row data; the step of analyzing the data to obtain the host data, the storage device data and the time data of the interaction between the test host and the storage device comprises: obtaining current row data and obtaining host data or storage device data of the current row data from the current row data; in response to the host data or the storage device data of the current row data being valid data, determining whether the current row data is first row data; if the current row data is the first row data, taking an execution time of the current row data as a time reference of the key features; if the current row data is not the first row data, taking a difference between the execution time of the current row data and an execution time of a previous row data as a time interval of the current row data; taking the time reference or the time interval as time data of the current row data; obtaining next row data, taking the next row data as new current row data, and again performing the step of obtaining the host data or the storage device data of the current row data from the current row data until obtaining the host data, the storage device data and the time data of all row data to obtain the key features of the data.
[0010] The step of configuring the test parameter file based on the key features further comprises: inserting preset data in the test parameter file; the preset data comprises one or more of power-off data, pressure deviation data, delay data, random command data, reset data and SSU.
[0011] The host data and the storage device data of the key features each comprise command execution time, rate mode, UPIU data packet and data cache; and the test parameter file comprises test time, instruction list and instruction sequence.
[0012] The step of testing the plurality of storage devices to be tested respectively by simulating the test behavior of the test host by running the test parameter file by the test device comprises: obtaining current row data from the test parameter file; in response to the current row data being target host data, judging whether the number of target data to be processed in the instruction list exceeds a preset value; when the number of target data to be processed does not exceed the preset value, adding the current row data into the instruction list; when the number of target data to be processed exceeds the preset value, waiting for the number of target data to be processed in the instruction list to drop below the preset value, and then adding the current row data into the instruction list; sequentially constructing a plurality of instructions in the instruction list based on the instruction sequence in the instruction list, and sequentially simulating the test host sending instructions to the corresponding storage device and processing the returned response result to perform the test.
[0013] The step of configuring the test parameter file based on the key feature further comprises: calculating the capacity ratio between the target storage device and the storage device to be tested; determining the address information and the size of the test parameter file based on the capacity ratio, and configuring the data content of the test parameter file based on the key feature to obtain the test parameter file.
[0014] The step of obtaining the data interacted between the test host and the target storage device comprises: constructing the data interacted between the test host and the target storage device based on the standard data; or collecting the data interacted between the test host and the target storage device from the log file of the test host; or connecting the test host with the protocol analyzer to record the data interacted between the test host and the target storage device through the protocol analyzer.
[0015] To solve the above technical problems, the application further provides an electronic device comprising a memory and a processor coupled with each other, and the processor is configured to execute program instructions stored in the memory to implement the test method of the storage device according to any one of the above.
[0016] To solve the above technical problems, the application further provides a computer readable storage medium having program instructions stored thereon, and the program instructions are executed by the processor to implement the test method of the storage device according to any one of the above.
[0017] The beneficial effects of the present application are: different from the prior art, the application obtains the data of the interaction between the test host and the target storage device; simulates the test behavior of the test host based on the data to test a plurality of storage devices to be tested, thereby testing the storage devices by simulating the test behavior of the test host, testing a plurality of storage devices to be tested at the same time, improving the test efficiency of the plurality of storage devices, greatly reducing the use of the test host, reducing the number of test hosts required in the batch test process of the plurality of storage devices, and reducing the investment cost of the real machine equipment. And the embodiment can realize directional behavior replay by simulating the test behavior of the test host, and accelerate the storage device verification analysis process. BRIEF DESCRIPTION OF DRAWINGS
[0018] Figure 1 is a flowchart of an embodiment of the storage device test method of the present application;
[0019] Figure 2 is a flowchart of another embodiment of the storage device test method of the present application;
[0020] Figure 3 is a flowchart of an embodiment of the test parameter file configuration of the present application;
[0021] Figure 4 is a flowchart of an embodiment of the test parameter file running of the present application;
[0022] Figure 5 is a frame diagram of an embodiment of the electronic device of the present application;
[0023] Figure 6 is a frame diagram of an embodiment of the computer readable storage medium of the present application. DETAILED DESCRIPTION
[0024] The scheme of the embodiments of the present application will be described in detail below in conjunction with the drawings of the specification.
[0025] In the following description, specific details such as specific system structures, interfaces, techniques, etc. are presented in order to thoroughly understand the present application, but are not intended to limit the present application.
[0026] The terms "system" and "network" are often used interchangeably in this paper. The term "and / or" in this paper is only a description of the association relationship of the associated objects, which means that there are three relationships, for example, A and / or B, which means that there are three cases of A alone, A and B together, and B alone. In addition, the character " / " in this paper generally represents an "or" relationship between the front and rear associated objects. In addition, "multiple" in this paper means two or more than two.
[0027] Please refer to Figure 1, Figure 1 is a flowchart of an embodiment of a test method of a storage device of the present application. The test method of the storage device in this embodiment specifically comprises the following steps:
[0028] Step S11: Obtain data interacted between a test host and a target storage device.
[0029] The storage device includes but is not limited to a hard disk, a solid state disk, a mobile hard disk, a U disk, a memory card, a non-volatile memory (NAND FLASH), a UFS (Universal Flash Storage) memory chip, an optical disk, and a cloud storage, etc.
[0030] The test host includes but is not limited to a mobile intelligent terminal, a computer terminal, a virtual host, a cloud host, etc.
[0031] In this step, data interacted between the test host and the target storage device is obtained first. The interacted data includes any data interacted between the test host and the target storage device, including but not limited to commands / instructions, reply data, execution time of data, and time interval between adjacent data, etc.
[0032] The scenarios of interaction between the test host and the target storage device can include multiple kinds to test the performance, life, and abnormal conditions of the storage device in multiple scenarios as much as possible. The interaction scenarios can include but are not limited to one or more of system burning, reboot, screen-off hibernation, screen-off wake-up, factory reset, screen-on standby, performance test, normal shutdown, normal startup, startup after abnormal power-off, file creation, file copying, file deletion, application installation, application startup, application uninstallation, and charging. The data of the above interaction scenarios is obtained in this embodiment to be simulated so that the multiple storage devices to be tested can be tested in any of the above interaction scenarios based on the corresponding interacted data.
[0033] Step S12: Simulate the test behavior of the test host based on the data to test the multiple storage devices to be tested respectively.
[0034] After the data of interaction between the test host and the target storage device in multiple interaction scenarios is obtained, the test behavior of the test host is simulated based on the interacted data to realize batch testing of the multiple storage devices to be tested, which greatly improves the test efficiency of the multiple storage devices.
[0035] The test host can be tested based on the data interaction by a test platform, a development board or other control circuit devices, while multiple storage devices to be tested are tested, the test efficiency is improved, the use of the test host is greatly reduced, the number of test hosts required in the batch testing process of the multiple storage devices is reduced, and the investment cost of the real machine equipment is reduced. The test behavior of the test host can be simulated to realize directional behavior replay and accelerate the storage device verification analysis process.
[0036] Through the above steps, the test method of the storage device of the embodiment can obtain the data interaction between the test host and the target storage device, simulate the test behavior of the test host based on the data, and test multiple storage devices to be tested respectively. Thus, the storage device can be tested by simulating the test behavior of the test host, multiple storage devices to be tested can be tested at the same time, the test efficiency of the multiple storage devices is improved, the use of the test host is greatly reduced, the number of test hosts required in the batch testing process of the multiple storage devices is reduced, and the investment cost of the real machine equipment is reduced. The test behavior of the test host can be simulated to realize directional behavior replay and accelerate the storage device verification analysis process.
[0037] Please refer to Figure 2 , Figure 2 is a flowchart of another embodiment of the test method of the storage device of the application. The test method of the storage device in the embodiment specifically includes the following steps:
[0038] Step S21: Obtain the data interaction between the test host and the target storage device.
[0039] In a specific application scenario, the data interaction between the test host and the target storage device can be constructed based on standard data. That is, the data constructed by a person in accordance with the storage device protocol is accepted.
[0040] In a specific application scenario, the data interaction between the test host and the target storage device can be collected from the log file (host driver log) of the test host. Specifically, the log file can be opened when the image is compiled on the test platform side, and then the log file in the actual interaction process can be collected through the universal asynchronous receiver-transmitter (UART) to obtain the data.
[0041] In a specific application scenario, the test host can also be connected with a protocol analyzer (PA), and the data exchanged between the test host and the target storage device can be recorded by the protocol analyzer. Specifically, a third-party protocol analyzer is introduced in the interaction process between the storage device and the test host to record the interaction process and obtain the data. For example, when the storage device is a UFS chip, the serial data input / output line of the UFS chip is connected to a PA probe, a PA supporting software is run, and the interaction behavior is started to be captured. The booting behavior can record the unipro data packet or UPIU data packet (UFS Protocol Information Unit) exchanged between the storage device and the test host from pressing the platform booting key to entering the platform operation interface to obtain the data. The data acquisition method is not limited herein. The data can be stored in the form of a Trace file.
[0042] Step S22: The data is parsed to obtain the key features of the data.
[0043] The test device is a special test device for simulating the test host, including but not limited to an ARM development board, a test board or other devices capable of data transmission and reception.
[0044] In this embodiment, the test host can be simulated by a development board, that is, the test device is a development board. In a specific application scenario, an ARM development board (Advanced RISC Machines) capable of running the test host operating system is prepared to simulate the test host. The storage device to be tested is placed in the development board socket for connection, and the data is imported into the ARM development board.
[0045] The data exchanged by the ARM development board is parsed to obtain the host data, storage device data and time data exchanged between the test host and the storage device, that is, the key data. The host data is the data sent by the test host to the storage device, and the storage device data is the data sent by the storage device to the test host. The above data includes but is not limited to commands / instructions, reply data, execution time of data and time interval between adjacent data, etc.
[0046] In response to the host data being target host data, the queue depth of the target host data is set based on the completion state of the target host data; and the key features of the exchanged data are obtained based on the host data, the target host data and the queue depth thereof, the storage device data and the time data.
[0047] The target host data can be UPIU CMD. There are 11 types of UPIU data, but only the execution of UPIU CMD data requires queue depth. Therefore, when the host data is target host data, the queue depth of the target host data needs to be determined for simulation. In a specific application scenario, the queue depth of the target host data is set based on the completion status of the target host data. When the target host data is in an incomplete state, i.e., the target host data has not received the corresponding response data, the corresponding queue depth is 1. When the target host data is in a completed state, i.e., the target host data has received the corresponding response data, the corresponding queue depth is 0.
[0048] When the host data is not target host data, the queue depth does not need to be obtained. The key features of the data are obtained based on the host data, the storage device data, and the time data.
[0049] In a specific application scenario, the interactive data includes multiple row data. The data is parsed row by row. Specifically, the current row data is obtained, and the host data or the storage device data of the current row data is obtained from the current row data. One row of data can only include one type of data.
[0050] When the host data or the storage device data of the current row data is valid data, it is determined whether the current row data is the first row data. Valid data refers to data that conforms to the storage device protocol. If the host data or the storage device data of the current row data is not valid data, i.e., it does not conform to the protocol, the key feature analysis is not performed based on the row data.
[0051] If it is the first row data, it means that the current row data is the starting point of the interactive data, and the execution time of the current row data is taken as the time reference of the key feature. If it is not the first row data, the difference between the execution time of the current row data and the execution time of the previous row data is taken as the time interval of the current row data. The time reference or the time interval is taken as the time data of the current row data.
[0052] The next row data is obtained, and the next row data is taken as the new current row data. The step of obtaining the host data or the storage device data of the current row data from the current row data is performed again until the host data, the storage device data, and the time data of all row data are obtained to obtain the key features of the interactive data.
[0053] Step S23: Configure a test parameter file based on the key features.
[0054] In a specific application scenario, the ARM development board configures a test parameter file based on the host data, the target host data and its queue depth, the storage device data, and the time data in the key features.
[0055] The host data and the storage device data of the key features each include data itself, command execution time, rate mode, UPIU data packet, and data buffer; the test parameter file includes test time, instruction list, and instruction sequence. The test parameter file can be in a json file type.
[0056] In a specific application scenario, preset data can also be inserted in the test parameter file; the preset data includes one or more of power-off data, pressure deviation data, delay data, random command data, reset data, and SSU (Start Stop Unit). That is, in the process of simulating the test host, preset data can be inserted based on needs to trigger specific test behaviors and meet corresponding test requirements. The preset data insertion can be timed insertion, random insertion, or no insertion. The actual needs are specifically set.
[0057] The test parameter file can be configured by using a behavior sequence csv file that can be recognized by a built-in program of the storage device. If the corresponding storage device can recognize other types of behavior sequences, other types of files can also be used to configure the test parameter file. This is not limited.
[0058] In a specific application scenario, if the capacities of the target storage device and the storage device to be tested are different, the capacity ratio between the target storage device and the storage device to be tested is calculated; the address information and the size of the test parameter file are determined based on the capacity ratio, and the data content of the test parameter file is configured based on the key features to obtain the test parameter file. For example, if the target storage device is 128G and the storage device to be tested is 64G, a mismatch may occur when the test parameter file is configured based on the interaction data, so the address information and the size of the test parameter file are adjusted based on the capacity ratio between the target storage device and the storage device to be tested, so that the test parameter file matches the 64G storage device.
[0059] When the size of the test parameter file is configured, the key features can also be simplified by using a data buffer to avoid large file parsing and facilitate data verification, thereby improving the test parameter file configuration efficiency.
[0060] In a specific application scenario, the address information and the size of the test parameter file can also be adjusted when the test parameter file is run.
[0061] Step S24: The test parameter file is run by the test device to simulate the test behavior of the test host, and the plurality of storage devices to be tested are tested respectively.
[0062] In a specific application scenario, the ARM development board initializes the test parameters and the test parameter file, starts the event trigger control process and the instruction sending process, parses and constructs the instructions in the instruction list in the test parameter file in the order of the instructions in the instruction list line by line, and then delivers the instructions to the instruction sending process. The sending process simulates the test host to send synchronous or asynchronous commands to the storage device to be tested and processes the response results returned by the storage device. The response results include data buffer for data verification.
[0063] Finally, after the test is completed, the test process data is analyzed, the execution time of each behavior and the delay distribution of the command are checked to determine the performance of this execution, and the command information, health information and disk logical state of a period of time before and after the command with high delay are given. The above data is obtained from the ARM development board, so that the developer can analyze and optimize the performance according to the provided information; the write amplification is checked, the interval time distribution of the command, the data length distribution and the expected TBW (Terabytes Written) value are given to provide a basis for life optimization; the chip running state and the command response state are checked, the test results are summarized and the test report is output.
[0064] In a specific application scenario, the specific process of running the test parameter file is as follows: obtaining current row data from the test parameter file; in response to the current row data including target host data, determining whether the number of target data to be processed in the instruction list exceeds a preset value; when the number of target data to be processed does not exceed the preset value, adding the current row data into the instruction list; when the number of target data to be processed exceeds the preset value, waiting for the number of target data to be processed in the instruction list to drop below the preset value, and then adding the current row data into the instruction list; since the number of target data to be processed in the instruction list has a preset upper limit, only when the number of target data to be processed in the instruction list is below the preset value, the target data to be processed of the current row data is added into the instruction list. When the response data corresponding to the target data to be processed in the instruction list is received, the target data to be processed is completed and is removed from the instruction list.
[0065] Based on the order of the instructions in the instruction list, the plurality of instructions in the instruction list are constructed in sequence, and the test host is simulated to send instructions to the corresponding storage device and process the returned response results for testing.
[0066] Through the above steps, the test method of the storage device of the embodiment can realize specific behavior replay stress testing by simulating the data of the test host, reduce the investment of the host terminal device, control the test variables and test injection, and accelerate the storage device problem analysis and verification process; improve the test efficiency of multiple storage devices, greatly reduce the number of test hosts required in the batch testing process of multiple storage devices, reduce the investment cost of real machine devices, and through comparative analysis of command response and behavior replay time, analyze performance bottlenecks, optimize storage device performance, and improve user experience; by collecting and establishing a behavior simulation model, analyzing the write amplification of common scenarios, and optimizing the service life of the storage device.
[0067] Please refer to Figure 3 , Figure 3 is a flowchart of an embodiment of the test parameter file configuration of the present application. Specifically, it includes the following steps:
[0068] Step S301: Obtain the Trace file of the interaction between the test host and the target storage device.
[0069] The type of the storage device in this embodiment is a UFS (Universal Flash Storage) storage chip. The storage device is taken as an example to illustrate the support of the UFCS (Universal Fast Charging Specification) protocol. When the type and protocol of the storage device are of other types, the test idea is similar to this embodiment, and will not be described in detail.
[0070] The interaction data can be stored in the form of a Trace file. The acquisition method of the Trace file can be referred to the aforementioned step S21, which will not be described here.
[0071] In a specific application scenario, the ARM development board opens the Trace file through the file path of the Trace file, obtains the current line data in the Trace file in sequence, and parses the entire Trace file line by line.
[0072] Step S302: Obtain the current line data.
[0073] Obtain the Trace line data from the Trace file.
[0074] Step S303: Obtain the execution time of the current line data and the host data or the storage device data.
[0075] A line of data can be host data or storage device data, and the execution time of the line data is further obtained.
[0076] Step S304: judging whether the host data or the storage device data of the current row data is valid data.
[0077] The valid data is the data conforming to the UFCS protocol of the storage device. If the host data or the storage device data of the current row data is valid data, step S305 is executed, otherwise, step S313 is executed.
[0078] Step S305: obtaining the power state of the current row data.
[0079] The power state contains the rate mode of the current row data and the power data in working time. The power data includes working state and idle state. The data in the power state is needed for simulation of the configuration parameter file.
[0080] Step S306: judging whether the current row data is the first row data.
[0081] The first row data is the row data of the first row of the Trace file. If the current row data is the first row data, step S307 is executed, otherwise, step S308 is executed.
[0082] Step S307: taking the execution time of the current row data as the time reference of the key feature to obtain the time data.
[0083] Step S308: taking the difference between the execution time of the current row data and the execution time of the last row data as the time interval of the current row data to obtain the time data.
[0084] Step S309: judging whether the host data of the current row data is UPIU CMD.
[0085] The simulation of the UPIU CMD command needs to set the queue depth, while other data does not need the queue depth. Therefore, it is judged whether the host data is UPIU CMD. If the host data of the current row data is UPIU CMD, step S310 is executed, otherwise, step S311 is executed.
[0086] Step S310: setting the queue depth of the target host data based on the completion state of the target host data.
[0087] When the target host data is in the uncompleted state, i.e., the target host data has not received the corresponding response data, the corresponding queue depth is 1. When the target host data is in the completed state, i.e., the target host data has received the corresponding response data, the corresponding queue depth is 0.
[0088] Step S311: analyzing the current row data to obtain the analysis data.
[0089] The parsing process can be specifically: extracting the Packet column parameter of the current row data, and splitting the Packet column parameter into UPIU data packet and Data Buffer according to the UPIU format to obtain parsed data.
[0090] Step S312: configuring the test parameter of the current row data based on the host data or storage device data, time data, parsed data, and power state of the current row data.
[0091] In a specific application scenario, the index, time interval or time reference, power state, type of the current row data, UPIU Type, UPIU data packet, Data Buffer, and queue depth can be configured as the test parameter of the current row data.
[0092] Step S313: determining whether the Trace file is read completely.
[0093] If the reading is completed, step S314 is performed, and if the reading is not completed, step S302 is performed.
[0094] Step S314: obtaining the test parameter file of the Trace file.
[0095] After the row data is read completely, the test parameter file of the Trace file is obtained, and the test parameter file can be stored in a csv file.
[0096] Please refer to Figure 4 , Figure 4 is a flowchart of an embodiment of the application for running the test parameter file.
[0097] Step S401: obtaining the test parameter file.
[0098] Loading the json test parameter to initialize the test parameter.
[0099] Step S402: obtaining the current row data.
[0100] Step S403: determining whether the current row data is UPIU.
[0101] Since the UPIU command needs to be adjusted in capacity, it is determined separately.
[0102] If yes, step S404 is performed, and if no, step S405 is performed.
[0103] Step S404: extracting the UPIU data packet, processing the UPIU based on the capacity ratio, and constructing the Data Buffer.
[0104] Step S405: adding the current row data to the instruction list.
[0105] In response to the current row data including target host data, it is judged whether the number of target data to be processed in the instruction list exceeds a preset value; when the number of target data to be processed does not exceed the preset value, the current row data is added to the instruction list; when the number of target data to be processed exceeds the preset value, the current row data is added to the instruction list after the number of target data to be processed in the instruction list falls below the preset value. The preset value is set based on actual needs and can be 8, 10, 15, 20, etc., which is not limited here.
[0106] In response to the current row data not including target host data, the current row data is directly added to the instruction list.
[0107] Step S406: It is judged whether a random event needs to be created.
[0108] The random event includes but is not limited to one or more of power-off, voltage deviation, delay, random command, reset, and SSU, which is set based on actual needs.
[0109] When the random event needs to be created, step S407 is executed; when the random event does not need to be created, step S408 is executed.
[0110] Step S407: The preset data of the random event is inserted into the instruction list.
[0111] The insertion can be random insertion or sequential insertion, which is set based on actual needs.
[0112] Step S408: The instruction list is generated.
[0113] Step S409: It is judged whether the test parameter file is read completely.
[0114] If yes, step S4010 is executed; if no, step S402 is executed.
[0115] Step S410: The instruction data in the instruction list is run in sequence to perform the test.
[0116] The execution time of each instruction data and the delay distribution of the instruction data are recorded to judge the performance of this execution and to provide the command information, health information and disk logical state of a period of time before and after the command with high delay, the above data being obtained from the ARM development board, so that the developer can analyze and optimize the performance according to the provided information; the write amplification is checked to provide the interval time distribution of the command, the data length distribution, and the expected TBW value, which provides the basis for life optimization; the chip running state and the command response state are checked, the test results are summarized and the test report is output.
[0117] Through the above steps, the test method of the storage device of the embodiment can realize specific behavior replay stress testing by simulating the data of the test host, reduce the investment of the host terminal device, control the test variables and test injection, accelerate the storage device problem analysis and verification process, improve the test efficiency of multiple storage devices, greatly reduce the number of test hosts required in the batch testing process of multiple storage devices, reduce the investment cost of real machine devices, and through the comparison and analysis of the command response and behavior replay time, analyze the performance bottleneck, optimize the storage device performance, and improve the user experience. Through the collection and establishment of the behavior simulation model, the write amplification in common scene use is analyzed, and the storage device life is optimized.
[0118] Please refer to Figure 5 , Figure 5 is a frame schematic diagram of an embodiment of the electronic device. The electronic device 500 includes a memory 501 and a processor 502 coupled to each other. The processor 502 is configured to execute program instructions stored in the memory 501 to implement the steps of the above method embodiments. In a specific implementation scenario, the electronic device 500 can include but is not limited to a microcomputer, a server, and in addition, the electronic device 500 can also include a notebook computer, a tablet computer, a solid state disk, a memory card, a Nand Flash, etc., which are not limited herein.
[0119] Specifically, the processor 502 is configured to control itself and the memory 501 to implement the steps of any of the above method embodiments. The processor 502 can also be referred to as a CPU (Central Processing Unit, central processing unit). The processor 502 can be an integrated circuit chip with a processing capability of signals. The processor 502 can also be a general-purpose processor, a DSP (Digital Signal Processor, digital signal processor), an ASIC (Application Specific Integrated Circuit, application specific integrated circuit), an FPGA (Field-Programmable Gate Array, field programmable gate array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor or the like. In addition, the processor 502 can be jointly implemented by integrated circuit chips.
[0120] The above scheme can improve the test efficiency of multiple storage devices and greatly reduce the cost investment of the test host.
[0121] Please refer to Figure 6 , Figure 6A schematic diagram of a framework of an embodiment of the computer readable storage medium of the present application is shown. The computer readable storage medium 600 stores program instructions 601 capable of being executed by a processor, which are used to implement the steps of any of the method embodiments described above.
[0122] In several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic, and the division of the modules or units is only a logical function division, and actual implementation can have another division manner, for example, the units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0123] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., they can be located in one place or distributed on network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the present embodiment.
[0124] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0125] If the integrated unit is realized in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for making a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor execute all or part of the steps of the methods of the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0126] The above merely describes the embodiments of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent process transformation made by using the content of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for testing a storage device, characterized in that: The storage device testing method comprises: Acquiring data of interaction between a test host and a target storage device; The test behavior of the test host is simulated based on the data to test the plurality of storage devices to be tested respectively.
2. The storage device testing method according to claim 1, wherein: The step of simulating the test behavior of the test host based on the data to test the plurality of storage devices to be tested respectively includes: Analyzing the data to obtain key features of the data; Configuring a test parameter file based on the key features; The test parameter file is run by a test device to simulate the test behavior of the test host and test multiple storage devices to be tested respectively.
3. The storage device testing method according to claim 2, wherein: The step of parsing the data to obtain key features of the data includes: Parsing the data to obtain host data, storage device data, and time data of the interaction between the test host and the storage device; In response to the host data being target host data, setting a queue depth of the target host data based on a completion status of the target host data; Key features of the data are obtained based on the host data, target host data and queue depth thereof, storage device data, and time data.
4. The storage device testing method according to claim 3, wherein: The data includes a plurality of row data; The step of parsing the data to obtain host data, storage device data, and time data of the interaction between the test host and the storage device includes: Acquire current row data, and acquire host data or storage device data of the current row data from the current row data; In response to the host data or storage device data of the current row of data being valid data, determining whether the current row of data is the first row of data; If it is the first row of data, the execution time of the current row of data is used as the time reference of the key feature; If it is not the first row of data, the difference between the execution time of the current row of data and the execution time of the previous row of data is used as the time interval of the current row of data; Using a time base or a time interval as the time data of the current row data; Obtain the next row of data, use the next row of data as the new current row of data, and again perform the step of obtaining the host data or storage device data of the current row of data from the current row of data, until the host data, storage device data, and time data of all row data are obtained to obtain the key features of the data.
5. The method for testing a storage device according to claim 2, wherein: The step of configuring the test parameter file based on the key features further includes: Inserting preset data into the test parameter file; The preset data includes one or more of power-off data, voltage bias data, delay data, random command data, reset data, and SSU.
6. The method for testing a storage device according to claim 2, wherein: The host data and storage device data of the key features include command execution time, rate mode, UPIU data packet and data cache; The test parameter file includes test time, instruction list, and instruction sequence.
7. The storage device testing method according to claim 6, wherein: The step of using the test device to run the test parameter file to simulate the test behavior of the test host and test the multiple storage devices to be tested respectively includes: Get the current row data from the test parameter file; In response to the current row of data being target host data, determining whether the amount of target data to be processed in the instruction list exceeds a preset value; When the amount of the target data to be processed does not exceed the preset value, the current row of data is added to the instruction list; when the amount of the target data to be processed exceeds the preset value, the current row of data is added to the instruction list after the amount of the target data to be processed in the instruction list drops below the preset value; Based on the instruction sequence in the instruction list, multiple instructions in the instruction list are constructed in sequence, and the test host is simulated in sequence to send instructions to the corresponding storage device and process the returned response results to perform testing.
8. The storage device testing method according to any one of claims 2 to 7, wherein: The step of configuring the test parameter file based on the key features further includes: Calculating a capacity ratio between the target storage device and the storage device to be tested; The address information and size of the test parameter file are determined based on the capacity ratio, and the data content of the test parameter file is configured based on the key characteristics to obtain the test parameter file.
9. The method for testing a storage device according to claim 1, wherein: The step of obtaining data exchanged between the test host and the target storage device includes: Constructing data for interaction between the test host and the target storage device based on standard data; or Collecting data on interactions between the test host and the target storage device from a log file of the test host; or The test host is connected to a protocol analyzer, and the data interacting between the test host and the target storage device is recorded by the protocol analyzer.
10. An electronic device, characterized in that: The device comprises a memory and a processor coupled to each other, wherein the processor is configured to execute program instructions stored in the memory to implement the storage device testing method according to any one of claims 1 to 9.
11. A computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the storage device testing method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Test method, test device and test system for storage device
CN112579371A
Firmware testing method, server and computer readable storage medium
CN113127338A
Data analysis method and device of hard disk, electronic equipment and storage medium
CN115525499A
Performance test method and device, electronic equipment and readable storage medium
CN115695227A
Communication terminal test device
JP2000341386A