A data storage management method and device, electronic equipment and storage medium

By dynamically adjusting the hibernation depth within the hard drive's hibernation zone based on data frequency, the high energy consumption problem caused by frequent hard drive wake-ups is solved, thus improving hard drive energy efficiency.

CN115840537BActive Publication Date: 2025-11-28INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211676356.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-26
Publication Date
2025-11-28
Estimated Expiration
2042-12-26

AI Technical Summary

Technical Problem

In existing technologies, storing high-frequency data on a hard drive in deep hibernation causes the hard drive to wake up frequently, resulting in high power consumption.

Method used

The system obtains the capacity of the initial storage data to match the hard drive hibernation zone, generates target storage data when a read request is received, generates frequency tags based on a preset data analysis cycle, determines the hibernation depth of the target hard drive hibernation zone, and moves the data to the target hibernation zone after the cycle ends.

Benefits of technology

It reduces the overall power consumption of the hard drive, avoids frequent wake-ups of the hard drive in deep sleep, and improves the energy efficiency of the hard drive.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115840537B_ABST
    Figure CN115840537B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a data storage management method and device, electronic equipment and storage medium. The method comprises: obtaining initial storage data; storing the initial storage data to an initial hard disk hibernation area matching the capacity of the initial storage data; upon receiving a read request for the initial storage data, obtaining a current timestamp and adding the current timestamp to the initial storage data to generate target storage data; starting a preset data analysis period, generating a frequency label corresponding to the target storage data based on the start time data of the preset data analysis period and the target storage data; determining a target hard disk hibernation area according to the frequency label, the target hard disk hibernation area having a different hibernation depth from the initial hard disk hibernation area; and after the end of the current cycle, moving the initial storage data from the initial hard disk hibernation area to the target hard disk hibernation area. The embodiments of the present application avoid frequently waking up the hard disk in deep hibernation, thereby saving overall energy consumption.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data storage, in particular to a data storage management method, a data storage management device, an electronic device and a storage medium. BACKGROUND

[0002] Hard disks exist in different levels of sleep states to meet the purpose of saving power consumption when the hard disks are inactive. In the existing scheme, data is stored based on its source, and high-frequency data is stored in a deep sleep hard disk. However, high-frequency data needs to be read frequently, which causes the deep sleep hard disk to be frequently awakened, resulting in a large amount of energy consumption of the deep sleep hard disk. Therefore, the problem of mismatching between the data hard disk and the awakening is a problem to be solved by those skilled in the art. SUMMARY

[0003] In view of the above problems, the embodiments of the present application are proposed to provide a data storage management method, a data storage management device, an electronic device and a storage medium which overcome the above problems or at least partially solve the above problems.

[0004] In a first aspect of the present application, the embodiments of the present application disclose a data storage management method, comprising:

[0005] obtaining initial storage data;

[0006] storing the initial storage data to an initial hard disk sleep area matched with the capacity of the initial storage data;

[0007] when receiving a read request for the initial storage data, obtaining a current timestamp, and adding the current timestamp to the initial storage data to generate target storage data;

[0008] starting a preset data analysis period, and generating a frequency label corresponding to the target storage data based on the starting time data of the preset data analysis period and the target storage data;

[0009] determining a target hard disk sleep area according to the frequency label, the target hard disk sleep area being different from the sleep depth of the initial hard disk sleep area;

[0010] after the end of the current cycle period, moving the initial storage data from the initial hard disk sleep area to the target hard disk sleep area.

[0011] Optionally, the method further comprises:

[0012] when the hard disk is in a sleep state, dividing the hard disk into a plurality of hard disk sleep areas according to the address of the hard disk.

[0013] Optionally, the divided hard disk hibernation area is provided with a plurality of storage hard disks, and after the initial storage data is moved from the initial hard disk hibernation area to the target hard disk hibernation area, the method further comprises:

[0014] Detecting the frequency baseline value of each divided hard disk hibernation area;

[0015] The frequency baseline values are sorted in reverse order to generate a frequency sequence;

[0016] Calculate the frequency difference between the first frequency baseline value and the last frequency baseline value in the frequency sequence;

[0017] Calculate the ratio of the frequency difference to the last frequency baseline value;

[0018] When the ratio is greater than a preset adjustment threshold, the storage hard disks of the divided hard disk hibernation area corresponding to the last frequency baseline value are reduced, and the storage hard disks of the divided hard disk hibernation area corresponding to the first frequency baseline value are correspondingly increased.

[0019] Optionally, the plurality of divided hard disk hibernation areas correspond to different capacity ranges, and the initial storage data is stored in the initial hard disk hibernation area matching the capacity of the initial storage data, comprising:

[0020] Determine the capacity of the initial storage data;

[0021] When the capacity of the initial storage data is within the capacity range, determine the divided hard disk hibernation area corresponding to the capacity range as the initial hard disk hibernation area;

[0022] Store the initial storage data in the initial hard disk hibernation area.

[0023] Optionally, the start time data of the preset data analysis period includes a start time stamp and a period length, and the frequency label corresponding to the target storage data is generated based on the start time data of the preset data analysis period and the target storage data, comprising:

[0024] Compare the start time stamp with the current time stamp corresponding to the target storage data to generate a time difference;

[0025] Determine the frequency label corresponding to the target storage data according to the time difference and the period length.

[0026] Optionally, the frequency label corresponding to the target storage data is determined according to the time difference and the period length, comprising:

[0027] Divide the period length into a plurality of equal difference reference lengths, and the reference length corresponds to a frequency label;

[0028] determining a target reference time length from the reference time length according to the time difference;

