Data writing control method and storage device

By calculating the actual delay value in real time in the data consolidation program and dynamically adjusting the data writing bandwidth, the problem of insufficient release speed of idle physical units in the non-volatile memory module is solved, and the data writing speed and bandwidth stability are improved.

CN118331509BActive Publication Date: 2024-08-27HEFEI KAIMENG TECHNOLOGY CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410764356.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-14
Publication Date
2024-08-27
Estimated Expiration
2044-06-14

AI Technical Summary

Technical Problem

In the non-volatile memory module, the release speed of idle physical units cannot keep up with the data writing speed of the host system, causing the data writing operation to be forced to stop, and the problem of the number of idle physical units returning to zero cannot be effectively avoided.

Method used

By calculating the actual delay value of the current round in real time during the execution of the data consolidation program, the data writing bandwidth between the host system and the storage device is dynamically adjusted to control the data writing speed of the host system.

Benefits of technology

The data writing speed is improved, idle physical units are prevented from being used up too quickly, and the data writing bandwidth stability between the storage device and the host system is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118331509B
    Figure CN118331509B
Patent Text Reader

Abstract

The present invention provides a data writing control method and a storage device. The method includes: obtaining parameter information and execution information of a data consolidation program, wherein the data consolidation program includes at least one round, the parameter information includes the estimated completion time of the data consolidation program and the estimated number of executions of the round, and the execution information includes the amount of valid data moved and the time consumed in each execution round; according to the parameter information and the execution information, calculating the data moving rate and the recovery time ratio reflecting the current round; according to the data moving rate, the recovery time ratio and the reference delay value, calculating the actual delay value reflecting the current round; and controlling the data writing speed corresponding to the host system according to the actual delay value. Therefore, the data writing speed between the host system and the storage device can be accurately adjusted to reflect the data moving speed of each round.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a memory management technology, and in particular to a data writing control method and a storage device for controlling the writing speed of a host system. Background Art

[0002] Non-volatile memory modules (such as flash memory modules) have advantages such as non-volatile data storage, low power consumption, and fast data access. Generally speaking, a non-volatile memory module is configured with some idle physical units by default to receive and store data from a host system. However, the number of idle physical units will gradually decrease as data is written.

[0003] In order to prevent the number of idle physical units from being reset to zero, a common solution is to release new idle physical units for subsequent use by performing data consolidation operations in the background during data writing. However, this method will cause the problem that if the release speed of idle physical units cannot keep up with the data writing speed of the host system, the data writing action of the host system will be forced to stop.

[0004] Therefore, in order to solve the above problems, a data writing control method is urgently needed. Summary of the invention

[0005] The present invention provides a data writing control method and a storage device, which can calculate the actual delay value of the current execution round in real time during the execution of the integrated program, and dynamically adjust the data writing bandwidth between the host system and the storage device according to the actual delay value, thereby improving the data writing speed.

[0006] An embodiment of the present invention provides a data writing control method for a storage device, wherein the storage device includes a memory module. The data writing control method includes: obtaining parameter information and execution information of a data consolidation program, wherein the data consolidation program includes at least one round, the parameter information includes the estimated completion time of the data consolidation program and the estimated number of executions of the round, and the execution information includes the amount of valid data moved and the time consumed in each execution round; calculating the data moving rate and the recovery time ratio reflecting the current round according to the parameter information and the execution information; calculating the actual delay value reflecting the current round according to the data moving rate, the recovery time ratio and the reference delay value; and controlling the data writing speed corresponding to the host system according to the actual delay value.

[0007] From another perspective, an embodiment of the present invention proposes a storage device, including a connection interface unit, a memory module and a memory controller. The connection interface unit is used to connect to a host system. The memory controller is connected to the connection interface unit and the memory module to perform multiple steps: obtaining parameter information and execution information of a data consolidation program, wherein the data consolidation program includes at least one round, the parameter information includes the expected completion time of the data consolidation program and the expected number of executions of the round, and the execution information includes the amount and time of moving valid data for each execution round; based on the parameter information and the execution information, calculating the data movement rate and recovery time ratio reflecting the current round; based on the data movement rate, the recovery time ratio and the benchmark delay value, calculating the actual delay value reflecting the current round; and controlling the data writing speed corresponding to the host system according to the actual delay value. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] Figure 1 is a schematic diagram of a memory storage device according to an embodiment of the present invention;

