Sleep control method and device, electronic equipment and storage medium thereof

By obtaining the actual number of sleep times in the storage device and updating the automatic sleep threshold, the power consumption problem of the storage device in different scenarios is solved, and more efficient sleep control is achieved.

CN120447979APending Publication Date: 2025-08-08合肥康芯威存储技术有限公司
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510486951.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-17
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

The existing automatic sleep control method of storage devices is not effective, resulting in the inability to reduce power consumption in different usage scenarios.

Method used

By obtaining the actual number of sleep times of the storage device, comparing it with the target number, updating the automatic sleep threshold according to the actual number of sleep times, and adjusting the sleep control strategy to adapt to different scenarios.

Benefits of technology

Improves the automatic sleep effect of the storage device and reduces power consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120447979A_ABST
    Figure CN120447979A_ABST
Patent Text Reader

Abstract

The invention provides a dormancy control method and device, electronic equipment and a storage medium. The method comprises the steps that the actual dormancy frequency of the storage equipment is obtained; determining whether the actual sleep times are greater than the target times; and if the actual dormancy frequency is greater than the target frequency, determining to update an automatic dormancy threshold according to the actual dormancy frequency under the condition that the automatic dormancy threshold of the storage device is updated, and performing automatic dormancy control on the storage device according to the updated automatic dormancy threshold. According to the scheme, the automatic dormancy threshold value can be adaptively adjusted according to the actual dormancy condition of the storage device, the automatic dormancy effect of the storage device is improved, and therefore the power consumption of the storage device can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data storage, and in particular to a sleep control method, device, electronic equipment and storage medium thereof. Background Art

[0002] With the development of computer technology, various high-performance computers have become widely used. To reduce power consumption, the corresponding storage devices used in these processors often have the ability to automatically enter sleep mode. However, since certain table information must be stored before the device enters sleep mode, this can affect the device's automatic sleep mode. Currently, automatic sleep mode is typically set after the device enters an idle state according to a pre-set sleep cycle, resulting in poor automatic sleep performance. Therefore, improving the automatic sleep performance of storage devices has become an urgent issue. Summary of the Invention

[0003] The main technical problem solved by the present invention is that the existing method for automatically controlling the dormancy of a storage device is ineffective, which results in the inability to reduce the power consumption of the storage device in different usage scenarios.

[0004] According to a first aspect, a sleep control method is provided, which is applied to an automatic sleep mode, and the method includes: obtaining the actual sleep times of a storage device; determining whether the actual sleep times are greater than a target times; if the actual sleep times are greater than the target times, determining that when the automatic sleep threshold of the storage device is updated, the automatic sleep threshold is updated according to the actual sleep times, and automatically controlling the storage device to sleep according to the updated automatic sleep threshold.

[0005] According to the second aspect, a sleep control device is provided, which is applied to the automatic sleep mode, and the device includes: an actual sleep number acquisition module, which is used to obtain the actual sleep number of the storage device; a first judgment module, which is used to determine whether the actual sleep number is greater than the target number; a first sleep control module, which is used to determine whether the automatic sleep threshold of the storage device is updated according to the actual sleep number if the actual sleep number is greater than the target number, and to perform automatic sleep control on the storage device according to the updated automatic sleep threshold.

[0006] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising: a processor; and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the sleep control method described above is implemented.

[0007] According to a fourth aspect of the embodiments of the present application, a computer-readable storage medium is provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor, the sleep control method described above is implemented.

[0008] According to the sleep control method / device of the above embodiment, the actual sleep times of the storage device obtained are compared with the target times, so as to determine that the actual sleep times are greater than the target times, and to determine that the automatic sleep times of the storage device are updated, the automatic sleep threshold is updated based on the actual sleep times, and finally the storage device can be automatically sleep controlled according to the updated automatic sleep threshold, so that the automatic sleep threshold can be adaptively adjusted according to the actual sleep situation of the storage device, thereby improving the automatic sleep effect of the storage device, thereby reducing the power consumption of the storage device. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] The accompanying drawings are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and those skilled in the art can derive other drawings based on these drawings without inventive effort.