[0029] determining a frequency label corresponding to the target reference time length as a frequency label corresponding to the target storage data.

[0030] Optionally, the determining the frequency label corresponding to the target storage data according to the time difference and the period length comprises:

[0031] calculating a ratio of the time difference and the period length;

[0032] sorting the target storage data based on the ratio;

[0033] determining the frequency label corresponding to the target storage data according to a sorting position of the target storage data.

[0034] Optionally, the moving the initial storage data from the initial hard disk hibernation area to the target hard disk hibernation area comprises:

[0035] reading the initial storage data from the initial hard disk hibernation area;

[0036] storing the initial storage data to an idle storage hard disk of the target hard disk hibernation area;

[0037] deleting the initial storage data from the initial hard disk hibernation area.

[0038] Optionally, the storing the initial storage data to the idle storage hard disk of the target hard disk hibernation area comprises:

[0039] sequentially storing the initial storage data to the idle storage hard disk of the target hard disk hibernation area one by one.

[0040] In a second aspect, the embodiments of the present application further disclose a data storage management device, comprising:

[0041] a first obtaining module, configured to obtain initial storage data;

[0042] a pre-storing module, configured to store the initial storage data to an initial hard disk hibernation area matching a capacity of the initial storage data;

[0043] a second obtaining module, configured to obtain a current time stamp when receiving a read request for the initial storage data, and generate target storage data by adding the current time stamp to the initial storage data;

[0044] The starting module is configured to start a preset data analysis period, generate a frequency label corresponding to the target storage data based on starting time data of the preset data analysis period and the target storage data;

[0045] The first determining module is configured to determine a target hard disk hibernation area according to the frequency label, the target hard disk hibernation area being different from the initial hard disk hibernation area in hibernation depth;

[0046] The moving module is configured to move the initial storage data from the initial hard disk hibernation area to the target hard disk hibernation area after the current cycle period ends.

[0047] In a third aspect of the present application, an electronic device is disclosed, which comprises a processor, a memory, and a computer program stored in the memory and capable of running on the processor, and the computer program implements the steps of the data storage management method when executed by the processor.

[0048] In a fourth aspect of the present application, a computer readable storage medium is disclosed, which stores a computer program, and the computer program implements the steps of the data storage management method when executed by a processor.

[0049] The embodiments of the present application have the following advantages:

[0050] The embodiments of the present application comprise the following advantages: BRIEF DESCRIPTION OF DRAWINGS

[0051] Figure 1 is a step flow chart of a data storage management method embodiment of the present application;

[0052] Figure 2 is a step flow chart of another data storage management method embodiment of the present application;

[0053] Figure 3 is a step flow chart of a data storage management method example of the present application;

[0054] Figure 4 is a structural block diagram of a data storage management device embodiment of the present application;

[0055] Figure 5 is a structural block diagram of an electronic device provided by an embodiment of the present application;

[0056] Figure 6 is a structural block diagram of a storage medium provided by an embodiment of the present application. DETAILED DESCRIPTION

[0057] In order to make the above objectives, features and advantages of the present application more apparent and comprehensible, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0058] Referring to Figure 1 , a step flow chart of a data storage management method embodiment of the present application is shown, which can specifically include the following steps:

[0059] Step 101, obtaining initial storage data;

[0060] When there is a need to store data of a hard disk, the data that needs to be stored, i.e., initial storage data, can be obtained. The initial storage data can come from a server, a processing terminal, etc., and the source of the initial storage data is not limited. The type of the initial storage data can be cold data, hot data, or warm data; wherein, the hot data refers to frequently accessed online data, which has a high requirement on storage performance. The cold data refers to infrequently accessed offline data, such as backup and archive data, which has a relatively low requirement on storage performance and requires a large-capacity storage medium. The access frequency and requirement on storage performance of the warm data are between those of the hot data and the cold data.

[0061] Step 102, storing the initial storage data to an initial hard disk hibernation area matching the capacity of the initial storage data;

[0062] After obtaining the initial storage data, the capacity of the initial storage data can be determined to determine an initial hard disk hibernation area matching the capacity of the initial storage data, and the initial storage data is stored to the initial hard disk hibernation area for pre-storage based on the capacity of the initial storage data.

[0063] It should be noted that there can be multiple initial hard disk hibernate areas, and different initial hard disk hibernate areas are used to store initial storage data of different capacity sizes. For example, there can be four initial hard disk hibernate areas: a.zone hibernate area, b.zone hibernate area, c.zone hibernate area, and z.zone hibernate area. The a.zone is used to store initial storage data with a capacity less than 16K (bytes); the b.zone hibernate area is used to store initial storage data with a capacity greater than 16K and less than 256K; the c.zone hibernate area is used to store initial storage data with a capacity greater than 256K and less than 1024K; and the z.zone hibernate area is used to store initial storage data with a capacity greater than 1024K.

[0064] Step 103, upon receiving a read request for the initial storage data, obtaining a current timestamp, and adding the current timestamp to the initial storage data to generate target storage data;

[0065] After the initial storage data is pre-stored in the initial hard disk hibernate area, there can be a read request for the initial storage data. The read request for the initial storage data can be received, and the initial storage data can be read from the initial hard disk hibernate area in response to the read request; at the same time, a current timestamp corresponding to the current actual time can be obtained, such as 14:38; and the current timestamp can be added to the initial storage data to generate target storage data, i.e., the target storage data is storage data carrying the current timestamp.

[0066] In addition, when the target storage data is generated and a read request for the initial storage data is also received, a new current timestamp can be obtained, and the current timestamp in the target storage data can be updated.

