A Method for Data Prefetching and Data Caching of a Solid State Drive
By introducing a data reading controller in a solid-state drive and adopting parallel pre-read and cache output methods, the problem of insufficient data reading and cache speed of existing solid-state drives is solved, and more efficient data processing is achieved.
Patent Information
- Application Number
- CN202510437556.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2045-04-09
AI Technical Summary
Existing solid-state drives have shortcomings in data reading and caching speed, making it difficult to make greater breakthroughs after the technology is mature.
By introducing a data read controller in a solid-state drive, using data pre-read and data cache methods, the serial reading of data is changed to parallel pre-read and cache output, allocating cache space and pre-reading the read sequence in parallel.
It effectively improves the data reading and cache speed of solid-state drives under the same conditions and improves data processing efficiency.
Smart Images

Figure CN119961185B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data storage, and particularly to a method for data prefetching and data caching of a solid-state drive. Background Art
[0002] In the field of data storage, solid-state drives are gradually beginning to replace traditional mechanical hard drives with faster data storage and reading speeds; with the development of technology, higher requirements have been placed on the data storage and reading speeds of solid-state drives. However, most of the current improved solid-state drive methods start from the solid-state drive itself, and it is difficult to achieve greater breakthroughs under the increasingly mature technology. Summary of the Invention
[0003] The purpose of the present invention is to overcome the deficiencies of the prior art and provide a method for data prefetching and data caching of a solid-state drive. Based on a data reading controller, data prefetching and data caching are performed, and the serial reading of data is modified to parallel prefetching and cached output, which can effectively improve the data reading and caching speeds in the case of the same solid-state drive.
[0004] The purpose of the present invention is achieved through the following technical solutions: A method for data prefetching and data caching of a solid-state drive includes the following steps:
[0005] S1. The data reading controller first receives a reading requirement;
[0006] S2. The data reading controller calculates the size of the cache space required for the reading requirement, and divides the cache space in the data reading buffer for this reading requirement according to the size of the cache space;
[0007] S3. The data reading controller divides the cache space into N sub-intervals numbered from 1 to N, and at the same time divides each data block included in the file to be read in the reading requirement into N reading sequences, numbered from 1 to N in the front-to-back order in the file to be read;
[0008] S4. The reading controller simultaneously performs parallel prefetching on the N reading sequences and caches them into the N sub-intervals;
[0009] S5. When there are multiple reading requirements, steps S1 to S4 are simultaneously executed for each reading requirement;
[0010] S6. M data output ports are set for the data reading buffer, and it is judged whether there is an output congestion phenomenon. If so, the reading requirement with a higher priority is selected for data output according to the priority of the reading requirement. If not, the data of multiple reading requirements are output simultaneously.
[0011] The beneficial effects of the present invention are as follows: Based on the data reading controller for data pre-reading and data caching, the serial reading of data is modified to parallel pre-reading and cached output, which can effectively improve the data reading and caching speed in the case of the same solid-state drive. Description of the Drawings
[0012] Figure 1 It is a flowchart of the method of the present invention. Detailed Embodiment
[0013] The technical solution of the present invention will be further described in detail below with reference to the drawings, but the protection scope of the present invention is not limited to the following.
[0014] As Figure 1 shown, a method for data pre-reading and data caching of a solid-state drive includes the following steps:
[0015] S1. The data reading controller first receives the reading requirement;
[0016] The reading requirement includes the priority of the reading requirement, the file name to be read, the data blocks included in the file, the size of each data block, and the storage address of each data block; the priority of the reading requirement is divided into levels 1 to 3, and the higher the priority, the more urgent the requirement.
[0017] S2. The data reading controller calculates the size of the cache space required by the reading requirement, and divides the cache space in the data reading buffer for this reading requirement according to the size of the cache space;
[0018] The data reading controller calculates the cache space required by the reading requirement, including: the data reading controller accumulates the sizes of the respective data blocks included in the file to be read to obtain the storage space size required by the reading requirement.
[0019] When dividing the cache space in the data reading buffer for this reading requirement, the size of the cache space needs to be greater than the cache space size required by the reading requirement.
[0020] S3. The data reading controller divides the cache space into N sub-intervals, numbered 1 to N, and at the same time divides the respective data blocks included in the file to be read in the reading requirement into N reading sequences, numbered 1 to N in the front-to-back order in the file to be read;
[0021] S4. The reading controller simultaneously performs parallel pre-reading on the N reading sequences and caches them into the N sub-intervals; including:
[0022] When n = 1, 2,..., N, the reading controller stores the reading sequence numbered n into the sub-interval numbered n.
[0023] S5. When there are multiple reading requirements, steps S1 - S4 are executed simultaneously for each reading requirement;
[0024] S6. Set M data output ports for the data reading buffer, and determine whether there is an output congestion phenomenon. If there is, according to the priority of the reading requirements, select the reading requirement with a higher priority for data output. If not, the data of multiple reading requirements are output simultaneously.
[0025] The said step S6 includes:
[0026] S601. Set M data output ports for the data reading buffer. Suppose the number of reading requirements is k. If M is not less than k * N, there is no output congestion phenomenon, and the data of multiple reading requirements are output simultaneously; if M is less than k * N, it is considered that there is an output congestion phenomenon, and step S602 is entered;
[0027] S602. Calculate M / N and take the integer part. Suppose the integer part result is L. Then, in the order of decreasing priority, only the data of L reading requirements are output each time until all the data of the reading requirements are output.
[0028] For each reading requirement, after the data is output through the data output port, the reading sequence of the read data is pieced together in the order of numbers 1 - N, and the required file is obtained.
[0029] The above description shows and describes a preferred embodiment of the present invention. However, as mentioned above, it should be understood that the present invention is not limited to the form disclosed herein, should not be regarded as excluding other embodiments, but can be used in various other combinations, modifications, and environments, and can be changed within the scope of the inventive concept described herein through the above teachings or the techniques or knowledge in related fields. And the changes and alterations made by those skilled in the art that do not depart from the spirit and scope of the present invention should all be within the protection scope of the appended claims of the present invention.
Claims
1. A method for pre-reading and caching data of a solid state drive, characterized in that: The following steps are involved: S1. The data reading controller first receives a reading request; S2. The data read controller calculates the cache space size required for the read demand, and divides the cache space in the data read cache area to the read demand according to the cache space size; S3. The data reading controller divides the cache space into N sub-intervals, numbered 1 to N, and divides each data block contained in the file to be read in the reading demand into N read sequences, numbered 1 to N according to the order in which they appear in the file to be read; S4. The read controller pre-reads N read sequences in parallel and caches them into N sub-intervals; S5. When there are multiple read requests, steps S1 to S4 are performed simultaneously for each read request; S6. Set M data output ports for the data read buffer area to determine whether there is output congestion. If so, select a higher priority read demand for data output according to the priority of the read demand. If not, multiple read demand data are output simultaneously; The step S6 comprises: S601. Set M data output ports for the data read buffer area, and set the number of read requirements to k. If M is not less than k*N, there is no output congestion, and the data of multiple read requirements are output simultaneously; if M is less than k*N, it is considered that there is output congestion, and enter step S602; S602. Calculate M / N and round it up. Suppose the rounded result is L. Then, in descending order of priority, only L read request data are output each time until all read request data output is completed.
2. The method for pre-reading and caching data of a solid state drive according to claim 1, characterized in that: The read demand includes the priority of the read demand, the name of the file to be read, the data blocks contained in the file, the size of each data block and the storage address of each data block; the priority of the read demand is divided into 1 to 3 levels, and the higher the priority, the more urgent the demand.
3. The method for pre-reading and caching data of a solid state drive according to claim 2, characterized in that: The data reading controller calculates the cache space required for the reading demand, including: the data reading controller accumulates the sizes of each data block contained in the file to be read to obtain the storage space size required for the reading demand.
4. The method for pre-reading and caching data of a solid state drive according to claim 2, characterized in that: The cache space is divided in the data read cache area to the read demand, and the size of the cache space needs to be larger than the size of the cache space required by the read demand.
5. The method for pre-reading and caching data of a solid state drive according to claim 1, characterized in that: The read controller reads the N read sequences in parallel and caches them into N sub-intervals, including: When n=1, 2, ..., N, the read controller stores the read sequence numbered n into the sub-interval numbered n.
6. The method for pre-reading and caching data of a solid state drive according to claim 1, characterized in that: For each reading requirement, after the data is output through the data output port, the reading sequence of the read data is pieced together in the order of numbers 1 to N, and the required file is obtained.
Citation Information
Patent Citations
Non-volatile memory with optimized read
CN115295046A
Unified prefetch circuit for multi-level caches
US10180905B1