[0010] Figure 1 2 is a flowchart of a sleep control method according to an embodiment of the present application.

[0011] Figure 2 2 is a flowchart of a sleep control method according to another embodiment of the present application.

[0012] Figure 3 3 is a flowchart of a sleep control method according to another embodiment of the present application.

[0013] Figure 4 It is a flowchart illustrating the specific steps before step 350 according to an embodiment of the present application.

[0014] Figure 5 2 is a flowchart of a sleep control method according to another embodiment of the present application.

[0015] Figure 6 2 is a block diagram of a sleep control device according to an embodiment of the present application.

[0016] Figure 7 It is a hardware structure diagram of an electronic device according to an embodiment of the present application.

[0017] The above-mentioned drawings have shown clear embodiments of the present invention, which will be described in more detail later. These drawings and textual descriptions are not intended to limit the scope of the present invention in any way, but to illustrate the concept of the present invention to computer technicians in this field through specific embodiments. DETAILED DESCRIPTION

[0018] The present invention will be further described in detail below by means of specific embodiments in conjunction with the accompanying drawings. Similar elements in different embodiments are numbered with associated similar elements. In the following embodiments, many detailed descriptions are provided to enable the present application to be better understood. However, those skilled in the art will readily appreciate that some of the features may be omitted in different circumstances, or may be replaced by other elements, materials, or methods. In some cases, some operations related to the present application are not shown or described in the specification. This is to avoid the core portion of the present application being overwhelmed by excessive descriptions, and for those skilled in the art, it is not necessary to describe these related operations in detail. They will fully understand the related operations based on the description in the specification and the general technical knowledge in the art.

[0019] In addition, the features, operations, or characteristics described in the specification may be combined in any appropriate manner to form various embodiments. Furthermore, the steps or actions in the method description may be reordered or adjusted in a manner readily apparent to those skilled in the art. Therefore, the various sequences in the specification and drawings are provided solely for the purpose of clearly describing a particular embodiment and are not intended to be mandatory, unless otherwise specified.

[0020] The serial numbers assigned to components herein, such as "first," "second," etc., are used solely to distinguish the objects being described and do not convey any sequential or technical meaning. References to "connection" and "coupling" herein, unless otherwise specified, include both direct and indirect connections (couplings).

[0021] Currently, most embedded storage systems have an automatic sleep function to reduce power consumption. The trigger condition is usually that the device enters sleep mode according to a predetermined period after entering an idle state. The purpose of sleep mode is to reduce power consumption, but some table information needs to be stored before entering sleep mode, which will consume the life of the storage device. In addition, because the information stored each time the device enters sleep mode is different, the efficiency of entering sleep mode cannot be adapted to different scenarios, resulting in low sleep efficiency of the storage device.

[0022] In an embodiment of the present invention, the actual sleep times of the storage device obtained are compared with the target times, so as to determine that the actual sleep times are greater than the target times, and to determine that the automatic sleep times of the storage device are updated, the automatic sleep threshold is updated based on the actual sleep times, and finally the automatic sleep control of the storage device can be performed according to the updated automatic sleep threshold, so that the automatic sleep threshold can be adaptively adjusted according to the actual sleep situation of the storage device, thereby improving the automatic sleep effect of the storage device, thereby reducing the power consumption of the storage device.

[0023] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices. The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily need to be executed in the order described. For example, some operations / steps may be further decomposed, while others may be combined or partially combined, so the actual execution order may vary depending on the actual situation.

[0024] See also Figure 1 , Figure 1 The sleep control method provided by an embodiment of the present application is shown. In a specific embodiment, the sleep control method can be applied to Figure 6 The sleep control device 600 and the electronic device 700 equipped with the sleep control device 600 are shown. Figure 7 ). The specific process of this embodiment will be described below. Of course, it is understandable that the method can be executed by a computer terminal with computing and processing capabilities, or other processors, or memory chips. Figure 1 The sleep control method may include the following steps:

[0025] Step 110: Obtain the actual number of sleep times of the storage device.

