SSD dynamic power consumption management method and device, computer equipment and storage medium

By building a three-level linkage mechanism of power consumption level, token bucket and command execution in the SSD, the SSD power consumption is dynamically managed, solving the problem of lack of power consumption management in the existing technology and achieving flexible power consumption control and device compatibility guarantee.

CN120803238APending Publication Date: 2025-10-17SUZHOU UNIONMEMORY INFORMATION SYST LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511010764.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-22
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

The existing SSD interface protocol lacks a host-configurable power management interface, forcing host manufacturers to design power supply modules for maximum redundancy, increasing costs and hindering innovation. Users also face the risk of excessive power consumption when replacing SSDs, impacting device reliability.

Method used

By determining the power consumption level of the SSD, determining the total number of tokens in the token bucket based on the level, initializing the token bucket, and dynamically managing it based on the type of host command and the number of remaining tokens, a token bucket mechanism is built to control power consumption, forming a negative feedback closed loop to ensure that instantaneous power consumption does not exceed the limit.

Benefits of technology

It enables host manufacturers to configure power consumption thresholds on demand, eliminates redundant design and compatibility risks of power supply modules, gives terminal devices the ability to adapt to power consumption, and improves system robustness and flexibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120803238A_ABST
    Figure CN120803238A_ABST
Patent Text Reader

Abstract

The invention discloses an SSD dynamic power consumption management method and device, computer equipment and a storage medium, and relates to the technical field of SSD power consumption management. Determining a total number of tokens of the token bucket based on the power consumption gear; initializing a token bucket based on the total number of tokens; if the host command is received, determining the number of target tokens required by the host command; judging whether the number of the remaining tokens in the token bucket is greater than or equal to the number of the target tokens; if yes, distributing tokens of a target token number to the host command, and executing the host command; and if not, adding the host command to a preset command waiting queue. According to the SSD dynamic power consumption management method, the power consumption upper limit reference is established through power consumption gear setting, and it is ensured that the instantaneous power consumption of the SSD never exceeds the limit. Therefore, limitation of a protocol layer is broken through, a host manufacturer can configure a power consumption threshold according to needs, redundant design and compatibility risks of a power supply module are eliminated, and power consumption self-adaption capability is given to terminal equipment.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of SSD power consumption management, and particularly relates to a SSD dynamic power consumption management method and device, computer equipment and a storage medium. BACKGROUND

[0002] With the evolution of the solid state disk (SSD) interface technology to the PCIe Gen5 generation, the peak performance of consumer SSDs continues to improve, but is accompanied by a significant increase in power consumption. The PCIe Gen5 SSD products currently on the market can be divided into multiple levels according to the performance upper limit, and there are obvious differences in peak power consumption performance among SSDs of different levels, and the higher the performance of the product, the higher the power consumption output.

[0003] However, the existing SSD interface protocol (such as NVMe) has not defined any function characteristics that allow the host to dynamically configure the power consumption upper limit. Limited by this, the SSD products on the market all lack the ability to actively control the power consumption threshold. This technical gap leads to a double dilemma for host manufacturers in product design: on the one hand, in order to ensure hardware compatibility, the power supply module must be designed according to the highest peak power consumption specified in the SSD product manual, even if this power consumption only occurs in extreme load scenarios; on the other hand, strict material classification management is required for SSDs of different power consumption levels to match the power supply capacity of specific host products. This not only increases the complexity of host hardware design and material management costs, but also limits the flexibility of differentiated product design.

[0004] For end users, this technical defect also causes compatibility risks. When users replace or upgrade SSDs on their own, if the peak power consumption of the new device exceeds the carrying capacity of the original host power supply module, it is easy to cause abnormal operation of the device and even hardware damage. In the existing solution, there is no protocol layer mechanism to prevent such risks, nor is there a standardized means to achieve power consumption adaptation.

[0005] In summary, the existing technology has the following core defects:

[0006] Protocol layer function missing: lack of host-configurable SSD power consumption management interface, unable to dynamically constrain peak power consumption;

[0007] System design rigidity: host manufacturers are forced to design power supply modules with maximum redundancy, which increases costs and restricts innovation;