[0009] Figure 2 is a schematic diagram of a management memory module according to an embodiment of the present invention;

[0010] Figure 3 is a schematic diagram illustrating a data consolidation procedure according to an embodiment;

[0011] Figure 4 is a flow chart showing a data writing control method according to an embodiment. DETAILED DESCRIPTION

[0012] Reference will now be made in detail to exemplary embodiments of the present invention, examples of which are illustrated in the accompanying drawings. Whenever possible, the same reference numerals are used in the drawings and the description to refer to the same or like parts.

[0013] Figure 1 is a schematic diagram of a memory storage device according to an embodiment of the present invention. Figure 1 The data storage system includes a storage device 10 and a host system 11. The host system 11 can be any type of computer system, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, an industrial computer, a game console, a server or a vehicle-mounted computer, etc., and the type of the host system 11 is not limited thereto.

[0014] The storage device 10 is connected to the host system 11 and is used to store data from the host system 11. For example, the storage device 10 may include a solid state drive, a USB flash drive, a memory card, or other types of non-volatile storage devices. The host system 11 may communicate with the storage device 10 through an embedded Multi-Media Card (embedded Multi-Media Card, eMMC), a universal flash memory (Universal FlashStorage, UFS), a fast peripheral component interconnect (Peripheral Component Interconnect Express, PCIExpress), a fast non-volatile memory (Non-Volatile Memory Express, NVM express), a serial advanced technology attachment (Serial Advanced Technology Attachment, SATA), a universal serial bus (Universal Serial Bus, USB) or other types of connection interface standards. Therefore, the host system 11 can store data to the storage device 10 and / or read data from the storage device 10.

[0015] The storage device 10 includes a connection interface unit 101, a memory module 102, and a memory controller 103. The connection interface unit 101 is used to connect the storage device 10 to the host system 11. For example, the connection interface unit 101 can support connection interface standards such as eMMC, UFS, PCI Express, NVM express, SATA, PCI Express, or USB. The storage device 10 can communicate with the host system 11 (e.g., exchange signals and / or data) via the connection interface unit 101.

[0016] The memory module 102 is used to store data. The memory module 102 may include one or more rewritable non-volatile memory modules. Each rewritable non-volatile memory module may include one or more memory cell arrays. The memory cells in the memory cell array store data in the form of voltage. For example, the memory module 102 may include a single level cell (SLC) NAND flash memory module, a multi level cell (MLC) NAND flash memory module, a triple level cell (TLC) NAND flash memory module, a quad level cell (QLC) NAND flash memory module and / or other memory modules having the same or similar characteristics.

[0017] The memory controller 103 is connected to the connection interface unit 101 and the memory module 102. The memory controller 103 can be regarded as the control core of the memory device 10 and is used to control the memory device 10. For example, the memory controller 103 can be responsible for controlling and / or managing the entire or partial operation of the memory device 10. For example, the memory controller 103 may include a central processing unit (CPU), or other programmable general-purpose or special-purpose microprocessors, digital signal processors (DSP), programmable controllers, application specific integrated circuits (ASIC), programmable logic devices (PLD) or other similar devices or combinations of these devices. In one embodiment, the memory controller 103 includes a flash memory controller.

[0018] In one embodiment, the memory controller 103 may further include a buffer memory, a power management circuit, an encoding circuit, a decoding circuit and / or various other types of circuit modules, which are not limited by the present invention. The buffer memory is used to cache data. The power management circuit is used to manage the power of the storage device 10. The encoding circuit is used to encode the data to be stored in the memory module 102 to generate an error correction code (and / or an error checking code). The decoding circuit is used to decode the data read from the memory module 102 to correct possible errors in the read data. For example, the encoding circuit and / or the decoding circuit may use various encoding / decoding algorithms such as Low Density Parity Check Code (LDPC code), BCH code, Reed-Solomon code (RS code), Exclusive OR (XOR) code, etc. to encode and decode data.

[0019] The memory module 102 may receive a command sequence from the memory controller 103 and access the storage unit according to the command sequence. For example, when data is to be stored, the memory controller 103 may send a write command sequence to the memory module 102 to instruct the memory module 102 to store the data in a specific storage unit. When data is to be read, the memory controller 103 may send a read command sequence to the memory module 102 to instruct the memory module 102 to read data from a specific storage unit. When data is to be deleted, the memory controller 103 may send an erase command sequence to the memory module 102 to instruct the memory module 102 to erase the data stored in the specific storage unit. In addition, the memory controller 103 may also send other types of command sequences to the memory module 102 to instruct the memory module 102 to perform corresponding operations, which is not limited by the present invention.

