System test method for UFS equipment, test host, equipment and medium

By dynamically adjusting the queue depth of the operation commands according to the command processing situation of the UFS device, the problem of mismatch between the test host and the UFS device queue depth is solved, and efficient testing of the UFS device system is achieved, and the test cycle is shortened.

CN120199314AActive Publication Date: 2025-06-24ARTMEM TECHNOLOGY CO LTD

Patent Information

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

AI Technical Summary

Technical Problem

During the UFS device system testing process, the depth of the test host and the command queue of the UFS device does not match, resulting in the processing capability of the UFS device being unable to be fully utilized, extending the test cycle.

Method used

By generating multiple different types of operation commands and adjusting the queue depth of the operation command according to the preset command sending mode, ensuring that the queue depth matches the maximum queue depth of the UFS device, thereby making full use of the command processing capabilities of the UFS device.

Benefits of technology

By dynamically adjusting the queue depth of the operation command, the test cycle of UFS device system testing can be shortened and the testing efficiency can be improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120199314A_ABST
    Figure CN120199314A_ABST
Patent Text Reader

Abstract

The invention discloses a system testing method for UFS equipment, a testing host, equipment and a medium, and relates to the technical field of UFS testing. The method comprises the following steps: generating a plurality of different types of operation commands; determining a first queue depth according to a preset command sending mode, asynchronously sending an operation command of the first queue depth to the UFS equipment so as to enable the UFS equipment to process the operation command according to a queue sequence, and returning a response when each operation command is completed; receiving a response returned by the UFS equipment; determining a second queue depth according to a preset command sending mode and the number of statistical responses; and the operation command of the second queue depth is sent to the UFS equipment, the UFS equipment continues to process the operation commands according to the queue sequence until all the operation commands are sent and executed, and system testing of the UFS equipment is completed. The test period of system testing on the UFS equipment can be shortened, and the test efficiency is improved.
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 a UFS device, and a testing host, device, and medium. Background Art

[0002] Universal Flash Storage (UFS) is a common storage device that is widely used in various electronic devices; system testing is a key link to ensure the reliability and stability of UFS devices. When performing system testing on UFS devices, the test host sends various operations and commands to the UFS device so that the UFS device executes various operations and commands for testing, and quickly identifies and locates defects in the UFS device based on the test results.

[0003] UFS devices usually support a command queue mechanism. The maximum queue depth of a UFS device refers to the maximum number of commands that the UFS device can receive and process simultaneously. Under the command queue mechanism, the test host can put multiple asynchronous commands into the queue, and the UFS device will process these commands in the order of the queue. During the system test, different hardware test hosts have different test behaviors for UFS devices and support different command queue depths; the rhythm of some test hosts sending commands may not match the processing capacity of the UFS device. If the command queue depth supported by the test host is much less than the maximum queue depth of the UFS device, the processing capacity of the UFS device cannot be fully utilized, resulting in the idleness of the UFS device and extending the test cycle; and if the command queue depth supported by the test host is much greater than the command queue depth of the UFS device, the command queue of the UFS device will be filled, and the redundant commands need to wait for the queue to be idle, resulting in command accumulation, which will also extend the test cycle. Therefore, how to shorten the cycle of system testing of UFS devices is a technical problem that needs to be solved urgently. Summary of the invention

[0004] The present application aims to solve at least one of the technical problems existing in the prior art. To this end, the present application proposes a system testing method for UFS devices and a test host, device and medium, which can adjust the queue depth of the next operation command sent according to the command processing status of the UFS device, thereby making full use of the command processing capability of the UFS device, shortening the test cycle of the system testing of the UFS device, and improving the 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, and the test host is electrically connected to the UFS device; the system testing method includes: Generate multiple different types of operation commands; Determine the first queue depth according to the preset command sending mode, and asynchronously send the operation commands with 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 the queue order, and returns an acknowledgment response for each completed operation command; wherein, the preset command sending modes include: fixed depth mode, random depth mode; Receive the acknowledgment response returned by the UFS device; Determine the second queue depth of the operation commands to be sent next according to the preset command sending mode and the counted number of the received acknowledgment responses; Send the operation commands with the second queue depth to the UFS device, and continue to make the UFS device store the operation commands in the form of a command queue and process the operation commands in the queue order until all the operation commands are sent and executed, completing the system test of the UFS device.

[0006] According to some embodiments of the present application, when the preset command sending mode is: random depth mode; the determining the first queue depth according to the preset command sending mode includes: Obtain the maximum command queue depth of the UFS device according to the random depth mode; Determine the maximum command queue depth as the first queue depth.

[0007] According to some embodiments of the present application, when the preset command sending mode is: random depth mode; the determining the second queue depth of the operation commands to be sent next according to the preset command sending mode and the counted number of the received acknowledgment responses includes: Randomly generate a delay time within a preset time range according to the random depth mode; Count the number of the acknowledgment responses returned by the UFS device received during the delay time; Determine the number of the acknowledgment responses received during the delay time as the second queue depth.

[0008] According to some embodiments of the present application, when the preset command sending mode is: fixed depth mode; the determining the first queue depth according to the preset command sending mode includes: Obtain a preset fixed depth according to the fixed depth mode; the fixed depth is less than or equal to the maximum command queue depth of the UFS device; Determine the fixed depth as the first queue depth.

[0009] 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 according to the preset command sending mode and the counted number of received response responses includes: According to the fixed depth mode, immediately count the number of response responses returned by the UFS device received each time; Determine the number of response responses returned by the UFS device obtained by immediate counting as the second queue depth; wherein, in the fixed depth mode, the second queue depth is less than or equal to the fixed depth.

[0010] According to some embodiments of the present application, generating a plurality of different types of operation commands includes: Generate a logical address, a block size, and a random number with a value in the range of 0 to 100%; According to the numerical interval where the random number is located, determine the corresponding operation type; wherein, the operation type includes: read operation, write operation, erase operation; Perform 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; Repeat the command generation processing multiple times to obtain a plurality of the operation commands; wherein, the operation commands include: read commands, write commands, erase commands.

[0011] According to some embodiments of the present application, determining the corresponding operation type according to the numerical interval where the random number is located includes: When the random number is greater than or equal to 0 and less than the first threshold, determine that the operation type is a read operation; When the random number is greater than or equal to the first threshold and less than the second threshold, determine 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%, determine that the operation type is an erase operation.

[0012] In a second aspect, an embodiment of the present application provides a system test device for a UFS device, including: A command generation module, configured to generate a plurality of 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 with the first queue depth to a UFS device, so that the UFS device stores the operation commands in the form of a command queue and processes the operation commands according to the 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. A response receiving module, configured to receive the response returned by the UFS device. A depth adjustment module, configured to determine a second queue depth of the operation commands to be sent next according to the preset command sending mode and the counted number of the received responses. A second command sending module, configured to send the operation commands with the second queue depth to the UFS device, and continue to make the UFS device store the operation commands in the form of a command queue and process the operation commands according to the queue order until all the operation commands are sent and executed, and the system test of the UFS device is completed.

[0013] In a third aspect, an embodiment of the present application provides an electronic device, including: at least one processor and a memory communicatively connected to the at least one processor; the memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to execute the system test method for a UFS device according to any one of the embodiments of the first aspect.

[0014] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, storing computer-executable instructions, and when the computer-executable instructions are executed by a processor, the system test method for a UFS device according to the first aspect is implemented.

[0015] Embodiments of the present application include: during the process of system testing a UFS device using a test host, first, generating multiple operation commands of different types; second, determining a first queue depth according to a preset command sending mode, and asynchronously sending the operation commands with 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 the queue order, and returns an acknowledgment response for each completed operation command; wherein, the preset command sending modes include: fixed depth mode, random depth mode; then, receiving the acknowledgment response returned by the UFS device; thereafter, determining a second queue depth of the operation commands to be sent next according to the preset command sending mode and the counted number of received acknowledgment responses; the counted number of received acknowledgment responses reflects the current command processing situation of the UFS device and provides a reliable reference for determining the second queue depth; finally, sending the operation commands with the second queue depth to the UFS device, and continuing to make the UFS device store the operation commands in the form of a command queue and process the operation commands in the queue order; until all operation commands are sent and executed, the system testing of the UFS device is completed; which can make full use of the command processing capability of the current UFS device, shorten the test cycle of the system testing of the UFS device, and improve the test efficiency. That is to say, the embodiments of the present application can adjust the queue depth of the operation commands to be sent next according to the command processing situation of the UFS device, so as to make full use of the command processing capability of the UFS device, shorten the test cycle of the system testing of the UFS device, and improve the test efficiency.