[0008] Insufficient compatibility protection: there is a risk of exceeding the power consumption limit when users replace SSDs, affecting device reliability.

[0009] These defects collectively constitute a technical bottleneck that restricts the coordinated development of SSD technology in high-performance and low-power consumption scenarios. SUMMARY

[0010] Embodiments of the present application provide a SSD dynamic power consumption management method, device, computer equipment and storage medium, aiming at solving the problem that the existing solid state disk cannot actively limit the upper limit of power consumption.

[0011] In a first aspect, the embodiments of the present application provide a SSD dynamic power consumption management method, which comprises:

[0012] determining a power consumption gear of the SSD;

[0013] determining a total token number of a token bucket based on the power consumption gear;

[0014] initializing the token bucket based on the total token number, wherein after initialization, the token bucket contains a token number equal to the total token number;

[0015] if a host command is received, determining a target token number required by the host command;

[0016] judging whether a remaining number of tokens in the token bucket is greater than or equal to the target token number;

[0017] if the remaining number of tokens in the token bucket is greater than or equal to the target token number, allocating tokens of the target token number to the host command, and executing the host command;

[0018] if the remaining number of tokens in the token bucket is less than the target token number, adding the host command to a preset command waiting queue.

[0019] Further technical solutions are that the determination of the power consumption gear of the SSD comprises:

[0020] receiving a power consumption gear configuration instruction;

[0021] configuring the power consumption gear of the SSD based on the power consumption gear configuration instruction.

[0022] Further technical solutions are that the determination of the total token number of the token bucket based on the power consumption gear comprises:

[0023] obtaining a preset gear-total token number mapping relationship;

[0024] determining the total token number corresponding to the power consumption gear based on the gear-total token number mapping relationship.

[0025] Further technical solutions are that the determination of the target token number required by the host command comprises:

[0026] determining a power consumption contribution coefficient corresponding to the host command based on a type of the host command;

[0027] Determine a target number of tokens required by the host command based on the power consumption contribution coefficient.

[0028] A further technical solution is that the method further comprises:

[0029] Determine the power consumption contribution coefficient corresponding to the host command of the preset type through experiment measurement.

[0030] A further technical solution is that the method further comprises:

[0031] If it is detected that the host command is executed, release the tokens occupied by the host command to the token bucket.

[0032] A further technical solution is that the method further comprises:

[0033] Detect the temperature of the SSD.

[0034] If the temperature of the SSD is greater than a preset temperature threshold, reduce the total number of tokens in the token bucket.

[0035] In a second aspect, the embodiments of the present application further provide an SSD dynamic power consumption management device, which comprises units for executing the above method.

[0036] In a third aspect, the embodiments of the present application further provide a computer device, which comprises a memory and a processor, the memory stores a computer program, and the processor implements the above method when executing the computer program.

[0037] In a fourth aspect, the embodiments of the present application further provide a computer readable storage medium, which stores a computer program, and the computer program can implement the above method when executed by a processor.

[0038] The embodiment of the present application provides a kind of SSD dynamic power management method, device, computer equipment and storage medium.Therein, the method comprises: determining the power consumption gear of SSD;Total token number of token bucket is determined based on the power consumption gear;The total token number is initialized based on the token bucket, wherein, after initialization, the token number contained in the token bucket is equal to the total token number;If a host command is received, determine the target token quantity required by the host command;Judge whether the remaining quantity of token in the token bucket is greater than or equal to the target token quantity;If the remaining quantity of token in the token bucket is greater than or equal to the target token quantity, allocate the target token quantity of token for the host command, and execute the host command;If the remaining quantity of token in the token bucket is less than the target token quantity, add the host command to the preset command waiting queue.This SSD dynamic power management method sets up power consumption upper limit benchmark through power consumption gear setting, converts physical power consumption into quantifiable resources through token bucket mechanism: initialize total quota corresponding to gear of full token bucket, and allocate token according to operation type difference when executing host command.Token reserve judgment dynamically controls command execution / queuing, forms negative feedback closed loop, and ensures that instantaneous power consumption is never over limit.Therefore, the protocol layer restriction is broken, the host manufacturer can configure power consumption threshold as needed, the redundancy design of power supply module and compatibility risk are eliminated, and the power consumption self-adaptive ability of terminal equipment is given. BRIEF DESCRIPTION OF DRAWINGS

