Power supply method of storage device, terminal device and storage medium
By obtaining the voltage range and matching the storage device when it is connected, and dynamically adjusting the power supply voltage, the problem of excessive power consumption in traditional power supply methods is solved, and the low power consumption requirement of the storage device is achieved.
Patent Information
- Application Number
- CN202411972268.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-05-13
AI Technical Summary
The traditional storage device power supply method uses a fixed voltage to supply power, and cannot be flexibly adjusted according to the actual needs and characteristics of the storage device, which is prone to excessive power consumption.
When the storage device is connected, it obtains its voltage range, and matches the voltage according to the range, determines the target voltage of the storage device, and dynamically adjusts the power supply voltage.
By dynamically adjusting the voltage, the minimum effective voltage required by the storage device can be determined and applied, which significantly reduces the power consumption of the storage device, which meets the storage device's demand for low power consumption.
Smart Images

Figure CN119987512A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of semiconductor technology, and in particular relates to a power supply method for a storage device, a terminal device and a storage medium. Background Art
[0002] Storage devices, such as SD cards, are widely used in various electronic devices. However, as devices are upgraded, power consumption requirements continue to decrease, and how to effectively manage the power consumption of storage devices has become an important issue.
[0003] Traditional storage device power supply methods often use a fixed voltage for power supply, which cannot be flexibly adjusted according to the actual needs and characteristics of the storage device, and is prone to excessive power consumption. A new technical means is needed to solve the above technical problems. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a power supply method for a storage device, a terminal device and a storage medium, which can solve the problem that the power supply method for a storage device in the related art is prone to excessive power consumption.
[0005] A first aspect of the present invention provides a power supply method for a storage device, comprising:
[0006] When the storage device is connected, the voltage range of the storage device is obtained;
[0007] According to the voltage range, matching the power voltage of the storage device to determine a first target voltage of the storage device;
[0008] A power supply operation is performed for the storage device according to the first target voltage.
[0009] Optionally, in a first implementation of the first aspect of the present invention, the power voltage of the storage device includes a plurality of power levels;
[0010] The step of matching the power voltage of the storage device according to the voltage range to determine the first target voltage of the storage device includes:
[0011] Within the voltage range, the power voltage of the storage device is matched in a plurality of power levels to determine a first target voltage of the storage device.
[0012] Optionally, in a second implementation of the first aspect of the present invention, each power level has a different voltage;
[0013] The step of matching the power voltage of the storage device in a plurality of power levels within the voltage range to determine a first target voltage of the storage device includes:
[0014] Among the multiple power consumption gears, adaptation is performed one by one from high to low until a first target voltage is determined, wherein the first target voltage is within the voltage range.
[0015] Optionally, in a third implementation of the first aspect of the present invention, after the step of performing a power supply operation for the storage device according to the first target voltage, the power supply method for the storage device further includes:
[0016] Detect the current read-write environment of the storage device and obtain the stability coefficient;
[0017] determining a second target voltage corresponding to the storage device according to the stability coefficient;
[0018] A power supply operation is performed for the storage device according to the second target voltage.
[0019] Optionally, in a fourth implementation manner of the first aspect of the present invention, detecting the current read / write environment of the storage device to obtain a stability coefficient includes:
[0020] Receiving verification information from a host system, wherein the verification information includes communication data and verification information;
[0021] The current read-write environment of the storage device is detected according to the communication data and the verification information to obtain the stability coefficient.
[0022] Optionally, in a fifth implementation of the first aspect of the present invention, when a storage device is connected, the step of obtaining a voltage range corresponding to the storage device includes:
[0023] When a power supply request of the storage device is detected, identifying the model information of the storage device;
[0024] Determine the voltage range supported by the storage device based on the model information.
[0025] Optionally, in a sixth implementation of the first aspect of the present invention, when a storage device is connected, the step of obtaining a voltage range corresponding to the storage device includes:
[0026] When an access request of a storage device is detected, a verification operation of a preset communication protocol is performed on the storage device;
[0027] If the storage device supports the preset communication protocol, obtain the voltage range corresponding to the storage device.
[0028] Optionally, in a seventh implementation manner of the first aspect of the present invention, after the step of performing a power supply operation for the storage device according to the first target voltage or the step of performing a power supply operation for the storage device according to the second target voltage, the power supply method for the storage device further includes:
[0029] After performing the power supply operation, obtain the accuracy of data transmission;
[0030] When the accuracy rate meets a preset condition, maintaining the first target voltage or the second target voltage to perform a power supply operation;
[0031] When the accuracy rate does not meet a preset condition, the first target voltage or the second target voltage is boosted to perform a power supply operation on the storage device according to the boosted voltage.
[0032] In a second aspect, an embodiment of the present invention provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the power supply method for the above-mentioned storage device when executing the computer program.
[0033] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the power supply method of the above-mentioned storage device are implemented.
[0034] In a fourth aspect, an embodiment of the present invention provides a computer program product. When the computer program product is run on a terminal device, the terminal device executes the power supply method of the storage device.
[0035] The beneficial effects of the embodiments of the present invention compared with the prior art are: when a storage device is connected, the voltage range of the storage device is obtained; according to the voltage range, the power voltage of the storage device is matched to determine the first target voltage of the storage device; and power supply operations are performed for the storage device according to the first target voltage. By obtaining the voltage range of the storage device when it is connected, and matching the voltage according to the range, the minimum effective voltage required by the storage device can be determined and applied. Compared with the traditional fixed voltage power supply, the dynamic voltage adjustment method meets the storage device's demand for low power consumption in the scenario of rapid iteration of storage devices, and can significantly reduce the power consumption of storage devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0037] Figure 1 A schematic diagram of an embodiment of a power supply method for a storage device in an embodiment of the present invention;
[0038] Figure 2A schematic diagram of a specific embodiment of step S102 of the power supply method for a storage device in an embodiment of the present invention;
[0039] Figure 3 A schematic diagram of a specific embodiment after step S103 of the power supply method for a storage device in an embodiment of the present invention;
[0040] Figure 4 A schematic diagram of a specific embodiment of step S101 of the power supply method for a storage device in an embodiment of the present invention;
[0041] Figure 5 The figure is a schematic diagram of an embodiment of a terminal device in an embodiment of the present invention. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work are protected by the present invention.
[0043] It should be noted that the terms "include", "comprises" and "have" and any variations thereof in the specification and claims of the present invention and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, terminal, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices. In the claims, specifications and drawings of the present invention, relational terms such as "first" and "second" are merely used to distinguish one entity / operation / object from another entity / operation / object, and do not necessarily require or imply any such real-time relationship or order between these entities / operations / objects.
[0044] Reference to an "embodiment" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiment may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0045] Storage devices, such as SD cards, are widely used in various electronic devices. However, as devices are upgraded, power consumption requirements continue to decrease, and how to effectively manage the power consumption of storage devices has become an important issue.
[0046] Traditional storage device power supply methods often use a fixed voltage for power supply, which cannot be flexibly adjusted according to the actual needs and characteristics of the storage device, and is prone to excessive power consumption. A new technical means is needed to solve the above technical problems.
[0047] In view of this, an embodiment of the present invention provides a power supply method, terminal device and storage medium for a storage device, which can determine and apply the minimum effective voltage required by the storage device by obtaining its voltage range when the storage device is connected and performing voltage matching according to the range. Compared with the traditional fixed voltage power supply, the dynamic voltage adjustment method meets the storage device's demand for low power consumption in the scenario of rapid iteration of storage devices, and can significantly reduce the power consumption of storage devices.
[0048] In order to illustrate the technical solution of the present invention, specific embodiments are provided below for illustration.
[0049] The professional terms involved in the embodiments of the present invention include but are not limited to:
[0050] Storage device: a device used to store data, such as a hard disk, a solid-state drive (SSD), a USB flash drive, etc. In the embodiment of the present invention, the storage device is the object of the power supply method, and its power demand is met by a specific power supply method.
[0051] Voltage range: The voltage range required for the normal operation of the storage device. Obtaining the voltage range of the storage device is a prerequisite for matching it with a suitable power supply voltage.
[0052] Power voltage: the voltage value actually used by the storage device. In the embodiment of the present invention, the power voltage may include multiple power levels, that is, different voltage values.
[0053] Power range: different voltage values available for a storage device. In an embodiment of the present invention, the target supply voltage of the storage device can be determined by matching the voltage range and power range of the storage device.
[0054] Target voltage: The actual voltage value required when the storage device is powered. The first target voltage is the initial power supply voltage determined according to the voltage range and power level of the storage device, and the second target voltage is the power supply voltage adjusted according to the read-write environment stability coefficient of the storage device.
[0055] Power supply operation: the process of providing power to the storage device so that it can work normally. In the embodiment of the present invention, the power supply operation is performed according to the determined target voltage.
[0056] Read-write environment: The state of the environment in which the storage device is located when reading and writing data. The stability of the read-write environment has an important impact on the performance of the storage device.
[0057] Stability coefficient: An indicator used to evaluate the stability of the read-write environment of a storage device. By detecting the read-write environment, the stability coefficient can be obtained, and the power supply voltage can be adjusted to improve the working stability of the storage device.
[0058] Verification information: information used to verify the integrity and correctness of communication data. In the embodiment of the present invention, the verification information is used to detect the stability of the read-write environment of the storage device.
[0059] Boost operation: An operation that increases the supply voltage. When the working stability of the storage device is insufficient or the data transmission accuracy does not meet the requirements, the boost operation can be used to increase the supply voltage to improve the working performance of the storage device.
[0060] Model information: The model identifier of the storage device, which is used to identify the type and specifications of the storage device. By identifying the model information, you can determine the voltage range and other parameters of the storage device.
[0061] Data transmission accuracy rate: The proportion of data correctly transmitted by a storage device during the data transmission process. The accuracy rate is one of the indicators for evaluating the working performance of a storage device.
[0062] Figure 1 The present invention provides a schematic diagram of a method for implementing a power supply process of a storage device, which can be applied to a terminal device, such as a mobile phone, a tablet computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, etc.
[0063] Specifically, the power supply method for the storage device may include the following steps S101 to S103.
[0064] Step S101, when a storage device is connected, obtaining a voltage range of the storage device.
[0065] The voltage range is the voltage interval required for the normal operation of the storage device.
[0066] When the host system is connected to the storage device, the storage device exchanges data with the host system so that the storage device reports its voltage range to the host system.
[0067] Specifically, when the storage device is connected to the terminal device through a physical interface, the terminal device interacts with the storage device based on the SD standard communication protocol; the terminal device sends an ACMD41 (SD_SEND_OP_COND) command, and the storage device responds with a Response, wherein the response content includes an ORC field, and the ORC (Operation conditions register) field indicates the supported voltage range; since the power supply of the storage device is controlled by the terminal device, the terminal device can adjust the power supply voltage according to the voltage range reported by the storage device.
[0068] In a specific implementation, when a storage device (SD device) is connected to a terminal device (SD host) through a physical interface (such as SATA, PCIe, etc.) or wirelessly, the SD host detects and identifies the device. For example, when the SD host and the SD device are powered on, data will be exchanged based on the SD standard communication protocol command. During this interaction, the SD host will continuously send ACMD41 commands to query the SD device. After receiving the query command, the SD device replies to ACMD41 through the standard protocol Response, where the ORC field in the Response contains the voltage range supported by the SD device. Since the power supply of the SD device is provided by the SD host, the SD host can control the power supply voltage of the SD device according to the supported voltage range reported by the SD device.
[0069] Optionally, a voltage range built into the storage device is read by detecting a specific pin or signal line on the storage device.
[0070] Optionally, when a storage device is connected, a query command is sent to it, and the storage device returns the voltage range it supports.
[0071] Optionally, according to the model information of the storage device, a corresponding voltage range is searched through a predefined database.
[0072] Optionally, a machine learning algorithm is used to predict the voltage range of the storage device based on its physical characteristics and communication protocol.
[0073] Step S102: matching the power voltage of the storage device according to the voltage range to determine a first target voltage of the storage device.
[0074] In an embodiment of the present invention, the terminal device selects a suitable voltage value as the first target voltage within the power supply capability range of the terminal device according to the voltage range provided by the storage device.
[0075] Optionally, a binary search method is used to quickly find a voltage value closest to the power supply capability of the terminal device within the voltage range.
[0076] Optionally, different voltage matching strategies are preset according to the type of storage device (such as enterprise-level, consumer-level) and performance requirements.
[0077] Optionally, the voltage matching strategy is dynamically adjusted taking into account the current load condition and energy efficiency ratio of the terminal device.
[0078] Optionally, intelligently match voltage based on real-time status and predicted demand of storage devices according to a pre-trained neural network model.
[0079] Optionally, a power supply operation is performed for the storage device according to the first target voltage.
[0080] Step S103 , performing a power supply operation for the storage device according to the first target voltage.
[0081] In an embodiment of the present invention, the terminal device adjusts its power supply circuit to provide a stable power supply to the storage device at a first target voltage.
[0082] Optionally, based on digital power management technology, output voltage and current can be controlled.
[0083] Optional, based on redundant power supply modules, seamlessly switch to backup power supply in case of power failure.
[0084] Optionally, the operating status of the storage device is monitored in real time, and the supply voltage is dynamically adjusted to optimize energy efficiency.
[0085] Optionally, collect environmental factors such as temperature and humidity of the storage device and adjust the power supply strategy in real time to extend the life of the device.
[0086] The beneficial effects of the embodiments of the present invention compared with the prior art are: when a storage device is connected, the voltage range of the storage device is obtained; according to the voltage range, the power voltage of the storage device is matched to determine the first target voltage of the storage device; and power supply operations are performed for the storage device according to the first target voltage. By obtaining the voltage range of the storage device when it is connected, and matching the voltage according to the range, the minimum effective voltage required by the storage device can be determined and applied. Compared with the traditional fixed voltage power supply, the dynamic voltage adjustment method meets the storage device's demand for low power consumption in the scenario of rapid iteration of storage devices, and can significantly reduce the power consumption of storage devices.
[0087] In the traditional storage device power supply method, usually only a fixed power supply voltage can be provided, and it is not possible to flexibly adjust according to the actual needs of the storage device. This may cause voltage mismatch, thereby affecting the performance of the storage device. Based on this, the present invention provides an optional embodiment. Step S102 also includes the following specific implementation methods.
[0088] Step S1021 : matching the power voltage of the storage device in a plurality of power levels within a voltage range to determine a first target voltage of the storage device.
[0089] In an embodiment of the present invention, the power voltage of the storage device includes multiple power levels. A list of multiple power levels supported by the storage device is obtained and initialized, and the levels can be pre-set according to the design specifications and performance requirements of the storage device.
[0090] When the storage device is connected to the terminal device, the terminal device obtains the voltage range of the storage device through detection or query.
[0091] The terminal device starts from the highest voltage gear and checks each gear one by one whether it is within the voltage range of the storage device. Find a power gear that meets the conditions (that is, the voltage value of the gear is within the voltage range of the storage device) and determine it as the first target voltage. If the highest gear does not meet the requirements, continue to check the next gear until a gear that meets the conditions is found or all gears are traversed. For example, the SD host obtains the voltage range supported by the SD device, and controls and reduces the communication voltage between the SD host and the SD device one by one from high to low. Each time the voltage value of a gear is matched (the first target voltage), the communication protocol command CMD19 (SEND_TUNING_BLOCK) can be used to verify the data to determine whether the read and write environment is normal. Only when the read and write environment is detected normally can the voltage of this gear be used as the working voltage and the matching of the next voltage gear can be continued. Repeat this operation until the lowest supported voltage gear is found as the current working voltage, that is, the purpose of adaptively reducing the power consumption of the SD device is achieved.
[0092] Furthermore, the terminal device adjusts the output voltage of its power supply circuit according to the determined first target voltage to match the power demand of the storage device.
[0093] Optionally, based on the storage device model, manufacturer, historical power usage data and other information, the most suitable power usage gear is intelligently predicted and prioritized to improve matching accuracy.
[0094] Optionally, the terminal device monitors the operating status of the storage device (such as read and write speed, temperature, etc.) in real time, and dynamically adjusts the power consumption level according to the above information to optimize energy efficiency.
[0095] Optionally, the user is allowed to customize the power usage level of the storage device within the permitted range according to actual needs to provide greater flexibility.
[0096] Optionally, for storage devices that support a wide voltage range, the terminal device may design a strategy to dynamically switch between multiple power levels to balance performance according to the actual load of the storage device.
[0097] Beneficial effects of this optional embodiment: By matching multiple power levels, the terminal device can more accurately meet the power requirements of the storage device and reduce performance degradation caused by voltage mismatch. In addition, the terminal device can select a suitable power level according to the actual power consumption of the storage device to avoid unnecessary energy consumption.
[0098] In the traditional storage device power supply method, usually only a fixed power supply voltage can be provided, and it is not possible to flexibly adjust according to the actual needs of the storage device. This may cause voltage mismatch, thereby affecting the performance of the storage device. Based on this, the present invention provides an optional embodiment. Step S102 also includes the following specific implementation methods.
[0099] Step S10211, adapt one by one from high to low among multiple power consumption gears until a first target voltage is determined, wherein the first target voltage is within the voltage range.
[0100] In an embodiment of the present invention, each power level has a different voltage. A list containing multiple power levels is initialized. Each level corresponds to a specific voltage value.
[0101] When the storage device is connected to the terminal device, the terminal device obtains the voltage range of the storage device through an interface or a protocol.
[0102] The terminal device selects the highest voltage level from the voltage range as the starting point to find the most suitable operating voltage with low power consumption.
[0103] Optionally, the most suitable power usage level can be predicted based on the storage device model, historical power usage data and other information to improve adaptation efficiency and accuracy.
[0104] Optionally, the operating status and voltage requirements of the storage device are monitored in real time, and the power usage level is dynamically adjusted according to the real-time data to adapt to the dynamic changes of the storage device.
[0105] The beneficial effects of this optional embodiment are as follows: by adapting multiple power levels one by one, the voltage requirements of the storage device can be met more accurately, reducing the performance degradation caused by voltage mismatch. In addition, by supporting multiple power levels, it can be compatible with more types of storage devices and improve the flexibility of use. It is also possible to select a suitable power level according to the actual voltage requirements of the storage device to avoid unnecessary energy consumption.
[0106] In the traditional storage device power supply method, power can usually only be supplied according to the static voltage requirement of the storage device, and it is impossible to dynamically adjust according to the real-time read / write environment and stability requirements. This may cause the storage device to degrade in performance, shorten its life, or even be damaged in harsh environments. Based on this, the present invention provides an optional embodiment. Step S103 also includes the following specific implementation methods.
[0107] Step S201, detecting the current read-write environment of the storage device to obtain a stability coefficient.
[0108] In the implementation mode of the present invention, the terminal device determines and applies the first target voltage for power supply according to the voltage range of the storage device. After the storage device starts working, the terminal device detects the read and write environment parameters of the storage device, such as temperature, humidity, vibration, etc., in real time or regularly through the built-in sensor or external interface. This is used to calculate the stability coefficient of the storage device, which reflects the stable operation capability of the storage device in the current environment.
[0109] The terminal device calculates the stability coefficient using a preset algorithm or model based on the detected read / write environment parameters. The stability coefficient can be a value between 0 and 1, where 1 indicates complete stability and 0 indicates extreme instability.
[0110] Step S202: determining a second target voltage corresponding to the storage device according to the stability coefficient.
[0111] The terminal device compares the calculated stability coefficient with a preset threshold value. If the stability coefficient is greater than or equal to the threshold value, the terminal device considers that the storage device is sufficiently stable under the current environment, and therefore uses the first target voltage as the second target voltage and continues to supply power.
[0112] If the stability coefficient is less than the threshold, the terminal device believes that the storage device may require a higher voltage to maintain stability, so it will perform a level boost operation on the first target voltage (such as increasing the voltage by one level) to obtain the second target voltage, and switch to this voltage for power supply.
[0113] Step S203 , performing a power supply operation for the storage device according to the second target voltage.
[0114] In an embodiment of the present invention, the terminal device adjusts the output voltage of the power supply circuit according to the determined second target voltage to provide a new stable power supply for the storage device.
[0115] Optionally, after the first target voltage is used as the second target voltage and power is continued, the step of detecting the current read / write environment of the storage device and obtaining the stability coefficient is returned. For example, the terminal device continuously monitors the read / write environment and stability coefficient of the storage device and dynamically adjusts the power supply voltage as needed to ensure that the storage device always works in the best state.
[0116] The beneficial effect of this optional embodiment is that by real-time detection of the read-write environment and dynamic adjustment of the power supply voltage, the storage device can always work in the best state, thereby improving its stability. Furthermore, reasonable adjustment of the power supply voltage can reduce the risk of damage to the storage device due to voltage mismatch or harsh environment, thereby extending its service life.
[0117] In the traditional storage device power supply method, there is a lack of a mechanism for dynamically adjusting the voltage. This may result in the storage device being unable to obtain sufficient voltage support in time when the performance is poor or the data transmission error rate is high, thereby affecting its performance. At the same time, a fixed power supply method may also lead to energy waste, such as when the storage device has excess performance or the data transmission demand is low. Based on this, the present invention provides an optional embodiment. Step S201 also includes the following specific implementation methods.
[0118] Step S2011, receiving verification information from the host system, wherein the verification information includes communication data and verification information.
[0119] In an embodiment of the present invention, verification information including communication data and verification information is received from a host system as a basis for evaluating the stability of the read-write environment of a storage device.
[0120] Based on the received communication data and verification information, the read and write environment of the storage device is detected and analyzed.
[0121] Step S2012: Detect the current read / write environment of the storage device according to the communication data and the verification information to obtain the stability coefficient.
[0122] In the embodiment of the present invention, the read and write environment of the storage device is detected based on the parsed communication data and verification information. The detection operation includes checking the integrity, speed, error rate, etc. of the data transmission.
[0123] Beneficial effects of this optional embodiment: Dynamically adjusting the supply voltage according to the data transmission accuracy can make the storage device work in the best performance state. When the data transmission accuracy is low, the read and write speed and stability of the storage device can be improved through the boost operation, thereby optimizing its performance.
[0124] In the traditional storage device power supply method, power can usually only be supplied according to the static voltage requirement of the storage device, and it is impossible to dynamically adjust according to the real-time read / write environment and stability requirements. This causes the performance of the storage device to degrade in harsh environments. Based on this, the present invention provides an optional embodiment. Step S202 also includes the following specific implementation methods.
[0125] Step S2013: when the stability coefficient is greater than or equal to the preset coefficient, the first target voltage is used as the second target voltage.
[0126] In an embodiment of the present invention, a threshold value of the stability coefficient (ie, a preset coefficient) is preset. The preset coefficient can be obtained based on the characteristics of the storage device and empirical data, and is used to determine whether the storage device needs to adjust the supply voltage to maintain stable operation.
[0127] The calculated stability factor is compared with the preset factor.
[0128] If the stability coefficient is greater than or equal to the preset coefficient, the terminal device believes that the storage device is sufficiently stable under the current environment, and therefore uses the first target voltage as the second target voltage and continues to supply power.
[0129] Step S2014: when the stability coefficient is less than the preset coefficient, a gear boost operation is performed on the first target voltage to obtain a second target voltage.
[0130] In an embodiment of the present invention, if the stability coefficient is less than a preset coefficient, the terminal device believes that the storage device requires a higher voltage to maintain stability, and therefore performs a level boost operation on the first target voltage (for example, increases the voltage by one level) to obtain the second target voltage, and switches to this voltage for power supply.
[0131] The beneficial effect of this optional embodiment is that by real-time detection of the read-write environment and dynamic adjustment of the power supply voltage, it is possible to ensure that the storage device always operates in the best state, thereby improving its stability.
[0132] In a conventional storage device power supply method, a terminal device can usually only provide a fixed or limited number of voltage options for a user to choose from. However, storage devices of different models may have different voltage requirements. Based on this, the present invention provides an optional embodiment. Step S101 also includes the following specific implementation methods.
[0133] Step S1011, when a power supply request of a storage device is detected, the model information of the storage device is identified.
[0134] In an embodiment of the present invention, when a storage device is connected to a terminal device through a physical interface (such as USB, SATA, PCIe, etc.) or wirelessly (such as Bluetooth, Wi-Fi, etc., although this is not common in storage devices), the terminal device detects this access event and identifies it as a power request.
[0135] The terminal device identifies the model information of the storage device by reading the identification information on the storage device (such as the information in the EEPROM chip, the barcode or QR code on the physical label, etc.) or by querying its built-in information after establishing a communication connection with the storage device.
[0136] Step S1012: Determine the voltage range supported by the storage device according to the model information.
[0137] In the embodiment of the present invention, a database of the correspondence between storage device models and voltage ranges is maintained inside the terminal device. After identifying the model information of the storage device, the terminal device will search the database for the voltage range corresponding to the model.
[0138] The beneficial effect of this optional embodiment is that by identifying the model information of the storage device to determine its voltage range, the terminal device can provide a suitable power supply for the storage device, thereby improving the compatibility of power supply.
[0139] In a conventional storage device power supply method, a terminal device can usually only provide a fixed or limited number of voltage options for a user to choose from. However, storage devices of different models may have different voltage requirements. Based on this, the present invention provides an optional embodiment. Step S101 also includes the following specific implementation methods.
[0140] Step S1013: When a power supply request of the storage device is detected, the model information of the storage device is identified.
[0141] In an embodiment of the present invention, when a storage device is connected to a terminal device through a physical interface (such as USB, SATA, PCIe, etc.) or wirelessly (such as Bluetooth, Wi-Fi, etc., although this is not common in storage devices), the terminal device detects this access event and identifies it as a power request.
[0142] The terminal device identifies the model information of the storage device by reading the identification information on the storage device (such as the information in the EEPROM chip, the barcode or QR code on the physical label, etc.) or by querying its built-in information after establishing a communication connection with the storage device.
[0143] Step S1014: determining the voltage range supported by the storage device according to the model information.
[0144] In the embodiment of the present invention, a database of the correspondence between storage device models and voltage ranges is maintained inside the terminal device. After identifying the model information of the storage device, the terminal device will search the database for the voltage range corresponding to the model.
[0145] The beneficial effect of this optional embodiment is that by identifying the model information of the storage device to determine its voltage range, the terminal device can provide a suitable power supply for the storage device, thereby improving the compatibility of power supply.
[0146] In the traditional storage device power supply method, the terminal device usually can only provide a fixed or limited number of voltage options for the user to choose, and usually does not perform communication protocol verification. Based on this, the present invention provides an optional embodiment. Step S101 also includes the following specific implementation methods.
[0147] Step S1013: When a power supply request of the storage device is detected, the model information of the storage device is identified.
[0148] In an embodiment of the present invention, the terminal device attempts to establish a communication connection with the storage device and sends a verification request according to a preset communication protocol (such as SCSI, ATA, NVMe, etc.). The verification request may include a specific command or data packet for checking whether the storage device supports the communication protocol.
[0149] After receiving the verification request, the storage device will determine whether it supports the communication protocol based on its internal configuration and firmware version. If it does, it will respond to the terminal device in the manner specified by the protocol, including a confirmation message and device identification information.
[0150] After confirming that the storage device supports the preset communication protocol, the terminal device will send an additional query request to obtain the voltage range of the storage device. The query request can be a specific command or data packet used to request the storage device to return its voltage requirement or supported range.
[0151] Step S1014: determining the voltage range supported by the storage device according to the model information.
[0152] In an embodiment of the present invention, after receiving the query request, the storage device will return its voltage range, such as multiple voltage values or ranges. The terminal device will parse the information and adjust the output voltage of its power supply circuit according to the voltage requirement of the storage device.
[0153] Beneficial effects of this optional embodiment: By verifying whether the storage device supports the preset communication protocol, the terminal device can ensure compatibility with the storage device, thereby avoiding power supply problems caused by communication protocol mismatch. In addition, implementing communication protocol verification can ensure communication security between the terminal device and the storage device.
[0154] In the traditional storage device power supply method, the terminal device usually can only provide a fixed or limited number of voltage options for the user to choose, and usually does not perform communication protocol verification. Based on this, the present invention provides an optional embodiment. Step S103 or step S203 also includes the following specific implementation.
[0155] Step S301, after performing the power supply operation, obtaining the accuracy of data transmission.
[0156] In an embodiment of the present invention, after the power supply operation is performed, the accuracy of data transmission is obtained from the storage device or the host system.
[0157] Step S302 , when the accuracy meets a preset condition, maintaining the first target voltage or the second target voltage to perform a power supply operation.
[0158] In an embodiment of the present invention, the acquired data transmission accuracy is compared with a preset accuracy threshold to determine whether a preset condition is met.
[0159] Step S303, when the accuracy rate does not meet a preset condition, boosting the first target voltage or the second target voltage to perform a power supply operation on the storage device according to the boosted voltage.
[0160] In an embodiment of the present invention, whether to maintain the current supply voltage or to perform a boost operation is determined according to the comparison result of the accuracy rate.
[0161] In a specific implementation, a power supply operation is performed for the storage device according to the first target voltage or the second target voltage.
[0162] After the power supply operation is performed for a period of time (e.g., a preset time period), the accuracy of data transmission is obtained. The accuracy can be calculated by comparing the sent and received data packets, for example, by calculating the ratio of the number of successfully transmitted data packets to the total number of data packets.
[0163] The acquired data transmission accuracy is compared with a preset accuracy threshold, which can be flexibly set according to the type of storage device, performance requirements and application scenarios.
[0164] If the accuracy meets the preset condition (ie, the accuracy is greater than or equal to the preset threshold), the current supply voltage is maintained unchanged.
[0165] If the accuracy does not meet the preset condition (ie, the accuracy is less than the preset threshold), the current power supply voltage is boosted once or multiple times until a new voltage value is reached, and the power supply operation is performed again.
[0166] Beneficial effects of this optional embodiment: By verifying whether the storage device supports the preset communication protocol, the terminal device can ensure compatibility with the storage device, thereby avoiding power supply problems caused by communication protocol mismatch. In addition, implementing communication protocol verification can ensure communication security between the terminal device and the storage device.
[0167] like Figure 5 , which is a schematic diagram of a terminal device provided in an embodiment of the present invention. The terminal device 5 may include: a processor 501, a memory 502, and a computer program 503 stored in the memory 502 and executable on the processor 501, such as a power supply program for a storage device. When the processor 501 executes the computer program 503, the steps in the power supply embodiments of each storage device described above are implemented.
[0168] The computer program may be divided into one or more modules / units, one or more modules / units are stored in the memory 502 and executed by the processor 501 to complete the present invention. One or more modules / units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the terminal device.
[0169] The terminal device may include, but is not limited to, a processor 501 and a memory 502. Those skilled in the art will appreciate that Figure 5 It is only an example of a terminal device and does not constitute a limitation of the terminal device. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device may also include input and output devices, network access devices, buses, etc.
[0170] The processor 501 may be a central processing unit (CPU), or 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. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0171] The memory 502 may be an internal storage unit of the terminal device, such as a hard disk or memory of the terminal device. The memory 502 may also be an external storage device of the terminal device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device. Further, the memory 502 may also include both an internal storage unit of the terminal device and an external storage device. The memory 502 is used to store computer programs and other programs and data required by the terminal device. The memory 502 may also be used to temporarily store data that has been output or is to be output.
[0172] It should be noted that, for the convenience and brevity of description, the structure of the above-mentioned terminal device can also refer to the specific description of the structure in the method embodiment, which will not be repeated here.
[0173] An embodiment of the present invention further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the power supply method of the storage device can be implemented.
[0174] An embodiment of the present invention provides a computer program product. When the computer program product is run on a mobile terminal, the mobile terminal can implement the steps in the power supply method for the storage device described above.
[0175] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0176] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them. Although the present invention has been described in detail with reference to the above embodiments, it should be understood by those skilled in the art that the technical solutions described in the above embodiments can still be modified, or some of the technical features can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention.
Claims
1. A power supply method for a storage device, characterized in that: include: When a storage device is connected, obtaining a voltage range of the storage device; According to the voltage range, matching the power voltage of the storage device to determine a first target voltage of the storage device; A power supply operation is performed for the storage device according to the first target voltage.
2. The power supply method for a storage device according to claim 1, wherein: The power voltage of the storage device includes multiple power levels; The step of matching the power voltage of the storage device according to the voltage range to determine the first target voltage of the storage device includes: Within the voltage range, the power consumption voltage of the storage device is matched among the plurality of power consumption gears to determine a first target voltage of the storage device.
3. The power supply method for a storage device according to claim 2, characterized in that: Each of the power levels has a different voltage; The step of matching the power voltage of the storage device in the plurality of power levels within the voltage range to determine the first target voltage of the storage device comprises: Among the multiple power consumption gears, adaptation is performed one by one from high to low until the first target voltage is determined, wherein the first target voltage is within the voltage range.
4. The power supply method for a storage device according to any one of claims 1 to 3, characterized in that: After the step of performing a power supply operation for the storage device according to the first target voltage, the power supply method for the storage device further includes: Detecting the current read-write environment of the storage device to obtain a stability coefficient; determining a second target voltage corresponding to the storage device according to the stability coefficient; A power supply operation is performed for the storage device according to the second target voltage.
5. The power supply method for a storage device according to claim 4, characterized in that: The detecting the current read / write environment of the storage device to obtain a stability coefficient includes: Receiving verification information from a host system, wherein the verification information includes communication data and verification information; The current read-write environment of the storage device is detected according to the communication data and the verification information to obtain the stability coefficient.
6. The power supply method for a storage device according to claim 4, characterized in that: The step of determining the second target voltage corresponding to the storage device according to the stability coefficient includes: When the stability coefficient is greater than or equal to a preset coefficient, using the first target voltage as the second target voltage; When the stability coefficient is less than a preset coefficient, a gear boost operation is performed on the first target voltage to obtain the second target voltage.
7. The power supply method for a storage device according to claim 4, characterized in that: When the storage device is connected, the step of obtaining the voltage range corresponding to the storage device includes: When a power supply request of the storage device is detected, identifying model information of the storage device; The voltage range supported by the storage device is determined according to the model information.
8. The power supply method for a storage device according to claim 4, characterized in that: After the step of performing a power supply operation for the storage device according to the first target voltage or the step of performing a power supply operation for the storage device according to the second target voltage, the power supply method for the storage device further includes: After performing the power supply operation, obtain the accuracy of data transmission; When the accuracy rate meets a preset condition, maintaining the first target voltage or the second target voltage to perform a power supply operation; When the accuracy rate does not meet a preset condition, the first target voltage or the second target voltage is boosted to perform a power supply operation on the storage device according to the boosted voltage.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the power supply method for the storage device according to any one of claims 1 to 8 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the power supply method for a storage device according to any one of claims 1 to 8 are implemented.