[0016] Other features and advantages of the present application will be described in the subsequent specification, and, in part, will be obvious from the specification, or will be understood by implementing the present application. The objectives and other advantages of the present application can be achieved and obtained by the structures specifically pointed out in the specification and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 is a schematic diagram of the functional modules of a test host provided by an embodiment of the present application; Figure 2 is a schematic diagram of the connection between a test host and a UFS device provided by an embodiment of the present application; Figure 3 is a schematic flowchart of a method for system testing a UFS device provided by an embodiment of the present application; Figure 4 is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0018] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments.

[0019] It should be understood that in the description of the present application, when it comes to orientation descriptions, such as the orientations or positional relationships indicated by up, down, front, back, left, right, etc., they are based on the orientations or positional relationships shown in the drawings. This is only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the devices or components referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation to the present application.

[0020] It should be noted that although the logical order is shown in the flowchart in the description of the present application, in some cases, the steps shown or described can be executed in a different order from that in the flowchart. In the description of the present application, the meaning of several is one or more, and the meaning of multiple is two or more. The descriptions of "first" and "second" are only for the purpose of distinguishing technical features, and should not be construed as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features or the sequence relationship of the indicated technical features.

[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.

[0022] The present application provides a system test method for a UFS device, a test host, an electronic device, and a computer-readable storage medium, relating to the technical field of UFS testing. The method includes: generating a plurality of operation commands of different types; determining a first queue depth according to a preset command sending mode, and asynchronously sending the operation commands with the first queue depth to the UFS device, so that the UFS device processes the operation commands in the 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 the number of counted responses; sending the operation commands with the second queue depth to the UFS device, and continuing to make the UFS device process the operation commands in the queue order until all operation commands are sent and executed, thus completing the system test of the UFS device. It can shorten the test cycle for system testing of the UFS device and improve the test efficiency.

[0023] The following further elaborates on the embodiments of the present application in conjunction with the drawings.

[0024] As Figure 1 shown, Figure 1 is a schematic diagram of the functional modules 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.

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

[0026] Specifically, the first command sending module 120 is configured to determine a first queue depth according to a preset command sending mode, 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 the queue order, and returns a response for each completed operation command; wherein, the preset command sending modes include: fixed depth mode, random depth mode.

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

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

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

[0030] It can be understood that, in the actual application process, multiple threads will be created, and each thread is used to correspondingly implement the function of a module.

[0031] Through the mutual cooperation and coordination among 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, the test host 100 provided by the embodiment of the present application can adjust the queue depth of the operation commands to be sent next according to the command processing situation of the UFS device, so as to make full use of the command processing ability of the UFS device, shorten the test cycle of the system test of the UFS device, and improve the test efficiency.

[0032] Such as Figure 2As shown in the figure, 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 through a USB cable, so that the test case executable program can be burned into the test host 100 from the host computer 300, in order to run the test cases and complete the system test on the UFS device 200. The power supply module 400 provides a 5V voltage to the test host so that the test host 100 can start working. A serial port board is also provided on the actual test host 100 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; the present application does not specifically limit the model of the test board.

[0033] Those skilled in the art can 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 combine some components, or different component arrangements.

[0034] The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0035] Those skilled in the art can understand that the system architecture and application scenarios described in the embodiments of the present application are for more clearly explaining the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art know that with the evolution of the system architecture and the emergence of new application scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.

[0036] Based on the above system structure, the following are the embodiments of the system test method for the UFS device of the present application.

[0037] In a first aspect, the system test method for the UFS device can be applied to a test host as shown in Figure 2 the figure, and the test host is electrically connected to the UFS device; as shown in Figure 3 the figure, the system test method for the UFS device may include but is not limited to steps S110 to S140.

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

