Storage access method, device and system

By sending request messages carrying multiple commands to the UFS host and using the idle time of the UFS device for preprocessing, the problem of computing power redundancy in the UFS system when processing multiple parallel requests is solved and the storage access efficiency is improved.

CN118732930APending Publication Date: 2024-10-01HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310357399.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-28
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

When the UFS system processes multiple parallel requests, because the request sending speed of the UFS host is lower than the response speed of the UFS device, the UFS device remains idle for a long time, resulting in redundant computing power and low storage access efficiency.

Method used

The UFS host sends a first request message containing multiple commands, carrying the storage space address and size of the second request message, and performs preprocessing in advance when the UFS device is idle, making full use of the computing power of the UFS device and improving storage access speed.

Benefits of technology

Effectively utilize the idle time of the UFS device for pre-processing, improve storage access efficiency, shorten the processing time of subsequent requests, and improve the overall performance of the UFS system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118732930A_ABST
    Figure CN118732930A_ABST
Patent Text Reader

Abstract

The invention provides a storage access method, device and system. In the method, a UFS host receives a plurality of commands sent by a plurality of processes of an application in parallel; the plurality of commands are used for requesting access to the flash memory; the UFS host sends a first request message to the UFS device, wherein the first request message is used for requesting the UFS device to execute a first command in the plurality of commands; the first request message comprises a storage space address corresponding to a second request message, the second request message is used for requesting the UFS device to execute a second command, and the second command is a command except the first command in the multiple commands. By means of the scheme, the UFS host and the UFS device can transmit more information in the one-time request message distribution process, the UFS device can obtain more information in advance so as to preprocess the request messages which are not received in advance, and the storage access 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 storage technology, and in particular to a storage access method, device and system. Background Art

[0002] The universal flash storage (UFS) system is a flash storage system defined for high data transfer speeds. The UFS system includes a UFS host and a UFS device. The UFS host can send a request message to the UFS device, which can be used to request to read data stored in the flash memory, or the request message can be used to request to write data to the flash memory. The UFS device can parse the request message and perform a read operation or a write operation on the flash memory according to the parsed request message.

[0003] When there are multiple request messages sent in parallel, the UFS host sends the request messages serially and dispatches the request messages to the UFS device in sequence. When the UFS host dispatches a request message to the UFS device, it will lock the UFS device to complete the critical area protection. When the UFS host sends multiple request messages to the UFS device, the multiple request messages need to queue up and wait for the UFS host to process them serially. However, the UFS device has a strong response capability, and the speed at which the UFS device processes the request message is faster than the speed at which the UFS host sends the request message, which leads to a large computing power redundancy in the UFS device, and it is in an idle state for a long time without request messages to be processed. Summary of the invention

[0004] The present application provides a storage access method, device and system for improving the storage access efficiency of a UFS system.

[0005] In a first aspect, the present application provides a storage access method, which can be applied to a UFS host, the method comprising: receiving multiple commands sent in parallel by an application; the multiple commands are used to request access to a flash memory; sending a first request message to a UFS device, the first request message being used to request the UFS device to execute a first command among the multiple commands; the first request message comprising a storage space address corresponding to a second request message, the second request message being used to request the UFS device to execute a second command, the second command being a command among the multiple commands other than the first command.

[0006] In this method, the first request message sent by the UFS host to the UFS device can be used to request the UFS device to execute the first command. At the same time, the first request message can also carry the storage space address corresponding to the second request message, so that the UFS host can instruct the UFS device to execute the first command through the first request message. At the same time, the UFS device can also obtain the storage space address corresponding to the second request message from the first request message, so as to pre-process the second request message when the UFS device is idle, make full use of the computing power of the UFS device, and improve the storage access speed of the UFS system.

[0007] In one possible design, before sending the first request message to the UFS device, the method further includes: acquiring a storage space address corresponding to the second request message; and generating the first request message according to the first command and the storage space address corresponding to the second request message.

[0008] Through this design, the UFS host can carry the storage space address corresponding to the second request message in the first request message, so that the UFS device can pre-process the second request message in advance according to the storage space address corresponding to the second request message to improve the storage access speed of the UFS system.

[0009] In one possible design, the first request message also includes a storage space size corresponding to the second request message.

[0010] Through this design, the first request message can also carry the storage space size corresponding to the second request message, further increasing the amount of information that the UFS host can carry in one message transmission, so that the UFS device can pre-process the second request message more accurately.

[0011] In one possible design, the first command is the command that ranks first in execution order among the multiple commands.

