System testing method for UFS devices and test host, equipment and media

In the system testing of UFS devices, the queue depth of the operation command is adjusted according to the number of responses, and the problem of the long test cycle of UFS devices is solved, and a more efficient testing process is achieved.

CN120199314BActive Publication Date: 2025-08-08ARTMEM TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510623667.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-15
Publication Date
2025-08-08
Estimated Expiration
2045-05-15

AI Technical Summary

Technical Problem

In the prior art, the system testing cycle of UFS devices is too long because the test host does not match the command queue depth of the UFS device, resulting in the UFS device processing capability not being fully utilized or the command queue accumulation.

Method used

By generating a number of different types of operation commands, determining the first queue depth according to the preset command sending mode, sending it asynchronously to the UFS device for processing, and adjusting the second queue depth according to the number of responses until all commands are executed.

Benefits of technology

It shortens the system test cycle of UFS devices, improves testing efficiency, and makes full use of the command processing capabilities of UFS devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120199314B_ABST
    Figure CN120199314B_ABST
Patent Text Reader

Abstract

The present application discloses a system testing method for a UFS device, as well as a test host, device, and medium, relating to the field of UFS testing technology. The method includes: generating multiple different types of operation commands; determining a first queue depth according to a preset command sending mode, asynchronously sending operation commands of the first queue depth to the UFS device, so that the UFS device processes the operation commands in queue order and returns a response for each completed operation command; receiving the response returned by the UFS device; determining a second queue depth according to the preset command sending mode and counting the number of response responses; sending operation commands of the second queue depth to the UFS device, and continuing to cause the UFS device to process the operation commands in queue order until all operation commands are sent and executed, thereby completing the system test of the UFS device. This method can shorten the test cycle of the system test of the UFS device and improve test efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of UFS testing technology, and in particular to a system testing method for UFS devices, and a testing host, device, and medium. Background Art

[0002] Universal Flash Storage (UFS), a common storage device, is widely used in various electronic devices. System testing is a key step in ensuring the reliability and stability of UFS devices. During system testing of UFS devices, the test host sends various operations and commands to the UFS device, causing it to execute the operations and commands for testing. Based on the test results, defects in the UFS device can be quickly identified and located.

[0003] UFS devices typically support a command queue mechanism. The maximum queue depth of a UFS device refers to the maximum number of commands it can simultaneously receive and process. Under this command queue mechanism, the test host can queue multiple asynchronous commands, and the UFS device will process them sequentially. During system testing, different hardware test hosts may have different test behaviors for UFS devices and support different command queue depths. Some test hosts may send commands at a pace that is mismatched with the processing capabilities of the UFS device. If the command queue depth supported by the test host is far less than the maximum queue depth of the UFS device, the UFS device's processing power is underutilized, resulting in idle UFS devices and prolonged testing cycles. On the other hand, if the command queue depth supported by the test host is far greater than the UFS device's command queue depth, the UFS device's command queue will fill up, forcing extra commands to wait for the queue to become free, leading to a command backlog and further prolonged testing cycles. Therefore, shortening the system testing cycle for UFS devices is a pressing technical issue. Summary of the Invention

[0004] This application aims to solve at least one of the technical problems existing in the prior art. To this end, this application proposes a system testing method for UFS devices, as well as a test host, device, and medium. The method can adjust the queue depth of the next operation command to be sent based on the command processing status of the UFS device, thereby fully utilizing the command processing capability of the UFS device, shortening the test cycle for the system testing of the UFS device, and improving test efficiency.

[0005] In a first aspect, an embodiment of the present application provides a system testing method for a UFS device, which is applied to a test host electrically connected to the UFS device. The system testing method includes:

[0006] Generate multiple different types of operation commands;

[0007] determining a first queue depth according to a preset command sending mode, and asynchronously sending the operation commands of the first queue depth to the UFS device, so that the UFS device stores the operation commands in the form of a command queue and processes the operation commands in queue order, and returns a response each time an operation command is completed; wherein the preset command sending mode includes: a fixed depth mode and a random depth mode;

[0008] Receive a response returned by the UFS device;

[0009] Determining a second queue depth of the operation command to be sent next time according to the preset command sending mode and the number of the received acknowledgement responses;

[0010] The operation commands of the second queue depth are sent to the UFS device, and the UFS device continues to store the operation commands in the form of a command queue and processes the operation commands in queue order until all the operation commands are sent and executed, thereby completing the system test of the UFS device.

[0011] According to some embodiments of the present application, when the preset command sending mode is a random depth mode, determining the first queue depth according to the preset command sending mode includes:

[0012] Obtaining a maximum command queue depth of the UFS device according to the random depth mode;

[0013] The maximum command queue depth is determined as the first queue depth.

[0014] According to some embodiments of the present application, when the preset command sending mode is: random depth mode; determining the second queue depth of the operation command to be sent next time according to the preset command sending mode and the number of the received response statistics includes:

[0015] Randomly generate a delay time within a preset time range according to the random depth mode;

[0016] Counting the number of the response messages returned by the UFS device within the delay time;

[0017] The number of the acknowledgement responses received within the delay time is determined as the second queue depth.

[0018] According to some embodiments of the present application, when the preset command sending mode is a fixed depth mode, determining the first queue depth according to the preset command sending mode includes:

[0019] According to the fixed depth mode, obtaining a preset fixed depth; the fixed depth is less than or equal to the maximum command queue depth of the UFS device;

[0020] The fixed depth is determined as the first queue depth.

[0021] According to some embodiments of the present application, when the preset command sending mode is: fixed depth mode; determining the second queue depth of the operation command to be sent next time according to the preset command sending mode and the number of the received response statistics includes:

[0022] According to the fixed depth mode, instantly counting the number of the response returned by the UFS device each time;

[0023] The number of the response responses returned by the UFS device obtained by real-time statistics is determined as a second queue depth; wherein, in the fixed depth mode, the second queue depth is less than or equal to the fixed depth.

[0024] According to some embodiments of the present application, generating multiple different types of operation commands includes:

[0025] Generate logical address, block size, and random number in the range of 0 to 100%;

[0026] Determine a corresponding operation type according to the numerical range of the random number; wherein the operation type includes: read operation, write operation, and erase operation;

[0027] Performing command generation processing according to the logical address, the block size, and the operation type to obtain the operation command; the type of the operation command is determined by the operation type;

[0028] The command generation process is repeated multiple times to obtain multiple operation commands; wherein the operation commands include: a read command, a write command, and an erase command.

[0029] According to some embodiments of the present application, determining the corresponding operation type according to the numerical interval in which the random number is located includes:

[0030] When the random number is greater than or equal to 0 and less than a first threshold, determining that the operation type is a read operation;

[0031] When the random number is greater than or equal to the first threshold and less than a second threshold, determining that the operation type is a write operation; wherein the second threshold is greater than the first threshold;

[0032] When the random number is greater than or equal to the second threshold and less than or equal to 100%, it is determined that the operation type is an erase operation.

[0033] In a second aspect, an embodiment of the present application provides a system testing apparatus for a UFS device, comprising:

[0034] A command generation module is used to generate multiple different types of operation commands;

[0035] a first command sending module, configured to determine a first queue depth according to a preset command sending mode, and asynchronously send the operation commands of the first queue depth to the UFS device, so that the UFS device stores the operation commands in the form of a command queue and processes the operation commands in queue order, and returns a response each time an operation command is completed; wherein the preset command sending mode includes: a fixed depth mode and a random depth mode;

[0036] A response receiving module, configured to receive a response returned by the UFS device;

[0037] a depth adjustment module, configured to determine a second queue depth of the operation command to be sent next time according to the preset command sending mode and the number of the received response statistics;

[0038] The second command sending module is used to send the operation commands of the second queue depth to the UFS device, continue to store the operation commands in the form of a command queue and process the operation commands in queue order until all the operation commands are sent and executed, thereby completing the system test of the UFS device.

[0039] In a third aspect, an embodiment of the present application provides an electronic device, comprising: at least one processor and a memory for communicating with the at least one processor; the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the system testing method for the UFS device as described in any one of the embodiments of the first aspect.

[0040] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to implement the system testing method for a UFS device as described in the first aspect when executed by a processor.