[0067] It should be noted that the granularity of the current timestamp can be minutes, seconds, milliseconds, microseconds, etc., and the granularity of the timestamp is not limited.

[0068] Step 104, starting a preset data analysis period, and generating a frequency label corresponding to the target storage data based on the starting time data of the preset data analysis period and the target storage data;

[0069] When it is necessary to analyze the target storage data to determine its read frequency, the preset data analysis period is started; the read frequency of the target storage data is analyzed by starting the preset data analysis period. According to the difference between the starting time data of the preset data analysis period and the target storage data, the frequency label corresponding to the read frequency of the target storage data is determined. The frequency label is used to represent the read frequency level of the target storage data; for example, the frequency label can be A, B, C, and D; the read frequency level of A level is frequent; the read frequency level of B level is general; the read frequency level of C level is less frequently read; and the read frequency level of D level is not read.

[0070] In addition, in order to avoid affecting other running processes in the data analysis process, the data analysis can be performed at the trough of the device data processing, such as at the low peak of 24h data in the early morning.

[0071] Step 105, according to the frequency label, determine the target hard disk hibernation area, the target hard disk hibernation area is different from the hibernation depth of the initial hard disk hibernation area;

[0072] The frequency label corresponds to the hard disk hibernation area with different reading frequency. When the frequency label corresponding to the target storage data is determined, the hard disk hibernation area corresponding to the frequency label is determined as the target hard disk hibernation area. The hibernation depth of the target hard disk hibernation area is different from that of the initial hard disk hibernation area; and the physical hard disk corresponding to the target hard disk hibernation area and the initial hard disk hibernation area can be the same, that is, the target hard disk hibernation area and the initial hard disk hibernation area are the hibernation areas corresponding to the same physical hard disk in different stages.

[0073] Step 106, after the end of the current cycle period, move the initial storage data from the initial hard disk hibernation area to the target hard disk hibernation area.

[0074] When the current cycle period of data analysis ends, the data can be moved. At this time, the initial storage data can be moved from the original initial hard disk hibernation area to the target hard disk hibernation area according to the target hard disk hibernation area determined by the frequency label; the initial storage data is stored in the target hard disk hibernation area and enters the target hard disk hibernation area hibernation, so that the data with the same reading frequency level can be stored in the same target hard disk hibernation area, and the data in a target hard disk hibernation area has the same reading frequency, which can obtain more hibernation time to reduce the power consumption of the hard disk.

[0075] The embodiment of the present application acquires initial storage data, stores the initial storage data to an initial hard disk hibernation area matching the capacity of the initial storage data, acquires a current timestamp when a read request for the initial storage data is received, and generates target storage data by adding the current timestamp to the initial storage data, starts a preset data analysis period, generates a frequency label corresponding to the target storage data based on the start time data of the preset data analysis period and the target storage data, determines a target hard disk hibernation area according to the frequency label, the target hard disk hibernation area has a different hibernation depth from the initial hard disk hibernation area, and moves the initial storage data from the initial hard disk hibernation area to the target hard disk hibernation area after the current cycle period ends. The initial storage data is pre-judged to fall into the corresponding hibernation area, and then the initial storage data is stored in the target hard disk hibernation area matching the read frequency based on the use frequency of the initial storage data, so that the hard disk in shallow hibernation can be frequently awakened, the hard disk in deep hibernation can be avoided from being frequently awakened, and the purpose of reducing overall power consumption is achieved.

[0076] Referring to Figure 2 , a step flowchart of another data storage management method embodiment of the present application is shown, and the data storage management method can specifically include the following steps:

[0077] Step 201, when the hard disk is in a hibernation state, the hard disk is divided into a plurality of hard disk hibernation areas according to the address of the hard disk; the divided hard disk hibernation area is provided with a plurality of storage hard disks;

[0078] When the hard disk is in a hibernation state, the data in the hard disk will not be read and written, at this time, the hard disk can be divided into hibernation areas according to the address, and the areas corresponding to the address are divided into a plurality of hard disk hibernation areas. Different divided hard disk hibernation areas are used to store data of different capacities or different read frequencies. Each divided hard disk hibernation area is provided with a plurality of storage hard disks; since the storage data capacity is different, the corresponding capacity, i.e. the number of storage hard disks, can be different; and the storage hard disks in the divided hard disk hibernation area can be numbered to facilitate identification of the storage hard disks.

[0079] For example, based on the hibernation state of the hard disk, the a.zone hard disk hibernation area, the b.zone hard disk hibernation area, the c.zone hard disk hibernation area, and the z.zone hard disk hibernation area are divided according to the address area.

[0080] The storage hard disks in the area entering the a.zone are numbered as n1.azone, …, nx.azone. The storage hard disks in the area entering the b.zone are numbered as n1.bzone, …, nx.bzone. The storage hard disks in the area entering the c.zone are numbered as n1.czone, …, nx.czone. The storage hard disks in the area entering the z.zone are numbered as n1.zzone, …, nx.zzone. The number of the storage hard disks corresponding to the a.zone hard disk hibernation area, the b.zone hard disk hibernation area, the c.zone hard disk hibernation area, and the z.zone hard disk hibernation area can satisfy: z.zone hard disk hibernation area > c.zone hard disk hibernation area > b.zone hard disk hibernation area > a.zone hard disk hibernation area. It should be noted that the number of the storage hard disks corresponding to each divided hard disk hibernation area is not fixed and can be dynamically adjusted based on the use case.

[0081] In step 202, initial storage data is obtained.

[0082] After the hard disk hibernation areas are divided, when an IO (Input / Output) arrives each time, the initial storage data carried by the IO is obtained.