[0020] Figure 2 FIG. 1 is a schematic diagram of a management memory module according to an embodiment of the present invention. Figure 1 and Figure 2 The memory module 102 includes a plurality of physical units 201 ( 1 ) to 201 (B). Each physical unit includes a plurality of storage cells and is used for non-volatile storage of data.

[0021] In one embodiment, a physical unit may include multiple physical sectors. For example, the data capacity of a physical sector may be 512 bytes (B), and a physical unit may include 8 physical sectors. However, the data capacity of a physical sector and / or the total number of physical sectors included in a physical unit may be adjusted according to practical needs, and the present invention is not limited thereto.

[0022] In one embodiment, a physical unit may be considered as a physical page. For example, the data capacity of a physical page may be 4 kilobytes (4KB), and the present invention is not limited thereto. In one embodiment, a physical unit may be considered as a physical block.

[0023] In one embodiment, a physical page is the minimum unit for synchronously writing data in the memory module 102. For example, when a programming operation is performed on a physical page to write data to the physical page, multiple memory cells in the physical page can be synchronously programmed to store corresponding data. For example, when programming a physical page, a write voltage can be applied to the physical page to change the threshold voltage of at least some of the memory cells in the physical page. The threshold voltage of each memory cell can reflect the bit data stored in the memory cell.

[0024] In one embodiment, the memory module 102 may include a plurality of physical blocks. Each physical block may include a plurality of physical cells. In particular, a plurality of physical cells (e.g., physical pages) in the same physical block may be erased simultaneously. For example, when erasing a physical block, an erase voltage may be applied to a plurality of physical pages in the physical block to change the threshold voltage of at least a portion of the memory cells in these physical pages and clear the bit data stored in each memory cell in these physical pages.

[0025] In one embodiment, the memory controller 103 may logically associate the physical units 201(1)-201(A) with the data area 21 and associate the physical units 201(A+1)-201(B) with the spare area 22. The physical units 201(1)-201(A) in the data area 21 are used to store data (also referred to as user data) from the host system 11. For example, each physical unit in the data area 21 may store valid data and / or invalid data. In addition, the physical units 201(A+1)-201(B) in the spare area 22 do not store data.

[0026] In one embodiment, if a physical unit does not store valid data, the physical unit can be associated with the idle area 22. In one embodiment, the idle area 22 is also called a free pool. In addition, the physical unit associated with the idle area 22 can be erased to clear the data in the physical unit.

[0027] In one embodiment, when data (i.e., user data) from the host system 11 needs to be stored, the memory controller 103 may select one or more physical units from the idle area 22 and instruct the memory module 102 to store the data from the host system 11 into the selected physical units. At the same time, the selected physical units may be associated with the data area 21.

[0028] In one embodiment, the memory controller 103 may configure a plurality of logical units 230(1)-230(C) to map the physical units 201(1)-201(A) in the data area 21. For example, a logical unit may correspond to a logical block address (LBA) or other logical management units. A logical unit may be mapped to one or more physical units in the data area 21.

[0029] In one embodiment, if a physical unit is currently mapped by any logical unit, the memory controller 103 may determine that the data currently stored in the physical unit includes valid data. Conversely, if a physical unit is not currently mapped by any logical unit, the memory controller 103 may determine that the physical unit does not currently store any valid data (and / or the data in the physical unit are all invalid data).

[0030] In one embodiment, the memory controller 103 may record the mapping relationship between the logical unit and the physical unit in a logical-to-physical mapping table. When receiving an access instruction (such as a read instruction, a write instruction, a delete instruction, or other types of instructions) from the host system 11, the memory controller 103 may instruct the memory module 102 to perform a corresponding operation behavior according to the information in the logical-to-physical mapping table.

[0031] The memory controller 103 may execute a data consolidation procedure as needed, which is also called a garbage collection procedure. For example, the memory controller 103 may determine the number of physical units in the idle area 22. If the number is too small, such as less than a threshold, the data consolidation procedure may be executed, but the present disclosure does not limit when the data consolidation procedure is to be executed. When executing the data consolidation procedure, the memory controller 103 may select at least one physical unit from the data area 21 as a source physical unit and select at least one physical unit from the idle area 22 as a target physical unit. The memory controller 103 may centrally copy the valid data stored in the source physical unit to the target physical unit.

