A pre-reading method based on a multi-core solid state disk and an electronic device

By preventing non-master cores from acquiring commands under low load, identifying continuous logical address patterns and triggering prefetching, and coordinating non-master cores to move data to the cache in parallel, the problem of low prefetching efficiency of multi-core SSDs is solved, and sequential read performance and prefetching throughput are improved.

CN123138145APending Publication Date: 2026-11-20INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611535212.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-30
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

During prefetching, uneven distribution of prefetching tasks and resource contention among multiple cores in multi-core solid-state drive controllers lead to low prefetching efficiency and failure to fully utilize the parallel computing capabilities of multiple cores, resulting in low sequential read prediction accuracy and insufficient prefetching throughput.

Method used

When the main control core is under low load, it prevents non-main control cores from obtaining host read commands. The main control core identifies continuous logical address patterns and triggers prefetching, coordinating non-main control cores to move data from flash memory chips to cache space in parallel, thus recycling cache resources.

Benefits of technology

It improves the pre-read hit rate and data filling efficiency in sequential read scenarios, significantly enhances read performance, and effectively masks NAND flash memory read latency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123138145A_ABST
    Figure CN123138145A_ABST
Patent Text Reader

Abstract

The application discloses a pre-reading method based on a multi-core solid state disk and electronic equipment, and relates to the technical field of computers, and comprises the following steps: when a master core is in a low load state, preventing non-master cores from obtaining a host reading command, so that the master core obtains a complete and continuous command view to determine a pre-reading starting condition; when the pre-reading starting condition is met, determining a target non-master core by the master core and allocating a logical address, and the target non-master core saves pre-reading data from a flash memory particle to a cache space in parallel; when a subsequent reading command hits the cache, data is directly returned, so that the problems of command sequence fragmentation, inaccurate sequential reading prediction and low pre-reading cache resource utilization caused by multi-core parallel processing are solved, and the technical effects of improving pre-reading accuracy, parallel pre-reading efficiency and sequential reading performance are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a pre-read method and electronic device based on a multi-core solid-state drive. Background Technology

[0002] Solid-state drives (SSDs), with their high bandwidth and low latency, have become the mainstream devices in the data storage industry. One of their core performance bottlenecks lies in the latency of reading data from NAND (NAND Flash Memory). To mask this latency, read-ahead technology is widely used, which predicts the data the host is about to access and loads it into RAM (Random Access Memory) in advance. However, read-ahead technology under multi-core SSD controller architecture faces the following challenges: First, the parallel processing of input / output commands by multiple cores makes it difficult for a single core to obtain a global, continuous view of the command sequence, leading to inaccurate access pattern predictions; second, RAM resources are limited, and blind or excessive read-ahead can cause cache pollution, which in turn reduces performance; third, read-ahead decisions are usually made by a single core, failing to fully utilize the parallel computing power of multiple cores, and failing to maximize read-ahead throughput when sequential read patterns are detected. Summary of the Invention

[0003] This application provides a pre-reading method and electronic device based on a multi-core solid-state drive, which at least solves the problem of low pre-reading efficiency caused by uneven distribution of pre-reading tasks and competition for pre-reading resources among multiple cores when performing pre-reading in related technologies.

[0004] This application provides a prefetching method based on a multi-core solid-state drive (SSD). The prefetching method includes: monitoring the SSD in response to power-on, wherein the SSD includes a main controller core, non-main controller cores, flash memory chips, and pre-allocated cache space; disabling the non-main controller core from acquiring host input / output commands (including host read commands) in response to the main controller core being in a low-load state; and determining whether the SSD meets the prefetching enable condition based on the logical address corresponding to the prior read command acquired by the main controller core. The command is the host read command before the pre-read operation is triggered; in response to the solid-state drive meeting the pre-read enable condition, the host core determines the target non-host core and allocates a pre-read logical address range to the target non-host core, where the target non-host core is the non-host core participating in the pre-read operation; the target non-host core saves the pre-read data corresponding to the pre-read logical address range from the flash memory chip to the cache space; it receives subsequent read commands and returns the pre-read data corresponding to the subsequent read commands in the cache space to the host in response to the subsequent read commands, where the subsequent read commands are the host read commands after the pre-read operation is completed.