[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0040] Figure 1 A flowchart of a SSD dynamic power management method provided by the embodiment of the present application is provided.

[0041] Figure 2 A performance-power curve diagram of SSD provided by the embodiment of the present application is provided.

[0042] Figure 3 A schematic block diagram of a computer device provided by the embodiment of the present application is provided. DETAILED DESCRIPTION

[0043] The technical solutions in the embodiments of the present application will be described clearly and completely in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0044] It should be understood that the terms "comprises" and "comprising," when used in this specification and the following claims, indicate the presence of the described features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0045] It should also be understood that the terms used in the specification and the appended claims are intended to be interpreted broadly and in a manner consistent with the principles of the prior art, and that references to a particular embodiment or a particular use of the application are intended to refer only to that specific embodiment or use, and that the use of the terms "comprise," "comprising," "include," "including," and the like are not intended to exclude or exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0046] It should be further understood that the term "and / or" used in the specification and the appended claims means one or more of the associated listed items, as well as all possible combinations of these combinations.

[0047] As used in this specification and the appended claims, the term "if" can be interpreted as meaning "when" or "once" or "in response to a determination" or "in response to detecting" depending on the context. Similarly, the phrase "if it is determined" or "if [a described condition or event] is detected" can be interpreted to mean "once it is determined" or "in response to a determination" or "upon detecting [a described condition or event]" or "in response to detecting [a described condition or event]" depending on the context.

[0048] Referring to Figure 1 The embodiment of the application provides a dynamic power consumption management method of SSD, which comprises the following steps:

[0049] S1, determining the power consumption gear of the SSD.

[0050] In specific implementation, the SSD is provided with multiple power gears, such as 5W, 8W, 10W, etc., which are not specifically limited by the application. The power consumption gear of the SSD can be set by the user according to actual needs.

[0051] For example, in some preferred embodiments, the above step "determining the power consumption gear of the SSD" specifically comprises the following steps: receiving a power consumption gear configuration instruction; and configuring the power consumption gear of the SSD based on the power consumption gear configuration instruction.

[0052] In specific implementation, the power consumption gear configuration instruction is issued by the host, and the SSD receives the power consumption gear configuration instruction and configures the power consumption gear of the SSD based on the power consumption gear configuration instruction.

[0053] Specifically, the NVME protocol allows manufacturers to implement specific functions through a custom SET FEATURE command, and the Feature command defined in the application is shown in Table 1. The host can set the power consumption mode of the SSD through the command according to its own working scene requirements.

[0054] Table 1. NVMe Set Feature command definition table

[0055]

[0056]

[0057] In the application, by receiving and responding to the power consumption gear configuration instruction issued by the host, the dynamic programmable capability of the system-level power consumption strategy is given:

[0058] Host-led power consumption strategy: the host can send a configuration instruction to switch the SSD gear according to the real-time power supply state (such as battery power less than 20%) or performance requirement (such as starting game mode). For example, after switching from 7W balanced gear to 5W energy-saving gear, the total token number of the token bucket is reduced synchronously, so that the SSD can immediately respond to the system power saving requirement without relying on hardware modification.

[0059] Cross-platform standardized management: the instruction interface provides a channel for OS layer unified power consumption management. The Windows power management module can directly issue a gear instruction through the NVMe drive, so that SSDs of different manufacturers follow the same power saving strategy, eliminating the fragmentation problem caused by private interfaces and simplifying the material management cost of OEM manufacturers.

[0060] S2, determining the total token number of the token bucket based on the power consumption gear.

[0061] In specific implementation, the total token number of the token bucket is determined according to the power consumption gear of the SSD, and the total token number refers to the maximum number of tokens that the token bucket can contain.

[0062] For example, in some preferred embodiments, the above step of "determining the total token number of the token bucket based on the power consumption gear" specifically includes the following steps: obtaining a preset gear-total token number mapping relationship; determining the total token number corresponding to the power consumption gear based on the gear-total token number mapping relationship.

