WO2023035113A1 - Control method and apparatus for storage apparatus - Google Patents

Control method and apparatus for storage apparatus Download PDF

Info

Publication number
WO2023035113A1
WO2023035113A1 PCT/CN2021/116983 CN2021116983W WO2023035113A1 WO 2023035113 A1 WO2023035113 A1 WO 2023035113A1 CN 2021116983 W CN2021116983 W CN 2021116983W WO 2023035113 A1 WO2023035113 A1 WO 2023035113A1
Authority
WO
WIPO (PCT)
Prior art keywords
burst traffic
time period
storage space
traffic
data processing
Prior art date
Application number
PCT/CN2021/116983
Other languages
French (fr)
Chinese (zh)
Inventor
底晔佳
王金伟
黄恩走
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN202180100197.4A priority Critical patent/CN117769699A/en
Priority to PCT/CN2021/116983 priority patent/WO2023035113A1/en
Publication of WO2023035113A1 publication Critical patent/WO2023035113A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation

Definitions

  • the present application relates to the field of storage technology, and in particular, to a method and device for controlling a storage device.
  • Solid state disk (SSD) is now widely used in various storage scenarios, such as servers, data centers, embedded devices, and so on.
  • SSD is equipped with garbage collection GC (garbage collection, GC) algorithm.
  • GC garbage collection, GC
  • the GC algorithm is used to perform garbage collection on the storage space of stored data when the available space (that is, empty space) in the SSD storage space is less than a threshold (called GC waterline), thereby releasing some storage space.
  • the SSD After a user request (IO) is sent to the SSD, the SSD needs a certain amount of time to respond to the IO. When the response time exceeds the user tolerance threshold (such as 1s), the user experience will be affected.
  • the response time of the IO is the total time from when the IO is issued to when the IO is processed, and the response time includes not only the time for flash memory processing, but also the time for waiting for the IO to be processed.
  • the number of IOs processed by the SSD per second (IOPS) is called the disk capacity. Generally, due to the resources occupied by GC, the disk capacity of SSD will be less than its maximum capacity.
  • the resources used by GC vary with the resources used by IO responses. When more resources are used by IO responses, more resources are allocated to GC. When fewer resources are used by IO responses, There are also fewer resources allocated for GC use. Among them, when the amount of IO access is small, the resources and storage space required by SSD to respond to IO, and the storage space occupied by the resulting garbage are all small, and the storage space occupied by IO response can be maintained by using less resources for GC The relative stability of storage space released by GC. Therefore, when the IO access volume is less than the capacity of the disk (called regular traffic), the SSD can complete the IO on time and at the same time perform GC normally to maintain a stable available storage space.
  • regular traffic the capacity of the disk
  • the GC may not be able to reclaim enough storage space in a short period of time, which will break the relative stability between the storage space occupied by the IO response and the storage space released by the GC, and may even cause the storage space to be consumed by the IO response process, affecting Stability of the storage system.
  • GC also needs to use more resources to speed up the release of storage space, so as to release as much storage space as possible for IO response, which will lead to resource contention between GC and IO response process, affecting the IO response speed, which may lead to IO response timeout problems.
  • the present application provides a storage device control method and device, which are used to improve the stability and IO response speed of the storage device by controlling resource allocation and execution of garbage collection GC operations in the storage device.
  • the present application provides a method for controlling a storage device, the storage device includes a controller and a storage array, the method is applied to the controller, and the method includes: when it is predicted that the memory During burst traffic, before the first time period, increase the bandwidth resources allocated to garbage collection GC operations; wherein, the burst traffic includes a first number of data processing requests, and the first number is greater than the The number of data processing requests that the storage device can respond to per second; use the first bandwidth resource to execute the GC operation to obtain the first available storage space in the storage array, wherein the first bandwidth resource is allocated to the Bandwidth resources for GC operations.
  • this method when the controller of the storage device predicts the burst traffic, by increasing the bandwidth resources allocated to the GC operation before the burst traffic arrives, the execution speed of the GC operation can be accelerated, so that the GC operation can be performed in a short time Fast reclamation within the system will result in more available storage space. Therefore, this method can be used to prepare storage space in advance for responding to burst traffic when burst traffic is predicted. In this way, when the burst traffic comes, it can ensure that there is more storage space in the storage device to respond to the burst traffic, thereby ensuring a high response speed while avoiding excessive consumption of available storage space and improving the stability of the storage device .
  • the method further includes: when it is determined that the burst traffic exists, allocating the first available storage space to an IO operation corresponding to the burst traffic.
  • the first available storage space obtained through advance processing of the GC operation is allocated to the IO operation corresponding to the burst traffic, which can ensure more storage space for the IO operation.
  • the execution speed of the IO operation can be improved; on the other hand, the excessive consumption of the available storage space can be avoided, and the stability of the storage device can be improved.
  • the method when it is predicted that there is a burst traffic within the first time period, the method further includes: increasing the start threshold of the GC operation; wherein, when the available storage in the storage array When the space is smaller than the start threshold, start the GC operation.
  • the controller can obtain a larger available storage space by executing the GC operation, and it can also ensure that the controller obtains a large storage space by executing the GC operation. After a larger available storage space, the available storage space can be maintained by performing GC operations.
  • the method when it is predicted that there is a burst traffic within the first time period, the method further includes: based on the storage space required for the IO operation corresponding to the burst traffic and the first bandwidth Resources determine a first target time; when the first target time arrives, increase the startup threshold of the GC operation; wherein, when the available storage space in the storage array is less than the startup threshold, start the GC operate.
  • the time required for the GC operation to process and obtain the storage space can be determined. Further, this time can be used as a reference to further Accurately determining the time to increase the start threshold of the GC operation can avoid raising the start threshold of the GC operation too early or too late, thereby reducing unnecessary GC operations and reducing the impact on the life of the storage device, and can be obtained through the GC operation. Large enough available storage space for burst traffic.
  • the method further includes: when it is determined that the burst traffic exists, lowering the start threshold of the GC operation; or, if the predicted burst traffic does not exist at the second target moment When the GC operation arrives, lower the start threshold of the GC operation; wherein, the second target time is any time within the first time period.
  • the GC operation when it is determined that the burst traffic exists, the GC operation can be stopped by lowering the start threshold of the GC operation, so that more bandwidth resources can be released for use by the IO operation, and the IO operation can be timely and quickly Respond to burst traffic, thereby reducing or avoiding the problem of IO response timeout.
  • the start threshold of the GC operation when it is determined that the predicted burst traffic does not come, can reduce the impact on the life of the storage device.
  • the method further includes: before it is determined that the burst traffic exists, when the first available storage space reaches a target value, allocating the second bandwidth resource to the storage space corresponding to the current data processing request IO operation, and assigning a third bandwidth resource to the GC operation; wherein, the target value is greater than or equal to the storage space required for the IO operation corresponding to the burst traffic; the size of the second bandwidth resource is the same as the The size of the available storage space in the storage array has a positive correlation, and the size of the third bandwidth resource has a negative correlation with the size of the available storage space in the storage array.
  • the available storage space in the storage array reaches the target value, it indicates that the first available storage space obtained through the GC operation is sufficient for the IO operation corresponding to the burst traffic. If it is not confirmed that there is a burst traffic at this time, by allocating bandwidth resources that have a positive correlation with the available storage space for IO operations, and allocating bandwidth resources that have a negative correlation with the available storage space for GC operations, you can allocate bandwidth resources in the available storage space When it is too large, it will speed up the consumption of storage space and slow down the recovery of available storage space. When the available storage space is too small, it will slow down the consumption of storage space and speed up the recovery of storage space, so that the size of available storage space remains relatively Stable to wait for the arrival of burst traffic.
  • the second bandwidth resource complies with the following formula:
  • BW 1 BW 2 ⁇ S 1 /S th
  • the BW 1 is the second bandwidth resource
  • the BW 2 is the total bandwidth resource that the controller can use
  • the S 1 is the available storage space in the storage array
  • the S th is The start threshold for the GC operation.
  • the target value is the sum of the first parameter and the second parameter
  • the first parameter is the storage space required for the IO operation corresponding to the burst traffic
  • the second parameter is The available storage space in the storage array when it is predicted that there is a burst traffic within the first time period.
  • the value setting of the target value can ensure that after the storage space required for the IO operation corresponding to the burst traffic is provided to the burst traffic, a certain margin of available storage space can still be maintained, so it can avoid Burst traffic will consume the available storage space, improving the stability of the storage system.
  • the storage space required for the IO operation corresponding to the burst traffic conforms to the following formula:
  • the S 2 is the storage space required for the IO operation corresponding to the burst traffic
  • the BW 3 is the bandwidth resource required for transmitting the burst traffic
  • the T is the duration of the burst traffic duration.
  • the storage space required for the IO operation corresponding to the burst traffic can be accurately calculated, and then the storage device is controlled accordingly according to the storage space .
  • determining that the burst traffic exists includes: after the end of the second time period, determining that the burst traffic exists according to a data processing request within the second time period; wherein, the The duration of the second time period is less than the set threshold, and the end time of the second time period is before the end time of the first time period.
  • determining that there is the burst traffic according to the data processing requests in the second time period includes at least one of the following: determining the total number of data processing requests in the second time period greater than the set threshold; determine that the total bandwidth of the data processing requests within the second time period is greater than the set bandwidth threshold; determine that the increment of the number of data processing requests within the second time period is greater than the set Increment threshold: determining that the growth rate of the number of data processing requests within the second time period is greater than a set growth rate threshold.
  • the burst traffic is characterized by a large number of data processing requests, and the number of data processing requests increases rapidly in a short period of time. Therefore, based on the multi-faceted information that can reflect the characteristics of the burst traffic, analyzing the data processing requests in the second time period can identify the burst traffic more accurately, so that the burst traffic can be more accurately identified. control.
  • predicting that there is a burst traffic in the first time period includes: using the set traffic forecasting model, according to the data processing request in the target historical time period, predicting that the burst traffic in the first time period There is a burst traffic in the segment; wherein, the traffic prediction model is obtained through machine learning and/or model training; or, according to the burst traffic prediction information from the upper layer application, it is predicted that there is a burst traffic in the first time period Burst traffic; wherein, the burst traffic prediction information is used to indicate: it is predicted that there is burst traffic within the first time period.
  • using the set traffic prediction model to predict the burst traffic can improve the accuracy of burst traffic prediction, and at the same time, it can adapt to the prediction of burst traffic in many different scenarios, and has good versatility.
  • the controller determines that the burst traffic is predicted according to the instruction from the upper-layer application, the prediction process of the burst traffic can be transferred to the upper-layer application, thereby simplifying the processing flow of the controller and increasing the processing rate.
  • the storage device is a solid state disk.
  • the present application provides a control device for a storage device, the control device is applied to a controller in the storage device, wherein the storage device further includes a storage array; the control device includes: a prediction module, It is used to predict that there is a burst traffic within the first time period; the processing module is used to increase the bandwidth resource allocated to the GC operation before the first time period, and use the first bandwidth resource to perform the GC operation, obtaining a first available storage space in the storage array; wherein, the burst flow includes a first number of data processing requests, and the first number is greater than the number of data processing requests that the storage device can respond to per second ; The first bandwidth resource is a bandwidth resource allocated to the GC operation.
  • the processing module is further configured to: when it is determined that the burst traffic exists, allocate the first available storage space to an input/output IO operation corresponding to the burst traffic.
  • the processing module when the prediction module predicts that there is a burst traffic within the first time period, is further configured to: increase the startup threshold of the GC operation; wherein, when the When the available storage space in the storage array is less than the startup threshold, the GC operation is started.
  • the processing module when the prediction module predicts that there is a burst traffic within the first time period, is further configured to: based on the storage space required for the IO operation corresponding to the burst traffic Determine a first target time with the first bandwidth resource; when the first target time arrives, increase the start threshold of the GC operation; wherein, when the available storage space in the storage array is less than the start threshold , start the GC operation.
  • the processing module is further configured to: when it is determined that the burst traffic exists, lower the start threshold of the GC operation; or, if the predicted burst traffic is within the second target If the time has not arrived, lower the start threshold of the GC operation; wherein, the second target time is any time within the first time period.
  • the processing module is further configured to: allocate a second bandwidth resource to the current data processing request when the first available storage space reaches a target value before determining that the burst traffic exists The corresponding IO operation, and assigning the third bandwidth resource to the GC operation; wherein, the target value is greater than or equal to the storage space required for the IO operation corresponding to the burst traffic; the size of the second bandwidth resource There is a positive correlation with the size of the available storage space in the storage array, and the size of the third bandwidth resource has a negative correlation with the size of the available storage space in the storage array.
  • the second bandwidth resource complies with the following formula:
  • BW 1 BW 2 ⁇ S 1 /S th
  • the BW 1 is the second bandwidth resource
  • the BW 2 is the total bandwidth resource that the controller can use
  • the S 1 is the available storage space in the storage array
  • the S th is The start threshold for the GC operation.
  • the target value is the sum of the first parameter and the second parameter
  • the first parameter is the storage space required for the IO operation corresponding to the burst traffic
  • the second parameter is The available storage space in the storage array when it is predicted that there is a burst traffic within the first time period.
  • the storage space required for the IO operation corresponding to the burst traffic conforms to the following formula:
  • the S 2 is the storage space required for the IO operation corresponding to the burst traffic
  • the BW 3 is the bandwidth resource required for transmitting the burst traffic
  • the T is the duration of the burst traffic duration.
  • the processing module determines that the burst traffic exists, it is specifically configured to: after the end of the second time period, according to the data processing request in the second time period, determine that the burst traffic exists.
  • the burst traffic wherein, the duration of the second time period is less than a set threshold, and the end moment of the second time period is before the end moment of the first time period.
  • the processing module determines that the burst traffic exists according to the data processing request within the second time period, it is specifically configured to perform at least one of the following: determine the second time The total number of data processing requests in the segment is greater than the set threshold; determine that the total bandwidth of the data processing requests in the second time period is greater than the set bandwidth threshold; determine the data processing requests in the second time period The increment of the quantity is greater than the set increment threshold; it is determined that the increase of the quantity of data processing requests within the second time period is greater than the set increase threshold.
  • the prediction module when the prediction module predicts that there is a burst traffic in the first time period, it is specifically configured to: use the set traffic prediction model to process the request according to the data in the target historical time period, It is predicted that there is a burst traffic within the first time period; wherein, the traffic prediction model is obtained through machine learning and/or model training; or, according to the burst traffic prediction information from the upper layer application, it is predicted that the There is a burst traffic in the first time period; wherein, the burst traffic prediction information is used to indicate: it is predicted that there is a burst traffic in the first time period.
  • the storage device is a solid state disk.
  • the present application provides a storage device, which includes a controller and a storage array; the storage array is used to store data; and the controller is used to perform the above-mentioned first aspect or the first Aspects of any possible design of the described method.
  • the storage device is a solid state disk.
  • the present application provides a computing device, which includes the storage device described in the above-mentioned second aspect or any possible design of the second aspect, or, the computing device includes the above-mentioned third aspect or the storage device described in any possible design of the second aspect. Any possible design of the storage device described in the three aspects.
  • the storage device is a solid state disk.
  • the present application provides a computer-readable storage medium, the computer-readable storage medium stores computer instructions, and when the computer instructions are run on a computer or a processor, the computer or the processor Execute the method described in the first aspect or any possible design of the first aspect.
  • the present application provides a computer program product.
  • the computer program product runs on a computer or a processor
  • the computer or the processor executes any of the above-mentioned first aspect or any possibility of the first aspect The design of the described method.
  • FIG. 1 is a schematic structural diagram of a possible application system of the solution provided by the embodiment of the present application;
  • FIG. 2 is a schematic diagram of a method for controlling a storage device provided in an embodiment of the present application
  • FIG. 3 is a schematic flowchart of a method for controlling a storage device provided in an embodiment of the present application
  • FIG. 4a is a schematic diagram of an SSD control method provided by an embodiment of the present application.
  • Fig. 4b is a schematic diagram of another SSD control mode provided by the embodiment of the present application.
  • Fig. 4c is a schematic diagram of another SSD control mode provided by the embodiment of the present application.
  • FIG. 5 is a schematic diagram of bandwidth resources corresponding to IO operations at different stages provided by an embodiment of the present application
  • FIG. 6 is a schematic diagram of a storage device provided by an embodiment of the present application.
  • Solid-state hard disk is a hard disk made of solid-state electronic memory chip array, also known as solid-state drive.
  • a solid state disk generally includes at least two parts, a controller and a storage array, and the controller can be used to control the solid state disk.
  • the storage array is used to provide the storage area of the solid-state disk, which can store data.
  • Flash memory When flash memory is used as the storage medium for solid-state drives, the storage array usually includes dozens, hundreds or even thousands of flash memories, and each flash memory may include hundreds to thousands of flash memory blocks, and each flash memory block may include thousands of flash memory blocks. Page. Flash memory has three basic operations: read, write, and erase. Among them, the operation granularity of read operation and write operation is a flash memory page, and the operation granularity of erase operation is a flash memory block. Therefore, flash memory has remote update and asymmetric read/write erase. Latency characteristics.
  • flash translation layer flash translation layer
  • FTL flash translation layer
  • the FTL mapping table is an address translation table, which is used to indicate a mapping relationship between a logical address of data and a physical address.
  • the logical address is the address generated by the system for the data before writing to the flash memory
  • the physical address is the address after writing to the flash memory.
  • the data processing request is a read request (for requesting a read operation), the data at the corresponding physical address in the flash memory is read out; if the data processing request is a write request (for requesting to perform a write operation), and the write If the operation is to write a certain data for the first time, write the data to a blank physical address in the flash memory; if the data processing request is a request to perform a write operation, and the write operation is used to update a stored data, then Mark the corresponding physical address of the data in the flash memory as invalid, and write the updated data corresponding to the data into the blank physical address in the flash memory, and then update the corresponding address mapping relationship in the FTL mapping table to complete the operation. If the data processing request is an erasing request (for requesting to perform an erasing operation), the data of the corresponding physical address in the flash memory is deleted, and the corresponding address mapping relationship in the FTL mapping table is deleted.
  • the data processing request may be referred to as an input/output (input/output, IO) or an IO request for short.
  • the GC operation is to select a flash memory block to reclaim when the available storage space (blank storage space or free storage space) in the storage array is less than the startup threshold (called the GC watermark), and the specific operation is to read the data in the selected flash block.
  • Valid data is migrated into the flash page in the available storage space, and then the content in the flash block is erased, so that the storage space corresponding to the flash block is reclaimed through GC operation.
  • the GC operation stops execution.
  • IO refers to a data processing request sent to the storage device by other devices (such as a host device).
  • the IO may include at least one of a read request, a write request, and an erase request.
  • the IO that occurs within a period of time can be defined as two situations: regular traffic and burst traffic.
  • regular traffic is smaller than the disk capacity of the solid-state hard disk, which is a scenario with few data processing requests.
  • the solid-state hard disk can process all the requests of the host in a timely manner.
  • burst traffic is greater than the disk capacity of the solid-state hard disk, which is a scenario where there are many data processing requests.
  • the solid-state hard disk can only respond to the data processing requests in the burst traffic in batches, which may cause request response timeouts.
  • the IO operation refers to the process in which the solid state disk performs corresponding operations according to the received IO, and is the operation performed by the solid state disk when responding to the IO.
  • the IO operation may include at least one of a read operation, a write operation, and an erase operation.
  • Bandwidth refers to the amount of data that can be transmitted per unit time. Bandwidth can be used to identify the data transmission capabilities of devices, devices or communication lines, usually expressed in bits or bits per second (bps) that can be transmitted.
  • the bandwidth of a storage device is fixed.
  • the controller can control the frequency of using the bandwidth to realize the effect of executing the IO operation or the GC operation under different bandwidth capabilities. Therefore, in the implementation of this application, the bandwidth resource refers to the bandwidth capability (or data transmission capability) realized by changing the frequency of using the bandwidth.
  • Allocating bandwidth resources to IO operations or GC operations means: by configuring IO operations or GC operations to use bandwidth frequencies during operation execution, to configure corresponding bandwidth capabilities for IO operations or GC operations, so that IO operations or GC operations Execute under the corresponding bandwidth capability.
  • the bandwidth resources of the storage device and the IOPS of the storage device (that is, the number of data processing requests that the storage device can respond to per second) can be converted to each other.
  • At least one in the embodiments of the present application refers to one or more, and “multiple” refers to two or more.
  • “And/or” describes the association relationship of associated objects, indicating that there may be three types of relationships, for example, A and/or B, which can mean: A exists alone, A and B exist simultaneously, and B exists alone, where A, B can be singular or plural.
  • the character “/” generally indicates that the contextual objects are an “or” relationship.
  • At least one (item) of the following” or similar expressions refer to any combination of these items, including any combination of single item(s) or plural item(s).
  • At least one item (unit) of a, b or c can represent: a, b, c, a and b, a and c, b and c, or a, b and c, wherein a, b, c Can be single or multiple.
  • the solid state drive can complete the corresponding IO operations on time. Moreover, based on the current resource allocation methods for IO operations and GC operations, the bandwidth resources allocated in the SSD can also maintain a stable available storage space. However, if the IO access volume exceeds the capacity of the disk (that is, the burst traffic scenario), the solid state disk will need a long waiting time when performing the corresponding IO operation, which may cause a response timeout.
  • the bandwidth resources allocated in SSDs cannot maintain the relative stability between the storage space occupied by IO operations and the storage space released by GC, so it is impossible to maintain a stable available storage space , and there may even be a situation where the available storage space is consumed by IO operations, which will affect the storage performance and stability of the SSD.
  • a method for controlling the resource of GC operation is to start and stop GC operation according to the requirement of IO operation, so as to achieve the effect of responding to IO first. Specifically, when the burst traffic comes, the GC operation can be stopped, so that all resources can be used for IO operations, and when the burst traffic ends, the GC operation can be started to reclaim the storage space.
  • this solution only considers IO requirements without considering the actual situation of storage space, and cannot maintain a relatively stable available storage space. Moreover, when the available storage space is small and the burst traffic lasts for a long time, the available storage space may be exhausted and the system may crash. Therefore, the implementability of this scheme is very poor.
  • an embodiment of the present application provides a method for controlling a storage device, wherein the storage device is capable of performing GC operations and IO operations.
  • the storage device may be a solid state disk.
  • the storage device can adjust the startup threshold of the GC operation, so that the storage device can always maintain a larger available storage space in the storage device by performing the GC operation after the startup threshold is increased, and at the same time, the storage device The GC operation can be started and stopped according to the requirements of the IO operation. In this way, before the burst traffic comes, the storage device can maintain a larger available storage space by increasing the start threshold of the GC operation.
  • the available storage space can be used for IO operations, thereby avoiding The IO operation will consume the available storage space, and at the same time, it can avoid the GC operation and the IO operation from competing for resources, and improve the execution efficiency of the IO operation.
  • the storage device after increasing the startup threshold of the GC operation, the storage device can always maintain a large available storage space in the normal traffic scenario, and in the burst traffic scenario, the storage device can use the available storage space when responding to the burst traffic , so as to prevent the storage system of the storage device from collapsing and improve its stability.
  • increasing the startup threshold of GC operation will cause frequent execution of GC operation, and valid flash memory pages need to be moved during the execution of GC operation, which will increase the burden of erasing and writing of the storage device, and will cause the life of the storage device to be lost. The problem.
  • the embodiment of the present application also provides another storage device control method, which is used to control the resource allocation and execution process of IO operations and GC operations of the storage device, so that the storage device can respond to a large number of IOs in a timely manner. To maintain a certain available storage space, thereby ensuring the normal working performance of the storage device, and further improving the operation stability and storage performance of the storage device.
  • FIG. 1 is a schematic structural diagram of a possible application system of the solution provided by the embodiment of the present application.
  • the system includes at least a storage device, the storage device includes a controller and a storage array, the controller is used to control the storage device, and the storage array is used to provide storage space for the storage device.
  • the storage device may be a solid state disk.
  • the system may also include a host (host) device.
  • the host device can communicate with the storage device and can perform some control over the storage device, and the storage device can also respond to data processing requests (IO/IOs) from the host device.
  • the storage device may be deployed in the host device.
  • the controller may further include a statistics module, a modulation module and a GC module.
  • the statistical module can be used to count current traffic information, available storage space, etc., and send the counted information to the control module.
  • the regulation module can be used to implement the control method provided by the embodiment of the present application, mainly including calculating the start threshold of GC operation under specific conditions according to current and future traffic information and information of available storage space, and allocating bandwidth resources for IO operation and GC operation , Control the execution of IO operations and GC operations, etc.
  • the GC module is used to perform GC operations under the control of the modulation module.
  • the controller may further include a prediction module.
  • the prediction module can be used to predict future traffic information according to the historical traffic information of the storage device, and send the predicted future traffic information to the control module, so that the control module can obtain the future traffic information.
  • the upper layer application in the host device can predict its future traffic information after obtaining the historical traffic information of the storage device, and send the predicted future traffic information to the controller of the storage device . Then the control module in the controller can also obtain the future traffic information from the upper layer application.
  • the upper layer application or prediction module may convert the IOPS of the storage device into a bandwidth requirement and send it to the controller of the storage device.
  • the storage array is the physical carrier for the final storage of data.
  • the storage array may use NAND flash memory, and may include multiple flash memory arrays (flash array).
  • flash array can be used as a NAND flash memory particle (flash memory medium particle), so the storage array is equivalent to a NAND flash memory particle group.
  • system architecture is only an exemplary description of the system architecture applicable to the solution of this application, and does not limit the system architecture applicable to the solution of this application.
  • Other devices or modules may also be added to the above system architecture, or some devices or modules may be reduced or modified.
  • FIG. 2 is a schematic diagram of a method for controlling a storage device provided by an embodiment of the present application. As shown in Figure 2, the method includes:
  • the controller of the storage device increases the bandwidth resources allocated to the garbage collection GC operation before the first time period; wherein the burst traffic includes A first number of data processing requests, the first number being greater than the number of data processing requests that the storage device can respond to per second.
  • the storage device includes a controller and a storage array, and the storage device is capable of performing GC operations and IO operations.
  • the storage device is a solid state disk.
  • the number of data processing requests included in the regular traffic is less than or equal to the number of data processing requests that the storage device can respond to per second, and the number of data processing requests included in the burst traffic is greater than the number of data processing requests that the storage device can respond to per second. The number of data processing requests that can be responded to.
  • the way the controller allocates bandwidth resources for IO operations and GC operations can be: allocate corresponding bandwidth resources for IO operations and GC operations, so that the storage device can maintain the storage required for IO operations during the running process.
  • a relative balance is maintained between the space and the storage space reclaimed by the GC operation, for example, the size difference between the two storage spaces is within the set range. In this way, it can not only ensure that the storage device has sufficient storage space for performing IO operations, but also avoid the impact of frequent execution of GC operations on the life of the storage device as much as possible.
  • the controller performs control according to the above method, and at the same time, judges whether there is a burst flow in the future time period, so as to adjust the control method accordingly.
  • the controller may predict whether there is a burst traffic in a future time period according to data processing requests received in a historical time period.
  • the controller can use the set traffic forecasting model to predict that there is a burst traffic in the first time period according to the data processing request in the target historical time period; wherein, the traffic forecasting model is based on machine learning and /or obtained by model training, the first time period is a certain time period in the future.
  • the traffic prediction model may be a model based on a long short-term memory network (long short-term memory, LSTM).
  • the controller may predict that there is a burst traffic within the first time period through the prediction module.
  • the controller may predict that there is a burst traffic within the first time period according to the burst traffic prediction information from the upper-layer application; wherein the burst traffic prediction information is used for Indication: It is predicted that there is a burst traffic within the first time period.
  • the upper-layer application may use the above-mentioned traffic prediction model to predict that there is a burst traffic within the first time period, and indicate it to the controller.
  • the prediction of future traffic can be completed by the host device, and the controller can directly determine that there is a burst in the first time period according to the instruction of the upper layer application in the host device. flow.
  • the information of the predicted burst traffic within the first time period may include: the expected arrival time of the burst traffic (that is, the starting moment of the first time period) , the bandwidth resources required for transmitting the burst traffic, and the duration of the burst traffic (that is, the duration of the first time period).
  • the controller may increase the bandwidth resource allocated to the GC operation on the basis of the bandwidth resource allocation in the above-mentioned normal traffic scenario. For example, the controller may increase the allocation of surplus bandwidth resources in the storage device to GC operations, thereby speeding up the reclaiming rate of the storage space.
  • the controller uses a first bandwidth resource to execute the GC operation to obtain a first available storage space in the storage array, where the first bandwidth resource is a bandwidth resource allocated to the GC operation.
  • the controller may use the first bandwidth resource allocated to the GC operation to execute the GC operation to obtain the first available storage space.
  • the first available storage space is greater than the size of the available storage space that can be maintained in the storage device in a normal traffic scenario.
  • the controller only needs a part of the bandwidth resources of the storage device to complete the IO operation and GC operation, therefore, the bandwidth resources of the storage device will have surplus. Based on this, when the controller predicts that there is a burst traffic within the first time period, it can further store the Some or all of the excess bandwidth resources are increased and allocated to GC operations.
  • the controller uses all the increased bandwidth resources allocated to the GC operation to execute the GC operation, which can speed up the execution rate of the GC operation, thereby speeding up the recovery rate of the storage space, so that the GC operation can be recovered before the arrival of the first time period. Lots of storage space.
  • the controller may increase the bandwidth resource allocated to the garbage collection GC operation before the first time period, and may also Before the first time period, the start and stop of the GC operation are controlled by increasing the start threshold of the GC operation.
  • the controller may increase the start threshold of the GC operation when it is predicted that there is a burst traffic within the first time period. Wherein, when the available storage space in the storage array is less than the startup threshold, the GC operation is started.
  • the controller can obtain a larger available storage space by executing the GC operation, and it can also ensure that after the execution of the GC operation obtains a larger available storage space, the controller will The available storage space obtained can also be maintained by performing GC operations.
  • the controller predicts that there is a burst traffic within the first time period, based on the storage space required for the IO operation corresponding to the burst traffic and the first bandwidth resource determining a first target time; and when the first target time arrives, increasing the start threshold of the GC operation; wherein, when the available storage space in the storage array is less than the start threshold, start the GC operate.
  • the controller may first calculate the storage space required for the IO operation corresponding to the burst traffic according to the predicted bandwidth resources required for transmitting the burst traffic and the duration of the burst traffic. Exemplarily, it can be calculated according to the following formula:
  • S 2 is the storage space required for the IO operation corresponding to the burst traffic
  • BW 3 is the bandwidth resource required for transmitting the burst traffic
  • T is the duration of the burst traffic.
  • the controller may calculate the time required to obtain the storage space through the GC operation according to the storage space required by the IO operation corresponding to the burst traffic and the increased bandwidth resource allocated to the GC operation. Exemplarily, it can be calculated according to the following formula:
  • T 1 S 2 /BW 4
  • t 1 is the time required for obtaining the storage space through GC operation
  • S 2 is the storage space required for the IO operation corresponding to the burst traffic
  • BW 4 is the additional allocation of the first resource to the Bandwidth resources for GC operations.
  • the controller may calculate and determine the first target moment. Specifically, the controller may calculate the time length between the first target moment and the moment when it is predicted that there is a burst traffic within the first time period according to the following formula:
  • T 2 T 3 -T 1 - ⁇
  • T2 is the time length between the first target moment and the moment when the burst traffic is predicted in the first time period
  • T3 is the start moment of the first time period and the time when the first time period is predicted
  • T 1 is the time required to obtain the storage space required for the IO operation corresponding to the burst traffic through GC operations
  • can be the set duration, and ⁇ is greater than or equal to 0 And less than or equal to T 3 -T 1 .
  • the controller After calculating T 2 , the controller delays by T 2 the time when the burst traffic is predicted to exist in the first time period, and the corresponding time is the first target time. Then, when the first target time arrives, the start threshold of the GC operation can be increased.
  • the controller can determine the time T 1 required to obtain the storage space that can be used to handle the burst traffic through the GC operation according to the additional bandwidth resources allocated to the GC operation and the bandwidth resources required to transmit the burst traffic, and then Adjusting the GC threshold from the time when the estimated arrival time of the burst traffic is ahead of T 1 can not only minimize unnecessary GC operations, reduce the impact on the life of the storage device, but also obtain a greater Storage space for use when burst traffic arrives. Furthermore, adding a certain time margin ⁇ on the basis of advancing T 1 can further ensure that the storage space obtained through the GC operation is sufficient for the arrival of burst traffic.
  • the start threshold of the GC operation may be adjusted to the first threshold.
  • the first threshold is greater than or equal to a target value
  • the target value is greater than or equal to the storage space required by the IO operation corresponding to the burst traffic.
  • the target value may be the sum of the first parameter and the second parameter, the first parameter is the storage space required for the IO operation corresponding to the burst traffic, and the second parameter is the predicted The available storage space in the storage array when there is a burst of traffic in the first time period.
  • the first threshold may satisfy the following formula: N 1 ⁇ S, where N 1 is the first threshold.
  • the controller allocates bandwidth resources for GC operation based on the above method and increases the start threshold of GC operation, in the process of executing GC operation according to step S202, it can judge whether there is burst traffic according to real-time traffic information (that is, Whether the burst traffic is coming), so as to carry out further control.
  • the controller judges whether there is a burst traffic according to the real-time traffic information
  • the following method may be adopted: after the second time period ends, according to the data processing request in the second time period, it is determined that the burst traffic exists;
  • the duration of the second time period is less than a set threshold, and the end time of the second time period is before the end time of the first time period.
  • the set threshold may be, for example, a short duration of millisecond level or second level.
  • the controller when the controller determines that the data processing request within the second time period satisfies at least one of the following conditions 1 to 4, it may determine that there is a burst traffic.
  • the total number of data processing requests within the second time period is greater than a set number threshold.
  • Condition 4 The growth rate of the number of data processing requests within the second time period is greater than a set growth rate threshold.
  • the second time period in each of the above conditions is a relatively short time period, and when the data processing requests in the second time period satisfy condition 1, it means that there are a large number of data processing requests in a short period of time, and it can be considered that there is a burst send traffic.
  • condition 2 When the data processing request in the second time period satisfies condition 2, it means that the data volume of the data processing request in a short period of time is large, and it can be considered that there is a burst traffic.
  • condition 3 or condition 4 it means that the data processing requests in a short period of time increase rapidly, and it can be considered that there is a burst traffic.
  • the embodiments of the present application include but are not limited to the above method for judging whether there is burst traffic, and the controller may also use other methods for judging, which will not be listed here.
  • the controller when the controller judges in real time whether there is a burst traffic, the judgment results may be obtained in various situations, and the corresponding control methods adopted are also different.
  • the control mode adopted by the controller when the size of the available storage space in the storage array changes, the control mode adopted by the controller also changes accordingly. Therefore, the controller needs to flexibly adjust the control mode of GC operation and IO operation according to the change of the actual situation, so as to obtain a better control effect.
  • the controller determines that there is a burst traffic according to the above manner, it indicates that the burst traffic is coming.
  • the target value is greater than or equal to the storage space required by the IO operation corresponding to the burst traffic. Therefore, when the available storage space in the storage array reaches the target value, it indicates that the first available storage space obtained through the GC operation is sufficient for the IO operation corresponding to the burst traffic. If it is not determined that there is a burst of traffic at this time, that is, the burst of traffic has not yet arrived, the execution speed of the IO operation can be appropriately reduced so that it can maintain the first available storage space currently obtained, thereby avoiding excessive GC operations. Effects on storage device lifetime.
  • the controller may allocate the second bandwidth resource to the IO operation corresponding to the current data processing request when determining that the first available storage space reaches the target value before determining that the burst traffic exists, and allocate the third bandwidth resource to Assigned to GC operations.
  • the size of the second bandwidth resource has a positive correlation with the size of the available storage space in the storage array
  • the size of the third bandwidth resource has a negative correlation with the size of the available storage space in the storage array.
  • the controller can allocate more bandwidth resources for IO operations and less bandwidth resources for GC operations, which can speed up the consumption of available storage space and slow down the consumption of available storage space. Recycling, so as to properly consume the available storage space, avoid excessive storage space, and improve the speed of IO operations.
  • the controller can allocate less bandwidth resources for IO operations and more bandwidth resources for GC operations, which can speed up the recovery of available storage space and slow down the consumption of available storage space, thereby avoiding unavailable The storage space is too small. By flexibly allocating bandwidth resources for IO operations and GC operations in this way, the size of the available storage space can be kept stable until burst traffic arrives.
  • the above-mentioned second bandwidth resource conforms to the following formula:
  • BW 1 BW 2 ⁇ S 1 /S th
  • BW 1 is the second bandwidth resource
  • BW 2 is the total bandwidth resource that the controller can use
  • S 1 is the available storage space in the storage array
  • S th is the start threshold of GC operation.
  • the above-mentioned third bandwidth resource may be a part or all of the bandwidth resource obtained by subtracting the second bandwidth resource from the total bandwidth resource available to the controller.
  • the controller lowers the start threshold of the GC operation when it is determined that there is a burst flow.
  • the controller can allocate the first available storage space obtained by executing the GC operation to the IO operation corresponding to the burst traffic, so as to ensure a timely response to the burst traffic.
  • the controller lowers the start threshold of the GC operation, the GC operation stops, and more bandwidth resources can be used for the IO operation, and the IO operation can respond to the burst traffic in a timely and rapid manner, thereby reducing or avoiding the IO response timeout The problem.
  • the GC operation start threshold may be adjusted to the second threshold.
  • the second threshold may be the start threshold (N 0 ) of the GC operation when a burst traffic is predicted, or the second threshold is less than or equal to the target value (S).
  • the controller can determine that the prediction is wrong and there is no burst traffic in fact, and lower the GC The start threshold for the action.
  • the controller determines that the predicted burst flow does not arrive at the second target moment, it determines that the burst flow does not exist, and may lower the start threshold of the GC operation.
  • the second target moment may be the start moment of the first time period.
  • the start threshold of the GC operation may be adjusted to the second threshold described in the above case 2.
  • the controller in the storage device predicts the arrival of burst traffic in advance, and at the same time, considering that the bandwidth resources required by the conventional traffic are small and there are surplus bandwidth resources available in the storage device, when the burst traffic is predicted When , increase the bandwidth resources allocated to GC operations, thereby speeding up the recovery rate of storage space, and preparing available storage space for burst traffic in advance. Then when the burst traffic comes, the controller can provide the available storage space prepared in advance to the IO operation corresponding to the burst traffic, so as to ensure the speed of IO response, improve the user experience, and avoid excessive consumption of the available storage space , improving the stability of the operation of the storage device.
  • FIG. 3 is a schematic flowchart of a method for controlling a storage device provided by an embodiment of the present application.
  • the process includes:
  • S301 In a normal traffic scenario, the controller controls the SSD according to a normal policy, and obtains prediction information of burst traffic.
  • the conventional strategy is to allocate corresponding bandwidth resources to the GC operation according to the executed IO operations, so that the storage space reclaimed by the GC operation is relatively balanced with the storage space required by the IO operations corresponding to the conventional traffic.
  • the controller of the SSD may adopt flow control policy 0 for regulation, and receive prediction information of burst traffic.
  • flow control strategy 0 is to control the startup threshold of GC operation as an initial value N 0 .
  • the bandwidth resources for IO operations are similar to those for GC operations, and both are smaller. There are many idle bandwidth resources in SSDs that are not being used.
  • the prediction information of the burst traffic includes the expected arrival time of the burst traffic, the duration, the bandwidth resource required for transmitting the burst traffic, and the like.
  • the prediction information of the burst traffic can be obtained by the controller itself, or determined according to the instruction of the upper layer application.
  • the controller adjusts the adopted flow control policy 0 to the flow control policy 1 after determining that the burst traffic is predicted according to the prediction information of the burst traffic.
  • flow control strategy 1 is to adjust the start threshold of GC operation to the first threshold N 1 , and at the same time, increase and allocate idle bandwidth resources in SSD to GC operation until the available storage space reaches the target value S.
  • the target value S bandwidth resources required for transmitting burst traffic ⁇ burst traffic duration+available storage space in the storage array when burst traffic is predicted, and N 1 is a value slightly larger than S.
  • the controller adopts flow control strategy 1, and the bandwidth resource used by the IO operation is based on the size of the actual IO traffic.
  • the space required for IO operations is small and the speed of GC operations is accelerating, the size of the available storage space is gradually increasing.
  • flow control strategy 2 is to allocate bandwidth resources proportional to the available storage space to IO operations, and the remaining bandwidth resources can be allocated to GC operations.
  • the bandwidth resource corresponding to the IO operation total bandwidth resource ⁇ available storage space/N 1 .
  • the maximum available storage space is N 1 , and all bandwidth resources are used for IO operations at this time.
  • the bandwidth resources used by IO operations are proportional to the available storage space. During this process, it can be maintained as much as possible
  • the available storage space is at the level of S or so.
  • step S304 The controller judges whether the burst traffic is coming according to the actual IO situation, and if so, executes step S305; otherwise, executes step S306.
  • the controller determines that within 3 consecutive seconds, the number of IOs per second increases by more than 50% compared with the previous second, it may determine that the burst traffic is coming.
  • the controller adjusts the adopted flow control strategy 2 to flow control strategy 3 when determining that a burst traffic is coming.
  • the flow control strategy 3 is to adjust the start threshold of the GC operation to the initial value N 0 , so as to stop the GC operation and use the bandwidth resource for the IO operation.
  • S306 The controller maintains the current control mode, or switches to control the SSD according to a conventional strategy when determining the expected end time of the arrival of the burst traffic.
  • the controller when it does not determine that the burst traffic is coming, it may maintain the flow control policy 2, or, when determining the expected end time of the arrival of the burst traffic, adjust the adopted traffic control policy 2 to the traffic control policy 3.
  • the expected end time of the burst traffic is the corresponding time after the expected arrival time of the burst traffic is delayed by the duration of the burst traffic.
  • the controller can quickly free up the storage space required for the IO operation corresponding to the burst traffic, and lower the startup threshold of the GC operation when the burst traffic comes, so as to maximize the IO response Ability to absorb burst traffic, improve IO response speed and SSD stability.
  • the allocation of bandwidth resources is increased for the GC operation to quickly reclaim the storage space will have an impact on the life of the SSD, but the duration is short, so the impact on the life can be reduced.
  • an embodiment of the present application further provides a control device for a storage device, the control device is applied to a controller in the storage device, and the storage device further includes a storage array.
  • the control device 600 includes: a predicting module 601, configured to predict that there is a burst traffic within the first time period; a processing module 602, used to increase the allocation to Bandwidth resources for GC operations, and using the first bandwidth resources to execute the GC operations to obtain a first available storage space in the storage array; wherein, the burst traffic includes a first number of data processing requests, and the second A number is greater than the number of data processing requests that the storage device can respond to per second; the first bandwidth resource is a bandwidth resource allocated to the GC operation.
  • the processing module 602 is further configured to: when it is determined that the burst traffic exists, allocate the first available storage space to an input/output IO operation corresponding to the burst traffic.
  • the processing module 602 is further configured to: increase the startup threshold of the GC operation; wherein, when When the available storage space in the storage array is less than the start threshold, start the GC operation.
  • the processing module 602 is further configured to: based on the IO operation required by the burst traffic storage space and the first bandwidth resource determine a first target time; when the first target time arrives, increase the start threshold of the GC operation; wherein, when the available storage space in the storage array is less than the When the threshold is started, the GC operation is started.
  • the processing module 602 is further configured to: when it is determined that the burst traffic exists, lower the start threshold of the GC operation; or, if the predicted burst traffic is in the second If the target time has not arrived, lower the start threshold of the GC operation; wherein, the second target time is any time within the first time period.
  • the processing module 602 is further configured to: before it is determined that the burst traffic exists, when the first available storage space reaches a target value, allocate the second bandwidth resource to the current data processing Requesting a corresponding IO operation, and allocating a third bandwidth resource to the GC operation; wherein, the target value is greater than or equal to the storage space required for the IO operation corresponding to the burst traffic; the second bandwidth resource
  • the size has a positive correlation with the size of the available storage space in the storage array, and the size of the third bandwidth resource has a negative correlation with the size of the available storage space in the storage array.
  • the second bandwidth resource complies with the following formula:
  • BW 1 BW 2 ⁇ S 1 /S th
  • the BW 1 is the second bandwidth resource
  • the BW 2 is the total bandwidth resource that the controller can use
  • the S 1 is the available storage space in the storage array
  • the S th is The start threshold for the GC operation.
  • the target value is the sum of the first parameter and the second parameter
  • the first parameter is the storage space required for the IO operation corresponding to the burst traffic
  • the second parameter is The available storage space in the storage array when it is predicted that there is a burst traffic within the first time period.
  • the storage space required for the IO operation corresponding to the burst traffic conforms to the following formula:
  • the S 2 is the storage space required for the IO operation corresponding to the burst traffic
  • the BW 3 is the bandwidth resource required for transmitting the burst traffic
  • the T is the duration of the burst traffic duration.
  • the processing module 602 determines that the burst traffic exists, it is specifically configured to: after the end of the second time period, according to the data processing request in the second time period, determine that there is The burst traffic; wherein, the duration of the second time period is less than a set threshold, and the end moment of the second time period is before the end moment of the first time period.
  • the processing module 602 determines that the burst traffic exists according to the data processing request within the second time period, it is specifically configured to perform at least one of the following: determine the second The total number of data processing requests in the time period is greater than the set number threshold; determine that the total bandwidth of the data processing requests in the second time period is greater than the set bandwidth threshold; determine the data processing in the second time period The increment of the quantity of requests is greater than a set increment threshold; it is determined that the increment of the quantity of data processing requests within the second time period is greater than the set increment threshold.
  • the prediction module 601 when the prediction module 601 predicts that there is a burst traffic in the first time period, it is specifically configured to: use the set traffic prediction model to process the request according to the data in the target historical time period , it is predicted that there is a burst traffic within the first time period; wherein, the traffic prediction model is obtained through machine learning and/or model training; or, according to the burst traffic prediction information from the upper-layer application, it is predicted that There is a burst traffic within the first time period; wherein, the burst traffic prediction information is used to indicate: it is predicted that there is a burst traffic within the first time period.
  • the storage device is a solid state disk.
  • each functional module in each embodiment of the present application can be integrated into a processing In the controller, it can also be physically present separately, or two or more modules can be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules.
  • the software or firmware includes but is not limited to computer program instructions or codes, and can be executed by a hardware processor.
  • the hardware includes but not limited to various integrated circuits, such as central processing unit (CPU), digital signal processor (DSP), field programmable gate array (FPGA) or application specific integrated circuit (ASIC).
  • the embodiment of the present application also provides a storage device, the storage device includes a controller and a storage array; the storage array is used to store data; the controller is used to control the storage device The method for controlling the storage device provided in the foregoing embodiments is executed.
  • the storage device is a solid state disk.
  • the embodiment of the present application further provides a computing device, the computing device includes the storage device provided in the above embodiment.
  • the storage device is a solid state disk.
  • the embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores computer instructions, and when the computer instructions are run on a computer or a processor, the The computer or the processor executes the method for controlling a storage device provided in the foregoing embodiments.
  • the embodiment of the present application also provides a computer program product, when the computer program product runs on a computer or a processor, the computer or the processor executes the computer program provided in the above embodiment.
  • a control method for a storage device is also provided.
  • the methods provided in the embodiments of the present application may be implemented in whole or in part by software, hardware, firmware or any combination thereof.
  • software When implemented using software, it may be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions.
  • the computer program instructions When the computer program instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present invention will be generated in whole or in part.
  • the computer may be a general purpose computer, a special purpose computer, a computer network, network equipment, user equipment or other programmable devices.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server or data center Transmission to another website site, computer, server, or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL) or wireless (such as infrared, wireless, microwave, etc.) means.
  • the computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media.
  • the available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), optical media (for example, digital video disc (digital video disc, DVD for short), or semiconductor media (for example, SSD), etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Disclosed in the present application are a control method and apparatus for a storage apparatus. The storage apparatus comprises a controller and a storage array. The method is applied to the controller. The method comprises: when it is predicted that there is burst traffic within a first time period, increasing, before the first time period, bandwidth resources that are allocated for a garbage collection (GC) operation, wherein the burst traffic includes a first number of data processing requests, the first number being greater than the number of data processing requests to which a storage apparatus can respond per second; and executing the GC operation by using a first bandwidth resource, so as to obtain a first available storage space in a storage array, wherein the first bandwidth resource is a bandwidth resource that is allocated for the GC operation. In the solution, the execution of a GC operation is promoted before the arrival of burst traffic, such that a relatively large available storage space can be obtained, and when the burst traffic arrives, it can be ensured that there is a relatively large available storage space in a storage apparatus for responding to the burst traffic, thereby improving the stability and input/output (IO) response speed of the storage apparatus.

Description

一种存储装置的控制方法及装置Method and device for controlling a storage device 技术领域technical field
本申请涉及存储技术领域,尤其涉及一种存储装置的控制方法及装置。The present application relates to the field of storage technology, and in particular, to a method and device for controlling a storage device.
背景技术Background technique
固态硬盘(solid state disk,SSD)现已广泛用于各种存储场景,如服务器、数据中心、嵌入式设备等等。Solid state disk (SSD) is now widely used in various storage scenarios, such as servers, data centers, embedded devices, and so on.
SSD中配备了垃圾回收GC(garbage collection,GC)算法。GC算法用于在SSD存储空间中的可用空间(即空白空间)小于一个阈值(称为GC水线)时,对已存储数据的存储空间进行垃圾回收,从而释放出一些存储空间。SSD is equipped with garbage collection GC (garbage collection, GC) algorithm. The GC algorithm is used to perform garbage collection on the storage space of stored data when the available space (that is, empty space) in the SSD storage space is less than a threshold (called GC waterline), thereby releasing some storage space.
当用户请求(IO)下发到SSD后,SSD需要一定的时间响应IO,当响应时间超出用户容忍阈值(如1s)时,就会影响用户体验。其中,IO的响应时间是从IO下发开始到IO被处理时的总时间,该响应时间除了包括闪存处理的时间外,还包括IO等待被处理的时间。当SSD持续稳定响应接收到的IO时,SSD每秒钟处理的IO数量(IOPS)称为盘片能力。一般,由于有GC占用资源,SSD的盘片能力会小于其最大能力。After a user request (IO) is sent to the SSD, the SSD needs a certain amount of time to respond to the IO. When the response time exceeds the user tolerance threshold (such as 1s), the user experience will be affected. Wherein, the response time of the IO is the total time from when the IO is issued to when the IO is processed, and the response time includes not only the time for flash memory processing, but also the time for waiting for the IO to be processed. When the SSD continues to respond to the received IO stably, the number of IOs processed by the SSD per second (IOPS) is called the disk capacity. Generally, due to the resources occupied by GC, the disk capacity of SSD will be less than its maximum capacity.
当前在SSD控制中,GC使用的资源是随IO响应使用的资源而变化的,在IO响应使用的资源较多时,分配给GC使用的资源也较多,在IO响应使用的资源较少时,分配给GC使用的资源也较少。其中,在IO访问量较小时,SSD响应IO所需的资源、存储空间以及由此产生的垃圾所占的存储空间都较小,使用较少的资源进行GC就能维持IO响应所占存储空间与GC释放的存储空间的相对稳定。因此,当IO访问量小于盘片能力(称为常规流量)时,SSD可将IO按时执行完毕,同时能够正常执行GC,维持稳定的可用存储空间。但是,当IO访问量超出盘片能力(称为突发流量)时,处理IO所需的资源及消耗的存储空间会在短时间内大大增加。一方面,GC短时间内可能无法及时回收足够的存储空间,则会打破IO响应所占存储空间与GC释放的存储空间之间的相对稳定,甚至可能导致存储空间被IO响应过程消耗完,影响存储系统的稳定性。另一方面,GC也需要使用较多的资源来加快存储空间释放的速度,以尽可能释放更多存储空间用于IO响应,则会导致GC和IO响应过程发生资源争抢,影响IO响应的速度,可能导致IO响应超时的问题。Currently, in SSD control, the resources used by GC vary with the resources used by IO responses. When more resources are used by IO responses, more resources are allocated to GC. When fewer resources are used by IO responses, There are also fewer resources allocated for GC use. Among them, when the amount of IO access is small, the resources and storage space required by SSD to respond to IO, and the storage space occupied by the resulting garbage are all small, and the storage space occupied by IO response can be maintained by using less resources for GC The relative stability of storage space released by GC. Therefore, when the IO access volume is less than the capacity of the disk (called regular traffic), the SSD can complete the IO on time and at the same time perform GC normally to maintain a stable available storage space. However, when the IO access volume exceeds the capacity of the disk (called burst traffic), the resources required for processing IO and the consumed storage space will greatly increase in a short period of time. On the one hand, the GC may not be able to reclaim enough storage space in a short period of time, which will break the relative stability between the storage space occupied by the IO response and the storage space released by the GC, and may even cause the storage space to be consumed by the IO response process, affecting Stability of the storage system. On the other hand, GC also needs to use more resources to speed up the release of storage space, so as to release as much storage space as possible for IO response, which will lead to resource contention between GC and IO response process, affecting the IO response speed, which may lead to IO response timeout problems.
发明内容Contents of the invention
本申请提供一种存储装置的控制方法及装置,用以通过对存储装置中垃圾回收GC操作的资源分配及执行进行控制,来提高存储装置的稳定性及IO响应速度。The present application provides a storage device control method and device, which are used to improve the stability and IO response speed of the storage device by controlling resource allocation and execution of garbage collection GC operations in the storage device.
第一方面,本申请提供一种存储装置的控制方法,所述存储装置包括控制器和存储阵列,所述方法应用于所述控制器,所述方法包括:当预测到在第一时间段内存在突发流量时,在所述第一时间段之前,增加分配给垃圾回收GC操作的带宽资源;其中,所述突发流量包含第一数量的数据处理请求,所述第一数量大于所述存储装置每秒钟能够响应的数据处理请求的数量;利用第一带宽资源执行所述GC操作,得到所述存储阵列中的第一可用存储空间,其中,所述第一带宽资源为分配给所述GC操作的带宽资源。In a first aspect, the present application provides a method for controlling a storage device, the storage device includes a controller and a storage array, the method is applied to the controller, and the method includes: when it is predicted that the memory During burst traffic, before the first time period, increase the bandwidth resources allocated to garbage collection GC operations; wherein, the burst traffic includes a first number of data processing requests, and the first number is greater than the The number of data processing requests that the storage device can respond to per second; use the first bandwidth resource to execute the GC operation to obtain the first available storage space in the storage array, wherein the first bandwidth resource is allocated to the Bandwidth resources for GC operations.
在该方法中,存储装置的控制器在预测到突发流量时,通过在突发流量到来之前增加 分配给GC操作的带宽资源,可以加快GC操作的执行速度,使得GC操作能够在较短时间内快速回收得到较多的可用存储空间。因此该方法可以用于在预测到突发流量时,提前为响应突发流量准备存储空间。这样当突发流量到来时,可以保证存储装置中有较多的存储空间用来响应突发流量,从而在保证较高响应速度的同时,避免可用存储空间的过度消耗,提高存储装置的稳定性。In this method, when the controller of the storage device predicts the burst traffic, by increasing the bandwidth resources allocated to the GC operation before the burst traffic arrives, the execution speed of the GC operation can be accelerated, so that the GC operation can be performed in a short time Fast reclamation within the system will result in more available storage space. Therefore, this method can be used to prepare storage space in advance for responding to burst traffic when burst traffic is predicted. In this way, when the burst traffic comes, it can ensure that there is more storage space in the storage device to respond to the burst traffic, thereby ensuring a high response speed while avoiding excessive consumption of available storage space and improving the stability of the storage device .
在一种可能的设计中,所述方法还包括:当确定存在所述突发流量时,将所述第一可用存储空间分配给所述突发流量对应的IO操作。In a possible design, the method further includes: when it is determined that the burst traffic exists, allocating the first available storage space to an IO operation corresponding to the burst traffic.
在该方法中,在确定存在突发流量时,将通过GC操作提前处理得到的第一可用存储空间分配给突发流量对应的IO操作,可以保证有较多的存储空间供IO操作使用。一方面由于存储空间较为充足,可以提高IO操作的执行速度,另一方面,能够避免可用存储空间的过度消耗,提高存储装置的稳定性。In this method, when it is determined that there is a burst traffic, the first available storage space obtained through advance processing of the GC operation is allocated to the IO operation corresponding to the burst traffic, which can ensure more storage space for the IO operation. On the one hand, because the storage space is relatively sufficient, the execution speed of the IO operation can be improved; on the other hand, the excessive consumption of the available storage space can be avoided, and the stability of the storage device can be improved.
在一种可能的设计中,当预测到在第一时间段内存在突发流量时,所述方法还包括:调高所述GC操作的启动阈值;其中,当所述存储阵列中的可用存储空间小于所述启动阈值时,启动所述GC操作。In a possible design, when it is predicted that there is a burst traffic within the first time period, the method further includes: increasing the start threshold of the GC operation; wherein, when the available storage in the storage array When the space is smaller than the start threshold, start the GC operation.
在该方法中,通过在预测到突发流量时调高GC操作的启动阈值,使得控制器能够通过执行GC操作得到一个较大的可用存储空间,还可以保证控制器在通过执行GC操作得到一个较大的可用存储空间后,还能通过执行GC操作维持得到的该可用存储空间。In this method, by increasing the startup threshold of the GC operation when the burst traffic is predicted, the controller can obtain a larger available storage space by executing the GC operation, and it can also ensure that the controller obtains a large storage space by executing the GC operation. After a larger available storage space, the available storage space can be maintained by performing GC operations.
在一种可能的设计中,当预测到在第一时间段内存在突发流量时,所述方法还包括:基于所述突发流量对应的IO操作所需的存储空间和所述第一带宽资源确定第一目标时刻;在所述第一目标时刻到来时,调高所述GC操作的启动阈值;其中,当所述存储阵列中的可用存储空间小于所述启动阈值时,启动所述GC操作。In a possible design, when it is predicted that there is a burst traffic within the first time period, the method further includes: based on the storage space required for the IO operation corresponding to the burst traffic and the first bandwidth Resources determine a first target time; when the first target time arrives, increase the startup threshold of the GC operation; wherein, when the available storage space in the storage array is less than the startup threshold, start the GC operate.
在该方法中,根据突发流量对应的IO操作所需的存储空间和分配给GC操作的带宽资源,可以确定GC操作处理得到该存储空间所需的时间,进一步可以以该时间为参考,更精确的确定调高GC操作的启动阈值的时刻,能够避免过早或过晚调高GC操作的启动阈值,进而减少不必要的GC操作,降低对存储装置寿命的影响,又能通过GC操作得到足够大的可用存储空间,以供突发流量到来时使用。In this method, according to the storage space required for the IO operation corresponding to the burst traffic and the bandwidth resources allocated to the GC operation, the time required for the GC operation to process and obtain the storage space can be determined. Further, this time can be used as a reference to further Accurately determining the time to increase the start threshold of the GC operation can avoid raising the start threshold of the GC operation too early or too late, thereby reducing unnecessary GC operations and reducing the impact on the life of the storage device, and can be obtained through the GC operation. Large enough available storage space for burst traffic.
在一种可能的设计中,所述方法还包括:当确定存在所述突发流量时,调低所述GC操作的启动阈值;或者,若预测的所述突发流量在第二目标时刻没有到来,则调低所述GC操作的启动阈值;其中,所述第二目标时刻为所述第一时间段内的任一时刻。In a possible design, the method further includes: when it is determined that the burst traffic exists, lowering the start threshold of the GC operation; or, if the predicted burst traffic does not exist at the second target moment When the GC operation arrives, lower the start threshold of the GC operation; wherein, the second target time is any time within the first time period.
在该方法中,当确定存在所述突发流量时,通过调低GC操作的启动阈值,可以使GC操作停止,因此可以释放更多的带宽资源供给IO操作使用,则IO操作可以及时快速的对突发流量进行响应,从而减轻或避免IO响应超时的问题。在预测的突发流量不存在时,若一直维持较高的GC操作的启动阈值,会由于过多的、不必要的GC操作对存储装置的寿命产生影响。因此,在确定预测的突发流量未到来时调低GC操作的启动阈值,可以减轻对存储装置寿命的影响。In this method, when it is determined that the burst traffic exists, the GC operation can be stopped by lowering the start threshold of the GC operation, so that more bandwidth resources can be released for use by the IO operation, and the IO operation can be timely and quickly Respond to burst traffic, thereby reducing or avoiding the problem of IO response timeout. When the predicted burst traffic does not exist, if a high GC operation start threshold is maintained all the time, the life span of the storage device will be affected due to excessive and unnecessary GC operations. Therefore, reducing the start threshold of the GC operation when it is determined that the predicted burst traffic does not come, can reduce the impact on the life of the storage device.
在一种可能的设计中,所述方法还包括:在确定存在所述突发流量之前,当所述第一可用存储空间达到目标值时,将第二带宽资源分配给当前数据处理请求对应的IO操作,以及将第三带宽资源分配给所述GC操作;其中,所述目标值大于或等于所述突发流量对应的IO操作所需的存储空间;所述第二带宽资源的大小与所述存储阵列中的可用存储空间的大小具有正相关关系,所述第三带宽资源的大小与所述存储阵列中的可用存储空间的 大小具有负相关关系。In a possible design, the method further includes: before it is determined that the burst traffic exists, when the first available storage space reaches a target value, allocating the second bandwidth resource to the storage space corresponding to the current data processing request IO operation, and assigning a third bandwidth resource to the GC operation; wherein, the target value is greater than or equal to the storage space required for the IO operation corresponding to the burst traffic; the size of the second bandwidth resource is the same as the The size of the available storage space in the storage array has a positive correlation, and the size of the third bandwidth resource has a negative correlation with the size of the available storage space in the storage array.
在该方法中,当存储阵列中的可用存储空间达到目标值时,表明通过GC操作得到的第一可用存储空间足够用于突发流量对应的IO操作使用。若此时还未确定存在突发流量,则通过为IO操作分配与可用存储空间具有正相关关系的带宽资源,为GC操作分配与可用存储空间具有负相关关系的带宽资源,可以在可用存储空间过大时,加快对存储空间的消耗,减慢可用存储空间的回收,在可用存储空间过小时,减慢对存储空间的消耗,加快对存储空间的回收,从而使可用存储空间的大小维持相对稳定,以等待突发流量到来。In this method, when the available storage space in the storage array reaches the target value, it indicates that the first available storage space obtained through the GC operation is sufficient for the IO operation corresponding to the burst traffic. If it is not confirmed that there is a burst traffic at this time, by allocating bandwidth resources that have a positive correlation with the available storage space for IO operations, and allocating bandwidth resources that have a negative correlation with the available storage space for GC operations, you can allocate bandwidth resources in the available storage space When it is too large, it will speed up the consumption of storage space and slow down the recovery of available storage space. When the available storage space is too small, it will slow down the consumption of storage space and speed up the recovery of storage space, so that the size of available storage space remains relatively Stable to wait for the arrival of burst traffic.
在一种可能的设计中,所述第二带宽资源符合以下公式:In a possible design, the second bandwidth resource complies with the following formula:
BW 1=BW 2×S 1/S th BW 1 =BW 2 ×S 1 /S th
其中,所述BW 1为所述第二带宽资源,所述BW 2为所述控制器能够使用的总带宽资源,所述S 1为所述存储阵列中的可用存储空间,所述S th为所述GC操作的启动阈值。 Wherein, the BW 1 is the second bandwidth resource, the BW 2 is the total bandwidth resource that the controller can use, the S 1 is the available storage space in the storage array, and the S th is The start threshold for the GC operation.
在该方法中,通过为IO操作分配与可用存储空间具有正比例关系的带宽资源,可以进一步提高带宽资源分配的准确度,进而提高对存储装置进行控制的准确度。In this method, by allocating bandwidth resources proportional to available storage space for IO operations, the accuracy of bandwidth resource allocation can be further improved, thereby improving the accuracy of storage device control.
在一种可能的设计中,所述目标值为第一参数与第二参数之和,所述第一参数为所述突发流量对应的IO操作所需的存储空间,所述第二参数为当预测到在第一时间段内存在突发流量时所述存储阵列中的可用存储空间。In a possible design, the target value is the sum of the first parameter and the second parameter, the first parameter is the storage space required for the IO operation corresponding to the burst traffic, and the second parameter is The available storage space in the storage array when it is predicted that there is a burst traffic within the first time period.
在该方法中,该目标值的取值设置可以保证在将突发流量对应的IO操作所需的存储空间提供给突发流量使用后,仍能保持一定余量的可用存储空间,因此可以避免突发流量将可用存储空间消耗完的情况发生,提高存储系统的稳定性。In this method, the value setting of the target value can ensure that after the storage space required for the IO operation corresponding to the burst traffic is provided to the burst traffic, a certain margin of available storage space can still be maintained, so it can avoid Burst traffic will consume the available storage space, improving the stability of the storage system.
在一种可能的设计中,所述突发流量对应的IO操作所需的存储空间符合以下公式:In a possible design, the storage space required for the IO operation corresponding to the burst traffic conforms to the following formula:
S 2=BW 3×T S 2 =BW 3 ×T
其中,所述S 2为所述突发流量对应的IO操作所需的存储空间,所述BW 3为传输所述突发流量所需的带宽资源,所述T为所述突发流量的持续时长。 Wherein, the S 2 is the storage space required for the IO operation corresponding to the burst traffic, the BW 3 is the bandwidth resource required for transmitting the burst traffic, and the T is the duration of the burst traffic duration.
在该方法中,根据传输突发流量所需的带宽资源和突发流量的持续时长,可以准确计算突发流量对应的IO操作所需的存储空间,进而根据该存储空间对存储装置进行相应控制。In this method, according to the bandwidth resources required to transmit the burst traffic and the duration of the burst traffic, the storage space required for the IO operation corresponding to the burst traffic can be accurately calculated, and then the storage device is controlled accordingly according to the storage space .
在一种可能的设计中,确定存在所述突发流量,包括:在第二时间段结束后,根据所述第二时间段内的数据处理请求,确定存在所述突发流量;其中,所述第二时间段的时长小于设定阈值,所述第二时间段的结束时刻在所述第一时间段的结束时刻之前。In a possible design, determining that the burst traffic exists includes: after the end of the second time period, determining that the burst traffic exists according to a data processing request within the second time period; wherein, the The duration of the second time period is less than the set threshold, and the end time of the second time period is before the end time of the first time period.
在该方法中,在第二时间段结束后,基于第二时间段内的实际的数据处理请求,判断是否存在突发流量,可以实现实时的流量识别,并且具有较高的准确度。In this method, after the end of the second time period, based on the actual data processing requests in the second time period, it is judged whether there is burst traffic, which can realize real-time traffic identification with high accuracy.
在一种可能的设计中,根据所述第二时间段内的数据处理请求,确定存在所述突发流量,包括以下至少一项:确定所述第二时间段内的数据处理请求的总数量大于设定的数量阈值;确定所述第二时间段内的数据处理请求的总带宽大于设定的带宽阈值;确定所述第二时间段内的数据处理请求的数量的增量大于设定的增量阈值;确定所述第二时间段内的数据处理请求的数量的增速大于设定的增速阈值。In a possible design, determining that there is the burst traffic according to the data processing requests in the second time period includes at least one of the following: determining the total number of data processing requests in the second time period greater than the set threshold; determine that the total bandwidth of the data processing requests within the second time period is greater than the set bandwidth threshold; determine that the increment of the number of data processing requests within the second time period is greater than the set Increment threshold: determining that the growth rate of the number of data processing requests within the second time period is greater than a set growth rate threshold.
在该方法中,突发流量的特性是包含的数据处理请求的数量大、数据处理请求的数量在短时间内增长快。因此,基于能够反映突发流量特性的、多方面的信息,对第二时间段内的数据处理请求进行分析,可以更为准确的对突发流量进行识别,从而可以针对突发流量进行更精确的控制。In this method, the burst traffic is characterized by a large number of data processing requests, and the number of data processing requests increases rapidly in a short period of time. Therefore, based on the multi-faceted information that can reflect the characteristics of the burst traffic, analyzing the data processing requests in the second time period can identify the burst traffic more accurately, so that the burst traffic can be more accurately identified. control.
在一种可能的设计中,预测到在第一时间段内存在突发流量,包括:利用设定的流量预测模型,根据目标历史时间段内的数据处理请求,预测到在所述第一时间段内存在突发流量;其中,所述流量预测模型是通过机器学习和/或模型训练得到的;或者,根据来自上层应用的突发流量预测信息,预测到在所述第一时间段内存在突发流量;其中,所述突发流量预测信息用于指示:预测到在所述第一时间段内存在突发流量。In a possible design, predicting that there is a burst traffic in the first time period includes: using the set traffic forecasting model, according to the data processing request in the target historical time period, predicting that the burst traffic in the first time period There is a burst traffic in the segment; wherein, the traffic prediction model is obtained through machine learning and/or model training; or, according to the burst traffic prediction information from the upper layer application, it is predicted that there is a burst traffic in the first time period Burst traffic; wherein, the burst traffic prediction information is used to indicate: it is predicted that there is burst traffic within the first time period.
在该方法中,利用设定的流量预测模型对突发流量进行预测,可以提高突发流量预测的准确度,同时能够适应多种不同场景下的突发流量的预测,通用性较好。控制器根据来自上层应用的指示确定预测到突发流量,则可以将突发流量的预测过程转移到上层应用,进而简化控制器的处理流程,提高处理速率。In this method, using the set traffic prediction model to predict the burst traffic can improve the accuracy of burst traffic prediction, and at the same time, it can adapt to the prediction of burst traffic in many different scenarios, and has good versatility. When the controller determines that the burst traffic is predicted according to the instruction from the upper-layer application, the prediction process of the burst traffic can be transferred to the upper-layer application, thereby simplifying the processing flow of the controller and increasing the processing rate.
在一种可能的设计中,所述存储装置为固态硬盘。In a possible design, the storage device is a solid state disk.
第二方面,本申请提供一种存储装置的控制装置,所述控制装置应用于所述存储装置中的控制器,其中,所述存储装置还包括存储阵列;所述控制装置包括:预测模块,用于预测到在第一时间段内存在突发流量;处理模块,用于在所述第一时间段之前,增加分配给GC操作的带宽资源,以及利用第一带宽资源执行所述GC操作,得到所述存储阵列中的第一可用存储空间;其中,所述突发流量包含第一数量的数据处理请求,所述第一数量大于所述存储装置每秒钟能够响应的数据处理请求的数量;所述第一带宽资源为分配给所述GC操作的带宽资源。In a second aspect, the present application provides a control device for a storage device, the control device is applied to a controller in the storage device, wherein the storage device further includes a storage array; the control device includes: a prediction module, It is used to predict that there is a burst traffic within the first time period; the processing module is used to increase the bandwidth resource allocated to the GC operation before the first time period, and use the first bandwidth resource to perform the GC operation, obtaining a first available storage space in the storage array; wherein, the burst flow includes a first number of data processing requests, and the first number is greater than the number of data processing requests that the storage device can respond to per second ; The first bandwidth resource is a bandwidth resource allocated to the GC operation.
在一种可能的设计中,所述处理模块还用于:当确定存在所述突发流量时,将所述第一可用存储空间分配给所述突发流量对应的输入输出IO操作。In a possible design, the processing module is further configured to: when it is determined that the burst traffic exists, allocate the first available storage space to an input/output IO operation corresponding to the burst traffic.
在一种可能的设计中,当所述预测模块预测到在第一时间段内存在突发流量时,所述处理模块还用于:调高所述GC操作的启动阈值;其中,当所述存储阵列中的可用存储空间小于所述启动阈值时,启动所述GC操作。In a possible design, when the prediction module predicts that there is a burst traffic within the first time period, the processing module is further configured to: increase the startup threshold of the GC operation; wherein, when the When the available storage space in the storage array is less than the startup threshold, the GC operation is started.
在一种可能的设计中,当所述预测模块预测到在第一时间段内存在突发流量时,所述处理模块还用于:基于所述突发流量对应的IO操作所需的存储空间和所述第一带宽资源确定第一目标时刻;在所述第一目标时刻到来时,调高所述GC操作的启动阈值;其中,当所述存储阵列中的可用存储空间小于所述启动阈值时,启动所述GC操作。In a possible design, when the prediction module predicts that there is a burst traffic within the first time period, the processing module is further configured to: based on the storage space required for the IO operation corresponding to the burst traffic Determine a first target time with the first bandwidth resource; when the first target time arrives, increase the start threshold of the GC operation; wherein, when the available storage space in the storage array is less than the start threshold , start the GC operation.
在一种可能的设计中,所述处理模块还用于:当确定存在所述突发流量时,调低所述GC操作的启动阈值;或者,若预测的所述突发流量在第二目标时刻没有到来,则调低所述GC操作的启动阈值;其中,所述第二目标时刻为所述第一时间段内的任一时刻。In a possible design, the processing module is further configured to: when it is determined that the burst traffic exists, lower the start threshold of the GC operation; or, if the predicted burst traffic is within the second target If the time has not arrived, lower the start threshold of the GC operation; wherein, the second target time is any time within the first time period.
在一种可能的设计中,所述处理模块还用于:在确定存在所述突发流量之前,当所述第一可用存储空间达到目标值时,将第二带宽资源分配给当前数据处理请求对应的IO操作,以及将第三带宽资源分配给所述GC操作;其中,所述目标值大于或等于所述突发流量对应的IO操作所需的存储空间;所述第二带宽资源的大小与所述存储阵列中的可用存储空间的大小具有正相关关系,所述第三带宽资源的大小与所述存储阵列中的可用存储空间的大小具有负相关关系。In a possible design, the processing module is further configured to: allocate a second bandwidth resource to the current data processing request when the first available storage space reaches a target value before determining that the burst traffic exists The corresponding IO operation, and assigning the third bandwidth resource to the GC operation; wherein, the target value is greater than or equal to the storage space required for the IO operation corresponding to the burst traffic; the size of the second bandwidth resource There is a positive correlation with the size of the available storage space in the storage array, and the size of the third bandwidth resource has a negative correlation with the size of the available storage space in the storage array.
在一种可能的设计中,所述第二带宽资源符合以下公式:In a possible design, the second bandwidth resource complies with the following formula:
BW 1=BW 2×S 1/S th BW 1 =BW 2 ×S 1 /S th
其中,所述BW 1为所述第二带宽资源,所述BW 2为所述控制器能够使用的总带宽资源,所述S 1为所述存储阵列中的可用存储空间,所述S th为所述GC操作的启动阈值。 Wherein, the BW 1 is the second bandwidth resource, the BW 2 is the total bandwidth resource that the controller can use, the S 1 is the available storage space in the storage array, and the S th is The start threshold for the GC operation.
在一种可能的设计中,所述目标值为第一参数与第二参数之和,所述第一参数为所述 突发流量对应的IO操作所需的存储空间,所述第二参数为当预测到在第一时间段内存在突发流量时所述存储阵列中的可用存储空间。In a possible design, the target value is the sum of the first parameter and the second parameter, the first parameter is the storage space required for the IO operation corresponding to the burst traffic, and the second parameter is The available storage space in the storage array when it is predicted that there is a burst traffic within the first time period.
在一种可能的设计中,所述突发流量对应的IO操作所需的存储空间符合以下公式:In a possible design, the storage space required for the IO operation corresponding to the burst traffic conforms to the following formula:
S 2=BW 3×T S 2 =BW 3 ×T
其中,所述S 2为所述突发流量对应的IO操作所需的存储空间,所述BW 3为传输所述突发流量所需的带宽资源,所述T为所述突发流量的持续时长。 Wherein, the S 2 is the storage space required for the IO operation corresponding to the burst traffic, the BW 3 is the bandwidth resource required for transmitting the burst traffic, and the T is the duration of the burst traffic duration.
在一种可能的设计中,所述处理模块在确定存在所述突发流量时,具体用于:在第二时间段结束后,根据所述第二时间段内的数据处理请求,确定存在所述突发流量;其中,所述第二时间段的时长小于设定阈值,所述第二时间段的结束时刻在所述第一时间段的结束时刻之前。In a possible design, when the processing module determines that the burst traffic exists, it is specifically configured to: after the end of the second time period, according to the data processing request in the second time period, determine that the burst traffic exists. The burst traffic; wherein, the duration of the second time period is less than a set threshold, and the end moment of the second time period is before the end moment of the first time period.
在一种可能的设计中,所述处理模块在根据所述第二时间段内的数据处理请求,确定存在所述突发流量时,具体用于执行以下至少一项:确定所述第二时间段内的数据处理请求的总数量大于设定的数量阈值;确定所述第二时间段内的数据处理请求的总带宽大于设定的带宽阈值;确定所述第二时间段内的数据处理请求的数量的增量大于设定的增量阈值;确定所述第二时间段内的数据处理请求的数量的增速大于设定的增速阈值。In a possible design, when the processing module determines that the burst traffic exists according to the data processing request within the second time period, it is specifically configured to perform at least one of the following: determine the second time The total number of data processing requests in the segment is greater than the set threshold; determine that the total bandwidth of the data processing requests in the second time period is greater than the set bandwidth threshold; determine the data processing requests in the second time period The increment of the quantity is greater than the set increment threshold; it is determined that the increase of the quantity of data processing requests within the second time period is greater than the set increase threshold.
在一种可能的设计中,所述预测模块在预测到在第一时间段内存在突发流量时,具体用于:利用设定的流量预测模型,根据目标历史时间段内的数据处理请求,预测到在所述第一时间段内存在突发流量;其中,所述流量预测模型是通过机器学习和/或模型训练得到的;或者,根据来自上层应用的突发流量预测信息,预测到在所述第一时间段内存在突发流量;其中,所述突发流量预测信息用于指示:预测到在所述第一时间段内存在突发流量。In a possible design, when the prediction module predicts that there is a burst traffic in the first time period, it is specifically configured to: use the set traffic prediction model to process the request according to the data in the target historical time period, It is predicted that there is a burst traffic within the first time period; wherein, the traffic prediction model is obtained through machine learning and/or model training; or, according to the burst traffic prediction information from the upper layer application, it is predicted that the There is a burst traffic in the first time period; wherein, the burst traffic prediction information is used to indicate: it is predicted that there is a burst traffic in the first time period.
在一种可能的设计中,所述存储装置为固态硬盘。In a possible design, the storage device is a solid state disk.
第三方面,本申请提供一种存储装置,所述存储装置包括控制器和存储阵列;所述存储阵列用于存储数据;所述控制器用于对所述存储装置执行上述第一方面或第一方面的任一可能的设计所描述的方法。In a third aspect, the present application provides a storage device, which includes a controller and a storage array; the storage array is used to store data; and the controller is used to perform the above-mentioned first aspect or the first Aspects of any possible design of the described method.
在一种可能的设计中,所述存储装置为固态硬盘。In a possible design, the storage device is a solid state disk.
第四方面,本申请提供一种计算设备,所述计算设备包括上述第二方面或第二方面的任一可能的设计所描述的存储装置,或者,所述计算设备包括上述第三方面或第三方面的任一可能的设计所描述的存储装置。In a fourth aspect, the present application provides a computing device, which includes the storage device described in the above-mentioned second aspect or any possible design of the second aspect, or, the computing device includes the above-mentioned third aspect or the storage device described in any possible design of the second aspect. Any possible design of the storage device described in the three aspects.
在一种可能的设计中,所述存储装置为固态硬盘。In a possible design, the storage device is a solid state disk.
第五方面,本申请提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机指令,当所述计算机指令在计算机或处理器上运行时,使得所述计算机或所述处理器执行上述第一方面或第一方面的任一可能的设计所描述的方法。In a fifth aspect, the present application provides a computer-readable storage medium, the computer-readable storage medium stores computer instructions, and when the computer instructions are run on a computer or a processor, the computer or the processor Execute the method described in the first aspect or any possible design of the first aspect.
第六方面,本申请提供一种计算机程序产品,当所述计算机程序产品在计算机或处理器上运行时,使得所述计算机或所述处理器执行上述第一方面或第一方面的任一可能的设计所描述的方法。In a sixth aspect, the present application provides a computer program product. When the computer program product runs on a computer or a processor, the computer or the processor executes any of the above-mentioned first aspect or any possibility of the first aspect The design of the described method.
上述第二方面到第六方面的有益效果,请参见上述第一方面的有益效果的描述,这里不再重复赘述。For the beneficial effects of the above-mentioned second aspect to the sixth aspect, please refer to the description of the above-mentioned beneficial effects of the first aspect, which will not be repeated here.
附图说明Description of drawings
图1为本申请实施例提供的方案的一种可能的应用系统的架构示意图;FIG. 1 is a schematic structural diagram of a possible application system of the solution provided by the embodiment of the present application;
图2为本申请实施例提供的一种存储装置的控制方法的示意图;FIG. 2 is a schematic diagram of a method for controlling a storage device provided in an embodiment of the present application;
图3为本申请实施例提供的一种存储装置的控制方法的流程示意图;FIG. 3 is a schematic flowchart of a method for controlling a storage device provided in an embodiment of the present application;
图4a为本申请实施例提供的一种SSD的控制方式的示意图;FIG. 4a is a schematic diagram of an SSD control method provided by an embodiment of the present application;
图4b为本申请实施例提供的另一种SSD的控制方式的示意图;Fig. 4b is a schematic diagram of another SSD control mode provided by the embodiment of the present application;
图4c为本申请实施例提供的又一种SSD的控制方式的示意图;Fig. 4c is a schematic diagram of another SSD control mode provided by the embodiment of the present application;
图5为本申请实施例提供的一种不同阶段下IO操作对应的带宽资源的示意图;FIG. 5 is a schematic diagram of bandwidth resources corresponding to IO operations at different stages provided by an embodiment of the present application;
图6为本申请实施例提供的一种存储装置的示意图。FIG. 6 is a schematic diagram of a storage device provided by an embodiment of the present application.
具体实施方式Detailed ways
为了使本申请实施例的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施例作进一步地详细描述。其中,在本申请实施例的描述中,以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。In order to make the purpose, technical solutions, and advantages of the embodiments of the present application clearer, the embodiments of the present application will be further described in detail below in conjunction with the accompanying drawings. Among them, in the description of the embodiments of the present application, the terms "first" and "second" are used for description purposes only, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features . Thus, a feature defined as "first" and "second" may explicitly or implicitly include one or more of these features.
为了便于理解,示例性的给出了与本申请相关概念的说明以供参考。In order to facilitate understanding, descriptions of concepts related to the present application are provided as examples for reference.
1)固态硬盘,是用固态电子存储芯片阵列制成的硬盘,又称固态驱动器。固态硬盘中一般至少包括控制器和存储阵列两部分,控制器可以用于对固态硬盘进行控制。存储阵列用于提供固态硬盘的存储区域,可以存储数据。1) Solid-state hard disk is a hard disk made of solid-state electronic memory chip array, also known as solid-state drive. A solid state disk generally includes at least two parts, a controller and a storage array, and the controller can be used to control the solid state disk. The storage array is used to provide the storage area of the solid-state disk, which can store data.
固态硬盘采用闪存作为存储介质时,存储阵列中通常包括几十、几百甚至上千块闪存,每块闪存可以包括几百到几千个闪存块,每个闪存块里可以包括几千个闪存页。闪存有读、写、擦除三种基本操作,其中,读操作和写操作的操作粒度为一个闪存页,擦除操作的操作粒度为一个闪存块,因此闪存具有异地更新和非对称读写擦时延的特性。When flash memory is used as the storage medium for solid-state drives, the storage array usually includes dozens, hundreds or even thousands of flash memories, and each flash memory may include hundreds to thousands of flash memory blocks, and each flash memory block may include thousands of flash memory blocks. Page. Flash memory has three basic operations: read, write, and erase. Among them, the operation granularity of read operation and write operation is a flash memory page, and the operation granularity of erase operation is a flash memory block. Therefore, flash memory has remote update and asymmetric read/write erase. Latency characteristics.
为了更好地使用闪存,固态硬盘中配备了闪存转换层(flash translation layer,FTL)映射表和GC操作的算法,以保证持续高效的写入性能。In order to make better use of flash memory, solid-state drives are equipped with flash translation layer (flash translation layer, FTL) mapping tables and GC operation algorithms to ensure continuous and efficient write performance.
FTL映射表为地址转换表,用于指示数据的逻辑地址和物理地址的映射关系。其中,逻辑地址为写到闪存前系统为数据生成的地址,而物理地址为写入闪存后的地址。当数据处理请求(或用户请求)下发到固态硬盘后,固态硬盘通过FTL映射表可以确定该数据处理请求对应的闪存中的物理地址。若该数据处理请求是读请求(用于请求进行读操作),则将闪存中对应的物理地址的数据读出;若该数据处理请求是写请求(用于请求执行写操作),且该写操作为初次写入某一数据,则将该数据写入闪存中的空白物理地址;若该数据处理请求是请求执行写操作,且该写操作用于对已存储的某一数据进行更新,则标记该数据在闪存中对应的物理地址为无效,并将该数据对应的更新后的数据写入闪存中的空白物理地址,接着更新FTL映射表中对应的地址映射关系,即完成操作。若该数据处理请求是擦除请求(用于请求执行擦除操作),则将闪存中对应的物理地址的数据删除,并删除FTL映射表中对应的地址映射关系。The FTL mapping table is an address translation table, which is used to indicate a mapping relationship between a logical address of data and a physical address. Among them, the logical address is the address generated by the system for the data before writing to the flash memory, and the physical address is the address after writing to the flash memory. After the data processing request (or user request) is sent to the solid-state hard disk, the solid-state hard disk can determine the physical address in the flash memory corresponding to the data processing request through the FTL mapping table. If the data processing request is a read request (for requesting a read operation), the data at the corresponding physical address in the flash memory is read out; if the data processing request is a write request (for requesting to perform a write operation), and the write If the operation is to write a certain data for the first time, write the data to a blank physical address in the flash memory; if the data processing request is a request to perform a write operation, and the write operation is used to update a stored data, then Mark the corresponding physical address of the data in the flash memory as invalid, and write the updated data corresponding to the data into the blank physical address in the flash memory, and then update the corresponding address mapping relationship in the FTL mapping table to complete the operation. If the data processing request is an erasing request (for requesting to perform an erasing operation), the data of the corresponding physical address in the flash memory is deleted, and the corresponding address mapping relationship in the FTL mapping table is deleted.
在本申请实施例中,数据处理请求可以简称为输入输出(input/output,IO)或IO请求。In this embodiment of the present application, the data processing request may be referred to as an input/output (input/output, IO) or an IO request for short.
GC操作是当存储阵列中的可用存储空间(空白存储空间或空闲存储空间)小于启动阈值(称为GC水线)时,选择一个闪存块回收,其具体操作为读出选择的闪存块中的有效数据并迁移入可用存储空间中的闪存页中,然后擦除该闪存块中的内容,从而通过GC 操作回收该闪存块对应的存储空间。当通过GC操作使得存储阵列中的可用存储空间大于或等于该启动阈值时,GC操作停止执行。The GC operation is to select a flash memory block to reclaim when the available storage space (blank storage space or free storage space) in the storage array is less than the startup threshold (called the GC watermark), and the specific operation is to read the data in the selected flash block. Valid data is migrated into the flash page in the available storage space, and then the content in the flash block is erased, so that the storage space corresponding to the flash block is reclaimed through GC operation. When the available storage space in the storage array is greater than or equal to the startup threshold through the GC operation, the GC operation stops execution.
2)IO(或IO请求),指其它装置(例如主机设备)下发到存储装置的数据处理请求。示例性的,IO可以包括读请求、写请求、擦除请求中的至少一项。2) IO (or IO request) refers to a data processing request sent to the storage device by other devices (such as a host device). Exemplarily, the IO may include at least one of a read request, a write request, and an erase request.
以存储装置为固态硬盘为例,按照固态硬盘的盘片能力,可以将在一段时间内出现的IO定义为两种情况:常规流量和突发流量。其中,常规流量小于固态硬盘的盘片能力,为数据处理请求少的场景,此时固态硬盘可以及时的处理主机的所有请求。而突发流量大于固态硬盘的盘片能力,为数据处理请求多的场景,此时固态硬盘只能分批次响应突发流量中的数据处理请求,因此可能会导致请求响应超时的现象。Taking the storage device as an example of a solid-state hard disk, according to the disk capacity of the solid-state hard disk, the IO that occurs within a period of time can be defined as two situations: regular traffic and burst traffic. Among them, the regular traffic is smaller than the disk capacity of the solid-state hard disk, which is a scenario with few data processing requests. At this time, the solid-state hard disk can process all the requests of the host in a timely manner. However, the burst traffic is greater than the disk capacity of the solid-state hard disk, which is a scenario where there are many data processing requests. At this time, the solid-state hard disk can only respond to the data processing requests in the burst traffic in batches, which may cause request response timeouts.
在本申请实施例中,IO操作指固态硬盘根据接收到的IO执行对应操作的过程,是固态硬盘在响应IO时执行的操作。例如,IO操作可以包括读操作、写操作、擦除操作中的至少一项。In the embodiment of the present application, the IO operation refers to the process in which the solid state disk performs corresponding operations according to the received IO, and is the operation performed by the solid state disk when responding to the IO. For example, the IO operation may include at least one of a read operation, a write operation, and an erase operation.
3)带宽,指单位时间内能传输的数据量,带宽可用于标识装置、器件或通信线路的数据传输能力,通常以每秒可传输的比特数或位数(bps)表示。3) Bandwidth refers to the amount of data that can be transmitted per unit time. Bandwidth can be used to identify the data transmission capabilities of devices, devices or communication lines, usually expressed in bits or bits per second (bps) that can be transmitted.
通常情况下,存储装置的带宽是固定的。控制器在控制执行IO操作或GC操作的过程中,可以通过控制使用带宽的频率,实现在不同的带宽能力下执行IO操作或GC操作的效果。因此,在本申请实施中,带宽资源指通过改变使用带宽的频率所实现的带宽能力(或数据传输能力)。将带宽资源分配给IO操作或GC操作指:通过为IO操作或GC操作配置在操作执行过程中使用带宽的频率,来为IO操作或GC操作配置对应的带宽能力,使得IO操作或GC操作在相应的带宽能力下执行。Typically, the bandwidth of a storage device is fixed. In the process of controlling the execution of the IO operation or the GC operation, the controller can control the frequency of using the bandwidth to realize the effect of executing the IO operation or the GC operation under different bandwidth capabilities. Therefore, in the implementation of this application, the bandwidth resource refers to the bandwidth capability (or data transmission capability) realized by changing the frequency of using the bandwidth. Allocating bandwidth resources to IO operations or GC operations means: by configuring IO operations or GC operations to use bandwidth frequencies during operation execution, to configure corresponding bandwidth capabilities for IO operations or GC operations, so that IO operations or GC operations Execute under the corresponding bandwidth capability.
此外,本申请实施例中,存储装置的带宽资源与存储装置的IOPS(即存储装置每秒钟能够响应的数据处理请求的数量)之间可以互相转换。In addition, in the embodiment of the present application, the bandwidth resources of the storage device and the IOPS of the storage device (that is, the number of data processing requests that the storage device can respond to per second) can be converted to each other.
应理解,本申请实施例中“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一(项)个”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a、b或c中的至少一项(个),可以表示:a,b,c,a和b,a和c,b和c,或a、b和c,其中a、b、c可以是单个,也可以是多个。It should be understood that "at least one" in the embodiments of the present application refers to one or more, and "multiple" refers to two or more. "And/or" describes the association relationship of associated objects, indicating that there may be three types of relationships, for example, A and/or B, which can mean: A exists alone, A and B exist simultaneously, and B exists alone, where A, B can be singular or plural. The character "/" generally indicates that the contextual objects are an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single item(s) or plural item(s). For example, at least one item (unit) of a, b or c can represent: a, b, c, a and b, a and c, b and c, or a, b and c, wherein a, b, c Can be single or multiple.
当前,如果固态硬盘的IO访问量小于其盘片能力(即常规流量场景),固态硬盘可将对应的IO操作按时执行完毕。并且,基于当前的IO操作和GC操作的资源分配方式,固态硬盘中分配的带宽资源也能维持稳定的可用存储空间。但是,如果IO访问量超出其盘片能力(即突发流量场景),固态硬盘在执行对应的IO操作时便需要较长的等待时间,可能会导致响应超时。并且,基于当前的IO操作和GC操作的资源分配方式,固态硬盘中分配的带宽资源无法维持IO操作所占存储空间与GC释放的存储空间之间的相对稳定,因此无法维持稳定的可用存储空间,甚至可能存在可用存储空间被IO操作消耗完的情况,则会影响固态硬盘的存储性能和稳定性。Currently, if the IO access volume of the solid state drive is less than its disk capacity (that is, the normal traffic scenario), the solid state drive can complete the corresponding IO operations on time. Moreover, based on the current resource allocation methods for IO operations and GC operations, the bandwidth resources allocated in the SSD can also maintain a stable available storage space. However, if the IO access volume exceeds the capacity of the disk (that is, the burst traffic scenario), the solid state disk will need a long waiting time when performing the corresponding IO operation, which may cause a response timeout. Moreover, based on the current resource allocation methods for IO operations and GC operations, the bandwidth resources allocated in SSDs cannot maintain the relative stability between the storage space occupied by IO operations and the storage space released by GC, so it is impossible to maintain a stable available storage space , and there may even be a situation where the available storage space is consumed by IO operations, which will affect the storage performance and stability of the SSD.
目前,一种控制GC操作的资源的方法是根据IO操作的需求启停GC操作,达成优先响应IO的效果。具体的,当突发流量来临时可以停止GC操作,从而将全部资源给IO操 作使用,当突发流量结束后,再启动GC操作回收存储空间。但是该方案只考虑IO需求而未考虑存储空间的实际情况,无法维持相对稳定的可用存储空间。并且,当可用存储空间较小,而突发流量持续时间较长时,可能导致可用存储空间耗光,造成系统崩溃。因此,该方案的可实施性很差。At present, a method for controlling the resource of GC operation is to start and stop GC operation according to the requirement of IO operation, so as to achieve the effect of responding to IO first. Specifically, when the burst traffic comes, the GC operation can be stopped, so that all resources can be used for IO operations, and when the burst traffic ends, the GC operation can be started to reclaim the storage space. However, this solution only considers IO requirements without considering the actual situation of storage space, and cannot maintain a relatively stable available storage space. Moreover, when the available storage space is small and the burst traffic lasts for a long time, the available storage space may be exhausted and the system may crash. Therefore, the implementability of this scheme is very poor.
为了提高固态硬盘的系统稳定性,本申请实施例提供了一种存储装置的控制方法,其中,该存储装置具备进行GC操作和IO操作的能力。可选的,该存储装置可以为固态硬盘。在该方法中,存储装置可以调节GC操作的启动阈值,这样存储装置可以在调高该启动阈值后,通过执行GC操作使存储装置中能够始终保持一个较大的可用存储空间,同时,存储装置可以结合IO操作的需求启停GC操作。这样,在突发流量到来前,存储装置可以先通过调高GC操作的启动阈值而保持的一个较大的可用存储空间,在突发流量到来时该可用存储空间可以供给IO操作使用,从而避免IO操作将可用存储空间消耗完,同时又能避免GC操作与IO操作争抢资源,提高IO操作的执行效率。In order to improve the system stability of the solid state disk, an embodiment of the present application provides a method for controlling a storage device, wherein the storage device is capable of performing GC operations and IO operations. Optionally, the storage device may be a solid state disk. In this method, the storage device can adjust the startup threshold of the GC operation, so that the storage device can always maintain a larger available storage space in the storage device by performing the GC operation after the startup threshold is increased, and at the same time, the storage device The GC operation can be started and stopped according to the requirements of the IO operation. In this way, before the burst traffic comes, the storage device can maintain a larger available storage space by increasing the start threshold of the GC operation. When the burst traffic comes, the available storage space can be used for IO operations, thereby avoiding The IO operation will consume the available storage space, and at the same time, it can avoid the GC operation and the IO operation from competing for resources, and improve the execution efficiency of the IO operation.
上述方案中,调高GC操作的启动阈值后,存储装置在常规流量场景下可以一直保持较大的可用存储空间,在突发流量场景下,存储装置响应突发流量时可以使用该可用存储空间,从而避免导致存储装置的存储系统崩溃,提高其稳定性。但是,上述方案中将GC操作的启动阈值调高,会造成GC操作的频繁执行,而GC操作执行过程中需要搬移有效闪存页,使得存储装置的擦写负担加重,又会引起存储装置寿命亏损的问题。In the above solution, after increasing the startup threshold of the GC operation, the storage device can always maintain a large available storage space in the normal traffic scenario, and in the burst traffic scenario, the storage device can use the available storage space when responding to the burst traffic , so as to prevent the storage system of the storage device from collapsing and improve its stability. However, in the above solution, increasing the startup threshold of GC operation will cause frequent execution of GC operation, and valid flash memory pages need to be moved during the execution of GC operation, which will increase the burden of erasing and writing of the storage device, and will cause the life of the storage device to be lost. The problem.
鉴于此,本申请实施例还提供另一种存储装置的控制方法,用于对存储装置的IO操作和GC操作的资源分配和执行过程等进行控制,使得存储装置能够在及时响应大量IO的同时,维持一定的可用存储空间,进而保证存储装置的正常工作性能,并进一步提高存储装置的运行稳定性及存储性能。In view of this, the embodiment of the present application also provides another storage device control method, which is used to control the resource allocation and execution process of IO operations and GC operations of the storage device, so that the storage device can respond to a large number of IOs in a timely manner. To maintain a certain available storage space, thereby ensuring the normal working performance of the storage device, and further improving the operation stability and storage performance of the storage device.
图1为本申请实施例提供的方案的一种可能的应用系统的架构示意图。如图1所示,该系统中至少包括存储装置,该存储装置包括控制器和存储阵列,控制器用于对存储装置进行控制,存储阵列用于提供存储装置的存储空间。可选的,该存储装置可以为固态硬盘。FIG. 1 is a schematic structural diagram of a possible application system of the solution provided by the embodiment of the present application. As shown in FIG. 1 , the system includes at least a storage device, the storage device includes a controller and a storage array, the controller is used to control the storage device, and the storage array is used to provide storage space for the storage device. Optionally, the storage device may be a solid state disk.
可选的,该系统中还可以包括主机(host)设备。主机设备可以与存储装置进行通信,并可以对存储装置进行一些控制,存储装置也可以响应来自主机设备的数据处理请求(IO/IOs)。可选的,该存储装置可以部署在主机设备中。Optionally, the system may also include a host (host) device. The host device can communicate with the storage device and can perform some control over the storage device, and the storage device can also respond to data processing requests (IO/IOs) from the host device. Optionally, the storage device may be deployed in the host device.
在存储装置中,控制器可以进一步包括统计模块、调制模块和GC模块。其中,统计模块可以用于统计当前的流量信息、可用存储空间的情况等,并将统计到的信息发送到调控模块。调控模块可以用于执行本申请实施例提供的控制方法,主要包括根据当前和未来的流量信息以及可用存储空间的信息计算特定条件下的GC操作的启动阈值、分配IO操作和GC操作的带宽资源、对IO操作和GC操作的执行进行控制等等。GC模块用于根据调制模块的控制执行GC操作。In the storage device, the controller may further include a statistics module, a modulation module and a GC module. Wherein, the statistical module can be used to count current traffic information, available storage space, etc., and send the counted information to the control module. The regulation module can be used to implement the control method provided by the embodiment of the present application, mainly including calculating the start threshold of GC operation under specific conditions according to current and future traffic information and information of available storage space, and allocating bandwidth resources for IO operation and GC operation , Control the execution of IO operations and GC operations, etc. The GC module is used to perform GC operations under the control of the modulation module.
在一种可能的方案中,控制器可以进一步包括预测模块。预测模块可以用于根据存储装置的历史流量信息,预测未来的流量信息,并将预测的未来的流量信息发送到调控模块,使得调控模块可以获取到未来的流量信息。In a possible solution, the controller may further include a prediction module. The prediction module can be used to predict future traffic information according to the historical traffic information of the storage device, and send the predicted future traffic information to the control module, so that the control module can obtain the future traffic information.
在另一种可能的方案中,主机设备中的上层应用可以在获取存储装置的历史流量信息后,对其未来的流量信息进行预测,并将预测的未来的流量信息发送到存储装置的控制器。 则控制器中的调控模块也可以获取到来自上层应用的、未来的流量信息。In another possible solution, the upper layer application in the host device can predict its future traffic information after obtaining the historical traffic information of the storage device, and send the predicted future traffic information to the controller of the storage device . Then the control module in the controller can also obtain the future traffic information from the upper layer application.
在一种可能的方式中,上层应用或预测模块可以将存储装置的IOPS转换为带宽需求后发送给存储装置的控制器。In a possible manner, the upper layer application or prediction module may convert the IOPS of the storage device into a bandwidth requirement and send it to the controller of the storage device.
在存储装置中,存储阵列是数据最终存储的物理载体。示例性的,存储阵列可以采用与非门(NAND)类型的闪存,并可以包括多个闪存阵列(flash array)。其中,每个闪存阵列可以作为一个NAND闪存颗粒(闪存介质颗粒),因此存储阵列相当于NAND闪存颗粒组。In the storage device, the storage array is the physical carrier for the final storage of data. Exemplarily, the storage array may use NAND flash memory, and may include multiple flash memory arrays (flash array). Wherein, each flash memory array can be used as a NAND flash memory particle (flash memory medium particle), so the storage array is equivalent to a NAND flash memory particle group.
需要说明的是,上述系统架构仅是对本申请方案适用的系统架构的一种示例性说明,并不对本申请方案适用的系统架构造成限制。上述系统架构中也可以增加其它的装置或模块,或者减少、修改部分装置或模块。It should be noted that the above system architecture is only an exemplary description of the system architecture applicable to the solution of this application, and does not limit the system architecture applicable to the solution of this application. Other devices or modules may also be added to the above system architecture, or some devices or modules may be reduced or modified.
下面结合具体实施例对本申请提供的方案进行介绍。The solution provided by the present application will be introduced below in combination with specific embodiments.
图2为本申请实施例提供的一种存储装置的控制方法的示意图。如图2所示,该方法包括:FIG. 2 is a schematic diagram of a method for controlling a storage device provided by an embodiment of the present application. As shown in Figure 2, the method includes:
S201:当预测到在第一时间段内存在突发流量时,存储装置的控制器在所述第一时间段之前,增加分配给垃圾回收GC操作的带宽资源;其中,所述突发流量包含第一数量的数据处理请求,所述第一数量大于所述存储装置每秒钟能够响应的数据处理请求的数量。S201: When it is predicted that there is a burst traffic within the first time period, the controller of the storage device increases the bandwidth resources allocated to the garbage collection GC operation before the first time period; wherein the burst traffic includes A first number of data processing requests, the first number being greater than the number of data processing requests that the storage device can respond to per second.
其中,存储装置包括控制器和存储阵列,存储装置具备执行GC操作和IO操作的能力。可选的,所述存储装置为固态硬盘。Wherein, the storage device includes a controller and a storage array, and the storage device is capable of performing GC operations and IO operations. Optionally, the storage device is a solid state disk.
本申请实施例中,常规流量中包含的数据处理请求的数量小于或等于存储装置每秒钟能够响应的数据处理请求的数量,突发流量中包含的数据处理请求的数量大于存储装置每秒钟能够响应的数据处理请求的数量。In this embodiment of the application, the number of data processing requests included in the regular traffic is less than or equal to the number of data processing requests that the storage device can respond to per second, and the number of data processing requests included in the burst traffic is greater than the number of data processing requests that the storage device can respond to per second. The number of data processing requests that can be responded to.
在常规流量场景下,控制器为IO操作和GC操作分配带宽资源的方式可以是:为IO操作和GC操作分配相对应的带宽资源,使得存储装置运行过程中,能够维持IO操作所需的存储空间与GC操作回收得到的存储空间之间维持相对平衡,例如两个存储空间的大小的差距处于设定范围内。这样既能保证存储装置有足够的存储空间用于执行IO操作,又能尽可能避免GC操作的频繁执行对存储装置寿命的影响。In a normal traffic scenario, the way the controller allocates bandwidth resources for IO operations and GC operations can be: allocate corresponding bandwidth resources for IO operations and GC operations, so that the storage device can maintain the storage required for IO operations during the running process. A relative balance is maintained between the space and the storage space reclaimed by the GC operation, for example, the size difference between the two storage spaces is within the set range. In this way, it can not only ensure that the storage device has sufficient storage space for performing IO operations, but also avoid the impact of frequent execution of GC operations on the life of the storage device as much as possible.
在常规流量场景下,控制器根据上述方式进行控制的同时,对未来时间段内是否存在突发流量进行判断,以便据此调整控制方式。In the normal flow scenario, the controller performs control according to the above method, and at the same time, judges whether there is a burst flow in the future time period, so as to adjust the control method accordingly.
作为一种可选的实施方式,控制器可以根据历史时间段内接收的数据处理请求预测未来时间段内是否存在突发流量。具体的,控制器可以利用设定的流量预测模型,根据目标历史时间段内的数据处理请求,预测到在第一时间段内存在突发流量;其中,所述流量预测模型是通过机器学习和/或模型训练得到的,所述第一时间段为未来的某一时间段。可选的,所述流量预测模型可以是基于长短期记忆网络(long short-term memory,LSTM)的模型。As an optional implementation manner, the controller may predict whether there is a burst traffic in a future time period according to data processing requests received in a historical time period. Specifically, the controller can use the set traffic forecasting model to predict that there is a burst traffic in the first time period according to the data processing request in the target historical time period; wherein, the traffic forecasting model is based on machine learning and /or obtained by model training, the first time period is a certain time period in the future. Optionally, the traffic prediction model may be a model based on a long short-term memory network (long short-term memory, LSTM).
例如,该方案应用于图1所示的系统中时,控制器可以通过预测模块预测到在所述第一时间段内存在突发流量。For example, when this solution is applied to the system shown in FIG. 1 , the controller may predict that there is a burst traffic within the first time period through the prediction module.
作为另一种可选的实施方式,控制器可以根据来自上层应用的突发流量预测信息,预测到在所述第一时间段内存在突发流量;其中,所述突发流量预测信息用于指示:预测到在所述第一时间段内存在突发流量。可选的,所述上层应用可以利用上述的流量预测模型 预测到在所述第一时间段内存在突发流量,并指示给所述控制器。As another optional implementation manner, the controller may predict that there is a burst traffic within the first time period according to the burst traffic prediction information from the upper-layer application; wherein the burst traffic prediction information is used for Indication: It is predicted that there is a burst traffic within the first time period. Optionally, the upper-layer application may use the above-mentioned traffic prediction model to predict that there is a burst traffic within the first time period, and indicate it to the controller.
例如,该方案应用于图1所示的系统中时,未来流量的预测可以由主机设备完成,控制器可以直接根据主机设备中上层应用的指示,确定在所述第一时间段内存在突发流量。For example, when this solution is applied to the system shown in Figure 1, the prediction of future traffic can be completed by the host device, and the controller can directly determine that there is a burst in the first time period according to the instruction of the upper layer application in the host device. flow.
在本申请一些实施例中,预测到在所述第一时间段内存在的突发流量的信息可以包括:所述突发流量的预计到来时间(即所述第一时间段的起始时刻)、传输所述突发流量所需的带宽资源、所述突发流量的持续时长(即所述第一时间段的时长)。In some embodiments of the present application, the information of the predicted burst traffic within the first time period may include: the expected arrival time of the burst traffic (that is, the starting moment of the first time period) , the bandwidth resources required for transmitting the burst traffic, and the duration of the burst traffic (that is, the duration of the first time period).
上述控制器预测到在第一时间段内存在突发流量时,可以在上述常规流量场景下的带宽资源分配情况的基础上,增加分配给GC操作的带宽资源。例如,控制器可以将存储装置中富余的带宽资源增加分配给GC操作,从而加快存储空间的回收速率。When the above-mentioned controller predicts that there is a burst traffic in the first time period, it may increase the bandwidth resource allocated to the GC operation on the basis of the bandwidth resource allocation in the above-mentioned normal traffic scenario. For example, the controller may increase the allocation of surplus bandwidth resources in the storage device to GC operations, thereby speeding up the reclaiming rate of the storage space.
S202:控制器利用第一带宽资源执行所述GC操作,得到所述存储阵列中的第一可用存储空间,其中,所述第一带宽资源为分配给所述GC操作的带宽资源。S202: The controller uses a first bandwidth resource to execute the GC operation to obtain a first available storage space in the storage array, where the first bandwidth resource is a bandwidth resource allocated to the GC operation.
控制器增加分配给GC操作的带宽资源后,可以利用分配给GC操作的第一带宽资源执行GC操作,得到的第一可用存储空间。其中,第一可用存储空间大于常规流量场景下存储装置中能够维持的可用存储空间的大小。After the controller increases the bandwidth resource allocated to the GC operation, the controller may use the first bandwidth resource allocated to the GC operation to execute the GC operation to obtain the first available storage space. Wherein, the first available storage space is greater than the size of the available storage space that can be maintained in the storage device in a normal traffic scenario.
按照上述常规流量场景下的带宽资源分配方式,控制器仅需存储装置的带宽资源中的一部分带宽资源就能完成IO操作和GC操作,因此,存储装置的带宽资源会存在富余。基于此,当控制器预测到在所述第一时间段内存在突发流量时,可以在第一时间段之前,在上述常规流量场景下的带宽资源分配情况的基础上,进一步将存储装置中富余的部分或全部带宽资源增加分配给GC操作使用。控制器利用增加后的所有分配给GC操作的带宽资源执行所述GC操作,可以加快GC操作的执行速率,进而加快存储空间的回收速率,使得GC操作可以在第一时间段到来之前回收得到更多的存储空间。这样当所述突发流量到来时,存储装置中可以有更多的存储空间供IO操作使用,从而保证IO操作的及时执行,提高IO响应速度,并尽可能避免可用存储空间余量过小,提高存储装置的稳定性。According to the above-mentioned bandwidth resource allocation method in the conventional traffic scenario, the controller only needs a part of the bandwidth resources of the storage device to complete the IO operation and GC operation, therefore, the bandwidth resources of the storage device will have surplus. Based on this, when the controller predicts that there is a burst traffic within the first time period, it can further store the Some or all of the excess bandwidth resources are increased and allocated to GC operations. The controller uses all the increased bandwidth resources allocated to the GC operation to execute the GC operation, which can speed up the execution rate of the GC operation, thereby speeding up the recovery rate of the storage space, so that the GC operation can be recovered before the arrival of the first time period. Lots of storage space. In this way, when the burst traffic arrives, more storage space can be used for IO operations in the storage device, thereby ensuring timely execution of IO operations, improving IO response speed, and avoiding too small margin of available storage space as much as possible. Improve storage device stability.
进一步的,在上述步骤S201中,当预测到在第一时间段内存在突发流量时,控制器在所述第一时间段之前增加分配给垃圾回收GC操作的带宽资源的基础上,还可以在所述第一时间段之前,通过调高GC操作的启动阈值,对GC操作的启停进行控制。Further, in the above step S201, when it is predicted that there is a burst traffic within the first time period, the controller may increase the bandwidth resource allocated to the garbage collection GC operation before the first time period, and may also Before the first time period, the start and stop of the GC operation are controlled by increasing the start threshold of the GC operation.
在一种可能的方式中,控制器可以在预测到在所述第一时间段内存在突发流量时,就调高GC操作的启动阈值。其中,当所述存储阵列中的可用存储空间小于所述启动阈值时,启动所述GC操作。In a possible manner, the controller may increase the start threshold of the GC operation when it is predicted that there is a burst traffic within the first time period. Wherein, when the available storage space in the storage array is less than the startup threshold, the GC operation is started.
该方式中,通过调高GC操作的启动阈值,使得控制器能够通过执行GC操作得到一个较大的可用存储空间,还可以保证在通过执行GC操作得到一个较大的可用存储空间后,控制器还能通过执行GC操作维持得到的该可用存储空间。In this way, by increasing the start threshold of the GC operation, the controller can obtain a larger available storage space by executing the GC operation, and it can also ensure that after the execution of the GC operation obtains a larger available storage space, the controller will The available storage space obtained can also be maintained by performing GC operations.
在另一种可能的方式,控制器可以在预测到在所述第一时间段内存在突发流量时,基于所述突发流量对应的IO操作所需的存储空间和所述第一带宽资源确定第一目标时刻;并在所述第一目标时刻到来时,调高所述GC操作的启动阈值;其中,当所述存储阵列中的可用存储空间小于所述启动阈值时,启动所述GC操作。In another possible manner, when the controller predicts that there is a burst traffic within the first time period, based on the storage space required for the IO operation corresponding to the burst traffic and the first bandwidth resource determining a first target time; and when the first target time arrives, increasing the start threshold of the GC operation; wherein, when the available storage space in the storage array is less than the start threshold, start the GC operate.
具体的,控制器可以先根据预测到的传输所述突发流量所需的带宽资源以及所述突发流量的持续时长,计算所述突发流量对应的IO操作所需的存储空间。示例性的,可以按照如下公式进行计算:Specifically, the controller may first calculate the storage space required for the IO operation corresponding to the burst traffic according to the predicted bandwidth resources required for transmitting the burst traffic and the duration of the burst traffic. Exemplarily, it can be calculated according to the following formula:
S 2=BW 3×T S 2 =BW 3 ×T
其中,S 2为所述突发流量对应的IO操作所需的存储空间,BW 3为传输所述突发流量所需的带宽资源,T为所述突发流量的持续时长。 Wherein, S 2 is the storage space required for the IO operation corresponding to the burst traffic, BW 3 is the bandwidth resource required for transmitting the burst traffic, and T is the duration of the burst traffic.
然后,控制器可以根据所述突发流量对应的IO操作所需的存储空间以及增加的分配给GC操作的带宽资源,计算通过GC操作得到该存储空间时所需的时间。示例性的,可以按照如下公式进行计算:Then, the controller may calculate the time required to obtain the storage space through the GC operation according to the storage space required by the IO operation corresponding to the burst traffic and the increased bandwidth resource allocated to the GC operation. Exemplarily, it can be calculated according to the following formula:
T 1=S 2/BW 4 T 1 =S 2 /BW 4
其中,t 1为通过GC操作得到该存储空间时所需的时间,S 2为所述突发流量对应的IO操作所需的存储空间,BW 4为所述第一资源中增加的分配给所述GC操作的带宽资源。 Wherein, t 1 is the time required for obtaining the storage space through GC operation, S 2 is the storage space required for the IO operation corresponding to the burst traffic, and BW 4 is the additional allocation of the first resource to the Bandwidth resources for GC operations.
确定上述信息后,控制器可以计算确定所述第一目标时刻。具体的,控制器可以按照如下公式计算第一目标时刻与预测到所述第一时间段内存在突发流量的时刻之间的时长:After the above information is determined, the controller may calculate and determine the first target moment. Specifically, the controller may calculate the time length between the first target moment and the moment when it is predicted that there is a burst traffic within the first time period according to the following formula:
T 2=T 3-T 1T 2 =T 3 -T 1
其中,T 2为第一目标时刻与预测到所述第一时间段内存在突发流量的时刻之间的时长,T 3为所述第一时间段的起始时刻与预测到所述第一时间段内存在突发流量的时刻之间的时长,T 1为通过GC操作得到突发流量对应的IO操作所需存储空间时所需的时间,δ可以为设定时长,δ大于或等于0且小于或等于T 3-T 1Among them, T2 is the time length between the first target moment and the moment when the burst traffic is predicted in the first time period, T3 is the start moment of the first time period and the time when the first time period is predicted The length of time between the moments of burst traffic in the time period, T 1 is the time required to obtain the storage space required for the IO operation corresponding to the burst traffic through GC operations, δ can be the set duration, and δ is greater than or equal to 0 And less than or equal to T 3 -T 1 .
控制器计算得到T 2后,将预测到所述第一时间段内存在突发流量的时刻延后T 2,对应的时刻即为第一目标时刻。则可以在该第一目标时刻到来时,调高GC操作的启动阈值。 After calculating T 2 , the controller delays by T 2 the time when the burst traffic is predicted to exist in the first time period, and the corresponding time is the first target time. Then, when the first target time arrives, the start threshold of the GC operation can be increased.
该方式中,控制器可以根据额外分配给GC操作的带宽资源以及传输突发流量所需的带宽资源,确定通过GC操作得到能够用于处理突发流量的存储空间所需的时间T 1,再从突发流量的预估到来时间提前T 1对应的时刻起调高GC阈值,既可以最大限度的减少不必要的GC操作,降低对存储装置寿命的影响,又可以通过GC操作得到较大的存储空间,以供突发流量到来时使用。进一步的,在提前T 1的基础上增加一定的时间余量δ,能够进一步保证通过GC操作得到的存储空间足够供给突发流量到来时使用。 In this way, the controller can determine the time T 1 required to obtain the storage space that can be used to handle the burst traffic through the GC operation according to the additional bandwidth resources allocated to the GC operation and the bandwidth resources required to transmit the burst traffic, and then Adjusting the GC threshold from the time when the estimated arrival time of the burst traffic is ahead of T 1 can not only minimize unnecessary GC operations, reduce the impact on the life of the storage device, but also obtain a greater Storage space for use when burst traffic arrives. Furthermore, adding a certain time margin δ on the basis of advancing T 1 can further ensure that the storage space obtained through the GC operation is sufficient for the arrival of burst traffic.
在上述两种方式中,控制器调高GC操作的启动阈值时,可以将GC操作的启动阈值调为第一阈值。其中,第一阈值大于或等于目标值,目标值大于或等于所述突发流量对应的IO操作所需的存储空间。In the above two manners, when the controller increases the start threshold of the GC operation, the start threshold of the GC operation may be adjusted to the first threshold. Wherein, the first threshold is greater than or equal to a target value, and the target value is greater than or equal to the storage space required by the IO operation corresponding to the burst traffic.
示例性的,所述目标值可以为第一参数与第二参数之和,所述第一参数为所述突发流量对应的IO操作所需的存储空间,所述第二参数为当预测到在第一时间段内存在突发流量时所述存储阵列中的可用存储空间。所述第一阈值可以等于所述目标值或者略大于所述目标值。也就是说,目标值可以满足以下公式:S=S 2+S 3,其中,S为目标值,S 2为所述突发流量对应的IO操作所需的存储空间,S 3为当预测到在第一时间段内存在突发流量时所述存储阵列中的可用存储空间。第一阈值可以满足以下公式:N 1≥S,其中,N 1为第一阈值。 Exemplarily, the target value may be the sum of the first parameter and the second parameter, the first parameter is the storage space required for the IO operation corresponding to the burst traffic, and the second parameter is the predicted The available storage space in the storage array when there is a burst of traffic in the first time period. The first threshold may be equal to the target value or slightly greater than the target value. That is to say, the target value can satisfy the following formula: S=S 2 +S 3 , where S is the target value, S 2 is the storage space required for the IO operation corresponding to the burst traffic, and S 3 is the predicted The available storage space in the storage array when there is a burst of traffic in the first time period. The first threshold may satisfy the following formula: N 1 ≥ S, where N 1 is the first threshold.
进一步的,控制器基于上述方式为GC操作增加分配带宽资源并调高GC操作的启动阈值后,在根据步骤S202执行GC操作的过程中,可以根据实时的流量信息判断是否存在突发流量(即突发流量是否到来),从而进行进一步的控制。Further, after the controller allocates bandwidth resources for GC operation based on the above method and increases the start threshold of GC operation, in the process of executing GC operation according to step S202, it can judge whether there is burst traffic according to real-time traffic information (that is, Whether the burst traffic is coming), so as to carry out further control.
其中,控制器根据实时流量信息判断是否存在突发流量时,可以采用如下方式:在第二时间段结束后,根据所述第二时间段内的数据处理请求,确定存在所述突发流量;其中, 所述第二时间段的时长小于设定阈值,所述第二时间段的结束时刻在所述第一时间段的结束时刻之前。示例性的,该设定阈值例如可以为毫秒级或秒级的较短时长。Wherein, when the controller judges whether there is a burst traffic according to the real-time traffic information, the following method may be adopted: after the second time period ends, according to the data processing request in the second time period, it is determined that the burst traffic exists; Wherein, the duration of the second time period is less than a set threshold, and the end time of the second time period is before the end time of the first time period. Exemplarily, the set threshold may be, for example, a short duration of millisecond level or second level.
具体的,控制器在确定所述第二时间段内的数据处理请求满足如下条件1至条件4中的至少一项条件时,可以确定存在突发流量。Specifically, when the controller determines that the data processing request within the second time period satisfies at least one of the following conditions 1 to 4, it may determine that there is a burst traffic.
条件1、第二时间段内的数据处理请求的总数量大于设定的数量阈值。 Condition 1. The total number of data processing requests within the second time period is greater than a set number threshold.
条件2、第二时间段内的数据处理请求的总带宽大于设定的带宽阈值。Condition 2. The total bandwidth of the data processing requests within the second time period is greater than the set bandwidth threshold.
条件3、第二时间段内的数据处理请求的数量的增量大于设定的增量阈值。Condition 3. The increment of the number of data processing requests within the second time period is greater than a set increment threshold.
条件4、第二时间段内的数据处理请求的数量的增速大于设定的增速阈值。Condition 4: The growth rate of the number of data processing requests within the second time period is greater than a set growth rate threshold.
其中,上述各个条件中的第二时间段为一个较短的时间段,在第二时间段内的数据处理请求满足条件1时,说明短时间内存在大量的数据处理请求,则可以认为存在突发流量。在第二时间段内的数据处理请求满足条件2时,说明短时间内的数据处理请求的数据量很大,则可以认为存在突发流量。在第二时间段内的数据处理请求满足条件3或条件4时,说明短时间内的数据处理请求增长的速度很快,则可以认为存在突发流量。Wherein, the second time period in each of the above conditions is a relatively short time period, and when the data processing requests in the second time period satisfy condition 1, it means that there are a large number of data processing requests in a short period of time, and it can be considered that there is a burst send traffic. When the data processing request in the second time period satisfies condition 2, it means that the data volume of the data processing request in a short period of time is large, and it can be considered that there is a burst traffic. When the data processing requests in the second time period satisfy condition 3 or condition 4, it means that the data processing requests in a short period of time increase rapidly, and it can be considered that there is a burst traffic.
需要说明的是,本申请实施例中包括但不限于采用上述方式判断是否存在突发流量,控制器也可以采用其它方式进行判断,此处不再一一列举说明。It should be noted that the embodiments of the present application include but are not limited to the above method for judging whether there is burst traffic, and the controller may also use other methods for judging, which will not be listed here.
本申请实施例中,控制器在实时判断是否存在突发流量的过程中,可能得到的判断结果有多种情况,对应采用的控制方式也有所不同。同时,在存储阵列中可用存储空间的大小发生变化时,控制器采用的控制方式也随之改变。因此,控制器需根据实际情况的变化,灵活调整对GC操作和IO操作的控制方式,从而得到更好的控制效果。In the embodiment of the present application, when the controller judges in real time whether there is a burst traffic, the judgment results may be obtained in various situations, and the corresponding control methods adopted are also different. At the same time, when the size of the available storage space in the storage array changes, the control mode adopted by the controller also changes accordingly. Therefore, the controller needs to flexibly adjust the control mode of GC operation and IO operation according to the change of the actual situation, so as to obtain a better control effect.
下面结合如下情况1~情况3进行详细介绍。The following describes in detail in conjunction with the following cases 1 to 3.
情况1、突发流量到来之前,存储阵列中的可用存储空间达到目标值,则控制器重新分配IO操作和GC操作在执行过程中使用的带宽资源。 Case 1. Before the arrival of burst traffic, the available storage space in the storage array reaches the target value, and the controller reallocates the bandwidth resources used during the execution of IO operations and GC operations.
需要说明的是,本申请实施例中,控制器在根据上述方式确定存在突发流量时,即说明突发流量到来。It should be noted that, in the embodiment of the present application, when the controller determines that there is a burst traffic according to the above manner, it indicates that the burst traffic is coming.
本申请实施例中,所述目标值大于或等于所述突发流量对应的IO操作所需的存储空间。因此,在存储阵列中的可用存储空间达到该目标值时,表明通过GC操作得到的第一可用存储空间足够用于突发流量对应的IO操作使用。若此时还未确定存在突发流量即突发流量还未到来,则可以适当降低IO操作的执行速度,使其能够维持当前得到的第一可用存储空间即可,从而避免过度的GC操作对存储装置寿命的影响。In the embodiment of the present application, the target value is greater than or equal to the storage space required by the IO operation corresponding to the burst traffic. Therefore, when the available storage space in the storage array reaches the target value, it indicates that the first available storage space obtained through the GC operation is sufficient for the IO operation corresponding to the burst traffic. If it is not determined that there is a burst of traffic at this time, that is, the burst of traffic has not yet arrived, the execution speed of the IO operation can be appropriately reduced so that it can maintain the first available storage space currently obtained, thereby avoiding excessive GC operations. Effects on storage device lifetime.
具体的,控制器可以在确定存在所述突发流量之前,在确定第一可用存储空间达到目标值时,将第二带宽资源分配给当前数据处理请求对应的IO操作,以及将第三带宽资源分配给GC操作。其中,第二带宽资源的大小与所述存储阵列中的可用存储空间的大小具有正相关关系,第三带宽资源的大小与所述存储阵列中的可用存储空间的大小具有负相关关系。Specifically, the controller may allocate the second bandwidth resource to the IO operation corresponding to the current data processing request when determining that the first available storage space reaches the target value before determining that the burst traffic exists, and allocate the third bandwidth resource to Assigned to GC operations. Wherein, the size of the second bandwidth resource has a positive correlation with the size of the available storage space in the storage array, and the size of the third bandwidth resource has a negative correlation with the size of the available storage space in the storage array.
基于该方式,在可用存储空间较大时,控制器可以为IO操作分配较多的带宽资源,为GC操作分配较少的带宽资源,可以加快对可用存储空间的消耗,减慢可用存储空间的回收,从而适当消耗可用存储空间,避免可用存储空间过大,同时提高IO操作速度。在可用存储空间较小时,控制器可以为IO操作分配较少的带宽资源,为GC操作分配较多的带宽资源,可以加快可用存储空间的回收,减慢对可用存储空间的消耗,从而避免可用存 储空间过小。通过该方式灵活分配IO操作和GC操作的带宽资源,可以使可用存储空间的大小维持稳定,直至突发流量到来。Based on this method, when the available storage space is large, the controller can allocate more bandwidth resources for IO operations and less bandwidth resources for GC operations, which can speed up the consumption of available storage space and slow down the consumption of available storage space. Recycling, so as to properly consume the available storage space, avoid excessive storage space, and improve the speed of IO operations. When the available storage space is small, the controller can allocate less bandwidth resources for IO operations and more bandwidth resources for GC operations, which can speed up the recovery of available storage space and slow down the consumption of available storage space, thereby avoiding unavailable The storage space is too small. By flexibly allocating bandwidth resources for IO operations and GC operations in this way, the size of the available storage space can be kept stable until burst traffic arrives.
示例性的,上述第二带宽资源符合以下公式:Exemplarily, the above-mentioned second bandwidth resource conforms to the following formula:
BW 1=BW 2×S 1/S th BW 1 =BW 2 ×S 1 /S th
其中,BW 1为第二带宽资源,BW 2为所述控制器能够使用的总带宽资源,S 1为所述存储阵列中的可用存储空间,所述S th为GC操作的启动阈值。 Wherein, BW 1 is the second bandwidth resource, BW 2 is the total bandwidth resource that the controller can use, S 1 is the available storage space in the storage array, and the S th is the start threshold of GC operation.
上述第三带宽资源可以为所述控制器能够使用的总带宽资源减去第二带宽资源得到的带宽资源中的部分或全部带宽资源。The above-mentioned third bandwidth resource may be a part or all of the bandwidth resource obtained by subtracting the second bandwidth resource from the total bandwidth resource available to the controller.
情况2、突发流量到来时,控制器调低GC操作的启动阈值。In case 2, when the burst traffic comes, the controller lowers the start threshold of the GC operation.
控制器在实时判断是否存在突发流量的过程中,在确定存在突发流量时,调低GC操作的启动阈值。同时,控制器可以将执行GC操作得到的第一可用存储空间分配给突发流量对应的IO操作,从而保证对突发流量的及时响应。During the process of judging whether there is a burst flow in real time, the controller lowers the start threshold of the GC operation when it is determined that there is a burst flow. At the same time, the controller can allocate the first available storage space obtained by executing the GC operation to the IO operation corresponding to the burst traffic, so as to ensure a timely response to the burst traffic.
其中,控制器调低GC操作的启动阈值后,GC操作停止,则有更多的带宽资源可以供给IO操作使用,IO操作可以及时快速的对突发流量进行响应,从而减轻或避免IO响应超时的问题。Among them, after the controller lowers the start threshold of the GC operation, the GC operation stops, and more bandwidth resources can be used for the IO operation, and the IO operation can respond to the burst traffic in a timely and rapid manner, thereby reducing or avoiding the IO response timeout The problem.
控制器在调低GC操作的启动阈值时,可以将GC操作的启动阈值调为第二阈值。其中,第二阈值可以为预测到突发流量时的GC操作的启动阈值(N 0),或者,第二阈值小于或等于目标值(S)。 When the controller lowers the GC operation start threshold, the GC operation start threshold may be adjusted to the second threshold. Wherein, the second threshold may be the start threshold (N 0 ) of the GC operation when a burst traffic is predicted, or the second threshold is less than or equal to the target value (S).
情况3、若预测的所述突发流量在第二目标时刻没有到来,则调低所述GC操作的启动阈值;其中,所述第二目标时刻为所述第一时间段内的任一时刻。Situation 3: If the predicted burst traffic does not arrive at the second target time, lower the start threshold of the GC operation; wherein, the second target time is any time within the first time period .
在预测的突发流量不存在时,若一直维持较高的GC操作的启动阈值,会由于过多的、不必要的GC操作对存储装置的寿命产生影响。因此,在确定预测的突发流量未到来时,需及时的调低GC操作的启动阈值。由于预测的突发流量存在的时间为第一时间段,因此,若第一时间段内未能确定突发流量到来,则控制器可以确定预测错误,实际不存在突发流量,并调低GC操作的启动阈值。When the predicted burst traffic does not exist, if a high GC operation start threshold is maintained all the time, the life span of the storage device will be affected due to excessive and unnecessary GC operations. Therefore, when it is determined that the predicted burst traffic has not come, it is necessary to lower the start threshold of the GC operation in time. Since the predicted burst traffic exists for the first period of time, if the arrival of burst traffic cannot be determined within the first time period, the controller can determine that the prediction is wrong and there is no burst traffic in fact, and lower the GC The start threshold for the action.
具体的,控制器若确定预测的突发流量在第二目标时刻没有到来,则确定突发流量不存在,可以调低GC操作的启动阈值。可选的,所述第二目标时刻可以为第一时间段的起始时刻。其中,控制器在调低GC操作的启动阈值时,可以将GC操作的启动阈值调为上述情况2中所述的第二阈值。Specifically, if the controller determines that the predicted burst flow does not arrive at the second target moment, it determines that the burst flow does not exist, and may lower the start threshold of the GC operation. Optionally, the second target moment may be the start moment of the first time period. Wherein, when the controller lowers the start threshold of the GC operation, the start threshold of the GC operation may be adjusted to the second threshold described in the above case 2.
上述实施例中,存储装置中的控制器通过提前预估突发流量到来,同时结合常规流量需求的带宽资源较小,存储装置中有富余的带宽资源可利用的情况,在预测到突发流量时,增加分配给GC操作的带宽资源,从而加快存储空间的回收速率,提前为突发流量准备可用存储空间。则当突发流量到来时,控制器可以将提前准备的可用存储空间提供给突发流量对应的IO操作使用,从而保证IO响应的速度,提高用户使用体验,同时,避免可用存储空间的过度消耗,提高存储装置运行的稳定性。In the above embodiment, the controller in the storage device predicts the arrival of burst traffic in advance, and at the same time, considering that the bandwidth resources required by the conventional traffic are small and there are surplus bandwidth resources available in the storage device, when the burst traffic is predicted When , increase the bandwidth resources allocated to GC operations, thereby speeding up the recovery rate of storage space, and preparing available storage space for burst traffic in advance. Then when the burst traffic comes, the controller can provide the available storage space prepared in advance to the IO operation corresponding to the burst traffic, so as to ensure the speed of IO response, improve the user experience, and avoid excessive consumption of the available storage space , improving the stability of the operation of the storage device.
下面以存储装置为SSD为例,对本申请实施例提供的方案进行介绍。Taking the storage device as an SSD as an example, the solution provided by the embodiment of the present application will be introduced below.
图3为本申请实施例提供的一种存储装置的控制方法的流程示意图。在该存储装置为SSD时,该流程包括:FIG. 3 is a schematic flowchart of a method for controlling a storage device provided by an embodiment of the present application. When the storage device is an SSD, the process includes:
S301:在常规流量场景下,控制器按照常规策略对SSD进行控制,并获取突发流量的 预测信息。S301: In a normal traffic scenario, the controller controls the SSD according to a normal policy, and obtains prediction information of burst traffic.
其中,所述常规策略为根据执行的IO操作,分配与之相当的带宽资源给GC操作,使得GC操作回收得到的存储空间与常规流量对应的IO操作所需的存储空间相对平衡。Wherein, the conventional strategy is to allocate corresponding bandwidth resources to the GC operation according to the executed IO operations, so that the storage space reclaimed by the GC operation is relatively balanced with the storage space required by the IO operations corresponding to the conventional traffic.
示例性的,参照图4a,初始时SSD的控制器可以采用流控策略0进行调控,并接收突发流量的预测信息。其中,流控策略0为控制GC操作的启动阈值为初始值N 0。此时IO操作的带宽资源与GC操作的带宽资源接近,且均较小,SSD存在较多空闲带宽资源未被使用。 Exemplarily, referring to FIG. 4 a , initially, the controller of the SSD may adopt flow control policy 0 for regulation, and receive prediction information of burst traffic. Wherein, flow control strategy 0 is to control the startup threshold of GC operation as an initial value N 0 . At this time, the bandwidth resources for IO operations are similar to those for GC operations, and both are smaller. There are many idle bandwidth resources in SSDs that are not being used.
突发流量的预测信息包括突发流量的预计到来时间、持续时长、传输突发流量所需的带宽资源等。突发流量的预测信息可以是控制器自身预测得到,或者根据上层应用的指示确定。The prediction information of the burst traffic includes the expected arrival time of the burst traffic, the duration, the bandwidth resource required for transmitting the burst traffic, and the like. The prediction information of the burst traffic can be obtained by the controller itself, or determined according to the instruction of the upper layer application.
S302:控制器获取突发流量的预测信息后,增加分配给GC操作的带宽资源,并调高GC操作的启动阈值。S302: After the controller obtains the prediction information of the burst traffic, increase the bandwidth resource allocated to the GC operation, and increase the start threshold of the GC operation.
示例性的,参照图4b,控制器根据突发流量的预测信息确定预测到突发流量后,将采用的流控策略0调整为流控策略1。其中,流控策略1为将GC操作的启动阈值调整为第一阈值N 1,同时,将SSD中空闲的带宽资源增加分配给GC操作,直至可用存储空间达到目标值S。 Exemplarily, referring to FIG. 4 b , the controller adjusts the adopted flow control policy 0 to the flow control policy 1 after determining that the burst traffic is predicted according to the prediction information of the burst traffic. Among them, flow control strategy 1 is to adjust the start threshold of GC operation to the first threshold N 1 , and at the same time, increase and allocate idle bandwidth resources in SSD to GC operation until the available storage space reaches the target value S.
其中,目标值S=传输突发流量所需的带宽资源×突发流量持续时长+预测到突发流量时存储阵列中的可用存储空间,N 1为略大于S的值。 Wherein, the target value S=bandwidth resources required for transmitting burst traffic×burst traffic duration+available storage space in the storage array when burst traffic is predicted, and N 1 is a value slightly larger than S.
示例性的,如图5中“准备可用存储空间阶段”对应的曲线所示,在预测到突发流量时,控制器采用流控策略1,IO操作使用的带宽资源根据实际IO流量的大小的变化而变化,但由于IO操作需求的空间较小,而GC操作的速度在加快,因此可用存储空间的大小在逐渐增大。Exemplarily, as shown in the curve corresponding to the "stage of preparing available storage space" in Figure 5, when a burst traffic is predicted, the controller adopts flow control strategy 1, and the bandwidth resource used by the IO operation is based on the size of the actual IO traffic. However, since the space required for IO operations is small and the speed of GC operations is accelerating, the size of the available storage space is gradually increasing.
S303:控制器确定可用存储空间达到目标值时,为IO操作分配与当前可用存储空间具有正相关关系的带宽资源,为GC操作分配与当前可用存储空间具有负相关关系的带宽资源。S303: When the controller determines that the available storage space reaches the target value, it allocates bandwidth resources that have a positive correlation with the current available storage space for IO operations, and allocates bandwidth resources that have a negative correlation with the current available storage space for GC operations.
示例性的,参照图4b,控制器确定可用存储空间达到目标值S后,将采用的流控策略1调整为流控策略2。其中,流控策略2为分配与可用存储空间成正比的带宽资源给IO操作,剩余带宽资源可以分配给GC操作。Exemplarily, referring to FIG. 4 b , after the controller determines that the available storage space reaches the target value S, the controller adjusts the adopted flow control strategy 1 to flow control strategy 2 . Among them, flow control strategy 2 is to allocate bandwidth resources proportional to the available storage space to IO operations, and the remaining bandwidth resources can be allocated to GC operations.
其中,IO操作对应的带宽资源=总带宽资源×可用存储空间/N 1。可用存储空间最大时为N 1,此时IO操作使用全部带宽资源。 Wherein, the bandwidth resource corresponding to the IO operation=total bandwidth resource×available storage space/N 1 . The maximum available storage space is N 1 , and all bandwidth resources are used for IO operations at this time.
示例性的,如图5中“维持可用存储空间阶段”对应的曲线所示,控制器采用流控策略2时,IO操作使用的带宽资源与可用存储空间成正比,此过程中,能够尽量维持可用存储空间处于S左右的水平。Exemplarily, as shown in the curve corresponding to the stage of "maintaining available storage space" in Figure 5, when the controller adopts flow control strategy 2, the bandwidth resources used by IO operations are proportional to the available storage space. During this process, it can be maintained as much as possible The available storage space is at the level of S or so.
S304:控制器根据实际IO情况判断突发流量是否到来,若是,则执行步骤S305;否则,执行步骤S306。S304: The controller judges whether the burst traffic is coming according to the actual IO situation, and if so, executes step S305; otherwise, executes step S306.
示例性的,控制器若确定在连续3秒内,每秒的IO数量比前一秒增加50%以上,则可以确定突发流量到来。Exemplarily, if the controller determines that within 3 consecutive seconds, the number of IOs per second increases by more than 50% compared with the previous second, it may determine that the burst traffic is coming.
S305:控制器调低GC操作的启动阈值。S305: the controller lowers the start threshold of the GC operation.
示例性的,参照图4c,控制器确定突发流量到来时,将采用的流控策略2调整为流控策略3。其中,流控策略3为将GC操作的启动阈值调整为初始值N 0,从而停止GC操作, 将带宽资源给IO操作使用。 Exemplarily, referring to FIG. 4 c , the controller adjusts the adopted flow control strategy 2 to flow control strategy 3 when determining that a burst traffic is coming. Among them, the flow control strategy 3 is to adjust the start threshold of the GC operation to the initial value N 0 , so as to stop the GC operation and use the bandwidth resource for the IO operation.
示例性的,如图5中“使用可用存储空间阶段”对应的曲线所示,控制器采用流控策略3时,GC操作停止,IO操作可以使用总带宽资源。Exemplarily, as shown in the curve corresponding to the "stage of using available storage space" in FIG. 5, when the controller adopts the flow control strategy 3, the GC operation stops, and the IO operation can use the total bandwidth resource.
S306:控制器维持当前控制方式,或者在确定到达突发流量的预计结束时间时,切换为按照常规策略对SSD进行控制。S306: The controller maintains the current control mode, or switches to control the SSD according to a conventional strategy when determining the expected end time of the arrival of the burst traffic.
示例性的,控制器未确定突发流量到来时,可以维持流控策略2,或者,在确定到达突发流量的预计结束时间时,将采用的流控策略2调整为流控策略3。Exemplarily, when the controller does not determine that the burst traffic is coming, it may maintain the flow control policy 2, or, when determining the expected end time of the arrival of the burst traffic, adjust the adopted traffic control policy 2 to the traffic control policy 3.
其中,突发流量的预计结束时间为突发流量的预计到来时间延迟突发流量的持续时长后对应的时间。Wherein, the expected end time of the burst traffic is the corresponding time after the expected arrival time of the burst traffic is delayed by the duration of the burst traffic.
应理解,上述实例仅是对本申请方案的一种可能的场景下的实施方式的示例性说明,并未将所有可能的场景或情况涵盖在内。上述实例中各步骤的具体实施方式可参照上述实施例中的介绍,此处不再详述。It should be understood that the above example is only an exemplary description of an implementation manner in a possible scenario of the solution of the present application, and does not cover all possible scenarios or situations. For the specific implementation manner of each step in the above example, reference may be made to the introduction in the above embodiment, and details are not described here again.
上述实例中,控制器在预测到突发流量后可以快速空出突发流量对应的IO操作所需的存储空间,并在突发流量来临时调低GC操作的启动阈值,从而最大化IO响应能力来吸收突发流量,提高IO响应速度和SSD的稳定性。在此过程中,只有为GC操作增加配置带宽资源使其快速回收存储空间时会对SSD的寿命产生影响,但持续的时间较短,因此可减小对寿命的影响。In the above example, after predicting the burst traffic, the controller can quickly free up the storage space required for the IO operation corresponding to the burst traffic, and lower the startup threshold of the GC operation when the burst traffic comes, so as to maximize the IO response Ability to absorb burst traffic, improve IO response speed and SSD stability. During this process, only when the allocation of bandwidth resources is increased for the GC operation to quickly reclaim the storage space will have an impact on the life of the SSD, but the duration is short, so the impact on the life can be reduced.
基于以上实施例及相同构思,本申请实施例还提供了一种存储装置的控制装置,所述控制装置应用于所述存储装置中的控制器,其中,所述存储装置还包括存储阵列。如图6所示,所述控制装置600包括:预测模块601,用于预测到在第一时间段内存在突发流量;处理模块602,用于在所述第一时间段之前,增加分配给GC操作的带宽资源,以及利用第一带宽资源执行所述GC操作,得到所述存储阵列中的第一可用存储空间;其中,所述突发流量包含第一数量的数据处理请求,所述第一数量大于所述存储装置每秒钟能够响应的数据处理请求的数量;所述第一带宽资源为分配给所述GC操作的带宽资源。Based on the above embodiments and the same idea, an embodiment of the present application further provides a control device for a storage device, the control device is applied to a controller in the storage device, and the storage device further includes a storage array. As shown in FIG. 6 , the control device 600 includes: a predicting module 601, configured to predict that there is a burst traffic within the first time period; a processing module 602, used to increase the allocation to Bandwidth resources for GC operations, and using the first bandwidth resources to execute the GC operations to obtain a first available storage space in the storage array; wherein, the burst traffic includes a first number of data processing requests, and the second A number is greater than the number of data processing requests that the storage device can respond to per second; the first bandwidth resource is a bandwidth resource allocated to the GC operation.
在一种可能的设计中,所述处理模块602还用于:当确定存在所述突发流量时,将所述第一可用存储空间分配给所述突发流量对应的输入输出IO操作。In a possible design, the processing module 602 is further configured to: when it is determined that the burst traffic exists, allocate the first available storage space to an input/output IO operation corresponding to the burst traffic.
在一种可能的设计中,当所述预测模块601预测到在第一时间段内存在突发流量时,所述处理模块602还用于:调高所述GC操作的启动阈值;其中,当所述存储阵列中的可用存储空间小于所述启动阈值时,启动所述GC操作。In a possible design, when the prediction module 601 predicts that there is a burst traffic within the first time period, the processing module 602 is further configured to: increase the startup threshold of the GC operation; wherein, when When the available storage space in the storage array is less than the start threshold, start the GC operation.
在一种可能的设计中,当所述预测模块601预测到在第一时间段内存在突发流量时,所述处理模块602还用于:基于所述突发流量对应的IO操作所需的存储空间和所述第一带宽资源确定第一目标时刻;在所述第一目标时刻到来时,调高所述GC操作的启动阈值;其中,当所述存储阵列中的可用存储空间小于所述启动阈值时,启动所述GC操作。In a possible design, when the prediction module 601 predicts that there is a burst traffic within the first time period, the processing module 602 is further configured to: based on the IO operation required by the burst traffic storage space and the first bandwidth resource determine a first target time; when the first target time arrives, increase the start threshold of the GC operation; wherein, when the available storage space in the storage array is less than the When the threshold is started, the GC operation is started.
在一种可能的设计中,所述处理模块602还用于:当确定存在所述突发流量时,调低所述GC操作的启动阈值;或者,若预测的所述突发流量在第二目标时刻没有到来,则调低所述GC操作的启动阈值;其中,所述第二目标时刻为所述第一时间段内的任一时刻。In a possible design, the processing module 602 is further configured to: when it is determined that the burst traffic exists, lower the start threshold of the GC operation; or, if the predicted burst traffic is in the second If the target time has not arrived, lower the start threshold of the GC operation; wherein, the second target time is any time within the first time period.
在一种可能的设计中,所述处理模块602还用于:在确定存在所述突发流量之前,当所述第一可用存储空间达到目标值时,将第二带宽资源分配给当前数据处理请求对应的IO操作,以及将第三带宽资源分配给所述GC操作;其中,所述目标值大于或等于所述突发 流量对应的IO操作所需的存储空间;所述第二带宽资源的大小与所述存储阵列中的可用存储空间的大小具有正相关关系,所述第三带宽资源的大小与所述存储阵列中的可用存储空间的大小具有负相关关系。In a possible design, the processing module 602 is further configured to: before it is determined that the burst traffic exists, when the first available storage space reaches a target value, allocate the second bandwidth resource to the current data processing Requesting a corresponding IO operation, and allocating a third bandwidth resource to the GC operation; wherein, the target value is greater than or equal to the storage space required for the IO operation corresponding to the burst traffic; the second bandwidth resource The size has a positive correlation with the size of the available storage space in the storage array, and the size of the third bandwidth resource has a negative correlation with the size of the available storage space in the storage array.
在一种可能的设计中,所述第二带宽资源符合以下公式:In a possible design, the second bandwidth resource complies with the following formula:
BW 1=BW 2×S 1/S th BW 1 =BW 2 ×S 1 /S th
其中,所述BW 1为所述第二带宽资源,所述BW 2为所述控制器能够使用的总带宽资源,所述S 1为所述存储阵列中的可用存储空间,所述S th为所述GC操作的启动阈值。 Wherein, the BW 1 is the second bandwidth resource, the BW 2 is the total bandwidth resource that the controller can use, the S 1 is the available storage space in the storage array, and the S th is The start threshold for the GC operation.
在一种可能的设计中,所述目标值为第一参数与第二参数之和,所述第一参数为所述突发流量对应的IO操作所需的存储空间,所述第二参数为当预测到在第一时间段内存在突发流量时所述存储阵列中的可用存储空间。In a possible design, the target value is the sum of the first parameter and the second parameter, the first parameter is the storage space required for the IO operation corresponding to the burst traffic, and the second parameter is The available storage space in the storage array when it is predicted that there is a burst traffic within the first time period.
在一种可能的设计中,所述突发流量对应的IO操作所需的存储空间符合以下公式:In a possible design, the storage space required for the IO operation corresponding to the burst traffic conforms to the following formula:
S 2=BW 3×T S 2 =BW 3 ×T
其中,所述S 2为所述突发流量对应的IO操作所需的存储空间,所述BW 3为传输所述突发流量所需的带宽资源,所述T为所述突发流量的持续时长。 Wherein, the S 2 is the storage space required for the IO operation corresponding to the burst traffic, the BW 3 is the bandwidth resource required for transmitting the burst traffic, and the T is the duration of the burst traffic duration.
在一种可能的设计中,所述处理模块602在确定存在所述突发流量时,具体用于:在第二时间段结束后,根据所述第二时间段内的数据处理请求,确定存在所述突发流量;其中,所述第二时间段的时长小于设定阈值,所述第二时间段的结束时刻在所述第一时间段的结束时刻之前。In a possible design, when the processing module 602 determines that the burst traffic exists, it is specifically configured to: after the end of the second time period, according to the data processing request in the second time period, determine that there is The burst traffic; wherein, the duration of the second time period is less than a set threshold, and the end moment of the second time period is before the end moment of the first time period.
在一种可能的设计中,所述处理模块602在根据所述第二时间段内的数据处理请求,确定存在所述突发流量时,具体用于执行以下至少一项:确定所述第二时间段内的数据处理请求的总数量大于设定的数量阈值;确定所述第二时间段内的数据处理请求的总带宽大于设定的带宽阈值;确定所述第二时间段内的数据处理请求的数量的增量大于设定的增量阈值;确定所述第二时间段内的数据处理请求的数量的增速大于设定的增速阈值。In a possible design, when the processing module 602 determines that the burst traffic exists according to the data processing request within the second time period, it is specifically configured to perform at least one of the following: determine the second The total number of data processing requests in the time period is greater than the set number threshold; determine that the total bandwidth of the data processing requests in the second time period is greater than the set bandwidth threshold; determine the data processing in the second time period The increment of the quantity of requests is greater than a set increment threshold; it is determined that the increment of the quantity of data processing requests within the second time period is greater than the set increment threshold.
在一种可能的设计中,所述预测模块601在预测到在第一时间段内存在突发流量时,具体用于:利用设定的流量预测模型,根据目标历史时间段内的数据处理请求,预测到在所述第一时间段内存在突发流量;其中,所述流量预测模型是通过机器学习和/或模型训练得到的;或者,根据来自上层应用的突发流量预测信息,预测到在所述第一时间段内存在突发流量;其中,所述突发流量预测信息用于指示:预测到在所述第一时间段内存在突发流量。In a possible design, when the prediction module 601 predicts that there is a burst traffic in the first time period, it is specifically configured to: use the set traffic prediction model to process the request according to the data in the target historical time period , it is predicted that there is a burst traffic within the first time period; wherein, the traffic prediction model is obtained through machine learning and/or model training; or, according to the burst traffic prediction information from the upper-layer application, it is predicted that There is a burst traffic within the first time period; wherein, the burst traffic prediction information is used to indicate: it is predicted that there is a burst traffic within the first time period.
在一种可能的设计中,所述存储装置为固态硬盘。In a possible design, the storage device is a solid state disk.
本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,另外,在本申请各个实施例中的各功能模块可以集成在一个处理器中,也可以是单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。The division of modules in the embodiments of the present application is schematic, and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional module in each embodiment of the present application can be integrated into a processing In the controller, it can also be physically present separately, or two or more modules can be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules.
图6中的各个模块的只一个或多个可以软件、硬件、固件或其结合实现。所述软件或固件包括但不限于计算机程序指令或代码,并可以被硬件处理器所执行。所述硬件包括但不限于各类集成电路,如中央处理单元(CPU)、数字信号处理器(DSP)、现场可编程门阵列(FPGA)或专用集成电路(ASIC)。Only one or more of the various modules in FIG. 6 may be implemented in software, hardware, firmware or a combination thereof. The software or firmware includes but is not limited to computer program instructions or codes, and can be executed by a hardware processor. The hardware includes but not limited to various integrated circuits, such as central processing unit (CPU), digital signal processor (DSP), field programmable gate array (FPGA) or application specific integrated circuit (ASIC).
基于以上实施例及相同构思,本申请实施例还提供了一种存储装置,所述存储装置包 括控制器和存储阵列;所述存储阵列用于存储数据;所述控制器用于对所述存储装置执行上述实施例提供的存储装置的控制方法。Based on the above embodiments and the same idea, the embodiment of the present application also provides a storage device, the storage device includes a controller and a storage array; the storage array is used to store data; the controller is used to control the storage device The method for controlling the storage device provided in the foregoing embodiments is executed.
在一种可能的设计中,所述存储装置为固态硬盘。In a possible design, the storage device is a solid state disk.
基于以上实施例及相同构思,本申请实施例还提供了一种计算设备,所述计算设备包上诉实施例中提供的存储装置。Based on the above embodiments and the same idea, the embodiment of the present application further provides a computing device, the computing device includes the storage device provided in the above embodiment.
在一种可能的设计中,所述存储装置为固态硬盘。In a possible design, the storage device is a solid state disk.
基于以上实施例及相同构思,本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机指令,当所述计算机指令在计算机或处理器上运行时,使得所述计算机或所述处理器执行上述实施例提供的存储装置的控制方法。Based on the above embodiments and the same idea, the embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores computer instructions, and when the computer instructions are run on a computer or a processor, the The computer or the processor executes the method for controlling a storage device provided in the foregoing embodiments.
基于以上实施例及相同构思,本申请实施例还提供了一种计算机程序产品,当所述计算机程序产品在计算机或处理器上运行时,使得所述计算机或所述处理器执行上述实施例提供的存储装置的控制方法。Based on the above embodiments and the same idea, the embodiment of the present application also provides a computer program product, when the computer program product runs on a computer or a processor, the computer or the processor executes the computer program provided in the above embodiment. A control method for a storage device.
本申请实施例提供的方法,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、网络设备、用户设备或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,简称DSL)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机可以存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如,数字视频光盘(digital video disc,简称DVD)、或者半导体介质(例如,SSD)等。The methods provided in the embodiments of the present application may be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present invention will be generated in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, network equipment, user equipment or other programmable devices. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server or data center Transmission to another website site, computer, server, or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL) or wireless (such as infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), optical media (for example, digital video disc (digital video disc, DVD for short), or semiconductor media (for example, SSD), etc.
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Apparently, those skilled in the art can make various changes and modifications to the present application without departing from the scope of the present application. In this way, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.

Claims (30)

  1. 一种存储装置的控制方法,所述存储装置包括控制器和存储阵列,所述方法应用于所述控制器,其特征在于,所述方法包括:A method for controlling a storage device, the storage device comprising a controller and a storage array, the method being applied to the controller, wherein the method includes:
    当预测到在第一时间段内存在突发流量时,在所述第一时间段之前,增加分配给垃圾回收GC操作的带宽资源;其中,所述突发流量包含第一数量的数据处理请求,所述第一数量大于所述存储装置每秒钟能够响应的数据处理请求的数量;When it is predicted that there is a burst traffic within the first time period, before the first time period, increase the bandwidth resource allocated to the garbage collection GC operation; wherein the burst traffic includes a first number of data processing requests , the first number is greater than the number of data processing requests that the storage device can respond to per second;
    利用第一带宽资源执行所述GC操作,得到所述存储阵列中的第一可用存储空间,其中,所述第一带宽资源为分配给所述GC操作的带宽资源。Executing the GC operation by using the first bandwidth resource to obtain a first available storage space in the storage array, where the first bandwidth resource is a bandwidth resource allocated to the GC operation.
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, further comprising:
    当确定存在所述突发流量时,将所述第一可用存储空间分配给所述突发流量对应的输入输出IO操作。When it is determined that the burst traffic exists, the first available storage space is allocated to an input/output IO operation corresponding to the burst traffic.
  3. 根据权利要求1或2所述的方法,其特征在于,当预测到在第一时间段内存在突发流量时,所述方法还包括:The method according to claim 1 or 2, wherein when it is predicted that there is a burst traffic within the first time period, the method further comprises:
    调高所述GC操作的启动阈值;其中,当所述存储阵列中的可用存储空间小于所述启动阈值时,启动所述GC操作。Increase the startup threshold of the GC operation; wherein, when the available storage space in the storage array is smaller than the startup threshold, the GC operation is started.
  4. 根据权利要求1或2所述的方法,其特征在于,当预测到在第一时间段内存在突发流量时,所述方法还包括:The method according to claim 1 or 2, wherein when it is predicted that there is a burst traffic within the first time period, the method further comprises:
    基于所述突发流量对应的IO操作所需的存储空间和所述第一带宽资源确定第一目标时刻;determining a first target moment based on the storage space required for the IO operation corresponding to the burst traffic and the first bandwidth resource;
    在所述第一目标时刻到来时,调高所述GC操作的启动阈值;其中,当所述存储阵列中的可用存储空间小于所述启动阈值时,启动所述GC操作。When the first target time arrives, the start threshold of the GC operation is increased; wherein, when the available storage space in the storage array is smaller than the start threshold, the GC operation is started.
  5. 根据权利要求1~4任一所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-4, characterized in that the method further comprises:
    当确定存在所述突发流量时,调低所述GC操作的启动阈值;或者When it is determined that the burst traffic exists, lowering the start threshold of the GC operation; or
    若预测的所述突发流量在第二目标时刻没有到来,则调低所述GC操作的启动阈值;其中,所述第二目标时刻为所述第一时间段内的任一时刻。If the predicted burst traffic does not arrive at the second target time, lowering the start threshold of the GC operation; wherein the second target time is any time within the first time period.
  6. 根据权利要求1~5任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-5, characterized in that the method further comprises:
    在确定存在所述突发流量之前,当所述第一可用存储空间达到目标值时,将第二带宽资源分配给当前数据处理请求对应的IO操作,以及将第三带宽资源分配给所述GC操作;Before determining that there is the burst traffic, when the first available storage space reaches a target value, allocate a second bandwidth resource to the IO operation corresponding to the current data processing request, and allocate a third bandwidth resource to the GC operate;
    其中,所述目标值大于或等于所述突发流量对应的IO操作所需的存储空间;所述第二带宽资源的大小与所述存储阵列中的可用存储空间的大小具有正相关关系,所述第三带宽资源的大小与所述存储阵列中的可用存储空间的大小具有负相关关系。Wherein, the target value is greater than or equal to the storage space required by the IO operation corresponding to the burst traffic; the size of the second bandwidth resource has a positive correlation with the size of the available storage space in the storage array, so The size of the third bandwidth resource has a negative correlation with the size of the available storage space in the storage array.
  7. 根据权利要求6所述的方法,其特征在于,所述第二带宽资源符合以下公式:The method according to claim 6, wherein the second bandwidth resource complies with the following formula:
    BW 1=BW 2×S 1/S th BW 1 =BW 2 ×S 1 /S th
    其中,所述BW 1为所述第二带宽资源,所述BW 2为所述控制器能够使用的总带宽资源,所述S 1为所述存储阵列中的可用存储空间,所述S th为所述GC操作的启动阈值。 Wherein, the BW 1 is the second bandwidth resource, the BW 2 is the total bandwidth resource that the controller can use, the S 1 is the available storage space in the storage array, and the S th is The start threshold for the GC operation.
  8. 根据权利要求6或7所述的方法,其特征在于,所述目标值为第一参数与第二参数之和,所述第一参数为所述突发流量对应的IO操作所需的存储空间,所述第二参数为当预测到在第一时间段内存在突发流量时所述存储阵列中的可用存储空间。The method according to claim 6 or 7, wherein the target value is the sum of the first parameter and the second parameter, and the first parameter is the storage space required for the IO operation corresponding to the burst traffic , the second parameter is the available storage space in the storage array when it is predicted that there is a burst traffic within the first time period.
  9. 根据权利要求6~8任一所述的方法,其特征在于,所述突发流量对应的IO操作所需 的存储空间符合以下公式:The method according to any one of claims 6 to 8, wherein the storage space required for the IO operation corresponding to the burst traffic meets the following formula:
    S 2=BW 3×T S 2 =BW 3 ×T
    其中,所述S 2为所述突发流量对应的IO操作所需的存储空间,所述BW 3为传输所述突发流量所需的带宽资源,所述T为所述突发流量的持续时长。 Wherein, the S 2 is the storage space required for the IO operation corresponding to the burst traffic, the BW 3 is the bandwidth resource required for transmitting the burst traffic, and the T is the duration of the burst traffic duration.
  10. 根据权利要求6~9任一所述的方法,其特征在于,确定存在所述突发流量,包括:The method according to any one of claims 6-9, wherein determining that there is a burst traffic comprises:
    在第二时间段结束后,根据所述第二时间段内的数据处理请求,确定存在所述突发流量;其中,所述第二时间段的时长小于设定阈值,所述第二时间段的结束时刻在所述第一时间段的结束时刻之前。After the second time period ends, according to the data processing request in the second time period, it is determined that the burst traffic exists; wherein, the duration of the second time period is less than a set threshold, and the second time period The end moment of is before the end moment of the first time period.
  11. 根据权利要求10所述的方法,其特征在于,根据所述第二时间段内的数据处理请求,确定存在所述突发流量,包括以下至少一项:The method according to claim 10, wherein, according to the data processing request within the second time period, determining that there is the burst traffic includes at least one of the following:
    确定所述第二时间段内的数据处理请求的总数量大于设定的数量阈值;determining that the total number of data processing requests within the second time period is greater than a set number threshold;
    确定所述第二时间段内的数据处理请求的总带宽大于设定的带宽阈值;determining that the total bandwidth of data processing requests within the second time period is greater than a set bandwidth threshold;
    确定所述第二时间段内的数据处理请求的数量的增量大于设定的增量阈值;determining that the increment of the number of data processing requests within the second time period is greater than a set increment threshold;
    确定所述第二时间段内的数据处理请求的数量的增速大于设定的增速阈值。It is determined that the growth rate of the number of data processing requests within the second time period is greater than a set growth rate threshold.
  12. 根据权利要求1~11任一所述的方法,其特征在于,预测到在第一时间段内存在突发流量,包括:The method according to any one of claims 1-11, wherein predicting that there is a burst traffic within the first time period includes:
    利用设定的流量预测模型,根据目标历史时间段内的数据处理请求,预测到在所述第一时间段内存在突发流量;其中,所述流量预测模型是通过机器学习和/或模型训练得到的;或者Using the set traffic prediction model, according to the data processing requests in the target historical time period, it is predicted that there is a burst traffic in the first time period; wherein, the traffic prediction model is through machine learning and/or model training obtained; or
    根据来自上层应用的突发流量预测信息,预测到在所述第一时间段内存在突发流量;其中,所述突发流量预测信息用于指示:预测到在所述第一时间段内存在突发流量。According to the burst traffic prediction information from the upper-layer application, it is predicted that there is a burst traffic within the first time period; wherein, the burst traffic prediction information is used to indicate: it is predicted that there is a burst traffic within the first time period burst traffic.
  13. 根据权利要求1~12任一所述的方法,其特征在于,所述存储装置为固态硬盘。The method according to any one of claims 1-12, wherein the storage device is a solid state disk.
  14. 一种存储装置的控制装置,所述控制装置应用于所述存储装置中的控制器,其中,所述存储装置还包括存储阵列;其特征在于,所述控制装置包括:A control device for a storage device, the control device is applied to a controller in the storage device, wherein the storage device further includes a storage array; it is characterized in that the control device includes:
    预测模块,用于预测到在第一时间段内存在突发流量;A prediction module, configured to predict that there is a burst traffic in the first time period;
    处理模块,用于在所述第一时间段之前,增加分配给GC操作的带宽资源,以及利用第一带宽资源执行所述GC操作,得到所述存储阵列中的第一可用存储空间;其中,所述突发流量包含第一数量的数据处理请求,所述第一数量大于所述存储装置每秒钟能够响应的数据处理请求的数量;所述第一带宽资源为分配给所述GC操作的带宽资源。A processing module, configured to increase bandwidth resources allocated to GC operations before the first time period, and use the first bandwidth resources to perform the GC operations to obtain a first available storage space in the storage array; wherein, The burst traffic includes a first number of data processing requests, and the first number is greater than the number of data processing requests that the storage device can respond to per second; the first bandwidth resource is allocated to the GC operation bandwidth resources.
  15. 根据权利要求14所述的控制装置,其特征在于,所述处理模块还用于:The control device according to claim 14, wherein the processing module is further used for:
    当确定存在所述突发流量时,将所述第一可用存储空间分配给所述突发流量对应的输入输出IO操作。When it is determined that the burst traffic exists, the first available storage space is allocated to an input/output IO operation corresponding to the burst traffic.
  16. 根据权利要求14或15所述的控制装置,其特征在于,当所述预测模块预测到在第一时间段内存在突发流量时,所述处理模块还用于:The control device according to claim 14 or 15, wherein when the prediction module predicts that there is a burst traffic within the first time period, the processing module is further configured to:
    调高所述GC操作的启动阈值;其中,当所述存储阵列中的可用存储空间小于所述启动阈值时,启动所述GC操作。Increase the startup threshold of the GC operation; wherein, when the available storage space in the storage array is smaller than the startup threshold, the GC operation is started.
  17. 根据权利要求14或15所述的控制装置,其特征在于,当所述预测模块预测到在第一时间段内存在突发流量时,所述处理模块还用于:The control device according to claim 14 or 15, wherein when the prediction module predicts that there is a burst traffic within the first time period, the processing module is further configured to:
    基于所述突发流量对应的IO操作所需的存储空间和所述第一带宽资源确定第一目标时刻;determining a first target moment based on the storage space required for the IO operation corresponding to the burst traffic and the first bandwidth resource;
    在所述第一目标时刻到来时,调高所述GC操作的启动阈值;其中,当所述存储阵列中的可用存储空间小于所述启动阈值时,启动所述GC操作。When the first target time arrives, the start threshold of the GC operation is increased; wherein, when the available storage space in the storage array is smaller than the start threshold, the GC operation is started.
  18. 根据权利要求14~17任一所述的控制装置,其特征在于,所述处理模块还用于:The control device according to any one of claims 14-17, wherein the processing module is further used for:
    当确定存在所述突发流量时,调低所述GC操作的启动阈值;或者When it is determined that the burst traffic exists, lowering the start threshold of the GC operation; or
    若预测的所述突发流量在第二目标时刻没有到来,则调低所述GC操作的启动阈值;其中,所述第二目标时刻为所述第一时间段内的任一时刻。If the predicted burst traffic does not arrive at the second target time, lowering the start threshold of the GC operation; wherein the second target time is any time within the first time period.
  19. 根据权利要求14~18任一项所述的控制装置,其特征在于,所述处理模块还用于:The control device according to any one of claims 14-18, wherein the processing module is further used for:
    在确定存在所述突发流量之前,当所述第一可用存储空间达到目标值时,将第二带宽资源分配给当前数据处理请求对应的IO操作,以及将第三带宽资源分配给所述GC操作;Before determining that there is the burst traffic, when the first available storage space reaches a target value, allocate a second bandwidth resource to the IO operation corresponding to the current data processing request, and allocate a third bandwidth resource to the GC operate;
    其中,所述目标值大于或等于所述突发流量对应的IO操作所需的存储空间;所述第二带宽资源的大小与所述存储阵列中的可用存储空间的大小具有正相关关系,所述第三带宽资源的大小与所述存储阵列中的可用存储空间的大小具有负相关关系。Wherein, the target value is greater than or equal to the storage space required by the IO operation corresponding to the burst traffic; the size of the second bandwidth resource has a positive correlation with the size of the available storage space in the storage array, so The size of the third bandwidth resource has a negative correlation with the size of the available storage space in the storage array.
  20. 根据权利要求19所述的控制装置,其特征在于,所述第二带宽资源符合以下公式:The control device according to claim 19, wherein the second bandwidth resource complies with the following formula:
    BW 1=BW 2×S 1/S th BW 1 =BW 2 ×S 1 /S th
    其中,所述BW 1为所述第二带宽资源,所述BW 2为所述控制器能够使用的总带宽资源,所述S 1为所述存储阵列中的可用存储空间,所述S th为所述GC操作的启动阈值。 Wherein, the BW 1 is the second bandwidth resource, the BW 2 is the total bandwidth resource that the controller can use, the S 1 is the available storage space in the storage array, and the S th is The start threshold for the GC operation.
  21. 根据权利要求19或20所述的控制装置,其特征在于,所述目标值为第一参数与第二参数之和,所述第一参数为所述突发流量对应的IO操作所需的存储空间,所述第二参数为当预测到在第一时间段内存在突发流量时所述存储阵列中的可用存储空间。The control device according to claim 19 or 20, wherein the target value is the sum of the first parameter and the second parameter, and the first parameter is the storage required for the IO operation corresponding to the burst traffic. space, and the second parameter is the available storage space in the storage array when it is predicted that there is a burst traffic within the first time period.
  22. 根据权利要求19~21任一所述的控制装置,其特征在于,所述突发流量对应的IO操作所需的存储空间符合以下公式:The control device according to any one of claims 19-21, wherein the storage space required for the IO operation corresponding to the burst traffic conforms to the following formula:
    S 2=BW 3×T S 2 =BW 3 ×T
    其中,所述S 2为所述突发流量对应的IO操作所需的存储空间,所述BW 3为传输所述突发流量所需的带宽资源,所述T为所述突发流量的持续时长。 Wherein, the S 2 is the storage space required for the IO operation corresponding to the burst traffic, the BW 3 is the bandwidth resource required for transmitting the burst traffic, and the T is the duration of the burst traffic duration.
  23. 根据权利要求19~22任一所述的控制装置,其特征在于,所述处理模块在确定存在所述突发流量时,具体用于:The control device according to any one of claims 19-22, characterized in that, when the processing module determines that the burst traffic exists, it is specifically used for:
    在第二时间段结束后,根据所述第二时间段内的数据处理请求,确定存在所述突发流量;其中,所述第二时间段的时长小于设定阈值,所述第二时间段的结束时刻在所述第一时间段的结束时刻之前。After the second time period ends, according to the data processing request in the second time period, it is determined that the burst traffic exists; wherein, the duration of the second time period is less than a set threshold, and the second time period The end moment of is before the end moment of the first time period.
  24. 根据权利要求23所述的控制装置,其特征在于,所述处理模块在根据所述第二时间段内的数据处理请求,确定存在所述突发流量时,具体用于执行以下至少一项:The control device according to claim 23, wherein the processing module is specifically configured to perform at least one of the following when determining that the burst traffic exists according to the data processing request within the second time period:
    确定所述第二时间段内的数据处理请求的总数量大于设定的数量阈值;determining that the total number of data processing requests within the second time period is greater than a set number threshold;
    确定所述第二时间段内的数据处理请求的总带宽大于设定的带宽阈值;determining that the total bandwidth of data processing requests within the second time period is greater than a set bandwidth threshold;
    确定所述第二时间段内的数据处理请求的数量的增量大于设定的增量阈值;determining that the increment of the number of data processing requests within the second time period is greater than a set increment threshold;
    确定所述第二时间段内的数据处理请求的数量的增速大于设定的增速阈值。It is determined that the growth rate of the number of data processing requests within the second time period is greater than a set growth rate threshold.
  25. 根据权利要求14~23任一所述的控制装置,其特征在于,所述预测模块在预测到在第一时间段内存在突发流量时,具体用于:The control device according to any one of claims 14-23, wherein the prediction module is specifically used for:
    利用设定的流量预测模型,根据目标历史时间段内的数据处理请求,预测到在所述第一时间段内存在突发流量;其中,所述流量预测模型是通过机器学习和/或模型训练得到的;或者Using the set traffic prediction model, according to the data processing requests in the target historical time period, it is predicted that there is a burst traffic in the first time period; wherein, the traffic prediction model is through machine learning and/or model training obtained; or
    根据来自上层应用的突发流量预测信息,预测到在所述第一时间段内存在突发流量;其中,所述突发流量预测信息用于指示:预测到在所述第一时间段内存在突发流量。According to the burst traffic prediction information from the upper-layer application, it is predicted that there is a burst traffic within the first time period; wherein, the burst traffic prediction information is used to indicate: it is predicted that there is a burst traffic within the first time period burst traffic.
  26. 根据权利要求14~25任一所述的控制装置,其特征在于,所述存储装置为固态硬盘。The control device according to any one of claims 14-25, wherein the storage device is a solid-state hard disk.
  27. 一种存储装置,其特征在于,所述存储装置包括控制器和存储阵列;A storage device, characterized in that the storage device includes a controller and a storage array;
    所述存储阵列用于存储数据;The storage array is used to store data;
    所述控制器用于对所述存储装置执行如权利要求1~13任一项所述的方法。The controller is configured to execute the method according to any one of claims 1-13 on the storage device.
  28. 根据权利要求27所述的存储装置,其特征在于,所述存储装置为固态硬盘。The storage device according to claim 27, wherein the storage device is a solid-state hard disk.
  29. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机指令,当所述计算机指令在计算机或处理器上运行时,使得所述计算机或所述处理器执行如权利要求1-13任一项所述的方法。A computer-readable storage medium, characterized in that the computer-readable storage medium stores computer instructions, and when the computer instructions are run on a computer or a processor, the computer or the processor executes the The method described in any one of claims 1-13.
  30. 一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机或处理器上运行时,使得所述计算机或所述处理器执行如权利要求1-13任一项所述的方法。A computer program product, characterized in that, when the computer program product is run on a computer or a processor, the computer or the processor is made to execute the method according to any one of claims 1-13.
PCT/CN2021/116983 2021-09-07 2021-09-07 Control method and apparatus for storage apparatus WO2023035113A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202180100197.4A CN117769699A (en) 2021-09-07 2021-09-07 Control method and device of storage device
PCT/CN2021/116983 WO2023035113A1 (en) 2021-09-07 2021-09-07 Control method and apparatus for storage apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/116983 WO2023035113A1 (en) 2021-09-07 2021-09-07 Control method and apparatus for storage apparatus

Publications (1)

Publication Number Publication Date
WO2023035113A1 true WO2023035113A1 (en) 2023-03-16

Family

ID=85506148

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/116983 WO2023035113A1 (en) 2021-09-07 2021-09-07 Control method and apparatus for storage apparatus

Country Status (2)

Country Link
CN (1) CN117769699A (en)
WO (1) WO2023035113A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117785619A (en) * 2024-02-27 2024-03-29 深圳超盈智能科技有限公司 Method and system for monitoring chip storage state

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170206006A1 (en) * 2016-01-20 2017-07-20 EpoStar Electronics Corp. Memory management method, memory storage device and memory control circuit unit
CN108984116A (en) * 2018-06-14 2018-12-11 浙江大华技术股份有限公司 A kind of flow control method and device of solid state hard disk garbage reclamation bandwidth
CN109977032A (en) * 2017-12-28 2019-07-05 北京忆恒创源科技有限公司 Junk data recycling and control method and its device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170206006A1 (en) * 2016-01-20 2017-07-20 EpoStar Electronics Corp. Memory management method, memory storage device and memory control circuit unit
CN109977032A (en) * 2017-12-28 2019-07-05 北京忆恒创源科技有限公司 Junk data recycling and control method and its device
CN108984116A (en) * 2018-06-14 2018-12-11 浙江大华技术股份有限公司 A kind of flow control method and device of solid state hard disk garbage reclamation bandwidth

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117785619A (en) * 2024-02-27 2024-03-29 深圳超盈智能科技有限公司 Method and system for monitoring chip storage state
CN117785619B (en) * 2024-02-27 2024-05-10 深圳超盈智能科技有限公司 Method and system for monitoring chip storage state

Also Published As

Publication number Publication date
CN117769699A (en) 2024-03-26

Similar Documents

Publication Publication Date Title
US9367340B2 (en) Resource management method and apparatus for virtual machine system, and virtual machine system
US10430347B2 (en) Power savings via dynamic page type selection
CN107885456B (en) Reducing conflicts for IO command access to NVM
EP2269132B1 (en) Storage system and control method thereof as well as program
CN108170369B (en) Host device and data transmission rate control method
US20120192186A1 (en) Computing Platform with Resource Constraint Negotiation
CN108170370B (en) Data storage device and data transmission rate control method
US10671141B2 (en) Storage device and method of controlling link state thereof
US11010094B2 (en) Task management method and host for electronic storage device
US11487478B2 (en) Memory system and method of controlling nonvolatile memory
WO2023035113A1 (en) Control method and apparatus for storage apparatus
CN110162396A (en) Method for recovering internal storage, device, system and storage medium
EP1970815A1 (en) Data transfering apparatus and information processing system
KR20150050085A (en) A buffer management method and apparatus for universal serial bus in a radio environment
JP6193189B2 (en) NAND background processing controller
CN109167740B (en) Data transmission method and device
CN110908595B (en) Storage device and information processing system
CN115033370B (en) Method and device for scheduling flash memory tasks in storage equipment, storage medium and equipment
CN112463028B (en) I/O processing method, system, equipment and computer readable storage medium
CN112463027B (en) I/O processing method, system, equipment and computer readable storage medium
CN107870877B (en) Method and system for managing data access in a storage system
US11321017B2 (en) Systems and methods for controlling completion rate of commands
CN114401072A (en) Dynamic cache control method and system for frame splitting and reordering queue based on HINOC protocol
US20240012578A1 (en) Data storage device for guaranteeing that system resources meet performance requirements, method of operating the same, and memory controller for the same
CN117119201B (en) Compressed video transmission method, device, equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21956302

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 202180100197.4

Country of ref document: CN

NENP Non-entry into the national phase

Ref country code: DE