[0041] An embodiment of the present application includes: first, generating a plurality of different types of operation commands during a system test of a UFS device using a test host; second, determining a first queue depth according to a preset command sending mode, and asynchronously sending the operation commands of the first queue depth to the UFS device, so that the UFS device stores the operation commands in the form of a command queue, processes the operation commands in queue order, and returns a response for each completed operation command; wherein the preset command sending mode includes: a fixed depth mode and a random depth mode; then, receiving a response returned by the UFS device; then, determining a second queue depth for the next operation command to be sent according to the preset command sending mode and a counted number of received response responses; the counted number of received response responses reflects the current command processing status of the UFS device and provides a reliable reference for determining the second queue depth; finally, sending the operation commands of the second queue depth to the UFS device, so that the UFS device continues to store the operation commands in the form of a command queue and processes the operation commands in queue order; until all operation commands are sent and executed, thereby completing the system test of the UFS device. This fully utilizes the command processing capability of the current UFS device, shortens the test cycle of the UFS device system test, and improves test efficiency. That is, the embodiment of the present application can adjust the queue depth of the next operation command to be sent according to the command processing status of the UFS device, thereby fully utilizing the command processing capability of the UFS device, shortening the test cycle of the system test of the UFS device, and improving the test efficiency.

[0042] Other features and advantages of the present application will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained through the structures particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 This is a functional module diagram of a test host provided by an embodiment of the present application;

[0044] Figure 2 This is a schematic diagram of the connection between a test host and a UFS device provided by an embodiment of the present application;

[0045] Figure 3 This is a flowchart of a method for systematically testing a UFS device according to an embodiment of the present application;

[0046] Figure 4 This is a schematic diagram of the hardware structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solutions and advantages of this application more clear, this application is further described in detail below with reference to the accompanying drawings and embodiments.

[0048] It should be understood that in the description of this application, descriptions of orientations, such as up, down, front, back, left, right, etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings. They are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, they cannot be understood as limitations on this application.

[0049] It should be noted that although a logical order is shown in the flowchart in the description of this application, in some cases, the steps shown or described may be performed in an order different from that in the flowchart. In the description of this application, "several" means one or more, and "more" means two or more. The description of "first" and "second" is only used to distinguish technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.

[0050] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0051] The present application provides a system testing method for a UFS device, as well as a test host, an electronic device, and a computer-readable storage medium, relating to the field of UFS testing technology. The method includes: generating multiple different types of operation commands; determining a first queue depth according to a preset command sending mode, asynchronously sending operation commands of the first queue depth to the UFS device, so that the UFS device processes the operation commands in queue order and returns a response for each completed operation command; receiving the response returned by the UFS device; determining a second queue depth according to the preset command sending mode and counting the number of response responses; sending operation commands of the second queue depth to the UFS device, and continuing to cause the UFS device to process the operation commands in queue order until all operation commands are sent and executed, thereby completing the system test of the UFS device. This can shorten the test cycle for system testing of UFS devices and improve test efficiency.

[0052] The embodiments of the present application are further described below with reference to the accompanying drawings.

[0053] like Figure 1 As shown, Figure 11 is a functional module diagram of a test host provided by an embodiment of the present application. The test host 100 includes: a command generation module 110, a first command sending module 120, a response receiving module 130, a depth adjustment module 140 and a second command sending module 150.

[0054] Specifically, the command generation module 110 is used to generate multiple operation commands of different types.

[0055] Specifically, the first command sending module 120 is used to determine the first queue depth according to a preset command sending mode, and asynchronously send operation commands of the first queue depth to the UFS device, so that the UFS device stores the operation commands in the form of a command queue and processes the operation commands in queue order, and returns a response each time an operation command is completed; wherein the preset command sending mode includes: fixed depth mode and random depth mode.

[0056] Specifically, the response receiving module 130 is configured to receive a response returned by the UFS device.

[0057] Specifically, the depth adjustment module 140 is configured to determine the second queue depth of the operation command to be sent next time according to a preset command sending mode and the number of received acknowledge responses that are counted.

[0058] Specifically, the second command sending module 150 is used to send operation commands of the second queue depth to the UFS device, continue to enable the UFS device to store the operation commands in the form of a command queue and process the operation commands in queue order until all operation commands are sent and executed, thereby completing the system test of the UFS device.

[0059] It is understandable that in actual application, multiple threads will be created, and each thread is used to implement the functions of a corresponding module.

[0060] The test host 100 provided in the embodiment of the present application can adjust the queue depth of the next operation command to be sent according to the command processing status of the UFS device through the mutual cooperation between the command generation module 110, the first command sending module 120, the response receiving module 130, the depth adjustment module 140, and the second command sending module 150, thereby fully utilizing the command processing capability of the UFS device, shortening the test cycle of the UFS device system test, and improving test efficiency.