[0063] In the embodiment of the application, the quantitative design based on the preset gear-total token number mapping relationship ensures the accuracy and scalability of power consumption control. The mapping relationship converts the abstract power consumption value (such as 7W) into the discrete total token number (such as 7000 tokens), and the adjustment of the power consumption threshold can be realized by increasing the number of gears (such as adding a 6W gear).

[0064] S3, initializing the token bucket based on the total number of tokens, wherein after the initialization, the token bucket contains the total number of tokens.

[0065] In specific embodiments, the token bucket is initialized based on the total number of tokens, and specifically, after the initialization, the token bucket contains the total number of tokens.

[0066] S4, determining the target number of tokens required by the host command if the host command is received.

[0067] In specific embodiments, the target number of tokens required by the host command is determined after the host command is received. Specifically, the power consumption value (i.e., power consumption contribution coefficient) required by each host command is measured in advance, and the quotient of the power consumption value of the host command and the reference power consumption value corresponding to each token is calculated to obtain the target number of tokens required by the host command.

[0068] For example, in some preferred embodiments, the above step of "determining the target number of tokens required by the host command" specifically includes the following steps: determining the power consumption contribution coefficient corresponding to the host command based on the type of the host command; and determining the target number of tokens required by the host command based on the power consumption contribution coefficient.

[0069] In specific embodiments, the power consumption contribution coefficients corresponding to different types of host commands are measured in advance, and the target number of tokens required by the host command is further determined based on the power consumption contribution coefficients. Specifically, a preset power consumption contribution coefficient-token number mapping relationship is obtained; and the target number of tokens corresponding to the power consumption contribution coefficient is determined based on the power consumption contribution coefficient-token number mapping relationship.

[0070] In some preferred embodiments, the method further includes: measuring the power consumption contribution coefficient corresponding to a host command of a preset type through experiments.

[0071] In specific embodiments, as shown in Table 2, referring to a typical SSD high-load working scenario, appropriate test tools and corresponding configuration items are selected, performance data and SSD power consumption data are recorded during the test process, and a performance-power consumption curve diagram as shown in FIG. 1 is generated. Figure 2

[0072] Table 2. SSD high-load working scenario test table

[0073] Test Type Load Description Corresponding tool parameter example Sequential Write Continuous large file write IOMeter 10 minute sequential write Sequential Read Continuous large file read IOMeter 32 GB range sequential read 4K stress random read High concurrency small file read IOMeter 32 GB range 8 thread 4KB random read 4K stress random write High concurrency small file write IOMeter 32 GB range 8 thread 4KB random write

[0074] ​Based on the SSD power performance curve, the power consumption contribution coefficient of NAND FLASH data access under different models is calculated, and the formula is: power consumption contribution coefficient = power consumption / performance x unit command data volume calculation, and the results are shown in Table 3 (the performance and power consumption data in Table 3, the NAND FLASH access model is related to the master control design and medium parameters, and the correct data needs to be obtained according to different SSD designs).

[0075] Table 3. Power consumption contribution coefficient calculation table

[0076]

[0077] S5, determining whether the remaining number of tokens in the token bucket is greater than or equal to the target token number.

[0078] In specific implementation, after determining the target token number required by the host command, it is determined whether the remaining number of tokens in the token bucket is greater than or equal to the target token number.

[0079] S6, if the remaining number of tokens in the token bucket is greater than or equal to the target token number, the target token number of tokens is allocated to the host command, and the host command is executed.

[0080] In specific implementation, if the remaining number of tokens in the token bucket is greater than or equal to the target token number, the target token number of tokens is allocated to the host command, and the host command is executed.

[0081] Further, in some preferred embodiments, the method further comprises: if it is detected that the host command execution is completed, releasing the tokens occupied by the host command to the token bucket.

[0082] In specific implementation, the closed-loop mechanism of releasing tokens when the host command is completed maintains the dynamic balance of the token bucket. The principle is: the tokens occupied during the execution of each command represent a "temporary power quota", and the tokens are returned to the bucket immediately after the command is completed (such as returning 3 tokens when the write command is completed), so that the subsequent command can reuse the quota.

[0083] For example, when the SSD continuously executes multiple write commands, token recycling and timely replenishment can avoid a long waiting queue; and when the burst load ends, the tokens can be quickly accumulated to respond to new requests. The effect realizes the sustainability of power consumption control - it allows instantaneous load to break through the average power consumption (as long as the tokens are sufficient), and can also constrain the long-term power level through the recycling mechanism, achieving the optimal balance between performance and power consumption.