[0083] In step 203, the initial storage data is stored in an initial hard disk hibernation area matching the capacity of the initial storage data.

[0084] In the embodiment of the present application, the divided hard disk hibernation area is the initial hard disk hibernation area when pre-storing the initial storage data. After receiving the initial storage data, the initial storage data can be stored in the matching initial hard disk hibernation area according to the capacity of the initial storage data.

[0085] Specifically, the plurality of divided hard disk hibernation areas correspond to different capacity ranges, and the step of storing the initial storage data in an initial hard disk hibernation area matching the capacity of the initial storage data can include the following sub-steps:

[0086] In sub-step S2031, the capacity of the initial storage data is determined.

[0087] In actual application, different divided hard disk hibernation areas, i.e., different initial hard disk hibernation areas, correspond to different capacity ranges; for example, the capacity range of the a.zone hard disk hibernation area is less than 16K, the capacity range of the b.zone hard disk hibernation area is greater than 16K and less than 256K, the capacity range of the c.zone hard disk hibernation area is greater than 256K and less than 1024K, and the capacity range of the z.zone hard disk hibernation area is greater than 1024K.

[0088] When pre-storing, first, the capacity of initial storage data is determined; the granularity of the capacity can be expressed in byte units.

[0089] In sub-step S2032, when the capacity of initial storage data is in the capacity range, the hard disk hibernation area corresponding to the capacity range is determined as the initial hard disk hibernation area.

[0090] The capacity of initial storage data is compared with the capacity range corresponding to each hard disk hibernation area, to determine the capacity range to which the initial storage data belongs; when the capacity of initial storage data is in the capacity range, the hard disk hibernation area corresponding to the capacity range is determined as the initial hard disk hibernation area.

[0091] Continuing with the above example, when the initial storage data is less than 16K, the a.zone hard disk hibernation area is determined as the initial hard disk hibernation area; when the initial storage data is greater than 16K and less than 256K, the b.zone hard disk hibernation area is determined as the initial hard disk hibernation area; when the initial storage data IO is greater than 256K and less than 1024K, the c.zone hard disk hibernation area is determined as the initial hard disk hibernation area; and when the initial storage data is greater than 1024K, the z.zone hard disk hibernation area is determined as the initial hard disk hibernation area.

[0092] In sub-step S2033, the initial storage data is stored in the initial hard disk hibernation area.

[0093] The initial storage data is stored in the initial hard disk hibernation area, to complete the pre-storing of the initial storage data, and wait for the data analysis period to determine the read frequency.

[0094] In step 204, when a read request for the initial storage data is received, a current timestamp is obtained, and the current timestamp is added to the initial storage data to generate target storage data.

[0095] When the initial storage data is stored in the initial hard disk hibernation area, when a read request for the initial storage data is received, a current timestamp can be obtained; and the current timestamp is added to the initial storage data to generate target storage data. The way of obtaining the current timestamp can be set according to requirements by those skilled in the art, and the embodiments of the present application do not limit this.

[0096] In addition, when the target storage data is generated, when a new read request for the initial storage data is received, a new current timestamp is obtained, and the new current timestamp is used to update the current timestamp in the target storage data.

[0097] Step 205, starting a preset data analysis period, generating a frequency label corresponding to the target storage data based on the starting time data of the preset data analysis period and the target storage data;

[0098] Starting a preset data analysis period, performing data analysis on the initial storage data based on the starting time data of the preset data analysis period, determining the reading frequency of the target storage data, and generating a frequency label corresponding to the target storage data.

[0099] Specifically, the starting time data of the preset data analysis period includes a starting time stamp and a period length, and the step of generating a frequency label corresponding to the target storage data based on the starting time data of the preset data analysis period and the target storage data can include the following sub-steps:

[0100] Sub-step S2051, comparing the starting time stamp with the current time stamp corresponding to the target storage data to generate a time difference;

[0101] In an embodiment of the present application, the starting time data of the preset data analysis period includes a starting time stamp and a period length. The starting time stamp is the time stamp of starting the preset data analysis period. The starting time stamp and the current time stamp of the target storage data are on the same time axis. The period length is the length of the running of the preset data analysis period.

[0102] First, the starting time stamp can be compared with the current time stamp corresponding to the target storage data. The time difference (t.diff) can be generated by subtracting the current time stamp (t.read) from the starting time stamp (t.real). The maximum value of t.diff should be the period length, and the minimum value is 0. When t.read is greater than t.real, t.diff is directly marked as 0.

[0103] Sub-step S2052, determining a frequency label corresponding to the target storage data according to the time difference and the period length.

[0104] According to the relationship between the time difference and the period length, the frequency label corresponding to the target storage data is determined.

[0105] In an optional embodiment of the present application, the step of determining a frequency label corresponding to the target storage data according to the time difference and the period length includes the following sub-steps:

[0106] Sub-step S20521, dividing the period length into a plurality of equal reference lengths, and the reference length corresponds to a frequency label;

[0107] In the embodiment of the present application, the period length can be divided into multiple equal-difference reference lengths according to the relationship between the time difference and the period length; for example, 25% of the period length is the first reference length, 50% of the period length is the second reference length, 75% of the period length is the third reference length, and 100% of the period length is the fourth reference length.

[0108] In sub-step S20522, the target reference length is determined from the reference lengths according to the time difference.

[0109] The target reference length is determined from the reference lengths according to the size of the time difference. Continuing with the above example, when the time difference is less than 25% of the period length, the first reference length is determined as the target reference length; when the time difference is less than 50% of the period length and greater than 25% of the period length, the second reference length is determined as the target reference length; when the time difference is less than 75% of the period length and greater than 50% of the period length, the third reference length is determined as the target reference length; and when the time difference is greater than 75% of the period length, the fourth reference length is determined as the target reference length.

