A solid state disk invalid data padding method and device
By establishing an invalid data filling speed model and optimizing the invalid data filling process, the problem of existing technologies being unable to cope with sudden IO commands is solved, and the flexible adaptability of the data filling process and the stable operation of the hard drive are achieved.
Patent Information
- Application Number
- CN202411921333.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2044-12-25
AI Technical Summary
Existing invalid data filling schemes cannot effectively cope with sudden I/O commands, prolonging the response time of host-initiated I/O commands or increasing the risk of data errors, and fail to rationalize the management of physical block open time.
An invalid data filling speed model is established. By adjusting the filling speed adjustment factor and the amplification factor, the invalid data filling process is optimized based on the IO command time and flash memory write speed limit. The invalid data filling speed is calculated using registers, timers, and comparators.
It achieves flexible adaptability in the invalid data filling process, taking into account both IO command response time and flash memory lifespan, ensuring data security and normal hard drive operation.
Smart Images

Figure CN119861872B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of hard disk maintenance technology, specifically to a method and device for filling invalid data into a solid-state drive. Background Technology
[0002] NAND flash memory is the key storage medium in SSDs. In NAND flash memory, floating gate transistors are organized into a flash array according to a certain structural hierarchy. In NAND, the physical page (PG) is the smallest unit of reading, the word line (WL) is the smallest unit of programming, and the physical block (BLK) is the smallest unit of erasing.
[0003] During flash memory programming, if a physical block remains open for too long, injected floating gate electrons may overflow, leading to errors in the data already written to that block. If the block is then directly shut down, the unwritten portions will experience a higher potential difference during erasure, increasing wear and affecting the block's lifespan. To address this, one solution is to fill the end of the physical block with invalid data when the open time reaches a threshold and the block is not fully written, and then shut down the block.
[0004] In existing technologies, there is limited research on invalid data padding schemes. If the remaining portion of the physical block is filled all at once, or if a large amount of invalid data is filled at a fixed time, it cannot cope with sudden I / O commands during the filling process, thus prolonging the response time of the host initiating I / O commands. If a small amount of data is filled per unit time, the increased filling time actually increases the open time of the physical block, thereby increasing the risk of data errors. Summary of the Invention
[0005] Firstly, this application provides a method for filling invalid data into a solid-state drive, which rationalizes the process of filling the end of a physical block with invalid data.
[0006] The technical solution of this application is as follows:
[0007] A method for filling invalid data into a solid-state drive (SSD) is proposed, which is based on the following invalid data filling speed model:
[0008] ;
[0009] In the formula, Indicates the filling speed of invalid data. Indicates the physical block open time threshold. t Indicates opening hours. K This indicates the upper limit for the filling speed of invalid data. The filling rate adjustment factor for invalid data. This represents the factor that adjusts the rate of increase in filling invalid data. Indicates the time of the most recent I / O command sent;
[0010] Based on the above invalid data filling speed model, this method specifically includes the following steps:
[0011] S1) Determine parameters based on the user's invalid data filling speed requirements. K、 、 ;
[0012] S2) Record the time of the most recent IO command sent as... To be continuously updated Meanwhile, the flash memory conversion layer continuously fills the physical blocks with invalid data based on the calculated invalid data filling rate.
[0013] Furthermore, the upper limit of the invalid data filling speed is a percentage range of the maximum write processing speed of the solid-state drive.
[0014] Furthermore, the invalid data filling rate adjustment factor Must meet:
[0015] ;
[0016] In the formula, This indicates the invalid data processing time for a single word line. Indicates the longest response time for an IO command.
[0017] Furthermore, the invalid data filling rate adjustment factor Also required:
[0018] ;
[0019] In the formula, The maximum time a user requests to disable BLK. Indicates the contents of each BLK wl quantity.
[0020] Furthermore, the adjustment factor for the rate of increase in filling invalid data. Must meet:
[0021] ;
[0022] In the formula, This indicates the time it takes for the fill speed to increase from its minimum value to its maximum value. This represents the minimum filling speed.
[0023] Furthermore, the adjustment factor for the rate of increase in filling invalid data. Also required:
[0024] ;
[0025] In the formula, This represents the shortest time it takes for the filling speed to increase from its minimum value to its maximum value.
[0026] Secondly, this application provides a device for filling invalid data into a solid-state drive, characterized in that it includes:
[0027] Registers: Used to store invalid data and fill speed models;
[0028] Timer: Used to record the open time of physical blocks;
[0029] Comparator: Used to record the time of the most recent I / O command and compare it with previously recorded timestamps. t Compared to 0;
[0030] Calculation unit: Used to calculate the filling speed of invalid data.
[0031] Due to the adoption of the above technical solution, the beneficial effects of this application are as follows:
[0032] 1. This application establishes an invalid data filling speed model in the form of an "S"-shaped curve, fully considering the following three cases:
[0033] 1) The current time is relatively long since the last I / O command. In this case, it is assumed that the host will not send I / O commands to the physical block for a considerable period of time. Therefore, the filling speed is increased, and the physical block is closed as soon as possible to ensure the security of the written data. This corresponds to the middle segment of the curve.
[0034] 2) The time since the last I / O command is relatively short. In this case, it is assumed that the host will still send I / O commands to the physical block in the future. Therefore, the response time of the next I / O command should be taken into account, and the fill speed should be appropriately reduced. This corresponds to the first segment of the curve.
[0035] 3) Due to the limitations of flash memory write speed, the filling speed of invalid data has an upper limit. When approaching the speed limit, the filling speed slows down to ensure the normal operation of the solid-state drive. This corresponds to the latter part of the curve.
[0036] 2. This application provides limiting values for the fill speed adjustment factor and the fill speed increase adjustment factor for invalid data, so that the fill speed fully adapts to the actual fill process. For example, The value should not be too large. The value should ensure that after the physical block enters the invalid data filling process, it can still be filled with a certain amount of invalid data even when frequent I / O commands occur. For example, It should not be too large, as it needs to balance filling speed and response time for sudden I / O commands. Attached Figure Description
[0037] The accompanying drawings, which are provided to further illustrate this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application.
[0038] Figure 1 A flowchart of a method for filling invalid data into a solid-state drive is provided in this application;
[0039] Figure 2 This is a schematic diagram illustrating the change in invalid data filling speed over open time in this application;
[0040] Figure 3 This application provides an architecture diagram of a solid-state drive invalid data filling device. Detailed Implementation
[0041] Based on the background technology, this application provides a method for filling invalid data in a solid-state drive. This method is implemented based on the following invalid data filling speed model:
[0042] ;
[0043] In the formula, Indicates the filling speed of invalid data. Indicates the physical block open time threshold. t Indicates opening hours. K This indicates the upper limit for the filling speed of invalid data. The filling rate adjustment factor for invalid data. This represents the factor that adjusts the rate of increase in filling invalid data. Indicates the time of the most recent I / O command sent;
[0044] Based on the above invalid data filling speed model, this method specifically includes the following steps:
[0045] S1) Determine parameters based on the user's invalid data filling speed requirements. K、 、 ;
[0046] S2) Record the time of the most recent IO command sent as... To be continuously updated Meanwhile, the flash memory conversion layer continuously fills the physical blocks with invalid data based on the calculated invalid data filling rate.
[0047] Existing methods for filling invalid data do not adequately match the processing speed of SSDs, thus prolonging the open time of physical blocks and increasing the risk of data write errors. Furthermore, they do not take into account the possibility of sudden IO commands during the invalid filling process.
[0048] As attached Figure 1 and attached Figure 2 As shown, when the physical block open time reaches a threshold, invalid data filling operation is initiated, and the filling speed is implemented according to the invalid data filling speed model. When filling begins, the time of the most recent IO command sent before filling starts is recorded as... Calculate the initial velocity. After filling begins, the velocity changes continuously. If another I / O command is recorded after filling begins, the sending time of this I / O command is re-recorded. The filling speed is recalculated, and filling continues according to the new calculation result, repeating this process until the physical block is completely filled. In this way, the more IO commands are sent during the invalid data filling process, the slower the calculated initial filling speed will be, which matches the scenario of frequent IO commands.
[0049] It should be noted that the rate at which invalid data is filled in this application can be determined according to the user's needs, i.e., by defining parameters. K、 、 Sure.
[0050] parameter K The value should be chosen to reach the upper limit of the solid-state drive's write processing speed as much as possible in order to shorten the opening time of physical blocks.
[0051] parameter This can be determined by the longest tolerable response time of a bursty I / O command. Assume a... wl The invalid data processing time is Then fill at the minimum speed Fill a line wl The time is .set up To set the maximum response time for an I / O command, it is necessary to make And thus obtain Furthermore, the parameter α should not be too large; it should ensure that once the physical block enters the invalid data filling process, even with frequent I / O commands, a certain amount of invalid data can be filled within a unit of time. Invalid data filling speed adjustment factor. Also required:
[0052] ;
[0053] In the formula, The maximum time a user requests to disable BLK. Indicates the contents of each BLK wl quantity.
[0054] parameter The time it takes for the fill speed to increase from the minimum to the maximum speed can be determined by the length of time it takes for the fill speed to increase from the minimum to the maximum speed when there are no I / O requests for a long period of time. This can be expressed as:
[0055] ;
[0056] In the formula, This indicates the time it takes for the fill speed to increase from its minimum value to its maximum value. This represents the minimum charging speed. Let... for ,but ,thereby In addition, parameters The value cannot be too large, otherwise the data filling speed will increase too quickly, and the response time of sudden I / O commands will still not be able to be taken into account. Therefore, the adjustment factor for the rate of increase of invalid data filling speed is... Also required:
[0057] ;
[0058] In the formula, This represents the shortest time it takes for the filling speed to increase from its minimum value to its maximum value.
[0059] In step S1) of this application, the invalid data filling speed requirement is determined by the user. The user can determine the filling speed based on their expected upper limit. , The model is determined by parameters such as...
[0060] Based on the above, this application establishes an "S"-shaped curve-based invalid data filling speed model, fully considering the following three scenarios: 1) The time since the last IO command is relatively long. In this case, it is assumed that the host will not send IO commands to the physical block for a considerable period of time, so the filling speed is increased to close the physical block as soon as possible to ensure the security of the written data. This corresponds to the middle section of the curve. 2) The time since the last IO command is relatively short. In this case, it is assumed that the host will still send IO commands to the physical block in the future, so the response time of the next IO command should be taken into account, and the filling speed should be appropriately reduced. This corresponds to the early section of the curve. 3) Due to the limitation of flash memory write speed, the invalid data filling speed has an upper limit. When approaching the speed limit, the filling speed slows down to ensure the normal operation of the solid-state drive. This corresponds to the later section of the curve.
[0061] Furthermore, this application provides limiting values for the fill speed adjustment factor and the fill speed increase adjustment factor for invalid data, ensuring that the fill speed fully adapts to the actual fill process. For example, The value should not be too large. The value should ensure that after the physical block enters the invalid data filling process, it can still be filled with a certain amount of invalid data even when frequent I / O commands occur. For example, It should not be too large, as it needs to balance filling speed and response time for sudden I / O commands.
[0062] As attached Figure 2 As shown, the fill speed calculation needs to be updated. The update method is to record the time of the most recent IO command as... To be continuously updated Meanwhile, the flash memory conversion layer continuously fills the physical blocks with invalid data based on the calculated invalid data filling rate.
[0063] This application also provides a device for filling invalid data into a solid-state drive, comprising:
[0064] Registers: Used to store invalid data and fill speed models;
[0065] Timer: Used to record the open time of physical blocks;
[0066] Comparator: Used to record the time of the most recent I / O command and compare it with the previously recorded t0;
[0067] Calculation unit: Used to calculate the filling speed of invalid data.
[0068] Invalid data is filled by the filling module, which interacts with the SSD's Flash Translation Layer (FTL). The FTL layer sends the initiation time of the last I / O command to the filling module, the filling module sends the filling speed to the FTL layer, and the FTL layer configures invalid data parameters and sends them to the backend to fill invalid data.
[0069] For any parts not mentioned in this application, existing technologies may be used or referenced.
[0070] The above description is merely an embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of this application should be included within the scope of the claims of this application.
Claims
1. A method for filling invalid data into a solid-state drive, characterized in that, This method is based on the following invalid data filling speed model: ; In the formula, Indicates the filling speed of invalid data. This represents the physical block open time threshold. t Indicates opening hours. K This indicates the upper limit for the filling speed of invalid data. This indicates the filling rate adjustment factor for invalid data. This represents the factor that adjusts the rate of increase in filling invalid data. Indicates the time of the most recent I / O command sent; Based on the above invalid data filling speed model, this method specifically includes the following steps: S1) Determine parameters based on the user's invalid data filling speed requirements. K、 、 ; in, ; ; In the formula, The maximum time a user requests to disable BLK. Indicates the contents of each BLK wl quantity, Indicates a wl The processing time for invalid data, Indicates the longest response time for an I / O command; The time it takes for the filling speed to increase from its minimum value to its maximum value. This represents the minimum filling speed. This represents the shortest time for the fill speed to increase from its minimum value to its maximum value. S2) Record the time of the most recent IO command sent as... To be continuously updated Meanwhile, the flash memory conversion layer continuously fills the physical blocks with invalid data based on the calculated invalid data filling rate.
2. A device for filling invalid data into a solid-state drive as described in claim 1, characterized in that, include: Registers: Used to store invalid data and fill speed models; Timer: Used to record the open time of physical blocks; Comparator: Used to record the time of the most recent I / O command and compare it with previously recorded timestamps. t Compare with 0; Calculation unit: Used to calculate the filling speed of invalid data.
Citation Information
Patent Citations
SSD Cache filling method and device
CN104133642A
Method and device for managing physical blocks in solid state disk
CN108874309A