[0084] S7, if the remaining number of tokens in the token bucket is less than the target token number, the host command is added to a preset command waiting queue.

[0085] In a specific implementation, if the remaining number of tokens in the token bucket is less than the target token number, the host command is added to a preset command waiting queue, and the host command is executed when the remaining number of tokens in the token bucket is greater than or equal to the target token number.

[0086] In some preferred embodiments, the method further comprises: detecting the temperature of the SSD; and reducing the total number of tokens in the token bucket if the temperature of the SSD is greater than a preset temperature threshold.

[0087] In a specific implementation, the temperature threshold can be set by those skilled in the art, and the present application does not specifically limit it. When the temperature of the SSD is greater than the preset temperature threshold, the total number of tokens in the token bucket is reduced, for example, by 10%-50% in proportion, and the present application does not specifically limit it. Further, when the temperature falls below the threshold, the original total number of tokens is restored.

[0088] In a specific implementation, the temperature-triggered total token number reduction mechanism increases the level of overheat protection. When the temperature sensor detects that the SSD exceeds the threshold (such as NAND flash > 85℃), the system automatically reduces the total token number (for example, from 100 to 70), which is equivalent to temporarily shrinking the upper limit of power consumption. The principle is that high temperature is often caused by continuous high power consumption (such as full-disk backup scenario), and reducing the token number will force the subsequent command to enter the waiting queue, giving the heat dissipation module time to recover. This design creates a double protection: on the basis of protocol layer flow control, hardware state feedback is superimposed, for example, when the SSD overheats due to poor heat dissipation, it automatically downshifts (such as 15W→10W) without the need for host intervention, preventing data loss or device damage caused by thermal runaway. The final effect is to improve the robustness of the system under extreme conditions, especially suitable for thermal management scenarios of compact devices.

[0089] The embodiment of the application provides a kind of SSD dynamic power consumption management method, comprising: determining the power consumption gear of SSD;Total token number of token bucket is determined based on the power consumption gear;Total token number is based on the initialization token bucket of the total token number, wherein, after initialization, the token number contained in the token bucket is equal to the total token number;If a host command is received, determine the target token quantity required by the host command;Judge whether the remaining number of tokens in the token bucket is greater than or equal to the target token quantity;If the remaining number of tokens in the token bucket is greater than or equal to the target token quantity, allocate the target token quantity of tokens for the host command, and execute the host command;If the remaining number of tokens in the token bucket is less than the target token quantity, add the host command to the preset command waiting queue.The SSD dynamic power consumption management method builds a three-level linkage mechanism of power consumption gear-token quantization-command execution, and actively restricts the maximum power consumption of the solid state disk for the first time in the protocol layer.The technical effect is specifically shown as follows: by determining the SSD power consumption gear to establish the basic control parameter, the host can set the power consumption upper limit threshold according to the system power supply capacity or heat dissipation demand, and solve the defect that the host must design the power supply module according to the maximum redundant power consumption of the SSD in the traditional scheme from the root;The process of determining the total token number of the token bucket based on the power consumption gear converts the physical power consumption into a quantifiable virtual resource, forming a token budget pool strictly corresponding to the power consumption upper limit;Initialization full token bucket ensures that the initial state has complete power consumption quota, laying a foundation for dynamic allocation.When the host command arrives, determine the target token quantity required by the command to realize the differentiated power consumption measurement of different operation types, so that heterogeneous loads such as reading and writing can accurately match their actual energy consumption characteristics;Token remaining amount judgment and allocation mechanism constitute the core control closed loop: if the remaining token is sufficient, immediately allocate and execute the command to guarantee real-time performance utilization rate;If the token is insufficient, the command is moved to the waiting queue, and the instantaneous power consumption peak is forcedly restricted by delayed execution.This design essentially builds a flow control system based on token feedback model-the total token quantity is limited by power consumption gear, command execution consumes tokens equivalent to power consumption quota, and command queuing mechanism forms negative feedback regulation, which ensures that the actual power consumption of SSD is always less than or equal to the gear setting value.Finally, it breaks through the bottleneck of prior art: host manufacturers can be free from the dependence on the nominal peak power consumption of SSD, and flexibly configure the power consumption gear according to product form (such as thin and light notebook or server), significantly reducing the design redundancy and material management cost of power supply module;When terminal user replaces SSD, the system automatically restricts the power consumption of new equipment according to the preset gear, and completely eliminates the compatibility risk caused by power consumption overrun;At the same time, it creates a new dimension for differentiated product design, such as realizing dynamic conversion of "performance mode" and "silent mode" by gear switching on the same hardware platform, promoting the coordinated development of high performance and low power consumption scenarios.