[0012] Through this design, when the UFS host receives multiple commands sent in parallel, it can carry the storage space addresses corresponding to other request messages in the first request message corresponding to the first command that is the first in the execution order. After receiving the first request message, the UFS device can pre-process the second request message when it is idle, thereby improving the storage access efficiency of the UFS system.

[0013] In one possible design, the first command is a direct access IO command.

[0014] In one possible design, the multiple commands may come from multiple processes initiated by the application, and the multiple commands correspond one-to-one to the multiple processes; or the multiple commands may come from multiple processes sent by the application, and each process includes at least one of the multiple commands.

[0015] Through this design, the storage access method provided by the present application can be applicable to single-concurrency scenarios and multi-concurrency scenarios, and can flexibly improve the storage access efficiency in various concurrency scenarios.

[0016] In a second aspect, the present application provides a storage access method, which can be applied to a universal flash storage UFS device, the method comprising: receiving a first request message sent by a UFS host, the first request message being used to request the UFS device to execute a first command; the first request message comprising a storage space address corresponding to a second request message, the second request message being used to request the UFS device to execute a second command; executing the first command; and when the UFS device is idle, pre-processing the second request message according to the storage space address corresponding to the second request message.

[0017] In this method, the UFS device can obtain the storage space address corresponding to the second request message in advance, so that after the UFS device executes the first command, it can pre-process the second request message in advance when it is idle later, fully utilizing the computing power of the UFS device and improving the storage access speed of the UFS system.

[0018] In a possible design, the preprocessing may include but is not limited to table entry loading and / or IO pre-reading processing. With this design, the UFS device can perform multiple preprocessing on the second request message according to the storage address of the second request message, thereby saving the processing time of the UFS device after receiving the second request message and improving storage access efficiency.

[0019] In a third aspect, the present application also provides a storage access device, which includes a processing unit and a communication unit; the communication unit is used to send and receive data; the processing unit is used to receive multiple commands sent in parallel by multiple application processes through the communication unit, and the multiple commands are used to request access to a flash memory; a first request message is sent to a UFS device through the communication unit, and the first request message is used to request the UFS device to execute a first command among the multiple commands; the first request message includes a storage space address corresponding to a second request message, and the second request message is used to request the UFS device to execute a second command, and the second command is a command other than the first command among the multiple commands.

[0020] In one possible design, the processing unit is further used to: before sending the first request message to the UFS device through the communication unit, obtain a storage space address corresponding to the second request message; and generate the first request message according to the first command and the storage space address corresponding to the second request message.

[0021] In a fourth aspect, the present application also provides a storage access device, which includes a processing unit and a communication unit; the communication unit is used to send and receive data; the processing unit is used to receive a first request message sent by a UFS host through the communication unit, and the first request message is used to request the UFS device to execute a first command; the first request message includes a storage space address corresponding to a second request message, and the second request message is used to request the UFS device to execute a second command; when the UFS device is idle, the second request message is pre-processed according to the storage space address corresponding to the second request message.

[0022] In a fifth aspect, the present application further provides a storage access system, the system comprising a UFS host, a UFS device, and a communication interface, the UFS host being connected to the UFS device via the communication interface;

[0023] The UFS host is used to receive multiple commands sent in parallel by an application; the multiple commands are used to request access to a flash memory; send a first request message to a UFS device, the first request message is used to request the UFS device to execute a first command among the multiple commands; the first request message includes a storage space address corresponding to a second request message, the second request message is used to request the UFS device to execute a second command, and the second command is a command other than the first command among the multiple commands.

[0024] The UFS device is configured to receive the first request message sent by the UFS host; and when the UFS device is idle, pre-process the second request message according to a storage space address corresponding to the second request message.

[0025] In one possible design, the UFS host is further used to: before sending the first request message to the UFS device, obtain a storage space address corresponding to the second request message; and generate the first request message according to the first command and the storage space address corresponding to the second request message.

[0026] In a sixth aspect, the present application provides a chip comprising a processor; the processor is used to couple with a memory storing computer programs, and to execute the programs stored in the memory, to implement the method described in the above-mentioned first aspect and any possible design thereof, or to implement the method described in the above-mentioned second aspect and any possible design thereof.

[0027] In a seventh aspect, the present application provides an electronic device, wherein the electronic device comprises the chip described in the sixth aspect.

[0028] In an eighth aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a computer, the computer executes the method described in the above-mentioned first aspect and any possible design thereof, or executes the method described in the above-mentioned second aspect and any possible design thereof.

[0029] In a ninth aspect, the present application provides a computer program product, comprising a computer program or instructions, which, when executed on a computer, enables the computer to execute the method described in the first aspect and any possible design thereof, or to execute the method described in the second aspect and any possible design thereof.