[0032] The data consolidation process may include one or more rounds, each of which selects a source physical unit and moves the valid data stored in the source physical unit to the target physical unit in each round. After a round is completed, if the target physical unit is not full, that is, there is still free space, the next round will be carried out, and another source physical unit will be selected and the valid data movement operation will be repeated.

[0033] For details, please refer to Figure 3 , Figure 3 FIG. 1 is a schematic diagram showing a data consolidation procedure according to an embodiment. Figure 3As shown, in this example, there are 4 rounds. The first round selects entity unit 201(1) as the source entity unit, the second round selects entity unit 201(2) as the source entity unit, the third round selects entity unit 201(3) as the source entity unit, and the fourth round selects entity unit 201(4) as the source entity unit. These source entity units 201(1) to 201(4) are different from each other. These four rounds all use entity unit 201(A+1) as the target entity unit. Valid data 301 is stored in entity unit 201(1). In the first round, valid data 301 will be moved to target entity unit 201(A+1). In this example, after the first round ends, there is still idle space in target entity unit 201(A+1) because a second round will be performed to move valid data 302 stored in source entity unit 201(2) to target entity unit 201(A+1). Similarly, in the third round and the fourth round, the valid data 303 and 304 will be moved to the target physical unit 201 (A+1) respectively.

[0034] After the valid data stored in the source physical unit is copied to the target physical unit 201(A+1), all the data in the source physical unit will be marked as invalid and the source physical unit can be divided into the idle area 22. In addition, the physical unit divided into the idle area 22 can be erased to clear the data stored in the physical unit.

[0035] In one embodiment, the operation of re-dividing a physical unit from the data area 21 to the idle area 22 is also called releasing a physical unit. That is, during the start of the data consolidation process, one or more physical units may be gradually released and the total number of physical units belonging to the idle area 22 may gradually increase. For example, after the first round, the source physical unit 201(1) may be released, after the second round, the source physical unit 201(2) may be released, and so on.

[0036] In one embodiment, after the data consolidation process is started, the data consolidation process may be executed in the background. Meanwhile, the host system 11 may continue to store data to the storage device 10 in the foreground.

[0037] In one embodiment, in response to the data consolidation procedure being initiated, the memory controller 103 may actively reduce the data write bandwidth between the storage device 10 and the host system 11 . The data write bandwidth may reflect the data write speed between the storage device 10 and the host system 11 .

[0038] In this way, by actively reducing the data writing speed of the host system 11, the already few physical units in the idle area 22 can be prevented from being further exhausted, thereby improving the stability of the data writing bandwidth (or data writing speed) between the storage device 10 and the host system 11.

[0039] In one embodiment, the data writing bandwidth may be adjusted by adjusting the number, frequency, or time interval of writing commands extracted from the host system 11 .

[0040] For example, the memory controller 103 may reduce the total number of at least one write instruction extracted from the host system 11 through a direct memory access (DMA) operation. In a state where the data consolidation procedure is not started, the memory controller 103 may extract k write instructions (k is any integer greater than 1) from the memory of the host system 11 through a DMA operation within 10 seconds. However, in a state where the data consolidation procedure is started, the memory controller 103 may extract p write instructions (p is a positive integer) from the memory of the host system 11 through a DMA operation within 10 seconds, and p is less than k.

[0041] In one embodiment, in response to the data consolidation process being initiated, the memory controller 103 may set an actual delay value.

[0042] For example, the memory controller 103 may set the actual delay value to a value greater than zero. During the execution of the data consolidation procedure, the memory controller 103 may extract a write instruction (also referred to as a first write instruction) from the host system 11 through a DMA operation. Then, the memory controller 103 may start calculating a waiting time and determine whether the waiting time reaches the actual delay value. When the waiting time reaches the actual delay value, the memory controller 103 may extract the next write instruction (also referred to as a second write instruction) from the host system 11 through a DMA operation.

[0043] In this way, through the method proposed in this embodiment, the characteristic attribute of the waiting time between two consecutive write instructions can be determined based on the actual delay value, and the data writing speed between the host system 11 can be adjusted by adjusting the actual delay value, thereby achieving control of the data writing speed and improving the efficiency of data writing.