[0090] Corresponding to the above SSD dynamic power management method, the application also provides an SSD dynamic power management device. The SSD dynamic power management device includes units for executing the above SSD dynamic power management method, and the SSD dynamic power management device can be configured in a desktop computer, a tablet computer, a laptop computer, and the like terminal. Specifically, the SSD dynamic power management device includes:

[0091] A first determination unit is configured to determine a power consumption gear of the SSD;

[0092] A second determination unit is configured to determine a total token number of a token bucket based on the power consumption gear;

[0093] An initialization unit is configured to initialize the token bucket based on the total token number, wherein after initialization, the token bucket contains a token number equal to the total token number;

[0094] A third determination unit is configured to determine a target token number required by a host command if the host command is received;

[0095] A judgment unit is configured to judge whether a remaining number of tokens in the token bucket is greater than or equal to the target token number;

[0096] An allocation unit is configured to allocate tokens of the target token number to the host command and execute the host command if the remaining number of tokens in the token bucket is greater than or equal to the target token number;

[0097] A queuing unit is configured to add the host command to a preset command waiting queue if the remaining number of tokens in the token bucket is less than the target token number.

[0098] In some preferred embodiments, the determination of the power consumption gear of the SSD includes:

[0099] Receiving a power consumption gear configuration instruction;

[0100] Configuring the power consumption gear of the SSD based on the power consumption gear configuration instruction.

[0101] In some preferred embodiments, the determination of the total token number of the token bucket based on the power consumption gear includes:

[0102] Obtaining a preset gear-total token number mapping relationship;

[0103] Determining the total token number corresponding to the power consumption gear based on the gear-total token number mapping relationship.

[0104] In some preferred embodiments, the determination of the target token number required by the host command includes:

[0105] determine a power consumption contribution coefficient corresponding to the host command based on a type of the host command;

[0106] determine a target token quantity required by the host command based on the power consumption contribution coefficient.

[0107] In some preferred embodiments, the SSD dynamic power consumption management apparatus further comprises:

[0108] a measurement unit configured to measure the power consumption contribution coefficient corresponding to the host command of the preset type through experiments.

[0109] In some preferred embodiments, the SSD dynamic power consumption management apparatus further comprises:

[0110] a release unit configured to release the token occupied by the host command into the token bucket if it is detected that the host command is executed.

[0111] In some preferred embodiments, the SSD dynamic power consumption management apparatus further comprises:

[0112] a detection unit configured to detect a temperature of the SSD;

[0113] an adjustment unit configured to reduce the total token quantity of the token bucket if the temperature of the SSD is greater than a preset temperature threshold.

[0114] It should be noted that the specific implementation process of the SSD dynamic power consumption management apparatus and each unit can be clearly understood by those skilled in the art, which can be referred to the corresponding description in the foregoing method embodiments. For the convenience and brevity of description, it will not be repeated here.

[0115] The SSD dynamic power consumption management apparatus can be implemented in the form of a computer program, which can run on a computer device as shown in Figure 3 .

[0116] Please refer to Figure 3 , Figure 3 is a schematic block diagram of a computer device provided by an embodiment of the present application. The computer device 500 can be a terminal or a server, wherein the terminal can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, a wearable device, and an electronic device with a communication function. The server can be a stand-alone server or a server cluster composed of multiple servers.

[0117] The computer device 500 includes a processor 502, a memory, and a network interface 505 connected through a system bus 501, wherein the memory can include a non-volatile storage medium 503 and an internal memory 504.

[0118] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032, when executed, can cause the processor 502 to perform an SSD dynamic power consumption management method.