[0039] Step S120: Determine the first queue depth according to the preset command sending mode, and asynchronously send the operation commands with 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 according to the queue order, and returns an acknowledgment response for each completed operation command; wherein, the preset command sending mode includes: fixed depth mode, random depth mode.

[0040] Step S130: Receive the acknowledgment response returned by the UFS device.

[0041] Step S140: Determine the second queue depth of the operation commands to be sent next according to the preset command sending mode and the counted number of received acknowledgment responses.

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

[0043] Specifically, the first queue depth refers to the first quantity of operation commands sent by the test main board to the UFS device.

[0044] Specifically, the second queue depth refers to the second quantity of operation commands sent by the test main board to the UFS device.

[0045] Specifically, the preset command sending mode includes two different modes. According to the situation of receiving the operation commands sent by the test host by the UFS device, the fixed depth mode and the random depth mode are defined. Among them, in the fixed depth mode, the depth of the command queue to be processed in the UFS device is a fixed depth; in the random depth mode, the depth of the command queue to be processed in the UFS device is variable.

[0046] Through steps S110 to S140, during the process of system testing the UFS device using a test host, first, multiple different types of operation commands are generated; second, according to a preset command sending mode, a first queue depth is determined, and the operation commands with 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 the queue order, and a response is returned for each completed operation command; wherein, the preset command sending modes include: fixed depth mode, random depth mode; then, the response returned by the UFS device is received; thereafter, according to the preset command sending mode and the counted number of received responses, a second queue depth of the operation commands to be sent next is determined; the counted number of received responses reflects the current command processing situation of the UFS device and provides a reliable reference for determining the second queue depth; finally, the operation commands with the second queue depth are sent to the UFS device, and the UFS device is continued to store the operation commands in the form of a command queue and process the operation commands in the queue order; until all operation commands are sent and executed, the system testing of the UFS device is completed; it can make full use of the current command processing ability of the UFS device, shorten the test cycle of the system testing of the UFS device, and improve the test efficiency. That is to say, the embodiment of the present application can adjust the queue depth of the operation commands to be sent next according to the command processing situation of the UFS device, so as to make full use of the command processing ability of the UFS device, shorten the test cycle of the system testing of the UFS device, and improve the test efficiency.

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

[0048] Step S111: Generate a logical address, a block size, and a random number whose value ranges from 0 to 100%.

[0049] Step S112: According to the numerical interval where the random number is located, determine the corresponding operation type; wherein, the operation types include: read operation, write operation, erase operation.

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

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

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

[0053] According to some embodiments of the present application, step S112 is further described. Step S112: Determine the corresponding operation type according to the numerical interval where the random number is located, including but not limited to: when the random number is greater than or equal to 0 and less than the first threshold, determine the operation type as a read operation; when the random number is greater than or equal to the first threshold and less than the second threshold, determine the operation type as a write operation; where 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%, determine the operation type as an erase operation. Determine the operation type through the interval where the random number is located to indicate the type of the operation command to be generated.

[0054] Give an example to illustrate the specific process of determining the operation type according to the random number.

[0055] Example 1: Determine the first threshold and the second threshold according to the command ratio of the preset order (read, write, erase); where the first threshold is equal to the incoming percentage of the write operation, and the second threshold is equal to the sum of the incoming percentage of the write operation and the incoming percentage of the write operation; that is, when the command ratio of the preset order is: read operation 50%, write operation 30%, erase operation 20%; then the pre-configured first threshold is 50% and the second threshold is 80%; furthermore, determine the numerical interval based on the first threshold and the second threshold. Specifically, the numerical interval includes: the first interval [0, 50%) determined by 0 and the first threshold; the second interval [50%, 80%) determined by the first threshold and the second threshold; the third interval [80%, 100%) determined by the second threshold and 100%. Generate a random number within the range of 0 to 100%. If this random number is 40%, then 40% falls within the first interval, and it is determined that the operation type of the operation command to be generated is a read operation; if this random number is 50%, then 50% falls within the second interval, and it is determined that the operation type of the operation command to be generated is a write operation; if this random number is 80%, then 80% falls within the third interval, and it is determined that the operation type of the operation command to be generated is an erase operation.