[0110] In sub-step S20523, the frequency label corresponding to the target reference length is determined as the frequency label corresponding to the target storage data.

[0111] Each reference length represents a different reading frequency, and the frequency label corresponding to each reference length represents a different reading frequency. Continuing with the above example, the reading frequencies represented by the first reference length, the second reference length, the third reference length, and the fourth reference length are increasing, i.e., the reading frequency corresponding to the first reference length < the reading frequency corresponding to the second reference length < the reading frequency corresponding to the third reference length < the reading frequency corresponding to the fourth reference length. Accordingly, the reading frequency of the frequency label corresponding to the target reference length is also the same.

[0112] After the target reference length is determined, the frequency label corresponding to the target reference length can be determined as the frequency label corresponding to the target storage data.

[0113] In an optional embodiment of the present application, the step of determining the frequency label corresponding to the target storage data according to the time difference and the period length comprises the following sub-steps:

[0114] In sub-step S20524, the ratio of the time difference to the period length is calculated.

[0115] In the embodiment of the present application, another embodiment for determining the frequency label corresponding to the target storage data is provided. The start time data of the preset data analysis period comprises a start time stamp and a period length. The start time stamp is the time stamp of starting the preset data analysis period. The start time stamp and the current time stamp of the target storage data are in the same time axis. The period length is the length of running the preset data analysis period.

[0116] Firstly, the ratio of the time difference to the period length is calculated, i.e. the proportion of the time difference in the period length.

[0117] In sub-step S20525, the target storage data is sorted based on the ratio.

[0118] The target storage data is sorted based on the size relationship of the ratio. The sorting can be sequential sorting or reverse sorting.

[0119] In sub-step S20526, the frequency label corresponding to the target storage data is determined according to the sorting position of the target storage data.

[0120] After sorting, the reading frequency level of the target storage data is determined according to the sorting position of the target storage data, and then the frequency label corresponding to the target data is determined. For example, if there are 10 data, and the sorting position of the target storage data in the sequential sorting is the second, it can be determined that the frequency label corresponding to the target storage data is the high-frequency label.

[0121] In step 206, the target hard disk hibernation area is determined according to the frequency label, and the target hard disk hibernation area is different from the hibernation depth of the initial hard disk hibernation area.

[0122] The target hard disk hibernation area with matching reading frequency is determined from the divided hard disk hibernation area according to the frequency label, and the target hard disk hibernation area is different from the hibernation depth of the initial hard disk hibernation area.

[0123] In step 207, after the end of the current cycle period, the initial storage data is moved from the initial hard disk hibernation area to the target hard disk hibernation area.

[0124] After the end of the current cycle period, i.e. after the completion of all data analysis, the initial storage data can be moved from the initial hard disk hibernation area to the target hard disk hibernation area for storage, and follow the hibernation rhythm of the target hard disk hibernation area for hibernation.

[0125] In an optional embodiment of the present application, the step of moving the initial storage data from the initial hard disk hibernation area to the target hard disk hibernation area can comprise the following sub-steps:

[0126] Sub-step S2071, reading the initial storage data from the initial hard disk hibernation area;

[0127] In practical applications, the initial storage data can be read from the initial hard disk hibernation area first.

[0128] Sub-step S2072, storing the initial storage data to the idle storage hard disk of the target hard disk hibernation area;

[0129] The read initial storage data is stored in the idle storage hard disk of the target hard disk hibernation area, so as to realize the storage of the initial storage data.

[0130] Specifically, the step of storing the initial storage data to the idle storage hard disk of the target hard disk hibernation area specifically includes the following sub-steps:

[0131] Sub-step S20721, sequentially storing the initial storage data to the idle storage hard disk of the target hard disk hibernation area one by one.

[0132] In practical applications, the next idle storage hard disk can be determined based on the currently used storage disk of the target hard disk hibernation area, the initial storage data is sequentially stored in the next idle storage hard disk one by one, and the first idle storage hard disk of the target hard disk hibernation area is sequentially written to the next idle storage hard disk.

[0133] Sub-step S2073, deleting the initial storage data from the initial hard disk hibernation area.

[0134] After reading the initial storage data, the initial storage data can be deleted from the initial hard disk hibernation area, so as to avoid repeated storage and improve the storage rate of the initial hard disk hibernation area.

[0135] Step 208, detecting the frequency baseline value of each divided hard disk hibernation area;

[0136] After the initial storage data is stored into the target hard disk hibernation area, the frequency baseline value of the entire divided hard disk hibernation area can be detected. The frequency baseline value is the ratio of the total number of the storage hard disks divided into the hard disk hibernation area to the number of the currently used storage hard disks. For example, the frequency baseline value rate.a of the a.zone hard disk hibernation area is the number of the disks in the current area / the number of the currently used disks. The frequency baseline value rate.b of the b.zone hard disk hibernation area is the number of the disks in the current area / the number of the currently used disks. The frequency baseline value rate.c of the c.zone hard disk hibernation area is the number of the disks in the current area / the number of the currently used disks. The frequency baseline value rate.z of the z.zone hard disk hibernation area is the number of the disks in the current area / the number of the currently used disks.

[0137] Step 209, the frequency baseline values are sorted in reverse order to generate a frequency sequence.

[0138] The frequency baseline values are sorted in reverse order according to the size to generate a frequency sequence; that is, the elements in the frequency sequence decrease.

[0139] Step 210, the frequency difference value between the first frequency baseline value and the last frequency baseline value in the frequency sequence is calculated.