[0005] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for implementing the steps of any of the above-described pre-read methods based on a multi-core solid-state drive when executing the computer program.

[0006] This application allows the main control core to exclusively acquire and serially process host read commands under low load, reassembling the command sequence that was originally scattered by multi-core parallelism into a complete and continuous view. This enables accurate identification of sequential read patterns and triggering prefetching based on continuous logical addresses, avoiding prediction inaccuracies caused by command sequence fragmentation. Simultaneously, after triggering prefetching, the main control core coordinates multiple idle non-main control cores to move prefetched data from flash memory chips to cache space in parallel, transforming multi-core parallelism from an interference factor into a parallel transport advantage. Furthermore, by leveraging the idle reclamation and refilling of cache space data groups after reading, a cyclical rolling supply of prefetched data is achieved. Therefore, it can solve the technical problems of low sequential read prediction accuracy, insufficient prefetch throughput, and cache resources being easily filled at once in multi-core SSDs, thus preventing continuous prefetching. This achieves the technical effects of improving prefetch hit rate and data filling efficiency in sequential read scenarios, effectively masking NAND flash memory read latency, and significantly improving read performance. Attached Figure Description

[0007] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0008] Figure 1 A flowchart illustrating a pre-read method based on a multi-core solid-state drive provided in this application embodiment; Figure 2 A detailed flowchart of a pre-read method based on a multi-core solid-state drive provided for embodiments of this application; Figure 3 This is a schematic diagram of an electronic device for implementing a pre-read method based on a multi-core solid-state drive, as provided in an embodiment of this application. Detailed Implementation

[0009] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0010] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0011] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0012] Embodiments of this application provide a pre-read method based on a multi-core solid-state drive, such as... Figure 1 As shown, the prefetching method based on a multi-core solid-state drive (SSD) includes: monitoring the SSD in response to power-on, wherein the SSD includes a main controller core, non-main controller cores, flash memory chips, and pre-allocated cache space; disabling the non-main controller cores from acquiring host input / output commands, including host read commands, in response to the main controller core being in a low-load state; and determining whether the SSD meets the prefetching enable condition based on the logical address corresponding to the prefetching command acquired by the main controller core, wherein the prefetching operation is triggered before the prefetching command is executed. The system receives host read commands; in response to the solid-state drive meeting the pre-read enable condition, it determines the target non-controller core through the main controller core and allocates a pre-read logical address range to the target non-controller core, where the target non-controller core is the non-controller core participating in the pre-read operation; the target non-controller core saves the pre-read data corresponding to the pre-read logical address range from the flash memory chip to the cache space; it receives subsequent read commands and returns the pre-read data corresponding to the subsequent read commands in the cache space to the host in response to the subsequent read commands, where the subsequent read commands are the host read commands after the pre-read operation is completed.

[0013] Specifically, the above method prohibits non-master cores from obtaining host read commands when the master core is under low load, so that the master core can obtain a complete and continuous command view to accurately determine the prefetching enable condition. After the prefetching is triggered, the master core coordinates the target non-master cores to move the prefetched data from the flash memory to the cache space in parallel. When the subsequent read command hits the cache, it can directly return the data, thereby masking the NAND read latency and improving sequential read performance.

[0014] In a specific implementation, 2MB of DRAM (Dynamic Random Access Memory) space is allocated inside the solid-state drive (SSD) for pre-reading, waiting to store the pre-read data. When the SSD is powered on, it enters the initial state, at which point only Core 0 (the main control core) is in a state that can receive I / O commands, while the other 7 cores are in a sleep state.

[0015] In specific implementations, such as Figure 2 As shown, this application uses an eight-core solid-state drive controller (Core0 to Core7) as an example, which is configured with sufficient DRAM capacity and divided into multiple 64KB data groups: 1. Dynamic Load Awareness and Task Scheduling: The SSD firmware continuously monitors the SSD's system load. When under low-load, read-only load conditions, the system suspends all cores except Core0 from acquiring new I / O commands. This ensures that all subsequent host read commands are processed serially by Core0, allowing Core0 to obtain a complete and continuous command flow view, laying the foundation for accurately identifying continuous read characteristics.

[0016] 2. Sequence-based pattern recognition and triggering mechanism: After other Cores are paused from acquiring new I / O commands, Core0 begins pattern recognition. The recognition method is as follows: when processing each host read command, its ending logical address is recorded and compared with the starting logical address of the next read command, and their continuity is analyzed in real time. When a strictly continuous sequence of logical addresses is detected for the fourth consecutive preset value (e.g., 4 times), it is determined that the host has entered a stable sequential read mode, and the global pre-read process is triggered.

[0017] 3. Multi-core Parallel Collaborative Prefetching: Once prefetching is triggered, Core0, acting as the coordinator, immediately notifies all seven other idle Cores (Core0 needs to first send messages to the seven idle Cores to confirm that they have completed processing all previously received IO commands). These Cores reply to Core0 with messages regarding whether they will participate in prefetching based on their own status. For example, Cores currently handling garbage collection or table modification can opt out of prefetching to avoid impacting the performance of garbage collection or table modification. Cores participating in prefetching no longer handle regular IO but instead prefetch data from the NAND flash memory to pre-divided data groups in RAM in parallel, based on the predicted logical address start point. Each Core is responsible for prefetching multiple fixed data groups (for example, the number of data groups is determined by the number of Cores participating in prefetching; each Core is responsible for four groups, each group being 64KB in size, and four planes being 64KB). This fully utilizes the internal data path of the SSD controller and the computing power of multiple Cores, achieving an extremely high prefetch data fill rate.

[0018] 4. Efficient Data Service and Cache Management: After pre-reading is complete, these data groups serve as a high-speed cache. Subsequent host read commands will first check if their logical address matches any of these data groups. If a match is found, the data is directly transferred from RAM to the host, completely avoiding NAND read latency. The system dynamically manages the state of the data groups. Once all data in a data group has been read, it is immediately marked as free and refilled by its respective core with new pre-read data, achieving cyclical utilization of the pre-read cache.

[0019] Furthermore, before receiving subsequent read commands, the pre-read method based on multi-core SSDs also includes: in response to the target non-controller cores completing the saving of pre-read data, the controller core sets the pre-read state of the SSD to an enabled state; after returning the pre-read data corresponding to the subsequent read command in the cache space to the host, the pre-read method based on multi-core SSDs also includes: determining whether the SSD meets the pre-read disable condition based on the command type information received by the controller core, or the data hit information of the cache space for the subsequent read command; in response to the SSD meeting the pre-read disable condition, determining whether to set the pre-read state to a disabled state based on the cache space's transfer status information for the subsequent read command.

[0020] Specifically, the above method sets the pre-read state to enabled after the pre-read data is saved, and determines whether the pre-read disable condition is met during subsequent read command processing based on the command type or data hit status. At the same time, it combines the cache transfer status information to determine when to actually disable the pre-read state, thereby avoiding data inconsistency or performance jitter caused by forcibly disabling it while the pre-read data is still being transferred, and achieving a smooth and safe switch of the pre-read state.

[0021] In a specific implementation, read-ahead is disabled: When Core 0 receives a non-read command or the read command's position is not hit, read-ahead needs to be disabled. The logic for disabling read-ahead is as follows: if no read command is moving data from DRAM, the read-ahead state is directly set to None. If a read command is moving data from DRAM, a flag is set to Disable (read-ahead disabled flag). After the corresponding read command's data movement operation is completed, the read-ahead state is set to None (disabled state). After setting the Disable flag, all read commands that have hit read-ahead but are in the waiting read-ahead completion state will no longer move data from DRAM and will instead proceed with the normal read process. Read-ahead will only be initiated again if the read-ahead state is None and the read-ahead enable condition is met again.

[0022] Furthermore, based on the command type information received by the main control core, or the data hit information of the cache space for subsequent read commands, it is determined whether the solid-state drive meets the pre-read disable condition, including: in response to the command type information being a host non-read command, or the data hit information indicating that there is no pre-read data corresponding to the subsequent read command in the cache space, it is determined that the solid-state drive meets the pre-read disable condition; based on the cache space's transfer status information for subsequent read commands, it is determined whether to set the pre-read state to the disabled state, including: in response to the transfer status information indicating that there is no subsequent read command transferring pre-read data from the cache space, the pre-read state is set to the disabled state; in response to the transfer status information indicating that there is a subsequent read command transferring pre-read data from the cache space, a pre-read disable flag is set, and after the subsequent read command transferring pre-read data from the cache space completes, the pre-read state is set to the disabled state; wherein, the pre-read disable flag is used to indicate that the pre-read state is to be disabled, and after the pre-read disable flag is set, the subsequent read command transferring pre-read data from the cache space is configured to read the corresponding data from the flash memory chip.