[0056] It can be understood that the command ratio of the preset order (read, write, erase) can be adjusted, and then the first threshold and the second threshold can also be adjusted. Therefore, the present application does not make specific limitations on the command ratio of the preset order (read, write, erase), the first threshold, and the second threshold.

[0057] Through steps S111 to S114, multiple 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.

[0058] After step S110 and before step S120, the system testing method for the UFS device according to the embodiments of the present application further includes: determining the type of the preset command sending mode according to the incoming mode selection parameter. Specifically, when the mode selection parameter is 0, it is determined that the preset command sending mode is the random depth mode; when the mode selection parameter is a non-zero positive number, it is determined that the preset command sending mode is the fixed depth mode.

[0059] According to some embodiments of the present application, step S120 is further described. When the preset command sending mode is: the 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.

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

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

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

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

[0064] According to some embodiments of the present application, step S130 is further described. When the preset command sending mode is: the random depth mode; step S130: determining the second queue depth of the operation command to be sent next according to the preset command sending mode and the counted number of received response responses includes but is not limited to steps S230 to S250.

[0065] Step S230: Randomly generate a delay time within a preset time range according to the random depth mode.

[0066] Step S240: Count the number of response responses returned by the UFS device received within the delay time.

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

[0068] It can be understood that in the random depth mode, the test host randomly generates a delay time. After sending the operation commands with the first queue depth to the UFS device, it starts timing; counts the number of response responses returned by the UFS device received within the delay time. The counted number of received response responses reflects the current command processing situation of the UFS device and indicates that the current UFS device still has the capacity to process new operation instructions. Thus, the number of response responses received within the delay time is determined as the second queue depth.

[0069] In the embodiment of the present application, through steps S230 to S250, in the random depth mode, the second queue depth of the operation instructions to be sent next is adjusted according to the number of response responses received within the random delay time; so as to facilitate sending the operation commands with the second queue depth to the UFS device subsequently, thereby making full use of the command processing capacity of the current UFS device, which is beneficial to shortening the test cycle of the system test for the UFS device and improving the test efficiency.

[0070] It can be understood that the embodiment of the present application realizes an asynchronous command processing mechanism based on the random depth mode through steps S210, S220, S230, S240, S250 and S150; in the asynchronous command processing mechanism based on the random depth mode, when conducting a system test on the UFS device, it can make full use of the command processing capacity of the current UFS device, which is beneficial to shortening the test cycle of the system test for the UFS device and improving the test efficiency.

[0071] Take an example to illustrate the specific processing flow of the asynchronous command processing mechanism based on the random depth mode provided by the embodiment of the present application.

[0072] Example 2: When the maximum command queue depth of the UFS device is 32; then let the first queue depth be equal to the maximum command queue depth 32. The test host first sends 32 operation commands to the UFS device. A delay time of 500 ms is randomly generated within the preset time range; when 28 response responses are received within 500 ms, it is determined that the second queue depth of the operation commands to be sent for the second time is 28, and 28 operation commands are sent for the second time. A delay time of 400 ms is randomly generated within the preset time range; when 25 response responses are received within 400 ms, it is determined that the second queue depth of the operation commands to be sent for the third time is 25, and 25 operation commands are sent for the third time. And so on, performing multiple command sending processes until the system test is completed. It can be understood that except for the first command sending process, the second queue depth of the operation commands sent in each command sending process is equal to the number of response responses received within the random delay time after the previous command sending process. Thus, it can make full use of the command processing capacity of the UFS device and shorten the test cycle.

[0073] 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 a first queue depth according to the preset command sending mode, including but not limited to steps S310 to S320.

[0074] Step S310: Obtain a preset fixed depth according to the fixed depth mode; the fixed depth is less than or equal to the maximum command queue depth of the UFS device.

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

[0076] It can be understood 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. The present application does not make specific limitations on the value of the fixed depth.

[0077] Through steps S310 to S320, the preset fixed depth is determined as the first queue depth, providing a reference for the test host to initially send operation commands.