[0140] The first frequency baseline value and the last frequency baseline value in the frequency sequence are determined, the maximum value in the frequency sequence, that is, max(rate.a., rate.b, rate.c, rate.z), and the minimum value in the frequency sequence, that is, min(rate.a., rate.b, rate.c, rate.z), are taken. The frequency difference value between the first frequency baseline value and the last frequency baseline value is calculated, that is, max(rate.a., rate.b, rate.c, rate.z)-min(rate.a., rate.b, rate.c, rate.z).

[0141] Step 211, the ratio of the frequency difference value to the last frequency baseline value is calculated.

[0142] The ratio of the frequency difference value to the last frequency baseline value is calculated, that is, (max(rate.a., rate.b, rate.c, rate.z)-min(rate.a., rate.b, rate.c, rate.z)) / min(rate.a., rate.b, rate.c, rate.z); the difference of the use of the storage hard disks divided into the hard disk hibernation area is determined by the ratio.

[0143] Step 212, when the ratio is greater than a preset adjustment threshold, the storage hard disk of the last frequency baseline value corresponding to the divided hard disk sleep area is reduced, and the storage hard disk of the first frequency baseline value corresponding to the divided hard disk sleep area is increased.

[0144] When the ratio is greater than a preset adjustment threshold, it indicates that the use of the storage hard disk of the divided hard disk sleep area is not balanced, and the storage hard disk of the first frequency baseline value corresponding to the divided hard disk sleep area can be increased, and the storage hard disk of the last frequency baseline value corresponding to the divided hard disk sleep area can be reduced, so that the use of the storage hard disk of each divided hard disk sleep area is balanced. The preset adjustment threshold can be selected according to the actual situation, and the embodiment of the application is not limited to this. In an example of the application, the preset adjustment threshold can be 25%.

[0145] By pre-judging the initial storage data to fall into the corresponding sleep area, then storing the initial storage data into the target hard disk sleep area matching the reading frequency based on the use frequency of the initial storage data, the hard disk in shallow sleep can be frequently awakened, avoiding the hard disk in deep sleep from being frequently awakened, achieving the purpose of reducing the overall power consumption; and after storing the initial storage data into the target hard disk sleep area, judging the use of each divided hard disk sleep area, adjusting the number of storage hard disks of the divided hard disk sleep area, so that the hard disk sleep area can have sufficient storage space to store data, avoiding storing data into the divided hard disk sleep area that does not match the reading frequency, further improving the accuracy of storage, so that data can be stored in the divided hard disk sleep area with appropriate reading frequency, and the divided hard disk sleep area can be effectively put into sleep, further reducing the overall energy consumption.

[0146] In order for those skilled in the art to better understand the embodiments of the application, the embodiments of the application are described below by an example:

[0147] Referring to Figure 3 , a step flow chart of an example of a data storage management method of the application is shown;

[0148] First, when the hard disk is in sleep state, the hard disk sleep area is divided based on the address of the current hard disk, and the total number of 60 disks is divided according to the number ratio of 1:2:3:4, i.e. a.zone, b.zone, c.zone, z.zone disks, and the corresponding number is 6, 12, 18, and 24 respectively.

[0149] After receiving 300K (byte) size data, it is judged that the data is based on size, greater than 56K and less than 1024K, i.e. can fall into idleC area (initial hard disk sleep area), and is written into the first disk of C area.

[0150] Receive 800K size data, judge data based on size, greater than 56K and less than 1024K, that is, can fall into idleC area (initial hard disk hibernation area), fall into the first piece of disk. If the first piece of disk space is full, fall into the second piece of disk.

[0151] When there is a read request for 300K data, add the tag t.real (current timestamp).

[0152] When there is a read request for 300K data again, update the tag t.real.

[0153] Select t.cycle (current cycle) as 4 days.

[0154] Because 300K data has more frequent reading, time period confirmation is performed, diff (time difference) is 0.5, and the target hard disk hibernation area is determined as a.zone area.

[0155] Because 800K data falls into C disk and has no reading, time period confirmation diff is 4, and the target hard disk hibernation area is determined as z.zone area.

[0156] After the current cycle period ends, move 300K data to a.zone area and start storing from the disk of the current area. If the first piece of disk is full, store it in the second piece of disk in turn. Move 800K data to z.zone area and start storing from the disk of the current area. If the first piece of disk is full, store it in the second piece of disk in turn.

[0157] After the identification is completed, start moving data to the idle storage hard disk of the target hard disk hibernation area, complete the allocation of data in the current cycle period, and enter the hibernation state of the corresponding area based on the area.

[0158] When there is a data read request, the hard disk can be awakened in any area and respond to the data read request.

[0159] It should be noted that for the method embodiment, in order to simply describe, it is expressed as a series of action combinations, but those skilled in the art should know that the embodiments of the present application are not limited by the order of the described actions, because according to the embodiments of the present application, certain steps can be performed in other order or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions involved are not necessarily necessary for the embodiments of the present application.

[0160] Referring to Figure 4 , a structural block diagram of an embodiment of a data storage management device of the present application is shown, which can specifically include the following modules:

[0161] The first obtaining module 401 is configured to obtain initial storage data;

[0162] The pre-storing module 402 is configured to store the initial storage data to an initial hard disk hibernation area matching the capacity of the initial storage data;

[0163] The second obtaining module 403 is configured to obtain a current timestamp when receiving a read request for the initial storage data, and generate target storage data by adding the current timestamp to the initial storage data;

[0164] The starting module 404 is configured to start a preset data analysis period, and generate a frequency label corresponding to the target storage data based on the starting time data of the preset data analysis period and the target storage data;