[0023] Specifically, the above method uses non-read commands on the host or cache misses as the conditions for disabling pre-read. When there are subsequent read commands that are moving pre-read data from the cache, a pre-read disabling flag is set, and the pre-read state is disabled after the data is moved. After the flag is set, the waiting read commands are redirected to the normal read process, thereby ensuring data correctness while stopping invalid pre-read in a timely manner, avoiding cache pollution and resource waste.

[0024] Furthermore, the solid-state drive is monitored, including: monitoring the number of input / output commands concurrently processed by the main control core within a preset time window, or monitoring the total data volume of input / output commands processed by the main control core; determining that the main control core is in a low-load state in response to the number of consecutive times the number of input / output commands is less than a first preset value being greater than or equal to a second preset value, or the total data volume being less than a third preset value; and determining that the main control core is in a high-load state in response to the number of consecutive times the number of input / output commands is less than the first preset value being less than the second preset value, or the total data volume being greater than or equal to a third preset value.

[0025] Specifically, the above method monitors the number of concurrent IO commands or the total amount of data processed by the main control core within a preset time window, and determines the low load or high load state by the number of consecutive times or the data volume threshold. In this way, the system load can be accurately identified in a simple and quantifiable manner, providing a reliable basis for whether to enter the serialized read-ahead mode.

[0026] In a specific implementation, load monitoring is performed as follows: The SSD firmware detects that within the most recent time window, if the number of concurrent IO commands processed by Core0 is lower than a second preset value (e.g., 5 times) for a consecutive period below a first preset value (e.g., 4), or if the total IO data volume of the processed commands is lower than a third preset value (1MB), it is determined to be a low-load state; otherwise, it is determined to be a high-load state. Task scheduling is performed as follows: In a low-load state, the SSD firmware pauses the IO acquisition logic of Cores 1 through 7, and only Core0 processes IO commands sent by the host. In a high-load state, the SSD firmware controls Core0 to notify the other 7 Cores to start receiving IO commands. After the pre-read condition is met, the pre-read sends a message to notify the other 7 Cores, and determines whether the corresponding Core can initiate pre-read based on the response messages from the 7 Cores (Cores participating in garbage collection or table modification do not initiate pre-read to avoid affecting performance; if any Core has non-read IO commands that have not been processed, Core0 cannot initiate pre-read either). Cores can only initiate pre-read under low-load conditions.

[0027] Furthermore, based on the logical address corresponding to the prior read command obtained by the main control core, it is determined whether the solid-state drive meets the pre-read enable condition, including: sequentially obtaining prior host commands and recording the command type of the prior host command and the logical address of the prior read command, wherein the prior host command is the host input / output command before the pre-read operation is triggered, and the prior host command is included in the prior read command; based on the command types of the previous prior host command and the current prior host command, it is determined whether the command type condition in the pre-read enable condition is met; in response to the fact that the command types of the previous prior host command and the current prior host command are both host read commands, based on the logical address of the previous prior read command and the logical address of the current prior read command, it is determined whether to update the consecutive count in the logical address sequence; in response to the fact that the consecutive count in the logical address sequence reaches the fourth preset value, it is determined that the solid-state drive meets the pre-read enable condition.

[0028] Specifically, the above method records the command type and read command logical address of the host command in sequence, first judges the command type condition, and then updates the number of consecutive logical address sequences based on whether adjacent logical addresses are consecutively updated based on the consecutive read commands. When the number of consecutive reads reaches a preset value, pre-reading is triggered, thereby accurately identifying stable sequential read patterns and reducing false triggering.

