Data storage method and device, computer device and storage medium thereof
By combining historical access records and data content, and using cooling models and temperature prediction models to dynamically adjust the data storage layer, the problem of insufficient storage flexibility in existing technologies is solved, and efficient reading and writing of data storage is achieved.
Patent Information
- Application Number
- CN202310980416.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-04
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2043-08-04
AI Technical Summary
Existing technologies tend to consider only a few factors when storing data, resulting in low storage flexibility and an inability to fully guarantee data read and write efficiency.
By acquiring historical access records and data content of the data to be processed, the current access temperature and predicted access temperature are determined using cooling and temperature prediction models. Combined with access temperature thresholds, the data is stored in the corresponding data storage layer, including hot, warm, and cold storage layers. The storage layer is dynamically adjusted to match the access frequency and predicted access frequency of the data.
It achieves improved data storage flexibility and read/write efficiency, avoiding situations where data is frequently accessed but stored in a location with low read/write efficiency, or vice versa, thus saving time and resources.
Smart Images

Figure CN117130549B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, in particular to a data storage method and device, computer equipment and a storage medium thereof. BACKGROUND
[0002] With the development of the data era, users are exposed to more and more data information in their daily work and life, and the amount of data that needs to be stored is also increasing.
[0003] In the prior art, in order to ensure the read-write efficiency of the user for the stored data, the data can be stored in storage devices with different read-write efficiencies according to the access frequency of the data. For example, the data is divided into hot data frequently accessed, warm data occasionally accessed, and cold data rarely accessed, and the hot data, warm data and cold data are stored in storage devices with different read-write efficiencies.
[0004] However, the prior art considers only a single factor when storing data, and the flexibility of storage is low, which cannot fully guarantee the data read-write efficiency. SUMMARY
[0005] Therefore, it is necessary to provide a data storage method, device, computer equipment and storage medium thereof capable of flexibly driving storage devices and ensuring data read-write efficiency to solve the above technical problems.
[0006] In a first aspect, the present application provides a data storage method. The method comprises:
[0007] If the data storage period is reached, the to-be-processed data is obtained, wherein the to-be-processed data includes stored data and / or newly stored data;
[0008] According to the historical access record of the to-be-processed data, the current access temperature of the to-be-processed data is determined;
[0009] According to the data content of the to-be-processed data, the predicted access temperature of the to-be-processed data is determined;
[0010] According to the access temperature threshold, the current access temperature and the predicted access temperature of the to-be-processed data, the to-be-processed data is stored in the corresponding data storage layer.
[0011] In one embodiment, according to the historical access record of the to-be-processed data, the current access temperature of the to-be-processed data is determined, comprising:
[0012] According to the historical access record of the to-be-processed data in the first preset time period, the access time of the to-be-processed data in the first preset time period is determined;
[0013] According to the access time of the to-be-processed data in the first preset time period, the current access temperature of the to-be-processed data is determined.
[0014] In one of the embodiments, the current access temperature of the to-be-processed data is determined according to the access time of the to-be-processed data within the first preset time period, comprising:
[0015] The current access temperature of the to-be-processed data is determined according to the access time of the to-be-processed data within the first preset time period through the cooling model.
[0016] In one of the embodiments, the historical access record is updated according to a preset record update period.
[0017] In one of the embodiments, the predicted access temperature of the to-be-processed data is determined according to the data content of the to-be-processed data, comprising:
[0018] The temperature prediction model is used to predict the temperature of the data content of the to-be-processed data to obtain the predicted access temperature of the to-be-processed data.
[0019] In one of the embodiments, the training process of the temperature prediction model comprises:
[0020] If the model training period is reached, the stored data and the current access temperature corresponding to the stored data are obtained;
[0021] The weight parameters in the temperature prediction model are updated according to the stored data and the current access temperature corresponding to the stored data to obtain the trained temperature prediction model.
[0022] In one of the embodiments, the access temperature threshold is an access temperature threshold interval composed of an access upper threshold and an access lower threshold; and the to-be-processed data is stored into the corresponding data storage layer according to the access temperature threshold, the current access temperature and the predicted access temperature of the to-be-processed data, comprising:
[0023] The mixed access temperature of the to-be-processed data is determined according to the current access temperature and the predicted access temperature;
[0024] The data storage layer corresponding to the to-be-processed data is determined according to the mixed access temperature and the access temperature threshold interval;
[0025] The to-be-processed data is stored into the corresponding data storage layer.
[0026] In one of the embodiments, the data storage layer corresponding to the to-be-processed data is determined according to the mixed access temperature and the access temperature threshold interval, comprising:
[0027] If the mixed access temperature is greater than the access upper threshold of the access temperature threshold interval, the data storage layer of the to-be-processed data is determined as the first storage layer;
[0028] If the mixed access temperature belongs to the access temperature threshold interval, the data storage layer of the to-be-processed data is determined as the second storage layer.
[0029] If the mixed access temperature is less than the access lower threshold of the access temperature threshold interval, the data storage layer of the to-be-processed data is determined as the third storage layer.
[0030] The read-write efficiency of the first storage layer is greater than that of the second storage layer, and the read-write efficiency of the second storage layer is greater than that of the third storage layer.
[0031] In one of the embodiments, the method further comprises:
[0032] If the access index of the data storage layer does not meet the index threshold, the access upper threshold and the access lower threshold are updated.
[0033] According to the updated access upper threshold and the access lower threshold, the access temperature threshold interval is adjusted.
[0034] In one of the embodiments, the access index of the data storage layer comprises an access hit rate and / or an access utilization rate.
[0035] Correspondingly, the method further comprises:
[0036] According to the access times of the first storage layer, the second storage layer and the third storage layer in the second preset period, and the access coefficients of the first storage layer and the second storage layer, the access hit rate of the data storage layer is determined.
[0037] According to the access times of the first storage layer and the second storage layer in the second preset period, and the data storage amount of the first storage layer and the data storage amount of the second storage layer, the access utilization rate of the data storage layer is determined.
[0038] In one of the embodiments, according to the current access temperature and the predicted access temperature, the mixed access temperature of the to-be-processed data is determined, comprising:
[0039] The first operation weight corresponding to the current access temperature is determined, and the second operation weight corresponding to the predicted access temperature is determined;
[0040] According to the first operation weight and the second operation weight, the current access temperature and the predicted access temperature are processed by weighted summation to obtain the mixed access temperature of the to-be-processed data.
[0041] In a second aspect, the application further provides a data storage device. The device comprises:
[0042] The acquisition module is configured to acquire to-be-processed data if the data storage period is reached, wherein the to-be-processed data comprises stored data and / or newly added storage data.
[0043] The first determining module is configured to determine a current access temperature of the to-be-processed data according to historical access records of the to-be-processed data.
[0044] The second determining module is configured to determine a predicted access temperature of the to-be-processed data according to data content of the to-be-processed data.
[0045] The storing module is configured to store the to-be-processed data to a corresponding data storage layer according to the access temperature threshold, the current access temperature and the predicted access temperature of the to-be-processed data.
[0046] In a third aspect, the present application provides a computer device. The computer device comprises a memory and a processor. The memory stores a computer program. The processor implements the following steps when executing the computer program:
[0047] If the data storage period is reached, obtaining to-be-processed data, wherein the to-be-processed data comprises stored data and / or newly stored data;
[0048] Determining a current access temperature of the to-be-processed data according to historical access records of the to-be-processed data;
[0049] Determining a predicted access temperature of the to-be-processed data according to data content of the to-be-processed data;
[0050] Storing the to-be-processed data to a corresponding data storage layer according to the access temperature threshold, the current access temperature and the predicted access temperature of the to-be-processed data.
[0051] In a fourth aspect, the present application provides a computer readable storage medium. The computer readable storage medium stores a computer program. The computer program is executed by a processor to implement the following steps:
[0052] If the data storage period is reached, obtaining to-be-processed data, wherein the to-be-processed data comprises stored data and / or newly stored data;
[0053] Determining a current access temperature of the to-be-processed data according to historical access records of the to-be-processed data;
[0054] Determining a predicted access temperature of the to-be-processed data according to data content of the to-be-processed data;
[0055] Storing the to-be-processed data to a corresponding data storage layer according to the access temperature threshold, the current access temperature and the predicted access temperature of the to-be-processed data.
[0056] In a fifth aspect, the present application provides a computer program product. The computer program product comprises a computer program. The computer program is executed by a processor to implement the following steps:
[0057] If the data storage period is reached, the to-be-processed data is obtained, wherein the to-be-processed data includes stored data and / or newly stored data;
[0058] According to the historical access record of the to-be-processed data, the current access temperature of the to-be-processed data is determined;
[0059] According to the data content of the to-be-processed data, the predicted access temperature of the to-be-processed data is determined;
[0060] According to the access temperature threshold, the current access temperature and the predicted access temperature of the to-be-processed data, the to-be-processed data is stored to the corresponding data storage layer.
[0061] The data storage method, device, computer device and storage medium thereof, by the historical access record of the to-be-processed data and the data content of the to-be-processed data, determine the current access temperature and the predicted access temperature of the to-be-processed data, and then store the to-be-processed data to the corresponding data storage layer according to the access temperature threshold, the current access temperature and the predicted access temperature of the to-be-processed data. In the above process, not only the current access temperature of the to-be-processed data is used, but also the predicted access temperature of the to-be-processed data is used to store the to-be-processed data to the corresponding data storage layer. The current access temperature and the predicted access temperature of the to-be-processed data are used to determine the corresponding data storage layer of the to-be-processed data, to prevent the future access temperature of the to-be-processed data from being high but stored in the data storage layer with low read-write efficiency, resulting in time waste when reading and writing the to-be-processed data; and to prevent the future access temperature of the to-be-processed data from being low but stored in the data storage layer with high read-write efficiency, resulting in waste of storage resources. Therefore, the present application ensures the flexibility of storing the to-be-processed data and fully covers the read-write efficiency of each to-be-processed data. BRIEF DESCRIPTION OF DRAWINGS
[0062] Figure 1 An application environment diagram of a data storage method provided by an embodiment of the present application;
[0063] Figure 2 A flowchart of a data storage method provided by an embodiment of the present application;
[0064] Figure 3 A step flowchart for determining the current access temperature of the to-be-processed data provided by an embodiment of the present application;
[0065] Figure 4 A function curve diagram of a data cooling function provided by an embodiment of the present application;
[0066] Figure 5 A relationship diagram of a temperature model training area and a temperature prediction area provided by an embodiment of the present application;
[0067] Figure 6 A flow chart of a step of storing data to be processed to a data storage layer is provided for an embodiment of the present application;
[0068] Figure 7 A flow chart of another data storage method is provided for an embodiment of the present application;
[0069] Figure 8 A flow chart of yet another data storage method is provided for an embodiment of the present application;
[0070] Figure 9 A structure block diagram of a first data storage device is provided for an embodiment of the present application;
[0071] Figure 10 A structure block diagram of a second data storage device is provided for an embodiment of the present application;
[0072] Figure 11 A structure block diagram of a third data storage device is provided for an embodiment of the present application;
[0073] Figure 12 A structure block diagram of a fourth data storage device is provided for an embodiment of the present application;
[0074] Figure 13 A structure block diagram of a fifth data storage device is provided for an embodiment of the present application;
[0075] Figure 14 An internal structure diagram of a computer device in an embodiment. DETAILED DESCRIPTION
[0076] In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application.
[0077] It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application. In the description of the present application, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any appropriate manner in any one or more embodiments or examples. In addition, the skilled in the art can combine and combine the different embodiments or examples described in the specification and the features of the different embodiments or examples without contradiction.
[0078] Based on the above, the data storage method provided by the embodiments of the present application can be applied to the application environment as shown in Figure 1 In one embodiment, a computer device is provided, which can be a server, and the internal structure diagram thereof can be as shown in Figure 1 The computer device includes a processor, a memory and a network interface connected through a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The database of the computer device is configured to store the acquired data of the data storage method. The network interface of the computer device is configured to communicate with an external terminal through a network connection. The computer program is executed by the processor to implement a data storage method.
[0079] The present application discloses a data storage method, device, computer device and storage medium thereof. The computer device of the present application acquires to-be-processed data, current access temperature and predicted access temperature of the to-be-processed data, and then stores the to-be-processed data to a corresponding data storage layer according to the access temperature threshold, the current access temperature and the predicted access temperature of the to-be-processed data.
[0080] In one embodiment, as shown in Figure 2 , Figure 2 a flowchart of a data storage method provided by the embodiments of the present application, a data storage method is provided, Figure 1 The data storage method executed by the computer device in the embodiment can include the following steps:
[0081] Step 201, if the data storage period is reached, acquiring to-be-processed data.
[0082] The to-be-processed data includes stored data and / or newly stored data. It can be understood that the to-be-processed data refers to all data stored in the data storage layer, and / or new data that needs to be stored.
[0083] It should be noted that since the access frequency corresponding to the to-be-processed data will change over time, in order to ensure that the to-be-processed data is stored in the corresponding data storage layer, it is necessary to regularly update and adjust the data storage layer corresponding to the to-be-processed data, so as to ensure that when the access frequency corresponding to the to-be-processed data changes over time, the data storage layer corresponding to the to-be-processed data also changes.
[0084] Therefore, in order to ensure that the data storage layer corresponding to the to-be-processed data is updated and adjusted regularly, a data storage period can be set. When the data storage period is reached, all data stored in the data storage layer and / or new data (i.e., to-be-processed data) that needs to be stored are obtained, and the to-be-processed data is stored in the corresponding data storage layer through the data storage method.
[0085] The specific time of the data storage period can be set and adjusted according to the historical experience of the staff and the actual situation. For example, the data storage period can be 24 hours or 48 hours, and the specific time of the data storage period is not limited herein.
[0086] In step 202, the current access temperature of the to-be-processed data is determined according to the historical access record of the to-be-processed data.
[0087] The current access temperature is used to represent how many times the to-be-processed data has been accessed in a certain period of time in the past. Further, if the current access temperature is high, it means that the to-be-processed data has been accessed more times in a certain period of time in the past. If the current access temperature is low, it means that the to-be-processed data has been accessed less times in a certain period of time in the past.
[0088] The length of the certain period of time can be set and adjusted according to actual needs. For example, the period of time can be three months or one month, and the length of the period of time is not limited herein.
[0089] It should be noted that when the current access temperature of the to-be-processed data is needed, the current access temperature of the to-be-processed data can be determined according to the access time corresponding to each access of the to-be-processed data in a certain period of time. Specifically, there are many methods for determining the current access temperature of the to-be-processed data according to the access time corresponding to each access of the to-be-processed data in a certain period of time. For example, different access temperatures corresponding to different access times in different periods of time are set in advance to determine the current access temperature of the to-be-processed data, or a cooling model is used to determine the current access temperature of the to-be-processed data.
[0090] In an embodiment of the present application, when it is necessary to determine the current access temperature of the to-be-processed data, the access heat corresponding to different access times can be preset in advance. Specifically, it can be set that the current access temperature of the to-be-processed data is 10 when the access times in the past three months is greater than or equal to 20, the current access temperature of the to-be-processed data is 5 when the access times in the past three months is less than 20 but greater than or equal to 10, and the current access temperature of the to-be-processed data is 1 when the access times in the past three months is less than 10. If it is determined according to the access time corresponding to each access of the to-be-processed data in a time period that the access times of the to-be-processed data in the time period is 15, it is determined that the access times of the to-be-processed data is less than 20 but greater than or equal to 10, and thus the current access temperature of the to-be-processed data is determined to be 5.
[0091] In another embodiment of the present application, when it is necessary to determine the current access temperature of the to-be-processed data, a cooling model can be trained in advance, the access time of the to-be-processed data in a first preset time period is input into the cooling model, and the output result of the cooling model is obtained, which is the current access temperature of the to-be-processed data.
[0092] In step 203, the predicted access temperature of the to-be-processed data is determined according to the data content of the to-be-processed data.
[0093] The predicted access temperature is used to represent the predicted number of accesses of the to-be-processed data in a future time period, and further, if the predicted access temperature is high, it means that the to-be-processed data is accessed more frequently in the future time period, and if the predicted access temperature is low, it means that the to-be-processed data is accessed less frequently in the future time period.
[0094] It should be noted that when it is necessary to predict the predicted access temperature of the to-be-processed data, a temperature prediction model can be trained in advance, and then the data content of the to-be-processed data is input into the temperature prediction model, and the output result of the temperature prediction model is obtained, which is the predicted access temperature of the to-be-processed data.
[0095] Further, when it is necessary to determine the predicted access temperature of the to-be-processed data, it can also be determined according to the access time corresponding to each access of the to-be-processed data in a time period whether the access times of the to-be-processed data become more frequent over time, and if yes, it is determined that the predicted access temperature of the to-be-processed data is high, and if no, it is determined that the predicted access temperature of the to-be-processed data is low.
[0096] In an embodiment of the present application, when it is needed to determine the predicted access temperature of the to-be-processed data, it can be determined according to the access time corresponding to each time of access within a certain time period whether the time interval of the access time corresponding to each two times of access is getting shorter and shorter, if yes, it is determined that the number of times of access of the to-be-processed data becomes more and more frequent over time, and thus the predicted access temperature of the to-be-processed data is higher; if no, it is determined that the number of times of access of the to-be-processed data becomes less and less over time, and thus the predicted access temperature of the to-be-processed data is lower.
[0097] In step 204, the to-be-processed data is stored to the corresponding data storage layer according to the access temperature threshold, the current access temperature and the predicted access temperature of the to-be-processed data.
[0098] It should be noted that when it is needed to determine the data storage layer corresponding to the to-be-processed data and store the to-be-processed data to the corresponding data storage layer, the mixed access temperature of the to-be-processed data can be determined according to the current access temperature and the predicted access temperature of the to-be-processed data, the data storage layer corresponding to the to-be-processed data is determined according to the size relationship between the mixed access temperature and the access upper threshold and the access lower threshold in the access temperature threshold, and then the to-be-processed data is stored to the corresponding data storage layer.
[0099] It should be noted that when it is needed to determine the data storage layer corresponding to the to-be-processed data and store the to-be-processed data to the corresponding data storage layer, the mixed access temperature of the to-be-processed data can be determined according to the current access temperature and the predicted access temperature of the to-be-processed data, the data storage layer corresponding to the to-be-processed data is determined according to the size relationship between the mixed access temperature and the access upper threshold and the access lower threshold in the access temperature threshold, and then the to-be-processed data is stored to the corresponding data storage layer.
[0100] It should be noted that when it is needed to determine the data storage layer corresponding to the to-be-processed data and store the to-be-processed data to the corresponding data storage layer, the mixed access temperature of the to-be-processed data can be determined according to the current access temperature and the predicted access temperature of the to-be-processed data, the data storage layer corresponding to the to-be-processed data is determined according to the size relationship between the mixed access temperature and the access upper threshold and the access lower threshold in the access temperature threshold, and then the to-be-processed data is stored to the corresponding data storage layer.
[0101] It should be noted that when it is needed to determine the data storage layer corresponding to the to-be-processed data and store the to-be-processed data to the corresponding data storage layer, the mixed access temperature of the to-be-processed data can be determined according to the current access temperature and the predicted access temperature of the to-be-processed data, the data storage layer corresponding to the to-be-processed data is determined according to the size relationship between the mixed access temperature and the access upper threshold and the access lower threshold in the access temperature threshold, and then the to-be-processed data is stored to the corresponding data storage layer.
[0102] It should be noted that when it is needed to determine the data storage layer corresponding to the to-be-processed data and store the to-be-processed data to the corresponding data storage layer, the mixed access temperature of the to-be-processed data can be determined according to the current access temperature and the predicted access temperature of the to-be-processed data, the data storage layer corresponding to the to-be-processed data is determined according to the size relationship between the mixed access temperature and the access upper threshold and the access lower threshold in the access temperature threshold, and then the to-be-processed data is stored to the corresponding data storage layer.
[0103] In an embodiment of the present application, when the data storage layer corresponding to the to-be-processed data is determined, the to-be-processed data is stored in the corresponding data storage layer according to the correspondence between the to-be-processed data and the data storage layer.
[0104] The data storage method determines the current access temperature and the predicted access temperature of the to-be-processed data according to the historical access record of the to-be-processed data and the data content of the to-be-processed data, and then stores the to-be-processed data in the corresponding data storage layer according to the access temperature threshold, the current access temperature and the predicted access temperature of the to-be-processed data. In the above process, the to-be-processed data is stored in the corresponding data storage layer not only according to the current access temperature of the to-be-processed data, but also in combination with the predicted access temperature of the to-be-processed data, so as to determine the data storage layer corresponding to the to-be-processed data in combination with the current access heat of the to-be-processed data and the future access heat of the to-be-processed data, prevent the situation that the future access heat of the to-be-processed data is high but the to-be-processed data is stored in a data storage layer with low read-write efficiency, which causes time waste when reading and writing the to-be-processed data, and prevent the situation that the future access heat of the to-be-processed data is low but the to-be-processed data is stored in a data storage layer with high read-write efficiency, which causes waste of storage resources. Therefore, the present application ensures the storage flexibility of the to-be-processed data and fully considers the read-write efficiency of each to-be-processed data.
[0105] Since the prior art considers only a single factor when storing data, the flexibility of storage is low, and therefore, when subsequent read-write processing of the to-be-processed data is required, there are situations that the future access heat of the to-be-processed data is high but the to-be-processed data is stored in a data storage layer with low read-write efficiency, and the future access heat of the to-be-processed data is low but the to-be-processed data is stored in a data storage layer with high read-write efficiency. Therefore, to solve the above technical problems, the computer device of the embodiment can determine the current access temperature of the to-be-processed data according to the historical access record of the to-be-processed data in a manner as shown in Figure 3
[0106] Step 301: determining the access time of the to-be-processed data in a first preset time period according to the historical access record of the to-be-processed data in the first preset time period.
[0107] It should be noted that the historical access record records each access record of the to-be-processed data in the first preset time period and the access time of each access record, wherein the access time of each access record is the access time of the to-be-processed data in the first preset time period.
[0108] Specifically, when the access time of the to-be-processed data in the first preset time period needs to be determined, the historical access records of the to-be-processed data in the first preset time period are subjected to information screening, and then the access time of each access record of the to-be-processed data in the first preset time period is screened out, which is the access time of the to-be-processed data in the first preset time period.
[0109] As an implementation manner, the historical access records are subjected to data updating according to a preset record updating period.
[0110] For example, if the preset record updating period is 24 hours, it is detected whether the time difference between the historical access records and the last data updating time is greater than 24 hours, if yes, the new access records of the to-be-processed data in the first preset time period and the access time of each new access record are obtained, and the new access records of the to-be-processed data in the first preset time period and the access time of each new access record are taken as new historical access records, so as to realize data updating of the historical access records.
[0111] As another implementation manner, the historical access records are subjected to data updating according to the size relationship between the newly added access times of the to-be-processed data and an access time threshold.
[0112] For example, if the newly added access times of the to-be-processed data are greater than the access time threshold, the historical access records are subjected to data updating. If the access time threshold is 10 times, it is judged whether the newly added access times of the to-be-processed data are greater than 10 times, if yes, the new access records of the to-be-processed data in the first preset time period and the access time of each new access record are obtained, and the new access records of the to-be-processed data in the first preset time period and the access time of each new access record are taken as new historical access records, so as to realize data updating of the historical access records.
[0113] In step 302, the current access temperature of the to-be-processed data is determined according to the access time of the to-be-processed data in the first preset time period.
[0114] It should be noted that when the current access temperature of the to-be-processed data needs to be determined, the current access temperature of the to-be-processed data can be determined according to the access time of the to-be-processed data in the first preset time period through the cooling model.
[0115] In an embodiment of the present application, the access time of the to-be-processed data in the first preset time period can be input into the cooling model, and the output result of the cooling model is obtained, which is the current access temperature of the to-be-processed data.
[0116] The function formula corresponding to the cooling model is a decreasing function, which can be shown in the calculation formula (1). The current access temperature of the to-be-processed data is obtained by substituting the access time of the to-be-processed data in the first preset time period into the calculation formula (1).
[0117] The calculation formula (1) is as follows:
[0118]
[0119] T i is the access time of the to-be-processed data in the first preset time period, i is the access frequency of the to-be-processed data in the first preset time period, f(T i ) is a data cooling function that monotonically decreases with time, which can be set as 1 / T i or exp(-T i ) and the like; wherein the function curve corresponding to the data cooling function can be shown in formula (2). Figure 4
[0120] In an embodiment of the present application, a temperature recording module can be set to record and update the current access temperature of the to-be-processed data according to the output result of the cooling model.
[0121] The above data storage method determines the current access temperature of the to-be-processed data by determining the access time of the to-be-processed data in the first preset time period, which provides a data basis for subsequent determination of the data storage layer corresponding to the to-be-processed data, and accurately reflects the access heat of the to-be-processed data through the current access temperature of the to-be-processed data, which provides a guarantee for the accuracy of subsequent determination of the data storage layer corresponding to the to-be-processed data.
[0122] It should be noted that when it is necessary to determine the predicted access temperature of the to-be-processed data according to the data content of the to-be-processed data, the following content can be included: performing temperature prediction on the data content of the to-be-processed data through a temperature prediction model to obtain the predicted access temperature of the to-be-processed data.
[0123] In an embodiment of the present application, when it is necessary to determine the predicted access temperature of the to-be-processed data, the data content of the to-be-processed data can be input into the temperature prediction model, and the output result of the temperature prediction model is obtained, which is the predicted access temperature of the to-be-processed data.
[0124] Further, the training process of the temperature prediction model includes the following steps: if the model training period is reached, the stored data and the current access temperature corresponding to the stored data are obtained; the weight parameters in the temperature prediction model are updated according to the stored data and the current access temperature corresponding to the stored data, to obtain the trained temperature prediction model. Further, the training process of the temperature prediction model includes the following steps: if the model training period is reached, the stored data and the current access temperature corresponding to the stored data are obtained; the weight parameters in the temperature prediction model are updated according to the stored data and the current access temperature corresponding to the stored data, to obtain the trained temperature prediction model.
[0125] Specifically, after the stored data and the current access temperature corresponding to the stored data are determined, the stored data and the current access temperature corresponding to the stored data can be substituted into the training formula (2) to update the weight parameters in the temperature prediction model, and a trained temperature prediction model is obtained.
[0126] The training formula (2) is as follows:
[0127] P = A(W, X) (2)
[0128] Wherein, W refers to the weight parameters in the temperature prediction model, X refers to the stored data, and P refers to the output result of the temperature prediction model, that is, the predicted access temperature of the to-be-processed data.
[0129] In an embodiment of the present application, the storage and calculation integrated module can be used to calculate the predicted access temperature of the to-be-processed data while storing the to-be-processed data. The storage and calculation integrated module includes a metadata storage area, a temperature model training area, a temperature prediction area, a current temperature storage area, and a predicted temperature storage area.
[0130] The metadata storage area is used to store the data content of the to-be-processed data, the current temperature storage area is used to store the current access temperature of the to-be-processed data, and the predicted temperature storage area is used to store the predicted access temperature of the to-be-processed data.
[0131] The temperature model training area can include a temperature training model and the weight parameters of the temperature training model. The temperature training model can extract the stored data and the current access temperature corresponding to the stored data from the metadata storage area and the current temperature storage area. Then, the weight parameters of the temperature prediction model are trained according to the stored data and the current access temperature corresponding to the stored data, and the trained weight parameters are synchronized to the temperature prediction model.
[0132] The temperature prediction area can include a temperature prediction model and the weight parameters of the temperature prediction model. The temperature prediction model can perform temperature prediction on the data content of the to-be-processed data to obtain the predicted access temperature of the to-be-processed data.
[0133] In an embodiment of the present application, as Figure 5As shown, the temperature model training area can extract the stored data from the data read-write unit of the metadata storage area as a training sample through the data input unit, and obtain the corresponding current access temperature of the stored data from the current temperature storage area according to the data output unit, wherein the storage unit CELL stores the weight parameters of the temperature training model, and the temperature model training area synchronizes the trained weight parameters to the data read-write unit of the temperature prediction area through the data read-write unit; The temperature prediction area can obtain all to-be-processed data from the metadata storage area through the data input unit, and output the predicted access temperature of all to-be-processed data to the predicted temperature storage area through the data output unit.
[0134] The above data storage method realizes obtaining the predicted access temperature of the to-be-processed data through the temperature prediction model. The predicted access temperature is realized according to the predicted access temperature to reflect the predicted access heat of the to-be-processed data in a future period of time, and the current access heat of the to-be-processed data and the predicted access heat of the to-be-processed data are combined to determine the corresponding data storage layer of the to-be-processed data.
[0135] As an embodiment, as shown in the formula (2), when the to-be-processed data is stored in the corresponding data storage layer according to the access temperature threshold, the current access temperature and the predicted access temperature of the to-be-processed data, the following contents can be included: Figure 6
[0136] Step 601, determining the mixed access temperature of the to-be-processed data according to the current access temperature and the predicted access temperature.
[0137] It should be noted that when the mixed access temperature of the to-be-processed data needs to be determined, the following contents can be included: determining the first operation weight corresponding to the current access temperature, and determining the second operation weight corresponding to the predicted access temperature; The current access temperature and the predicted access temperature are weighted and summed to obtain the mixed access temperature of the to-be-processed data according to the first operation weight and the second operation weight.
[0138] In an embodiment of the present application, the mixed access temperature of the to-be-processed data can be determined according to the calculation formula (3), wherein the calculation formula (3) is as follows:
[0139]
[0140] Wherein, The first operation weight corresponding to the current access temperature is denoted as K1, The second operation weight corresponding to the predicted access temperature is denoted as K2, Q denotes the current access temperature, P denotes the predicted access temperature, and K denotes the mixed access temperature of the to-be-processed data.
[0141] At step 602, according to the mixed access temperature and the access temperature threshold interval, the data storage layer corresponding to the to-be-processed data is determined.
[0142] The access temperature threshold is an access temperature threshold interval composed of an access upper threshold and an access lower threshold.
[0143] For example, if the access upper threshold is 8 and the access lower threshold is 3, it is determined that the access temperature threshold interval is a closed interval less than or equal to 8 and greater than or equal to 3.
[0144] It should be noted that when the data storage layer corresponding to the to-be-processed data needs to be determined, the following content can be included: if the mixed access temperature is greater than the access upper threshold of the access temperature threshold interval, it is determined that the data storage layer of the to-be-processed data is the first storage layer; if the mixed access temperature belongs to the access temperature threshold interval, it is determined that the data storage layer of the to-be-processed data is the second storage layer; if the mixed access temperature is less than the access lower threshold of the access temperature threshold interval, it is determined that the data storage layer of the to-be-processed data is the third storage layer; wherein the read-write efficiency of the first storage layer is greater than the read-write efficiency of the second storage layer, and the read-write efficiency of the second storage layer is greater than the read-write efficiency of the third storage layer.
[0145] For example, if there are three to-be-processed data, the three to-be-processed data are to-be-processed data a, to-be-processed data b and to-be-processed data c, and the access temperature threshold interval is a closed interval less than or equal to 8 and greater than or equal to 3, however, the mixed access temperature corresponding to the to-be-processed data a is 7, the mixed access temperature corresponding to the to-be-processed data b is 9, and the mixed access temperature corresponding to the to-be-processed data c is 2. Therefore, the mixed access temperature of the to-be-processed data a belongs to the access temperature threshold interval, so it is determined that the data storage layer of the to-be-processed data a is the second storage layer; the mixed access temperature of the to-be-processed data b is greater than the access upper threshold of the access temperature threshold interval, so it is determined that the data storage layer of the to-be-processed data b is the first storage layer; the mixed access temperature of the to-be-processed data c is less than the access lower threshold of the access temperature threshold interval, so it is determined that the data storage layer of the to-be-processed data c is the third storage layer.
[0146] It should be noted that it is necessary to determine in real time whether the access index of the data storage layer meets the index threshold, and if not, the access upper threshold and the access lower threshold need to be updated. Specifically, if the access index of the data storage layer does not meet the index threshold, the access upper threshold and the access lower threshold are updated; and the access temperature threshold interval is adjusted according to the updated access upper threshold and the access lower threshold.
[0147] The access index of the data storage layer refers to the access hit rate and the access utilization rate. Therefore, the index threshold includes the hit rate threshold corresponding to the access hit rate and the utilization rate threshold corresponding to the access utilization rate.
[0148] To further explain, when it is necessary to determine whether the access metrics of the data storage layer meet the metric thresholds, the following can be included: if the access hit rate is less than the hit rate threshold and / or the access utilization is less than the utilization threshold, then the access metrics of the data storage layer are determined not to meet the metric thresholds; if the access hit rate is greater than or equal to the hit rate threshold and the access utilization is greater than or equal to the utilization threshold, then the access metrics of the data storage layer are determined to meet the metric thresholds.
[0149] In one embodiment of this application, the access hit rate of the data storage layer can be determined based on the number of accesses to the first, second, and third storage layers within a second preset time period, and the access coefficients of the first and second storage layers. Specifically, the access hit rate can be determined as shown in formula (4):
[0150]
[0151] Where S refers to the access hit rate of the data storage layer, and a h ,a w ,a c These represent the number of accesses to the data to be processed in the first, second, and third storage layers, respectively, where α refers to a h The corresponding coefficient, β, refers to a w The corresponding coefficient.
[0152] In another embodiment of this application, the access utilization rate of the data storage layer can be determined based on the number of accesses to the first storage layer and the second storage layer within a second preset time period, as well as the data storage volume of the first storage layer and the data storage volume of the second storage layer. Specifically, the above determination of the access utilization rate can be performed as shown in the calculation formula (5):
[0153]
[0154] Where U refers to the access utilization rate of the data storage layer, a h ,a w This refers to the number of times the data to be processed is accessed in the first and second storage layers, where α refers to a h The corresponding coefficient, β, refers to a w The corresponding coefficient, N h N refers to the total amount of data to be processed contained in the first storage layer. w This refers to the total amount of data to be processed contained in the second storage layer.
[0155] In an embodiment of the present application, if the access index of the data storage layer does not satisfy the index threshold value, and it is required to increase the access utilization rate of the data storage layer and decrease the access hit rate of the data storage layer, the value of the access upper limit threshold value can be increased, so that the total quantity of the data to be processed contained in the first storage layer decreases, and then according to the calculation formula (4) and the calculation formula (5), the access utilization rate of the data storage layer can be increased and the access hit rate of the data storage layer can be decreased.
[0156] In another embodiment of the present application, if the access index of the data storage layer does not satisfy the index threshold value, and it is required to increase the access utilization rate of the data storage layer and decrease the access hit rate of the data storage layer, the value of the access lower limit threshold value can be increased, so that the total quantity of the data to be processed contained in the second storage layer decreases, and then according to the calculation formula (4) and the calculation formula (5), the access utilization rate of the data storage layer can be increased and the access hit rate of the data storage layer can be decreased.
[0157] In still another embodiment of the present application, the adjustment of the access utilization rate and the access hit rate can not only rely on the access upper limit threshold value and the access lower limit threshold value. For example, if the access index of the data storage layer does not satisfy the index threshold value, and it is required to decrease the access utilization rate of the data storage layer and increase the access hit rate of the data storage layer, the value of the second operation weight corresponding to the predicted access temperature can be increased, so that the mixed access temperature of the data to be processed increases, and the total quantity of the data to be processed contained in the first storage layer increases, and then according to the calculation formula (4) and the calculation formula (5), the access utilization rate of the data storage layer can be decreased and the access hit rate of the data storage layer can be increased.
[0158] In step 603, the data to be processed is stored into the corresponding data storage layer.
[0159] In an embodiment of the present application, the present application can include a storage allocation and migration module, a data management module and a monitoring module.
[0160] The storage allocation and migration module can determine the mixed access temperature of the data to be processed according to the current access temperature and the predicted access temperature, and then determine the data storage layer corresponding to the data to be processed according to the mixed access temperature and the access temperature threshold interval, and store the data to be processed into the corresponding data storage layer.
[0161] The data management module can implement the storage operation of the data to be processed, and store the data to be processed from one data storage layer to another data storage layer, and can also record the access of the data to be processed in the data storage layer and feed back the access of the data to be processed to the monitoring module.
[0162] The monitoring module is configured to count the access of the to-be-processed data in the data storage layer, and determine the access hit rate of the data storage layer and the access utilization rate of the data storage layer according to the access.
[0163] The data storage method determines the belonging relationship between the to-be-processed data and the access temperature threshold interval according to the mixed access temperature of the to-be-processed data, and further determines the corresponding data storage layer of the to-be-processed data, thereby ensuring that the to-be-processed data is successfully stored in the corresponding data storage layer.
[0164] In an embodiment of the present application, when it is necessary to store the to-be-processed data in the corresponding data storage layer, the following steps can be performed as shown in FIG. 7. Figure 7 The specific contents include the following steps.
[0165] In step 701, the to-be-processed data is obtained when the data storage period is reached.
[0166] In step 702, the access time of the to-be-processed data in the first preset time period is determined according to the historical access record of the to-be-processed data in the first preset time period.
[0167] In step 703, the current access temperature of the to-be-processed data is determined according to the access time of the to-be-processed data in the first preset time period by using the cooling model.
[0168] In step 704, the data content of the to-be-processed data is temperature predicted by using the temperature prediction model, and the predicted access temperature of the to-be-processed data is obtained.
[0169] In step 705, the first operation weight corresponding to the current access temperature is determined, and the second operation weight corresponding to the predicted access temperature is determined.
[0170] In step 706, the current access temperature and the predicted access temperature are weighted and summed according to the first operation weight and the second operation weight, and the mixed access temperature of the to-be-processed data is obtained.
[0171] In step 707, if the mixed access temperature is greater than the access upper limit threshold of the access temperature threshold interval, the data storage layer of the to-be-processed data is determined as the first storage layer.
[0172] In step 708, if the mixed access temperature belongs to the access temperature threshold interval, the data storage layer of the to-be-processed data is determined as the second storage layer.
[0173] In step 709, if the mixed access temperature is less than the access lower limit threshold of the access temperature threshold interval, the data storage layer of the to-be-processed data is determined as the third storage layer.
[0174] In step 710, the to-be-processed data is stored in the corresponding data storage layer.
[0175] In one embodiment of this application, when it is necessary to store the data to be processed to the corresponding data storage layer, such as... Figure 8 As shown, the specific process may include the following: Users upload or access data to be processed. The metadata storage area in the storage-computing module performs operations such as creation, modification, indexing, and deletion on the data to be processed. The data management model performs operations such as writing, reading, modifying, and deleting on the data to be processed. In addition, the data management model updates historical access records so that the cooling model can determine the current access temperature of the data to be processed and record and store the current access temperature of the data to be processed. The temperature model training area synchronizes the trained weight parameters to the temperature prediction model in the temperature prediction area so that the temperature prediction model can predict the predicted access temperature of the data to be processed. The monitoring module adjusts the upper and lower access thresholds based on the access hit rate and access utilization rate of the data storage layer. Then, the storage allocation and migration module determines the data storage layer corresponding to the data to be processed based on the upper and lower access thresholds, the predicted access temperature of the data to be processed, and the current access temperature of the data to be processed, and feeds back migration instructions to the data management model so that the data management model stores the data to be processed in the first, second, and third storage layers according to the migration instructions.
[0176] The aforementioned data storage method determines the current and predicted access temperatures of the data to be processed based on its historical access records and content. Then, based on the access temperature threshold, the current and predicted access temperatures, the data to be processed is stored in the corresponding data storage layer. Because this process considers not only the current but also the predicted access temperature to determine the appropriate data storage layer, it combines the current access frequency and the predicted future access frequency of the data to be processed. This prevents situations where data with high future access frequency is stored in a low-efficiency data storage layer, leading to wasted time during data read / write operations; and conversely, it prevents situations where data with low future access frequency is stored in a high-efficiency data storage layer, leading to wasted storage resources. Therefore, this application ensures the flexibility of data storage and fully considers the read / write efficiency of each piece of data to be processed.
[0177] It should be understood that although the steps in the flowcharts involved in the above embodiments are shown in sequence according to the arrows, the steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, the execution of the steps is not strictly limited in sequence, and the steps can be executed in other orders. Moreover, at least some of the steps in the flowcharts involved in the above embodiments can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of the steps or stages is not necessarily sequential, but can be alternately or alternately executed with at least part of other steps or steps or stages in other steps.
[0178] Based on the same inventive concept, the embodiments of the present application also provide a data storage device for implementing the above-mentioned data storage method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more data storage device embodiments provided below can refer to the limitations of the data storage method in the above text, which will not be repeated here.
[0179] In one embodiment, as shown in Figure 9 a data storage device is provided, comprising: an acquisition module 10, a first determination module 20, a second determination module 30 and a storage module 40, wherein:
[0180] The acquisition module 10 is configured to acquire to-be-processed data if a data storage period is reached, wherein the to-be-processed data includes stored data and / or newly stored data.
[0181] The first determination module 20 is configured to determine a current access temperature of the to-be-processed data according to a historical access record of the to-be-processed data.
[0182] The second determination module 30 is configured to determine a predicted access temperature of the to-be-processed data according to data content of the to-be-processed data.
[0183] The second determination module is specifically configured to perform temperature prediction on the data content of the to-be-processed data through a temperature prediction model to obtain the predicted access temperature of the to-be-processed data.
[0184] The second determination module is further specifically configured to acquire the stored data and a current access temperature corresponding to the stored data if a model training period is reached; and update a weight parameter in the temperature prediction model according to the stored data and the current access temperature corresponding to the stored data to obtain a trained temperature prediction model.
[0185] The storage module 40 is used to store the data to be processed to the corresponding data storage layer based on the access temperature threshold, the current access temperature of the data to be processed, and the predicted access temperature.
[0186] In one embodiment, such as Figure 10 As shown, a data storage device is provided. The first determining module 20 in this data storage device includes: a first determining unit 21 and a second determining unit 22, wherein:
[0187] The first determining unit 21 is used to determine the access time of the data to be processed within the first preset time period based on the historical access records of the data to be processed within the first preset time period.
[0188] Among them, historical access records are updated according to a pre-set record update cycle.
[0189] The second determining unit 22 is used to determine the current access temperature of the data to be processed based on the access time of the data to be processed within a first preset time period.
[0190] The second determining unit is specifically used to determine the current access temperature of the data to be processed based on the access time of the data to be processed within a first preset time period using a cooling model.
[0191] In one embodiment, such as Figure 11 As shown, a data storage device is provided, wherein the storage module 40 of the data storage device includes: a third determining unit 41, a fourth determining unit 42, and a storage unit 43, wherein:
[0192] The third determining unit 41 is used to determine the mixed access temperature of the data to be processed based on the current access temperature and the predicted access temperature.
[0193] The third determining unit is specifically used to determine the first operation weight corresponding to the current access temperature and the second operation weight corresponding to the predicted access temperature; based on the first operation weight and the second operation weight, the current access temperature and the predicted access temperature are weighted and summed to obtain the mixed access temperature of the data to be processed.
[0194] The fourth determining unit 42 is used to determine the data storage layer corresponding to the data to be processed based on the mixed access temperature and the access temperature threshold range.
[0195] Storage unit 43 is used to store the data to be processed to the corresponding data storage layer.
[0196] In one embodiment, such as Figure 12 As shown, a data storage device is provided, wherein the fourth determining unit 42 of the data storage device includes: a first determining subunit 421, a second determining subunit 422, and a third determining subunit 423, wherein:
[0197] The first determining sub-unit 421 is configured to determine the data storage layer of the to-be-processed data as the first storage layer if the mixed access temperature is greater than the access upper threshold of the access temperature threshold interval.
[0198] The second determining sub-unit 422 is configured to determine the data storage layer of the to-be-processed data as the second storage layer if the mixed access temperature belongs to the access temperature threshold interval.
[0199] The third determining sub-unit 423 is configured to determine the data storage layer of the to-be-processed data as the third storage layer if the mixed access temperature is less than the access lower threshold of the access temperature threshold interval.
[0200] In one embodiment, as shown in FIG. 4B, a data storage device is provided, and the fourth determining unit 42 further includes an updating module 424 and an adjusting module 425, wherein: Figure 13 The updating module 424 is configured to update the access upper threshold and the access lower threshold if the access index of the data storage layer does not satisfy the index threshold.
[0201] The updating module is specifically configured to determine the access hit rate of the data storage layer according to the access frequencies of the first storage layer, the second storage layer and the third storage layer in the second preset time period, and the access coefficient of the first storage layer and the second storage layer; and determine the access utilization rate of the data storage layer according to the access frequencies of the first storage layer and the second storage layer in the second preset time period, and the data storage amount of the first storage layer and the data storage amount of the second storage layer.
[0202] The adjusting module 425 is configured to adjust the access temperature threshold interval according to the updated access upper threshold and the updated access lower threshold.
[0203] The above modules in the data storage device can be all or partially realized by software, hardware and combination thereof. The above modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so as to be called and executed by the processor to perform the operations corresponding to the above modules.
[0204] In one embodiment, a computer device is provided, which can be a terminal, and the internal structure diagram thereof can be as shown in FIG. 4C.
[0205] Figure 14 The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to perform wired or wireless communication with external terminals. The wireless communication can be achieved through WIFI, mobile cellular network, NFC (Near Field Communication) or other technologies. The computer program is executed by the processor to implement a data storage method. The display unit of the computer device is configured to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the computer device, or an external keyboard, touchpad or mouse, etc.
[0206] Those skilled in the art can understand that, Figure 14 The skilled in the art can understand that,
[0207] In one embodiment, a computer device is provided, including a memory and a processor, the memory stores a computer program, and the processor executes the computer program to implement the following steps:
[0208] If the data storage period is reached, the to-be-processed data is obtained, wherein the to-be-processed data includes the stored data and / or the newly stored data;
[0209] According to the historical access record of the to-be-processed data, the current access temperature of the to-be-processed data is determined;
[0210] According to the data content of the to-be-processed data, the predicted access temperature of the to-be-processed data is determined;
[0211] According to the access temperature threshold, the current access temperature and the predicted access temperature of the to-be-processed data, the to-be-processed data is stored to the corresponding data storage layer.
[0212] In one embodiment, the processor, when executing the computer program, also implements the following steps:
[0213] According to the historical access record of the to-be-processed data in the first preset time period, the access time of the to-be-processed data in the first preset time period is determined.
[0214] According to the access time of the to-be-processed data in the first preset time period, the current access temperature of the to-be-processed data is determined.
[0215] In one embodiment, the processor, when executing the computer program, also implements the following steps:
[0216] According to the access time of the to-be-processed data in the first preset time period, the current access temperature of the to-be-processed data is determined through the cooling model.
[0217] In one embodiment, the processor, when executing the computer program, also implements the following steps:
[0218] The historical access record updates data according to a pre-set record update period.
[0219] In one embodiment, the processor, when executing the computer program, also implements the following steps:
[0220] Through the temperature prediction model, the temperature prediction of the data content of the to-be-processed data is performed to obtain the predicted access temperature of the to-be-processed data.
[0221] In one embodiment, the processor, when executing the computer program, also implements the following steps:
[0222] If the model training period is reached, the stored data and the current access temperature corresponding to the stored data are obtained;
[0223] According to the stored data and the current access temperature corresponding to the stored data, the weight parameters in the temperature prediction model are updated to obtain the trained temperature prediction model.
[0224] In one embodiment, the processor, when executing the computer program, also implements the following steps:
[0225] According to the current access temperature and the predicted access temperature, the mixed access temperature of the to-be-processed data is determined;
[0226] According to the mixed access temperature and the access temperature threshold interval, the data storage layer corresponding to the to-be-processed data is determined;
[0227] The to-be-processed data is stored to the corresponding data storage layer.
[0228] In one embodiment, the processor, when executing the computer program, also implements the following steps:
[0229] If the mixed access temperature is greater than an access upper threshold of the access temperature threshold interval, the data storage layer of the data to be processed is determined as the first storage layer;
[0230] If the mixed access temperature belongs to the access temperature threshold interval, the data storage layer of the data to be processed is determined as the second storage layer;
[0231] If the mixed access temperature is less than an access lower threshold of the access temperature threshold interval, the data storage layer of the data to be processed is determined as the third storage layer.
[0232] Wherein, the read-write efficiency of the first storage layer is greater than the read-write efficiency of the second storage layer, and the read-write efficiency of the second storage layer is greater than the read-write efficiency of the third storage layer.
[0233] In one embodiment, the processor executing the computer program also implements the following steps:
[0234] If the access index of the data storage layer does not meet the index threshold, the access upper threshold and the access lower threshold are updated.
[0235] According to the updated access upper threshold and the access lower threshold, the access temperature threshold interval is adjusted.
[0236] In one embodiment, the processor executing the computer program also implements the following steps:
[0237] According to the access times of the first storage layer, the second storage layer and the third storage layer in the second preset period, and the access coefficients of the first storage layer and the second storage layer, the access hit rate of the data storage layer is determined.
[0238] According to the access times of the first storage layer and the second storage layer in the second preset period, and the data storage amount of the first storage layer and the data storage amount of the second storage layer, the access utilization rate of the data storage layer is determined.
[0239] In one embodiment, the processor executing the computer program also implements the following steps:
[0240] The first operation weight corresponding to the current access temperature is determined, and the second operation weight corresponding to the predicted access temperature is determined.
[0241] According to the first operation weight and the second operation weight, the current access temperature and the predicted access temperature are weighted and summed to obtain the mixed access temperature of the data to be processed.
[0242] In one embodiment, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to implement the following steps:
[0243] If the data storage period is reached, the to-be-processed data is obtained, wherein the to-be-processed data includes the stored data and / or the newly stored data;
[0244] According to the historical access record of the to-be-processed data, the current access temperature of the to-be-processed data is determined;
[0245] According to the data content of the to-be-processed data, the predicted access temperature of the to-be-processed data is determined;
[0246] According to the access temperature threshold, the current access temperature and the predicted access temperature of the to-be-processed data, the to-be-processed data is stored to the corresponding data storage layer.
[0247] In one embodiment, the computer program is executed by the processor to further implement the following steps:
[0248] According to the historical access record of the to-be-processed data in the first preset time period, the access time of the to-be-processed data in the first preset time period is determined;
[0249] According to the access time of the to-be-processed data in the first preset time period, the current access temperature of the to-be-processed data is determined.
[0250] In one embodiment, the computer program is executed by the processor to further implement the following steps:
[0251] According to the access time of the to-be-processed data in the first preset time period, the current access temperature of the to-be-processed data is determined by the cooling model.
[0252] In one embodiment, the computer program is executed by the processor to further implement the following steps:
[0253] The historical access record is updated according to a pre-set record update period.
[0254] In one embodiment, the computer program is executed by the processor to further implement the following steps:
[0255] The data content of the to-be-processed data is temperature predicted by the temperature prediction model to obtain the predicted access temperature of the to-be-processed data.
[0256] In one embodiment, the computer program is executed by the processor to further implement the following steps:
[0257] If the model training period is reached, the stored data and the corresponding current access temperature of the stored data are obtained;
[0258] According to the stored data and the corresponding current access temperature of the stored data, the weight parameters in the temperature prediction model are updated to obtain the trained temperature prediction model.
[0259] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0260] According to the current access temperature and the predicted access temperature, a mixed access temperature of the to-be-processed data is determined;
[0261] According to the mixed access temperature and the access temperature threshold interval, a data storage layer corresponding to the to-be-processed data is determined;
[0262] The to-be-processed data is stored to the corresponding data storage layer.
[0263] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0264] If the mixed access temperature is greater than an access upper limit threshold of the access temperature threshold interval, the data storage layer of the to-be-processed data is determined as the first storage layer;
[0265] If the mixed access temperature belongs to the access temperature threshold interval, the data storage layer of the to-be-processed data is determined as the second storage layer;
[0266] If the mixed access temperature is less than an access lower limit threshold of the access temperature threshold interval, the data storage layer of the to-be-processed data is determined as the third storage layer;
[0267] Wherein, the read-write efficiency of the first storage layer is greater than that of the second storage layer, and the read-write efficiency of the second storage layer is greater than that of the third storage layer.
[0268] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0269] If the access index of the data storage layer does not satisfy the index threshold, the access upper limit threshold and the access lower limit threshold are updated;
[0270] According to the updated access upper limit threshold and the access lower limit threshold, the access temperature threshold interval is adjusted.
[0271] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0272] According to the access frequencies of the first storage layer, the second storage layer and the third storage layer in the second preset period, and the access coefficients of the first storage layer and the second storage layer, an access hit rate of the data storage layer is determined;
[0273] According to the access frequencies of the first storage layer and the second storage layer in the second preset period, and the data storage amount of the first storage layer and the data storage amount of the second storage layer, an access utilization rate of the data storage layer is determined.
[0274] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0275] determine a first operation weight corresponding to the current access temperature, and determine a second operation weight corresponding to the predicted access temperature;
[0276] perform weighted sum processing on the current access temperature and the predicted access temperature according to the first operation weight and the second operation weight, to obtain a mixed access temperature of the to-be-processed data.
[0277] In an embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the following steps:
[0278] if a data storage period is reached, obtaining to-be-processed data, wherein the to-be-processed data comprises stored data and / or newly added stored data;
[0279] determining a current access temperature of the to-be-processed data according to historical access records of the to-be-processed data;
[0280] determining a predicted access temperature of the to-be-processed data according to data content of the to-be-processed data;
[0281] storing the to-be-processed data to a corresponding data storage layer according to an access temperature threshold, the current access temperature and the predicted access temperature of the to-be-processed data.
[0282] In an embodiment, the computer program, when executed by the processor, further implements the following steps:
[0283] determining an access time of the to-be-processed data within a first preset time period according to historical access records of the to-be-processed data within the first preset time period;
[0284] determining a current access temperature of the to-be-processed data according to the access time of the to-be-processed data within the first preset time period.
[0285] In an embodiment, the computer program, when executed by the processor, further implements the following steps:
[0286] determining a current access temperature of the to-be-processed data according to the access time of the to-be-processed data within the first preset time period by a cooling model.
[0287] In an embodiment, the computer program, when executed by the processor, further implements the following steps:
[0288] the historical access records are updated according to a pre-set record update period.
[0289] In an embodiment, the computer program, when executed by the processor, further implements the following steps:
[0290] The temperature prediction model is used to predict the temperature of the data content of the to-be-processed data, and a predicted access temperature of the to-be-processed data is obtained.
[0291] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0292] If the model training period is reached, the stored data and the current access temperature corresponding to the stored data are obtained;
[0293] According to the stored data and the current access temperature corresponding to the stored data, the weight parameters in the temperature prediction model are updated to obtain a trained temperature prediction model.
[0294] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0295] According to the current access temperature and the predicted access temperature, a mixed access temperature of the to-be-processed data is determined;
[0296] According to the mixed access temperature and the access temperature threshold interval, a data storage layer corresponding to the to-be-processed data is determined;
[0297] The to-be-processed data is stored in the corresponding data storage layer.
[0298] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0299] If the mixed access temperature is greater than the access upper limit threshold of the access temperature threshold interval, the data storage layer of the to-be-processed data is determined as the first storage layer;
[0300] If the mixed access temperature belongs to the access temperature threshold interval, the data storage layer of the to-be-processed data is determined as the second storage layer;
[0301] If the mixed access temperature is less than the access lower limit threshold of the access temperature threshold interval, the data storage layer of the to-be-processed data is determined as the third storage layer;
[0302] The read-write efficiency of the first storage layer is greater than that of the second storage layer, and the read-write efficiency of the second storage layer is greater than that of the third storage layer.
[0303] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0304] If the access index of the data storage layer does not satisfy the index threshold, the access upper limit threshold and the access lower limit threshold are updated;
[0305] According to the updated access upper limit threshold and the access lower limit threshold, the access temperature threshold interval is adjusted.
[0306] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0307] According to the access times of the first storage layer, the second storage layer and the third storage layer in the second preset period, and the access coefficients of the first storage layer and the second storage layer, the access hit rate of the data storage layer is determined.
[0308] According to the access times of the first storage layer and the second storage layer in the second preset period, and the data storage amount of the first storage layer and the data storage amount of the second storage layer, the access utilization rate of the data storage layer is determined.
[0309] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0310] The first operation weight corresponding to the current access temperature is determined, and the second operation weight corresponding to the predicted access temperature is determined;
[0311] According to the first operation weight and the second operation weight, the current access temperature and the predicted access temperature are weighted and summed to obtain the mixed access temperature of the to-be-processed data.
[0312] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.
[0313] Any combination of the technical features of the above embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist, it should be considered as the scope of the present application.
[0314] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of protection of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A data storage method, characterized by, The method comprises: if a data storage period is reached, obtaining to-be-processed data, wherein the to-be-processed data comprises stored data and / or newly stored data; determining a current access temperature of the to-be-processed data according to historical access records of the to-be-processed data; determining a predicted access temperature of the to-be-processed data according to data content of the to-be-processed data; storing the to-be-processed data to a corresponding data storage layer according to an access temperature threshold, the current access temperature and the predicted access temperature of the to-be-processed data, wherein the access temperature threshold is an interval formed by an upper access threshold and a lower access threshold; if an access index of the data storage layer does not satisfy an index threshold, updating the upper access threshold and the lower access threshold, wherein the access index of the data storage layer comprises an access hit rate and / or an access utilization rate; adjusting the access temperature threshold interval according to the updated upper access threshold and the lower access threshold; wherein the determination process of the access hit rate is as follows: Wherein, S refers to the access hit rate of the data storage layer, a h ,a w ,a c Respectively, the access times of the first storage layer, the second storage layer, the third storage layer, the data to be processed, a h Corresponding coefficient, β refers to a w Corresponding coefficient; wherein the determination process of the access utilization rate is as follows: Wherein, U refers to the access utilization rate of the data storage layer, a h ,a w refers to the access times of the first storage layer and the second storage layer, α refers to the a h corresponding coefficient, β refers to the a w corresponding coefficient, N h refers to the total number of the first storage layer containing the data to be processed, N w refers to the total number of the second storage layer containing the data to be processed.
2. The method of claim 1, wherein, the determination of the current access temperature of the to-be-processed data according to the historical access records of the to-be-processed data comprises: determining an access time of the to-be-processed data in a first preset time period according to historical access records of the to-be-processed data in the first preset time period; determining the current access temperature of the to-be-processed data according to the access time of the to-be-processed data in the first preset time period.
3. The method of claim 2, wherein, the determination of the current access temperature of the to-be-processed data according to the access time of the to-be-processed data in the first preset time period comprises: determining the current access temperature of the to-be-processed data according to the access time of the to-be-processed data in the first preset time period through a cooling model.
4. The method according to claim 1 or 2, characterized in that, the historical access records are updated according to a pre-set record update period.
5. The method of claim 1, wherein, the determination of the predicted access temperature of the to-be-processed data according to the data content of the to-be-processed data comprises: performing temperature prediction on the data content of the to-be-processed data through a temperature prediction model to obtain the predicted access temperature of the to-be-processed data.
6. The method of claim 5, wherein, the training process of the temperature prediction model comprises: if a model training period is reached, obtaining the stored data and a current access temperature corresponding to the stored data; updating weight parameters in the temperature prediction model according to the stored data and the current access temperature corresponding to the stored data to obtain a trained temperature prediction model.
7. The method of claim 1, wherein, the access temperature threshold is an access temperature threshold interval formed by an upper access threshold and a lower access threshold; storing the to-be-processed data to a corresponding data storage layer according to an access temperature threshold, the current access temperature and the predicted access temperature of the to-be-processed data, wherein the access temperature threshold is an interval formed by an upper access threshold and a lower access threshold; determining a mixed access temperature of the to-be-processed data according to the current access temperature and the predicted access temperature; determining a data storage layer corresponding to the to-be-processed data according to the mixed access temperature and the access temperature threshold interval; storing the to-be-processed data to the corresponding data storage layer.
8. The method of claim 7, wherein, the determination of a data storage layer corresponding to the to-be-processed data according to the mixed access temperature and the access temperature threshold interval comprises: If the mixed access temperature is greater than an access upper threshold of the access temperature threshold interval, a data storage layer of the to-be-processed data is determined as a first storage layer; If the mixed access temperature belongs to the access temperature threshold interval, a data storage layer of the to-be-processed data is determined as a second storage layer; If the mixed access temperature is less than an access lower threshold of the access temperature threshold interval, a data storage layer of the to-be-processed data is determined as a third storage layer. The read-write efficiency of the first storage layer is greater than that of the second storage layer, and the read-write efficiency of the second storage layer is greater than that of the third storage layer.
9. The method of claim 1, wherein, The predicted access temperature is used to represent a case of how many times the to-be-processed data is accessed in a future time period.
10. The method of claim 1, wherein, The index threshold includes a hit rate threshold corresponding to an access hit rate and a utilization threshold corresponding to an access utilization.
11. The method of claim 7, wherein, The method comprises the following steps of: determining a first operation weight corresponding to the current access temperature, and determining a second operation weight corresponding to the predicted access temperature; performing weighted sum processing on the current access temperature and the predicted access temperature according to the first operation weight and the second operation weight to obtain the mixed access temperature of the to-be-processed data.
12. A data storage device, characterized by The device comprises: an acquisition module, configured to acquire to-be-processed data if a data storage period is reached, wherein the to-be-processed data includes stored data and / or newly added stored data; a first determination module, configured to determine a current access temperature of the to-be-processed data according to historical access records of the to-be-processed data; a second determination module, configured to determine a predicted access temperature of the to-be-processed data according to data content of the to-be-processed data; a storage module, configured to store the to-be-processed data to a corresponding data storage layer according to an access temperature threshold, the current access temperature and the predicted access temperature of the to-be-processed data, wherein the access temperature threshold is an interval formed by an access upper threshold and an access lower threshold; if an access index of the data storage layer does not satisfy an index threshold, updating the access upper threshold and the access lower threshold, wherein the access index of the data storage layer includes an access hit rate and / or an access utilization; adjusting the access temperature threshold interval according to the updated access upper threshold and the access lower threshold; The determination process of the access hit rate is as follows: Wherein, S refers to the access hit rate of the data storage layer, a h ,a w ,a c Respectively, the access times of the first storage layer, the second storage layer, the third storage layer, the data to be processed, a h Corresponding coefficient, β refers to a w Corresponding coefficient; The determination process of the access utilization is as follows: wherein U refers to the access utilization rate of the data storage layer, a h ,a w refers to the access times of the first storage layer and the second storage layer for the data to be processed, a h corresponding coefficient, b refers to the access utilization rate of the data storage layer, a w corresponding coefficient, N h refers to the total number of the first storage layer containing the data to be processed, N w refers to the total number of the second storage layer containing the data to be processed.
13. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor executes the computer program to implement the steps of the method in any one of claims 1 to 11.
14. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 11.
15. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 11.
Citation Information
Patent Citations
Data storage method and device based on distributed storage system, equipment and medium
CN113391765A
Method and device for controlling solid state disk
CN114442963A
Data access defense method and system in hierarchical network
CN115277228A