[0165] The first determining module 405 is configured to determine a target hard disk hibernation area according to the frequency label, wherein the target hard disk hibernation area has a different hibernation depth from the initial hard disk hibernation area;

[0166] The moving module 406 is configured to move the initial storage data from the initial hard disk hibernation area to the target hard disk hibernation area after the current cycle period ends.

[0167] In an optional embodiment of the present application, the device further comprises:

[0168] The dividing module is configured to divide the hard disk into a plurality of hard disk hibernation areas according to the address of the hard disk when the hard disk is in a hibernation state.

[0169] In an optional embodiment of the present application, the divided hard disk hibernation area is provided with a plurality of storage hard disks, and the device further comprises:

[0170] The detecting module is configured to detect the frequency baseline value of each divided hard disk hibernation area;

[0171] The sorting module is configured to sort the frequency baseline values in reverse order to generate a frequency sequence;

[0172] The first calculating module is configured to calculate the frequency difference value between the frequency baseline value at the first position and the frequency baseline value at the last position in the frequency sequence;

[0173] The second calculating module is configured to calculate the ratio of the frequency difference value to the frequency baseline value at the last position;

[0174] The regulating module is configured to, when the ratio is greater than a preset adjustment threshold, reduce the storage hard disk of the divided hard disk hibernation area corresponding to the frequency baseline value at the last position, and correspondingly increase the storage hard disk of the divided hard disk hibernation area corresponding to the frequency baseline value at the first position.

[0175] In an optional embodiment of the present application, the plurality of divided hard disk hibernation areas correspond to different capacity ranges, and the pre-storage module 402 comprises:

[0176] a capacity determination sub-module configured to determine the capacity of the initial storage data;

[0177] a first determination sub-module configured to determine, when the capacity of the initial storage data is within the capacity range, that the divided hard disk hibernation area corresponding to the capacity range is the initial hard disk hibernation area;

[0178] a storage sub-module configured to store the initial storage data to the initial hard disk hibernation area.

[0179] In an optional embodiment of the present application, the start time data of the preset data analysis period comprises a start time stamp and a period length, and the first determination module 405 comprises:

[0180] a comparison sub-module configured to compare the start time stamp with the current time stamp corresponding to the target storage data to generate a time difference;

[0181] a frequency label determination sub-module configured to determine, according to the time difference and the period length, the frequency label corresponding to the target storage data.

[0182] In an optional embodiment of the present application, the frequency label determination sub-module comprises:

[0183] an equal division unit configured to divide the period length into a plurality of equidifferent reference lengths, the reference length corresponding to a frequency label;

[0184] a target reference length unit configured to determine, according to the time difference, a target reference length from the reference lengths;

[0185] a first determination unit configured to determine the frequency label corresponding to the target reference length as the frequency label corresponding to the target storage data.

[0186] In an optional embodiment of the present application, the frequency label determination sub-module comprises:

[0187] a calculation unit configured to calculate the ratio of the time difference to the period length;

[0188] a sorting unit configured to sort the target storage data based on the ratio;

[0189] a second determination unit configured to determine, according to the sorting position of the target storage data, the frequency label corresponding to the target storage data.

[0190] In an optional embodiment of the present application, the moving module 406 comprises:

[0191] a data reading sub-module, configured to read the initial storage data from the initial hard disk hibernation area;

[0192] a data storage sub-module, configured to store the initial storage data to the idle storage hard disk of the target hard disk hibernation area;

[0193] a data deletion sub-module, configured to delete the initial storage data from the initial hard disk hibernation area.

[0194] In an optional embodiment of the present application, the data storage sub-module comprises:

[0195] a sequential storage unit, configured to sequentially store the initial storage data to the idle storage hard disk of the target hard disk hibernation area one by one.

[0196] For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts refer to the part of the method embodiment.

[0197] With reference to Figure 5 The embodiment of the present application further provides an electronic device, comprising:

[0198] The processor 501 and the storage medium 502, the storage medium 502 stores the computer program executable by the processor 501, when the electronic device runs, the processor 501 executes the computer program, to execute the data storage management method as any one of the embodiments of the present application. The specific implementation and technical effects are similar to some of the method embodiments, which will not be repeated here.

[0199] The memory can include a random access memory (RAM) and can also include a non-volatile memory, such as at least one disk memory. Optionally, the memory can also be at least one storage device located away from the aforementioned processor.

[0200] The processor described above can be a general processor, including a central processing unit (CPU), a network processor (NP), etc.; can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.

[0201] With reference to Figure 6 The computer readable storage medium 601 stores a computer program, and the computer program is executed by a processor to perform the data storage management method according to any one of the embodiments of the present application. The specific implementation and technical effects are similar to some of the method embodiments, and will not be repeated here.

[0202] Each embodiment in the specification is described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same and similar parts between each embodiment can be referred to each other.

[0203] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, device or computer program product. Therefore, the embodiments of the present application can be in the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present application can be in the form of a computer program product implemented on one or more computer usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.

[0204] The embodiments of the present application are described with reference to flowcharts and / or block diagrams according to the method, terminal device (system) and computer program product of the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of the flows and / or blocks in the flowchart and / or block diagram can be realized by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing terminal device to produce a machine, so that the instructions executed by the computer or other programmable data processing terminal device produce a device for implementing the functions specified in the flowchart and / or block diagram. Figure 1 The device for implementing the functions specified in one flow or multiple flows and / or blocks Figure 1 The device for implementing the functions specified in one flow or multiple flows and / or blocks

[0205] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the flow Figure 1 one or more flow or block Figure 1 one or more flow or block

