Method and device for improving reading efficiency of embedded multimedia card
By using the processing unit of the flash memory controller in the embedded multimedia card to transmit data in advance when the amount of data in the buffer memory reaches a threshold, and performing continuity judgment and preset time waiting under small data demand, the problem of poor efficiency of open-end read commands is solved, and more efficient data reading is achieved.
Patent Information
- Application Number
- CN202411661266.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-07-23
- Filing Date
- 2024-11-20
- Publication Date
- 2026-01-23
AI Technical Summary
In existing technologies, embedded multimedia cards have poor efficiency in reading commands from the open end when the data demand is small, which leads to reduced controller performance, inability to respond to the stop command of the host device in a timely manner, and unnecessary data transmission delays and power consumption.
When the processing unit of the flash memory controller detects that the amount of data in the buffer memory has reached a threshold, it transmits the data to the host device in advance. When the data demand is small, it performs continuity judgment and preset time waiting to end the open end read command in advance.
It improves data reading efficiency, avoids unnecessary data transmission delays and energy consumption, and enhances reading performance under small data demand conditions.
Smart Images

Figure CN121387174A_ABST
Abstract
Description
Technical Field
[0001] This application relates to a storage device, and more particularly to a method and apparatus for improving read performance of an embedded multimedia card. Background Technology
[0002] The embedded Multi-Media Card (eMMC) specification defines many eMMC commands CMD0 to CMD48. The host device operates the eMMC device by sending eMMC commands. The eMMC device includes a controller and a flash memory device. After receiving the eMMC command, the controller performs actions such as reading, writing, erasing, and stopping data on the flash memory device. The detailed specifications, such as the command format and the purpose of each bit, can be found in the eMMC specification. Among them, the commands related to data reading include: (1) single-block read command CMD17 and multiple-block read command CMD18, where the command parameter field is used to carry the data start address; (2) command CMD16, sent before command CMD18, is used to indicate the length of data read; and (3) stop command CMD12. According to the eMMC specification, the host device can send command CMD18 directly to the eMMC device instead of command CMD16. Since the read length is not specified, command CMD18 in this case is called an open-ended multiple-block read command. The controller will continuously read data from the flash memory device until it receives a stop command CMD12 from the host device. This is particularly suitable for reading large amounts of required data, but relatively unsuitable for reading small amounts of required data. For ease of description, the command CMD18 below refers to the open-ended multiple-block read command, or simply the open-ended read command CMD18.
[0003] Figure 1This is a timing diagram illustrating the execution process of the open-end read command CMD18 in a scenario with low data demand, as described in the prior art. At time t1, the host device sends the open-end read command CMD18 to the eMMC device. Upon detecting this command, the processing unit within the eMMC device's controller executes the first batch of reads at time t2, reading data from the flash memory via Direct Memory Access (DMA) and temporarily storing it in buffer memory. Taking a batch size of 32KB as an example, the buffer memory stores the first batch of 32KB data at time t3. Immediately afterwards, the processing unit executes another DMA operation to transfer the first batch of 32KB data from the buffer memory to the host device. Simultaneously, the processing unit can still perform other tasks, such as detecting and executing received eMMC commands. In this example, the stop command CMD12 has not yet been received, so at time t4, the processing unit begins reading the second batch of 32KB data. At time t6, the buffer memory has stored the second batch of 32KB data, and then the processing unit executes DMA to transfer the second batch of 32KB data from the buffer memory to the host device. Meanwhile, the processing unit can still perform other tasks and read the next batch of data at time t7, repeating this process continuously. After the host device receives the first batch of 32KB data at time t5, it considers that the required data volume has been met, and therefore sends a stop command CMD12 to the eMMC device. However, the transmission and processing processes take time, and usually, the processing unit cannot detect it at time t6. Instead, it is detected at time t8 when the next batch of data has been read. At this time, the processing unit will respond to the stop command CMD12 to stop subsequent operations and stop reading from the flash memory device.
[0004] The open-source command CMD18 was originally designed for scenarios with high data volume requirements, and therefore tends to be inefficient for scenarios with low data volume requirements. For example... Figure 1 As can be seen, when the host device uses CMD18 to read only one batch of data (such as 32KB), the eMMC device processing unit will spend time t2 to t8, which is almost the time it takes for the processing unit to read three batches of 32KB data, resulting in reduced controller performance. Since some existing electronic devices, such as wearable devices, use command CMD18 to read small amounts of data, there is a need for improvement methods to enhance data reading performance. Summary of the Invention
[0005] To mitigate or eliminate the problems in the aforementioned related fields, the present invention relates to a method for improving read performance of an embedded multimedia card, executed by a processing unit of a flash memory controller. The method includes the following steps: (a) receiving a first open-end read command from a host device, wherein the parameters of the first open-end read command include a first data address; (b) batch reading a first batch of data from a flash memory device according to the first data address, storing it in a buffer memory, and during the process detecting when the amount of data stored in the buffer memory reaches a threshold amount (e.g., 4K), transmitting the threshold amount of data to the host device, wherein the threshold amount of data is less than a batch read data amount (e.g., 32K); (c) reading a second batch of data from the flash memory device and storing it in the buffer memory; and (d) detecting whether a stop command has been received from the host device, and if so, ending the execution of the first open-end read command.
[0006] In one embodiment of the method of the present invention, when the detection result of step (d) is yes, the method further includes performing the following steps: (e) detecting whether a second open terminal read command is received, wherein the parameters of the second open terminal read command include a second data address; (f) performing a continuity determination, and if yes, proceeding to step (g); and (g) when the second batch of data in the buffer memory is complete, transmitting it to the host device, and reading the third batch of data from the flash memory device and storing it in the buffer memory; wherein the continuity determination condition is: (1) the second data address is contiguous after the end address of the data read of the first open terminal read command. Since the cumulative data read amount of the first open terminal read command is often a small data demand, the continuity determination condition may optionally further include another condition: (2) the cumulative data read amount of the first open terminal read command is a small data demand.
[0007] As in one embodiment of the present invention, the method further includes the following steps after step (g): (h) determining whether the cumulative data read volume of the second open terminal read command is greater than or equal to the cumulative data read volume of the first open terminal read command; if so, proceeding to step (i); (i) waiting for a preset time; and (j) detecting whether a stop command is received from the host device.
[0008] The present invention also relates to an electronic device comprising: a host device; a flash memory device; and a flash memory controller coupled to the host device and the flash memory device, wherein the flash memory controller comprises: a host interface for coupling to the host device; a flash memory interface for coupling to the flash memory device; a buffer memory; and a processing unit coupled to the buffer memory, the host interface, and the flash memory interface, for receiving embedded multimedia card commands from the host device through the host interface and accessing the flash memory device through the flash memory interface, wherein the processing unit is configured to perform the aforementioned method for improving read performance.
[0009] The present invention also relates to a flash memory controller coupled to a host device and a flash memory device, the flash memory controller comprising: a host interface for coupling to the host device; a flash memory interface for coupling to the flash memory device; a buffer memory; and a processing unit coupled to the buffer memory, the host interface and the flash memory interface, for receiving embedded multimedia card commands from the host device through the host interface and accessing the flash memory device through the flash memory interface, wherein the processing unit is configured to perform the aforementioned method for improving read performance.
[0010] Compared to existing technologies, the method and apparatus of the present invention allow the host device to receive data and issue a stop command earlier when the data reading demand is small. This enables the open end to end the reading operation earlier, improves reading efficiency, and avoids unnecessary data transmission and delays in the transmission stop time, thus avoiding energy consumption and latency problems. Attached Figure Description
[0011] Figure 1 This is a timing diagram illustrating the command execution process on the open end under the current technology for situations with small data requirements;
[0012] Figure 2 This is a system architecture diagram of an electronic device according to an embodiment of the present invention;
[0013] Figure 3 This is a flowchart of an open-end command reading and execution method according to an embodiment of the present invention;
[0014] Figure 4 This is a timing diagram illustrating the execution process of a single open terminal reading command in a scenario with low data demand, according to an embodiment of the present invention; and
[0015] Figure 5 This is a timing diagram illustrating the execution process of the first and second commands in a continuous open terminal reading command under a small data demand situation, according to an embodiment of the present invention. Detailed Implementation
[0016] The following description illustrates preferred embodiments of the invention and is intended to describe the basic spirit of the invention, but is not intended to limit the invention. The actual invention must be understood by referring to the claims. The use of terms such as "first," "second," and "third" in the claims is to modify elements in the claims and does not indicate a priority order between elements. It must be understood that when an element is described as "connected" or "coupled" to another element, it can be a direct connection or coupling to other elements, and intermediate elements may be involved.
[0017] Please refer to Figure 2 This is a system architecture diagram of an electronic device according to an embodiment of the present invention. The electronic device 10 includes a host device 110, a controller 130, and a flash memory device 150. The electronic device 10 can be implemented in various electronic products such as computers, mobile phones, digital cameras / camcorders, and wearable devices. The controller 130 includes a host interface 131, a processing unit 134, a read-only memory (ROM) 135, a random access memory (RAM) 136, registers 137, and a flash memory interface 139. A bus 132 is used to couple the host interface 131, processing unit 134, ROM 135, RAM 136, registers 137, and flash memory interface 139 to transmit data, addresses, control signals, etc. The host device 110 and the flash memory controller 130 communicate with each other via the host interface 131 using the eMMC specification. The flash memory controller 130 and the flash memory device 150 communicate with each other via the flash memory interface 139. The processing unit 134 is used to execute the program stored in the ROM 135, including receiving and executing eMMC commands through the host interface 131 and executing these commands, as well as executing the method of the present invention. The RAM 136 can be used as a buffer memory 138 and to store data such as variables required during execution. The register 137 is used to store various parameter values according to the eMMC specification.
[0018] Please refer to Figure 3 This is a flowchart of an open-end command reading and execution method according to an embodiment of the present invention. The method consists of... Figure 2 The execution steps are described below by the processing unit 134. For ease of description, it is assumed that no open terminal read command has been received yet. Step S110: When the processing unit 134 detects that an open terminal read command CMD18 has been received from the host device 110, it proceeds to step S130; otherwise, the processing unit 134 performs other processing (not shown in the figure).
[0019] Step S131: Based on the data address specified in the received open-end read command CMD18, read the first batch of data from the flash memory device 150 and store it in the buffer memory 138. During this process, when the amount of data stored in the buffer memory 138 reaches a threshold data amount, transmit that threshold data amount to the host device 110. After reading the first batch of data, proceed to step S133. According to the eMMC specification and the number of memory chips and dies contained in the flash memory device, the amount of data read from the flash memory device 150 each time has its basic unit, such as 16KB, 32KB, or the amount of data associated with less than or equal to 64 logical block addresses (LBAs). The following explanation will use 32KB of data read per batch as an example. For ease of description, considering that the first batch of 32KB of data to be read has contiguous storage addresses in the flash memory device 150, step S131 will only require one DMA read. How the address specified in the open-end read command CMD18 corresponds to the physical address in the flash memory device 150 can be found in the eMMC specification, and will not be elaborated here. The threshold data size is a value smaller than the batch read data size; 4KB is used as an example here. During the process of storing data to the buffer memory 138, this step detects when the stored data reaches a threshold data size and then transmits that threshold data size to the host device 110. This allows the first batch of data to be transmitted to the host device 110 earlier, without waiting for the entire first batch of data to be stored in the buffer memory 138 before transmission to the host device 110 begins.
[0020] If the 32KB of data to be read is scattered in the flash memory device 150, then step S131 will require more than one DMA operation. In this case, the first DMA operation will also detect when the amount of data stored in the buffer memory 138 reaches the threshold data amount, and then transfer the threshold data amount to the host device 110, so as to achieve the effect of transferring the data in the buffer memory 138 to the host device 110 earlier.
[0021] Step S133: Read the second batch of data from the flash memory device 150 and store it in the buffer memory 138. Continuing from the end address of the first batch of data, read the second batch of 32K data from the flash memory device 150 via DMA and store it in the buffer memory 138.
[0022] Step S141: Processing unit 134 checks whether a stop command CMD12 has been received. If yes, proceed to step S143; otherwise, proceed to step S142. It is worth noting that for cases with small data demands, the host device 110 will issue a stop command CMD12 after receiving the first batch of data. Therefore, step S141 will detect that a stop command CMD12 has been received.
[0023] Step S142: The second batch of data in buffer memory 138 is transferred to host device 110, and the third batch of data is read from flash memory device 150 and stored in buffer memory 138. After step S142 (not shown in the figure), the process returns to step S141 to check if a stop command CMD12 has been received. If the result is no, an action similar to step S142 is performed: the current batch of data in buffer memory 138 is transferred to host device 110, and the next batch of data is read from flash memory device 150 and stored in buffer memory 138.
[0024] Step S143: Processing unit 134 checks whether it has received the open terminal read command CMD18. If not, the process ends; if yes, it means that after receiving the stop command CMD12 (step 141), the open terminal read command CMD18 was received immediately. In this case, proceed to step 144.
[0025] Step S144: Perform a continuity check. If the check result is yes, proceed to step S145; otherwise, end the process. The stop command CMD12 detected in step S141 indicates the end of the first open-end read command CMD18. The cumulative amount of data transmitted to the host device 110 is called the cumulative data read amount of the first open-end read command CMD18. If this cumulative data read amount is less than or equal to a preset threshold standard, such as 32KB, 16KB, or associated with less than or equal to 64 LBAs, it is defined as a small data demand. The detection of another open-end read command CMD18 immediately following indicates the start of a new open-end read command CMD18. The continuity judgment condition is as follows: (1) The data address in the current open terminal read command CMD18 is contiguous after the end address of the previous open terminal read job, that is, the data block required by the current open terminal read command CMD18 is just contiguous after the data block read by the previous open terminal read command CMD18. The end address of the previous open terminal read job can be calculated from the data address of the previous open terminal read command CMD18 and its cumulative data read volume. Since the cumulative data read volume of the previous open terminal read command CMD18 is often a small data requirement, the continuity judgment condition may optionally include another condition: (2) The cumulative data read volume of the previous open terminal read command CMD18 is a small data requirement.
[0026] Step S145: Once all the data in the buffer memory 138 has arrived, it is transferred to the host device 110, and the next batch of data is read from the flash memory device 150 and stored in the buffer memory 138. Based on condition (2) in step S144, the data read in step S133 corresponding to the first open-end read command CMD18 is exactly the data required by the second open-end read command CMD18, and therefore can be transferred to the host device 110 via DMA. This data is considered to be the data read by the second open-end read command CMD18. In addition, in this step, besides driving the DMA to transfer data to the host device 110, the processing unit 134 will also perform other processing (not shown in the figure), and after a period of time, it will read the next batch of data from the flash memory device 150 and store it in the buffer memory 138.
[0027] Step S147: Determine whether the cumulative data read volume of the current open terminal read command CMD18 is greater than or equal to the cumulative data read volume of the previous open terminal read command CMD18. If the determination is yes, since the amount of data that the new open terminal read command CMD18 wants to read may be close to the cumulative data read volume of the previous open terminal read command CMD18, especially when the cumulative data read volume of the previous open terminal read command CMD18 is a small data requirement, after waiting for a preset time in step 148, proceed to step S149, and there is a chance to detect the stop command CMD12 sent by the host device 110; if the determination is no, proceed directly to step S149.
[0028] Step S149: Processing unit 134 checks if a stop command CMD12 has been received. If yes, it indicates that the second open terminal read command CMD18 has ended. Subsequent processing steps (not shown in the figure) include: returning to the execution of steps S143 to S149. If the result of step 149 is no, it indicates that the second open terminal read command CMD18 has not yet ended. Subsequent processing steps (not shown in the figure) include: returning to the execution of steps S145 to S149.
[0029] Reference Figure 4 Based on the aforementioned Figure 3The disclosed embodiment illustrates the timing of a single open-end read command execution process in the case of small data demand. The host device 110 sends an open-end read command CMD18 at time t1, considering that the previously sent read command was not CMD18. The processing unit 134 in the controller 130 detects that this is an open-end read command CMD18 (step S110) and performs the first read at time t2 (step S131), reading the first batch of 32KB data from the flash memory device 150 via DMA and temporarily storing it in the buffer memory 138. For ease of description, considering that the batch read data size is 32KB, and the addresses of the read 32KB data in the flash memory device 150 are contiguous, at time t3 after the processing unit 134 completes the DMA read, the buffer memory 138 will have completely stored the first batch of 32KB data. During the DMA process, the processing unit 134 also detects when the data stored in the buffer memory 138 reaches a preset threshold data size; here, 4KB is used as an example. 21 The data in buffer memory 138 is transferred to host device 110. After a period of time, at time t5, host device 110 receives 32KB of data and considers it to be the required data length, therefore issuing a stop command CMD12. At time t3, after the data reading is completed, processing unit 134 spends time processing some tasks, including detecting the stop command CMD12 and the open end read command CMD18. Since there is no stop command CMD12 at this time, at time t4, processing unit 134 performs a second batch of data reading (step S133), reading a second batch of 32KB of data from flash memory device 150 and temporarily storing it in buffer memory 138, which is completed at time t6. The stop command CMD12 issued by host device 110 should arrive before time t6. At this time, the result of processing unit 134's detection (step S141) to see if it has received the stop command CMD12 will be affirmative, and therefore the execution of this open end read command ends. For the scenario where the host device 110 uses the open terminal read command CMD18 to read only a batch of data, i.e., a small data requirement, in the embodiment of the present invention, the time difference between the host device issuing the open terminal read command CMD18 and the stop command CMD12 is significantly shorter than […]. Figure 1 Existing technology. The processing unit 134 takes t2 to t6, which is also shorter than... Figure 1 The existing technology requires t2 to t8 time, thus improving the eMMC data reading performance.
[0030] Reference Figure 5 Based on the aforementioned Figure 3 The disclosed embodiment illustrates the timing of the execution processes of the first and second commands in a series of open-end read commands under conditions of low data demand. The execution process of the first open-end read command CMD18 is shown below. Figure 4 The same parts will not be described again here. After receiving 32KB of data at time t5, the host device 110 considers that the required amount of data has been met, and therefore issues a stop command CMD12. Since further data is still needed—considering that the data address is the data address of the first open-end read command CMD18 plus 32KB—it then issues a second open-end read command CMD18. At time t6, the processing unit 134 detects that this is the stop command CMD12 (step S141) and the open-end read command CMD18 (step S143), and determines that the continuity is "yes" (step S144). Then, the data read in step S143 of the first open-end read command CMD18 is exactly the data required by the second open-end read command CMD18, and it is directly transmitted to the host device 110 (step S145). This action does not affect the processing unit 134 from continuing its work. Processing unit 134 will perform other processing. After a period of time, at time t7, it will execute the next batch of data reading (step S145), reading 32KB of data from flash memory device 150 and temporarily storing it in buffer memory 138. After a period of time, at time t8, after the host device 110 receives 32KB of data, it considers that the required data amount has been met, and therefore issues a stop command CMD12. At time t9, after the data reading is completed, since it is determined that the cumulative data reading amount of the second open-end read command CMD18 has reached the cumulative data reading amount of the first open-end read command CMD18 (step S147), it waits for a preset delay time (step 148) and then proceeds at time t... 10 The system checks whether a stop command CMD12 has been received (step S149). The detection result indicates that a stop command CMD12 has been received, therefore the second open-end read command execution ends. For cases where the host device 110 uses consecutive open-end read commands CMD18 to read only a batch of data (i.e., a small data requirement), in the embodiment disclosed in this disclosure, the time difference between the host device issuing the second open-end read command CMD18 and the stop command CMD12 is significantly shorter than... Figure 1 Existing technology. The processing unit 134 takes t6 to t6 time. 10 It is also shorter than Figure 1 The existing technology requires t2 to t8 time. Therefore, the eMMC data reading performance is improved.
[0031] Referring to Table 1, a comparison table of the effects of the read command execution method according to the embodiments of the present invention and the previous read command execution method is provided. The data address is the eMMC sector address, the sector size is 512 bits, and the open-end read command start-end time is in milliseconds (ms), which refers to the time difference between the host device issuing the open-end read command CMD18 and the stop command CMD12. Compared to the prior art, the method and apparatus for processing open-end read commands according to the present invention, in cases of small data demand reads, the flash memory controller conforming to an embodiment of the present invention is expected to process the stop command issued by the host device earlier than conventional flash memory controllers. Therefore, the open-end read operation can be terminated earlier, improving read efficiency and avoiding unnecessary data transmission and delays in transmission stop time, thus preventing energy consumption and latency problems.
[0032] Table 1
[0033]
[0034] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for embedded Multi-Media Card (eMMC) read performance enhancement, performed by a processing unit of a flash controller, the method comprising: The method comprises the following steps: (a) receiving a first open-end read command from a host device, wherein parameters of the first open-end read command include a first data address; (b) reading a first batch of data from a flash memory device according to the first data address, storing the first batch of data into a buffer memory, and detecting when an amount of data stored into the buffer memory reaches a threshold data amount, and transmitting the threshold data amount of data to the host device, wherein the threshold data amount is less than a batch read data amount; (c) reading a second batch of data from the flash memory device, and storing the second batch of data into the buffer memory; and (d) detecting whether a stop command from the host device is received, and if so, ending execution of the first open-end read command. The batch read data amount is 16 KB, 32 KB, or an amount of data associated with less than or equal to 64 logical block addresses (LBAs), and the threshold data amount is 4 KB.
2. The method of enhancing read performance according to claim 1, wherein, When the detection result of step (d) is yes, the method further comprises the following steps:
3. The method of enhancing read performance of claim 1, wherein, (e) detecting whether a second open-end read command is received, wherein parameters of the second open-end read command include a second data address; (f) performing a continuity judgment, and if so, proceeding to step (g); and (g) when the second batch of data in the buffer memory is complete, transmitting the second batch of data to the host device, and reading a third batch of data from the flash memory device, and storing the third batch of data into the buffer memory; wherein the continuity judgment condition is that (1) the second data address is continuous after an end address of data read of the first open-end read command. The continuity judgment condition further comprises (2) that a cumulative data read amount of the first open-end read command is a small data requirement amount.
4. The method of enhancing read performance according to claim 3, wherein, 5. The method for improving read performance according to claim 4, wherein the small data requirement amount refers to that the cumulative data read amount of the first open-end read command is 16 KB, 32 KB, or an amount of data associated with less than or equal to 64 LBAs. After step (g), the method further comprises the following steps:
6. The method of enhancing read performance according to claim 3, wherein, (h) judging whether a cumulative data read amount of the second open-end read command is greater than or equal to a cumulative data read amount of the first open-end read command, and if so, proceeding to step (i); (i) waiting for a preset time; and (j) detecting whether a stop command from the host device is received. The electronic device comprises: a host device; 7. An electronic device, comprising: a flash memory device; and a flash memory controller coupled to the host device and the flash memory device, wherein the flash memory controller comprises: a host interface for coupling to the host device; a flash memory interface for coupling to the flash memory device; a buffer memory; and a processing unit coupled to the buffer memory, the host interface, and the flash memory interface, for receiving an embedded multimedia card command from the host device through the host interface, and accessing the flash memory device through the flash memory interface, wherein the processing unit is configured to perform the following steps: (a) receiving a first open-end read command from the host device, wherein parameters of the first open-end read command include a first data address; (b) reading a first batch of data from the flash memory device, storing to the buffer memory, and detecting when the length of data stored to the buffer memory reaches a threshold data amount, and transferring the threshold data amount of data to the host device, wherein the threshold data amount is less than the batch read data amount; (c) reading a second batch of data from the flash memory device, storing to the buffer memory; and (d) detecting whether a stop command is received from the host device, and if so, ending execution of the first open-ended read command. 8.The electronic device of claim 7, wherein, The batch read data amount is 16KB, 32KB, or an amount of data associated with less than or equal to 64 logical block addresses (LBAs), and the threshold data amount is 4KB. 9.The electronic device of claim 7, wherein, When step (d) detects that a stop command is received from the host device, the processing unit performs the following steps: (e) detecting whether a second open-ended read command is received, wherein the parameters of the second open-ended read command include a second data address; (f) performing a continuity check, and if so, proceeding to step (g); and (g) when the second batch of data in the buffer memory is complete, transferring the second batch of data to the host device, and reading a third batch of data from the flash memory device, storing to the buffer memory; wherein the continuity check condition is that (1) the second data address is sequential to the end address of the first open-ended read command. 10.The electronic device of claim 9, wherein, The continuity check condition further includes (2) the cumulative data read amount of the first open-ended read command is a small data requirement. 11.The electronic device of claim 10, wherein, The small data requirement means that the cumulative data read amount of the first open-ended read command is 16KB, 32KB, or an amount of data associated with less than or equal to 64 LBAs. 12.The electronic device of claim 9, wherein, After step (g), the following steps are further included: (h) determining whether the cumulative data read amount of the second open-ended read command is greater than or equal to the cumulative data read amount of the first open-ended read command, and if so, proceeding to step (i); (i) waiting for a predetermined time; and (j) detecting whether a stop command is received from the host device. A flash memory controller coupled to a host device and a flash memory device, the flash memory controller comprising:
13. A flash memory controller, comprising: a host interface for coupling to the host device; a flash memory interface for coupling to the flash memory device; a buffer memory; and a processing unit coupled to the buffer memory, the host interface, and the flash memory interface, for receiving an embedded multi-media card command from the host device via the host interface, and for accessing the flash memory device via the flash memory interface, wherein the processing unit is configured to perform the following steps: (a) receiving a first open-ended read command from the host device, wherein the parameters of the first open-ended read command include a first data address; (b) reading a first batch of data from the flash memory device, storing to the buffer memory, and detecting when the length of data stored to the buffer memory reaches a threshold data amount, and transferring the threshold data amount of data to the host device, wherein the threshold data amount is less than the batch read data amount; (c) reading a second batch of data from the flash memory device and storing into the buffer memory; and (d) detecting whether a stop command is received from the host device, and if so, ending the execution of the first open-ended read command.
14. The flash controller of claim 13, wherein, The batch read data amount is 16KB, 32KB, or an amount of data associated with less than or equal to 64 logical block addresses (LBA), and the threshold data amount is 4KB.
15. The flash controller of claim 13, wherein, When the result of step (d) is yes, the processing unit performs the following steps: (e) detecting whether a second open-ended read command is received, wherein the parameters of the second open-ended read command include a second data address; (f) performing a continuity judgment, and if so, proceeding to step (g); and (g) when the second batch of data in the buffer memory is complete, transmitting to the host device, and reading a third batch of data from the flash memory device and storing into the buffer memory; wherein the continuity judgment condition is that (1) the second data address is consecutive to the end address of the data read by the first open-ended read command.
16. The flash controller of claim 15, wherein, The continuity judgment condition further includes (2) the cumulative data read amount of the first open-ended read command is a small data requirement amount.
17. The flash controller of claim 16, wherein, The small data requirement amount refers to the cumulative data read amount of the first open-ended read command being 16KB, 32KB, or an amount of data associated with less than or equal to 64 LBA.
18. The flash controller of claim 15, wherein, After step (g), the following steps are further included: (h) judging whether the cumulative data read amount of the second open-ended read command is greater than or equal to the cumulative data read amount of the first open-ended read command, and if so, proceeding to step (i); (i) waiting for a predetermined time; and (j) detecting whether a stop command is received from the host device.