[0029] In a specific implementation, pattern recognition proceeds as follows: Core0 processes the first read command, LBA (Logical Block Address) = 1000, and records it. Core0 processes the second read command, LBA = 1001, and records it. The expected sequence [1000, 1001] is continuous. If the second command is not a read command or is not continuous, the LBA recorded by the first read command is cleared, and the system waits for the next read command to re-record. Core0 processes the third read command, LBA = 1002, and records it. The expected sequence [1000, 1001, 1002] is continuous. If the third command is not a read command or is not continuous, the system clears the LBA recorded by all read commands, and the system waits for the next read command to re-record. Core0 processes the fourth read command, LBA = 1003, and records it. The expected sequence [1000, 1001, 1002, 1003] is continuous. If the trigger condition is met, and the fourth command is not a read command or is not continuous, the system clears the LBA recorded by all read commands, and the system waits for the next read command to re-record.

[0030] Furthermore, based on the command types of the previous prior host command and the current prior host command, it is determined whether the command type condition in the read-ahead enable condition is met, including: if the command type of both the previous prior host command and the current prior host command is a host read command, it is determined that the command type condition is met; if the command type of either the previous prior host command or the current prior host command is a host non-read command, it is determined that the command type condition is not met; the logical address sequence is cleared, and the system waits for the next prior host command.

[0031] Specifically, the above method clarifies that the command type condition is satisfied only when two adjacent preceding host commands are both host read commands. Once a host non-read command appears, the logical address sequence is cleared and the system waits for the next command, thereby ensuring the purity of pattern recognition and avoiding interference from non-read commands with sequential read judgment.

[0032] Further, based on the logical address of the previous read-first command and the logical address of the current read-first command, it is determined whether to update the consecutive count in the logical address sequence, including: in response to the logical address of the previous read-first command being consecutive with the logical address of the current read-first command, adding the logical address of the previous read-first command to the logical address sequence and updating the consecutive count in the logical address sequence; in response to the logical address of the previous read-first command being discontinuous with the logical address of the current read-first command, clearing the logical addresses in the logical address sequence and resetting the consecutive count in the logical address sequence to zero; in response to the logical addresses in the logical address sequence being cleared, waiting for the next read-first command to record the corresponding logical address.

[0033] Specifically, the above method adds the previous logical address to the sequence and updates the consecutive count when adjacent read command logical addresses are consecutive, and clears the sequence and resets the consecutive count to zero when they are not consecutive, thereby maintaining the sequential read sequence in real time and accurately, and ensuring that pre-read triggering is based on a truly consecutive sequential access mode.

[0034] Furthermore, determining the target non-master control core through the master control core includes: sending a pre-read request message to the non-master control core through the master control core, and receiving a response message from the non-master control core in response to the pre-read request message, wherein the response message is used to indicate whether the non-master control core participates in the pre-read operation; in response to the response message indicating participation in the pre-read operation, the non-master control core corresponding to the response message is determined as the target non-master control core; in response to the response message indicating non-participation in the pre-read operation, the non-master control core corresponding to the response message is prohibited from participating in this pre-read operation.

[0035] Specifically, the above method determines which non-master cores participate in pre-reading by sending pre-read request messages to non-master cores and receiving response messages, thereby avoiding cores that are performing tasks such as garbage collection or table modification being forced to participate in pre-reading. This utilizes the parallel capabilities of multi-cores without affecting the performance of other critical background tasks.

[0036] Furthermore, a pre-read logical address range is allocated to the target non-master core, including: determining the starting logical address of the pre-read logical address range according to the logical address sequence; dividing the pre-read logical address range starting from the starting logical address into pre-read address sub-ranges corresponding one-to-one with the target non-master cores according to the number of target non-master cores; and sending the pre-read address sub-ranges to the corresponding target non-master cores so that the target non-master cores can read the pre-read data corresponding to the pre-read address sub-ranges from the flash memory chips in parallel.

[0037] Specifically, the above method determines the pre-read starting logical address based on the logical address sequence, and divides the pre-read logical address range into one-to-one corresponding sub-ranges according to the number of target non-master control cores participating in the pre-read, so that each target non-master control core reads the data in its respective sub-range in parallel, thereby making full use of the multi-core parallel capability and internal data path, and significantly improving the pre-read data filling efficiency.