[0206] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the flow Figure 1 one or more flow or block Figure 1 one or more flow or block

[0207] Although preferred embodiments of the present application have been described, those skilled in the art will be able to make additional changes and modifications thereto without departing from the scope of the present application. Accordingly, it is intended to embrace all such changes and modifications as fall within the scope of the present application.

[0208] Finally, it should be noted that the terms "first" and "second" and the like are used merely to distinguish one entity or action from another, without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises", "comprising", or any other variation thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises a... " does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.

[0209] The above provides a data storage management method, device, electronic equipment and storage medium provided by the present application, and the principle and implementation manner of the present application are described by using specific examples. The above description of the embodiments is only used to help understand the method and core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation manner and application range can be changed, and the above description of the present application should not be understood as a limitation.

Claims

1. A data storage management method, characterized in that, include: Obtain initial storage data; The initial storage data is stored in an initial hard disk hibernation area whose capacity matches that of the initial storage data; Upon receiving a read request for the initial stored data, the current timestamp is obtained and incremented into the initial stored data to generate the target stored data; A preset data analysis cycle is initiated. Based on the start time data of the preset data analysis cycle and the target stored data, a frequency tag corresponding to the target stored data is generated, including: comparing the start timestamp and the current timestamp corresponding to the target stored data to generate a time difference; and determining the frequency tag corresponding to the target stored data based on the time difference and the cycle duration. The target hard drive hibernation zone is determined according to the frequency label, and the hibernation depth of the target hard drive hibernation zone is different from that of the initial hard drive hibernation zone; After the current cycle ends, the initial stored data is moved from the initial hard disk hibernation area to the target hard disk hibernation area.

2. The method according to claim 1, characterized in that, The method further includes: When the hard drive is in hibernation mode, it is divided into multiple hard drive hibernation zones according to the hard drive's address.

3. The method according to claim 2, characterized in that, The method further includes: multiple hard drive hibernation zones are configured with multiple storage hard drives; after moving the initial stored data from the initial hard drive hibernation zone to the target hard drive hibernation zone, the method also includes: Detect the baseline frequency values ​​of the multiple hard drive hibernation zones as described above; The frequency baseline values ​​are sorted in reverse order to generate a frequency sequence; Calculate the frequency difference between the baseline value of the first frequency position and the baseline value of the last frequency position in the frequency sequence; Calculate the ratio of the frequency difference to the frequency baseline value of the last position; When the ratio is greater than a preset adjustment threshold, the number of storage hard drives corresponding to the last frequency baseline value in the multiple hard drive hibernation zones is reduced, and the number of storage hard drives corresponding to the first frequency baseline value in the multiple hard drive hibernation zones is increased accordingly.

4. The method according to claim 2, characterized in that, The multiple hard disk hibernation zones correspond to different capacity ranges, and storing the initial storage data into an initial hard disk hibernation zone whose capacity matches the initial storage data includes: Determine the capacity of the initial stored data; When the capacity of the initial stored data is within the capacity range, the multiple hard disk hibernation zones corresponding to the capacity range are determined as the initial hard disk hibernation zones; The initial storage data is stored in the initial hard disk hibernation area.

5. The method according to claim 1, characterized in that, The step of determining the frequency tag corresponding to the target stored data based on the time difference and the period duration includes: The period duration is divided into multiple equally arithmetic reference durations, and frequency tags corresponding to the reference durations are determined. Based on the time difference, the target reference duration is determined from the reference duration; The frequency tag corresponding to the target reference duration is determined to be the frequency tag corresponding to the target stored data.

6. The method according to claim 1, characterized in that, The step of determining the frequency tag corresponding to the target stored data based on the time difference and the period duration includes: Calculate the ratio of the time difference to the period duration; Based on the ratio, the target stored data is sorted; Based on the sorting position of the target stored data, determine the frequency tag corresponding to the target stored data.

7. The method according to claim 1, characterized in that, Moving the initial stored data from the initial hard disk hibernation area to the target hard disk hibernation area includes: Read the initial storage data from the initial hard disk hibernation area; The initial storage data is stored in the idle storage hard drive of the target hard drive's hibernation area; Delete the initial stored data from the initial hard disk hibernation area.

8. The method according to claim 7, characterized in that, The step of storing the initial storage data to the idle storage hard drive in the hibernation area of ​​the target hard drive includes: The initial storage data is stored sequentially to the idle storage hard drive in the hibernation area of ​​the target hard drive.

9. A data storage management device, characterized in that, include: The first acquisition module is used to acquire the initial storage data; A pre-storage module is used to store the initial storage data into an initial hard disk hibernation area with a capacity matching the initial storage data; The second acquisition module is used to acquire the current timestamp when a read request for the initial storage data is received, and to add the current timestamp to the initial storage data to generate the target storage data; A startup module is used to start a preset data analysis cycle. Based on the startup time data of the preset data analysis cycle and the target stored data, a frequency tag corresponding to the target stored data is generated, including: comparing the startup timestamp and the current timestamp corresponding to the target stored data to generate a time difference; and determining the frequency tag corresponding to the target stored data based on the time difference and the cycle duration. The first determining module is used to determine the target hard disk hibernation zone according to the frequency label, wherein the hibernation depth of the target hard disk hibernation zone is different from that of the initial hard disk hibernation zone; The moving module is used to move the initial stored data from the initial hard disk hibernation area to the target hard disk hibernation area after the current cycle ends.

10. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the steps of the data storage management method as described in any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when executed by a processor, the computer program implements the steps of the data storage management method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Hard disk control method and device

    CN103777893A

  • Data query method and device, terminal equipment and computer readable storage medium

    CN115185941A