Backup method of SSD user data in internal cache
By introducing DMA hardware modules into SSD, data transmission and cache management between SRAM and DDR are realized, which solves the problem that SSD user data backup solution cannot guarantee high performance and high consistency at the same time, and achieves more stable sequential write performance and consistency.
Patent Information
- Application Number
- CN202411947282.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-12-27
AI Technical Summary
The backup solution of existing SSD user data in the internal cache cannot ensure high performance and high consistency of sequential writing, resulting in excessive performance fluctuations.
By introducing DMA hardware modules inside the SSD, data transmission between the SRAM user data cache unit and the DDR user data backup cache unit is realized, ensuring that the SRAM cache unit is released after the flash memory particle write operation is completed.
This method improves the sequential write performance and consistency of SSDs without losing user data, reduces performance fluctuations, and improves the performance average.
Smart Images

Figure CN119718208A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of flash memory storage control, and in particular to a method for backing up SSD user data in an internal cache. Background Art
[0002] The sequential write performance of solid state drive (SSD) products is mainly determined by the DMA (Direct Memory Access) performance from the host computer to the SSD internal cache, the DMA performance from the SSD internal cache to the flash memory particle data register, and the flash memory particle data writing storage medium performance (hereinafter referred to as the flash memory particle write performance). The flash memory particle write performance cannot be changed after the flash memory particle type is determined. The sequential write performance can only be improved by optimizing the use medium and usage scheme of the SSD internal cache. SSDs usually use DDR (Double Data Rate Synchronous Dynamic Random Access Memory) as their internal system information management medium, and can also be used as an internal cache to transmit user data, but this solution has poor sequential write performance because DDR performance is relatively low. To further improve the sequential write performance, some mainstream SSD products will use higher-performance SRAM (Static Random-Access Memory) as an internal cache to transmit user data. Due to cost limitations, the SRAM cache capacity configured in the product is usually very low. In order to improve the utilization of the SRAM cache, the SRAM cache will be released in advance after the data is transferred from the SRAM cache to the flash memory particle data register, rather than releasing the SRAM cache after the flash memory particle writes the data to the storage medium. This solution needs to ensure that when the flash memory particle fails to write data to the storage medium, it can find the original user data and write it to other locations in the flash memory particle. Therefore, the user data needs to be backed up, that is, it needs to be backed up to the DDR before releasing the SRAM cache. Under this solution, if the amount of backup data is too large or too small each time, the sequential write performance will be lower than the expected value, and if the amount of backup data is inconsistent each time, the performance fluctuation will be too large. There is currently no mature backup solution for SSD user data in the internal cache that can simultaneously guarantee high performance and high consistency of sequential writes. Therefore, it is necessary to design and develop a reliable backup solution for user data in the internal cache. Summary of the invention
[0003] The present invention aims to provide a method for backing up SSD user data in an internal cache, which can improve the sequential write performance and consistency of the SSD.
[0004] In order to achieve the above-mentioned purpose, the present invention is implemented through the following technical solutions.
[0005] A method for backing up SSD user data in an internal cache comprises the following steps: S1, the SRAM user data cache unit and the DDR user data backup cache unit perform initialization operations; S2. The host computer sends a write command to the SSD. The SSD allocates an SRAM user data cache unit for the host computer write command. The host computer write command obtains the SRAM user data cache unit successfully, starts the DMA operation, and transfers the host computer user data to the SRAM user data cache unit. S3, start the DMA operation of the specified number of SRAM user data cache unit data to the associated DDR user data backup cache unit, and complete the SSD SRAM user data cache unit backup; S4, performing a flash memory particle write operation on all SRAM user data cache units; S5. The data in the flash memory particle data register is written into the flash memory particle storage medium.
[0006] Further, step S1 includes: right All members perform initialization operations: , ; right All members perform initialization operations: , ; right All members perform initialization operations: , ; Will Set to 0, Set to 0; Among them, the array Indicates the DDR user data backup cache set number associated with each SRAM user data cache unit. The array index is the SRAM user data cache unit number. The array member is the DDR user data backup cache set number that backs up the current SRAM user data cache unit. Indicates the number of SRAM user data cache units, and the calculation formula is: ; Indicates the SRAM user data cache capacity, Indicates the capacity of the user data cache unit, in Byte; Arrays Indicates the status of each SRAM user data cache unit. The array index is the SRAM user data cache unit number, and the array member is the status of the SRAM user data cache unit. Indicates the idle state of the SRAM user data cache unit; Arrays Indicates the status of each DDR user data backup cache unit. The array index is the DDR user data backup cache unit number, and the array member is the status of the DDR user data backup cache unit. Indicates the number of DDR user data backup cache units. Indicates the idle state of the DDR user data backup cache unit; Indicates the currently allocatable SRAM user data cache unit number. Indicates the SRAM user data cache unit number currently waiting to be backed up.
[0007] Further, step S2 includes: S201, after the host computer sends a write command to the SSD, the SSD checks whether the current SRAM user data cache unit is idle, and if so, proceeds to the next step; S202, calculating the DDR user data backup cache unit number associated with the current SRAM user data cache unit, and checking whether the DDR user data backup cache unit is idle, if so, proceeding to the next step; S203, updating the state of the SRAM user data cache unit and the state of the DDR user data backup cache unit, associating the SRAM user data cache unit with the host computer write command, and starting the DMA operation of the user data associated with the host computer write command to the SRAM user data cache unit.
[0008] Furthermore, the SSD allocates an SRAM user data cache unit for a host computer write command and performs data transmission including: examine Is the value If yes, proceed to the next step, otherwise suspend allocating SRAM user data cache units; Depend on Get the number The DDR user data backup cache set associated with the SRAM user data cache unit is used Temporarily record the DDR user data backup cache unit number associated with the SRAM user data cache unit, as follows: ; examine Is the value If yes, proceed to the next step, otherwise suspend allocating SRAM user data cache units; Will Updated to ,Will Updated to ; Assign numbers to write commands The SRAM user data cache unit will Set to ; right Execute the plus 1 operation and repeat the above steps of allocating SRAM user data cache units until equal , then Set to 0; in, Indicates the number of DDR user data backup cache units. Indicates the idle state of the DDR user data backup cache unit. Indicates the state of transferring the host computer user data to the SRAM user data cache unit. Indicates the state that the DDR user data backup cache unit is waiting for the SRAM user data cache unit to start the backup operation. Indicates the SRAM user data cache unit number obtained by the current host computer write command; Write command to get number After the SRAM user data cache unit is set, the DMA operation is started to transfer the host computer user data to The SRAM user data cache unit.
[0009] Further, step S3 includes: S301, after the DMA operation of the host computer writing the user data associated with the command to the SRAM user data cache unit is completed, the state of the SRAM user data cache unit associated with the write command is updated; S302, obtaining the number of the SRAM user data cache unit currently waiting for the backup operation, and starting from this number, checking the status of a specified number of SRAM user data cache units; S303: After confirming that the specified number of SRAM user data cache units complete the host computer DMA operation, start the DMA operation of the specified number of SRAM user data cache unit data to the associated DDR user data backup cache unit.
[0010] Further, the specific steps include: S301-1, Updated to ,in Indicates the status of each SRAM user data cache unit. The array index is the SRAM user data cache unit number. Indicates the completion status of the host computer user data transmission; S302-1, Set to , Indicates the SRAM user data cache unit number that needs to be checked before performing the backup operation. Indicates the SRAM user data cache unit number currently waiting to be backed up; S302-2, Inspection Is it , if yes, continue, otherwise exit the operation; S302-3, Yes Execute the plus 1 operation and repeat the above check of the specified number of SRAM user data cache unit states until equal , then Set to 0, Indicates the number of SRAM user data cache units; S302-4. Inspection Is it equal to Or it is equal to 0, if yes, continue, otherwise return to S302-2, Indicates the number of SRAM user data cache units set for each backup operation; S303-1, calculation number is The DDR user data backup cache unit number associated with the SRAM user data cache unit : ; S303-2, start the SSD internal DMA, from the number The SRAM user data cache unit starts with the number The SRAM user data cache unit transfers data from the slave number In the starting DDR user data backup cache unit; S303-3, Set to ; S303-4, Set to , Indicates the state of transferring the SRAM user data cache unit data to the DDR user data backup cache unit; S303-5, Yes Execute the plus 1 operation and repeat the above DMA operation until equal , then Set to 0; S303-6, Inspection Is it equal to or equal to 0, if yes, proceed to the next step, otherwise return to S303-4; S303-7, the starting SRAM user data cache unit number of this backup operation Set to ,Will Set to .
[0011] Further, step S4 includes: S401, after the DMA operation of the SRAM user data cache unit data to the associated DDR user data backup cache unit is completed, the status of all SRAM user data cache units associated with the backup operation is updated; S402: Perform a flash memory particle write operation on all SRAM user data cache units, and associate all DDR user data backup cache units associated with the SRAM user data cache units with the flash memory particle write operation.
[0012] Furthermore, before writing the SRAM user data cache unit data into the flash memory particle, the following steps are performed: S401-1. Obtain the starting SRAM user data cache unit number associated with this backup operation ,Will Set to , Indicates the SRAM user data cache unit number that needs to be updated after the backup operation is completed. Indicates the starting SRAM user data cache unit number in the backup operation execution S401-2, Updated to , Indicates the status of each SRAM user data cache unit. The array index is the SRAM user data cache unit number. Indicates the status of the data transfer from the SRAM user data cache unit to the DDR user data backup cache unit; S401-3, calculation number is The DDR user data backup cache unit number associated with the SRAM user data cache unit , specifically as follows, ; S401-4, Updated to , Indicates the status of each DDR user data backup cache unit. The array index is the DDR user data backup cache unit number. Indicates the status of the data transfer from the SRAM user data cache unit to the DDR user data backup cache unit; S401-5, Yes Execute the plus 1 operation and repeat the above steps S401-1 to S401-4. equal , then Set to 0; S401-6. Inspection Is it equal to Or it is equal to 0, if yes, continue, otherwise return to S401-2; S401-7, Set to , Indicates the starting SRAM user data cache unit number of the flash memory particle to be written; S401-8, calculation number is The DDR user data backup cache unit number associated with the SRAM user data cache unit : S401-9, and Associated with the flash memory particle write operation to be executed; S402-1, when the flash memory particle write operation is executed, if the data in the SRAM user data cache unit has been transferred to the flash memory particle data register, obtain the starting SRAM user data cache unit number associated with this operation ; S402-2, Set to , Indicates the SRAM user data cache unit number that needs to be updated after the SRAM user data cache unit data is written into the flash memory particle data register; S402-3, Updated to , Indicates the idle state of the SRAM user data cache unit; S402-4, Yes Execute the plus 1 operation, if equal , then Set to 0, Indicates the number of DDR user data backup cache sets. is a positive integer and ; S402-5, Yes Execute the plus 1 operation and repeat steps S402-3 to S402-4. equal , then Set to 0; S402-6, Inspection Is it equal to Or equal to 0, if yes, exit the operation, otherwise return to S402-3.
[0013] Further, step S5 includes: S501, after the data of all SRAM user data cache units associated with the flash memory particle write operation are written into the flash memory particle data register, all SRAM user data cache units are released, and the DDR user data backup cache set numbers associated with all SRAM user data cache units are updated; S502: Write the data in the flash memory particle data register into the flash memory particle storage medium, and after writing, release all DDR user data backup cache units associated with the flash memory particle write operation.
[0014] Furthermore, the method further comprises the steps of: S502-1. After writing the data in the data register into the storage medium, obtain the associated starting DDR user data backup cache unit number , Indicates the DDR user data backup cache unit number associated with the starting SRAM user data cache unit number of the flash memory particle to be written; S502-2, Set to , Indicates the DDR user data backup cache unit number that needs to be updated after writing the flash memory particle data register data into the flash memory particle storage medium; S502-3, Updated to ; S502-4, Yes Execute the plus 1 operation and repeat step S502-3 until equal , then Set to 0; S502-5, Inspection Is it equal to Or equal to 0, if yes, exit the operation, otherwise return to S502-3.
[0015] The advantages of the present invention are: the proposed method for backing up SSD user data in the internal cache ensures that the sequential write performance mean and performance consistency are not affected under the premise that the user data is not lost. The data backup operation from the SRAM cache to the DDR cache is separated from the write command processing flow from the host computer to the SSD, ensuring that the data volume of each backup operation of the SSD is basically consistent, thereby reducing performance fluctuations and improving performance mean. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 The flow chart of obtaining the SSD SRAM user data cache unit by the host computer writing command of the present invention; Figure 2 This is a flow chart of backing up the SSD SRAM user data cache unit of the present invention; Figure 3 This is a processing flow chart after the backup of the SSD SRAM user data cache unit of the present invention is completed. DETAILED DESCRIPTION
[0017] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0018] This embodiment discloses a method for backing up SSD user data in an internal cache, the core of which is that after the data backup function is enabled inside the SSD, the sequential write performance mean and performance consistency are not affected.
[0019] In order to realize the internal cache backup function of SSD user data, a DMA hardware module needs to be added inside the SSD to realize the data transmission operation from SRAM to DDR.
[0020] Before implementing the backup method of SSD user data in the internal cache, the following parameters need to be obtained: SRAM user data cache capacity , the unit is Byte; User data cache unit capacity , the unit is Byte; Number of SRAM user data cache units , defined as follows, .
[0021] All SRAM user data cache units are numbered starting from 0 and managed using sets. ,in Represents the i-th user data cache unit.
[0022] DDR user data backup cache set capacity ,in, .
[0023] Number of DDR user data backup cache sets , is a positive integer, and .
[0024] DDR user data backup cache capacity , the unit is Byte.
[0025] Number of DDR user data backup cache units .
[0026] All DDR user data backup cache units are numbered starting from 0 and managed using sets. ,in represents the i-th DDR user data backup cache unit; All DDR user data backup cache sets are numbered starting from 0 and are managed using sets. ,in Represents the i-th DDR user data backup cache set.
[0027] After obtaining the relevant parameters of the SRAM user data cache and the DDR user data backup cache, the following management information is required to manage the SRAM user data cache and the DDR user data backup cache: Using Arrays The DDR user data backup cache set number associated with each SRAM user data cache unit is recorded, the array index is the SRAM user data cache unit number, and the array member is the DDR user data backup cache set number that backs up the current SRAM user data cache unit.
[0028] Using Arrays Record the status of each SRAM user data cache unit. The array index is the SRAM user data cache unit number, and the array member is the status of the SRAM user data cache unit. The status types include: : SRAM user data cache unit idle state; : Transfer the host computer user data to the SRAM user data cache unit status; : Status of host computer user data transmission completion; : Transfer the SRAM user data cache unit data to the DDR user data backup cache unit state; : The data from the SRAM user data cache unit to the DDR user data backup cache unit is transferred to the completion status.
[0029] use Record the currently allocatable SRAM user data cache unit number; use Record the SRAM user data cache unit number obtained by the current host computer write command; use Temporarily record the DDR user data backup cache unit number associated with the SRAM user data cache unit with the specified number; use Record the SRAM user data cache unit number currently waiting to be backed up; use Record the SRAM user data cache unit number that needs to be checked before performing the backup operation; use Record the starting SRAM user data cache unit number in the backup operation execution; use Record the SRAM user data cache unit number that needs to be updated after the backup operation is completed; use Record the starting SRAM user data cache unit number of the flash memory particle to be written; use Record the SRAM user data cache unit number that needs to be updated after the SRAM user data cache unit data is written into the flash memory particle data register; use Record the DDR user data backup cache unit number associated with the starting SRAM user data cache unit number of the flash memory particle to be written; use Record the DDR user data backup cache unit number that needs to be updated after writing the flash memory particle data register data into the flash memory particle storage medium; use Indicates the number of SRAM user data cache units for each backup operation. This value can be defined by the user. Using Arrays Record the status of each DDR user data backup cache unit. The array index is the DDR user data backup cache unit number. The array member is the status of the DDR user data backup cache unit. The status types include: : DDR user data backup cache unit idle state; : The state in which the DDR user data backup cache unit waits for the SRAM user data cache unit to start the backup operation; : The data from the SRAM user data cache unit to the DDR user data backup cache unit is transferred to the completion status.
[0030] The method for backing up SSD user data in the internal cache includes the following steps: S1, the SRAM user data cache unit and the DDR user data backup cache unit perform initialization operations; S2. The host computer sends a write command to the SSD. The SSD allocates an SRAM user data cache unit for the host computer write command. The host computer write command obtains the SRAM user data cache unit successfully, starts the DMA operation, and transfers the host computer user data to the SRAM user data cache unit. S3, start the DMA operation of the specified number of SRAM user data cache unit data to the associated DDR user data backup cache unit, and complete the SSD SRAM user data cache unit backup; S4, performing a flash memory particle write operation on all SRAM user data cache units; S5. The data in the flash memory particle data register is written into the flash memory particle storage medium.
[0031] Step S1 initialization includes: (1) Yes All members perform initialization operations: , ; (2) Yes All members perform initialization operations: , ; (3) Yes All members perform initialization operations: , ; (4) Set to 0, Set to 0.
[0032] Please refer to step S2 Figure 1 , including the following steps.
[0033] (1) After the host computer sends a write command to the SSD, the SSD checks Is the value If yes, proceed to the next step, otherwise suspend allocating SRAM user data cache units; (2) By Get the number The DDR user data backup cache set associated with the SRAM user data cache unit is used Temporarily record the DDR user data backup cache unit number associated with the SRAM user data cache unit, as follows: ; (3) Inspection Is the value If yes, proceed to the next step, otherwise suspend allocating SRAM user data cache units; (4) Updated to ,Will Updated to ; (5) Assign a number to the write command: The SRAM user data cache unit will Set to ; (6) Yes Execute the plus 1 operation and repeat the above steps of allocating SRAM user data cache units until equal , then Set to 0.
[0034] (7) Write command to get the number After the SRAM user data cache unit is set, the DMA operation is started to transfer the host computer user data to The SRAM user data cache unit.
[0035] Please refer to step S3 Figure 2 , including the following steps.
[0036] (1) Updated to ; (2) Set to ; (3) Inspection Is it , if yes, continue, otherwise exit the operation; (4) Yes Execute the plus 1 operation and repeat the above check of the specified number of SRAM user data cache unit states until equal , then Set to 0; (5) Inspection Is it equal to or equal to 0, if yes, continue, otherwise return to S302-2; (6) Calculation number is The DDR user data backup cache unit number associated with the SRAM user data cache unit : ; (7) Start the SSD internal DMA, starting from The SRAM user data cache unit starts with the number The SRAM user data cache unit transfers data from the slave number In the starting DDR user data backup cache unit; (8) Set to ; (9) Set to ; (10) Yes Execute the plus 1 operation and repeat the above DMA operation until equal , then Set to 0; (11) Inspection Is it equal to Or it is equal to 0, if yes, go to the next step, otherwise return to (9); (12) The starting SRAM user data cache unit number for this backup operation Set to ,Will Set to .
[0037] Please refer to step S4 Figure 3 , including the following steps.
[0038] (1) Obtain the starting SRAM user data cache unit number associated with this backup operation ,Will Set to ; (2) Updated to ; (3) Calculation number is The DDR user data backup cache unit number associated with the SRAM user data cache unit , specifically as follows, ; (4) Updated to ; (5) Yes Execute the plus 1 operation and repeat the above steps S401-1 to S401-4. equal , then Set to 0; (6) Inspection Is it equal to Or it is equal to 0, if yes, continue, otherwise return (2); (7) Set to ; (8) Calculation number is The DDR user data backup cache unit number associated with the SRAM user data cache unit : (9) and Associated with the flash memory granule write operation to be performed.
[0039] When the flash memory particle write operation is executed, if the data in the SRAM user data cache unit has been transferred to the flash memory particle data register, obtain the starting SRAM user data cache unit number associated with this operation , and perform the following steps. (1) Set to ; (2) Updated to , Indicates the idle state of the SRAM user data cache unit; (3) Yes Execute the plus 1 operation, if equal , then Set to 0; (4) Yes Execute the plus 1 operation and repeat steps S402-3 to S402-4. equal , then Set to 0; (5) Inspection Is it equal to Or equal to 0, if yes, exit the operation, otherwise return to (2).
[0040] Please refer to step S5 Figure 3 , including the following steps.
[0041] (1) After writing the data in the data register to the storage medium, obtain the associated starting DDR user data backup cache unit number ; (2) Set to ; (3) Updated to ; (4) Yes Execute the plus 1 operation and repeat step S502-3 until equal , then Set to 0; (5) Inspection Is it equal to Or equal to 0, if yes, exit the operation, otherwise return to (3).
[0042] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for backing up SSD user data in an internal cache, characterized in that: Includes steps: S1, the SRAM user data cache unit and the DDR user data backup cache unit perform initialization operations; S2. The host computer sends a write command to the SSD. The SSD allocates an SRAM user data cache unit for the host computer write command. The host computer write command obtains the SRAM user data cache unit successfully, starts the DMA operation, and transfers the host computer user data to the SRAM user data cache unit. S3, start the DMA operation of the specified number of SRAM user data cache unit data to the associated DDR user data backup cache unit, and complete the SSD SRAM user data cache unit backup; S4, performing a flash memory particle write operation on all SRAM user data cache units; S5. The data in the flash memory particle data register is written into the flash memory particle storage medium.
2. The method for backing up SSD user data in internal cache according to claim 1, characterized in that: Step S1 includes: right All members perform initialization operations: , ; right All members perform initialization operations: , ; right All members perform initialization operations: , ; Will Set to 0, Set to 0; Among them, the array Indicates the DDR user data backup cache set number associated with each SRAM user data cache unit. The array index is the SRAM user data cache unit number. The array member is the DDR user data backup cache set number that backs up the current SRAM user data cache unit. Indicates the number of SRAM user data cache units, and the calculation formula is: ; Indicates the SRAM user data cache capacity, Indicates the capacity of the user data cache unit, in Byte; Arrays Indicates the status of each SRAM user data cache unit. The array index is the SRAM user data cache unit number, and the array member is the status of the SRAM user data cache unit. Indicates the idle state of the SRAM user data cache unit; Arrays Indicates the status of each DDR user data backup cache unit. The array index is the DDR user data backup cache unit number, and the array member is the status of the DDR user data backup cache unit. Indicates the number of DDR user data backup cache units. Indicates the idle state of the DDR user data backup cache unit; Indicates the currently allocatable SRAM user data cache unit number. Indicates the SRAM user data cache unit number currently waiting to be backed up.
3. The method for backing up SSD user data in internal cache according to claim 1, characterized in that: Step S2 includes: S201, after the host computer sends a write command to the SSD, the SSD checks whether the current SRAM user data cache unit is idle, and if so, proceeds to the next step; S202, calculating the DDR user data backup cache unit number associated with the current SRAM user data cache unit, and checking whether the DDR user data backup cache unit is idle, if so, proceeding to the next step; S203, updating the state of the SRAM user data cache unit and the state of the DDR user data backup cache unit, associating the SRAM user data cache unit with the host computer write command, and starting the DMA operation of the user data associated with the host computer write command to the SRAM user data cache unit.
4. The method for backing up SSD user data in internal cache according to claim 3, characterized in that: The SSD allocates SRAM user data cache units for host computer write commands and performs data transmission including: examine Is the value If yes, proceed to the next step, otherwise suspend allocating SRAM user data cache units; Depend on Get the number The DDR user data backup cache set associated with the SRAM user data cache unit is used Temporarily record the DDR user data backup cache unit number associated with the SRAM user data cache unit, as follows: ; examine Is the value If yes, proceed to the next step, otherwise suspend allocating SRAM user data cache units; Will Updated to ,Will Updated to ; Assign numbers to write commands The SRAM user data cache unit will Set to ; right Execute the plus 1 operation and repeat the above steps of allocating SRAM user data cache units until equal , then Set to 0; Among them, the array Indicates the DDR user data backup cache set number associated with each SRAM user data cache unit. The array index is the SRAM user data cache unit number. The array member is the DDR user data backup cache set number that backs up the current SRAM user data cache unit. Indicates the number of SRAM user data cache units, array Indicates the status of each SRAM user data cache unit. The array index is the SRAM user data cache unit number, and the array member is the status of the SRAM user data cache unit. Indicates the idle state of the SRAM user data cache unit, array Indicates the status of each DDR user data backup cache unit. The array index is the DDR user data backup cache unit number, and the array member is the status of the DDR user data backup cache unit. Indicates the number of DDR user data backup cache units. Indicates the idle state of the DDR user data backup cache unit. Indicates the state of transferring the host computer user data to the SRAM user data cache unit. Indicates the state that the DDR user data backup cache unit is waiting for the SRAM user data cache unit to start the backup operation. Indicates the currently allocatable SRAM user data cache unit number. Indicates the SRAM user data cache unit number obtained by the current host computer write command; Write command to get number After the SRAM user data cache unit is set, the DMA operation is started to transfer the host computer user data to The SRAM user data cache unit.
5. The method for backing up SSD user data in internal cache according to claim 1, characterized in that: Step S3 includes: S301, after the DMA operation of the host computer writing the user data associated with the command to the SRAM user data cache unit is completed, the state of the SRAM user data cache unit associated with the write command is updated; S302, obtaining the number of the SRAM user data cache unit currently waiting for the backup operation, and starting from this number, checking the status of a specified number of SRAM user data cache units; S303: After confirming that the specified number of SRAM user data cache units complete the host computer DMA operation, start the DMA operation of the specified number of SRAM user data cache unit data to the associated DDR user data backup cache unit.
6. The method for backing up SSD user data in internal cache according to claim 5, characterized in that: The specific steps include: S301-1, Updated to ,in Indicates the status of each SRAM user data cache unit. The array index is the SRAM user data cache unit number. Indicates the completion status of the host computer user data transmission; S302-1, Set to , Indicates the SRAM user data cache unit number that needs to be checked before performing the backup operation. Indicates the SRAM user data cache unit number currently waiting to be backed up; S302-2, Inspection Is it , if yes, continue, otherwise exit the operation; S302-3, Yes Execute the plus 1 operation and repeat the above check of the specified number of SRAM user data cache unit states until equal , then Set to 0, Indicates the number of SRAM user data cache units; S302-4. Inspection Is it equal to Or it is equal to 0, if yes, continue, otherwise return to S302-2, Indicates the number of SRAM user data cache units set for each backup operation; S303-1, calculation number is The DDR user data backup cache unit number associated with the SRAM user data cache unit : ; in, Indicates the DDR user data backup cache set number associated with each SRAM user data cache unit, and the array index is the SRAM user data cache unit number; S303-2, start the SSD internal DMA, from the number The SRAM user data cache unit starts with the number The SRAM user data cache unit transfers data from the slave number In the starting DDR user data backup cache unit; S303-3, Set to ; S303-4, Set to , Indicates the state of transferring the SRAM user data cache unit data to the DDR user data backup cache unit; S303-5, Yes Execute the plus 1 operation and repeat the above DMA operation until equal , then Set to 0; S303-6, Inspection Is it equal to or equal to 0, if yes, proceed to the next step, otherwise return to S303-4; S303-7, the starting SRAM user data cache unit number of this backup operation Set to ,Will Set to .
7. The method for backing up SSD user data in internal cache according to claim 1, characterized in that: Step S4 includes: S401, after the DMA operation of the SRAM user data cache unit data to the associated DDR user data backup cache unit is completed, the status of all SRAM user data cache units associated with the backup operation is updated; S402: Perform a flash memory particle write operation on all SRAM user data cache units, and associate all DDR user data backup cache units associated with the SRAM user data cache units with the flash memory particle write operation.
8. The method for backing up SSD user data in internal cache according to claim 7, characterized in that: Before writing the data of the SRAM user data cache unit into the flash memory particle, the following steps are performed: S401-1. Obtain the starting SRAM user data cache unit number associated with this backup operation ,Will Set to , Indicates the SRAM user data cache unit number that needs to be updated after the backup operation is completed. Indicates the starting SRAM user data cache unit number in the backup operation execution S401-2, Updated to , Indicates the status of each SRAM user data cache unit. The array index is the SRAM user data cache unit number. Indicates the status of the data transfer from the SRAM user data cache unit to the DDR user data backup cache unit; S401-3, calculation number is The DDR user data backup cache unit number associated with the SRAM user data cache unit , specifically as follows, ; in, Indicates the DDR user data backup cache set number associated with each SRAM user data cache unit. The array index is the SRAM user data cache unit number. Indicates the number of SRAM user data cache units; S401-4, Updated to , Indicates the status of each DDR user data backup cache unit. The array index is the DDR user data backup cache unit number. Indicates the status of the data transfer from the SRAM user data cache unit to the DDR user data backup cache unit; S401-5, Yes Execute the plus 1 operation and repeat the above steps S401-1 to S401-4. equal , then Set to 0; S401-6. Inspection Is it equal to Or it is equal to 0, if yes, continue, otherwise return to S401-2, Indicates the number of SRAM user data cache units set for each backup operation; S401-7, Set to , Indicates the starting SRAM user data cache unit number of the flash memory particle to be written; S401-8, calculation number is The DDR user data backup cache unit number associated with the SRAM user data cache unit : S401-9, and Associated with the flash memory particle write operation to be executed; S402-1, when the flash memory particle write operation is executed, if the data in the SRAM user data cache unit has been transferred to the flash memory particle data register, obtain the starting SRAM user data cache unit number associated with this operation ; S402-2, Set to , Indicates the SRAM user data cache unit number that needs to be updated after the SRAM user data cache unit data is written into the flash memory particle data register; S402-3, Updated to , Indicates the idle state of the SRAM user data cache unit; S402-4, Yes Execute the plus 1 operation, if equal , then Set to 0, Indicates the number of DDR user data backup cache sets; S402-5, Yes Execute the plus 1 operation and repeat steps S402-3 to S402-4. equal , then Set to 0; S402-6, Inspection Is it equal to Or equal to 0, if yes, exit the operation, otherwise return to S402-3.
9. The method for backing up SSD user data in internal cache according to claim 1, characterized in that: Step S5 includes: S501, after the data of all SRAM user data cache units associated with the flash memory particle write operation are written into the flash memory particle data register, all SRAM user data cache units are released, and the DDR user data backup cache set numbers associated with all SRAM user data cache units are updated; S502: Write the data in the flash memory particle data register into the flash memory particle storage medium, and after writing, release all DDR user data backup cache units associated with the flash memory particle write operation.
10. The method for backing up SSD user data in internal cache according to claim 9, characterized in that: Also includes the steps: S502-1. After writing the data in the data register into the storage medium, obtain the associated starting DDR user data backup cache unit number , Indicates the DDR user data backup cache unit number associated with the starting SRAM user data cache unit number of the flash memory particle to be written; S502-2, Set to , Indicates the DDR user data backup cache unit number that needs to be updated after writing the flash memory particle data register data into the flash memory particle storage medium; S502-3, Updated to , Indicates the status of each DDR user data backup cache unit. The array index is the DDR user data backup cache unit number. Indicates the idle state of the DDR user data backup cache unit; S502-4, Yes Execute the plus 1 operation and repeat step S502-3 until equal , then Set to 0, Indicates the number of DDR user data backup cache units, and the calculation formula is: ; in, Indicates the DDR user data backup cache capacity. Indicates the capacity of the user data cache unit, in Byte; S502-5, Inspection Is it equal to or equal to 0, if yes, then exit the operation, otherwise return to S502-3, Indicates the number of SRAM user data cache units that are set for each backup operation.
Citation Information
Patent Citations
Solid-state disk data write-in method
CN107807790A
Hardware cache management data backup and quick recovery method and system
CN110287062A
Method and device for improving SSD writing performance, computer equipment and storage medium
CN112559385A
Solid state disk and write operation method
CN112947869A
Solid state disk and write operation method
CN113778344A