[0044] In this embodiment, the data transfer speed of the data consolidation process is considered at the round level, and the data writing speed corresponding to the host system 11 is adjusted according to the data transfer speed.

[0045] Specifically, please refer to Figure 4 , Figure 4 FIG. 1 is a flow chart showing a data writing control method according to an embodiment. Figure 4 As shown, the data writing method in the embodiment of the present application includes the following steps:

[0046] Step 401, obtaining parameter information and execution information of the data consolidation program.

[0047] Here, the parameter information includes information obtained by previously executing the data consolidation program or information set by the system. For example, the parameter information includes the estimated completion time of the data consolidation program. The estimated completion time can be obtained by analyzing the data consolidation program through statistical methods after collecting multiple data consolidation programs, or it can also be a system default value, and the present invention is not limited thereto.

[0048] In addition, the parameter information may also include the estimated number of executions of the above rounds, for example, the system defaults to 5 times, or in one embodiment, the number of rounds previously executed during the data consolidation process may be counted, and the estimated number of executions may be obtained through statistical methods. The above statistical methods may be the maximum value, average value, median, etc., and the present invention is not limited thereto.

[0049] On the other hand, the execution information may include relevant information of multiple rounds of the currently executed data consolidation procedure, such as the amount of valid data moved in each round and the time consumed.

[0050] Step 402: Calculate the data migration rate and recovery time ratio of the current round among all rounds according to the parameter information and the execution information.

[0051] Exemplarily, the data transfer rate of the current round is calculated based on the transfer amount of valid data of the current round. Since the transfer amount is an absolute value, the data transfer rate can be calculated in combination with other parameters. For example, the transfer amount of valid data of the current round is divided by a transfer amount calculated according to the previous execution of the data consolidation program to obtain a relative ratio. Such a ratio can reflect whether the current transfer amount is relatively large or small.

[0052] Step 403, calculating the actual delay value reflecting the current round according to the data transfer rate, the recovery time ratio and the reference delay value.

[0053] For example, a value (also called a first value) can be calculated based on the data transfer rate and the recovery time ratio to reflect the transfer speed of the current round. When the transfer speed is higher, it means that the new idle physical unit can be released more quickly, and a smaller actual delay value can be set in this state. On the contrary, when the transfer speed is lower, it means that the release speed of the new idle physical unit is slower, and a larger actual delay value can be set in this state.

[0054] Step 404 , controlling the data writing speed corresponding to the host system 11 according to the actual delay value.

[0055] Exemplarily, when the actual delay value is larger, the waiting time between two write instructions is longer, and the data writing speed of the host system 11 is slower. On the contrary, when the actual delay value is smaller, the waiting time between two write instructions is shorter, and the data writing speed of the host system 11 is faster. The actual delay value and the data writing speed have been described in the above paragraphs and will not be repeated here.

[0056] In some cases, there is less valid data in the source physical unit, that is, the mapping of valid data is very random, which makes it impossible for the valid data in a source physical unit to fully write a target physical unit, resulting in multiple rounds. According to the existing practice, if multiple rounds are not considered, a slower data transfer speed may be calculated, which makes the actual delay value larger, the data writing speed will become lower, and even write timeouts and other problems may occur.

[0057] In this way, through the method proposed in this embodiment, an accurate actual delay value can be dynamically calculated for each round during the execution of the consolidation program; further, the data write bandwidth between the host system and the storage device is adjusted according to the calculated actual delay value, thereby achieving the purpose of accelerating the speed at which the host system writes data during data consolidation.

[0058] In one embodiment, the maximum data transfer amount in all rounds may be determined first, and then the data transfer rate may be calculated according to the maximum data transfer amount and the amount of valid data transferred in the current round.

[0059] Exemplarily, the maximum data migration amount is determined based on the execution information of the data consolidation program, and the maximum value of the amount of valid data migrated in each round is taken as the maximum data migration amount according to the execution information.

[0060] Furthermore, the amount of data moved in the current round is compared with the maximum amount of data moved to obtain a ratio, ie, the data moving rate.

[0061] In one embodiment, the data transfer rate may be obtained by dividing the amount of valid data that has been transferred in the current round by the maximum data transfer amount. The calculation is as shown in the following mathematical formula 1.

[0062] [Mathematical formula 1]

[0063] Data migration rate = (the amount of valid data moved in the current round × 100) / maximum data migration amount