[0030] For the beneficial effects of the third to ninth aspects mentioned above, please refer to the description of the beneficial effects of the first or second aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 A schematic diagram of the architecture of a UFS system provided in an embodiment of the present application;

[0032] Figure 2 A schematic diagram of a UFS system workflow;

[0033] Figure 3 A storage access method provided in an embodiment of the present application;

[0034] Figure 4 A schematic diagram of a storage access method provided in an embodiment of the present application;

[0035] Figure 5 A schematic diagram of a UFS system executing a storage access method provided in an embodiment of the present application;

[0036] Figure 6 A schematic diagram of a storage access method provided in an embodiment of the present application applied to a single concurrent scenario;

[0037] Figure 7 A schematic diagram of the storage access method provided in an embodiment of the present application applied to multiple concurrent scenarios;

[0038] Figure 8 A schematic diagram of the structure of a storage access device provided in an embodiment of the present application;

[0039] Fig. 9 A schematic diagram of the structure of a chip provided in an embodiment of the present application. DETAILED DESCRIPTION

[0040] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the embodiments of the present application will be further described in detail below in conjunction with the accompanying drawings. Among them, in the description of the embodiments of the present application, the terms "first" and "second" are used only for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features.

[0041] It should be understood that in the embodiments of the present application, "at least one" refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can represent: a, b, c, a and b, a and c, b and c, or a, b and c, where a, b, c can be single or multiple.

[0042] The universal flash storage (UFS) system is a flash storage system defined for high data transfer speeds. The UFS system includes a UFS host and a UFS device, wherein the UFS host may be, for example, a central processing unit (CPU), a system on chip (SoC), etc. The UFS device may be, for example, a controller for receiving a request message from the UFS host and performing a read / write operation on the flash memory. One or more channels may be established between the UFS host and the UFS device, and the UFS host and the UFS device may communicate through the established channels.

[0043] Figure 1 A schematic diagram of the architecture of a UFS system provided in an embodiment of the present application. Figure 1 The UFS system includes a UFS host and a UFS device. To facilitate the introduction of the workflow of the UFS system, Figure 1 Also shown are an application layer and a flash memory layer in an electronic device to which the UFS system is applied.

[0044] In an embodiment of the present application, the UFS host may include a small computer system interface (SCSI) layer, a block device management layer, and a driver layer. The SCSI layer may include a request generation module and a request pool to be sent, and the request generation module may be used to convert a direct access IO (DIO) command from the application layer into a request message. The block device management layer is used to distribute the request message to multiple dispatch queues; the driver layer is used to lock and unlock the UFS device, and send a request message to the UFS device.

[0045] The UFS device may include a controller layer, and the controller layer may be used to parse a request message to perform a read operation or a write operation on a flash memory.

[0046] based on Figure 1 The UFS system is shown in the figure. The working process of the UFS system is introduced below. Figure 2 A schematic diagram of the workflow of a UFS system. Figure 2 , process 1, process 2, process 3 and process 4 are four processes initiated by the application, and processes 1-4 are all processes requesting access to the UFS device. After the application initiates the process, the application layer sends a DIO command to the SCSI layer of the UFS host. After receiving the DIO command of each process, the request generation module of the SCSI layer converts the DIO command into a request message, and sends the obtained four request messages to the block device management layer of the UFS host. The block device management layer adds the four request messages to the four dispatch queues corresponding to the four processes respectively, and each dispatch queue calls the driver interface to dispatch the request message. After receiving the request message of process 1, the driver layer of the UFS host needs to lock the UFS device and send the request message of process 1 to the UFS device during the locking period. During the locking period, the UFS host cannot send request messages of other processes to the UFS device. In fact, the UFS device has a strong response capability. During the period when the UFS host locks the UFS device, the UFS device processes request messages faster than the UFS host sends request messages, which leads to a large computing power redundancy in the UFS device and it is in an idle state for a long time with no request messages to process.

[0047] In addition, refer to Figure 2 Since the UFS host cannot send other request messages while locking the UFS device, other request messages will need to wait in the dispatch queue for dispatch by the UFS host, resulting in a long end-to-end response cycle and affecting the storage access performance of the UFS system.

[0048] Based on the above problems, the present application embodiment provides a storage access method. The method can be Figure 1 The UFS system implementation shown. Figure 3 A storage access method provided in an embodiment of the present application is referred to Figure 3 , the method may include the following steps:

[0049] S301: The UFS host receives multiple commands sent in parallel by an application.