[0061] like Figure 2As shown, the test host 100 is electrically connected to the UFS device 200, the host computer 300, and the power supply module 400, respectively. Specifically, it is connected to the host computer 300 via a USB cable, so that the test case executable program is burned from the host computer 300 to the test host 100, so as to run the test case and complete the system test of the UFS device 200. A 5V voltage is provided to the test host through the power supply module 400 so that the test host 100 can start working. The actual test host 100 is also provided with a serial port board to provide serial port printing. Specifically, the host computer 300 is a PC device. The test host 100 is specifically a test board, or an electronic device equipped with a test board; this application does not impose specific restrictions on the model of the test board.

[0062] Those skilled in the art will understand that the system structure shown in the figure does not constitute a limitation on the embodiments of the present application, and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.

[0063] The system embodiment described above is merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.

[0064] Those skilled in the art will understand that the system architecture and application scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will know that with the evolution of the system architecture and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0065] Based on the above system structure, various embodiments of the system testing method for UFS devices of the present application are proposed below.

[0066] First, the system testing method for UFS devices can be applied to Figure 2 In the test host shown, the test host is electrically connected to the UFS device; Figure 3 As shown, the system testing method for the UFS device may include but is not limited to steps S110 to S140.

[0067] Step S110: Generate multiple operation commands of different types.

[0068] Step S120: Determine a first queue depth according to a preset command sending mode, and asynchronously send operation commands of the first queue depth to the UFS device, so that the UFS device stores the operation commands in the form of a command queue and processes the operation commands in queue order, and returns a response each time an operation command is completed; wherein the preset command sending mode includes: fixed depth mode and random depth mode.

[0069] Step S130: Receive a response returned by the UFS device.

[0070] Step S140: determining a second queue depth for the next operation command to be sent according to the preset command sending mode and the number of received acknowledgement responses.

[0071] Step S150: Send the operation commands of the second queue depth to the UFS device, continue to store the operation commands in the form of a command queue and process the operation commands in queue order until all operation commands are sent and executed, completing the system test of the UFS device.

[0072] Specifically, the first queue depth refers to a first number of operation commands sent by the test mainboard to the UFS device.

[0073] Specifically, the second queue depth refers to a second number of operation commands sent by the test mainboard to the UFS device.

[0074] Specifically, the preset command sending mode includes two different modes: fixed depth mode and random depth mode, which define the situation where the UFS device receives operation commands sent by the test host. In fixed depth mode, the depth of the command queue to be processed in the UFS device is fixed; in random depth mode, the depth of the command queue to be processed in the UFS device varies.

[0075] Through steps S110 to S140, in the process of using the test host to perform system testing on the UFS device, first, multiple different types of operation commands are generated; second, a first queue depth is determined according to a preset command sending mode, and the operation commands of the first queue depth are asynchronously sent to the UFS device, so that the UFS device stores the operation commands in the form of a command queue and processes the operation commands in queue order, and returns a response each time an operation command is completed; wherein the preset command sending mode includes: fixed depth mode and random depth mode; then, a response returned by the UFS device is received; and then, according to the preset command sending mode and the statistical The number of received response responses is used to determine the second queue depth of the operation command to be sent next; the number of received response responses statistically reflects the command processing status of the current UFS device, providing a reliable reference for determining the second queue depth; finally, the operation command of the second queue depth is sent to the UFS device, and the UFS device continues to store the operation commands in the form of a command queue and process the operation commands in queue order; until all operation commands are sent and executed, the system test of the UFS device is completed; the command processing capability of the current UFS device can be fully utilized, the test cycle of the system test of the UFS device can be shortened, and the test efficiency can be improved. In other words, the embodiment of the present application can adjust the queue depth of the operation command to be sent next according to the command processing status of the UFS device, thereby fully utilizing the command processing capability of the UFS device, shortening the test cycle of the system test of the UFS device, and improving the test efficiency.

[0076] According to some embodiments of the present application, step S110 is further described. Step S110: generating multiple different types of operation commands, including but not limited to steps S111 to S114.

[0077] Step S111: Generate a logical address, a block size, and a random number with a value in the range of 0 to 100%.

[0078] Step S112: Determine the corresponding operation type according to the numerical range of the random number; wherein the operation type includes: read operation, write operation, and erase operation.