[0064] Here we use specific numbers as an example, please refer to Figure 3 and Figure 4, assuming that the fourth round is currently underway, in the first three rounds, 40 units (for example, bytes) of valid data are moved in each round, and each round takes 20 ms. In the fourth round, 20 units of valid data have been moved, which takes 10 ms. In this example, the amount of valid data that has been moved in the current round is 20, and the amount of valid data moved in these four rounds is 40, 40, 40, and 20 respectively. The maximum value of these four numbers is 40, which is the maximum amount of data moved. Substituting the relevant numbers into mathematical formula 1, we can get a data transfer rate of 20x100 / 40=50. In this embodiment, the right side of the equal sign of mathematical formula 1 is multiplied by 100 to calculate the percentage. In other embodiments, this value "100" can also be replaced by other values ​​that are not equal to 0.

[0065] In other embodiments, the amount of valid data that has been moved in the current round may be divided by the average amount of data moved in all rounds to obtain the data moving rate. Alternatively, the amount of valid data that has been moved in the current round may be substituted into a function to obtain the data moving rate, and the function may be a polynomial function, an exponential function, etc. In one embodiment, the amount of valid data that has been moved in the current round may also be combined with other variables to calculate the data moving rate, and the present invention is not limited to the above embodiments.

[0066] On the other hand, the recovery time ratio is also calculated in step 402, and this recovery time ratio reflects the time consumed by the current round. Since the time consumed by the current round is an absolute value, a ratio can be calculated by referring to other values. For example, the time consumed by each round when the data consolidation program was previously executed can be counted, and then a reference value can be obtained according to the statistical method. The time consumed by the current round can be compared with this reference value to obtain a more appropriate ratio. The above-mentioned statistical method can take the maximum value, minimum value, average value, etc., and the present invention is not limited thereto.

[0067] Thus, the method proposed in this embodiment, compared with the common method of calculating the data movement rate based on the expected amount of data to be moved as a benchmark value, the present application chooses to use the maximum amount of data moved in the execution round as a benchmark value to calculate the data movement rate, and refers to the actual execution progress. In this way, a data movement rate that more accurately reflects the data movement rate when the current round of execution of the data consolidation program is obtained, thereby improving the calculation accuracy of the actual delay value and using it more accurately in the control of the write speed.

[0068] In one embodiment, a unit time consumption can be calculated based on the above-mentioned estimated completion time and the estimated number of executions. This unit time consumption refers to the estimated time consumed to execute a round. For example, the unit time consumption can be obtained by dividing the estimated completion time by the estimated number of executions. Next, the recovery time ratio can be calculated based on the time consumption of the current round to move valid data and this unit time consumption. If the time consumption of the current round is large and the unit time consumption is small, this means that the current round consumes more time than before, so a larger recovery time ratio can be set. On the contrary, if the time consumption of the current round is small and the unit time consumption is large, this means that the current round consumes less time than before, so a smaller recovery time ratio can be set. For example, the time consumption of the current round to move valid data can be divided by the unit time consumption to obtain the recovery time ratio, as shown in the following mathematical formula 2.

[0069] [Mathematical formula 2]

[0070] Recovery time ratio = (current round time × 100) / unit time

[0071] In this example, the estimated completion time is 100 ms, and the estimated number of executions is 5, so the unit time is 100 / 5=20. Continuing the above example, the fourth round is currently in progress, and it takes 10 ms. Substituting these numbers into mathematical formula 2, the recovery time ratio can be calculated as 10x100 / 20=50. Similarly, in this embodiment, the right side of the equal sign in mathematical formula 2 is multiplied by 100 to calculate the percentage. In other embodiments, this value "100" can also be replaced by other values ​​that are not equal to 0.

[0072] In other embodiments, the time consumption of the current round may also be substituted into a function or combined with other variables to calculate the data migration time. The present invention is not limited to the above embodiments.

[0073] Thus, through the method proposed in this embodiment, the release speed of the idle physical units is determined by calculating the moving speed of the current round, and further, the actual delay value adapted thereto is set according to the release speed, thereby achieving the purpose of dynamically controlling the data writing speed.

[0074] In one embodiment, the actual delay value can be calculated based on the first value and the reference delay value. The first value can be used as an adjustment parameter. The reference delay value can be enlarged or reduced based on the first value to calculate the actual delay value, wherein the first value is proportional to the actual delay value.