[0050] In an optional implementation, multiple applications may be installed in the electronic device, each application may initiate a process, each process may include at least one command, and the command is used to request access to the flash memory. The application may send a command to the UFS host, the command may be a DIO command, and the command sent by the application may include a write command and / or a read command. For example, a write command is used to write data to the flash memory, and a read command is used to read data from the flash memory.

[0051] Optionally, the multiple commands received by the UFS host may be sent by the same application or by multiple applications, which is not limited in the embodiments of the present application.

[0052] S302: The UFS host generates a first request message.

[0053] In an optional implementation, the command received by the UFS host may be a DIO command, and the UFS host may split the DIO command into multiple blocking IOs (BIOs), and generate a request message according to the multiple BIOs.

[0054] For example, Figure 4 A schematic diagram of a storage access method provided in an embodiment of the present application. Figure 4 The UFS host can process multiple commands received in parallel and generate request messages corresponding to the commands of each process respectively.

[0055] In the embodiment of the present application, when the UFS host generates the first request message, it can obtain the storage space address corresponding to the second request message, wherein the first request message is used to request the UFS device to execute the first command, and the first command can be the command with the first execution order among multiple commands received by the UFS host, such as the first command is the command with the earliest reception time among multiple commands, or the first command is the command with the highest priority among multiple commands. The second request message is a request message other than the first request message among the multiple request messages currently to be processed, and the second request message is used to request the UFS device to execute the second command.

[0056] It should be noted that the storage space address corresponding to the second request message is a medium operation address where the UFS device needs to perform a read operation / write operation. For example, the storage space address corresponding to the second request message is a logical block address (LBA).

[0057] Optionally, the first request message may also include a storage space size corresponding to the second request message.

[0058] In an embodiment of the present application, the UFS host can generate a first request message based on the storage space address corresponding to the first command and the second request message, so that the first request message can be used to request the UFS device to execute the first command. At the same time, the first request message can also carry the storage space address corresponding to the second request message, so that the UFS host and the UFS device can transmit more information during a request message distribution process.

[0059] S303: The UFS host sends a first request message to the UFS device.

[0060] In an optional implementation, when the UFS host sends the first request message to the UFS device, the UFS device is in a locked state. During the locked state, the UFS host cannot continue to send other request messages to the UFS device.

[0061] refer to Figure 4 When the UFS host sends the first request message to the UFS device, other request messages are in the dispatch queue waiting for the UFS device to switch from the locked state to the unlocked state.

[0062] S304: The UFS device executes the first command according to the first request message.

[0063] In an optional implementation, after receiving the first request message, the UFS device may execute the first command to the flash memory according to the first request message. For example, when the first command is a read command, the UFS device may read data from the flash memory according to parameters such as the storage space address and storage space size of the first command, and write the read data into the cache of the UFS device, and then write the data from the cache of the UFS device to the cache of the UFS host to complete the execution of the first command.

[0064] S305: When the UFS device is idle, pre-process the second request message according to the storage space address corresponding to the second request message in the first request message.

[0065] In an embodiment of the present application, when the UFS device receives the first request message, since the speed at which the UFS device processes the request message is faster than the speed at which the UFS host dispatches the request message, after the UFS device obtains the storage space address corresponding to the second request message in the first request message, if the UFS device is idle, the UFS device can pre-process the second request message according to the storage space address corresponding to the second request message.

[0066] For example, the preprocessing of the second request message by the UFS device may include, but is not limited to, table entry loading and / or IO pre-reading processing, etc. Among them, the table entry loading includes the UFS device determining the location of the target storage space in the flash memory according to the storage space address corresponding to the second request message; the IO pre-reading includes the UFS device obtaining data from the flash memory according to the storage space address corresponding to the second request message, and placing the obtained data into the cache of the UFS device.

[0067] It should be noted that, when the first request message also includes the storage space size corresponding to the second request message, the UFS device may also pre-process the second request message according to the storage space address and storage space size corresponding to the second request message.

[0068] Through the above design, the UFS device can obtain the storage space address corresponding to the second request message in advance, so as to pre-process the second request message in advance when the UFS device is idle, fully utilize the computing power of the UFS device, and improve the storage access speed of the UFS system.

[0069] S306: The UFS host sends a second request message to the UFS device.

[0070] In an optional implementation, after sending the first request message, the UFS host may unlock the UFS device, and then the UFS host may continue to send other request messages to the UFS device. For example, the UFS host sends a second request message to the UFS device. Figure 4 When the UFS host sends a request message to the UFS device, the UFS device is in a locked state, and after receiving multiple request messages, the UFS device can process the multiple request messages in parallel.

[0071] S307: The UFS device executes the second command according to the second request message.