[0026] As a way, in order to enable the storage device to adapt to different scenarios, in different usage scenarios, the storage device can ensure that the power consumption of the storage device is reduced according to actual conditions. The actual number of sleep times corresponding to the last automatic sleep of the storage device can be used to determine whether to update the automatic sleep threshold of the storage device. In this way, the storage device can adaptively perform sleep control based on the updated automatic sleep threshold when it enters automatic sleep next time.

[0027] Optionally, each time the storage device enters sleep mode, the sleep data of the storage device during the automatic sleep mode will be recorded. The sleep data may include the actual number of sleep times, the number of sleep pages corresponding to the sleep data, and the automatic sleep threshold, etc. The actual number of sleep times of the storage device can be obtained directly in the sleep data storage area of the storage device.

[0028] Step 120: Determine whether the actual number of sleep times is greater than the target number.

[0029] As a way, in order to determine whether the automatic sleep threshold of the storage device needs to be updated before the next sleep, it is ensured that the storage device can automatically sleep according to the actual usage scenario.

[0030] Optionally, a target number of automatic hibernations corresponding to the storage device may be set in advance, and the actual number of hibernations may be compared with the target number to determine whether the actual number of hibernations is greater than the target number. Specifically, to ensure that the storage device can enter automatic hibernation, the target number may be set to 0 to determine whether the storage device entered automatic hibernation the last time it should have entered automatic hibernation. The target number may also be set to another value, which indicates the number of times the storage device enters hibernation during an automatic hibernation cycle.

[0031] As another way, the amount of writes to the table information of the storage device corresponding to the storage device before the storage device enters automatic sleep mode can be obtained, and the relationship between the actual sleep times and the target times can be determined by determining whether the amount of writes to the storage device is greater than the write amount threshold. Optionally, if it is determined that the amount of writes to the storage device is not greater than the write amount threshold, the data to be stored will continue to be written to the storage device; if it is determined that the amount of writes to the storage device is greater than or equal to the write amount threshold, the actual sleep times obtained will be compared with the target times to determine whether the actual sleep times are greater than the target times. The write amount threshold can be set according to actual needs and is not specifically limited here.

[0032] Step 130: If the actual number of sleep times is greater than the target number, it is determined that when the automatic sleep threshold of the storage device is updated, the automatic sleep threshold is updated according to the actual number of sleep times, and the storage device is automatically sleep controlled according to the updated automatic sleep threshold.

[0033] As a method, when it is determined that the actual number of sleep times is greater than the target number, in order to ensure that the storage device can be more in line with the actual usage scenario when entering the next round of automatic sleep, it can be determined again whether the automatic sleep threshold of the storage device needs to be updated. In this way, if it is determined that the automatic sleep threshold of the storage device needs to be updated, the automatic sleep threshold of the storage device will be updated according to the actual number of sleep times of the storage device obtained.

[0034] Optionally, the need to update the automatic sleep threshold of the storage device before the automatic sleep can be determined based on the corresponding sleep data of the storage device during the last automatic sleep period, so that the storage device can be more adaptable to actual usage scenarios. Optionally, the target parameter can be determined by the actual sleep times of the storage device corresponding to the sleep data, the preset sleep times under a fixed write volume, and the number of sleep pages corresponding to the storage device, and then the target parameter is compared with the target value to determine whether the automatic sleep threshold of the storage device needs to be updated. Optionally, when the target parameter is equal to the target value, it can be determined that the automatic sleep threshold does not need to be updated; when the target parameter is not equal to the target value, it can be determined that the automatic sleep threshold needs to be updated.

[0035] Optionally, the actual number of sleep times of the storage device can be used to determine whether the automatic sleep threshold of the storage device needs to be updated. Optionally, the preset number of sleep times corresponding to the storage device under a fixed write volume can be first determined, and then the actual number of sleep times can be compared with the preset number of sleep times to determine whether the automatic sleep threshold of the storage device needs to be updated. Optionally, if it is determined that the actual number of sleep times is equal to the preset number of sleep times, it is determined that the automatic sleep threshold does not need to be updated; if it is determined that the actual number of sleep times is not equal to the preset number of sleep times, it is determined that the automatic sleep threshold needs to be updated.