[0079] Step S113: Perform command generation processing according to the logical address, block size, and operation type to obtain an operation command; the type of the operation command is determined by the operation type.

[0080] Step S114: Repeat the command generation process multiple times to obtain multiple operation commands; wherein the operation commands include: read command, write command, and erase command.

[0081] Specifically, step S111 is further described. There are two ways to generate logical addresses: one is to randomly generate a logical address within a specified address range; the other is to generate a logical address using a random function within a range determined by the capacity length of the entire UFS device. The block size can be specified in pre-configured information or randomly generated within the range of 1 to 128.

[0082] According to some embodiments of the present application, step S112 is further described. Step S112: Based on the numerical range of the random number, the corresponding operation type is determined, including but not limited to: when the random number is greater than or equal to 0 and less than a first threshold, the operation type is determined to be a read operation; when the random number is greater than or equal to the first threshold and less than a second threshold, the operation type is determined to be a write operation; wherein the second threshold is greater than the first threshold; when the random number is greater than or equal to the second threshold and less than or equal to 100%, the operation type is determined to be an erase operation. The operation type is determined by the range in which the random number is located to indicate the type of operation command to be generated.

[0083] An example is given to illustrate the specific process of determining the operation type based on a random number.

[0084] Example 1: Determine the first threshold and the second threshold based on the proportion of commands in a preset order (read, write, erase); wherein the first threshold is equal to the incoming percentage of write operations, and the second threshold is equal to the sum of the incoming percentage of write operations and the incoming percentage of write operations; that is, when the proportion of commands in the preset order is: 50% for read operations, 30% for write operations, and 20% for erase operations; then the pre-configured first threshold is 50% and the second threshold is 80%; and then determine the numerical interval based on the first threshold and the second threshold. Specifically, the numerical interval includes: a first interval [0, 50%) determined by 0 and the first threshold; a second interval [50%, 80%) determined by the first threshold and the second threshold; and a third interval [80%, 100%) determined by the second threshold and 100%. A random number is generated within the range of 0 to 100%. If the random number is 40%, 40% falls within the first interval, and the operation type of the operation command to be generated is determined to be a read operation. If the random number is 50%, 50% falls within the second interval, and the operation type of the operation command to be generated is determined to be a write operation. If the random number is 80%, 80% falls within the third interval, and the operation type of the operation command to be generated is determined to be an erase operation.

[0085] It can be understood that the proportion of commands in the preset order (read, write, erase) can be adjusted, and the first threshold and the second threshold can also be adjusted. Therefore, this application does not impose specific restrictions on the proportion of commands in the preset order (read, write, erase), the first threshold and the second threshold.

[0086] Through steps S111 to S114 , a plurality of different types of operation commands are generated based on the logical address, block size, and random number, providing a basis for subsequent system testing of the UFS device.

[0087] After step S110 and before step S120, the system testing method for a UFS device according to an embodiment of the present application further includes: determining the type of the preset command transmission mode based on the input mode selection parameter. Specifically, when the mode selection parameter is 0, the preset command transmission mode is determined to be the random depth mode; when the mode selection parameter is a non-zero positive number, the preset command transmission mode is determined to be the fixed depth mode.

[0088] According to some embodiments of the present application, step S120 is further described. When the preset command sending mode is: random depth mode; step S120: determining the first queue depth according to the preset command sending mode includes but is not limited to steps S210 to S220.

[0089] Step S210: Obtain the maximum command queue depth of the UFS device according to the random depth mode.

[0090] Step S220: Determine the maximum command queue depth as the first queue depth.

[0091] Specifically, in step S210 , the test host obtains the maximum command queue depth of the UFS device, where the maximum command queue depth refers to the maximum number of commands that the UFS device can simultaneously receive and process.

[0092] Through steps S210 to S220 , the maximum command queue depth of the UFS device is determined as the first queue depth, which provides a reference for the test host to initially send an operation command.

[0093] According to some embodiments of the present application, step S130 is further explained. When the preset command sending mode is: random depth mode; step S130: according to the preset command sending mode and the statistical number of received response responses, determine the second queue depth of the operation command to be sent next time, including but not limited to steps S230 to S250.

[0094] Step S230: randomly generating a delay time within a preset time range according to the random depth mode.

[0095] Step S240: Counting the number of responses returned by the UFS device within the delay time.