[0038] In a specific implementation, collaborative prefetching: Core0 calculates the starting LBA for prefetching as 1004. Core0 notifies Cores 1 through 7 that prefetching can begin, and Cores 1 through 7 reply with messages confirming whether prefetching can be initiated. Allocation strategy: If all 7 cores can initiate prefetching, then: Core1 prefetches LBA range 1004-1155 (4 groups), Core2 prefetches LBA range 1156-1307 (4 groups), ..., and so on. The seven cores prefetch a total of 7 × 4 × 64KB = 1792KB of data into RAM. Data service: The host issues a read command requesting LBA=1100. This data is located in the second data group handled by Core 1. The controller directly reads the corresponding data from the RAM within this data group and returns it to the host, without accessing NAND.

[0039] Furthermore, the cache space is divided into multiple data groups. After the target non-controller core saves the pre-read data to the cache space, the pre-read method based on the multi-core SSD also includes: monitoring the data read status in multiple data groups; in response to the fact that all pre-read data in the data group has been read by subsequent read commands, marking the data group as idle; determining a new pre-read logical address range through the controller core, and allocating the new pre-read logical address range to the target non-controller core to which the data group belongs; saving the pre-read data corresponding to the new pre-read logical address range from the flash memory chip to the data group marked as idle through the target non-controller core to which the data group belongs; in response to the data group being refilled with pre-read data, updating the status of the data group from idle to occupied; in response to the data group being refilled with pre-read data and then read again, repeating the above steps until the SSD meets the pre-read disable condition.

[0040] Specifically, the above method divides the cache space into multiple data groups and monitors their data read status. After all the pre-read data in a data group has been read by subsequent read commands, it is marked as free. Then, the master control core determines a new pre-read logical address range and allocates it to the target non-master control core to which the data group belongs. The target non-master control core then refills the free data group with the new pre-read data from the flash memory chip and updates its status to occupied after filling. This process is repeated until the pre-read shutdown condition is met, thereby realizing the recycling of the pre-read cache and dynamic rolling pre-read. This avoids the problem of not being able to continue pre-reading after the cache space is filled at once, and can continuously fill the released data group with new predicted data in continuous sequential read scenarios, maintaining the continuous hit capability of pre-read data for host read commands, further masking NAND read latency and improving sequential read performance.

[0041] In a specific implementation, resource reclamation occurs when all data in LBA1004-1067 (corresponding to the first data set of Core1) has been read away, and the data set is marked as Free. Core1 immediately initiates a new prefetch, filling the Free data set with new predicted data (such as LBA2692-2755).

[0042] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0043] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above embodiments of the pre-read method based on a multi-core solid-state drive.

[0044] When the program instructions are read and executed by one or more processors, they can also perform operations corresponding to the steps in the above method embodiments, as described above, and will not be repeated here. Reference Figure 3 This example illustrates the architecture of an electronic device, which may include a processor 310, a video display adapter 311, a disk drive 312, an input / output interface 313, a network interface 314, and a memory 320. The processor 310, video display adapter 311, disk drive 312, input / output interface 313, network interface 314, and memory 320 can communicate with each other via a communication bus 330.

[0045] The processor 310 can be implemented using a general-purpose central processing unit (CPU), microprocessor, application specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to achieve the technical solution provided in this application.

[0046] The memory 320 can be implemented as a read-only memory (ROM), random access memory (RAM), static storage device, dynamic storage device, etc. The memory 320 can store an operating system 321 for controlling the operation of the electronic device 300, and a basic input / output system (BIOS) 322 for controlling the low-level operations of the electronic device 300. Additionally, it can store a web browser 323, data storage management 324, and an icon / font processing system 325. The icon / font processing system 325 can be the application program that specifically implements the aforementioned steps in this embodiment. In summary, when implementing the technical solution provided in this application through software or firmware, the relevant program code is stored in the memory 320 and executed by the processor 310.

[0047] Input / output interface 313 is used to connect input / output modules to realize information input and output. Input / output modules can be configured as components in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touch screens, microphones, various sensors, etc., and output devices may include displays, speakers, vibrators, indicator lights, etc.

[0048] Network interface 314 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0049] Bus 330 includes a pathway for transmitting information between various components of the device, such as processor 310, video display adapter 311, disk drive 312, input / output interface 313, network interface 314, and memory 320.

[0050] In addition, the electronic device 300 can also obtain information on specific claim conditions from the virtual resource object claim condition information database (not shown in the figure) for use in condition judgment.