[0036] Optionally, when it is determined that the automatic sleep threshold needs to be updated, the intermediate parameter value can be determined based on the actual number of sleep times, and then the new automatic sleep threshold can be determined based on the intermediate parameter value and the automatic sleep threshold corresponding to the last automatic sleep of the storage device and the life of the storage device. Then, the original automatic sleep threshold of the storage device is updated to the new automatic sleep threshold, so that the automatic sleep control of the storage device can be performed based on the updated automatic sleep threshold.

[0037] Optionally, after updating the automatic sleep threshold of the storage device, in order to make the storage device more adaptable to actual usage scenarios, the updated automatic sleep threshold can be used to control the automatic sleep of the storage device, so that the storage device enters a sleep state when the idle time is greater than or equal to the new automatic sleep threshold, thereby reducing the power consumption of the storage device.

[0038] Optionally, after updating the stored automatic sleep threshold, a new intermediate parameter value can be determined based on the actual number of sleep times and the number of sleep pages after automatic sleep after the updated automatic sleep threshold, and it can be determined whether the new intermediate parameter value is equal to the target value. If not, the automatic sleep threshold is continued to be updated, and when it is determined that the new actual number of sleep times is equal to 0, the automatic sleep threshold of the storage device is initialized, so that the automatic sleep threshold becomes the initial automatic sleep threshold, ensuring that the storage device can automatically sleep normally.

[0039] In an embodiment of the present application, the actual sleep times of the storage device obtained are compared with the target times, so as to determine that the actual sleep times are greater than the target times, and to determine that the automatic sleep times of the storage device are updated, the automatic sleep threshold is updated based on the actual sleep times, and finally the automatic sleep control of the storage device can be performed according to the updated automatic sleep threshold, so that the automatic sleep threshold can be adaptively adjusted according to the actual sleep situation of the storage device, thereby improving the automatic sleep effect of the storage device, thereby reducing the power consumption of the storage device.

[0040] See also Figure 2 , Figure 2 The sleep control method provided by an embodiment of the present application is shown below. Figure 2 The sleep control method may include the following steps:

[0041] Step 210: Obtain the set sleep times corresponding to the preset write amount of the storage device.

[0042] As a way, in order to further determine whether the automatic sleep threshold of the storage device needs to be updated, the actual sleep times of the storage device can be compared with the predetermined sleep times to determine whether the automatic sleep times of the storage device meet the set requirements. Therefore, the set sleep times can be set in advance for the storage device. The set sleep times are the set sleep times corresponding to the preset write amount of the storage device, so that it is expected that the number of automatic sleep times of the storage device under the corresponding write amount will meet the set sleep times.

[0043] Optionally, the preset write amount corresponding to different usage scenarios and the set sleep times corresponding to the preset write amount can be pre-set, so as to first determine the current usage scenario of the storage device, and thus determine the preset write amount of the storage device in the corresponding usage scenario and the set sleep times corresponding to the write amount.

[0044] Step 220: Determine whether to update the automatic sleep threshold according to the actual sleep times and the set sleep times.

[0045] As one approach, the actual number of sleep cycles can be compared with the set number of sleep cycles to determine whether they are equal, thereby determining whether to update the automatic sleep threshold of the storage device. Optionally, since the set number of sleep cycles indicates the expected number of sleep cycles for the storage device under a corresponding usage scenario, the actual number of sleep cycles can be compared with the set number of sleep cycles to determine whether the specific automatic sleep conditions of the storage device meet expectations, thereby determining whether to update the automatic sleep threshold.

[0046] Step 230: If the actual sleep times are not equal to the set sleep times, then determine to update the automatic sleep threshold.

[0047] As a method, when it is determined that the actual number of sleep times is not equal to the set number of sleep times, it can be determined that the automatic sleep of the storage device does not meet expectations. At this time, it can be determined that the automatic sleep threshold needs to be updated, so that the storage device can be updated according to the updated automatic sleep threshold.

[0048] Step 240: If the actual sleep times are equal to the set sleep times, determine not to update the automatic sleep threshold.

[0049] As a method, when it is determined that the actual number of sleep times is equal to the set number of sleep times, it can be determined that the automatic sleep of the storage device meets expectations. At this time, it can be determined that the storage device can perform automatic sleep control according to the original automatic sleep threshold, thereby determining that there is no need to update the automatic sleep threshold.