[0096] Step S250: Determine the number of acknowledge responses received within the delay time as the second queue depth.

[0097] It can be understood that in random depth mode, the test host randomly generates a delay time and starts timing after sending an operation command of the first queue depth to the UFS device; the number of response responses returned by the UFS device received during the delay time is counted, and the number of response responses received reflects the command processing status of the current UFS device, and indicates that the current UFS device still has spare capacity to process new operation instructions, thereby determining the number of response responses received during the delay time as the second queue depth.

[0098] In the embodiment of the present application, through steps S230 to S250, in the random depth mode, the second queue depth of the next operation instruction to be sent is adjusted according to the number of response responses received within the random delay time; so as to facilitate the subsequent sending of operation commands with the second queue depth to the UFS device, thereby fully utilizing the command processing capability of the current UFS device, which is conducive to shortening the test cycle of the system test of the UFS device and improving the test efficiency.

[0099] It can be understood that the embodiment of the present application implements an asynchronous command processing mechanism based on the random depth mode through steps S210, S220, S230, S240, S250 and S150; under the asynchronous command processing mechanism based on the random depth mode, system testing of the UFS device can fully utilize the command processing capabilities of the current UFS device, which is conducive to shortening the test cycle of the system testing of the UFS device and improving the test efficiency.

[0100] An example is given to illustrate the specific processing flow of the asynchronous command processing mechanism based on the random depth mode provided in the embodiment of the present application.

[0101] Example 2: When the maximum command queue depth of the UFS device is 32, the first queue depth is set equal to the maximum command queue depth of 32. The test host initially sends 32 operation commands to the UFS device. A randomly generated delay of 500ms is set within a preset time range. If 28 responses are received within 500ms, the second queue depth of the second pending operation commands is set to 28, and 28 operation commands are sent for the second time. A randomly generated delay of 400ms is set within a preset time range. If 25 responses are received within 400ms, the second queue depth of the third pending operation commands is set to 25, and 25 operation commands are sent for the third time. This process is repeated multiple times until the system test is complete. It should be understood that, except for the first command send, the second queue depth of the operation commands sent in each command send is equal to the number of responses received within the random delay period after the previous command send. This fully utilizes the command processing capabilities of the UFS device and shortens the test cycle.

[0102] According to some embodiments of the present application, step S120 is further described. When the preset command sending mode is: fixed depth mode; step S120: determining the first queue depth according to the preset command sending mode, including but not limited to steps S310 to S320.

[0103] Step S310: According to the fixed depth mode, a preset fixed depth is obtained; the fixed depth is less than or equal to the maximum command queue depth of the UFS device.

[0104] Step S320: Determine the fixed depth as the first queue depth.

[0105] It is understandable that the fixed depth is preset. As long as the fixed depth is less than or equal to the maximum command queue depth of the UFS device, this application does not impose any specific restrictions on the value of the fixed depth.

[0106] Through step S310 to step S320, the preset fixed depth is determined as the first queue depth, which provides a reference for the test host to initially send an operation command.

[0107] According to some embodiments of the present application, step S130 is further described. When the preset command sending mode is: fixed depth mode; step S130: according to the preset command sending mode and the statistical number of received response responses, determine the second queue depth of the operation command to be sent next time, including but not limited to steps S330 to S340.

[0108] Step S330: According to the fixed depth mode, the number of responses returned by the UFS device each time is immediately counted.

[0109] Step S340: Determine the number of responses returned by the UFS device obtained through real-time statistics as a second queue depth; wherein, in the fixed depth mode, the second queue depth is less than or equal to the fixed depth.

[0110] It can be understood that in the fixed depth mode, the number of response responses returned by the UFS device each time received and instantly counted by the test host reflects the command processing status of the current UFS device, indicating that the current UFS device still has spare capacity to process new operation instructions. The test host then responds immediately and determines the number of response responses returned by the UFS device obtained by instantly counting as the second queue depth.

[0111] Through steps S330 to S340, in the fixed-depth mode, based on the instantaneous response of the response returned by the UFS device, the number of response responses returned by the UFS device obtained by instant statistics is determined as the second queue depth; so that operation commands of the second queue depth can be subsequently sent to the UFS device, so that the depth of the command queue storing the pending operation commands in the UFS device is maintained at a fixed depth, so that the UFS device can efficiently and stably process the fixed-depth operation commands, fully utilize the command processing capability of the current UFS device, and help shorten the test cycle of the system test of the UFS device and improve the test efficiency.