[0072] In the embodiment of the present application, since the UFS device has pre-processed the second request message before receiving the second request message, the UFS device can quickly execute the second command after receiving the second request message, saving the time of pre-processing the second request message. For example, when the second command is a read command, after the UFS device obtains the storage space address corresponding to the second request message from the first request message, it can perform IO pre-reading on the second request message, obtain the data corresponding to the storage space address from the flash memory, and put the obtained data into the cache of the UFS device. After receiving the second request message, the UFS device can directly read the data from the cache of the UFS device and write the data to the cache of the UFS host, thereby completing the execution of the second command and improving the efficiency of executing the second command.

[0073] By comparison Figure 2 and Figure 4 It can be seen that in the memory reading method provided in the embodiment of the present application, since the UFS device can pre-process DIO2.1, DIO3.1 and DIO4.1 in advance, the idle period of the UFS device waiting for the request message can be fully utilized, and the time for the UFS host to wait for the UFS device to execute DIO2.1, DIO3.1 and DIO4.1 can be reduced, thereby improving the storage access speed of the UFS system.

[0074] The storage access method provided in the embodiment of the present application can be performed by Figure 1 The UFS system shown is executed. Figure 5 A schematic diagram of a UFS system executing a storage access method provided in an embodiment of the present application. Figure 5 , the application layer of the electronic device sends a DIO command to the SCSI layer of the UFS host, and the SCSI layer of the UFS host can convert the received DIO command into a request message. The SCSI layer also includes a pending request pool, in which the pending request pool contains request messages waiting to be sent by the UFS host to the UFS device. The SCSI layer can obtain the storage space address corresponding to the second request message from the pending request pool, and fill the storage space address corresponding to the second request message into the first request message.

[0075] The SCSI layer passes the multiple request messages to the block device management layer, and the block device management layer adds the multiple request messages to the dispatch queue corresponding to each process. The block device management layer calls the driver interface to send the first request message to the driver layer.

[0076] The driver layer locks the UFS device and sends the first request message to the Controller layer of the UFS device. The Controller layer of the UFS device can execute the first command according to the first request, and the UFS device can obtain the storage space address corresponding to the second request message from the first request message, and pre-process the second request message according to the storage space address corresponding to the second request message when the UFS device is idle. For example, the pre-processing can be that the Controller layer of the UFS device pre-reads data from the flash memory according to the storage space address corresponding to the second request message.

[0077] It should be noted that, in the embodiment of the present application, the first request message includes the storage space address of the second request message, and specifically, the storage space address of the second request message may be carried in various data structures of the first request message. For example, the first request message generated by the SCSI layer of the UFS host is a UFS-cmd data structure, and the first request message transmitted by the driver layer to the UFS device is a upiu structure. The first request message under the above two data structures carries the storage space address of the second request message, and may further carry the storage space size corresponding to the second request message.

[0078] The following is an introduction to examples of the storage access method provided in the embodiments of the present application applied to two concurrent scenarios. The embodiments of the present application are applicable to single-concurrency scenarios and multi-concurrency scenarios. Among them, the single-concurrency scenario refers to the UFS host receiving multiple commands from multiple processes, and the multiple commands correspond one-to-one to the multiple processes, that is, the application sends one command to the UFS host at a time in one process. The multi-concurrency scenario refers to the UFS host receiving multiple commands from multiple processes, each process includes at least one command of the multiple commands, that is, the application can send multiple commands to the UFS host at the same time in one process.

[0079] Example 1: Single concurrent scenario

[0080] Figure 6 This is a schematic diagram of the storage access method provided in the embodiment of the present application applied to a single concurrent scenario. Figure 6 , process 1, process 2, process 3 and process 4 are four processes initiated by the application, and process 1-process 4 are all processes requesting access to the UFS device. In a single concurrency scenario, the application sends a DIO command to the UFS host each time in one process, such as Figure 6In the example, the application sends DIO1.1 to the UFS host in process 1, the application sends DIO2.1 to the UFS host in process 2, the application sends DIO3.1 to the UFS host in process 3, and the application sends DIO4.1 to the UFS host in process 4; DIO1.1, DIO2.1, DIO3.1, and DIO4.1 are sent to the UFS host in parallel.

[0081] The UFS host converts DIO1.1 to request1.1, DIO2.1 to request2.1, DIO3.1 to request3.1, and DIO4.1 to request4.1. Furthermore, the UFS host adds the storage space addresses corresponding to request2.1, request3.1, and request4.1 to request1.1.