[0078] 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: determining a second queue depth of the operation command to be sent next according to the preset command sending mode and the counted number of received response responses, including but not limited to steps S330 to S340.

[0079] Step S330: Instantly count the number of response responses returned by the UFS device received each time according to the fixed depth mode.

[0080] Step S340: Determine the number of response responses returned by the UFS device obtained by instant counting as the second queue depth; wherein, in the fixed depth mode, the second queue depth is less than or equal to the fixed depth.

[0081] It can be understood that in the fixed depth mode, the number of response responses returned by the UFS device received each time instantaneously counted by the test host reflects the current command processing situation of the UFS device. If it shows that the current UFS device still has the capacity to process new operation instructions, the test host responds immediately and determines the number of response responses returned by the UFS device obtained by instant counting as the second queue depth.

[0082] Through steps S330 to S340, in the fixed-depth mode, an immediate response is made according to the response returned by the UFS device, and the number of responses returned by the UFS device obtained by immediate statistics is determined as the second queue depth; so as to facilitate subsequent sending of operation commands with the second queue depth to the UFS device, so that the depth of the command queue storing the operation commands to be processed in the UFS device remains at a fixed depth, enabling the UFS device to process operation commands with a fixed depth efficiently and stably, making full use of the current command processing capacity of the UFS device, which is conducive to shortening the test cycle for system testing of the UFS device and improving the test efficiency.

[0083] It can be understood that the embodiment of the present application realizes an asynchronous command processing mechanism based on the fixed-depth mode through steps S310, S320, S330, S340, and S150; under the asynchronous command processing mechanism based on the fixed-depth mode, when performing system testing on the UFS device, the current command processing capacity of the UFS device can be fully utilized, which is conducive to shortening the test cycle for system testing of the UFS device and improving the test efficiency.

[0084] Take an example to illustrate the specific processing flow of the asynchronous command processing mechanism based on the fixed-depth mode provided by the embodiment of the present application.

[0085] Example 3: When the parameter of the preset fixed depth obtained is 8, the first queue depth is equal to the fixed depth of 8; the test host first sends 8 operation commands to the UFS device. When the test host receives one response, it immediately sends 1 operation command so that the total number of operation commands to be processed in 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 so that the total number of operation commands to be processed in the UFS device does not exceed 8 (i.e., less than or equal to 8); that is to say, as long as a response from the UFS device is received, an operation command is immediately sent to the UFS device; the command processing capacity of the UFS device can be fully utilized, and the test cycle can be shortened.

[0086] From Example 2 and Example 3, it can be known that the difference between the asynchronous command processing mechanism based on the random-depth mode and the asynchronous command processing mechanism based on the fixed-depth mode lies in: in the random-depth mode, within a random event range, the number of all responses received is statistically counted and the same number of operation instructions are sent; in the fixed-depth mode, as long as a response is received, the same number of operation instructions are immediately sent. From the perspective of the timing of sending operation instructions, the random-depth mode can also be understood as a random-delay sending mode, and the fixed-depth mode can also be understood as an immediate-response sending mode.

[0087] Further describe the system test method for the UFS device provided in the embodiments of the present application. Step S130: After receiving the response from the UFS device, the system test method for the UFS device further includes: parsing the execution status information from the response. When the execution status information indicates successful execution, it is determined that the response is normal and the operation command is successfully executed; when the execution status information indicates failed execution, it is determined that the response is abnormal and the operation command fails to be executed. Among them, if the type of the operation command is a read operation, it is also necessary to compare the original data written to the UFS device with the read data read from the UFS device. When the data is consistent, it is determined that the reading is correct and the read operation is successful; when the data is inconsistent, it is determined that the reading is incorrect and the read operation fails.

[0088] Further describe step S150. It can be understood that the number of operation commands that the test host needs to issue and the specific content of the system test are determined by the program burned into the test host by the upper computer. When all the operation commands that need to be sent have been sent and the UFS device has completed the execution, it is determined that the system test is over.

