Data storage method and device, equipment and storage medium
By predicting future access frequency based on historical access records and dynamically adjusting the storage medium, the problem of balancing data storage cost and access performance is solved, thus achieving cost and performance optimization.
Patent Information
- Application Number
- CN202511113042.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-08
- Publication Date
- 2025-11-25
AI Technical Summary
In existing technologies, data storage cost and data access performance cannot be effectively balanced. Mechanical hard drives are low in cost but have high latency, while solid-state drives have good performance but are expensive.
By obtaining the historical access records of the target object, its future access popularity can be predicted, and the storage medium can be dynamically adjusted based on the popularity: solid-state drives are used when the popularity is high, and hard disk drives are used when the popularity is low.
It achieves a balance between data storage cost and data access performance, improving the user experience while reducing storage costs.
Smart Images

Figure CN121008752A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of storage, and in particular to a data storage method, device, equipment and storage medium. BACKGROUND
[0002] With the development of big data, artificial intelligence, unmanned driving and other technologies, data has experienced explosive growth. In order to reduce data storage costs, some technologies use low-cost but high-latency storage media, such as hard disk drives (HDD). In these technologies, although the data storage cost is effectively reduced, the data access performance is not high (for example, the data access delay is large), which affects the user experience. In order to improve the data access performance, other technologies use high-cost but low-latency storage media, such as solid-state drives (SSD). In these technologies, although the data access performance is effectively improved, the data storage cost is also correspondingly increased. Therefore, how to effectively balance the data storage cost and the data access performance has become a problem to be solved. SUMMARY
[0003] The present application provides a data storage method, device, electronic equipment, computer readable storage medium and computer program product to at least solve the problem that the data storage cost and the data access performance cannot be balanced in the related art.
[0004] The present application provides a data storage method, comprising:
[0005] obtaining a historical access record of a target object;
[0006] determining an access behavior feature of the target object in a target historical period based on the historical access record, and predicting an access heat of the target object in a future target period based at least on the access behavior feature of the target historical period;
[0007] determining a target storage medium of the target object in the future target period based on the access heat of the future target period;
[0008] if the target object is saved in other storage media outside the target storage medium in the future target period, migrating the target object from the other storage media to the target storage medium.
[0009] The present application also provides a data storage device, comprising:
[0010] a record obtaining module configured to obtain a historical access record of a target object;
[0011] a heat degree prediction module, configured to determine a visiting behavior feature of the target object in a target historical time period based on the historical visiting record, and predict a visiting heat degree of the target object in a future target time period based on at least the visiting behavior feature of the target historical time period;
[0012] a medium determination module, configured to determine a target storage medium of the target object in the future target time period based on the visiting heat degree of the target object in the future target time period;
[0013] an object migration module, configured to migrate the target object from other storage medium to the target storage medium if the target object is saved in other storage medium than the target storage medium in the future target time period.
[0014] The present application further provides an electronic device, comprising a memory configured to store a computer program, and a processor configured to execute the computer program to implement the steps of any of the data storage methods.
[0015] The present application further provides a computer readable storage medium, which stores a computer program, wherein the computer program is executed by a processor to implement the steps of any of the data storage methods.
[0016] In the technical solutions of some embodiments of the present application, the visiting heat degree of the target object in the future target time period is predicted based on the historical visiting record of the target object, and the target storage medium of the target object in the future target time period is determined based on the visiting heat degree. In this way, the storage medium of the target object can be dynamically adjusted according to the visiting heat degree of the target object in each time period. For example, when the visiting heat degree of the target object is relatively high, the target object can be migrated to a storage medium with low latency, so as to improve the data access performance and user experience; when the visiting heat degree of the target object is reduced, the target object can be migrated to a storage medium with low cost, so as to reduce the data storage cost. In this way, a balance between the data storage cost and the data access performance can be achieved, and the problem that the data storage cost and the data access performance cannot be balanced in some technologies can be solved. BRIEF DESCRIPTION OF DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present application, the drawings needed in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0018] Figure 1 a flowchart of the data storage method provided by some embodiments of the present application;
[0019] Figure 2A flowchart of a process for determining access heat provided for some embodiments of the present application is shown in FIG. 1.
[0020] Figure 3 A module diagram of a data storage device provided for some embodiments of the present application is shown in FIG. 4.
[0021] Figure 4 A module diagram of an electronic device provided for some embodiments of the present application is shown in FIG. 5. DETAILED DESCRIPTION
[0022] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, any other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0023] It should be noted that, in the description of the present application, the terms "comprise", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such a process, method, article or device. The terms "first", "second" and the like in the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence.
[0024] In order for those skilled in the art to better understand the technical solutions of the present application, the present application will be further described in detail below with reference to the drawings and specific embodiments.
[0025] In some technical solutions, mechanical hard disk storage has low cost, but physical structure limitation leads to high access delay, which cannot meet the high real-time requirement; solid state disk is used to improve data access performance, but data storage cost is high, and the cost increases sharply. Therefore, how to achieve effective balance between data storage cost and access performance has become a problem to be solved.
[0026] In view of this, the present application provides a data storage method, which can solve the problem that data storage cost and data access performance cannot be balanced. The data storage method can be applied to an electronic device. The electronic device can include but is not limited to a tablet computer, a notebook computer, a desktop computer, a server, etc. For reference Figure 1 A flowchart of a data storage method provided for some embodiments of the present application is shown in FIG. 2. Figure 1 The data storage method includes the following steps:
[0027] In step S101, the historical access record of a target object is obtained.
[0028] The target object refers to a digital resource saved in a storage medium, such as a text file, a video file, a picture, file metadata, and the like. The storage medium refers to a carrier for temporarily or long-term saving a digital resource, such as a solid-state disk, a mechanical hard disk, and the like.
[0029] A user, a system, or a service, and the like can initiate an access behavior for a target object. For example, in the storage medium of some short video platform, a large number of video files are stored. A user can click to play a video file (i.e., access the video file in the storage medium) through a short video client. For another example, in the storage medium of some system, file metadata are stored. In the running process of the system, a business module of the system can view or modify the file metadata (i.e., access the file metadata in the storage medium).
[0030] An access record of a target object can be generated each time the target object is accessed. Based on these access records, the access behavior of the target object, and the like, can be traced back. Specifically, the access record can include, but is not limited to, the following information:
[0031] The time when the target object is accessed, the visitor information of the target object (such as a user name, a business module name, and the like), the operation type for the target object, the storage medium type (such as a solid-state disk, a mechanical hard disk, and the like) where the target object is located, the read-write rate, the access delay.
[0032] In this embodiment, in response to receiving a trigger instruction for executing the method of the present application, the access record of the target object within a specified time length before the current time point can be obtained as a historical access record. For example, assuming that the current time point is March 15, 2025, the access record of the target object between January 15, 2025 and March 14, 2025 can be obtained as a historical access record.
[0033] Of course, it can be understood that, in response to receiving a trigger instruction for executing the method of the present application, all historical access records of the target object before the current time can also be obtained. The present application does not limit this.
[0034] Step S102, based on the historical access record, determining an access behavior feature of the target object in a target historical time period, and predicting an access heat of the target object in a future target time period based on at least the access behavior feature of the target historical time period.
[0035] Specifically, the target historical time period is a sliding time window determined based on the current time point. For example, when the current time point is March 15, 2025, the target historical time period is January 15, 2025 to March 14, 2025. When the current time point is March 16, 2025, the target historical time period is January 16, 2025 to March 15, 2025. And so on.
[0036] The access behavior feature refers to a feature exhibited by a user, a system, or a service when accessing a target object. For example, the time points at which the target object is frequently accessed are mainly concentrated in the weekends and at night. For another example, the number of times the target object is accessed shows a gradually decreasing trend.
[0037] The access heat refers to the frequency of access of the target object. Based on the access behavior feature of the target object in the target historical period, the access heat of the target object in the target future period can be predicted. For example, assuming that the number of times the target object is accessed shows a gradually decreasing trend in the target historical period, it can be predicted that the access heat of the target object in the target future period is relatively low.
[0038] In step S103, the target storage medium of the target object in the target future period is determined based on the access heat of the target future period.
[0039] Specifically, according to the change of the access heat of the target object, the target object can be migrated between different types of storage media. For example, when the access heat of the target object is relatively high, the target object can be migrated to a solid state disk, so as to ensure the data access performance of the target object. When the access heat of the target object is relatively low, the target object can be migrated to a mechanical hard disk, so as to reduce the storage cost of the target object.
[0040] A mapping relationship between the access heat and the storage medium can be created in advance. For example, the access heat below a first heat threshold corresponds to a tape hard disk, the access heat between the first heat threshold and a second heat threshold corresponds to a mechanical hard disk, and the access heat above the second heat threshold corresponds to a solid state disk. The first heat threshold is less than the second heat threshold. In this way, after the access heat of the target object in the target future period is predicted, the heat range in which the access heat of the target object is located can be determined based on the mapping relationship, and then the target storage medium of the target object in the target future period can be determined.
[0041] In step S104, if the target object is stored in other storage media than the target storage medium in the target future period, the target object is migrated from the other storage media to the target storage medium.
[0042] Specifically, the metadata of the target object can include the current physical storage location of the target object, such as the type of the storage medium where the target object is currently located, the path, and the like. After entering the target future period, whether the target object is currently stored in the target storage medium can be determined based on the metadata of the target object. If the target object is currently stored in other storage media than the target storage medium, the target object is migrated from the other storage media to the target storage medium.
[0043] In conclusion, in the technical solutions of some embodiments of the present application, based on the historical access records of the target object, the access heat of the target object in the future target period is predicted, and based on the access heat, the target storage medium of the target object in the future target period is determined. In this way, the storage medium of the target object can be dynamically adjusted according to the access heat of the target object in each period. For example, when the access heat of the target object is relatively high, the target object can be migrated to a storage medium with low latency, thereby improving the data access performance and user experience. When the access heat of the target object decreases, the target object can be migrated to a storage medium with low cost, thereby reducing the data storage cost. In this way, a balance between the data storage cost and the data access performance can be achieved, and the problem that the data storage cost and the data access performance cannot be balanced in some technologies can be solved.
[0044] In some embodiments, the step of predicting the access heat of the target object in the future target period based on at least the access behavior feature of the target object in the target historical period in step S102 can include steps S201 to S202. For details, refer to Figure 2 The flowchart for determining the access heat provided by some embodiments of the present application is shown in the figure. Figure 2 The access heat determination method includes the following steps:
[0045] In step S201, based on the historical access records, the storage medium feature of the target object in the target historical period is determined.
[0046] In this embodiment, the storage medium feature refers to the attribute feature and attribute change feature of the storage medium in which the target object is located in the target historical period. The attribute feature includes but is not limited to the storage medium type, the read-write rate of the storage medium, the capacity occupancy rate of the storage medium, the access latency of the storage medium, etc. The attribute change feature can include the following two aspects:
[0047] 1) When the target object is migrated between different storage media in the target historical period, the change trend of the storage medium type. For example, assuming that the target historical period is from January 15, 2025 to February 30, 2025, and on January 15, 2025, the target object is saved in a solid state disk, on January 20, 2025, the target object is migrated from the solid state disk to the mechanical hard disk, on January 30, 2025, the target object is migrated from the mechanical hard disk to the tape hard disk, on February 3, 2025, the target object is migrated from the tape hard disk to the solid state disk, on February 18, 2025, the target object is migrated from the solid state disk to the mechanical hard disk, and on February 30, 2025, the target object is migrated from the mechanical hard disk to the tape hard disk. Then, in the target historical period, the change trend of the storage medium type is: solid state disk > mechanical hard disk > tape hard disk > solid state disk > mechanical hard disk > tape hard disk.
[0048] 2) the attribute change trend of the storage medium when the target object is in the same storage medium in the target historical period. For example, between January 15, 2025 and January 20, 2025, the target object is saved in the solid state disk, and then the read-write rate change trend and the access delay change trend of the solid state disk in this period can be counted as the attribute change characteristics of the solid state disk in this period.
[0049] In the embodiment, the record entries corresponding to the target historical period can be extracted from the historical access records. Based on the record entries, the storage medium information (such as storage medium type, read-write rate, access delay, etc.) corresponding to each time the target object is accessed in the target historical period can be retrieved. By summarizing and analyzing the retrieved storage medium information, the storage medium characteristics of the target object in the target historical period can be determined.
[0050] In step S202, the access heat of the target object in the future target period is predicted based on the access behavior characteristics of the target historical period, the storage medium characteristics, and the object attribute of the target object.
[0051] Specifically, the initial access heat of the target object in the future target period can be predicted based on the access behavior characteristics of the target historical period. Based on the storage medium characteristics and the object attribute of the target object, the initial access heat can be corrected. For example, based on the access behavior characteristics of the target historical period, it is predicted that the initial access heat of the target object in the future target period is low, but based on the storage medium characteristics, it is found that the access delay of the mechanical hard disk and the tape hard disk is relatively high, but the target object is important, so the initial access heat can be increased to save the target object in the solid state disk. In this way, in the case where the target object is important, the access speed of the target object can be guaranteed. For another example, based on the access behavior characteristics of the target historical period, it is predicted that the initial access heat of the target object in the future target period is high, but based on the storage medium characteristics, it is found that the access delay of the mechanical hard disk and the tape hard disk is relatively low, but the importance of the target object is low, so the initial access heat can be reduced to save the target object in the mechanical hard disk. In this way, the storage cost of the target object can be reduced.
[0052] In the above embodiment, when predicting the access heat of the target object in the future target period, the storage medium characteristics of the target object in the target historical period and the object attribute of the target object are simultaneously referred to, which can improve the prediction accuracy of the access heat.
[0053] In some embodiments, the above prediction of the access heat of the target object in the future target period based on the access behavior characteristics of the target historical period, the storage medium characteristics, and the object attribute of the target object can include:
[0054] The access behavior feature of the target historical period, the storage medium feature, and the attribute feature of the target object are input into the trained first prediction model to obtain the access behavior feature of the target object in a future target period;
[0055] The access behavior feature of the future target period is input into the trained second prediction model to obtain the access heat of the target object in the future target period.
[0056] Specifically, the first prediction model can output the access behavior feature of the target object in the future target period in the form of a trend chart, a table, a numerical value, or the like. For example, the first prediction model can output an access frequency trend chart of the target object in the future target period.
[0057] The second prediction model can output the access heat of the target object in the future target period in the form of a heat label or a heat value. The heat label is a classification label, such as 0-cold data, 1-warm data, and 2-hot data. The heat value is a cold and hot degree value. For example, when the heat value is 20, the access heat of the target object can be low, and when the heat value is 80, the access heat of the target object can be high.
[0058] At least one of the first prediction model and the second prediction model can be an LSTM (Long Short-Term Memory) model. The network structure thereof can include an input layer, an LSTM layer, a fully connected layer, and an output layer, and the structures of the layers can be as follows:
[0059] Input layer: The sequence dimension is set to (time step, feature dimension), for example, 30 days x 24 hours of feature data is used.
[0060] LSTM layer: 2-3 layers are stacked, the number of hidden units is set to 64-128, the activation function uses a tanh function, and the forgetting gate bias is initialized to 1 to enhance long-term memory.
[0061] Fully connected layer: used to integrate feature information output by the LSTM layer.
[0062] Output layer: used to output the access behavior feature of the target object in the future target period or the access frequency trend chart of the target object in the future target period.
[0063] In the above embodiment, by first predicting the access behavior feature of the target object in the future target period, and then predicting the access heat of the target object in the future target period based on the access behavior feature of the future target period, the inference logic can be simplified, and thus the accuracy of the inference can be improved.
[0064] In some embodiments, the above determination of the target storage medium of the target object in the future target period based on the access heat of the future target period can include:
[0065] obtain a storage cost and a maximum access delay of the target object in each candidate storage medium, the maximum access delay referring to a maximum delay allowed when accessing the target object.
[0066] perform weighted fusion calculation on the access heat, the storage cost and the maximum access delay, and determine the target storage medium of the target object in the future target period according to a calculation result of the calculation.
[0067] Specifically, a weight coefficient of the access heat, the storage cost and the maximum access delay can be preset, wherein the weight coefficient of the access heat reflects an influence degree thereof on the selection of the storage medium (e.g., high access heat corresponds to high weight), the weight of the storage cost reflects a cost control degree, and the weight of the maximum access delay reflects an importance of performance requirement.
[0068] After obtaining the access heat, the storage cost and the maximum access delay of the target object, the access heat, the storage cost and the maximum access delay can be normalized to convert them to a unified data interval (e.g., 0-1) and eliminate dimensional differences of different parameters. The weighted fusion calculation described above is performed on each candidate storage medium to obtain a corresponding comprehensive score, and a storage medium with a high comprehensive score is selected as the target storage medium of the target object in the future target period. For example, the access heat of the target object, the storage cost and the maximum access delay of the target object in candidate storage medium A are weighted and fused to obtain a comprehensive score of candidate storage medium A. By analogy, comprehensive scores of other candidate storage media can be obtained, and then a candidate storage medium with the highest comprehensive score is selected as the target storage medium.
[0069] In the above embodiment, the access heat, the storage cost and the maximum access delay are comprehensively considered, and the target storage medium is selected by weighted fusion calculation, so that the storage cost can be optimized while meeting the performance requirement, and the scientificity and adaptability of the selection of the storage medium are improved.
[0070] In some embodiments, the determination of the access behavior feature of the target object in the target historical period based on the historical access record can include:
[0071] dividing the target historical period into a plurality of historical sub-periods;
[0072] based on the historical access record, counting access indexes of the target object in each historical sub-period, and based on the access indexes of the historical sub-periods, determining a change trend of the access indexes of the target object in the target historical period, the access indexes including at least one of access times, access frequency, access interval and access delay;
[0073] The access indexes of each historical sub-period, and the access index change trend of the target historical period, are used as the access behavior characteristics of the target object in the target historical period.
[0074] Specifically, the target historical period is divided into a plurality of continuous and non-overlapping historical sub-periods according to a preset time interval (such as 1 hour), and the time interval can be set according to the total length of the target historical period and actual requirements.
[0075] Based on the obtained historical access records, the following operations can be performed:
[0076] 1) The total number of times that the target object is accessed in each historical sub-period is counted;
[0077] 2) The access frequency (the ratio of the number of accesses to the length of the sub-period) is calculated;
[0078] 3) The access frequency change rate between the historical sub-periods is calculated, wherein the access frequency change rate is the difference between the access frequencies of two adjacent historical sub-periods, and is used to reflect the fluctuation of the access frequency;
[0079] 4) The time interval between two adjacent accesses is recorded.
[0080] According to the access indexes of each historical sub-period, the access frequency change rate between the historical sub-periods, and the data access interval distribution, the access index change trend of the target object in the target historical period can be determined through trend analysis.
[0081] In the above embodiment, by dividing the target historical period into sub-periods, counting the access indexes of each sub-period, and determining the access behavior characteristics by combining the access index change trend analysis, the access rules can be comprehensively captured, accurate data can be provided for subsequent steps, and the scientificity of decision-making is improved.
[0082] In some embodiments, after the target object is migrated from other storage media to the target storage media, the following information can be obtained:
[0083] 1) The first storage cost of the target object in the future target period, and the first access performance index when accessing the target object in the future target period.
[0084] 2) The second storage cost of the target object in the target historical period, and the second access performance index when accessing the target object in the target historical period.
[0085] Specifically, the first predicted cost is a cost generated by storing the target object in the target storage medium in the future target period, including a unit storage cost of the target storage medium, a maintenance cost generated by occupying storage space, and the like. The first access performance indicator refers to a performance parameter exhibited when accessing the target object stored in the target storage medium in the future target period, including an access response time, an IOPS (Input / Output Operations Per Second), a data transmission rate, and the like.
[0086] The second storage cost is a cost generated by storing the target object in the original storage medium (i.e., the storage medium before migration) in the target historical period, and the calculation manner is consistent with that of the first storage cost to ensure comparability. The second access performance indicator refers to a performance parameter exhibited when accessing the target object stored in the original storage medium in the target historical period, including an access response time, an IOPS, a data transmission rate, and the like.
[0087] By comparing the first storage cost and the second storage cost, a first comparison result can be obtained, and by comparing the first access performance indicator and the second access performance indicator, a second comparison result can be obtained. According to the first comparison result and the second comparison result, the accuracy of migrating the target object to the target storage medium in the future target period can be determined. For example, if the first storage cost is higher than the second storage cost, it proves that the migration is inaccurate; if the first access performance indicator is better than the second access performance indicator, it proves that the migration is accurate.
[0088] In some embodiments, the weights of the storage cost and the access performance indicator can be set in advance, and a comprehensive accuracy score can be obtained through weighted fusion calculation. The higher the score, the higher the accuracy of the migration decision.
[0089] Based on the above accuracy, at least one of the first prediction model and the second prediction model can be fine-tuned. Specifically, actual access behavior characteristics and actual access heat of the target object in the future target period can be collected, and compared with the access behavior characteristic prediction value output by the first prediction model and the access heat prediction value output by the second prediction model to obtain respective prediction deviation values. If the prediction deviation value is greater than a deviation threshold, it means that the prediction model is not accurate enough and can be fine-tuned. If the prediction deviation value is lower than the deviation threshold, it means that the prediction model is relatively accurate and can not be fine-tuned.
[0090] In the above embodiments, the effect of migrating the target object to the target storage medium is quantitatively evaluated and the model is optimized, the migration accuracy is accurately determined, the prediction model is dynamically optimized, and thus the storage resource management efficiency and the decision reliability are improved.
[0091] In some embodiments, the above-mentioned migration of the target object from the other storage medium to the target storage medium if the target object is stored in the other storage medium other than the target storage medium in the future target period comprises:
[0092] At the first time point, a first target storage medium of the target object in a first target period after the first time point is determined, and the target object is migrated to the first target storage medium in the first target period;
[0093] At the second time point, a second target storage medium of the target object in a second target period after the second time point is determined, and the target object is migrated to the second target storage medium in the second target period;
[0094] The first time point and the second time point are separated by a preset time length.
[0095] Specifically, at the first time point, a first target storage medium suitable for the target object in a first target period after the first time point is determined based on historical access records before the time point and a prediction model. When entering the first target period, if it is detected that the target object is currently stored in a storage medium other than the first target storage medium, a migration operation is performed to migrate the target object to the first target storage medium.
[0096] At the second time point, a second target storage medium suitable for the target object in a second target period after the second time point is determined by using the same method as in step S701, in combination with the latest historical access records and the prediction model output result. The second target storage medium can be the same as or different from the first target storage medium. When entering the second target period, if it is detected that the target object is currently stored in a storage medium other than the second target storage medium, a migration operation is performed to migrate the target object to the second target storage medium.
[0097] The first time point and the second time point are separated by a preset time length, which can be set according to the requirements of a business scenario (such as in units of hours, days, or months) to ensure that the two target periods are sequentially connected in time and do not overlap.
[0098] In the above-mentioned embodiments, the target storage medium is determined by time period and is migrated at intervals, which can dynamically adapt to the storage requirements of the target object in different time periods and avoid resource waste or insufficient performance caused by long-term fixed storage media. The preset time length interval can balance the migration cost and the adaptation accuracy, make the storage strategy more flexible, and improve the operation efficiency and resource utilization rate of the overall storage system.
[0099] Corresponding to the data storage method, the application also provides a data storage device. For details, see Figure 3 A module schematic diagram of the data storage device provided by some embodiments of the application is shown. Figure 3In some embodiments, the data storage apparatus comprises:
[0100] The record obtaining module 301 is configured to obtain historical access records of the target object.
[0101] The heat prediction module 302 is configured to determine, based on the historical access records, access behavior features of the target object in a target historical time period, and predict, based on at least the access behavior features of the target historical time period, access heat of the target object in a future target time period.
[0102] The medium determination module 303 is configured to determine, based on the access heat of the future target time period, a target storage medium of the target object in the future target time period.
[0103] The object migration module 304 is configured to, in the future target time period, if the target object is saved in other storage media than the target storage medium, migrate the target object from the other storage media to the target storage medium.
[0104] In some embodiments, the heat prediction module 302 is specifically configured to:
[0105] determine, based on the historical access records, storage medium features of the target object in the target historical time period;
[0106] predict, based on the access behavior features, the storage medium features, and object attributes of the target object in the target historical time period, the access heat of the target object in the future target time period.
[0107] In some embodiments, the heat prediction module 302 is specifically configured to:
[0108] input the access behavior features, the storage medium features, and the attribute features of the target object in the target historical time period into the trained first prediction model to obtain access behavior features of the target object in the future target time period;
[0109] input the access behavior features in the future target time period into the trained second prediction model to obtain the access heat of the target object in the future target time period.
[0110] In some embodiments, after migrating the target object from the other storage media to the target storage medium, the object migration module 304 is further configured to:
[0111] obtain a first storage cost of the target object in the future target time period, and a first access performance index when accessing the target object in the future target time period;
[0112] obtain a second storage cost of the target object in the target historical time period, and a second access performance index when accessing the target object in the target historical time period;
[0113] The first storage cost and the second storage cost are compared to obtain a first comparison result, and the first access performance index and the second access performance index are compared to obtain a second comparison result;
[0114] Based on the first comparison result and the second comparison result, the accuracy of migrating the target object to the target storage medium in the future target period is determined;
[0115] Based on the accuracy, at least one of the first prediction model and the second prediction model is fine-tuned.
[0116] In some embodiments, the medium determination module 303 is specifically configured to:
[0117] Obtain the storage cost and the maximum access delay of the target object in various candidate storage media, the maximum access delay being the maximum delay allowed when accessing the target object;
[0118] The access heat, the storage cost and the maximum access delay are weighted and fused to calculate, and according to the calculation result, the target storage medium of the target object in the future target period is determined.
[0119] In some embodiments, the heat prediction module 302 is specifically configured to:
[0120] Divide the target historical period into a plurality of historical sub-periods;
[0121] Based on the historical access record, the access index of the target object in each historical sub-period is counted, and based on the access index, the access index change trend of the target object in the target historical period is determined, the access index including at least one of the access times, the access frequency, the access interval and the access delay;
[0122] The access index of each historical sub-period and the access index change trend of the target historical period are taken as the access behavior characteristics of the target object in the target historical period.
[0123] In some embodiments, the object migration module 304 is specifically configured to:
[0124] At a first time point, determine the first target storage medium of the target object in a first target period after the first time point, and migrate the target object to the first target storage medium in the first target period;
[0125] At a second time point, determine the second target storage medium of the target object in a second target period after the second time point, and migrate the target object to the second target storage medium in the second target period;
[0126] The first time point and the second time point are separated by a preset time length. The features of the data storage device can be referred to the related description of the sample data processing method, which will not be repeated here.
[0127] Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and necessary general hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better embodiment.
[0128] In conjunction with the above Figure 4 The embodiment of the present application also provides an electronic device, including a memory 10 and a processor 20, the memory 10 stores a computer program, and the processor 20 is configured to run the computer program to execute the steps in any of the above data storage method embodiments.
[0129] The embodiment of the present application also provides a computer readable storage medium, which stores a computer program, wherein the computer program is configured to execute the steps in any of the above data storage method embodiments when running.
[0130] In an exemplary embodiment, the above computer readable storage medium can include but is not limited to: a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store computer programs.
[0131] The embodiment of the present application also provides a computer program product, which includes a computer program, and the computer program is executed by a processor to realize the steps in any of the above data storage method embodiments.
[0132] The embodiment of the present application also provides another computer program product, which includes a non-volatile computer readable storage medium, and the non-volatile computer readable storage medium stores a computer program, and the computer program is executed by a processor to realize the steps in any of the above data storage method embodiments.
[0133] Those skilled in the art will further realize that the mere concepts, teachings, and embodiments described herein are merely meant to provide an enabling description of the applications and are not intended to limit the scope of the applications. Therefore, embodiments or examples described herein are not meant to be limiting, but merely to aid in the understanding of the overall more complete disclosure of the applications. Accordingly, the disclosure of various examples and embodiments is meant to be illustrative and not limiting of the scope of the applications, as claimed.
[0134] The data storage method, device, equipment and storage medium provided by the application are described in detail above. The principles and implementation manners of the application are described by applying specific examples. The above description of the embodiments is only used to help understand the method and core idea of the application. It should be pointed out that, for those skilled in the art, without departing from the principles of the application, some improvements and modifications can be made to the application. These improvements and modifications also fall within the protection scope of the claims of the application.
Claims
1. A data storage method, characterized in that, The method includes: Retrieve the historical access records of the target object; Based on the historical access records, the access behavior characteristics of the target object within the target historical period are determined, and based at least on the access behavior characteristics of the target historical period, the access popularity of the target object in the future target period is predicted. Based on the access frequency during the future target period, the target storage medium for the target object during the future target period is determined; If, during the future target time period, the target object is stored in a storage medium other than the target storage medium, then the target object will be migrated from the other storage medium to the target storage medium.
2. The method according to claim 1, characterized in that, The prediction of the access popularity of the target object in a future target time period, based at least on the access behavior characteristics of the target historical time period, includes: Based on the historical access records, the storage medium characteristics of the target object during the target historical period are determined; Based on the access behavior characteristics, storage medium characteristics, and object attributes of the target object during the target historical period, the access popularity of the target object in the future target period is predicted.
3. The method according to claim 2, characterized in that, The method of predicting the access popularity of the target object in a future target time period based on the access behavior characteristics, storage medium characteristics, and object attributes of the target object during the target historical time period includes: The access behavior characteristics, storage medium characteristics, and attribute characteristics of the target object during the target historical period are input into the trained first prediction model to obtain the access behavior characteristics of the target object during the future target period. The access behavior characteristics of the target object during the future target period are input into the trained second prediction model to obtain the access popularity of the target object during the future target period.
4. The method according to claim 3, characterized in that, After migrating the target object from other storage media to the target storage media, the method further includes: Obtain the first storage cost of the target object in the future target time period, and the first access performance metric when accessing the target object in the future target time period; Obtain the second storage cost of the target object during the target historical period, and the second access performance metric when accessing the target object during the target historical period; The first storage cost and the second storage cost are compared to obtain a first comparison result, and the first access performance index and the second access performance index are compared to obtain a second comparison result. Based on the first comparison result and the second comparison result, determine the accuracy of migrating the target object to the target storage medium within the future target time period; Based on the accuracy, at least one of the first prediction model and the second prediction model is fine-tuned.
5. The method according to any one of claims 1 to 4, characterized in that, The step of determining the target storage medium for the target object during the future target time period based on access popularity includes: The storage cost and maximum access latency of the target object in various candidate storage media are obtained, wherein the maximum access latency refers to the maximum allowed latency when accessing the target object; The access popularity, storage cost, and maximum access latency are weighted and fused for calculation, and the target storage medium for the target object in the future target time period is determined based on the calculation results.
6. The method according to any one of claims 1 to 4, characterized in that, The step of determining the access behavior characteristics of the target object within a target historical period based on the historical access records includes: The target historical period is divided into multiple historical sub-periods; Based on the historical access records, the access metrics of the target object in each of the historical sub-periods are statistically analyzed, and based on the access metrics, the trend of the access metrics of the target object in the target historical period is determined. The access metrics include at least one of access count, access frequency, access interval, and access latency. The access metrics of each of the historical sub-periods and the trend of the access metrics of the target historical period are used as the access behavior characteristics of the target object within the target historical period.
7. The method according to claim 1, characterized in that, If, during the future target time period, the target object is stored in a storage medium other than the target storage medium, then migrating the target object from the other storage medium to the target storage medium includes: At a first time point, the first target storage medium of the target object is determined within a first target time period after the first time point, and the target object is migrated to the first target storage medium during the first target time period. At a second time point, the second target storage medium of the target object is determined within a second target time period after the second time point, and the target object is migrated to the second target storage medium during the second target time period; The first time point and the second time point are separated by a preset time interval.
8. A data storage device, characterized in that, The device includes: The record acquisition module is used to acquire the historical access records of the target object; The popularity prediction module is used to determine the access behavior characteristics of the target object within a target historical period based on the historical access records, and to predict the access popularity of the target object in a future target period based at least on the access behavior characteristics of the target historical period. The media determination module is used to determine the target storage medium of the target object in the future target time period based on the access popularity of the future target time period. The object migration module is used to migrate the target object from the other storage medium to the target storage medium if the target object is stored in a storage medium other than the target storage medium during the future target time period.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the data storage method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the data storage method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Hierarchical storage data adaptive migration method based on deep reinforcement learning
CN112051969A
File management method and device based on file popularity, equipment and storage medium
CN117370272A
Data block hierarchical storage method and device, computer equipment and storage medium
CN118034593A
File conversion method, equipment, storage medium and device
CN118796759A
Data dynamic storage method and device, equipment and storage medium
CN118915978A
Cited By
A storage decision method and apparatus
CN122387393A