[0082] The UFS host sends request1.1 to the UFS device, and the UFS device executes DIO1.1 according to request1.1 and returns a response message corresponding to request1.1 to the UFS host. Figure 6 In the process of the UFS host sending a request message to the UFS device, the UFS device is in a locked state. The UFS device can obtain the storage space addresses corresponding to request2.1, request3.1 and request4.1 from request1.1, so the UFS device can pre-process request2.1, request3.1 and request4.1 when it is idle, such as Figure 6 The timing when the UFS device can pre-process request2.1, request3.1 and request4.1 is marked in. Since the UFS device has pre-processed request2.1, request3.1 and request4.1, the execution of DIO2.1, DIO3.1 and DIO4.1 by the UFS device will be shortened after receiving request2.1, request3.1 and request4.1.

[0083] The UFS host continues to receive DIO1.2 sent by the application in process 1, DIO2.2 sent by the application in process 2, DIO3.2 sent by the application in process 3, and DIO4.2 sent by the application in process 4.

[0084] Similar to the above process, the UFS host converts DIO1.2 to request1.2, DIO2.2 to request2.2, DIO3.2 to request3.2, and DIO4.2 to request4.2. Furthermore, the UFS host adds the storage space addresses corresponding to request2.2, request3.2, and request4.2 to request1.2.

[0085] The UFS host sends request1.2 to the UFS device, and the UFS device executes DIO1.2 according to request1.2 and returns a response message corresponding to request1.2 to the UFS host. The UFS device can obtain the storage space addresses corresponding to request2.2, request3.2, and request4.2 from request1.2, so the UFS device can pre-process request2.2, request3.2, and request4.2 when idle, such as Figure 6 The timing when the UFS device can pre-process request2.2, request3.2, and request4.2 is marked in. Since the UFS device has pre-processed request2.2, request3.2, and request4.2, the execution of DIO2.2, DIO3.2, and DIO4.2 by the UFS device after receiving request2.2, request3.2, and request4.2 will be shortened.

[0086] Example 2: Multiple concurrent scenarios

[0087] Figure 7 A schematic diagram of the storage access method provided in the embodiment of the present application applied to multiple concurrent scenarios. Figure 7 , process 1, process 2, process 3 and process 4 are four processes initiated by the application, and process 1-process 4 are all processes requesting access to the UFS device. In a multi-concurrency scenario, an application can send at least one DIO command to the UFS host in one process at a time, such as Figure 7 In the example, the application sends DIO1.1 and DIO1.2 to the UFS host in process 1, the application sends DIO2.1 and DIO2.2 to the UFS host in process 2, the application sends DIO3.1 and DIO3.2 to the UFS host in process 3, and the application sends DIO4.1 and DIO4.2 to the UFS host in process 4; DIO1.1, DIO1.2, DIO2.1, DIO2.2, DIO3.1, DIO3.2, DIO4.1 and DIO4.2 are sent to the UFS host in parallel.

[0088] The UFS host converts DIO1.1 to request1.1, DIO2.1 to request2.1, DIO3.1 to request3.1, and DIO4.1 to request4.1; the UFS host converts DIO1.2 to request1.2, DIO2.2 to request2.2, DIO3.2 to request3.2, and DIO4.2 to request4.2. In addition, the UFS host adds the storage space addresses corresponding to request1.2, request2.1, request2.2, request3.1, request3.2, request4.1, and request4.2 to request1.1.

[0089] The UFS host sends request1.1 to the UFS device, and the UFS device executes DIO1.1 according to request1.1 and returns a response message corresponding to request1.1 to the UFS host. Figure 7 In the process of the UFS host sending a request message to the UFS device, the UFS device is in a locked state. The UFS device can obtain the storage space addresses corresponding to request1.2, request2.1, request2.2, request3.1, request3.2, request4.1 and request4.2 from request1.1, so the UFS device can pre-process request1.2, request2.1, request2.2, request3.1, request3.2, request4.1 and request4.2 when idle, such as Figure 6The timing when the UFS device can pre-process request1.2, request2.1, request2.2, request3.1, request3.2, request4.1, and request4.2 is marked. Since the UFS device has pre-processed request1.2, request2.1, request2.2, request3.1, request3.2, request4.1, and request4.2, the time for the UFS device to execute DIO1.2, DIO2.1, DIO2.2, DIO3.1, DIO3.2, DIO4.1, and DIO4.2 will be shortened after receiving request1.2, request2.1, request2.2, request3.1, request3.2, request4.1, and request4.2.

[0090] Based on the above embodiments and the same concept, an embodiment of the present application further provides a storage access device, which can be applied to a UFS host or a UFS device. Figure 8 A schematic diagram of the structure of a storage access device provided in an embodiment of the present application. Figure 8 , the storage access device 800 may include a processing unit 801 and a communication unit 802 .

