UFS random read optimization method, device, readable storage medium and electronic device
By receiving and processing part of the read command in the flash memory device, judging that the surface of the next command is different or the same, and synchronously issuance is achieved, which solves the problem of limited improvement in random read performance in traditional methods and realizes more efficient commands Concurrency and data read performance.
Patent Information
- Application Number
- CN202411260455.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-09-10
AI Technical Summary
The traditional IWL READ method cannot comprehensively improve the random read performance of flash memory devices, especially in the case of high read pressure, the delay time due to scheduling delay cannot be effectively saved.
By receiving the current partial read command and determining whether there are capital partial read commands for different faces, if there are, these commands are issued to NAND to execute at the same time, and synchronously triggering IWL READ; if the partial read commands are targeted at the same face, wait before After one command is completed, the next command is issued to ensure the reliability of data reading; directly issue commands when the IO pressure is low to avoid delays.
This method can save scheduling time under high IO pressure, realize synchronous concurrency of commands, reduce delay, improve random read performance, and improve the number of concurrencies between NAND planes, reaching a performance improvement of 10%~20%.
Smart Images

Figure CN118778906B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of flash memory technology, and in particular to a UFS random read optimization method, device, readable storage medium and electronic device. Background Art
[0002] As we all know, with the increasing performance requirements, each NAND Flash (NAND for short) manufacturer currently provides a method for concurrent partial read between planes (i.e., reading data smaller than a page, usually 8KB or 4KB in size). The method is called differently on NANDs from different manufacturers, such as IWLREAD (Independent Word Line Read), AMPI (Asynchronous MultiPlane Independent Read), and PIR (Plane Independent Read). They are collectively referred to as IWL READ below. This function is mainly used to improve the performance of NAND random reads. Taking reading different pages of two planes as an example, its functions are as follows:
[0003] 1) Partial read without IWL READ function: The command execution process of the two planes is serial, such as Figure 6 As shown, Figure 6 Where CMD is the command prompt, tDMA is the data transfer time, that is, the time it takes for data to be transferred from NAND's cache register (cache space inside the flash memory) to SRAM (cache space accessible to the host), tR (Plane0, Page55) means that the command is for the data in Plane0, Page55, and tR (Plane1, Page10) means that the command is for the data in Plane1, Page10;
[0004] 2) Supporting partial read of IWL READ function: The command execution process of the two planes is parallel, which can save the gain time compared with the traditional partial read. Figure 7 shown.
[0005] The above partial read that supports the IWL READ function will divide the reads for the two planes into two reads and send them to NAND regardless of the read pressure of UFS (Universal Flash Storage, a universal flash storage device mainly used for mobile phone data storage). Then the two planes asynchronously trigger the IWL READ function. Due to the particularity of UFS devices, the scheduling is implemented by software. Therefore, due to the scheduling delay, the interval between the two reads will be relatively large, such as Figure 8 As shown in the figure, in the asynchronous triggering method, when the read pressure is small, the delay time cannot be saved because the next read command cannot be obtained. However, in the case of heavy read pressure, the next read command can be obtained, but the delay time cannot be saved because the next read command will not be obtained in advance. Therefore, the time that can be saved by the traditional IWL READ method is: gain time minus delay time, as shown in Figure 8 shown.
[0006] In summary, the traditional IWL READ method still cannot comprehensively improve the random read performance. Summary of the invention
[0007] The technical problem to be solved by the present invention is to provide a UFS random read optimization method, device, readable storage medium and electronic device, which can comprehensively improve the random read performance.
[0008] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0009] A UFS random read optimization method comprises the following steps:
[0010] Receive the current partial read command;
[0011] If there is a next partial read command corresponding to the current partial read command, and the next partial read command and the current partial read command target different surfaces, the next partial read command is received, and the current partial read command and the next partial read command are simultaneously sent to NAND for execution.
[0012] In order to solve the above technical problems, another technical solution adopted by the present invention is:
[0013] A UFS random read optimization device, comprising:
[0014] A receiving module, used for receiving a current partial read command;
[0015] A synchronous execution module is used to receive a next partial read command corresponding to the current partial read command if there is one, and the next partial read command and the current partial read command are targeted at different surfaces, and to send the current partial read command and the next partial read command to NAND for execution at the same time.
[0016] In order to solve the above technical problems, another technical solution adopted by the present invention is:
[0017] A computer-readable storage medium stores a computer program, which implements each step of the above-mentioned UFS random read optimization method when executed by a processor.
[0018] In order to solve the above technical problems, another technical solution adopted by the present invention is:
[0019] An electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements each step of the above-mentioned UFS random read optimization method when executing the computer program.
[0020] The beneficial effect of the present invention is that if there is a next partial read command corresponding to the received current partial read command, and the next partial read command and the current partial read command target different surfaces, it means that the current IO pressure is relatively large, and the next partial read command can be received, and the current partial read command and the next partial read command can be sent to NAND for execution at the same time, saving scheduling time, and all commands are started to be executed at the same time, and the concurrency can be maximized, avoiding the gap between each command causing delays in the subsequently issued commands, so that the gain time can be saved, and the synchronous triggering of IWL READ can be achieved, thereby comprehensively improving the random read performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 A flowchart of a UFS random read optimization method according to an embodiment of the present invention;
[0022] Figure 2 A schematic diagram of the structure of a UFS random read optimization device according to an embodiment of the present invention;
[0023] Figure 3 A schematic diagram of the structure of an electronic device according to an embodiment of the present invention;
[0024] Figure 4 It is a processing flow chart of the current partial read command in the UFS random read optimization method according to an embodiment of the present invention;
[0025] Figure 5A processing flow chart of the UFS random read optimization method according to an embodiment of the present invention when executing a current partial read command;
[0026] Figure 6 A schematic diagram of command execution that does not support the IWL READ function in the UFS random read optimization method according to an embodiment of the present invention;
[0027] Figure 7 A schematic diagram of command execution supporting the IWL READ function in the UFS random read optimization method according to an embodiment of the present invention;
[0028] Figure 8 The diagram is a command execution diagram of asynchronously triggering an IWL READ function in a UFS random read optimization method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0029] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in conjunction with the implementation modes and the accompanying drawings.
[0030] Please refer to Figure 1 , a UFS random read optimization method, comprising the steps of:
[0031] Receive the current partial read command;
[0032] If there is a next partial read command corresponding to the current partial read command, and the next partial read command and the current partial read command target different surfaces, the next partial read command is received, and the current partial read command and the next partial read command are simultaneously sent to NAND for execution.
[0033] From the above description, it can be seen that the beneficial effect of the present invention is: if there is a next partial read command corresponding to the received current partial read command, and the next partial read command and the current partial read command are targeted at different surfaces, it means that the current IO pressure is relatively large, and the next partial read command can be received, and the current partial read command and the next partial read command can be sent to NAND for execution at the same time, saving scheduling time, and all commands are started to be executed at the same time, and the concurrency can be maximized, avoiding gaps between each command causing delays in subsequently issued commands, thereby saving the gain time and realizing synchronous triggering of IWL READ, thereby comprehensively improving random read performance.
[0034] Further, after receiving the current part read command, the method further includes:
[0035] If there is a next partial read command corresponding to the current partial read command, and the next partial read command targets the same surface as the current partial read command, then after the current partial read command is sent to NAND for execution, the next partial read command is received and sent to NAND for execution.
[0036] From the above description, it can be seen that since NAND cannot execute multiple commands on the same surface, if the next partial read command is targeted at the same surface as the current partial read command, after the current partial read command is sent to NAND for execution, the next partial read command is received and sent to NAND for execution to ensure the reliability of data reading.
[0037] Further, after receiving the current part read command, the method further includes:
[0038] If there is no next partial read command corresponding to the current partial read command, the current partial read command is sent to NAND for execution.
[0039] From the above description, it can be seen that when there is no next partial read command corresponding to the current partial read command, it means that the current IO pressure is small, and the current partial read command is directly sent to NAND for execution to achieve effective data reading.
[0040] Furthermore, the sending of the current partial read command to NAND for execution also includes:
[0041] Determine whether the next partial read command is received. If the next partial read command is received, determine whether the next partial read command and the current partial read command target the same surface. If they are the same, wait until the current partial read command is executed, and then send the next partial read command to NAND for execution.
[0042] From the above description, it can be seen that while the current partial read command is being executed, if the next partial read command is received, and the next partial read command targets the same surface as the current partial read command, the next partial read command will be executed after the current partial read command is completed, to ensure smooth data reading.
[0043] Furthermore, it also includes:
[0044] It is determined whether the next partial read command and the current partial read command target the same surface; if not, the next partial read command is sent to NAND for execution.
[0045] From the above description, it can be seen that while the current partial read command is being executed, if the next partial read command is received, and the next partial read command and the current partial read command target different surfaces, the next partial read command can be directly sent to NAND for execution, thereby realizing asynchronous triggering of IWL READ, which can save the time of gain time minus delay time.
[0046] Furthermore, it also includes:
[0047] If the next partial read command is not received, the process returns to the step of determining whether the next partial read command is received.
[0048] It can be seen from the above description that when the next partial read command is not received, polling judgment is performed to ensure that the partial read command can be processed in time, thereby improving data reading performance.
[0049] Furthermore, it also includes:
[0050] Check from the preset linked list whether there is a next partial read command corresponding to the current partial read command.
[0051] As can be seen from the above description, it is simple and fast to check whether there is a next partial read command corresponding to the current partial read command from the preset linked list.
[0052] Please refer to Figure 2 Another embodiment of the present invention provides a UFS random read optimization device, including:
[0053] A receiving module, used for receiving a current partial read command;
[0054] A synchronous execution module is used to receive a next partial read command corresponding to the current partial read command if there is one, and the next partial read command and the current partial read command are targeted at different surfaces, and to send the current partial read command and the next partial read command to NAND for execution at the same time.
[0055] Another embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the computer program implements the steps in the above-mentioned UFS random read optimization method.
[0056] Please refer to Figure 3 Another embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements each step of the above-mentioned UFS random read optimization method when executing the computer program.
[0057] The UFS random read optimization method, device, readable storage medium and electronic device of the present invention can be applied to UFS data reading scenarios, and are described below through specific implementation methods:
[0058] Please refer to Figure 1 , Figure 4-Figure 5 as well as Figure 7-Figure 8 , Embodiment 1 of the present invention is:
[0059] A UFS random read optimization method comprises the following steps:
[0060] S1. Receive the current partial read command.
[0061] S2. If there is a next partial read command corresponding to the current partial read command, and the next partial read command and the current partial read command target different surfaces, then receive the next partial read command, and send the current partial read command and the next partial read command to NAND for execution at the same time, such as Figure 4 shown.
[0062] The current partial read command and the next partial read command are sent to NAND for execution at the same time. They can be executed and released at the same time, which reduces the time for scheduling the latter command separately. There is no delay time between the two commands, so the gain time can be saved. Figure 7 shown.
[0063] In an optional implementation, a preset linked list is checked to see whether there is a next partial read command corresponding to the current partial read command. The preset linked list is the linked list where commands are hung after the front-end module interacting with the host obtains commands issued by the host.
[0064] S3. If there is a next partial read command corresponding to the current partial read command, and the next partial read command targets the same surface as the current partial read command, then after the current partial read command is sent to NAND for execution, the next partial read command is received and sent to NAND for execution.
[0065] S4. If there is no next partial read command corresponding to the current partial read command, the current partial read command is sent to NAND for execution.
[0066] Wherein, the current partial read command is sent to NAND for execution at the same time, such as Figure 5 As shown, it also includes:
[0067] Determine whether the next partial read command is received. If the next partial read command is received, determine whether the next partial read command and the current partial read command target the same surface. If they are the same, wait until the current partial read command is executed, and then send the next partial read command to NAND for execution; if they are not the same, send the next partial read command to NAND for execution; if the next partial read command is not received, return to the step of determining whether the next partial read command is received. In this way, while the current partial read command is being executed, if the next partial read command is detected, it will be immediately sent to NAND for execution, which can save the gain time minus the delay time. Figure 8 shown.
[0068] The above steps are repeated throughout the entire UFS read command execution process, and some read commands are processed by combining synchronous triggering of IWL READ and asynchronous triggering of IWL READ. Under high-pressure and low-pressure scenarios, compared with the existing method of only asynchronously triggering IWL READ, the random read performance of the present invention is improved by about 10% to 20%, which can better improve the concurrency number between NAND planes at each time point, ensure that the maximum concurrency of NAND can be achieved, thereby comprehensively improving the random read performance.
[0069] Please refer to Figure 2 , Embodiment 2 of the present invention is:
[0070] A UFS random read optimization device, comprising:
[0071] A receiving module, used for receiving a current partial read command;
[0072] A synchronous execution module is used to receive a next partial read command corresponding to the current partial read command if there is one, and the next partial read command and the current partial read command are targeted at different surfaces, and to send the current partial read command and the next partial read command to NAND for execution at the same time.
[0073] Embodiment 3
[0074] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, each step of the UFS random read optimization method in the first embodiment can be implemented.
[0075] Embodiment 4
[0076] Please refer to Figure 3An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, each step of the UFS random read optimization method in the first embodiment is implemented.
[0077] In summary, the present invention provides a UFS random read optimization method, device, readable storage medium and electronic device. If there is a next partial read command corresponding to the received current partial read command, and the next partial read command and the current partial read command target different surfaces, it means that the current IO pressure is relatively large, and the next partial read command can be received, and the current partial read command and the next partial read command are simultaneously sent to NAND for execution, saving scheduling time, and all commands are started to be executed at the same time, and the concurrency can be maximized, avoiding the gap between each command causing a delay in the subsequent commands issued, so that the gain time can be saved, and the synchronous triggering of IWL READ can be realized, thereby comprehensively improving the random read performance; in addition, while the current partial read command is being executed, if the next partial read command is received, and the next partial read command and the current partial read command target different surfaces, the next partial read command can be directly sent to NAND for execution, so as to realize the asynchronous triggering of IWL READ, which can save the gain time minus the delay time. time; at the same time, since NAND cannot execute multiple commands on the same surface, if the next partial read command targets the same surface as the current partial read command, after the current partial read command is sent to NAND for execution, the next partial read command is received and sent to NAND for execution to ensure the reliability of data reading.
[0078] In the above embodiments provided in the present application, it should be understood that the disclosed methods, devices, computer-readable storage media, and electronic devices can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple components or modules can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or components or modules, which can be electrical, mechanical or other forms.
[0079] The components described as separate components may or may not be physically separated, and the components shown as components may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the components may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0080] In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each component may exist physically separately, or two or more modules may be integrated into one module. The above integrated modules may be implemented in the form of hardware or in the form of software functional modules.
[0081] If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0082] It should be noted that, for the convenience of description, the aforementioned method embodiments are all described as a series of action combinations, but those skilled in the art should be aware that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0083] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0084] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A UFS random read optimization method, characterized in that: Includes steps: Receive the current partial read command; If there is a next partial read command corresponding to the current partial read command, and the next partial read command and the current partial read command target different surfaces, then receiving the next partial read command, and simultaneously sending the current partial read command and the next partial read command to the NAND for execution; If there is no next partial read command corresponding to the current partial read command, the current partial read command is sent to NAND for execution; The sending of the current partial read command to NAND for execution also includes: Determine whether the next partial read command is received. If the next partial read command is received, determine whether the next partial read command and the current partial read command target the same surface. If they are the same, wait for the current partial read command to be executed, and then send the next partial read command to NAND for execution. If they are not the same, send the next partial read command to NAND for execution. If the next partial read command is not received, return to execute the step of determining whether the next partial read command is received.
2. A UFS random read optimization method according to claim 1, characterized in that: After receiving the current part read command, the method further includes: If there is a next partial read command corresponding to the current partial read command, and the next partial read command targets the same surface as the current partial read command, then after the current partial read command is sent to NAND for execution, the next partial read command is received and sent to NAND for execution.
3. A UFS random read optimization method according to claim 1, characterized in that: Also includes: Check from the preset linked list whether there is a next partial read command corresponding to the current partial read command.
4. A UFS random read optimization device, characterized in that: include: A receiving module, used for receiving a current partial read command; a synchronous execution module, configured to receive a next partial read command corresponding to the current partial read command, and simultaneously send the current partial read command and the next partial read command to the NAND for execution if there is a next partial read command corresponding to the current partial read command and the next partial read command targets a different surface; If there is no next partial read command corresponding to the current partial read command, the current partial read command is sent to NAND for execution; The sending of the current partial read command to NAND for execution also includes: Determine whether the next partial read command is received. If the next partial read command is received, determine whether the next partial read command and the current partial read command target the same surface. If they are the same, wait for the current partial read command to be executed, and then send the next partial read command to NAND for execution. If they are not the same, send the next partial read command to NAND for execution. If the next partial read command is not received, return to execute the step of determining whether the next partial read command is received.
5. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step in a UFS random read optimization method as claimed in any one of claims 1 to 3 is implemented.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, each step in the UFS random read optimization method as described in any one of claims 1 to 3 is implemented.