[0075] In one embodiment, the baseline delay value is calculated based on the estimated completion time of the data consolidation program and the idle storage capacity of the target physical unit. When the estimated completion time is larger, it means that more time is required to execute the data consolidation program each time, so a larger baseline delay value needs to be set. Otherwise, a smaller baseline delay value can be set.

[0076] In addition, when the idle storage capacity of the target physical unit is larger, it means that more source physical units need to be selected to fill the target physical unit. These source physical units have the opportunity to be released. At this time, the data writing speed of the host system 11 can be increased, and a smaller baseline delay value can be set, otherwise a larger baseline delay value can be set.

[0077] In one embodiment, the estimated completion time of the data consolidation process may be divided by the idle storage capacity of the target physical unit to obtain a reference delay value.

[0078] Continuing with the above example, the estimated completion time is 100 ms. Figure 3 Here, it is assumed that the idle storage capacity 310 (i.e., the total amount of space that has not been written with valid data) of the target physical unit 201 (A+1) is 500 units (e.g., bytes). Therefore, in such an example, the reference delay value is 100 / 500=0.2, as shown in the following mathematical formula 3.

[0079] [Mathematical formula 3]

[0080] Baseline delay value = estimated completion time / idle storage capacity of target entity unit

[0081] As described above, the first value can be used as an adjustment parameter, and the reference delay value can be enlarged or reduced according to the first value to calculate the actual delay value.

[0082] In one embodiment, the recovery time ratio may be divided by the data transfer rate to obtain the first value mentioned above (this value is inversely proportional to the transfer rate of the current round), and then the actual delay value may be obtained by multiplying the reference delay value by the first value.

[0083] This is shown in the following mathematical formula 4. Substituting the numbers in the above example into mathematical formula 4, the delay value can be obtained as 0.2x50 / 50=0.2.

[0084] [Formula 4]

[0085] Actual delay value = benchmark delay value × recovery time ratio / data transfer rate

[0086] In this way, through the method proposed in this embodiment, the data movement rate, recovery time ratio and benchmark delay value are simultaneously used as influencing factors to calculate the actual delay value that can better reflect the current round of execution of the data consolidation program, and then based on the actual delay value, the speed of data writing in the next round of execution can be dynamically adjusted, which has higher flexibility and accuracy in data writing control.

[0087] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A data writing control method, characterized in that: Used in a storage device, the storage device includes a memory module, and the data writing control method includes: Acquire parameter information and execution information of a data consolidation program, wherein the data consolidation program includes at least one round, the parameter information includes an estimated completion time of the data consolidation program and an estimated number of executions of the round, and the execution information includes the amount of valid data moved and the time consumed in each execution of the round; Calculating, according to the parameter information and the execution information, a data migration rate and a recovery time ratio reflecting a current round in the rounds; Calculating an actual delay value reflecting the current round according to the data transfer rate, the recovery time ratio and the reference delay value; and The data writing speed corresponding to the host system is controlled according to the actual delay value.

2. The data writing control method according to claim 1, characterized in that: The step of calculating the data migration rate and the recycling time ratio reflecting the current round in the round according to the parameter information and the execution information comprises: Determining the maximum amount of data to be moved in the round; and The data migration rate is calculated according to the maximum data migration amount and the amount of the valid data migrated in the current round.

3. The data writing control method according to claim 2, characterized in that: The step of calculating the data migration rate according to the maximum data migration amount and the amount of the valid data migrated in the current round includes: The data migration rate is obtained by dividing the amount of the valid data that has been migrated in the current round by the maximum data migration amount.

4. The data writing control method according to claim 1, characterized in that: The step of calculating the data migration rate and the recycling time ratio reflecting the current round in the round according to the parameter information and the execution information includes: Calculate the unit time consumption according to the estimated completion time and the estimated number of executions; and The recovery time ratio is calculated according to the time consumed in the current round to move the valid data and the unit time consumed.

5. The data writing control method according to claim 4, characterized in that: The step of calculating the unit time consumption according to the estimated completion time and the estimated number of executions includes: Divide the estimated completion time by the estimated number of executions to obtain the unit time consumption. The step of calculating the recovery time ratio according to the time consumed to move the valid data in the current round and the unit time consumed comprises: The time consumption of moving the valid data in the current round is divided by the unit time consumption to obtain the recycling time ratio.