[0051] It should be noted that although the above-described electronic device 300 only shows a processor 310, a video display adapter 311, a disk drive 312, an input / output interface 313, a network interface 314, a memory 320, and a bus 330, in specific implementations, the electronic device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the solution of this application, and does not necessarily include all the components shown in the figures.

[0052] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause an electronic device (which may be a personal computer, cloud server, or network device, etc.) to execute the methods of various embodiments or some parts of the embodiments of this application.

[0053] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above embodiments of the pre-read method based on a multi-core solid-state drive when it is run.

[0054] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0055] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above embodiments of the pre-read method based on a multi-core solid-state drive.

[0056] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above embodiments of the pre-read method based on a multi-core solid-state drive.

[0057] Any of the components, modules, units, parts, methods, and operations described herein can be implemented using software, firmware, hardware (e.g., fixed logic circuitry), manual processing, or any combination thereof. Alternatively or additionally, any functionality described herein can be executed at least in part by one or more hardware logic components, such as, but not limited to, a central processing unit (CPU), a field-programmable gate array (FPGA), an application-specific integrated circuit (ASIC), an application-specific standard product (ASSP), a system-on-a-chip (SoC), a complex programmable logic device (CPLD), a microprocessor (MCU), etc. The terms "system," "computing device," or "apparatus" as used herein encompass various means, devices, and machines for processing data, including, for example, one or more programmable processors, computers, SoCs, or combinations thereof. The apparatus may also include code that creates an execution environment for the computer program in question, such as code constituting processor firmware, a protocol stack, a database management system, an operating system, a cross-platform runtime environment, a virtual machine, or one or more combinations thereof. The aforementioned computer program (also known as a program, software, software application, app, script, or code) can be written in any form of programming language, including compiled or interpreted languages, declarative or procedural languages, and can be deployed in any form, including as a standalone program or as a module, component, subroutine, object, or other unit suitable for a computing environment.

[0058] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0059] The foregoing has provided a detailed description of a pre-read method and electronic device based on a multi-core solid-state drive provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and its core ideas. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A pre-read method based on a multi-core solid-state drive, characterized in that, The method includes: In response to power-on of the solid-state drive (SSD), the SSD is monitored, wherein the SSD includes a main controller core, a non-main controller core, flash memory chips, and pre-allocated cache space; In response to the main control core being in a low-load state, the non-main control core is prohibited from obtaining host input / output commands through the main control core, wherein the host input / output commands include host read commands; Based on the logical address corresponding to the read-before command obtained by the main control core, it is determined whether the solid-state drive meets the read-before enabling condition, wherein the read-before command is the host read command before the read-before operation is triggered; In response to the solid-state drive meeting the pre-read enable condition, the target non-controller core is determined by the main control core, and a pre-read logical address range is allocated to the target non-controller core, wherein the target non-controller core is the non-controller core participating in the pre-read operation; The target non-master core saves the pre-read data corresponding to the pre-read logical address range from the flash memory chip to the cache space. The system receives a subsequent read command and returns the pre-read data corresponding to the subsequent read command in the cache space to the host in response to the subsequent read command, wherein the subsequent read command is the host read command after the pre-read operation is completed.

2. The method according to claim 1, characterized in that, Before receiving subsequent read commands, the method further includes: In response to the fact that all the target non-controller cores have completed the saving of the pre-read data, the pre-read state of the solid-state drive is set to enabled by the controller core; After returning the pre-read data corresponding to the subsequent read command in the cache space to the host, the method further includes: Based on the command type information received by the main control core, or the data hit information of the cache space for the subsequent read command, determine whether the solid-state drive meets the pre-read disable condition; In response to the solid-state drive meeting the read-ahead disable condition, the system determines whether to set the read-ahead state to disable based on the cache space's transfer status information for the subsequent read command.