[0112] It can be understood that the embodiment of the present application implements an asynchronous command processing mechanism based on a fixed depth mode through steps S310, S320, S330, S340, and S150. Under the asynchronous command processing mechanism based on a fixed depth mode, system testing of the UFS device can fully utilize the command processing capabilities of the current UFS device, which is conducive to shortening the test cycle of the system testing of the UFS device and improving the test efficiency.

[0113] An example is given to illustrate the specific processing flow of the asynchronous command processing mechanism based on the fixed depth mode provided in the embodiment of the present application.

[0114] Example 3: When the preset fixed depth parameter is 8, the first queue depth is equal to the fixed depth of 8. The test host initially sends 8 operation commands to the UFS device. When the test host receives a response, it immediately sends another operation command, ensuring that the total number of operation commands pending on the UFS device does not exceed 8 (i.e., less than or equal to 8). When the test host receives two responses, it immediately sends two operation commands, ensuring that the total number of operation commands pending on the UFS device does not exceed 8 (i.e., less than or equal to 8). In other words, as soon as a response is received from the UFS device, an operation command is immediately sent to the UFS device. This fully utilizes the command processing capabilities of the UFS device and shortens the test cycle.

[0115] As shown in Examples 2 and 3, the difference between the asynchronous command processing mechanism based on random depth mode and the asynchronous command processing mechanism based on fixed depth mode is that: in random depth mode, the number of received responses is counted within a random event range and the same number of operation instructions are sent; in fixed depth mode, the same number of operation instructions are sent immediately as soon as a response is received. In terms of the timing of sending operation instructions, random depth mode can also be understood as a random delay sending mode, and fixed depth mode can also be understood as an immediate response sending mode.

[0116] Further illustrating the system testing method for a UFS device provided in an embodiment of the present application, step S130: After receiving a response from the UFS device, the system testing method for the UFS device further includes: parsing the response to obtain execution status information. If the execution status information indicates successful execution, the response is determined to be normal and the operation command is successfully executed; if the execution status information indicates failed execution, the response is determined to be abnormal and the operation command is failed. If the operation command is a read operation, the original data written to the UFS device is compared with the read data read from the UFS device. If the data are consistent, the read is determined to be correct and the read operation is successful; if the data are inconsistent, the read is determined to be incorrect and the read operation is failed.

[0117] Further explanation of step S150. It is understood that the number of operation commands required to be issued by the test host and the specific content of the system test are determined by the program burned into the test host by the host computer. When all the operation commands required to be sent have been processed and the UFS device has completed execution, the system test is judged to be completed.

[0118] like Figure 4 As shown, the present application also provides an electronic device, including:

[0119] The processor 401 may be implemented as a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is configured to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.

[0120] The memory 402 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 402 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 402 and is called by the processor 401 to execute the system testing method for the UFS device in the embodiments of this application.

[0121] Input / output interface 403, used to implement information input and output;

[0122] Communication interface 404, used to implement communication interaction between the apparatus and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.);

[0123] Bus 405 , which transmits information between various components of the device (e.g., processor 401 , memory 402 , input / output interface 403 , and communication interface 404 );

[0124] The processor 401 , the memory 402 , the input / output interface 403 and the communication interface 404 are connected to each other in communication within the device via a bus 405 .

[0125] An embodiment of the present application further provides a storage medium, which is a computer-readable storage medium and stores a computer program. When the computer program is executed by a processor, the above-mentioned system testing method for a UFS device is implemented.

[0126] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory optionally includes a memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of the above-mentioned networks include but are not limited to the Internet, an intranet, a local area network, a mobile communication network and a combination thereof. The device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and are located in one place, or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.

[0127] Those skilled in the art will appreciate that all or some of the steps and systems disclosed above can be implemented as software, firmware, hardware, or any suitable combination thereof. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on computer-readable media, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is well known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVDs) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. Furthermore, as is well known to those skilled in the art, communication media typically includes computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0128] The above is a specific description of the preferred implementation of the present application, but the present application is not limited to the above implementation mode. Technical personnel familiar with the field can also make various equivalent modifications or substitutions without violating the spirit of the present application. These equivalent modifications or substitutions are all included in the scope defined by the present application.

Claims

