Model slicing prefetching method and device of solid state disk, solid state disk and medium
By monitoring the read request sequence in real time and using triple condition judgment, the next fragment address is accurately calculated and the prefetched data is marked as the highest priority. This solves the problem of low fragment prefetch accuracy in solid-state drive models and improves inference performance and pipeline continuity.
Patent Information
- Application Number
- CN202611302607.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-26
- Publication Date
- 2026-11-17
AI Technical Summary
Existing solid-state drives have low accuracy in model sharding prefetching, which affects inference performance. Especially when the read latency of QLC flash memory is high, the prefetched data does not match the host requirements, affecting the continuity and efficiency of the inference pipeline.
By monitoring the logical block address and request length of the host read request sequence in real time, a triple condition judgment mechanism is used to identify the model's fragment loading mode, accurately calculate the starting address of the next fragment, and mark the prefetched data as the highest priority to ensure that the data is loaded into the cache in a timely manner.
It improves prefetch accuracy, reduces inference pauses caused by cache misses, enhances the continuity and efficiency of model loading, adapts to different model sharding specifications, and requires no additional host support.
Smart Images

Figure CN123114366A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of solid-state drive (SSD) technology, and more particularly to a model sharding prefetching method, apparatus, SSD, and medium for SSDs. Background Technology
[0002] With the rapid development of artificial intelligence technology, the demand for deploying Large Language Models (LLMs) in edge computing devices is growing. Scenarios such as edge AI inference devices, autonomous driving domain controllers, 5G MEC edge cloud, and industrial IoT devices all require local storage and loading of large-scale model parameters. Due to the massive number of model parameters, models are typically stored in shards on solid-state drives (SSDs) and loaded into memory or GPU memory as needed during inference.
[0003] Quad-Level Cell (QLC) flash memory has become the preferred medium for high-capacity storage in edge AI devices due to its high storage density and low cost. However, QLC flash memory inherently suffers from high read latency, which is typically 2 to 3 times that of Triple-Level Cell (TLC) flash memory. In model inference scenarios, the host needs to continuously read multiple model fragments. If the read latency of each fragment is high, it will cause frequent pauses in the inference pipeline, severely impacting inference performance.
[0004] To mitigate the performance impact of flash memory read latency, existing technologies typically employ a prefetch mechanism. This involves loading the data for the next fragment from the flash memory into the cache while the host is reading the current fragment, ensuring that subsequent read requests can hit the cache. However, existing SSD prefetch mechanisms have the following shortcomings in AI model fragment loading scenarios: First, current prefetching techniques often rely on simple sequential read detection or historical access frequency for prefetching decisions, leading to a mismatch between the prefetched data and the host's actual needs, resulting in a low prefetch hit rate. When prefetch accuracy is insufficient, host read requests may miss the prefetch buffer, requiring data to be read again from the flash memory, causing inference pipeline pauses and severely impacting inference performance. Second, existing SSD read request queues typically employ first-come, first-served (FFS) or round-robin scheduling strategies, treating prefetch commands the same as normal host read requests. This fails to consider the specific requirements for data loading timeliness in model inference scenarios, potentially causing the host to wait for data completion, resulting in inference thread pauses. Furthermore, QLC flash memory read latency fluctuates significantly. When the current data read time exceeds expectations, existing prefetching techniques cannot dynamically adjust the prefetching strategy, resulting in subsequent data not being loaded into the cache in a timely manner, affecting the continuity of the inference pipeline. In addition, existing prefetching techniques typically use fixed prefetching granularity or rely on host notifications. In practical applications, fixed prefetching granularity cannot adapt to various model scenarios, while relying entirely on host notifications increases the complexity of the software stack. Summary of the Invention
[0005] This invention provides a model fragmentation prefetching method, apparatus, solid-state drive, and medium for solid-state drives, aiming to solve the problem of low accuracy in model fragmentation prefetching of existing solid-state drives.
[0006] In a first aspect, embodiments of the present invention provide a model sharding prefetching method for a solid-state drive, comprising: The system monitors the sequence of read requests issued by the host in real time, records the logical block address and request length of each read request in the sequence, and determines the starting logical block address and cumulative length of the current fragment based on the logical block address and request length of each read request. If the read request sequence is detected to meet the preset model fragment loading conditions, the starting logical block address of the next fragment is calculated based on the starting logical block address of the current fragment; Based on the starting logical block address of the next segment, the data of the next segment is read from the flash memory medium and saved to the prefetch buffer; The read command corresponding to the data of the next data segment is marked as the highest priority in the read request queue so that subsequent read requests from the host can hit it.
[0007] Secondly, embodiments of the present invention also provide a model sharding prefetching device for a solid-state drive, comprising: The monitoring and recording unit is used to monitor the read request sequence issued by the host in real time, record the logical block address and request length of each read request in the read request sequence, and determine the starting logical block address and cumulative length of the current fragment based on the logical block address and request length of each read request. The detection calculation unit is used to calculate the starting logical block address of the next fragment based on the starting logical block address of the current fragment if the read request sequence is detected to meet the preset model fragment loading conditions; The read-save unit is used to read the data of the next segment from the flash memory medium and save it to the prefetch buffer according to the starting logical block address of the next segment; The marking unit is used to mark the read command corresponding to the data of the next data segment as the highest priority in the read request queue, so that the host can hit it for subsequent read requests.
[0008] Thirdly, embodiments of the present invention also provide a solid-state drive, the solid-state drive including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the above-described method.
[0009] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the above-described method.
[0010] This invention provides a model sharding prefetching method, apparatus, solid-state drive, and medium for a solid-state drive (SSD). The method includes: real-time monitoring of read request sequences issued by the host; recording the logical block address and request length of each read request in the sequence; determining the starting logical block address and cumulative length of the current shard based on the logical block address and request length of each read request; if the read request sequence meets preset model sharding loading conditions, calculating the starting logical block address of the next shard based on the starting logical block address of the current shard; reading the data of the next shard from the flash memory medium and saving it to a prefetch buffer according to the starting logical block address of the next shard; marking the read command corresponding to loading the data of the next shard as the highest priority in the read request queue for subsequent read requests from the host. The technical solution of this invention accurately determines the starting address and cumulative length of the current fragment by real-time monitoring of the logical block address and request length of the read request sequence. When the model fragment loading condition is met, the starting address of the next fragment is accurately calculated based on the starting address of the current fragment, and the corresponding data is prefetched from the flash memory to the buffer. At the same time, the prefetch command is marked as the highest priority to ensure that the prefetched data is loaded into the cache in a timely manner for the host to hit, thereby improving the accuracy of prefetching and reducing inference pauses caused by cache misses. Attached Figure Description
[0011] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 This is a flowchart illustrating a model fragmentation prefetching method for a solid-state drive according to an embodiment of the present invention. Figure 2 This is a schematic diagram of a sub-process of a model fragmentation prefetching method for a solid-state drive provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of another sub-process of a model fragmentation prefetching method for a solid-state drive provided in an embodiment of the present invention; Figure 4 A schematic block diagram of a model sharding prefetching device for a solid-state drive provided in an embodiment of the present invention; Figure 5 This is a schematic block diagram of a solid-state drive provided in an embodiment of the present invention. Detailed Implementation
[0013] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0014] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0015] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0016] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0017] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."
[0018] Currently, in the field of solid-state drive (SSD) technology, the model fragment prefetching accuracy of existing SSDs is relatively low. To address this issue, this invention proposes a model fragment prefetching method for SSDs. This method accurately determines the starting address and cumulative length of the current fragment by real-time monitoring of the logical block address and request length of the read request sequence. When the model fragment loading condition is met, it precisely calculates the starting address of the next fragment based on the current fragment starting address and prefetches the corresponding data from the flash memory into a buffer. Simultaneously, the prefetch command is marked as the highest priority to ensure that the prefetched data is loaded into the cache in a timely manner for host hits, thereby improving prefetching accuracy and reducing inference pauses caused by cache misses. The invention will be described in detail below through specific embodiments.
[0019] Please see Figure 1 , Figure 1 This is a flowchart illustrating a model fragmentation prefetching method for a solid-state drive according to an embodiment of the present invention. Figure 1 As shown, the method includes the following steps S110-S140.
[0020] S110. Monitor the read request sequence issued by the host in real time, record the logical block address and request length of each read request in the read request sequence, and determine the starting logical block address and cumulative length of the current fragment based on the logical block address and request length of each read request.
[0021] In this embodiment of the invention, the flash memory translation layer in the solid-state drive firmware layer tracks the read request sequence issued by the host in real time, recording two key parameters for each read request: logical block address and request length. The logical block address is the linear address identifier used by the host when accessing data, and the request length is the amount of data to be transferred in a single read operation. By continuously analyzing the change pattern of the logical block address of each read request in the read request sequence, subsequences of read requests with continuously increasing logical block addresses are identified, and the logical block address of the first read request in the subsequence is used as the starting logical block address of the current slice. Simultaneously, the request lengths of each read request in the subsequence are successively accumulated to obtain the cumulative length of the current slice. This cumulative length reflects the total amount of data read by the current slice, and the starting logical block address identifies the starting position of the current slice in the logical address space. Together, these constitute the complete location information of the current slice, ensuring accurate slice boundary identification and avoiding errors in calculating the starting address of the next slice due to slice positioning deviations, thereby improving prefetch accuracy. It should be noted that the solid-state drive firmware layer, as the core software program of the solid-state drive controller, runs on the controller's built-in processor and is responsible for managing data read and write operations on the flash memory medium.
[0022] S120. If the read request sequence is detected to meet the preset model fragment loading conditions, the starting logical block address of the next fragment is calculated based on the starting logical block address of the current fragment.
[0023] In embodiments of the present invention, such as Figure 2 As shown, step S120 specifically includes steps S121-S126: S121. Monitor whether the logical block address of each read request in the read request sequence increases continuously; S122. If the address of the logical block is detected to be continuously increasing, the cumulative length of the current segment is obtained. S123. If the cumulative length of the current fragment falls within the preset fragment size range and the starting logical block address of the current fragment is aligned according to the preset granularity, then it is determined that the read request sequence satisfies the preset model fragment loading condition. S124. Obtain the size of the current fragment; S125. Calculate the number of sectors by dividing the fragment size by the preset number of sector bytes. S126. Calculate the sum of the starting logical block address of the current segment and the number of sectors to obtain the starting logical block address of the next segment.
[0024] In this embodiment of the invention, the logical block addresses of each read request in the read request sequence are monitored to see if they increase continuously, i.e., whether the logical block addresses of adjacent read requests increase sequentially by a fixed step size, forming a continuous address access pattern. If a continuous increase in logical block addresses is detected, the cumulative length of the current fragment is obtained. This cumulative length is obtained by successively adding the request lengths of each read request in the continuously increasing read request subsequence, reflecting the total amount of data currently read. If the cumulative length of the current fragment falls within a preset fragment size range and the starting logical block address of the current fragment is aligned with a preset granularity, the read request sequence is determined to meet the preset model fragment loading conditions. The preset fragment size range is a length interval set based on the single-fragment parameter quantity of a typical artificial intelligence model, used to filter data loading behaviors that conform to the model fragment characteristics. Preset granularity alignment means that the starting logical block address is divisible by a preset granularity value, ensuring that the fragment boundary matches the physical structure of the storage medium. By combining three conditions—address continuity, length range matching, and address alignment verification—the fragment loading mode of the artificial intelligence model can be accurately identified, eliminating interference from ordinary sequential read operations and avoiding accidental triggering of the prefetch mechanism, thereby improving prefetch accuracy and cache hit rate. It should be noted that in this embodiment, the preset fragment size range is set to 32MB to 256MB, and the preset granularity is set to 4KB alignment.
[0025] In one embodiment, such as this embodiment, as Figure 3As shown, step S124 specifically includes steps S1241-S1243: S1241, detecting whether the fragment size configuration information sent by the host has been received; S1242, if the fragment size configuration information has been received, determining the fragment size parameter carried in the fragment size configuration information as the fragment size of the current fragment; S1243, if the fragment size configuration information has not been received, dynamically determining the fragment size of the current fragment based on the statistical characteristics of the historical read request sequence. Specifically, detecting whether the fragment size configuration information sent by the host has been received means listening to the management commands issued by the host through the solid-state drive firmware layer and determining whether the management commands carry fragment size parameters. If the fragment size configuration information has been received, the fragment size parameter carried in the fragment size configuration information is determined as the fragment size of the current fragment. This method allows the host to explicitly notify the solid-state drive fragment size according to the specific model specifications, achieving precise adaptation. If no shard size configuration information is received, the shard size of the current shard is dynamically determined based on the statistical characteristics of historical read request sequences. Specifically, a self-learning mechanism is used to calculate the cumulative length of multiple sequential read operations within a preset time window, and the most frequently occurring cumulative length value is determined as the shard size. This self-learning method requires no host intervention and can automatically adapt to shard specifications of different models. The two shard size determination methods form a complementary mechanism, with host notification taking precedence and the self-learning mechanism as a fallback. This supports both scenarios where the host actively configures the shard size and deployment environments where the host is unaware of the configuration, improving the applicability and flexibility of the solution and ensuring the accuracy of the calculation of the starting address of the next shard, avoiding prefetch address errors due to shard size deviations. It should be noted that the cumulative length of multiple sequential read operations within a preset time window calculated by the self-learning mechanism refers to the amount of data continuously recorded by the SSD firmware layer for each sequential read operation within the preset time window.
[0026] In one embodiment, such as this one, the number of sectors is obtained by calculating the quotient of the fragment size and the preset sector byte count, that is, converting the fragment size from bytes to sectors. The preset sector byte count is usually set to 512 bytes, which is the smallest addressing unit of a solid-state drive logical block address. Since the fragment size is represented in bytes and the logical block address is numbered in sectors, the two units are inconsistent and cannot be directly added. A division operation is used to convert the fragment size into the corresponding sector count to ensure unit consistency. The starting logical block address of the current fragment is the starting sector number of the current fragment in the logical address space, and the sector count is the number of sectors corresponding to the fragment size. Adding the two together gives the starting sector number of the next fragment in the logical address space. Understandably, this calculation method is based on the assumption that the model fragments are stored contiguously in the logical address space, ensuring that the starting address of the next fragment is accurate, avoiding prefetching errors due to address calculation deviations, improving prefetching accuracy and cache hit rate, and reducing the occurrence of host read requests missing the cache.
[0027] S130. Based on the starting logical block address of the next segment, read the data of the next segment from the flash memory medium and save it to the prefetch buffer.
[0028] In this embodiment of the invention, the solid-state drive (SSD) generates a corresponding flash memory read command based on the calculated starting logical block address of the next slice, and reads data within an address range from the NAND flash memory medium. The address range starts from the starting logical block address of the next slice and continuously covers the number of sectors corresponding to the slice size. The amount of data read is equal to the slice size, ensuring complete acquisition of all parameters of the next slice. After reading, the data is stored in a prefetch buffer, which is located in the SSD's DRAM cache and configured with a capacity of 256MB. It should be noted that the prefetch buffer is managed using the LRU algorithm. When the buffer space is insufficient, the least recently accessed data block is evicted. The LRU algorithm, or Least Recently Used replacement algorithm, arranges data blocks in the order of access by recording the access timestamp of each data block. When new prefetched data needs to be stored in the buffer but the remaining space is insufficient, the data block with the earliest access time is automatically selected for eviction, releasing storage space. This mechanism ensures that hot data is retained in the buffer, improving the cache hit rate, avoiding frequent eviction of potentially re-accessed slice data, and optimizing the utilization efficiency of the prefetch buffer. It should also be noted that the prefetch buffer is used to temporarily store pre-loaded fragment data. When the host subsequently initiates a read request, it can directly retrieve the data from the buffer without accessing the flash memory again, which greatly reduces read latency and improves the execution efficiency of the inference pipeline.
[0029] S140. Mark the read command corresponding to the data of the next data segment as the highest priority in the read request queue so that subsequent read requests from the host can hit it.
[0030] In this embodiment of the invention, the solid-state drive (SSD) generates an internal read command from the prefetch operation and sets the priority field of this read command to the highest priority level. The read request queue employs a priority scheduling mechanism, with higher-priority read commands executed first. When a prefetch read command is marked as the highest priority, the flash translation layer prioritizes sending this read command to the flash media for execution, ensuring that the next data segment is loaded into the prefetch buffer as quickly as possible. When the host subsequently initiates a read request, if the requested address matches the next data segment already loaded in the prefetch buffer, the data is returned directly from the buffer without waiting for flash memory to read, significantly reducing read latency, ensuring continuous execution of the inference pipeline, and avoiding inference pauses caused by untimely data loading.
[0031] In one embodiment, such as this embodiment, after the step of marking the read command corresponding to loading the data of the next shard as the highest priority in the read request queue, the method further includes: The process continuously monitors the waiting time of read requests for the current segment. If the waiting time exceeds a preset waiting time, the prefetching of the unfinished portion of the next segment is accelerated. If the waiting time does not exceed the preset waiting time, the loading of the current segment is checked. If the current segment is not fully loaded, the process returns to the step of continuously monitoring the waiting time of read requests for the current segment. If the current segment is fully loaded, the prefetching process ends, and the step to allow subsequent read requests from the host is executed. It should be noted that continuously monitoring the waiting time of read requests for the current segment refers to monitoring the time interval from when the host issues a read request to when the SSD returns data. If the waiting time exceeds the preset waiting time (set to 50ms), it indicates high flash memory read latency, slow loading of the current segment, and potentially insufficient normal prefetching progress for the next segment. In this case, an emergency prefetching mechanism is triggered, increasing the priority of the next segment prefetch command or increasing prefetch bandwidth to accelerate the prefetching of the remaining data. If the detected waiting time does not exceed the preset waiting time, the system checks whether the current shard loading is complete. If the current shard loading is not complete, the system returns to the step of continuously monitoring the waiting time of read requests for the current shard, forming a loop monitoring process. If the current shard loading is complete, the prefetching process ends, and steps are executed to ensure subsequent read requests from the host are ready to be loaded. This mechanism dynamically monitors read latency and proactively accelerates prefetching when latency exceeds the limit, ensuring that the next shard is ready after the host finishes reading the current shard, avoiding inference pipeline stalls, and improving prefetching accuracy and response speed.
[0032] In summary, the solid-state drive model sharding prefetching method of this invention, by real-time monitoring of the logical block address and request length of the read request sequence, adopts a triple-condition joint judgment mechanism to identify the model sharding loading mode, namely address continuity verification, cumulative length range matching, and start address alignment check, which can accurately distinguish between AI model sharding loading and ordinary sequential read operations. By converting the shard size to sector units and accurately calculating the start address of the next shard, the prefetching hit rate is significantly improved, and inference pauses caused by cache misses are reduced. The prefetching read command is marked as the highest priority, so that the next shard data is loaded into the prefetching buffer in time before the host read request arrives, effectively shortening the prefetching data readiness time. By continuously monitoring the read request waiting time, an emergency prefetching mechanism is triggered when the preset latency threshold is exceeded, which significantly reduces the number of inference pauses in latency jitter scenarios. The dual mode of host notification and self-learning can adapt to the sharding specifications of different models and can automatically learn the model sharding rules without host cooperation. The prefetching buffer is managed by the LRU algorithm to ensure that hot data is kept in the buffer, improve the cache hit rate, and optimize the buffer usage efficiency.
[0033] Figure 4 This is a schematic block diagram of a solid-state drive model fragmentation prefetching device 200 provided in an embodiment of the present invention. Figure 4 As shown, corresponding to the above-described solid-state drive (SSD) model sharding prefetching method, the present invention also provides a solid-state drive (SSD) model sharding prefetching apparatus 200. This SSD model sharding prefetching apparatus 200 includes a unit for executing the above-described solid-state drive model sharding prefetching method, and the apparatus can be configured on the solid-state drive. Specifically, please refer to... Figure 4 The solid-state drive's model sharding prefetching device 200 includes a monitoring and recording unit 201, a detection and calculation unit 202, a read and save unit 203, and a marking unit 204. Detailed descriptions of each functional module are as follows: The monitoring and recording unit 201 is used to monitor the read request sequence issued by the host in real time, record the logical block address and request length of each read request in the read request sequence, and determine the starting logical block address and cumulative length of the current fragment based on the logical block address and request length of each read request. The detection calculation unit 202 is used to calculate the starting logical block address of the next fragment based on the starting logical block address of the current fragment if the read request sequence is detected to meet the preset model fragment loading conditions; The read and save unit 203 is used to read the data of the next segment from the flash memory medium and save it to the prefetch buffer according to the starting logical block address of the next segment; The marking unit 204 is used to mark the read command corresponding to the data of the next data segment as the highest priority in the read request queue, so that the host can hit it for subsequent read requests.
[0034] In some embodiments, such as this one, the detection calculation unit 202 is specifically used for: Monitor whether the logical block address of each read request in the read request sequence increases consecutively; If the address of the logical block is detected to be continuously increasing, the cumulative length of the current fragment is obtained; If the cumulative length of the current fragment falls within the preset fragment size range and the starting logical block address of the current fragment is aligned with the preset granularity, then the read request sequence is determined to meet the preset model fragment loading condition. Get the size of the current fragment; The number of sectors is obtained by calculating the quotient of the fragment size and the preset sector byte count; The starting logical block address of the next segment is obtained by summing the starting logical block address of the current segment with the number of sectors.
[0035] In some embodiments, such as this one, the detection calculation unit 202 is further configured to: Check whether the fragment size configuration information sent by the host has been received; If the fragment size configuration information is received, the fragment size parameter carried in the fragment size configuration information is determined as the fragment size of the current fragment; If the fragment size configuration information is not received, the fragment size of the current fragment is dynamically determined based on the statistical characteristics of the historical read request sequence.
[0036] In some embodiments, such as this one, the solid-state drive model sharding prefetching device 200 further includes: A monitoring unit is used to continuously monitor the waiting time of read requests for the current shard; A prefetching unit is used to accelerate the prefetching of the unprefetched portion of the next slice if the waiting time is detected to exceed a preset waiting time. The detection unit is used to detect whether the current segment loading is complete if the waiting time is detected to be less than the preset waiting time. The first execution unit is configured to return to the step of continuously monitoring the waiting time for the read request of the current fragment if the current fragment loading is not completed; The second execution unit is configured to terminate the prefetch process and execute the steps to allow subsequent read requests from the host to be hit if the current fragment is loaded.
[0037] The aforementioned solid-state drive model sharding prefetching device can be implemented as a computer program, which can, for example... Figure 5 It runs on the solid-state drive shown.
[0038] Please see Figure 5 , Figure 5 This is a schematic block diagram of a solid-state drive (SSD) provided in an embodiment of the present invention. The SSD 300 is a device capable of performing model fragmentation prefetching.
[0039] See Figure 5 The solid-state drive 300 includes a processor 302, a memory, and a network interface 305 connected via a system bus 301. The memory may include a non-volatile storage medium 303 and internal memory 304.
[0040] The non-volatile storage medium 303 may store an operating system 3031 and a computer program 3032. When the computer program 3032 is executed, it causes the processor 302 to execute a model fragmentation prefetching method for a solid-state drive.
[0041] The processor 302 provides computing and control capabilities to support the operation of the entire solid-state drive 300.
[0042] The internal memory 304 provides an environment for the execution of the computer program 3032 in the non-volatile storage medium 303. When the computer program 3032 is executed by the processor 302, the processor 302 can execute a model sharding prefetching method for a solid-state drive.
[0043] This network interface 305 is used for network communication with other devices. Those skilled in the art will understand that... Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present invention and does not constitute a limitation on the solid-state drive 300 to which the present invention is applied. The specific solid-state drive 300 may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0044] The processor 302 is used to run a computer program 3032 stored in the memory to implement any embodiment of the above-described solid-state drive model sharding prefetching method.
[0045] It should be understood that, in this embodiment of the invention, the processor 302 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0046] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by a processor in the computer system to implement the process steps of the embodiments of the above methods.
[0047] Therefore, the present invention also provides a storage medium. This storage medium can be a computer-readable storage medium. The storage medium stores a computer program. When executed by a processor, the computer program causes the processor to perform any embodiment of the model fragmentation prefetching method for the solid-state drive described above.
[0048] The storage medium can be any computer-readable storage medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), magnetic disk, or optical disk.
[0049] Those skilled in the art will 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 implementations should not be considered beyond the scope of this invention.
[0050] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0051] The steps in the method of this invention can be adjusted, merged, or reduced in order according to actual needs. The units in the device of this invention can be merged, divided, or reduced according to actual needs. Furthermore, the functional units in the various embodiments of this invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0052] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a solid-state drive to execute all or part of the steps of the methods described in the various embodiments of the present invention.
[0053] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0054] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Since these modifications and variations fall within the scope of the claims and their equivalents, this invention also intends to include these modifications and variations.
[0055] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A model-fragment pre-fetch method for a solid state drive, the method comprising: include: The system monitors the sequence of read requests issued by the host in real time, records the logical block address and request length of each read request in the sequence, and determines the starting logical block address and cumulative length of the current fragment based on the logical block address and request length of each read request. If the read request sequence is detected to meet the preset model fragment loading conditions, the starting logical block address of the next fragment is calculated based on the starting logical block address of the current fragment; Based on the starting logical block address of the next segment, the data of the next segment is read from the flash memory medium and saved to the prefetch buffer; The read command corresponding to the data of the next data segment is marked as the highest priority in the read request queue so that subsequent read requests from the host can hit it.
2. The method of claim 1, wherein, The step of detecting that the read request sequence meets the preset model sharding loading conditions includes: Monitor whether the logical block address of each read request in the read request sequence increases consecutively; If the address of the logical block is detected to be continuously increasing, the cumulative length of the current fragment is obtained; If the cumulative length of the current fragment falls within the preset fragment size range and the starting logical block address of the current fragment is aligned with the preset granularity, then the read request sequence is determined to meet the preset model fragment loading condition.
3. The method of claim 1, wherein, The step of calculating the starting logical block address of the next fragment based on the starting logical block address of the current fragment includes: Get the size of the current fragment; The number of sectors is obtained by calculating the quotient of the fragment size and the preset sector byte count; The starting logical block address of the next segment is obtained by summing the starting logical block address of the current segment with the number of sectors.
4. The method of claim 3, wherein, The step of obtaining the fragment size of the current fragment includes: Check whether the fragment size configuration information sent by the host has been received; If the fragment size configuration information is received, the fragment size parameter carried in the fragment size configuration information is determined as the fragment size of the current fragment; If the fragment size configuration information is not received, the fragment size of the current fragment is dynamically determined based on the statistical characteristics of the historical read request sequence.
5. The method of claim 1, wherein, After the step of marking the read command corresponding to loading the data of the next slice as the highest priority in the read request queue, the method further includes: Continuously monitor the waiting time of read requests for the current fragment; If the waiting time is detected to exceed the preset waiting time, the prefetching of the unprefetched portion of the next slice is accelerated.
6. The method of claim 5, wherein, Following the step of continuously monitoring the wait time of read requests for the current shard, the method further includes: If the waiting time is detected to be less than the preset waiting time, then check whether the current segment loading is complete; If the current shard loading is not complete, return to the step of continuously monitoring the waiting time for read requests of the current shard; If the current shard is loaded, the prefetch process ends, and the steps to allow subsequent read requests from the host to be hit are executed.
7. The method of claim 1, wherein, The prefetch buffer is managed using the LRU algorithm, and when the buffer space is insufficient, the least accessed data block is evicted.
8. A model sharding prefetching device for a solid-state drive, characterized in that, include: The monitoring and recording unit is used to monitor the read request sequence issued by the host in real time, record the logical block address and request length of each read request in the read request sequence, and determine the starting logical block address and cumulative length of the current fragment based on the logical block address and request length of each read request. The detection calculation unit is used to calculate the starting logical block address of the next fragment based on the starting logical block address of the current fragment if the read request sequence is detected to meet the preset model fragment loading conditions; The read-save unit is used to read the data of the next segment from the flash memory medium and save it to the prefetch buffer according to the starting logical block address of the next segment; The marking unit is used to mark the read command corresponding to the data of the next data segment as the highest priority in the read request queue, so that the host can hit it for subsequent read requests.
9. A solid state drive, comprising: The solid-state drive includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, can implement the method as described in any one of claims 1-7.