[0050] In an embodiment, whether the automatic sleep threshold of the storage device needs to be updated is determined by determining whether the actual sleep times of the storage device are equal to the set sleep times corresponding to the preset write amount of the storage device, thereby ensuring the accuracy of updating the automatic sleep threshold of the storage device.

[0051] See also Figure 3 , Figure 3 The sleep control method provided by an embodiment of the present application is shown below. Figure 3 The sleep control method may include the following steps:

[0052] Step 310: Obtain the actual number of sleep times of the storage device.

[0053] Step 320: Determine whether the actual number of sleep times is greater than the target number.

[0054] The specific step descriptions of step 310 to step 320 can be found in step 110 to step 120 and will not be repeated here.

[0055] Step 330 : If the actual number of sleep times is greater than the target number, determine to obtain the number of sleep pages of the storage device when the automatic sleep threshold of the storage device is updated.

[0056] As a method, when it is determined that the actual number of sleep times is greater than the target number, it means that the automatic sleep time of the storage device during the last automatic sleep time cannot adapt to the actual usage scenario, and it can be determined that the automatic sleep time threshold needs to be updated. At this time, the automatic sleep time threshold can be updated based on the actual number of sleep times of the storage device.

[0057] Optionally, a fixed data size of each dormant page can be pre-set, so that the number of dormant pages of the storage device can be determined based on the data size of the table information written before the storage device last entered automatic dormancy and the fixed data size of each dormant page.

[0058] Step 340 : Determine the sleep frequency factor according to the actual sleep times, the set sleep times, and the number of sleep pages.

[0059] As a method, the sleep frequency factor can be used to evaluate the frequency of automatic sleep of the storage device. Then, the sleep frequency factor can be determined as an intermediate value for updating the automatic sleep threshold of the storage device, and then the automatic sleep threshold can be updated based on the sleep frequency factor as the intermediate value.

[0060] Optionally, the frequency of automatic hibernation of the storage device can be evaluated by calculating the ratio of the number of automatic hibernations to the amount of writes, and then the hibernation frequency factor can be determined by the actual number of hibernations, the set number of hibernations and the number of hibernation pages.

[0061] In some embodiments, step 340 includes: determining a sleep frequency difference between the actual sleep frequency and the set sleep frequency; determining a product of the sleep frequency difference and the number of sleep pages, and determining the product as the sleep frequency factor.

[0062] As one approach, after determining the actual number of sleep attempts and the set sleep coefficient, the sleep frequency factor can be determined by first determining the sleep frequency difference between the actual number of sleep attempts and the set number of sleep attempts, and then multiplying the sleep frequency difference by the number of sleep pages to determine the sleep frequency factor. Alternatively, the sleep frequency factor can be determined according to the formula B = (AI) * N, where B is the sleep frequency factor, A is the set number of sleep attempts, I is the actual number of sleep attempts, and N is the number of sleep pages.

[0063] In some embodiments, before step 350, Figure 4 As shown, the method further includes:

[0064] Step 410: Determine whether the sleep frequency factor is equal to a frequency threshold.

[0065] As a way, in order to further ensure that the storage device can be more adapted to the actual usage scenario in the next round of automatic hibernation, and since the hibernation frequency factor is used to evaluate the frequency of automatic hibernation of the storage device, it can be determined based on the hibernation frequency factor whether the automatic hibernation threshold of the storage device needs to be updated, so as to first determine whether the hibernation frequency factor is equal to the frequency threshold.

[0066] Optionally, the frequency threshold is the expected sleep frequency corresponding to the automatic sleep of the storage device set according to actual needs. Then, the actually calculated sleep frequency factor and the frequency threshold can be compared to determine whether the storage device meets the sleep expectations, so as to determine whether the automatic sleep threshold needs to be updated.

[0067] Step 420: If it is determined that the sleep frequency factor is equal to the frequency threshold, determine not to update the automatic sleep threshold.

[0068] As a way, when it is determined that the sleep frequency factor is equal to the frequency threshold, it can be determined that the automatic sleep of the storage device meets expectations, and then it can be determined that the storage device can perform automatic sleep control according to the automatic sleep threshold of the last automatic sleep, so it can be determined that the automatic sleep threshold will not be updated.