[0119] The processor 502 is configured to provide computing and control capabilities to support the operation of the entire computer device 500.

[0120] The non-volatile storage medium 503 provides an environment for the computer program 5032 stored therein to run, and the computer program 5032, when executed by the processor 502, can cause the processor 502 to perform an SSD dynamic power consumption management method.

[0121] The network interface 505 is configured to perform network communication with other devices. Those skilled in the art can understand that the above structure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device 500 to which the scheme of the present application is applied. The specific computer device 500 can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.

[0122] The processor 502 is configured to run the computer program 5032 stored in the memory to implement the following steps:

[0123] Determine the power consumption gear of the SSD;

[0124] Determine the total number of tokens of the token bucket based on the power consumption gear;

[0125] Initialize the token bucket based on the total number of tokens, wherein after initialization, the token bucket contains a number of tokens equal to the total number of tokens;

[0126] If a host command is received, determine the target number of tokens required by the host command;

[0127] Determine whether the remaining number of tokens in the token bucket is greater than or equal to the target number of tokens;

[0128] If the remaining number of tokens in the token bucket is greater than or equal to the target number of tokens, allocate the target number of tokens for the host command, and execute the host command;

[0129] If the remaining number of tokens in the token bucket is less than the target number of tokens, add the host command to a pre-set command waiting queue.

[0130] In some preferred embodiments, the determination of the power consumption gear of the SSD comprises:

[0131] Receive a power consumption gear configuration instruction;

[0132] configure a power consumption gear of the SSD based on the power consumption gear configuration instruction.

[0133] In some preferred embodiments, the determining the total token number of the token bucket based on the power consumption gear comprises:

[0134] obtaining a preset gear-total token number mapping relationship;

[0135] determining the total token number corresponding to the power consumption gear based on the gear-total token number mapping relationship.

[0136] In some preferred embodiments, the determining the target token number required by the host command comprises:

[0137] determining a power consumption contribution coefficient corresponding to the host command based on the type of the host command;

[0138] determining the target token number required by the host command based on the power consumption contribution coefficient.

[0139] In some preferred embodiments, the method further comprises:

[0140] measuring the power consumption contribution coefficient corresponding to the preset type of host command through experiments.

[0141] In some preferred embodiments, the method further comprises:

[0142] if it is detected that the host command is executed, releasing the token occupied by the host command to the token bucket.

[0143] In some preferred embodiments, the method further comprises:

[0144] detecting the temperature of the SSD;

[0145] if the temperature of the SSD is greater than a preset temperature threshold, reducing the total token number of the token bucket.

[0146] It should be understood that, in the embodiments of the present application, the processor 502 can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0147] It can be understood by those skilled in the art that all or part of the processes in the above-mentioned embodiments can be completed by a computer program instructing related hardware. The computer program can be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the process steps of the above-mentioned embodiments.

[0148] Therefore, the present application also provides a storage medium. The storage medium can be a computer-readable storage medium. The storage medium stores a computer program. When the computer program is executed by a processor, the processor executes the following steps:

[0149] determining a power consumption gear of the SSD;

[0150] determining a total token number of a token bucket based on the power consumption gear;

[0151] initializing the token bucket based on the total token number, wherein after the initialization, the token bucket contains a token number equal to the total token number;

[0152] if a host command is received, determining a target token number required by the host command;

[0153] judging whether a remaining token number in the token bucket is greater than or equal to the target token number;

[0154] if the remaining token number in the token bucket is greater than or equal to the target token number, allocating the target token number of tokens for the host command, and executing the host command;

[0155] if the remaining token number in the token bucket is less than the target token number, adding the host command to a preset command waiting queue.

[0156] In some preferred embodiments, determining the power consumption level of the SSD includes:

[0157] Receive power consumption level configuration instructions;

[0158] The power consumption level of the SSD is configured based on the power consumption level configuration instruction.

[0159] In some preferred embodiments, determining the total number of tokens in the token bucket based on the power consumption level includes:

[0160] Get the preset mapping relationship between gear position and total number of tokens;

[0161] Based on the gear-total token number mapping relationship, the total token number corresponding to the power consumption gear is determined.