[0091] The communication unit 802 is an interface or port for communicating with other devices. The processing unit 801 may also be referred to as a processor, a processing board, a processing module, or a processing device. Optionally, the communication unit 802 is used to perform the sending operation and the receiving operation on the UFS host side or the UFS device side in the above method. The device used to implement the receiving function in the communication unit 802 may be regarded as a receiving unit, and the device used to implement the sending function in the communication unit 802 may be regarded as a sending unit, that is, the communication unit 802 includes a receiving unit and a sending unit.

[0092] When the storage access device 800 is applied to a UFS host, the processing unit 801 can be used to implement Figure 3 or Figure 5 The processing function of the UFS host in the example, the communication unit 802 can be used to implement Figure 3 The UFS host transceiver function in the example. Alternatively, the communication device can also be understood by referring to the description and possible designs in the third aspect of the invention.

[0093] When the storage access device 800 is applied to a UFS device, the processing unit 801 may be used to implement Figure 3 The processing function of the UFS device in the example, the communication unit 802 can be used to implement Figure 3The UFS device described in the example has a transceiver function. Alternatively, the communication device can also be understood by referring to the description and possible designs in the fourth aspect of the invention.

[0094] In addition, it should be noted that the aforementioned communication unit and / or processing unit can be implemented through a virtual module, for example, the processing unit can be implemented through a software function unit or a virtual device, and the communication unit can be implemented through a software function or a virtual device. Alternatively, the processing unit or the communication unit can also be implemented through a physical device, for example, if the device is implemented using a chip / chip circuit, the communication unit can be an input-output circuit and / or a communication interface, performing input operations (corresponding to the aforementioned receiving operations) and output operations (corresponding to the aforementioned sending operations); the processing unit is an integrated processor or microprocessor or integrated circuit.

[0095] The division of units in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional unit in each example of the embodiments of the present application may be integrated into a processor, or may exist physically separately, or two or more units may be integrated into a module. The above-mentioned integrated units may be implemented in the form of hardware or in the form of software functional modules.

[0096] Based on the above embodiments and the same concept, the embodiments of the present application also provide a chip for implementing the storage access method provided in the embodiments of the present application. For example, the chip can be used to implement the functions performed by the UFS host in the embodiments of the present application, or to implement the functions performed by the UFS device in the embodiments of the present application. Fig. 9 As shown, the chip 900 includes at least one processor 903. Furthermore, the chip 900 may also include a transceiver 901 and a memory 902.

[0097] Among them, the processor 903 and the transceiver 901 are coupled. The coupling in the embodiment of the present application is an indirect coupling or communication connection between devices, units or modules, which can be electrical, mechanical or other forms, and is used for information interaction between devices, units or modules.

[0098] Specifically, the transceiver 901 may be a circuit, a bus, a communication interface or any other module that can be used for information interaction, and may be used to receive or send information.

[0099] Optionally, the memory 902 is coupled to the transceiver 901 and the processor 903, and is used to store program instructions.

[0100] The processor 903 is used to call the program instructions stored in the memory 902 so that the chip 900 executes the method provided in the embodiment of the present application.

[0101] The transceiver 901 is used to receive and send radio frequency signals, and is coupled to the receiver and transmitter of the chip 900. The transceiver 901 communicates with communication networks and other communication devices through radio frequency signals or optical signals, such as Ethernet, Radio Access Technology (RAN), Wireless Local Area Networks (WLAN), optical transport networks, etc. In a specific implementation, the communication protocols supported by the transceiver 901 may include optical transport network protocols, wireless communication protocols, etc. The wireless communication network protocol may be, for example, WiFi protocol, 2G / 3G, Long Term Evolution (LTE), 5G New Radio (NR), etc.

[0102] In a specific implementation, the memory 902 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more disk storage devices, flash memory devices or other non-volatile solid-state storage devices. The memory 902 may store an operating system (hereinafter referred to as system), such as an embedded operating system such as ANDROID, IOS, WINDOWS, or LINUX. The memory 902 may be used to store an implementation program of an embodiment of the present application. The memory 902 may also store a network communication program, which may be used to communicate with one or more additional devices, one or more user devices, and one or more network devices.

[0103] The processor 903 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present application.

[0104] In some embodiments of the present application, the transceiver 901, the memory 902 and the processor 903 can be connected to each other via a communication line 904; the communication line 904 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication line 904 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0105] Need to explain, Fig. 9 This is only one implementation of the embodiment of the present application. In actual applications, the chip 900 may also include more or fewer components, which is not limited here.