[0069] Step 430: If it is determined that the sleep frequency factor is not equal to the frequency threshold, determine not to update the automatic sleep threshold.

[0070] As a method, when it is determined that the sleep frequency factor is not equal to the frequency threshold, it can be determined that the automatic sleep of the storage device does not meet expectations, and then it can be determined that the automatic sleep threshold of the storage device needs to be updated, so that automatic sleep control can be performed according to the updated automatic sleep threshold.

[0071] Please continue reading Figure 3 In step 350 , when the automatic sleep threshold is updated according to the sleep frequency factor, a parameter value is determined according to the sleep frequency factor, and the automatic sleep threshold is updated based on the parameter value.

[0072] As a method, when it is determined that the sleep frequency factor is not equal to the frequency threshold, it is determined that the automatic sleep threshold of the storage device needs to be updated. Then, the parameter value can be determined based on the sleep frequency factor, and the automatic sleep threshold of the storage device can be updated according to the parameter value.

[0073] Optionally, the sleep frequency factor and the automatic sleep threshold of the storage device in the previous round may be multiplied to obtain a parameter value, and the automatic sleep threshold may be updated according to the parameter value.

[0074] In some embodiments, step 350 includes: obtaining the historical automatic sleep threshold corresponding to the last automatic sleep of the storage device; determining the life coefficient of the storage device, and determining the parameter value based on the life coefficient, the historical automatic sleep threshold and the sleep frequency factor.

[0075] As a way, since the power consumption of the storage device is related to its lifespan, the lifespan of the storage device should be considered when performing automatic sleep control on the storage device. Then, the lifespan coefficient of the storage device can be determined first, so that the parameter value can be comprehensively determined based on the lifespan coefficient and sleep frequency of the storage device.

[0076] Optionally, the number of usable times of the storage device is preset when it leaves the factory, and then the number of historical uses of the storage device is determined, so that the life coefficient of the storage device can be determined based on the number of usable times and the number of historical uses.

[0077] Optionally, the parameter value can be determined by the formula T*(1 / L)*B, where T is the historical automatic sleep threshold corresponding to the storage device in the last automatic sleep, L is the life coefficient of the storage device, and B is the sleep frequency factor.

[0078] In this embodiment, when it is determined that the automatic hibernation threshold of a storage device needs to be updated, a hibernation frequency factor is determined by obtaining the number of hibernation pages of the storage device, the actual number of hibernation times of the storage device, and the set number of hibernation times. This allows the parameter value used to update the automatic hibernation threshold to be determined based on the hibernation frequency factor, ensuring the accuracy of the automatic hibernation threshold update. Furthermore, when determining the parameter value, the storage device's lifespan coefficient is incorporated into the overall determination, thereby correlating the storage device's power consumption with its lifespan, thereby optimizing the storage device's lifespan while ensuring reduced power consumption.

[0079] See also Figure 5 , Figure 5 The sleep control method provided by an embodiment of the present application is shown below. Figure 5 The sleep control method may include the following steps:

[0080] Step 510: If it is determined that the actual number of sleep times is not greater than the target number of times, an initial automatic sleep threshold of the storage device is obtained.

[0081] As a method, when it is determined that the actual number of sleep times of the storage device is not greater than the target number, it can be determined that the storage device is less than the target number of sleep times that should be set. There may be an error in the automatic sleep threshold during the continuous update process. At this time, it can be determined that the automatic sleep threshold of the storage device needs to be restored. Therefore, the initial automatic sleep threshold of the storage device can be obtained to facilitate automatic sleep control of the storage device according to the initial automatic sleep threshold to achieve restoration.

[0082] Step 520: Automatically control the storage device to sleep according to the initial automatic sleep threshold.

[0083] As a method, after determining the initial automatic sleep threshold of the storage device, the automatic sleep information of the storage device is updated based on the initial automatic sleep threshold, so that the storage device can automatically sleep according to the initial automatic sleep threshold to achieve automatic sleep recovery.

