A method for controlling a data flow in a storage device, comprising: obtaining (S201) a cache input and output parameter, wherein the cache input and output parameter comprises a cache water mark, and the cache water mark is used to indicate a proportion of an amount of data stored in a cache to a cache capacity; determining (S202) whether the cache input and output parameter meets an overload condition, wherein the overload condition comprises that: the cache water mark is higher than a first water mark threshold; when the cache input and output parameter meets the overload condition, obtaining (S203) a first bandwidth value, wherein the first bandwidth value is less than a current flushing bandwidth value of the cache, wherein the current flushing bandwidth value is an amount of data written into a storage pool per unit time; determining (S204) a quantity of tokens based on the first bandwidth value; and controlling the data flow in the storage device by using the quantity of tokens so that incoming traffic of the cache is reduced; wherein the cache input and output parameter further comprises a cache flushing concurrent usage proportion, and the overload condition further comprises that: the cache flushing concurrent usage proportion is greater than a target proportion threshold, wherein the cache flushing concurrent usage proportion is a proportion of flushing concurrency that is currently used by the cache to maximum flushing concurrency that can be used by the cache, wherein a flushing concurrency indicates a quantity of write requests that are cached and that are concurrently delivered to the storage pool. obtaining (S201) a cache input and output parameter, wherein the cache input and output parameter comprises a cache water mark, and the cache water mark is used to indicate a proportion of an amount of data stored in a cache to a cache capacity; determining (S202) whether the cache input and output parameter meets an overload condition, wherein the overload condition comprises that: the cache water mark is higher than a first water mark threshold; when the cache input and output parameter meets the overload condition, obtaining (S203) a first bandwidth value, wherein the first bandwidth value is less than a current flushing bandwidth value of the cache, wherein the current flushing bandwidth value is an amount of data written into a storage pool per unit time; determining (S204) a quantity of tokens based on the first bandwidth value; and controlling the data flow in the storage device by using the quantity of tokens so that incoming traffic of the cache is reduced; wherein the cache input and output parameter further comprises a cache flushing concurrent usage proportion, and the overload condition further comprises that: the cache flushing concurrent usage proportion is greater than a target proportion threshold, wherein the cache flushing concurrent usage proportion is a proportion of flushing concurrency that is currently used by the cache to maximum flushing concurrency that can be used by the cache, wherein a flushing concurrency indicates a quantity of write requests that are cached and that are concurrently delivered to the storage pool. <EOS>