[0106] Based on the above embodiments and the same concept, the present application also provides a storage access system, the system comprising a UFS host and a UFS device; the UFS host and the UFS device can interact to execute the method provided in the above embodiments, please refer to Figure 3 and Figure 5 Introduction.

[0107] Based on the above embodiments and the same concept, an embodiment of the present application further provides an electronic device, which includes the chip described in the above embodiments.

[0108] Based on the above embodiments and the same concept, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program runs on a computer, the computer executes the method provided in the above embodiments.

[0109] Based on the above embodiments and the same concept, the embodiments of the present application also provide a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed on a computer, the computer executes the method provided in the above embodiments.

[0110] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0111] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0112] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0113] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0114] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the scope of protection of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A storage access method, characterized in that: Applied to a universal flash storage UFS host, the method comprises: receiving a plurality of commands sent in parallel by an application; the plurality of commands being used to request access to a flash memory; A first request message is sent to a UFS device, where the first request message is used to request the UFS device to execute a first command among the multiple commands; the first request message includes a storage space address corresponding to a second request message, where the second request message is used to request the UFS device to execute a second command, where the second command is a command among the multiple commands other than the first command.

2. The method according to claim 1, characterized in that Before sending the first request message to the UFS device, the method further includes: Obtaining a storage space address corresponding to the second request message; The first request message is generated according to the storage space address corresponding to the first command and the second request message.

3. The method according to claim 1 or 2, characterized in that The first request message also includes a storage space size corresponding to the second request message.

4. The method according to any one of claims 1 to 3, characterized in that: The first command is a command that is first in execution order among the multiple commands.

5. The method according to any one of claims 1 to 4, characterized in that: The first command is a direct access IO command.

6. The method according to any one of claims 1 to 5, characterized in that: The multiple commands come from multiple processes initiated by the application, and the multiple commands correspond one-to-one to the multiple processes; or The multiple commands come from multiple processes sent by an application, and each process includes at least one command among the multiple commands.

7. A storage access method, characterized in that: Applied to a universal flash storage UFS device, the method comprises: receiving a first request message sent by a UFS host, the first request message being used to request the UFS device to execute a first command; the first request message including a storage space address corresponding to a second request message, the second request message being used to request the UFS device to execute a second command; executing the first command; When the UFS device is idle, the second request message is pre-processed according to a storage space address corresponding to the second request message.

8. The method according to claim 7, characterized in that The preprocessing includes table entry loading and / or IO pre-reading processing.

9. A storage access system, characterized in that: The system includes a universal flash storage UFS host and a UFS device; The UFS host is used to receive multiple commands sent in parallel by an application; the multiple commands are used to request access to the flash memory; Sending a first request message to the UFS device, the first request message being used to request the UFS device to execute a first command among the multiple commands; the first request message including a storage space address corresponding to a second request message, the second request message being used to request the UFS device to execute a second command, the second command being a command among the multiple commands except the first command; The UFS device is configured to receive the first request message sent by the UFS host; and execute the first command; When the UFS device is idle, the second request message is pre-processed according to a storage space address corresponding to the second request message.

10. The system according to claim 9, characterized in that The UFS host is also used to: Before sending the first request message to the UFS device, a storage space address corresponding to the second request message is acquired; and the first request message is generated according to the first command and the storage space address corresponding to the second request message.

11. The system according to claim 9 or 10, characterized in that The first request message also includes a storage space size corresponding to the second request message.

12. The system according to any one of claims 9 to 11, characterized in that: The first command is a command that is first in execution order among the multiple commands.

13. The system according to any one of claims 9 to 12, characterized in that: The first command is a direct access IO command.

14. The system according to any one of claims 9 to 13, characterized in that: The multiple commands come from multiple processes initiated by the application, and the multiple commands correspond one-to-one to the multiple processes; or The multiple commands come from multiple processes sent by an application, and each process includes at least one command among the multiple commands.

15. The system according to any one of claims 9 to 14, characterized in that: The preprocessing includes table entry loading and / or IO pre-reading processing.

16. A storage access device, characterized in that: Used to implement the method according to any one of claims 1 to 6; or used to implement the method according to claim 7 or 8.

17. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein the computer program includes instructions for implementing the method according to any one of claims 1 to 6, or includes instructions for implementing the method according to claim 7 or 8.

18. A computer program product, characterized in that The computer program product comprises: a computer program code, and when the computer program code is run on a computer, the computer is enabled to execute the method according to any one of claims 1 to 6, or to execute the method according to claim 7 or 8.

19. A chip, characterized in that: comprising a processor, the processor being coupled to a memory storing a computer program, and being configured to execute the program stored in the memory to implement the method according to any one of claims 1 to 6; Or implement the method as claimed in claim 7 or 8.