[0084] In this embodiment, when it is determined that the actual number of sleep times is not greater than the target number, the automatic sleep threshold of the storage device is updated to the initial automatic sleep threshold, so that the storage device can be automatically sleep controlled according to the initial automatic sleep threshold, ensuring that the storage device can automatically sleep normally.

[0085] Figure 6 FIG. 1 is a block diagram of a sleep control device according to an embodiment of the present application. Figure 7 As shown, the sleep control device 600 includes: an actual sleep times acquisition module 610 , a first judgment module 620 and a first sleep control module 630 .

[0086] The actual sleep times acquisition module 610 is used to obtain the actual sleep times of the storage device; the first judgment module 620 is used to determine whether the actual sleep times are greater than the target times; the first sleep control module 630 is used to determine whether the automatic sleep times of the storage device are updated according to the actual sleep times, and to control the automatic sleep of the storage device according to the updated automatic sleep times if the actual sleep times are greater than the target times.

[0087] In some embodiments, the sleep control device 600 also includes: a set sleep number acquisition module, used to obtain the set sleep number corresponding to the storage device under a preset write amount; a second judgment module, used to determine whether to update the automatic sleep threshold based on the actual sleep number and the set sleep number; a first determination module, used to determine that the automatic sleep threshold is updated if the actual sleep number is not equal to the set sleep number; a second determination module, used to determine that the automatic sleep threshold is not updated if the actual sleep number is equal to the set sleep number.

[0088] In some embodiments, the first sleep control module 630 includes: a sleep page number acquisition submodule, used to obtain the number of sleep pages of the storage device; a sleep frequency factor determination submodule, used to determine the sleep frequency factor based on the actual sleep times, the set sleep times and the number of sleep pages; a sleep control submodule, used to determine a parameter value according to the sleep frequency factor when the automatic sleep threshold is updated according to the sleep frequency factor, and update the automatic sleep threshold based on the parameter value.

[0089] In some embodiments, the first sleep control module further includes: a judgment submodule, used to determine whether the sleep frequency factor is equal to the frequency threshold; a first determination submodule, used to determine not to update the automatic sleep threshold if it is determined that the sleep frequency factor is equal to the frequency threshold; and a second determination submodule, used to determine not to update the automatic sleep threshold if it is determined that the sleep frequency factor is not equal to the frequency threshold.

[0090] In some embodiments, the sleep frequency factor determination submodule includes: a sleep number difference determination unit, used to determine the sleep number difference between the actual sleep number and the set sleep number; a sleep frequency factor determination unit, used to determine the product of the sleep number difference and the number of sleep pages, and determine the product as the sleep frequency factor.

[0091] In some embodiments, the sleep control submodule also includes: a historical automatic sleep threshold acquisition unit, used to obtain the historical automatic sleep threshold corresponding to the storage device in the last automatic sleep; a parameter value determination unit, used to determine the life coefficient of the storage device, and determine the parameter value based on the life coefficient, the historical automatic sleep threshold and the sleep frequency factor.

[0092] In some embodiments, the sleep control device 600 also includes: an initial automatic sleep threshold acquisition module, which is used to obtain the initial automatic sleep threshold of the storage device if it is determined that the actual sleep number is not greater than the target number; and a second sleep control module, which is used to automatically control the sleep of the storage device according to the initial automatic sleep threshold.

[0093] According to one aspect of the embodiments of the present application, an electronic device is also provided, such as Figure 7 As shown, the electronic device 700 includes a processor 710 and one or more memories 720. The one or more memories 720 are used to store program instructions executed by the processor 710. When the processor 710 executes the program instructions, the above-mentioned sleep control method is implemented.

[0094] Furthermore, the processor 710 may include one or more processing cores. The processor 710 runs or executes instructions, programs, code sets or instruction sets stored in the memory 720, and calls data stored in the memory 720. Optionally, the processor 710 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 710 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to handle wireless communications. It is understandable that the above-mentioned modem may not be integrated into the processor and may be implemented separately through a communication chip.

[0095] According to one aspect of the present application, a computer-readable storage medium is provided. The computer-readable storage medium may be included in the electronic device described in the above embodiments, or may exist independently without being incorporated into the electronic device. The computer-readable storage medium carries computer-readable instructions. When the computer-readable storage instructions are executed by a processor, the method of any of the above embodiments is implemented.