[0162] In some preferred embodiments, determining the target number of tokens required for the host command includes:

[0163] Determining a power consumption contribution coefficient corresponding to the host command based on the type of the host command;

[0164] Based on the power consumption contribution coefficient, a target number of tokens required for the host command is determined.

[0165] In some preferred embodiments, the method further comprises:

[0166] The power consumption contribution coefficient corresponding to the preset type of host command is measured through experiments.

[0167] In some preferred embodiments, the method further comprises:

[0168] If it is detected that the execution of the host command is completed, the token occupied by the host command is released to the token bucket.

[0169] In some preferred embodiments, the method further comprises:

[0170] detecting the temperature of the SSD;

[0171] If the temperature of the SSD is greater than a preset temperature threshold, the total number of tokens in the token bucket is reduced.

[0172] The storage medium is a physical, non-transient storage medium, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a magnetic disk, or an optical disk, etc. Any physical storage medium capable of storing program code can be non-volatile or volatile.

[0173] Those skilled in the art can understand that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been described in the above description in a general manner. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A person skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0174] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of each unit is only a logical function division, and actual implementation can have another division manner. For example, a plurality of units or components can be combined or integrated into another system, or some features can be omitted or not executed.

[0175] The steps in the method embodiments of the present application can be sequentially adjusted, combined and deleted according to actual needs. The units in the device embodiments of the present application can be combined, divided and deleted according to actual needs. In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit.

[0176] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a storage medium. Based on such understanding, the technical solutions of the present application essentially or say the part that contributes to the prior art, or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a plurality of instructions for causing a computer device (which can be a personal computer, a terminal or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application.

[0177] In the above embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.

[0178] Obviously, those skilled in the art can make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, these modifications and variations of the present application are intended to be included 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.

[0179] The above merely illustrates the specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and any skilled person in the art can easily think of various equivalent modifications or replacements within the technical range disclosed by the present application, and these modifications or replacements shall be covered within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims

1. A method for managing SSD dynamic power consumption, characterized in that: include: Determine the power consumption level of the SSD; Determine the total number of tokens in the token bucket based on the power consumption level; Initializing the token bucket based on the total number of tokens, wherein after initialization, the number of tokens contained in the token bucket is equal to the total number of tokens; If a host command is received, determining a target number of tokens required by the host command; Determine whether the remaining number of tokens in the token bucket is greater than or equal to the target number of tokens; If the remaining number of tokens in the token bucket is greater than or equal to the target number of tokens, allocate the target number of tokens to the host command and execute the host command; If the remaining number of tokens in the token bucket is less than the target number of tokens, the host command is added to a preset command waiting queue.

2. The SSD dynamic power management method according to claim 1, wherein: Determining the power consumption level of the SSD includes: Receive power consumption level configuration instructions; The power consumption level of the SSD is configured based on the power consumption level configuration instruction.

3. The SSD dynamic power management method according to claim 1, wherein: The determining the total number of tokens in the token bucket based on the power consumption level includes: Get the preset mapping relationship between gear position and total number of tokens; Based on the gear-total token number mapping relationship, the total token number corresponding to the power consumption gear is determined.

4. The SSD dynamic power management method according to claim 1, wherein: Determining the target number of tokens required for the host command includes: Determining a power consumption contribution coefficient corresponding to the host command based on the type of the host command; Based on the power consumption contribution coefficient, a target number of tokens required for the host command is determined.

5. The SSD dynamic power management method according to claim 4, characterized in that: The method further comprises: The power consumption contribution coefficient corresponding to the preset type of host command is measured through experiments.

6. The SSD dynamic power management method according to claim 1, wherein: The method further comprises: If it is detected that the execution of the host command is completed, the token occupied by the host command is released to the token bucket.

7. The SSD dynamic power management method according to claim 1, wherein: The method further comprises: detecting the temperature of the SSD; If the temperature of the SSD is greater than a preset temperature threshold, the total number of tokens in the token bucket is reduced.

8. An SSD dynamic power management device, characterized in that: The method comprises means for performing the method according to any one of claims 1 to 7.

9. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that The storage medium stores a computer program, and when the computer program is executed by a processor, the computer program can implement the method according to any one of claims 1 to 7.