1. A method for systematically testing a UFS device, characterized in that: Applied to a test host, the test host being electrically connected to a UFS device; The system testing method includes: Generate multiple different types of operation commands; determining a first queue depth according to a preset command sending mode, and asynchronously sending the operation commands of the first queue depth to the UFS device, so that the UFS device stores the operation commands in the form of a command queue and processes the operation commands in queue order, and returns a response each time an operation command is completed; wherein the preset command sending mode includes: a fixed depth mode and a random depth mode; Receive a response returned by the UFS device; Determining a second queue depth of the operation command to be sent next time according to the preset command sending mode and the number of the received acknowledgement responses; sending the operation commands of the second queue depth to the UFS device, and continuing to cause the UFS device to store the operation commands in the form of a command queue and process the operation commands in queue order until all the operation commands are sent and executed, thereby completing the system test of the UFS device; The determining, according to the preset command sending mode and the number of the received response statistics, of a second queue depth of the operation command to be sent next time includes: When the preset command sending mode is a random depth mode; randomly generating a delay time within a preset time range according to the random depth mode; counting the number of response responses returned by the UFS device received within the delay time; and determining the number of response responses received within the delay time as the second queue depth; When the preset command sending mode is: fixed depth mode; according to the fixed depth mode, the number of response responses returned by the UFS device each time is instantly counted; the number of response responses returned by the UFS device obtained by instant counting is determined as the second queue depth; wherein, in the fixed depth mode, the second queue depth is less than or equal to the fixed depth.

2. The method for system testing of UFS devices according to claim 1, wherein: When the preset command sending mode is a random depth mode, determining the first queue depth according to the preset command sending mode includes: Obtaining a maximum command queue depth of the UFS device according to the random depth mode; The maximum command queue depth is determined as the first queue depth.

3. The method for system testing of UFS devices according to claim 1, wherein: When the preset command sending mode is a fixed depth mode, determining the first queue depth according to the preset command sending mode includes: According to the fixed depth mode, obtaining a preset fixed depth; the fixed depth is less than or equal to the maximum command queue depth of the UFS device; The fixed depth is determined as the first queue depth.

4. The method for system testing of UFS devices according to claim 1, wherein: The generating of multiple different types of operation commands includes: Generate logical address, block size, and random number in the range of 0 to 100%; Determine a corresponding operation type according to the numerical range of the random number; wherein the operation type includes: read operation, write operation, and erase operation; Performing command generation processing according to the logical address, the block size, and the operation type to obtain the operation command; the type of the operation command is determined by the operation type; The command generation process is repeated multiple times to obtain multiple operation commands; wherein the operation commands include: a read command, a write command, and an erase command.

5. The method for system testing of UFS devices according to claim 4, characterized in that: The determining of the corresponding operation type according to the numerical range of the random number includes: When the random number is greater than or equal to 0 and less than a first threshold, determining that the operation type is a read operation; When the random number is greater than or equal to the first threshold and less than a second threshold, determining that the operation type is a write operation; wherein the second threshold is greater than the first threshold; When the random number is greater than or equal to the second threshold and less than or equal to 100%, it is determined that the operation type is an erase operation.

6. A test host, characterized in that: The system testing method for a UFS device according to claim 1 can be executed, wherein the testing host comprises: A command generation module is used to generate multiple different types of operation commands; a first command sending module, configured to determine a first queue depth according to a preset command sending mode, and asynchronously send the operation commands of the first queue depth to the UFS device, so that the UFS device stores the operation commands in the form of a command queue and processes the operation commands in queue order, and returns a response each time an operation command is completed; wherein the preset command sending mode includes: a fixed depth mode and a random depth mode; A response receiving module, configured to receive a response returned by the UFS device; a depth adjustment module, configured to determine a second queue depth of the operation command to be sent next time according to the preset command sending mode and the number of the received response statistics; The second command sending module is used to send the operation commands of the second queue depth to the UFS device, continue to store the operation commands in the form of a command queue and process the operation commands in queue order until all the operation commands are sent and executed, thereby completing the system test of the UFS device.

7. An electronic device, characterized in that: The system comprises at least one processor and a memory for communicating with the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the system testing method for a UFS device according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the system testing method for a UFS device according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • UFS maximum performance test method, controller, system and medium

    CN117012268A

  • UFS performance test method and device and electronic equipment

    CN117407253A