3. The method according to claim 2, characterized in that, The step of determining whether the solid-state drive meets the read-before-read disable condition based on the command type information received by the main control core, or the data hit information of the cache space for the subsequent read command, includes: In response to the command type information being a host non-read command, or the data hit information indicating that there is no pre-read data in the cache space corresponding to the subsequent read command, it is determined that the solid-state drive meets the pre-read disable condition; The step of determining whether to set the pre-read state to a disabled state based on the cache space's transport status information for the subsequent read command includes: In response to the transport status information indicating that there are no subsequent read commands transporting pre-read data from the cache space, the pre-read status is set to the off state; In response to the transport status information indicating the existence of a subsequent read command that is transporting pre-read data from the cache space, a pre-read disable flag is set, and after the subsequent read command that is transporting pre-read data from the cache space is completed, the pre-read status is set to the disabled state; The prefetch disable flag is used to indicate that the prefetch state is to be disabled. After the prefetch disable flag is set, subsequent read commands that are moving prefetch data from the cache space are configured to read the corresponding data from the flash memory chip.

4. The method according to any one of claims 1-3, characterized in that, The monitoring of the solid-state drive includes: Within a preset time window, monitor the number of input / output commands processed concurrently by the main control core, or monitor the total data volume of input / output commands processed by the main control core; In response to the number of consecutive times the number of input / output commands is less than a first preset value being greater than or equal to a second preset value, or the total data volume being less than a third preset value, it is determined that the main control core is in the low load state; In response to the number of consecutive times the number of input / output commands is less than the first preset value being less than the second preset value, or the total data volume being greater than or equal to the third preset value, it is determined that the main control core is in a high-load state.

5. The method according to claim 4, characterized in that, The step of determining whether the solid-state drive meets the read-before-read enable conditions based on the logical address corresponding to the read-before command obtained by the main control core includes: The preceding host commands are sequentially obtained, and the command type of the preceding host commands and the logical address of the preceding read commands are recorded. The preceding host commands are the host input / output commands that were triggered before the pre-read operation, and the preceding host commands include the preceding read commands. Based on the command types of the previous prior host command and the current prior host command, determine whether the command type condition in the read-ahead enable condition is met; In response to the fact that both the previous prior host command and the current prior host command are of the host read command type, it is determined whether to update the consecutive number of times in the logical address sequence based on the logical address of the previous prior read command and the logical address of the current prior read command; When the number of consecutive occurrences in the logical address sequence reaches a fourth preset value, it is determined that the solid-state drive meets the read-ahead enable condition.

6. The method according to claim 5, characterized in that, The step of determining whether the command type condition in the read-ahead enable condition is met based on the command types of the previous prior host command and the current prior host command includes: Since both the previous prior host command and the current prior host command are of the host read command type, it is determined that the command type condition is satisfied; In response to the fact that the command type of the previous or current prior host command is a host non-read command, it is determined that the command type condition is not met. Clear the logical address sequence and wait for the next preceding host command.

7. The method according to claim 6, characterized in that, The step of determining whether to update the consecutive counts in the logical address sequence based on the logical address of the previous read command and the logical address of the current read command includes: In response to the logical address of the previous read command being consecutive to the logical address of the current read command, the logical address of the previous read command is added to the logical address sequence, and the consecutiveness of the logical address sequence is updated. In response to the logical address of the previous read-first command being discontinuous with the logical address of the current read-first command, the logical addresses in the logical address sequence are cleared, and the consecutive count in the logical address sequence is reset to zero. In response to the logical address sequence being cleared, the system awaits the next read command to record the corresponding logical address.

8. The method according to claim 7, characterized in that, The step of determining the target non-master core through the master core includes: The main control core sends a pre-read request message to the non-main control core and receives a response message from the non-main control core in response to the pre-read request message, wherein the response message is used to indicate whether the non-main control core participates in the pre-read operation; In response to the response message indicating participation in the pre-read operation, the non-master core corresponding to the response message is identified as the target non-master core; The response message indicates that the user will not participate in the pre-read operation, and the non-master core corresponding to the response message is prohibited from participating in this pre-read operation.

9. The method according to claim 8, characterized in that, The allocation of a pre-read logical address range for the target non-master core includes: Based on the logical address sequence, determine the starting logical address of the pre-read logical address range; Based on the number of target non-master cores, the pre-read logical address range starting from the starting logical address is divided into pre-read address sub-ranges corresponding one-to-one with the target non-master cores; The prefetch address range is sent to the corresponding target non-master core so that the target non-master core can read the prefetch data corresponding to the prefetch address range from the flash memory chip in parallel.

10. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the prefetching method based on a multi-core solid-state drive as described in any one of claims 1-9 when executing the computer program.