A storage device conversion method and device based on migration algorithm
By adopting a storage device conversion method based on migration algorithm in Internet business scenarios, the optimal conversion time point is calculated based on the access frequency and historical access time of data, thereby achieving efficient conversion and cost reduction of storage devices.
Patent Information
- Application Number
- CN202311704593.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-12
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2043-12-12
AI Technical Summary
In Internet business scenarios, high access frequency of hot data requires high-performance hardware configuration, while low access frequency of cold data leads to very high cost of adopting high-performance storage devices. How to complete the conversion of storage devices at the optimal time to reduce costs is an urgent problem.
A storage device conversion method based on migration algorithm is proposed. By detecting the access frequency and historical access time of data, the optimal data storage device conversion time point is calculated, and the storage device is switched in real time, thereby reducing storage cost.
It realizes the optimal data storage device conversion time point based on the data access frequency and storage cost, and switches the storage device in real time, effectively reducing storage costs.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of cloud storage, and in particular relates to a storage device conversion method and device based on a migration algorithm. Background Art
[0002] In Internet business scenarios, data access is usually uneven: some data is accessed more frequently, while others are less frequently. In other words, data has "hotness". Generally, whether data is cold or hot is determined based on the following two dimensions: access frequency and access timeliness. That is, the more times a piece of data is accessed within a period of time and the closer the access time is to the current time point, the "hotter" the data is considered to be.
[0003] In the process of implementing the present application, the inventors found that hot data has a high access frequency and high access performance requirements, which requires high-performance CPU, large memory, SSD hard disk and other good hardware configurations to support. In addition, the access mode of most data has a long tail phenomenon, that is, for a data object, most access requests occur in the early stage of its life cycle, and gradually become cold over time. Therefore, the longer the time, the more historical data there is in the storage device, and most of these historical data are cold data. Since the access frequency of cold data is low, if high-performance storage devices are still used, the cost will be very high.
[0004] The problem can be effectively solved by storing data in layers, that is, storing cold data with low access frequency in low-cost storage devices such as HDD hard disks. However, this faces a problem: the price of storage devices is inversely proportional to their access price, that is, the lower the performance of the storage device, the higher the access price. This data access mode follows the Pareto principle, that is, a small amount of data consumes most of the high-performance storage resources. Therefore, how to complete the conversion of storage devices at the optimal time to reduce costs is a technical problem that needs to be solved urgently. Summary of the invention
[0005] In view of the above-mentioned deficiencies in the prior art, the purpose of the invention is to provide a storage device conversion method and apparatus based on a migration algorithm, so that the optimal data storage device conversion time point can be calculated according to the data access frequency, historical access time and storage cost, and real-time switching can be performed, thereby effectively reducing costs.
[0006] A first aspect of the present invention provides a storage device conversion method based on a migration algorithm, which may include:
[0007] S1. When data release is detected, the data is written to a standard storage device;
[0008] S2. Obtain the first number of visits to the data at the first moment;
[0009] S3. Setting the first moment offset duration to be calculated for the first moment; wherein, after the first moment is offset by the first moment offset duration, the storage cost of storing the data in the standard storage device is equal to the storage cost of storing the data in the low-frequency storage device;
[0010] S4. Calculate the first time offset duration based on the standard storage cost calculation formula, the low-frequency storage cost calculation formula, and the first access volume;
[0011] S5. Calculate the first migration time based on the density function and the first time offset duration; at the first migration time, the storage cost of the data in the standard storage device is greater than the storage cost in the low-frequency storage device;
[0012] S6. When monitoring reaches the first migration time, storing the data in the low-frequency storage device.
[0013] Further, after S6, the method further includes:
[0014] S7. Obtaining the second access volume of the data at the second moment;
[0015] S8. Setting a second moment offset duration to be calculated for the second moment; wherein, after the second moment is offset by the second moment offset duration, the storage cost of storing the data in the low-frequency storage device is equal to the storage cost of storing the data in the archival storage device;
[0016] S9. Calculate the second time offset duration based on the archival storage cost calculation formula, the low-frequency storage cost calculation formula, and the second access volume;
[0017] S10. Calculate a second migration time based on the density function and the second time offset duration; at the second migration time, the storage cost of the data in the low-frequency storage device is greater than the storage cost in the archive storage device;
[0018] S11. When monitoring reaches the second migration time, storing the data in the archival storage device.
[0019] Furthermore, the standard storage cost calculation formula is:
[0020] C s =a(t)R s +S s Δ(t)
[0021] Among them, the C sis the standard storage cost, a(t) is the first access amount of the data at the first time t, and R s is the access unit price of the standard storage device, Δ(t) is the offset duration of the first moment, and S s is the storage unit price of the standard storage device per unit time, and S represents the standard storage device;
[0022] The low-frequency storage cost calculation formula is:
[0023] C i =a(t)R i +M s +S i Δ(t)
[0024] Among them, the C i For low-frequency storage cost, the R i is the access unit price of the low-frequency storage device, and the S i is the storage unit price of the low-frequency storage device per unit time, i represents the low-frequency storage device; M s is a first migration cost of migrating the data to the low-frequency storage device.
[0025] Furthermore, the archiving storage cost calculation formula is:
[0026] C g =a(t1)R g +M i +S g Δ(t1)
[0027] Among them, the C g is the archival storage cost, a(t1) is the second access amount of the data at the second time t1, and R g is the access unit price of the archival storage device, Δ(t1) is the offset duration of the second time, and S g is the storage unit price of the archival storage device per unit time, and g represents the archival storage device.
[0028] Furthermore, the density function is:
[0029]
[0030] Wherein, the f(k(t)) is a density function, the k(t) is the first migration time, the Δ(t) is the offset duration of the first time, and the e is the base of the natural logarithm.
[0031] In a second aspect, an embodiment of the present invention further provides a storage device conversion device based on a migration algorithm, which may include:
[0032] A first writing module, used for writing the data into a standard storage device after detecting that the data is released;
[0033] A first acquisition module, used to acquire a first number of hits of the data at a first moment;
[0034] A first calculation module, used for setting a first moment offset duration to be calculated for the first moment; wherein, after the first moment is offset by the first moment offset duration, a storage cost of storing the data in the standard storage device is equal to a storage cost of storing the data in the low-frequency storage device;
[0035] A second calculation module is used to calculate the first time offset duration based on a standard storage cost calculation formula, a low-frequency storage cost calculation formula, and the first access volume;
[0036] A third calculation module is used to calculate a first migration time based on the density function and the first time offset duration; at the first migration time, the storage cost of the data in the standard storage device is greater than the storage cost in the low-frequency storage device;
[0037] The first transfer module is configured to store the data in the low-frequency storage device when monitoring reaches the first migration time.
[0038] Furthermore, the device also includes:
[0039] A first acquisition module, used for acquiring a second number of visits to the data at a second moment;
[0040] a fourth calculation module, configured to set a second moment offset duration to be calculated for the second moment; wherein, after the second moment is offset by the second moment offset duration, a storage cost of storing the data in the low-frequency storage device is equal to a storage cost of storing the data in the archival storage device;
[0041] A fifth calculation module, configured to calculate the offset duration of the second time based on the archiving storage cost calculation formula, the low-frequency storage cost calculation formula, and the second access volume;
[0042] A sixth calculation module, configured to calculate a second migration time based on the density function and the second time offset duration; at the second migration time, the storage cost of the data in the low-frequency storage device is greater than the storage cost in the archive storage device;
[0043] The second transfer module is configured to store the data to the archival storage device when monitoring reaches the second migration time.
[0044] Furthermore, the standard storage cost calculation formula is:
[0045] C s =a(t)R s +S s Δ(t)
[0046] Among them, the C s is the standard storage cost, a(t) is the first access amount of the data at the first time t, and R s is the access unit price of the standard storage device, Δ(t) is the offset duration of the first moment, and S s is the storage unit price of the standard storage device per unit time, and S represents the standard storage device;
[0047] The low-frequency storage cost calculation formula is:
[0048] C i =a(t)R i +M s +S i Δ(t)
[0049] Among them, the C i For low-frequency storage cost, the R i is the access unit price of the low-frequency storage device, and the S i is the storage unit price of the low-frequency storage device per unit time, i represents the low-frequency storage device; M s is a first migration cost of migrating the data to the low-frequency storage device.
[0050] Furthermore, the archiving storage cost calculation formula is:
[0051] C g =a(t1)R g +M i +S g Δ(t1)
[0052] Among them, the C g is the archival storage cost, a(t1) is the second access amount of the data at the second time t1, and R g is the access unit price of the archival storage device, Δ(t1) is the offset duration of the second time, and S g is the storage unit price of the archival storage device per unit time, and g represents the archival storage device.
[0053] Furthermore, the density function is:
[0054]
[0055] Wherein, the f(k(t)) is a density function, the k(t) is the first migration time, the Δ(t) is the offset duration of the first time, and the e is the base of the natural logarithm.
[0056] The beneficial effects of the present invention are as follows:
[0057] The method and apparatus of the present invention can write data into a standard storage device after detecting data release. Then, obtain the first access volume of the data at the first moment, and set the first moment offset duration to be calculated for the first moment. Then, based on the standard storage cost calculation formula, the low-frequency storage cost calculation formula, and the first access volume, calculate the first moment offset duration. And, based on the density function and the first moment offset duration, calculate the first migration moment. Among them, at the first migration moment, the storage cost of the data in the standard storage device is greater than the storage cost in the low-frequency storage device. When monitoring reaches the first migration moment, the data is stored in the low-frequency storage device. In this way, the optimal data storage device conversion time point can be calculated, and the storage device can be switched in real time, thereby effectively reducing the storage cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] The accompanying drawings are only used to illustrate specific embodiments and are not considered to limit the present invention. In the entire drawings, the same reference symbols represent the same components. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings.
[0059] Figure 1 A flowchart of a storage device conversion method based on a migration algorithm provided by an embodiment of the present invention;
[0060] Figure 2 A schematic diagram of the structure of a storage device conversion device based on a migration algorithm provided by an embodiment of the present invention;
[0061] Figure 3 A schematic diagram of the structure of a storage device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0062] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without making creative work should fall within the scope of protection of the present invention.
[0063] Furthermore, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts disclosed in the present invention.
[0064] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the orientation or position relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inside", "outside", etc. is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. The terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be a connection between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0065] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of methods and systems consistent with some aspects of the present invention as detailed in the appended claims.
[0066] The present invention proposes a storage device conversion method and apparatus based on a migration algorithm, in order to solve the technical problem that the existing method still uses high-performance storage devices for cold data with low access frequency, and the storage cost is very high.
[0067] Specifically, in the current business scenarios, data access in the Ceph cluster has a long tail phenomenon, but the future access situation of the data is unknown. After the data is converted from standard storage to low-frequency or archive storage, it may need to be converted back to standard storage due to a surge in access volume, and converting storage devices and migrating data itself requires a certain cost.
[0068] Therefore, when to perform storage device conversion is crucial, but the future access curve cannot be predicted, and decisions need to be made by analyzing historical data.
[0069] Ceph is a highly scalable, high-performance distributed storage system that supports three interfaces: block storage, file storage, and object storage.
[0070] Method Embodiment
[0071] A first aspect of the present invention provides a storage device conversion method based on a migration algorithm, which may include:
[0072] S1. When data release is detected, the data is written to a standard storage device;
[0073] It is understandable that the access volume of newly released data is higher in the early stage of its life cycle, so after the detection data is released, the data is written to the standard storage device.
[0074] S2. Obtain the first number of visits to the data at the first moment;
[0075] It is understandable that the first access volume of the data at the first moment can be obtained in real time, and the first moment is the moment when the data is stored in the standard storage device.
[0076] S3. Setting the first moment offset duration to be calculated for the first moment; wherein, after the first moment is offset by the first moment offset duration, the storage cost of storing the data in the standard storage device is equal to the storage cost of storing the data in the low-frequency storage device;
[0077] It can be understood that it can be assumed that after the first moment t is offset by the first moment offset duration Δ(t), the storage cost of storing data in the standard storage device is equal to the storage cost of storing data in the low-frequency storage device. Based on this, it can be set that when there is a first moment offset duration Δ(t), the above condition is met.
[0078] S4. Calculate the first time offset duration based on the standard storage cost calculation formula, the low-frequency storage cost calculation formula, and the first access volume;
[0079] It is understandable that after setting the first moment offset duration Δ(t), the first moment offset duration can be calculated based on the standard storage cost calculation formula, the low-frequency storage cost calculation formula, and the first access volume.
[0080] The standard storage cost calculation formula can be:
[0081] C s =a(t)R s +S s Δ(t)
[0082] The C s is the standard storage cost, a(t) is the first access amount of the data at the first time t, and R sis the access unit price of the standard storage device, Δ(t) is the offset duration of the first moment, and S s is the storage unit price of the standard storage device per unit time, and S represents the standard storage device;
[0083] The formula for calculating the low-frequency storage cost can be:
[0084] C i =a(t)R i +M s +S i Δ(t)
[0085] Among them, the C i For low-frequency storage cost, the R i is the access unit price of the low-frequency storage device, and the S i is the storage unit price of the low-frequency storage device per unit time, i represents the low-frequency storage device; M s is a first migration cost of migrating the data to the low-frequency storage device.
[0086] Then, when the storage cost of storing data in the standard storage device=the storage cost of storing data in the low-frequency storage device, the first moment offset duration can be calculated.
[0087] It is worth noting that the storage cost described in the embodiment of the present invention refers to the total cost, that is, the storage cost plus the access cost.
[0088] S5. Calculate the first migration time based on the density function and the first time offset duration; at the first migration time, the storage cost of the data in the standard storage device is greater than the storage cost in the low-frequency storage device;
[0089] It can be understood that after calculating the offset duration of the first moment, the first migration moment can also be calculated based on the density function and the offset duration of the first moment. Among them, at the first migration moment, the storage cost of data in the standard storage device is greater than the storage cost of data in the low-frequency storage device. In this way, it can be calculated that migrating data from the standard storage device to the low-frequency storage device at the first migration moment can greatly reduce the storage cost. Among them, the total cost (storage and access) of the standard storage device per unit of data per unit of time is greater than the total cost (storage and access) of the low-frequency storage device per unit of time for unit data.
[0090] The density function refers to the probability density function (Probability Density Function). The probability density function is a function used in probability theory and statistics to describe the probability distribution of a random variable falling within different value ranges.
[0091] In the embodiment of the present invention, the density function may be set as:
[0092]
[0093] The f(k(t)) is a density function, the k(t) is the first migration time, the Δ(t) is the offset duration of the first time, and the e is the base of the natural logarithm.
[0094] In which, let the first migration time k∈[0,Δ(t)). As long as the total cost of the data in the standard storage device is greater than the total cost of switching to the low-frequency storage device in the latest k(t) time units, the storage device conversion operation is performed. The value of k(t) reflects the aggressiveness of the migration strategy. The smaller its value, the earlier the migration operation is performed and the more aggressive the strategy is.
[0095] S6. When monitoring reaches the first migration time, storing the data in the low-frequency storage device.
[0096] In this way, when the first migration moment is reached, the data can be migrated from the standard storage device to the low-frequency storage device, which can greatly reduce the storage cost. The embodiment of the present invention comprehensively considers the storage cost, access cost and migration cost, and calculates the optimal storage device conversion moment, thereby minimizing the total cost of the data. In addition, the implementation of the storage device conversion can be automatically triggered according to the calculation results without manually calling the interface, which is more flexible and real-time than the existing technology. In addition, the embodiment of the present invention simultaneously considers the access frequency and access timeliness of the data, making the calculation more accurate, and converting the data between the standard storage device and the low-frequency storage device in real time to achieve the optimal cost.
[0097] The beneficial effects of the present invention are as follows:
[0098] By applying the method described in the present invention, the data can be written into a standard storage device after the data release is detected. Then, the first access volume of the data at the first moment is obtained, and the first moment offset duration to be calculated for the first moment is set. Then, based on the standard storage cost calculation formula, the low-frequency storage cost calculation formula, and the first access volume, the first moment offset duration is calculated. And, based on the density function and the first moment offset duration, the first migration moment is calculated. Among them, at the first migration moment, the storage cost of the data in the standard storage device is greater than the storage cost in the low-frequency storage device. When the monitoring reaches the first migration moment, the data is stored in the low-frequency storage device. In this way, the optimal data storage device conversion time point can be calculated, and the storage device can be switched in real time, thereby effectively reducing the storage cost.
[0099] Furthermore, after transferring the data to the low-frequency storage device, the method may further include:
[0100] S7. Obtaining the second access volume of the data at the second moment;
[0101] It is understandable that after the data is transferred to the low-frequency storage device, a second access amount of the data at a second moment can be obtained, and the second moment is the moment when the data is stored in the low-frequency storage device.
[0102] S8. Setting a second moment offset duration to be calculated for the second moment; wherein, after the second moment is offset by the second moment offset duration, the storage cost of storing the data in the low-frequency storage device is equal to the storage cost of storing the data in the archival storage device;
[0103] It can be understood that it can be assumed that after the second moment is offset by the second moment offset duration Δ(t1), the storage cost of storing data in the low-frequency storage device is equal to the storage cost of storing data in the archival storage device. Based on this, it can be set that when there is a second moment offset duration Δ(t1), the above condition is satisfied.
[0104] S9. Calculate the second time offset duration based on the archival storage cost calculation formula, the low-frequency storage cost calculation formula, and the second access volume;
[0105] It is understandable that after setting the second time offset duration Δ(t1), the first time offset duration can be calculated based on the low-frequency storage cost calculation formula, the archive storage cost calculation formula, and the first access volume.
[0106] The low-frequency storage cost calculation formula can be:
[0107] C i =a(t)R i +M s +S i Δ(t)
[0108] Among them, the C i For low-frequency storage cost, the R i is the access unit price of the low-frequency storage device, and the S i is the storage unit price of the low-frequency storage device per unit time, i represents the low-frequency storage device; M s is a first migration cost of migrating the data to the low-frequency storage device.
[0109] The archival storage cost calculation formula is:
[0110] C g =a(t1)R g +M i +S g Δ(t1)
[0111] Among them, the C g is the archival storage cost, a(t1) is the second access amount of the data at the second time t1, and R g is the access unit price of the archival storage device, Δ(t1) is the offset duration of the second time, and S g is the storage unit price of the archival storage device per unit time, and g represents the archival storage device.
[0112] Then, when the storage cost of storing data in the low-frequency storage device = the storage cost of storing data in the archival storage device, the offset duration of the second moment can be calculated.
[0113] S10. Calculate a second migration time based on the density function and the second time offset duration; at the second migration time, the storage cost of the data in the low-frequency storage device is greater than the storage cost in the archive storage device;
[0114] It can be understood that after calculating the offset duration of the second moment, the second migration moment can also be calculated based on the density function and the offset duration of the second moment. Among them, at the second migration moment, the storage cost of data in the low-frequency storage device is greater than the storage cost of data in the archival storage device. In this way, it can be calculated that migrating data from the low-frequency storage device to the archival storage device at the second migration moment can greatly reduce the storage cost. Among them, the total cost (storage and access) of the low-frequency storage device for unit data per unit time is greater than the total (storage and access) cost of the archival storage device for unit data per unit time.
[0115] The density function can be set as:
[0116]
[0117] The f(k(t1)) is a density function, the k(t1) is the second migration time, the Δ(t1) is the offset duration of the second time, and the e is the base of the natural logarithm.
[0118] S11. When monitoring reaches the second migration time, storing the data in the archival storage device.
[0119] In this way, when the second migration time is reached, the data can be migrated from the low-frequency storage device to the archive storage device, which can greatly reduce the storage cost. In addition, the embodiment of the present invention takes into account the access frequency and access timeliness of the data at the same time, making the calculation more accurate, and converting the data between the standard storage device, the low-frequency storage device, and the archive storage device in real time to achieve the optimal cost.
[0120] Device Embodiment
[0121] In a second aspect, an embodiment of the present invention further provides a storage device conversion apparatus based on a migration algorithm. Figure 2 , the device may include:
[0122] A first writing module 201 is used to write the data into a standard storage device after detecting that the data is published;
[0123] A first acquisition module 202, used to acquire a first number of hits of the data at a first moment;
[0124] A first calculation module 203 is used to set a first moment offset duration to be calculated for the first moment; wherein, after the first moment is offset by the first moment offset duration, a storage cost of storing the data in the standard storage device is equal to a storage cost of storing the data in the low-frequency storage device;
[0125] A second calculation module 204 is used to calculate the first time offset duration based on a standard storage cost calculation formula, a low-frequency storage cost calculation formula, and the first access volume;
[0126] A third calculation module 205 is used to calculate a first migration time based on the density function and the first time offset duration; at the first migration time, the storage cost of the data in the standard storage device is greater than the storage cost in the low-frequency storage device;
[0127] The first transfer module 206 is configured to store the data in the low-frequency storage device when monitoring reaches the first migration time.
[0128] The beneficial effects of the present invention are as follows:
[0129] By using the device described in the present invention, the data can be written into a standard storage device after the data release is detected. Then, the first access volume of the data at the first moment is obtained, and the first moment offset duration to be calculated for the first moment is set. Then, based on the standard storage cost calculation formula, the low-frequency storage cost calculation formula, and the first access volume, the first moment offset duration is calculated. And, based on the density function and the first moment offset duration, the first migration moment is calculated. Among them, at the first migration moment, the storage cost of the data in the standard storage device is greater than the storage cost in the low-frequency storage device. When the monitoring reaches the first migration moment, the data is stored in the low-frequency storage device. In this way, the optimal data storage device conversion time point can be calculated, and the storage device can be switched in real time, thereby effectively reducing the storage cost.
[0130] Furthermore, the device also includes:
[0131] A first acquisition module, used for acquiring a second number of visits to the data at a second moment;
[0132] a fourth calculation module, configured to set a second moment offset duration to be calculated for the second moment; wherein, after the second moment is offset by the second moment offset duration, a storage cost of storing the data in the low-frequency storage device is equal to a storage cost of storing the data in the archival storage device;
[0133] A fifth calculation module, configured to calculate the offset duration of the second time based on the archiving storage cost calculation formula, the low-frequency storage cost calculation formula, and the second access volume;
[0134] A sixth calculation module, configured to calculate a second migration time based on the density function and the second time offset duration; at the second migration time, the storage cost of the data in the low-frequency storage device is greater than the storage cost in the archive storage device;
[0135] The second transfer module is configured to store the data to the archival storage device when monitoring reaches the second migration time.
[0136] Furthermore, the standard storage cost calculation formula is:
[0137] C s =a(t)R s +S s Δ(t)
[0138] Among them, the C s is the standard storage cost, a(t) is the first access amount of the data at the first time t, and R s is the access unit price of the standard storage device, Δ(t) is the offset duration of the first moment, and S s is the storage unit price of the standard storage device per unit time, and S represents the standard storage device;
[0139] The low-frequency storage cost calculation formula is:
[0140] C i =a(t)R i +M s +S i Δ(t)
[0141] Among them, the C i For low-frequency storage cost, the R i is the access unit price of the low-frequency storage device, and the S i is the storage unit price of the low-frequency storage device per unit time, i represents the low-frequency storage device; M sis a first migration cost of migrating the data to the low-frequency storage device.
[0142] Furthermore, the archiving storage cost calculation formula is:
[0143] C g =a(t1)R g +M i +S g Δ(t1)
[0144] Among them, the C g is the archival storage cost, a(t1) is the second access amount of the data at the second time t1, and R g is the access unit price of the archival storage device, Δ(t1) is the offset duration of the second time, and S g is the storage unit price of the archival storage device per unit time, and g represents the archival storage device.
[0145] Furthermore, the density function is:
[0146]
[0147] Wherein, the f(k(t)) is a density function, the k(t) is the first migration time, the Δ(t) is the offset duration of the first time, and the e is the base of the natural logarithm.
[0148] In a third aspect, the present invention provides a storage device, such as Figure 3 As shown, it includes: a memory 301 and one or more processors 302.
[0149] One or more application programs are stored in the memory 301 , and the one or more application programs are suitable for being executed by the one or more processors 302 to implement the method described in the first aspect.
[0150] The beneficial effects of the present invention are as follows:
[0151] The storage device described in the present invention can write data into a standard storage device after detecting data release. Then, the first access volume of the data at the first moment is obtained, and the first moment offset duration to be calculated for the first moment is set. Then, based on the standard storage cost calculation formula, the low-frequency storage cost calculation formula, and the first access volume, the first moment offset duration is calculated. And, based on the density function and the first moment offset duration, the first migration moment is calculated. Among them, at the first migration moment, the storage cost of the data in the standard storage device is greater than the storage cost in the low-frequency storage device. When the monitoring reaches the first migration moment, the data is stored in the low-frequency storage device. In this way, the optimal data storage device conversion time point can be calculated, and the storage device can be switched in real time, thereby effectively reducing the storage cost.
[0152] like Figure 3 As shown, the storage device includes: a processor 302 and a memory 301. The processor 302 and the memory 301 are connected, for example, through a bus.
[0153] The structure of the storage device does not constitute a limitation on the embodiments of the present invention.
[0154] The processor 302 may be a CPU, a general purpose processor 302, a DSP, an ASIC, an FPGA or other programmable logic device, a transistor logic device, a hardware component or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of the present invention. The processor 302 may also be a combination that implements computing functions, such as a combination of one or more microprocessors 302, a combination of a DSP and a microprocessor 302, etc.
[0155] The bus may include a path to transmit information between the above components. The bus may be a PCI bus or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0156] The memory 301 can be a ROM or other type of static storage device that can store static information and instructions, a RAM or other type of dynamic storage device that can store information and instructions, or an EEPROM, a CD-ROM or other optical disk storage, an optical disk storage (including a compressed optical disk, a laser disk, an optical disk, a digital versatile disk, a Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.
[0157] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program can be loaded by the processor 302 and executed in accordance with the method described in the first aspect.
[0158] The applicant of the present invention has made a detailed explanation and description of the implementation examples of the present invention in conjunction with the drawings in the specification. However, those skilled in the art should understand that the above implementation examples are only preferred implementation schemes of the present invention, and the detailed description is only to help readers better understand the spirit of the present invention, but not to limit the scope of protection of the present invention. On the contrary, any improvements or modifications based on the inventive spirit of the present invention should fall within the scope of protection of the present invention.
[0159] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, rather than to limit them. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the above embodiments, or replace some of the technical features therein by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. Any changes or replacements that can be easily thought of by those skilled in the art within the technical scope disclosed in the present invention should be covered within the protection scope of the present invention.
Claims
1. A storage device conversion method based on a migration algorithm, characterized in that: include: S1. When data release is detected, the data is written to a standard storage device; S2. Obtain the first number of visits to the data at the first moment; S3. Setting the first moment offset duration to be calculated for the first moment; wherein, after the first moment is offset by the first moment offset duration, the storage cost of storing the data in the standard storage device is equal to the storage cost of storing the data in the low-frequency storage device; S4. Calculate the first time offset duration based on the standard storage cost calculation formula, the low-frequency storage cost calculation formula, and the first access volume; S5. Calculate the first migration time based on the density function and the first time offset duration; at the first migration time, the storage cost of the data in the standard storage device is greater than the storage cost in the low-frequency storage device; S6. When the monitoring reaches the first migration time, the data is stored in the low-frequency storage device; The standard storage cost calculation formula is: C s =a(t)R s +S s Δ(t) Among them, C s is the standard storage cost, a(t) is the data at the first moment t The first visit, R s is the access unit price of the standard storage device, Δ(t) is the offset duration of the first moment, and S s is the storage unit price of the standard storage device per unit time, and S represents the standard storage device; The low-frequency storage cost calculation formula is: C i =a(t)R i +M s +S i Δ(t) Among them, C i is the low-frequency storage cost, R i is the access unit price of the low-frequency storage device, S i is the storage unit price of the low-frequency storage device per unit time, i represents the low-frequency storage device; s is a first migration cost of migrating the data to the low-frequency storage device.
2. The method according to claim 1, characterized in that After S6, the method further includes: S7. Obtaining the second access volume of the data at the second moment; S8. Setting a second moment offset duration to be calculated for the second moment; wherein, after the second moment is offset by the second moment offset duration, the storage cost of storing the data in the low-frequency storage device is equal to the storage cost of storing the data in the archival storage device; S9. Calculate the second time offset duration based on the archival storage cost calculation formula, the low-frequency storage cost calculation formula, and the second access volume; S10. Calculate a second migration time based on the density function and the second time offset duration; at the second migration time, the storage cost of the data in the low-frequency storage device is greater than the storage cost in the archive storage device; S11. When monitoring reaches the second migration time, storing the data in the archival storage device.
3. The method according to claim 2, characterized in that The archival storage cost calculation formula is: C g =a(t1)R g +M i +S g Δ(t1) Among them, C g is the archival storage cost, a(t1) is the second access amount of the data at the second time t1, R g is the access unit price of the archival storage device, Δ(t1) is the offset duration of the second time, S g is the storage unit price of the archival storage device per unit time, and g represents the archival storage device.
4. The method according to claim 3, characterized in that The density function is: Wherein, the f(k(t)) is a density function, the k(t) is the first migration time, the Δ(t) is the offset duration of the first time, and e is the base of the natural logarithm.
5. A storage device conversion device based on a migration algorithm, characterized in that: include: A first writing module, used for writing the data into a standard storage device after detecting that the data is released; A first acquisition module, used to acquire a first number of hits of the data at a first moment; A first calculation module, used for setting a first moment offset duration to be calculated for the first moment; wherein, after the first moment is offset by the first moment offset duration, a storage cost of storing the data in the standard storage device is equal to a storage cost of storing the data in the low-frequency storage device; A second calculation module is used to calculate the first time offset duration based on a standard storage cost calculation formula, a low-frequency storage cost calculation formula, and the first access volume; A third calculation module is used to calculate a first migration time based on the density function and the first time offset duration; at the first migration time, the storage cost of the data in the standard storage device is greater than the storage cost in the low-frequency storage device; A first transfer module, configured to store the data in the low-frequency storage device when monitoring reaches the first migration time; The standard storage cost calculation formula is: C s =a(t)R s +S s Δ(t) Among them, C s is the standard storage cost, a(t) is the data at the first moment t The first visit, R s is the access unit price of the standard storage device, Δ(t) is the offset duration of the first moment, S s is the storage unit price of the standard storage device per unit time, and S represents the standard storage device; The low-frequency storage cost calculation formula is: C i =a(t)R i +M s +S i Δ(t) Among them, C i is the low-frequency storage cost, R i is the access unit price of the low-frequency storage device, S i is the storage unit price of the low-frequency storage device per unit time, i represents the low-frequency storage device; M s is a first migration cost of migrating the data to the low-frequency storage device.
6. The device according to claim 5, characterized in that The device also includes: A first acquisition module, used for acquiring a second number of visits to the data at a second moment; a fourth calculation module, configured to set a second moment offset duration to be calculated for the second moment; wherein, after the second moment is offset by the second moment offset duration, a storage cost of storing the data in the low-frequency storage device is equal to a storage cost of storing the data in the archival storage device; A fifth calculation module, configured to calculate the offset duration of the second time based on the archiving storage cost calculation formula, the low-frequency storage cost calculation formula, and the second access volume; A sixth calculation module, configured to calculate a second migration time based on the density function and the second time offset duration; at the second migration time, the storage cost of the data in the low-frequency storage device is greater than the storage cost in the archive storage device; The second transfer module is configured to store the data to the archival storage device when monitoring reaches the second migration time.
7. The device according to claim 6, characterized in that The archival storage cost calculation formula is: C g =a(t1)R g +M i +S g Δ(t1) Among them, C g is the archival storage cost, a(t1) is the second access amount of the data at the second time t1, R g is the access unit price of the archival storage device, Δ(t1) is the offset duration of the second time, S g is the storage unit price of the archival storage device per unit time, and g represents the archival storage device.
8. The device according to claim 7, characterized in that The density function is: Wherein, f(k(t)) is the density function, k(t) is the first migration time, Δ(t) is the offset duration of the first time, and e is the base of the natural logarithm.
Citation Information
Patent Citations
Data migration method and device, equipment and storage medium
CN112965957A
Method for calculating tier relocation cost and storage system using the same
US20130080703A1