6. The data writing control method according to claim 1, characterized in that: The step of calculating the actual delay value reflecting the current round according to the data transfer rate, the recovery time ratio and the reference delay value comprises: Calculating a first value reflecting the migration speed of the current round according to the data migration rate and the recovery time ratio; and The actual delay value is calculated according to the first value and the reference delay value.

7. The data writing control method according to claim 6, characterized in that: The step of calculating the first value reflecting the migration speed of the current round according to the data migration rate and the recovery time ratio includes: Dividing the recovery time ratio by the data migration rate to obtain the first value, The step of calculating the actual delay value according to the first value and the reference delay value comprises: The reference delay value is multiplied by the first value to obtain the actual delay value.

8. The data writing control method according to claim 1, characterized in that: The step of controlling the data writing speed corresponding to the host system according to the actual delay value comprises: After extracting the first write instruction from the host system, determining whether the waiting time reaches the actual delay value; and If the waiting time reaches the delay value, a second write command is fetched from the host system.

9. A storage device, characterized in that: include: A connection interface unit for connecting to a host system; Memory module; as well as a memory controller connected to the connection interface unit and the memory module, The memory controller is configured to perform a plurality of steps: Acquire parameter information and execution information of a data consolidation program, wherein the data consolidation program includes at least one round, the parameter information includes an estimated completion time of the data consolidation program and an estimated number of executions of the round, and the execution information includes the amount of valid data moved and the time consumed in each execution of the round; Calculating, according to the parameter information and the execution information, a data migration rate and a recovery time ratio reflecting a current round in the rounds; Calculating an actual delay value reflecting the current round according to the data transfer rate, the recovery time ratio and the reference delay value; and The data writing speed corresponding to the host system is controlled according to the actual delay value.

10. The storage device according to claim 9, characterized in that: The step of calculating the data migration rate and the recycling time ratio reflecting the current round in the round according to the parameter information and the execution information comprises: Determining the maximum amount of data to be moved in the round; and The data migration rate is calculated according to the maximum data migration amount and the amount of the valid data migrated in the current round.

11. The storage device according to claim 10, characterized in that: The step of calculating the data migration rate according to the maximum data migration amount and the amount of the valid data migrated in the current round includes: The data migration rate is obtained by dividing the amount of the valid data that has been migrated in the current round by the maximum data migration amount.

12. The storage device according to claim 9, characterized in that: The step of calculating the data migration rate and the recycling time ratio reflecting the current round in the round according to the parameter information and the execution information includes: Calculate the unit time consumption according to the estimated completion time and the estimated number of executions; and The recovery time ratio is calculated according to the time consumed in the current round to move the valid data and the unit time consumed.

13. The storage device according to claim 12, characterized in that: The step of calculating the unit time consumption according to the estimated completion time and the estimated number of executions includes: Divide the estimated completion time by the estimated number of executions to obtain the unit time consumption. The step of calculating the recovery time ratio according to the time consumed to move the valid data in the current round and the unit time consumed comprises: The time consumption of moving the valid data in the current round is divided by the unit time consumption to obtain the recycling time ratio.

14. The storage device according to claim 9, characterized in that: The step of calculating the actual delay value reflecting the current round according to the data transfer rate, the recovery time ratio and the reference delay value comprises: Calculating a first value reflecting the migration speed of the current round according to the data migration rate and the recovery time ratio; and The actual delay value is calculated according to the first value and the reference delay value.

15. The storage device according to claim 14, characterized in that: The step of calculating the first value reflecting the migration speed of the current round according to the data migration rate and the recovery time ratio includes: Dividing the recovery time ratio by the data migration rate to obtain the first value, The step of calculating the actual delay value according to the first value and the reference delay value comprises: The reference delay value is multiplied by the first value to obtain the actual delay value.

16. The storage device according to claim 9, characterized in that: The step of controlling the data writing speed corresponding to the host system according to the actual delay value comprises: After extracting the first write instruction from the host system, determining whether the waiting time reaches the actual delay value; and If the waiting time reaches the delay value, a second write command is fetched from the host system.

Citation Information

Patent Citations

  • A method for reducing the influence of NVMe SSD response delay on the write-in speed of high-speed data storage equipment

    CN109814811A

  • Method for judging self-given delay repeatability of streaming data in real time

    CN112035521A

  • Memory testing method and device

    CN114880181A

  • Cache space allocation method and memory storage device

    CN118092807A

  • Random access in a communications network

    US20150173074A1