A Solid State Drive Address Translation Acceleration Method Based on a Multi - Segment Linear Regression Model
By establishing a multi-segment linear regression model for the flash global mapping table in the solid-state disk memory and periodically updating it, the problem of low random read performance of solid-state disks is solved, and the effect of reducing the number of flash reads and improving performance is achieved.
Patent Information
- Application Number
- CN202211166847.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-23
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2042-09-23
AI Technical Summary
In the prior art, when the solid state disk is randomly read, it is impossible to use access locality to put frequently accessed maps into memory, resulting in two flash reads required for each random read request, which seriously affects the performance of random reads.
Using a method based on a polylinear regression model, a low-overhead polylinear regression model is established for the global map table of flash memory in solid-state disk memory, and is updated periodically in garbage collection. The physical page number of logical page numbers that cannot be hit in the hot map table through the model is predicted, reducing the number of flash reads.
This greatly reduces the dual-read problem in address conversion in SSD random reading scenarios, and improves the random reading performance of SSD.
Smart Images

Figure CN115481055B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer data storage, and particularly to a method for accelerating solid-state drive address conversion based on a multi-segment linear regression model. Background Art
[0002] Flash-based solid-state drives exhibit characteristics different from those of mechanical disks. Due to the absence of seek latency, the performance of solid-state drives is much better than that of mechanical disks. Therefore, solid-state drives have been widely deployed as a buffer layer in enterprises and large data centers to absorb random accesses of storage systems based on mechanical disks, including random read and random write operations. In recent years, the design of log-structured file systems and log-structured merge trees has enabled random write operations to be converted into sequential write operations, accelerating the random write performance of solid-state drives. However, random reads have not been optimized. Therefore, random read performance has become a key performance bottleneck of solid-state drives.
[0003] Flash memory has unique device characteristics, such as out-of-place updates and erase-before-write. To hide the internal characteristics of flash memory, solid-state drives usually provide virtual logical addresses to the outside world (such as the operating system, etc.). Inside the solid-state drive, a Flash Translation Layer (FTL for short) is used to convert the virtual logical page address into a physical address within the device. The address conversion mode in the flash translation layer is an important component of the solid-state drive, which determines the performance of the solid-state drive. Therefore, the read performance of flash-based solid-state drives highly depends on the effectiveness of the page-level mapping scheme in the FTL design.
[0004] The currently mainstream mapping method is at the page level, that is, the flash memory of the entire solid-state drive is divided into a certain number of flash pages, each page having a size of 4KB, and a unique physical page number is assigned. When the outside world accesses the solid-state drive, a virtual logical page number is used, and each logical page number corresponds to a physical page number. In a solid-state drive, the conversion from a logical page number to a physical page number usually uses a table form. The mapping of each logical page number to a physical page number exists in a table. For any given logical page number, the corresponding physical page number can be found from the table. The mapping table is stored in the memory of the solid-state drive to improve access speed and saved to the flash memory when power is off.
[0005] However, due to cost issues, the memory capacity in a solid-state drive is usually not sufficient to accommodate the entire mapping table. The mainstream approach utilizes the locality of data access and only stores a portion of the frequently accessed and hot mappings (from logical page numbers to physical page numbers) in the memory of the solid-state drive, while the global mapping table that records all mappings is stored in the flash memory. For frequently accessed logical page numbers, the solid-state drive directly reads the physical page number from the mapping table in the memory and directly returns the flash page data corresponding to the physical page number. For logical page numbers that are infrequently read, since they cannot be hit in the memory, it is necessary to first read the global mapping table in the flash memory to obtain the corresponding physical page number, and then return the corresponding flash page data through the physical page number. Infrequently accessed mappings require one more flash read than frequently accessed mappings.
[0006] However, when the solid-state drive serves as a buffer layer for a mechanical hard drive, the access requests to the solid-state drive are random, that is, the access probability of any logical page number is the same, and there is no logical page number that is frequently accessed. This will render the aforementioned scheme of utilizing access locality and placing frequently accessed mappings in the memory ineffective. Any random read request will stably trigger two flash reads. The first flash read obtains the physical page number corresponding to the logical page number, and the second flash read obtains the data, seriously affecting the random read performance of the flash memory. Summary of the Invention
[0007] The main objective of the present invention is to overcome the above-mentioned defects in the prior art and propose a solid-state drive address translation acceleration method based on a multi-segment linear regression model. The method uses a piecewise linear regression algorithm to model the mapping from logical addresses to physical addresses, reduces the number of times of accessing the flash memory during random reads, and thereby improves the random read performance of the solid-state drive.
[0008] The present invention adopts the following technical solutions:
[0009] A solid-state drive address translation acceleration method based on a multi-segment linear regression model, including an initialization step, a data write operation step, a garbage collection and model training step, and a data read operation step:
[0010] 1) Initialization step:
[0011] (1-1) Calculate the number of physical flash pages of the solid-state drive and assign a fixed physical page number to each physical flash page according to the physical area it is located in, and proceed to process (1-2);
[0012] (1-2) Establish an equal number of logical page numbers based on the number of physical flash pages, and establish an empty global mapping table based on the total number of logical page numbers, and proceed to process (1-3);
[0013] (1-3)Partition the global mapping table according to the logical page number, and fixedly allocate an equal number of physical flash pages to each partition to perform the write operation, then go to process (1-4);
[0014] (1-4)Initialize an empty bitmap and an empty model for each partition in the memory of the solid-state drive, then go to process (1-5);
[0015] (1-5)Establish a hot mapping table in the memory of the solid-state drive, and the size of the hot mapping table is 0.5% of the flash size of the solid-state drive;
[0016] 2) Data write operation steps:
[0017] (2-1)According to the write instruction passed by the user, fetch the logical page number of the data page to be written in the write operation, then go to process (2-2);
[0018] (2-2)Check whether there is an empty flash page in the partition where the logical page number is located. If so, go to process (2-4), otherwise go to process (2-3);
[0019] (2-3)Perform garbage collection and model training steps on this partition, and then go to process (2-4);
[0020] (2-4)Write the data into the empty flash page, record the physical page number of this flash page, then go to process (2-5);
[0021] (2-5)Search for this logical page number in the hot mapping table in the memory of the solid-state drive. If this logical page number is found in the hot mapping table in the memory of the solid-state drive, go to process (2-6), otherwise go to process (2-7);
[0022] (2-6)Mark the physical page number corresponding to the found logical page number as invalid and delete this mapping in the hot mapping table, then go to process (2-14);
[0023] (2-7)Judge whether there is free space in the hot mapping table. If there is no free space, go to process (2-8), otherwise go to process (2-14);
[0024] (2-8)Select the mapping with the least number of usage times within the set time in the hot mapping table and replace it from the memory, then go to process (2-9);
[0025] (2-9)Judge whether there is a mapping replaced out in the global mapping table. If so, go to process (2-10), otherwise go to process (2-13);
[0026] (2-10)Mark the physical page number corresponding to the replaced logical page number in the global mapping table as invalid, delete this mapping, then go to process (2-11);
[0027] (2-11) Determine whether the replaced logical page number is accurately predicted by the multiple linear regression model, that is, whether the bitmap information corresponding to the physical page number output after inputting this logical page number into the model is 1. If it is 1, go to process (2-12); otherwise, go to process (2-13);
[0028] (2-12) Modify the bitmap information corresponding to the physical page number output by the model to 0, and go to process (2-13);
[0029] (2-13) Insert the replaced mapping into the global mapping table, and go to process (2-14);
[0030] (2-14) Insert the logical page number of the write request and the corresponding physical page number into the hot mapping table, and the write operation ends;
[0031] 3) Garbage collection and model training steps:
[0032] (3-1) Select the partition that needs to perform garbage collection, and go to process (3-2);
[0033] (3-2) Determine whether the data in this partition contains valid data. If so, go to process (3-3); otherwise, go to process (3-9);
[0034] (3-3) Read the valid data into the memory of the solid-state drive and sort it in ascending order of logical page number, and go to process (3-4);
[0035] (3-4) Take out a group of free flash blocks with consecutive physical page numbers from the reserved space, and go to process (3-5);
[0036] (3-5) Write the valid data to the selected free flash blocks in the order of logical page numbers, obtain a group of mappings from logical page numbers to physical page numbers that are monotonically increasing, and divide this group of mappings from logical page numbers to physical page numbers into N segments on average, and go to process (3-6);
[0037] (3-6) Use the least squares method to calculate the slope and intercept for each segment of the mapping from logical page numbers to physical page numbers, and store them in the model area belonging to this partition in the memory, and go to process (3-7);
[0038] (3-7) Use all the logical page numbers of this partition to verify the model and update the bitmap information; mark the bitmap of the physical page numbers accurately predicted by the model as 1, and mark those that cannot be accurately predicted as 0, and go to process (3-8);
[0039] (3-8) Mark the model in the memory of the solid-state drive for this partition as available, and go to process (3-10);
[0040] (3-9) Mark the model in this partition in the solid-state drive memory as unavailable, and proceed to process (3-11);
[0041] (3-10) Erase the data blocks in the current garbage collection partition, and the operation ends;
[0042] (3-11) Erase the data blocks in the partition currently undergoing garbage collection, and return the erased data blocks to the reserved space, and the operation ends;
[0043] 4) Data read operation steps:
[0044] (4-1) According to the read instruction transmitted by the user, obtain the logical page number of the data page to be read in the read operation, and proceed to process (4-2);
[0045] (4-2) Search the hot mapping table in the solid-state drive memory. If the corresponding actual physical page number is found in the hot mapping table, proceed to process (4-9), otherwise proceed to process (4-3);
[0046] (4-3) Search and judge the partition information in the solid-state drive memory. If the model in the partition is marked as available, proceed to process (4-4), otherwise proceed to process (4-8);
[0047] (4-4) Input the logical page number into the multi-segment linear regression model to obtain the predicted physical page number, and proceed to process (4-5);
[0048] (4-5) Judge whether the predicted physical page number exceeds the partition range. If it exceeds, proceed to process (4-8), otherwise proceed to process (4-6);
[0049] (4-6) Judge whether the bitmap information corresponding to the predicted physical page number is 1. If it is 1, proceed to process (4-7), otherwise proceed to process (4-8);
[0050] (4-7) Mark the predicted physical page number as the actual physical page number, and proceed to process (4-10);
[0051] (4-8) Search the global mapping table in the flash memory to obtain the physical page number corresponding to the required logical page number, mark it as the actual physical page number, and proceed to process (4-10);
[0052] (4-9) Mark the physical page number found in the hot mapping table as the actual physical page number, and proceed to process (4-10);
[0053] (4-10) Return the flash page data corresponding to the actual physical page number, and the read operation is completed.
[0054] As can be seen from the above description of the present invention, compared with the prior art, the present invention has the following beneficial effects:
[0055] The present invention proposes a method for accelerating solid-state drive (SSD) address translation based on a multi-segment linear regression model. A low-overhead multi-segment linear regression model is established for groups of the global mapping table in the flash memory within the memory of the SSD and is periodically updated along with the garbage collection of the SSD. For logical page numbers that cannot be hit in the hot mapping table with locality requirements, attempts can be made to hit them in the model, greatly reducing the search overhead caused by the double-reading problem in address translation in the random read scenario of the SSD, thereby improving the random read performance of the SSD. Brief Description of the Drawings
[0056] Figure 1 It is a schematic diagram of the structural device of the present invention;
[0057] Figure 2 It is a schematic diagram of the mapping table in the present invention;
[0058] Figure 3 It is a schematic diagram of the partition information in the present invention;
[0059] Figure 4 It is a schematic diagram of the multi-segment linear regression model in the present invention;
[0060] Figure 5 It is a schematic diagram of the step process of system initialization in the present invention;
[0061] Figure 6 It is a schematic diagram of the step process of data write operation in the present invention;
[0062] Figure 7 It is a schematic diagram of the step process of garbage collection and model training in the present invention.
[0063] Figure 8 It is a schematic diagram of the step process of data read operation in the present invention.
[0064] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. Detailed Embodiments
[0065] The present invention proposes a method for accelerating solid-state drive (SSD) address translation based on a multi-segment linear regression model. A low-overhead multi-segment linear regression model is established for groups of the global mapping table in the flash memory within the memory of the SSD and is periodically updated along with the garbage collection of the SSD. For logical page numbers that cannot be hit in the hot mapping table with locality requirements, attempts can be made to hit them in the model, greatly reducing the search overhead caused by the double-reading problem in address translation in the random read scenario of the SSD, thereby improving the random read performance of the SSD.
[0066] A method for accelerating solid-state drive address translation based on a multi-segment linear regression model includes an initialization step, a data write operation step, a garbage collection and model training step, and a data read operation step:
[0067] 1) Initialization step:
[0068] (1-1) Calculate the number of physical flash pages of the solid-state drive, and assign a fixed physical page number to each physical flash page according to the physical area it belongs to, then go to process (1-2);
[0069] (1-2) Establish an equal number of logical page numbers based on the number of physical flash pages, and establish an empty global mapping table according to the total number of logical page numbers, then go to process (1-3);
[0070] (1-3) Partition the global mapping table according to the logical page numbers, and fix an equal number of physical flash pages for each partition to perform the write operation, then go to process (1-4);
[0071] (1-4) Initialize an empty bitmap and an empty model for each partition in the memory of the solid-state drive, then go to process (1-5);
[0072] (1-5) Establish a hot mapping table in the memory of the solid-state drive, and the size of the hot mapping table is 0.5% of the flash size of the solid-state drive;
[0073] 2) Data write operation step:
[0074] (2-1) According to the write instruction passed by the user, retrieve the logical page number of the data page to be written in the write operation, then go to process (2-2);
[0075] (2-2) Check whether there is an empty flash page in the partition where the logical page number is located. If there is, go to process (2-4), otherwise go to process (2-3);
[0076] (2-3) Perform garbage collection and model training steps on this partition, and then go to process (2-4);
[0077] (2-4) Write the data into the empty flash page, record the physical page number of this flash page, then go to process (2-5);
[0078] (2-5) Search for this logical page number in the hot mapping table in the memory of the solid-state drive. If this logical page number is found in the hot mapping table in the memory of the solid-state drive, go to process (2-6), otherwise go to process (2-7);
[0079] (2-6) Mark the physical page number corresponding to the found logical page number as invalid and delete this mapping in the hot mapping table, then go to process (2-14);
[0080] (2-7) Judge whether there is free space in the hot mapping table. If there is no free space, go to process (2-8), otherwise go to process (2-14);
[0081] (2-8) Select the mapping with the least usage times within the set time in the thermal mapping table and replace it from the memory, then go to process (2-9);
[0082] (2-9) Determine whether the globally mapped table contains the replaced mapping. If so, go to process (2-10); otherwise, go to process (2-13);
[0083] (2-10) Mark the physical page number corresponding to the replaced logical page number in the globally mapped table as invalid, delete this mapping, and go to process (2-11);
[0084] (2-11) Determine whether the replaced logical page number is accurately predicted by the multiple linear regression model, that is, whether the bitmap information corresponding to the physical page number output after this logical page number is input into the model is 1. If it is 1, go to process (2-12); otherwise, go to process (2-13);
[0085] (2-12) Modify the bitmap information corresponding to the physical page number output by the model to 0, and go to process (2-13);
[0086] (2-13) Insert the replaced mapping into the globally mapped table, and go to process (2-14);
[0087] (2-14) Insert the logical page number of the write request and the corresponding physical page number into the thermal mapping table, and the write operation ends;
[0088] 3) Garbage collection and model training steps:
[0089] (3-1) Select the partition that needs to perform garbage collection, and go to process (3-2);
[0090] (3-2) Determine whether the data in this partition contains valid data. If so, go to process (3-3); otherwise, go to process (3-9);
[0091] (3-3) Read the valid data into the memory of the solid-state drive and sort it in ascending order of logical page numbers, and go to process (3-4);
[0092] (3-4) Take out a group of free flash memory blocks with continuous physical page numbers from the reserved space, and go to process (3-5);
[0093] (3-5) Write the valid data to the selected free flash memory blocks in the order of logical page numbers, obtain a group of mappings from logical page numbers to physical page numbers that are monotonically increasing, and divide this group of mappings from logical page numbers to physical page numbers into N segments on average, and go to process (3-6);
[0094] (3 - 6) Use the least squares method to calculate the slope and intercept for each mapping from logical page number to physical page number, and store them in the model area belonging to this partition in memory, then go to process (3 - 7);
[0095] (3 - 7) Use all the logical page numbers in this partition to verify the model and update the bitmap information; Mark the bitmap of the physical page number accurately predicted by the model as 1, and mark those that cannot be accurately predicted as 0, then go to process (3 - 8);
[0096] (3 - 8) Mark the model in this partition of the solid - state disk memory as usable, then go to process (3 - 10);
[0097] (3 - 9) Mark the model in this partition of the solid - state disk memory as unavailable, then go to process (3 - 11);
[0098] (3 - 10) Erase the data blocks in the current garbage collection partition, and the operation ends;
[0099] (3 - 11) Erase the data blocks in the current partition undergoing garbage collection, and put the erased data blocks back into the reserved space, and the operation ends;
[0100] 4) Steps for data read operation:
[0101] (4 - 1) According to the read instruction passed by the user, take out the logical page number of the data page to be read for the read operation, then go to process (4 - 2);
[0102] (4 - 2) Search the hot mapping table in the solid - state disk memory. If the corresponding actual physical page number is found in the hot mapping table, go to process (4 - 9), otherwise go to process (4 - 3);
[0103] (4 - 3) Search and judge the partition information in the solid - state disk memory. If the model in the partition is marked as usable, go to process (4 - 4), otherwise go to process (4 - 8);
[0104] (4 - 4) Input the logical page number into the multi - segment linear regression model to obtain the predicted physical page number, then go to process (4 - 5);
[0105] (4 - 5) Judge whether the predicted physical page number exceeds the partition range. If it exceeds, go to process (4 - 8), otherwise go to process (4 - 6);
[0106] (4 - 6) Judge whether the bitmap information corresponding to the predicted physical page number is 1. If it is 1, go to process (4 - 7), otherwise go to process (4 - 8);
[0107] (4 - 7) Mark the predicted physical page number as the actual physical page number, then go to process (4 - 10);
[0108] (4-8) Search the global mapping table in the flash memory to obtain the physical page number corresponding to the required logical page number, mark it as the actual physical page number, and go to process (4-10);
[0109] (4-9) Mark the physical page number found in the thermal mapping table as the actual physical page number, and go to process (4-10);
[0110] (4-10) Return the flash page data corresponding to the actual physical page number, and the read operation is completed.
[0111] Figure 1 It is the system structure device diagram of the present invention; it is divided into the memory area and the flash memory area of the solid-state disk. The memory area is of DRAM medium, with a small capacity, and the data is volatile. It is mainly used as the read / write cache of the flash memory area and to place the mapping table. The flash memory area is of flash memory medium, with a large capacity, and the data is non-volatile. It is mainly used to store user data; the memory area includes a thermal mapping table and partition information. The thermal mapping table is used to store the mapping from the logical page number with locality to the physical page number, and the partition information is used to store the grouping information of all address mappings; the flash memory area contains a user data area and a global mapping table. The global mapping table stores the mapping information from the logical page number to the physical page number in the entire solid-state disk, and the user data area stores all the data of the user.
[0112] Figure 2 It is the mapping information from a logical address to a physical address of the present invention, including the indexed logical page number and the corresponding physical page number.
[0113] Figure 3 It is the structure diagram of the partition information of the present invention: including the partition number for identifying each partition, the starting logical page number of this partition, the model-related information of multiple linear regression, and the location of the global mapping information corresponding to this partition in the flash memory.
[0114] Figure 4 It is the schematic diagram of the model structure of the present invention: including bitmap information and piecewise linear regression information. The bitmap information is used to represent whether the physical page number predicted by this model is an accurate bitmap, where each bit corresponds to a physical page number, 1 represents accurate, and 0 represents inaccurate. The piecewise linear regression information includes the starting logical page number and the slope and intercept of each segment.
[0115] Figure 5This is a schematic diagram of the initialization stage of the present invention, and the following process is carried out: First, calculate the capacity of the entire solid-state drive, that is, the total number of flash pages, and then allocate physical page numbers according to their positions. Through this physical page number, the solid-state drive can index the position of each flash page in the solid-state drive. Then, an equal number of logical page numbers are established and exposed for use by the client. At the same time, a global mapping table based on the logical page numbers and physical page numbers is established and stored in the flash area. After that, all the logical page numbers are partitioned. Each partition generally contains an integer multiple of 512 logical page numbers. Each group of logical addresses corresponds to an equal number of free physical flash pages to receive data writing. After partitioning, an empty bitmap and model are established in the memory for each partition. Finally, a hot mapping table is established in the memory of the solid-state drive to receive hot mapping data to accelerate the reading of mappings with locality.
[0116] Figure 6 This is a schematic diagram of the data write operation step process of the present invention, and the following operations are carried out: First, the solid-state drive main control extracts the required logical page number and the data to be written in the instruction. Then, check whether there are free flash pages in the partition to which the logical page number belongs. If there are free flash pages, write the data to the free flash page and record the physical page number of the newly written flash page; if not, perform garbage collection and model training to recycle the garbage data in the partition to generate free flash pages in the partition, and then write the data to the recycled free flash page and record the physical page number of the flash page. After the data is written to the flash page, check whether the requested logical page number can be hit in the hot mapping table in the memory of the solid-state drive. If it can, mark the physical page number corresponding to the logical page number found in the mapping table as invalid and delete the mapping in the hot mapping table, and then update the requested logical page number and the physical page number of the newly written flash page to the hot mapping table to end the write operation; if the logical page number cannot be hit in the hot mapping table, check whether there is still free space in the hot mapping table. If there is free space, then insert the requested logical page number and the physical page number of the newly written flash page into the hot mapping table to end the write operation; if there is no free space in the hot mapping table, replace the least recently used mapping in the hot mapping table into the global mapping table of the flash. Check whether the global mapping table contains the logical page number of the replaced mapping. If it does not contain the replaced logical page number, insert the replaced mapping into the global mapping table, and then insert the mapping from the logical page number corresponding to the write request to the physical page number into the hot mapping table to end the write operation; if the global mapping table contains the replaced logical page number, first mark the physical page number corresponding to the logical page number in the global mapping table as invalid, check whether the replaced logical page number can be accurately predicted in the model, that is, whether the predicted physical page number output by the model is 1 in the bitmap. If it can be predicted accurately, modify the bitmap bit to 0; re-insert the replaced mapping into the global mapping table, and then insert the mapping from the logical page number corresponding to the write request to the physical page number into the mapping table to end the write operation.
[0117] Figure 7 This is a schematic diagram of the garbage collection and model training process of the present invention. The following operations are performed: First, select the partition that needs to perform garbage collection according to the request, and then check whether the partition contains valid flash page data. If there is no valid data in the partition, the model of the partition is marked as unavailable. Then, erase all flash blocks of the current partition, and the operation ends; if the partition contains valid data, read out all valid page data into the solid-state disk memory and sort them in ascending order of logical page numbers; then, take out a set of free flash blocks with consecutive physical page numbers from the reserved space; then, write the valid pages back to the free flash blocks with consecutive physical page numbers in the order of logical page numbers, obtaining a monotonically increasing mapping from logical page numbers to physical page numbers, and evenly divide it into N segments (usually 7); perform linear regression on each segment using the least squares method to calculate the slope and intercept; use the logical page numbers in this set of mappings to evaluate the model, mark the bitmap information corresponding to the correctly predicted physical page number as 1, and mark the ones that cannot be predicted accurately as 0; then mark the model of the partition as available; finally, erase the flash blocks of the partition that performs garbage collection, and after erasing, put the flash blocks back into the reserved space, and the operation ends.
[0118] Figure 8 This is a schematic diagram of the data reading operation of the present invention. The following operations are performed: First, the solid-state disk main controller obtains the logical page number in the read instruction; then, check whether the logical page number is contained in the hot mapping table. If the logical page number can be found, mark the physical page number corresponding to the logical page number found in the hot mapping table as the actual physical page number, and return the flash page data according to the actual physical page number, and the operation ends; if the logical page number cannot be found in the hot mapping table, then check whether the model in the partition corresponding to the logical page number is available. If the model is not marked as available, look up the global mapping table in the flash to obtain the actual physical page number corresponding to the required logical page number; finally, return the flash page data corresponding to the actual physical page number, and the operation ends; if the model in the partition corresponding to the logical page number is marked as available, input the logical page number into the model to obtain the predicted physical page number; check whether the bitmap information corresponding to the predicted physical page number is 1. If it is 1, mark the predicted physical page number as the actual physical page number; finally, return the flash page data corresponding to the actual physical page number, and the operation ends; if it is 0, look up the global mapping table in the flash to obtain the actual physical page number corresponding to the required logical page number; finally, return the flash page data corresponding to the actual physical page number, and the operation ends.
[0119] The present invention provides a solid-state drive address translation acceleration method based on a multi-segment linear regression model. A low-overhead multi-segment linear regression model is established for grouping the global mapping table in the flash memory in the memory of the solid-state drive and is periodically updated along with the garbage collection of the solid-state drive. For a logical page number that cannot be hit in the hot mapping table with locality requirements, an attempt can be made to hit it in the model, greatly reducing the search overhead caused by the double-read problem in address translation in the random read scenario of the solid-state drive, thereby improving the random read performance of the solid-state drive.
[0120] The above are only specific embodiments of the present invention, but the design concept of the present invention is not limited thereto. Any non-substantive modification made to the present invention using this concept shall fall within the scope of infringement of the protection of the present invention.
Claims
1. A solid-state drive address translation acceleration method based on a multi-segment linear regression model, characterized in that It includes an initialization step, a data write operation step, a garbage collection and model training step, and a data read operation step: 1) Initialization step: (1-1) Calculate the number of physical flash pages of the solid-state drive, and assign a fixed physical page number to each physical flash page according to the physical area it belongs to, and go to process (1-2); (1-2) Establish an equal number of logical page numbers based on the number of physical flash pages, and establish an empty global mapping table according to the total number of logical page numbers, and go to process (1-3); (1-3) Partition the global mapping table according to the logical page numbers, and fix an equal number of physical flash pages for each partition to perform the write operation, and go to process (1-4); (1-4) Initialize an empty bitmap and an empty model for each partition in the memory of the solid-state drive, and go to process (1-5); (1-5) Establish a hot mapping table in the memory of the solid-state drive, and the size of the hot mapping table is 0.5% of the flash size of the solid-state drive; 2) Data write operation step: (2-1) According to the write instruction passed by the user, take out the logical page number of the data page to be written in the write operation, and go to process (2-2); (2-2) Check whether there is an empty flash page in the partition where the logical page number is located. If so, go to process (2-4), otherwise go to process (2-3); (2-3) Perform the garbage collection and model training steps on this partition, and then go to process (2-4); (2-4) Write the data into the empty flash page, record the physical page number of this flash page, and go to process (2-5); (2-5) Search for this logical page number in the hot mapping table in the memory of the solid-state drive. If this logical page number is found in the hot mapping table in the memory of the solid-state drive, go to process (2-6), otherwise go to process (2-7); (2-6) Mark the physical page number corresponding to the found logical page number as invalid and delete this mapping in the hot mapping table, and go to process (2-14); (2-7) Judge whether there is free space in the hot mapping table. If there is no free space, go to process (2-8), otherwise go to process (2-14); (2-8) Select the mapping with the least number of usage times within the set time in the hot mapping table and replace it from the memory, and go to process (2-9); (2-9) Judge whether there is a mapping replaced out in the global mapping table. If so, go to process (2-10), otherwise go to process (2-13); (2-10) Mark the physical page number corresponding to the logical page number replaced out in the global mapping table as invalid, delete this mapping, and go to process (2-11); (2-11) Judge whether the logical page number replaced out is accurately predicted by the multiple linear regression model, that is, whether the bitmap information corresponding to the physical page number output after this logical page number is input into the model is 1. If it is 1, go to process (2-12), otherwise go to process (2-13); (2-12) Modify the bitmap information corresponding to the physical page number output by the model in the model to 0, and go to process (2-13); (2-13) Insert the replaced mapping into the global mapping table, and go to process (2-14); (2-14) Insert the logical page number of the write request and the corresponding physical page number into the hot mapping table, and the write operation ends; 3) Garbage collection and model training step: (3-1) Select the partition that needs to perform garbage collection, and go to process (3-2); (3-2) Determine whether the data in the partition contains valid data. If so, go to process (3-3); otherwise, go to process (3-9); (3-3) Read the valid data into the memory of the solid-state drive and sort it in ascending order of logical page numbers, then go to process (3-4); (3-4) Take out a group of free flash blocks with consecutive physical page numbers from the reserved space, and go to process (3-5); (3-5) Write the valid data to the selected free flash blocks in the order of logical page numbers, obtain a group of mappings from monotonically increasing logical page numbers to physical page numbers, and divide this group of mappings from logical page numbers to physical page numbers into N segments on average, then go to process (3-6); (3-6) Use the least squares method to calculate the slope and intercept for each segment of the mapping from logical page numbers to physical page numbers, and store them in the model area belonging to this partition in the memory, then go to process (3-7); (3-7) Use all the logical page numbers of this partition to verify the model and update the bitmap information; mark the bitmap of the physical page numbers that can be accurately predicted by the model as 1, and those that cannot be accurately predicted as 0, then go to process (3-8); (3-8) Mark the model in the memory of the solid-state drive for this partition as available, and go to process (3-10); (3-9) Mark the model in the memory of the solid-state drive for this partition as unavailable, and go to process (3-11); (3-10) Erase the data blocks in the current garbage collection partition, and the operation ends; (3-11) Erase the data blocks in the current partition undergoing garbage collection, and put the erased data blocks back into the reserved space, and the operation ends; 4) Steps of data read operation: (4-1) According to the read instruction passed by the user, take out the logical page numbers of the data pages that need to be read for the read operation, and go to process (4-2); (4-2) Search the hot mapping table in the memory of the solid-state drive. If the corresponding actual physical page number is found in the hot mapping table, go to process (4-9); otherwise, go to process (4-3); (4-3) Search and judge the partition information in the memory of the solid-state drive. If the model in the partition is marked as available, go to process (4-4); otherwise, go to process (4-8); (4-4) Input the logical page number into the multi-segment linear regression model to obtain the predicted physical page number, and go to process (4-5); (4-5) Determine whether the predicted physical page number exceeds the partition range. If it exceeds, go to process (4-8); otherwise, go to process (4-6); (4-6) Determine whether the bitmap information corresponding to the predicted physical page number is 1. If it is 1, go to process (4-7); otherwise, go to process (4-8); (4-7) Mark the predicted physical page number as the actual physical page number, and go to process (4-10); (4-8) Search the global mapping table in the flash memory to obtain the physical page number corresponding to the required logical page number, mark it as the actual physical page number, and go to process (4-10); (4-9) Mark the physical page number found in the hot mapping table as the actual physical page number, and go to process (4-10); (4-10) Return the flash page data corresponding to the actual physical page number, and the read operation is completed.