[0089] As Figure 4 shown, the present application also provides an electronic device, including: A processor 401, which can be implemented in a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application; A memory 402, which 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), etc. The memory 402 can store an operating system and other application programs. When implementing the technical solutions provided in the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 402 and are called by the processor 401 to execute the system test method for the UFS device in the embodiments of the present application; An input / output interface 403, which is used to implement information input and output; A communication interface 404, which is used to implement communication interaction between this device and other devices, and can implement communication through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.); A bus 405 transmits information among various components of the device, such as a processor 401, a memory 402, an input / output interface 403, and a communication interface 404. Among them, the processor 401, the memory 402, the input / output interface 403, and the communication interface 404 achieve communication connections with each other inside the device through the bus 405.

[0090] An embodiment of the present application also provides a storage medium, which is a computer-readable storage medium. The storage medium stores a computer program, and when the computer program is executed by a processor, it implements the above-mentioned system testing method for a UFS device.

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

[0092] Those of ordinary skill in the art will understand that all or some of the steps and systems disclosed above can be implemented as software, firmware, hardware, and appropriate combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include a computer storage medium (or non-transitory medium) and a communication medium (or transitory medium). As is well known to those of ordinary skill in the art, the term computer storage medium 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 (DVD) or other optical disk storage, magnetic cassettes, tapes, 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. In addition, it is well known to those of ordinary skill in the art that 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 transmission mechanism, and can include any information delivery medium.

[0093] The above is a specific description of the preferred embodiments of the present application. However, the present application is not limited to the above embodiments. Those skilled in the art can make various equivalent deformations or substitutions without departing from the spirit of the present application, and these equivalent deformations or substitutions are all included within 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 comprises: Generate multiple different types of operation commands; Determine a first queue depth according to a preset command sending mode, and asynchronously send the operation command of the first queue depth to the UFS device, so that the UFS device stores the operation command in the form of a command queue and processes the operation command 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; Receiving 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 response statistics; 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.

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

3. The method for system testing of UFS device according to claim 2, characterized in that: 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: According to the random depth mode, randomly generating a delay time within a preset time range; Counting the number of the response returned by the UFS device within the delay time; The number of the acknowledgement responses received within the delay time is determined as the second queue depth.

4. The method for system testing of UFS device according to claim 1, characterized in that: 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.

5. The method for system testing of UFS device according to claim 4, characterized in that: When the preset command sending mode is a 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: According to the fixed depth mode, instantly counting the number of the response returned by the UFS device each time received; 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.

6. The method for system testing of UFS device according to claim 1, characterized in that: The generating of multiple different types of operation commands includes: Generate logical address, block size, random number with value between 0 and 100%; Determine a corresponding operation type according to the numerical range of the random number; wherein the operation type includes: a read operation, a write operation, and an erase operation; Perform 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.

7. The method for system testing of UFS device according to claim 6, characterized in that: The determining the corresponding operation type according to the numerical interval 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.

8. A test host, characterized in that: include: A command generation module, used to generate multiple different types of operation commands; A first command sending module is used to determine a first queue depth according to a preset command sending mode, and asynchronously send the operation command of the first queue depth to the UFS device, so that the UFS device stores the operation command in the form of a command queue and processes the operation command in a 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, used for receiving a response returned by the UFS device; A depth adjustment module, used to determine 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; The second command sending module is used to send the operation command of the second queue depth to the UFS device, continue to make the UFS device store the operation command in the form of a command queue and process the operation command in queue order until all the operation commands are sent and executed, thereby completing the system test of the UFS device.

9. An electronic device, characterized in that: It includes 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 so that the at least one processor can execute the system testing method for a UFS device as described in any one of claims 1 to 7.

10. 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 7.

Citation Information

Patent Citations

  • Command scheduling method and device and storage medium

    CN112840309A

  • Queue depth adjustment method and device, electronic equipment and readable storage medium

    CN116610445A

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

    CN117012268A

  • UFS performance test method and device and electronic equipment

    CN117407253A

  • Storage performance test method and device and medium

    CN119473740A

Cited By

  • UFS equipment stability test method, system and device and storage medium

    CN120581060A

  • A stability testing method, system, device and storage medium for UFS devices

    CN120581060B