[0096] It should be noted that the computer-readable medium shown in the embodiments of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, or any suitable combination thereof.

[0097] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. In some cases, the names of these units do not constitute limitations on the units themselves.

[0098] The above examples are used to illustrate the present invention, which are only used to help understand the present invention and are not intended to limit the present invention. Those skilled in the art can make several simple deductions, modifications or substitutions based on the concept of the present invention.

Claims

1. A sleep control method, applied in automatic sleep mode, characterized in that: The method comprises: Get the actual number of sleep times of the storage device; Determining whether the actual number of sleep times is greater than the target number; If the actual number of sleep times is greater than the target number, it is determined that when the automatic sleep threshold of the storage device is updated, the automatic sleep threshold is updated according to the actual number of sleep times, and the storage device is automatically sleep controlled according to the updated automatic sleep threshold.

2. The method according to claim 1, characterized in that The method further comprises: Obtaining a set number of sleep times corresponding to a preset write amount of the storage device; determining whether to update the automatic sleep threshold according to the actual sleep times and the set sleep times; If the actual sleep times are not equal to the set sleep times, determining to update the automatic sleep threshold; If the actual sleep times are equal to the set sleep times, it is determined that the automatic sleep threshold is not updated.

3. The method according to claim 1 or 2, characterized in that The updating of the automatic sleep threshold according to the actual sleep times includes: Obtaining the number of dormant pages of the storage device; determining the sleep frequency factor according to the actual sleep times, the set sleep times, and the number of sleep pages; In the case of determining to update the automatic sleep threshold according to the sleep frequency factor, a parameter value is determined according to the sleep frequency factor, and the automatic sleep threshold is updated based on the parameter value.

4. The method according to claim 3, characterized in that The method further comprises: determining whether the sleep frequency factor is equal to a frequency threshold; If it is determined that the sleep frequency factor is equal to the frequency threshold, determining not to update the automatic sleep threshold; If it is determined that the sleep frequency factor is not equal to the frequency threshold, it is determined not to update the automatic sleep threshold.

5. The method according to claim 3, characterized in that The determining the sleep frequency factor according to the actual sleep times, the set sleep times, and the number of sleep pages includes: Determine the sleep number difference between the actual sleep number and the set sleep number; A product of the sleep number difference and the number of sleep pages is determined, and the product is determined as the sleep frequency factor.

6. The method according to claim 3, characterized in that The determining of the parameter value according to the sleep frequency factor includes: Obtaining a historical automatic hibernation threshold corresponding to the last automatic hibernation of the storage device; A life coefficient of the storage device is determined, and the parameter value is determined according to the life coefficient, the historical automatic hibernation threshold, and the hibernation frequency factor.

7. The method according to any one of claims 1 to 6, characterized in that After determining whether the actual number of sleep times is greater than a sleep time threshold, the method further includes: If it is determined that the actual number of sleep times is not greater than the target number of times, obtaining an initial automatic sleep threshold value of the storage device; Automatic sleep control is performed on the storage device according to the initial automatic sleep threshold.

8. A sleep control device, used in automatic sleep mode, characterized in that: The device comprises: The actual sleep times acquisition module is used to obtain the actual sleep times of the storage device; A first judgment module is used to determine whether the actual number of sleep times is greater than the target number; The first sleep control module is used to determine, if the actual sleep number is greater than the target number, that the automatic sleep threshold of the storage device is updated according to the actual sleep number, and to control the automatic sleep of the storage device according to the updated automatic sleep threshold.

9. An electronic device, characterized in that: The electronic device comprises: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program code, which can be called by a processor to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Adaptive idle timeout for storage devices

    CN106796494A

  • Dormancy control method and device of electronic equipment and electronic equipment

    CN111209049A

  • Solid state disk power consumption control method, solid state disk and storage medium

    CN119396268A

  • Adaptive Idle Timeout for Storage Devices

    US20160103481A1

  • Memory System and Method for Adaptive Auto-Sleep and Background Operations

    US20170024002A1