CN111737163B - Data flow control method and device and solid state disk - Google Patents

Data flow control method and device and solid state disk Download PDF

Info

Publication number
CN111737163B
CN111737163B CN202010572869.9A CN202010572869A CN111737163B CN 111737163 B CN111737163 B CN 111737163B CN 202010572869 A CN202010572869 A CN 202010572869A CN 111737163 B CN111737163 B CN 111737163B
Authority
CN
China
Prior art keywords
data units
flow control
consumable
data
input
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202010572869.9A
Other languages
Chinese (zh)
Other versions
CN111737163A (en
Inventor
刘力锐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangsu Xinsheng Intelligent Technology Co ltd
Original Assignee
Jiangsu Xinsheng Intelligent Technology Co ltd
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 Jiangsu Xinsheng Intelligent Technology Co ltd filed Critical Jiangsu Xinsheng Intelligent Technology Co ltd
Priority to CN202010572869.9A priority Critical patent/CN111737163B/en
Publication of CN111737163A publication Critical patent/CN111737163A/en
Application granted granted Critical
Publication of CN111737163B publication Critical patent/CN111737163B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0253Garbage collection, i.e. reclamation of unreferenced memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0617Improving the reliability of storage systems in relation to availability
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Feedback Control In General (AREA)

Abstract

The invention discloses a data flow control method, a data flow control device and a solid state disk, wherein the number of the current consumable data units is dynamically adjusted by utilizing a proportional-integral-derivative control algorithm, so that the dynamic control of the input flow of user data is realized, the cycle of stopping GC due to repeated start is avoided, IO errors caused by exhaustion of data blocks are avoided, and the robustness and the usability of a storage system are enhanced. The method comprises the following steps: when the main body to be controlled enters a garbage recovery mode, acquiring the number of available data units of the main body to be controlled; calculating the number of available data units by using a proportional-integral-derivative control algorithm to obtain the number of currently consumable data units; and controlling the input flow of the user data according to the number of the current consumable data units, so that the difference between the number of the current consumable data units and the number of data units contained in the data block threshold in the garbage collection mode is not higher than a preset value.

Description

Data flow control method and device and solid state disk
Technical Field
The present invention relates to the field of data processing, and in particular, to a method and an apparatus for controlling data flow, and a solid state disk.
Background
The physical characteristics of a Flash memory (NAND Flash) determine that the minimum programming unit is a Page (Page) when programming the NAND Flash. For a memory Block (Block) that has already been programmed, a full Block erase is required before programming. Before erasing, the valid user data in Block needs to be migrated to another location. The process of identifying valid data and migrating it is called Garbage Collection (GC).
In a Solid State Disk (SSD) system, user data is written into Block sequentially. When Block is about to be written, SSD needs to release Block with less valid data (called Victim Block) by GC for receiving new user data. When the SSD system performs GC, a part of system resources need to be used, and during the process of GC, the traffic size of the received user data needs to be controlled, and if the traffic size is not controlled, idle Block is exhausted, and the user data cannot be received.
In the SSD system, a Flow Controller Module (FCM) is used to limit the size of user data received by the SSD, thereby avoiding Block exhaustion. The best state for flow control is to make the consumption of resources by user data equal to the resources released by the GC.
Current methods of implementing flow control are fixed flow control, flow control based on producer-consumer models, and segmented flow control.
However, the GC efficiency for fixed flow control is not constant, and the system may run into a cycle of repeatedly starting and stopping GC, resulting in severe performance fluctuations; the flow control based on the producer consumer model may cause that the resource used by the user data is actually larger than the resource released by the GC, and finally the Block is exhausted, IO error occurs and other problems; segmented flow control also causes severe performance fluctuations.
Disclosure of Invention
The invention aims to provide a data flow control method, a data flow control device and a solid state disk, wherein the number of the current consumable data units is dynamically adjusted by utilizing a proportional-integral-derivative control algorithm, so that the dynamic control of the input flow of user data is realized, the cycle of stopping GC due to repeated start is avoided, IO errors caused by exhaustion of data blocks are avoided, and the robustness and the usability of a storage system are enhanced.
A first aspect of the present invention provides a data flow control method, including:
when the main body to be controlled enters a garbage recovery mode, acquiring the number of available data units of the main body to be controlled;
calculating the number of available data units by using a proportional-integral-derivative control algorithm to obtain the number of the current consumable data units;
and controlling the input flow of the user data according to the number of the current consumable data units, so that the difference between the number of the current consumable data units and the number of data units contained in the data block threshold in the garbage collection mode is not higher than a preset value.
Further, calculating the number of available data units by using a proportional integral derivative control algorithm to obtain the current number of consumable data units, including:
taking the number of available data units as a first input value;
calculating a first input value by using a preset proportional-integral-derivative control function to obtain a first output value;
when the first output value is equal to the first input value, taking the first output value as the number of the current consumable data units;
and when the first output value is not equal to the first input value, taking the first output value as a second input value, and calculating the second input value by using a preset proportional-integral-derivative control function until the output value of the preset proportional-integral-derivative control function is equal to the input value.
Further, controlling the input flow of the user data according to the number of currently consumable data units includes:
setting a flow control proportionality coefficient according to the number of the current consumable data units;
acquiring input flow of user data, and determining the occupation speed of a current data unit according to the input flow of the user data;
acquiring the data unit release speed of a garbage recovery mode;
and controlling the input flow of the user data according to the flow control proportionality coefficient, the current data unit occupation speed and the data unit release speed of the garbage recovery mode.
Further, according to the flow control proportionality coefficient, the current data unit occupation speed and the data unit release speed of the garbage collection mode, the input flow of the user data is controlled, which includes:
calculating the number of consumable data units at a preset time point n and the number of consumable data units at a preset time point n-1 according to the current data unit occupation speed, the data unit release speed in the garbage recovery mode and the current number of consumable data units;
subtracting the number of the consumable data units at the preset time point n from the number of the consumable data units at the preset time point n-1 to obtain a consumable data unit difference value at the preset time point n;
calculating the sum of the difference values of the N consumable data units to obtain the sum of the difference values of the consumable data units, wherein N is a positive integer greater than 1;
calculating the difference value of the consumable data units at the preset time point n and the difference value of the consumable data units at the preset time point n-1 to obtain the difference value of the consumable data units at the preset time point n;
constructing a flow control formula according to the flow control proportionality coefficient, the difference value of the consumable data units at the preset time point n, the difference value of the consumable data units and the difference value of the consumable data units at the preset time point n;
and controlling the input flow of the user data according to the flow control formula.
Further, the method further comprises:
and when the main body to be controlled has no input and output of user data, exiting the garbage collection mode.
A second aspect of the present invention provides a data flow control apparatus, comprising:
the system comprises an acquisition module, a control module and a control module, wherein the acquisition module is used for acquiring the number of available data units of a main body to be controlled when the main body to be controlled enters a garbage recovery mode;
the proportional-integral-derivative control module is used for calculating the number of available data units by utilizing a proportional-integral-derivative control algorithm to obtain the number of the current consumable data units;
a flow control module for controlling the input flow of user data according to the number of data units currently consumable,
and the difference between the number of the currently consumable data units and the number of the data units contained in the data block threshold in the garbage collection mode is not higher than a preset value.
Further, the pid control module includes:
an input unit configured to take the number of available data units as a first input value;
the control unit is used for calculating a first input value by utilizing a preset proportional-integral-derivative control function to obtain a first output value;
the output unit is used for taking the first output value as the number of the currently consumable data units when the first output value is equal to the first input value;
and the feedback unit is used for taking the first output value as a second input value when the first output value is not equal to the first input value, and calculating the second input value by using a preset proportional-integral-derivative control function until the output value of the preset proportional-integral-derivative control function is equal to the input value.
Further, the flow control module is specifically configured to set a flow control proportionality coefficient according to the number of the current consumable data units;
the flow control module is also used for acquiring the input flow of the user data and determining the occupation speed of the current data unit according to the input flow of the user data;
the flow control module is also used for acquiring the data unit release speed of the garbage recovery mode;
and the flow control module is also used for controlling the input flow of the user data according to the flow control proportionality coefficient, the current data unit occupation speed and the data unit release speed in the garbage recovery mode.
Further, the flow control module is further configured to calculate the number of consumable data units at the preset time point n and the number of consumable data units at the preset time point n-1 according to the current data unit occupation speed, the data unit release speed in the garbage collection mode, and the current number of consumable data units;
the flow control module is also used for subtracting the number of the consumable data units at the preset time point n from the number of the consumable data units at the preset time point n-1 to obtain a consumable data unit difference value at the preset time point n;
the flow control module is also used for calculating the sum of the difference values of the N consumable data units to obtain the sum of the difference values of the consumable data units, wherein N is a positive integer greater than 1;
the flow control module is also used for calculating the difference value of the consumable data unit difference value of the preset time point n and the consumable data unit difference value of the preset time point n-1 to obtain the difference value of the consumable data unit difference value of the preset time point n;
the flow control module is also used for constructing a flow control formula according to the flow control proportionality coefficient, the difference value of the consumable data units at the preset time point n, the difference value of the consumable data units and the difference value of the consumable data units at the preset time point n;
and the flow control module is also used for controlling the input flow of the user data according to the flow control formula.
Further, the apparatus further comprises: and the garbage recovery mode control module is used for exiting the garbage recovery mode when the main body to be controlled does not have input and output of user data.
A third aspect of the present invention provides a solid state disk, including:
the data flow control apparatus of the second aspect, and performs the data flow control method of the first aspect.
Therefore, in the invention, when the main body to be controlled enters the garbage recovery mode, the number of the available data units of the main body to be controlled is obtained, the number of the available data units is calculated by using a proportional-integral-derivative control algorithm to obtain the number of the current consumable data units, and the input flow of the user data is controlled according to the number of the current consumable data units, so that the difference value between the number of the current consumable data units and the number of data units contained in the data block threshold value in the garbage recovery mode is not higher than the preset value. Compared with the existing fixed flow control, flow control based on a producer consumer model and sectional flow control, the method utilizes a proportional-integral-derivative control algorithm to dynamically adjust the number of the currently consumable data units, thereby realizing the dynamic control of the input flow of user data, avoiding the cycle of repeatedly starting and stopping a GC, avoiding IO errors caused by the exhaustion of data blocks, and enhancing the robustness and the usability of a storage system.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed in the prior art and the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic flowchart of an embodiment of a data traffic control method according to the present invention;
FIG. 2 is a circuit diagram showing an analog circuit of a preset PID control function provided by the present invention;
FIG. 3 is a schematic structural diagram of an embodiment of a data flow control device provided by the present invention;
FIG. 4 is a schematic structural diagram of another embodiment of a data flow control device provided by the present invention;
FIG. 5 is a schematic structural diagram of a data flow control device according to another embodiment of the present invention;
fig. 6 is a schematic structural diagram of an embodiment of a solid state disk provided in the present invention.
Detailed Description
The core of the invention is to provide a data flow control method, a data flow control device and a solid state disk, wherein the number of the current consumable data units is dynamically adjusted by using a proportional-integral-derivative control algorithm, so that the dynamic control of the input flow of user data is realized, the cycle of stopping GC (gas chromatography) due to repeated start is avoided, IO (input/output) errors caused by the exhaustion of data blocks are avoided, and the robustness and the usability of a storage system are enhanced.
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, an embodiment of the invention provides a data traffic control method, including:
101. when the main body to be controlled enters a garbage recovery mode, acquiring the number of available data units of the main body to be controlled;
in this embodiment, the main application scenario is an SSD system, and may specifically be another storage system, which is not limited. The embodiment of the invention is explained by a main body to be controlled. Generally, in an SSD system, each Data Block (Block) can be divided into a plurality of Data units (Data units, DUs), and a Valid Data table (VCT) is used in the SSD system to record the number of Valid DUs in each Block. Therefore, the VCT can determine the number of available Data units of the subject to be controlled, and when the number of Free Data blocks (Free Data blocks) is lower than the Data Block threshold in the Garbage Collection (GC) mode, the subject to be controlled enters the GC mode, and the input traffic of user Data needs to be controlled.
102. Calculating the number of available data units by using a proportional-integral-derivative control algorithm to obtain the number of currently consumable data units;
in this embodiment, as the GC proceeds, a part of the DU is released, and at the same time, the user data is also written into D U, so that the number of available data units is variable, and the number of available data units needs to be calculated by a proportional-Integral-differential (PID) algorithm to obtain the number of currently consumable data units.
103. And controlling the input flow of the user data according to the number of the current consumable data units, so that the difference between the number of the current consumable data units and the number of data units contained in the data block threshold in the garbage collection mode is not higher than a preset value.
In this embodiment, the input flow of the user data is controlled according to the current number of the consumable data units, so that the difference between the current number of the consumable data units and the number of data units included in the data block threshold in the garbage collection mode is not higher than the preset value.
In the embodiment of the invention, the number of the available data units is calculated by utilizing a proportional-integral-derivative control algorithm to obtain the number of the current consumable data units, and the input flow of the user data is controlled according to the number of the current consumable data units, so that the difference value between the number of the current consumable data units and the number of data units contained in the data block threshold in the garbage recovery mode is not higher than the preset value. Compared with the existing fixed flow control, flow control based on a producer consumer model and segmented flow control, the method utilizes a proportional-integral-derivative control algorithm to dynamically adjust the number of the current consumable data units, thereby realizing the dynamic control of the input flow of user data, avoiding the cycle of repeatedly starting and stopping a GC, avoiding the IO error caused by the exhaustion of a data block and enhancing the robustness and the usability of a storage system.
It should be noted that, because the PID in this embodiment makes the number of consumable data units not higher than the preset value, if the user data is not input or output, the garbage collection mode is exited.
Optionally, in some embodiments of the present invention, calculating the number of available data units by using a pid control algorithm to obtain the current number of consumable data units, includes:
taking the number of available data units as a first input value;
calculating a first input value by using a preset proportional-integral-derivative control function to obtain a first output value;
when the first output value is equal to the first input value, taking the first output value as the number of the current consumable data units;
and when the first output value is not equal to the first input value, taking the first output value as a second input value, and calculating the second input value by using a preset proportional-integral-derivative control function until the output value of the preset proportional-integral-derivative control function is equal to the input value.
In the embodiment of the present invention, an analog circuit for presetting a pid control function is shown in fig. 2, the preset pid control function is actually a combination of proportional control, integral control and derivative control, and the preset pid control function is specifically as follows:
Figure GDA0003735027110000081
where err (T) represents a difference between the first output value and the first input value, kp is a preset proportional parameter, T1 is a preset integration time, and TD is a preset differentiation time. Taking the first output value as the current number of consumable data units only when the first output value is equal to the first input value; and if the first output value is not equal to the first input value, taking the first output value as a second input value, calculating the second input value by using a preset proportional-integral-derivative control function, and circulating until the output value of the preset proportional-integral-derivative control function is equal to the input value.
Optionally, in some embodiments of the present invention, controlling the input flow of the user data according to the number of currently consumable data units includes:
setting a flow control proportionality coefficient according to the number of the current consumable data units;
acquiring input flow of user data, and determining the occupation speed of a current data unit according to the input flow of the user data;
acquiring the data unit release speed of a garbage recovery mode;
and controlling the input flow of the user data according to the flow control proportionality coefficient, the current data unit occupation speed and the data unit release speed of the garbage recovery mode.
In the embodiment of the invention, the flow control proportionality coefficient is related to the number of the current consumable data units, the input flow of the user data is obtained, the occupation speed of the current data unit is determined according to the input flow of the user data, and the occupation speed of the current data unit can be determined only according to the input flow of the user data because the size of the data unit is known. In the process of the garbage collection mode, the data unit release speed is known, and the input flow of the user data is controlled according to the flow control proportionality coefficient, the current data unit occupation speed and the data unit release speed of the garbage collection mode.
Optionally, in some embodiments of the present invention, controlling the input flow of the user data according to the flow control scaling factor, the current data unit occupation speed, and the data unit release speed in the garbage collection mode includes:
calculating the number of consumable data units at a preset time point n and the number of consumable data units at a preset time point n-1 according to the current data unit occupation speed, the data unit release speed in the garbage recovery mode and the current number of consumable data units;
subtracting the number of consumable data units at the preset time point n from the number of consumable data units at the preset time point n-1 to obtain a consumable data unit difference value at the preset time point n;
calculating the sum of the difference values of the N consumable data units to obtain the sum of the difference values of the consumable data units, wherein N is a positive integer greater than 1;
calculating the difference value of the consumable data unit difference value of the preset time point n and the consumable data unit difference value of the preset time point n-1 to obtain the difference value of the consumable data unit difference value of the preset time point n;
constructing a flow control formula according to the flow control proportionality coefficient, the difference value of the consumable data units at the preset time point n, the difference value of the consumable data units and the difference value of the consumable data units at the preset time point n;
and controlling the input flow of the user data according to the flow control formula.
In the embodiment of the invention, the flow control formula is generated as follows:
e (tn) is used to represent the difference between the number of consumable data units FreeDUprev at the preset time point n and the number of consumable data units FreeDUcur at the preset time point n-1, i.e. the difference between the consumable data units at the preset time point n, and is represented as:
E(tn)=FreeDUprev-FreeDUcur
calculating the sum of the difference values of the consumable data units of the N time nodes to obtain the difference value sum I (I) of the consumable data units, wherein the calculation mode is as follows:
Figure GDA0003735027110000101
calculating the difference between the difference value E (tn) of the consumable data units at the preset time point n and the difference value E (tn-1) of the consumable data units at the preset time point n-1 to obtain the difference value D (n) of the difference values of the consumable data units at the preset time point n, and expressing as:
D(n)=E(tn)-E(tn-1)
from E (tn), I (I), D (n), and the flow control scaling factor P, a flow control formula FC (t) is generated, expressed as:
FC(t)=P*(E(t)+I(t)+D(n))
since P in the flow control formula FC (t) is a flow control proportionality coefficient, which is set according to the number of currently consumable data units, the smaller the number of Free DUs, the larger P is, so as to avoid exhaustion of the Free DUs due to a longer adjustment period.
The flow rate control method is described in the above examples, and a flow rate control device to which the flow rate control method is applied will be described in detail below with reference to examples.
Referring to fig. 3, an embodiment of the present invention provides a data flow control apparatus, including:
an obtaining module 301, configured to obtain the number of available data units of a main body to be controlled when the main body to be controlled enters a garbage collection mode;
the pid control module 302 is configured to calculate the number of available data units by using a pid control algorithm to obtain the current number of consumable data units;
the flow control module 303 is configured to control an input flow of user data according to the number of currently consumable data units, so that a difference between the number of currently consumable data units and the number of data units included in the data block threshold in the garbage collection mode is not higher than a preset value.
In the embodiment of the present invention, when the main body to be controlled enters the garbage collection mode, the obtaining module 301 obtains the number of available data units of the main body to be controlled, the pid control module 302 calculates the number of available data units by using a pid control algorithm to obtain the current number of consumable data units, and the flow control module 303 controls the input flow of user data according to the current number of available data units, so that the difference between the current number of consumable data units and the number of data units included in the data block threshold in the garbage collection mode is not higher than the preset value. Compared with the existing fixed flow control, flow control based on a producer consumer model and segmented flow control, the method utilizes a proportional-integral-derivative control algorithm to dynamically adjust the number of the current consumable data units, thereby realizing the dynamic control of the input flow of user data, avoiding the cycle of repeatedly starting and stopping a GC, avoiding the IO error caused by the exhaustion of a data block and enhancing the robustness and the usability of a storage system.
Optionally, in combination with the embodiment shown in fig. 3, as shown in fig. 4, in some embodiments of the present invention, the pid control module 302 includes:
an input unit 401 for taking the number of available data units as a first input value;
a control unit 402, configured to calculate a first input value by using a preset pid control function, so as to obtain a first output value;
an output unit 403, configured to take the first output value as the current consumable data unit number when the first output value is equal to the first input value;
and a feedback unit 404 for calculating a second input value using a preset proportional-integral-derivative control function with the first output value as the second input value when the first output value is not equal to the first input value until an output value of the preset proportional-integral-derivative control function is equal to the input value.
In the embodiment of the present invention, the preset pid control function of the control unit 402 is actually a combination of proportional control, integral control and derivative control, and the preset pid control function is specifically as follows:
Figure GDA0003735027110000121
where err (T) represents a difference between the first output value and the first input value, kp is a preset proportional parameter, T1 is a preset integration time, and TD is a preset differentiation time. Taking the first output value as the current number of consumable data units only when the first output value is equal to the first input value; and if the first output value is not equal to the first input value, taking the first output value as a second input value, calculating the second input value by using a preset proportional-integral-derivative control function, and circulating until the output value of the preset proportional-integral-derivative control function is equal to the input value.
Alternatively, in conjunction with the embodiment shown in fig. 4, in some embodiments of the invention,
a flow control module 303, configured to set a flow control proportionality coefficient according to the number of currently consumable data units;
the flow control module 303 is further configured to obtain an input flow rate of the user data, and determine an occupation speed of the current data unit according to the input flow rate of the user data;
the flow control module 303 is further configured to obtain a data unit release speed in the garbage collection mode;
the flow control module 303 is further configured to control an input flow of the user data according to the flow control proportionality coefficient, an occupation speed of the current data unit, and a data unit release speed in the garbage collection mode.
Alternatively, in conjunction with the embodiment shown in fig. 4, in some embodiments of the invention,
the flow control module 303 is further configured to calculate, according to the current data unit occupation speed, the data unit release speed in the garbage collection mode, and the current number of consumable data units, the number of consumable data units at a preset time point n, and the number of consumable data units at a preset time point n-1;
the flow control module 303 is further configured to subtract the number of the consumable data units at the preset time point n from the number of the consumable data units at the preset time point n-1 to obtain a consumable data unit difference at the preset time point n;
the flow control module 303 is further configured to calculate a sum of difference values of the N consumable data units to obtain a sum of difference values of the consumable data units, where N is a positive integer greater than 1;
the flow control module 303 is further configured to calculate a difference between a difference of the consumable data units at the preset time point n and a difference of the consumable data units at the preset time point n-1, so as to obtain a difference of the consumable data units at the preset time point n;
the flow control module 303 is further configured to construct a flow control formula according to the flow control proportionality coefficient, the difference between the consumable data units at the preset time point n, the difference between the consumable data units, and the difference between the consumable data units at the preset time point n;
the flow control module 303 is further configured to control an input flow of the user data according to the flow control formula.
In the embodiment of the present invention, the process of the flow control module 303 generating the flow control formula is as follows:
e (tn) is used to represent the difference between the number of consumable data units FreeDUprev at the preset time point n and the number of consumable data units FreeDUcur at the preset time point n-1, i.e. the difference between the consumable data units at the preset time point n, and is represented as:
E(tn)=FreeDUprev-FreeDUcur
calculating the sum of the difference values of the consumable data units of the N time nodes to obtain the difference value sum I (I) of the consumable data units, wherein the calculation mode is as follows:
Figure GDA0003735027110000131
calculating the difference between the consumable data unit difference E (tn) at the preset time point n and the consumable data unit difference E (tn-1) at the preset time point n-1 to obtain the difference D (n) between the consumable data unit differences at the preset time point n, wherein the difference D (n) is represented as:
D(n)=E(tn)-E(tn-1)
from E (tn), I (I), D (n), and the flow control scaling factor P, a flow control formula FC (t) is generated, expressed as:
FC(t)=P*(E(t)+I(t)+D(n))
since P in the flow control formula FC (t) is a flow control proportionality coefficient, which is set according to the number of currently consumable data units, the smaller the number of Free DUs, the larger P is, so as to avoid exhaustion of the Free DUs due to a longer adjustment period.
Optionally, in combination with the embodiment shown in fig. 4, as shown in fig. 5, in some embodiments of the present invention, the flow control device further includes:
the garbage collection mode control module 501 is configured to exit the garbage collection mode when the to-be-controlled main body has no input/output of user data.
The main application scenario of the data flow control method and the data flow control apparatus described above is in a Solid State Disk (SSD) system, and thus, as shown in fig. 6, an embodiment of the present invention further provides a fixed hard disk, which includes:
the data flow control apparatus 601 described in the above embodiment, and performs the data flow control method described in the above embodiment.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (9)

1. A method for controlling data traffic, comprising:
when a main body to be controlled enters a garbage recovery mode, acquiring the number of available data units of the main body to be controlled;
calculating the number of the available data units by using a proportional integral derivative control algorithm to obtain the number of the current consumable data units;
controlling the input flow of user data according to the number of the current consumable data units, so that the difference value between the number of the current consumable data units and the number of data units contained in the data block threshold in the garbage collection mode is not higher than a preset value;
the controlling the input flow of the user data according to the current consumable data unit number comprises:
setting a flow control proportionality coefficient according to the number of the current consumable data units;
acquiring input flow of user data, and determining the occupation speed of a current data unit according to the input flow of the user data;
acquiring the data unit release speed of the garbage recovery mode;
and controlling the input flow of the user data according to the flow control proportionality coefficient, the current data unit occupation speed and the data unit release speed of the garbage collection mode.
2. The method of claim 1, wherein said calculating the number of available data units using a pid control algorithm to obtain a current number of consumable data units comprises:
taking the number of available data units as a first input value;
calculating the first input value by using a preset proportional-integral-derivative control function to obtain a first output value;
when the first output value is equal to the first input value, taking the first output value as the number of currently consumable data units;
and when the first output value is not equal to the first input value, taking the first output value as a second input value, and calculating the second input value by using the preset proportional-integral-derivative control function until the output value of the preset proportional-integral-derivative control function is equal to the input value.
3. The method of claim 2, wherein the controlling the input flow of the user data according to the flow control scaling factor, the current data unit occupation rate, and the data unit release rate in the garbage collection mode comprises:
according to the current data unit occupation speed, the data unit release speed of the garbage recovery mode and the current consumable data unit number, calculating to obtain the consumable data unit number at a preset time point n and the consumable data unit number at a preset time point n-1;
subtracting the number of consumable data units at the preset time point n from the number of consumable data units at the preset time point n-1 to obtain a consumable data unit difference value at the preset time point n;
calculating the sum of N difference values of the consumable data units to obtain the sum of the difference values of the consumable data units, wherein N is a positive integer greater than 1;
calculating the difference value of the consumable data unit difference value of the preset time point n and the consumable data unit difference value of the preset time point n-1 to obtain the difference value of the consumable data unit difference value of the preset time point n;
constructing a flow control formula according to the flow control proportionality coefficient, the difference value of the consumable data units at the preset time point n, the difference value of the consumable data units and the difference value of the consumable data units at the preset time point n;
and controlling the input flow of the user data according to the flow control formula.
4. The method according to any one of claims 1-3, further comprising:
and when the main body to be controlled has no input and output of user data, exiting the garbage collection mode.
5. A data flow control apparatus, comprising:
the system comprises an acquisition module, a control module and a control module, wherein the acquisition module is used for acquiring the number of available data units of a main body to be controlled when the main body to be controlled enters a garbage recovery mode;
the proportional-integral-derivative control module is used for calculating the number of the available data units by utilizing a proportional-integral-derivative control algorithm to obtain the number of the current consumable data units;
the flow control module is used for controlling the input flow of user data according to the number of the current consumable data units, so that the difference value between the number of the current consumable data units and the number of data units contained in the data block threshold in the garbage collection mode is not higher than a preset value;
the flow control module is specifically used for setting a flow control proportionality coefficient according to the number of the current consumable data units;
the flow control module is further used for acquiring the input flow of the user data and determining the occupation speed of the current data unit according to the input flow of the user data;
the flow control module is further configured to obtain a data unit release speed of the garbage collection mode;
and the flow control module is further used for controlling the input flow of the user data according to the flow control proportionality coefficient, the current data unit occupation speed and the data unit release speed in the garbage recovery mode.
6. The apparatus of claim 5, wherein the pid control module comprises:
an input unit for taking the number of available data units as a first input value;
the control unit is used for calculating the first input value by utilizing a preset proportional-integral-derivative control function to obtain a first output value;
an output unit, configured to take the first output value as a current consumable data unit number when the first output value is equal to the first input value;
and the feedback unit is used for taking the first output value as a second input value when the first output value is not equal to the first input value, and calculating the second input value by using the preset proportional-integral-derivative control function until the output value of the preset proportional-integral-derivative control function is equal to the input value.
7. The apparatus of claim 6,
the flow control module is further configured to calculate the number of consumable data units at a preset time point n and the number of consumable data units at a preset time point n-1 according to the current data unit occupation speed, the data unit release speed in the garbage collection mode, and the current number of consumable data units;
the flow control module is further configured to subtract the consumable data unit number at the preset time point n from the consumable data unit number at the preset time point n-1 to obtain a consumable data unit difference at the preset time point n;
the flow control module is further configured to calculate a sum of difference values of the N consumable data units to obtain a sum of difference values of the consumable data units, where N is a positive integer greater than 1;
the flow control module is further configured to calculate a difference between the consumable data unit difference at the preset time point n and the consumable data unit difference at the preset time point n-1, so as to obtain a difference between the consumable data unit differences at the preset time point n;
the flow control module is further configured to construct a flow control formula according to the flow control proportionality coefficient, the consumable data unit difference at the preset time point n, the consumable data unit difference, and the difference between the consumable data unit differences at the preset time point n;
and the flow control module is also used for controlling the input flow of the user data according to the flow control formula.
8. The apparatus of any one of claims 5-7, further comprising:
and the garbage recovery mode control module is used for exiting the garbage recovery mode when the main body to be controlled has no input and output of user data.
9. A solid state disk, comprising:
the data flow control apparatus of any of claims 5-8 and performing the data flow control method of any of claims 1-4.
CN202010572869.9A 2020-06-22 2020-06-22 Data flow control method and device and solid state disk Active CN111737163B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010572869.9A CN111737163B (en) 2020-06-22 2020-06-22 Data flow control method and device and solid state disk

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010572869.9A CN111737163B (en) 2020-06-22 2020-06-22 Data flow control method and device and solid state disk

Publications (2)

Publication Number Publication Date
CN111737163A CN111737163A (en) 2020-10-02
CN111737163B true CN111737163B (en) 2022-10-14

Family

ID=72650298

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010572869.9A Active CN111737163B (en) 2020-06-22 2020-06-22 Data flow control method and device and solid state disk

Country Status (1)

Country Link
CN (1) CN111737163B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108984116A (en) * 2018-06-14 2018-12-11 浙江大华技术股份有限公司 A kind of flow control method and device of solid state hard disk garbage reclamation bandwidth
CN109726137A (en) * 2017-10-27 2019-05-07 华为技术有限公司 Management method, controller and the solid state hard disk of solid state hard disk garbage reclamation task
CN110569561A (en) * 2019-08-16 2019-12-13 佛山科学技术学院 differential-integral order estimation method of fractional order PID controller
CN110908790A (en) * 2018-09-14 2020-03-24 旺宏电子股份有限公司 Memory storage device and operation method thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109726137A (en) * 2017-10-27 2019-05-07 华为技术有限公司 Management method, controller and the solid state hard disk of solid state hard disk garbage reclamation task
CN108984116A (en) * 2018-06-14 2018-12-11 浙江大华技术股份有限公司 A kind of flow control method and device of solid state hard disk garbage reclamation bandwidth
CN110908790A (en) * 2018-09-14 2020-03-24 旺宏电子股份有限公司 Memory storage device and operation method thereof
CN110569561A (en) * 2019-08-16 2019-12-13 佛山科学技术学院 differential-integral order estimation method of fractional order PID controller

Also Published As

Publication number Publication date
CN111737163A (en) 2020-10-02

Similar Documents

Publication Publication Date Title
CN102084318B (en) Power manager and method for managing power
CN107124442A (en) Resource dynamic regulation method and equipment based on user behavior
CN107463424B (en) Virtual machine migration method and device
CN111861412B (en) Completion time optimization-oriented scientific workflow scheduling method and system
TW201416858A (en) Memory device and host device
CN112416255A (en) User writing speed control method, device, equipment and medium
CN111142942A (en) Window data processing method and device, server and storage medium
CN111737163B (en) Data flow control method and device and solid state disk
KR102118799B1 (en) Apparatus and Method for managing power of processor in a mobile terminal device
CN113873074A (en) Control method, electronic device and computer storage medium
CN111813535A (en) Resource configuration determining method and device and electronic equipment
CN113325998B (en) Read-write speed control method and device
CN104636397A (en) Resource allocation method, computation speedup method and device for distributed computation
CN116185568A (en) Container expansion method and device, electronic equipment and storage medium
CN112783441B (en) Method and device for adjusting read-write speed limit of virtual machine disk and computing equipment
CN109634525B (en) Method and system for estimating effective capacity of storage system and related components
CN106202262B (en) Information processing method and electronic equipment
CN109660625B (en) Edge device control method, edge device and computer readable storage medium
CN110557339A (en) flow planning method and device, computer equipment and storage medium
JP4778538B2 (en) Storage data management system and storage data management program
CN109445996B (en) Method, system and related assembly for distributing IO stream
CN113639470A (en) Water quantity control method and device for water heater, water heater and storage medium
JP6787032B2 (en) Control devices, control methods, and control programs
JP2008257607A (en) Log file storage device and log file management method
Wardi et al. On-line optimization of switched-mode systems: Algorithms and convergence properties

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant