Data storage method, device, computer equipment and storage medium

By dynamically adjusting the data storage location, the problem of waste of storage space caused by fixed cold and hot data capacity ratio in the hierarchical storage structure is solved, and the flexibility and security of data storage are improved, and it is suitable for data storage scenarios in different industries.

CN113377781BActive Publication Date: 2024-12-10INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110784013.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-12
Publication Date
2024-12-10
Estimated Expiration
2041-07-12

Smart Images

  • Figure CN113377781B_ABST
    Figure CN113377781B_ABST
Patent Text Reader

Abstract

This article provides a data storage method, device, computer equipment and storage medium, which relates to the field of big data technology and can be used in the financial field. The method includes: determining the thermal attribute of the data to be stored, the thermal attribute is one of hot data, warm data or cold data; if the thermal attribute of the data to be stored is hot data, then determining whether the occupancy rate of the hot data storage unit is less than a first threshold; if the occupancy rate of the hot data storage unit is greater than or equal to the first threshold, then storing the data to be stored in a first buffer; if the occupancy rate of the hot data storage unit is less than the first threshold, then storing the data to be stored in the hot data storage unit. This article avoids the collapse of the hot data storage unit due to reaching the limit of its storage capacity by setting a first buffer, thereby improving the security and reliability of data storage; it also avoids the data storage pollution problem caused by the high occupancy rate of the hot data storage unit and the failure to meet the hot data storage demand.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of big data technology and can be used in the financial field, in particular to a data storage method, device, computer equipment and storage medium. Background Art

[0002] In the era of big data where the amount of data is exploding, data storage faces huge challenges. In the prior art, data is often divided into hot data (i.e. frequently accessed data) and cold data (infrequently accessed data) according to the access frequency of the data, and then hot data and cold data are stored in a hierarchical storage structure to avoid storage resource waste and storage pollution caused by cold data residing in high-performance storage tiers.

[0003] However, data storage scenarios vary from industry to industry, and the proportion of cold and hot data varies. In the existing hierarchical storage structure, the storage capacity ratio of hot data and cold data is generally fixed. The hierarchical storage structure with a fixed ratio may not be well adapted to different industries and fields. If the ratio of cold and hot data capacity in the hierarchical storage structure is significantly different from the ratio of cold and hot data in the industry, it will cause a waste of storage space.

[0004] In view of the above-mentioned defects in the prior art, this article aims to provide a data storage method, apparatus, computer equipment and storage medium, which can dynamically store various types of data in a hierarchical manner and improve the flexibility of data storage. Summary of the invention

[0005] In view of the above-mentioned problems in the prior art, the purpose of this article is to provide a data storage method, apparatus, computer equipment and storage medium to solve the problem of storage space waste caused by the fact that the hierarchical storage structure with fixed storage capacity in the prior art cannot be applied to data storage scenarios in various industries.

[0006] In order to solve the above technical problems, the specific technical solutions of this article are as follows:

[0007] In one aspect, the present invention provides a data storage method, comprising:

[0008] Determining a thermal attribute of the data to be stored, wherein the thermal attribute is one of hot data, warm data, or cold data;

[0009] If the heat attribute of the data to be stored is hot data, determining whether the occupancy rate of the hot data storage unit is less than a first threshold;

[0010] If the occupancy rate of the hot data storage unit is greater than or equal to a first threshold, storing the data to be stored in a first buffer;

[0011] If the occupancy rate of the hot data storage unit is less than a first threshold, the data to be stored is stored in the hot data storage unit.

[0012] Specifically, after storing the data to be stored in the first buffer, the method further includes:

[0013] Determining whether the occupancy rate of the first buffer is less than a first threshold;

[0014] If the occupancy rate of the first buffer is greater than or equal to a first threshold value, the hot data storage unit is expanded.

[0015] Further, determining the heat attribute of the data to be stored includes:

[0016] Acquire the access frequency and source information of the data to be stored, wherein the source information includes industry information, system information and application information;

[0017] The heat attribute of the data to be stored is determined according to the access frequency and the source information.

[0018] Specifically, the method further includes:

[0019] Acquire first stored data in the thermal data storage unit;

[0020] determining, according to the access frequency and source information of the first stored data, whether the heat attribute of the first stored data is still hot data;

[0021] If the heat attribute of the first stored data is warm data or cold data, the first stored data is migrated to a warm data storage unit or a cold data storage unit.

[0022] Furthermore, after migrating the first stored data to the warm data storage unit or the cold data storage unit, the method further includes:

[0023] Determine whether the occupancy rate of the thermal data storage unit is less than the first threshold;

[0024] If the occupancy rate of the hot data storage unit is less than the first threshold, the data stored in the first buffer is transferred to the hot data storage unit.

[0025] Specifically, the method further includes:

[0026] If the heat attribute of the data to be stored is warm data, determining whether the occupancy rate of the warm data storage unit is less than a second threshold;

[0027] If the occupancy rate of the warm data storage unit is greater than or equal to a second threshold, storing the data to be stored in a second buffer;

[0028] If the occupancy rate of the warm data storage unit is less than a second threshold, the data to be stored is stored in the warm data storage unit.

[0029] Furthermore, the method further comprises:

[0030] Acquire second stored data in the warm data storage unit;

[0031] determining, according to the access frequency and source information of the second stored data, whether the thermal attribute of the second stored data is still warm data;

[0032] If the thermal attribute of the second stored data is hot data or cold data, the second stored data is migrated to the hot data storage unit or the cold data storage unit.

[0033] Specifically, the method further includes:

[0034] If the heat attribute of the data to be stored is cold data, the data to be stored is stored in a cold data storage unit.

[0035] On the other hand, the present invention also provides a data storage device, comprising:

[0036] A determination module, used to determine the thermal attribute of the data to be stored, wherein the thermal attribute is one of hot data, warm data or cold data;

[0037] A judging module, configured to judge whether the occupancy rate of the hot data storage unit is less than a first threshold value when the heat attribute of the data to be stored is hot data;

[0038] A first storage module, configured to store the data to be stored in a first buffer when the occupancy rate of the hot data storage unit is greater than or equal to a first threshold;

[0039] The second storage module is configured to store the data to be stored in the thermal data storage unit when the occupancy rate of the thermal data storage unit is less than a first threshold.

[0040] On the other hand, this document also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the data storage method provided by the above technical solution is implemented.

[0041] On the other hand, this document also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the data storage method provided by the above technical solution.

[0042] By adopting the above technical scheme, a data storage method, device, computer equipment and storage medium described in this article can overcome the problems of narrow adaptability and easy waste of storage resources caused by the fixed ratio of storage capacity of the existing magneto-optical hierarchical structure; this article realizes flexible and dynamic storage of hot data by setting a first buffer zone, avoids the collapse caused by the hot data storage unit reaching its storage capacity limit, and improves the security and reliability of data storage.

[0043] In order to make the above and other purposes, features and advantages of this article more obvious and easy to understand, the following specifically cites preferred embodiments and describes them in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solutions in the embodiments of this article or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of this article. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0045] Figure 1 A schematic diagram showing a data storage structure provided by an embodiment of the present invention is shown;

[0046] Figure 2 A schematic diagram of a data storage method provided in an embodiment of the present invention is shown;

[0047] Figure 3 A schematic diagram of a process for determining the thermal attribute of data to be stored is shown;

[0048] Figure 4 A schematic flow chart of a method for processing first stored data is shown;

[0049] Figure 5 A schematic flow chart of a method for storing data with a thermal attribute of warm data is shown;

[0050] Figure 6 A schematic flow chart of a method for processing second stored data is shown;

[0051] Figure 7 A schematic diagram of the structure of a data storage device provided in an embodiment of this invention is shown;

[0052] Figure 8 A schematic diagram of the structure of a computer device provided in an embodiment of this invention is shown.

[0053] Description of the accompanying symbols:

[0054] 10. Thermal data storage unit;

[0055] 20. First buffer zone;

[0056] 30. Warm data storage unit;

[0057] 40. Second buffer zone;

[0058] 50. Cold data storage unit;

[0059] 60. Data statistics unit;

[0060] 71. Determination module;

[0061] 72. Judgment module;

[0062] 73. A first storage module;

[0063] 74. A second storage module;

[0064] 802. Computer equipment;

[0065] 804, processor;

[0066] 806. Memory;

[0067] 808, driving mechanism;

[0068] 810, input / output module;

[0069] 812. Input device;

[0070] 814. Output device;

[0071] 816. Presentation equipment;

[0072] 818. Graphical user interface;

[0073] 820, network interface;

[0074] 822, communication link;

[0075] 824. Communication bus. DETAILED DESCRIPTION

[0076] The following will be combined with the drawings in the embodiments of this article to clearly and completely describe the technical solutions in the embodiments of this article. Obviously, the described embodiments are only part of the embodiments of this article, not all of the embodiments. Based on the embodiments of this article, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this article.

[0077] It should be noted that the terms "first", "second", etc. in the specification and claims of this article and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of this article described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0078] In the era of big data where the amount of data is exploding, data storage faces huge challenges, which are mainly restricted by the storage time, storage performance and storage cost of the storage medium. The average life of hard disks and solid-state disks is 5 years; the average life of magnetic disks is 10 years, but magnetic storage media are easily damaged by electromagnetic radiation, so they have high requirements for the storage environment. Affected by storage performance, data stored on hard disks, solid-state disks or magnetic disks needs to be copied or backed up every few years, which will create the risk of data loss, reduce data security and cause high storage costs.

[0079] Therefore, in the prior art, data is divided into hot data and cold data according to the access frequency of the data. When the data volume is large, warm data (i.e., data with an access frequency between hot data and cold data) can also be divided, and then hot data, warm data, and cold data are stored in different storage media of the hierarchical storage structure. For example: hot data is stored in a solid-state disk, warm data is stored in a hard disk, and cold data is stored in an optical disk. However, once the hierarchical storage structure is manufactured, the storage space of the three storage media is fixed. For example, the solid-state disk, hard disk, and optical disk account for 10%, 20%, and 70% of the total storage capacity, respectively. However, in actual application scenarios, the data storage scenarios of various industries are different, and the proportions of hot, warm, and cold data are also different. When the proportion of data at all levels in a certain industry field is greatly different from the ratio of the storage capacity at all levels in the hierarchical storage structure, it will cause relative waste of storage space at all levels and increase storage costs.

[0080] In order to solve the above problems, the embodiment of this article provides a data storage structure, such as Figure 1 As shown, it may include:

[0081] A thermal data storage unit 10, used to store thermal data;

[0082] A warm data storage unit 30, used to store warm data;

[0083] A cold data storage unit 50, used for storing cold data;

[0084] A first buffer 20, for storing hot data when the occupancy rate of the hot data storage unit is greater than or equal to a first threshold;

[0085] and a second buffer 40 for storing warm data when the occupancy rate of the warm data storage unit is greater than or equal to a second threshold.

[0086] The first buffer 20 may be a space divided from the thermal data storage unit 10, or may be a space independent of the thermal data storage unit 10; the first buffer 20 and the thermal data storage unit 10 may use a solid state disk. In some feasible embodiments, a memory may also be used to store thermal data, that is, the memory is used for the thermal data storage unit 10 and / or the first buffer 20.

[0087] The second buffer 40 is similar to the first buffer 20, that is, the second buffer 40 can be a space divided from the warm data storage unit 30, or it can be a space independent of the warm data storage unit 30; in the embodiment of this specification, the second buffer 40 and the warm data storage unit 30 can use a hard disk.

[0088] An optical disc is a device that uses the laser principle to read and write, and can be used to store various data such as text, sound, and images, and has a long preservation time. Therefore, in the embodiment of this specification, an optical disc is preferably used as the cold data storage unit 50. In some feasible embodiments, a third buffer may also be provided, and when the occupancy rate of the cold data storage unit 50 is greater than or equal to a preset threshold, the cold data is temporarily stored in the third buffer.

[0089] In addition, the data storage structure may also include a data statistics unit 60, which is connected to the hot data storage unit 10, the warm data storage unit 30 and the cold data storage unit 50, and is used to count the occupancy of the hot data storage unit 10, the warm data storage unit 30 and the cold data storage unit 50; and is also used to be connected to the first buffer zone 20 and the second buffer zone 40, and is used to count the occupancy of the first buffer zone 20 and the second buffer zone 40.

[0090] Based on the above storage structure, the embodiments of this article provide a data storage method, device, computer equipment and storage medium, which can play a role of dynamic hierarchical storage for various types of data and improve the flexibility of data storage. It should be noted that the data storage method, device, computer equipment and storage medium provided in this article can be used in the financial field, and can also be used in any field other than the financial field. This article does not limit the application field of the method, device, computer equipment and storage medium. Figure 2This is a flowchart of a data storage method provided in the embodiments of this article. This specification provides method operation steps as described in the embodiments or flowcharts, but may include more or fewer operation steps based on conventional or non-creative labor. The order of steps listed in the embodiments is only one way of executing the steps among many orders, and does not represent the only order of execution. When the actual system or device product is executed, it can be executed in the order or in parallel according to the method shown in the embodiments or drawings. Specifically, Figure 2 As shown, the method may include:

[0091] S110: Determine the thermal attribute of the data to be stored, where the thermal attribute is one of hot data, warm data, or cold data;

[0092] S120: If the heat attribute of the data to be stored is hot data, determine whether the occupancy rate of the hot data storage unit is less than a first threshold;

[0093] The first threshold value may be pre-set according to the storage capacity of the thermal data storage unit, for example, 70%. Of course, it may also be set to other proportional values ​​such as 90% according to actual use requirements.

[0094] S130: If the occupancy rate of the hot data storage unit is greater than or equal to a first threshold, storing the data to be stored in a first buffer;

[0095] The storage capacity of the first buffer zone can be set according to the data storage requirement and the migration requirement of the stored data. Exemplarily, the storage capacity of the first buffer zone is approximately 30% of the storage capacity of the hot data storage unit.

[0096] S140: If the occupancy rate of the hot data storage unit is less than a first threshold, storing the data to be stored in the hot data storage unit.

[0097] The embodiments of the present specification provide a data storage method, which can store the to-be-stored data with a thermal attribute of hot data in a first buffer when the occupancy rate of a hot data storage unit is high, so as to avoid the hot data storage unit reaching the limit of its storage capacity and causing collapse, thereby improving the security and reliability of data storage and avoiding data loss; the setting of the first buffer makes the storage space more flexible for hot data, thereby eliminating the need to set the storage structure according to different storage scenarios, making the data storage structure more adaptable and more widely applicable; it also avoids the problem of data storage pollution caused by the high occupancy rate of the hot data storage unit and the failure to meet the hot data storage demand.

[0098] In some optional embodiments, after storing the data to be stored in the first buffer in step S130, the method may further include:

[0099] Determining whether the occupancy rate of the first buffer is less than a first threshold;

[0100] If the occupancy rate of the first buffer zone is greater than or equal to a first threshold value, the hot data storage unit is expanded.

[0101] Since the hot data to be stored is preferably stored in the first buffer only when the occupancy rate of the hot data storage unit is greater than or equal to the first threshold value, therefore, when the occupancy rate of the first buffer is greater than or equal to the first threshold value, it can be known that the remaining capacity of the hot data storage unit is also small (the occupancy rate reaches the first threshold value) and remains for a period of time (the data needs to be continuously stored in the first buffer to make the occupancy rate of the first buffer reach the first threshold value). Therefore, in the embodiments of this specification, it is only necessary to determine the remaining capacity of the first buffer to obtain the remaining capacity of the hot data storage unit, which greatly simplifies the process; when it is determined that the storage capacity of the hot data storage unit continues to remain low, the hot data storage unit is expanded.

[0102] In the embodiments of this specification, Figure 3 As shown, step S110: determining the heat attribute of the data to be stored may include:

[0103] S210: Obtain access frequency and source information of the data to be stored, where the source information may include industry information, system information, and application information.

[0104] It should be noted that the access frequency described in the embodiments of this specification can be set according to actual needs, and the start time and the end time can be set to calculate the access frequency during the period from the start time to the end time. The start time can be set as needed, for example, it can be set to the first access time of the data to be stored or a specific time (accurate to the hour); the end time can be set to the last access time of the data to be stored or another specific time (that is, the end time should be different from the start time, and the end time should be after the start time), and the number of accesses is counted to calculate the access frequency of the data to be stored. For example, the access frequency of the data to be stored data1 is calculated to be 100 times / day based on the first access time and the last access time. The above-mentioned measurement unit for the access frequency of the data to be stored is only exemplary. In some other embodiments, other statistical units such as times / month can also be used. In the embodiments of this specification, information such as the first access time, the last access time and the access frequency of the data to be stored and the source information can be obtained from the database log.

[0105] For data to be stored in different industries and fields, the measurement standards for their heat attributes are not the same. For example, for data data1 to be stored in the banking and financial field, when its access frequency reaches 200 times / day, its heat attribute can be judged as hot data; for data data2 to be stored in the medical field, when its access frequency reaches 40 times / day, its heat attribute can be judged as hot data. Not only that, for data to be stored in the banking and financial field, when the data source system is different or the application is different, the heat attribute judgment standard for the data to be stored may also be different. It should be noted that the above judgment conditions are only exemplary and are not used to limit the present invention.

[0106] S220: Determine the heat attribute of the data to be stored according to the access frequency and the source information.

[0107] In addition, the process may also include obtaining the associated information of the data to be stored, and determining the heat attribute of the data to be stored according to the access frequency, source information and associated information. Since data are usually interrelated, if the heat attributes of other data associated with the data to be stored data1 are all hot data or a large proportion of them are hot data, then the heat attribute of data1 can also be determined to be hot data.

[0108] It may also include obtaining the security level of the data to be stored, and determining the thermal attribute of the data to be stored according to the access frequency, source information and the security level. Generally, the higher the security level of the data, the colder its thermal attribute.

[0109] That is, in the embodiments of the present specification, the thermal attributes of the data to be stored can be judged by one or a combination of associated information, security level, and access frequency and source information, thereby improving the richness of parameters for judging the thermal attributes of the stored data, which is beneficial to improving the accuracy of judging the thermal attributes of the data and the accuracy of hierarchical storage of data, and avoiding contamination of data in storage units at all levels due to errors in thermal attribute judgment.

[0110] In the embodiments of this specification, Figure 4 As shown, the method may also include:

[0111] S310: Acquire first stored data in the hot data storage unit.

[0112] S320: Determine, based on the access frequency and source information of the first stored data, whether the heat attribute of the first stored data is still hot data.

[0113] It should be noted that the criterion for determining whether the first stored data is still hot data here may be the same as or different from the determination condition when the first stored data is stored in the aforementioned step (i.e., when the first stored data is used as data to be stored). On the one hand, considering the era of big data, the amount of data access will be affected by the explosive growth of data volume. For example, when a piece of data is just stored in a data storage structure provided in an embodiment of this specification, the data under the source information may be determined to be hot data if the access frequency reaches 100 times per day at that time, but as time goes by, the data under the same source information must reach an access frequency of 110 times per day to be determined to be hot data, so the determination conditions may be different. In other words, in the embodiment of this specification, the condition for defining whether the data under the same source is hot data (warm data or cold data) by the access frequency is advancing with the times.

[0114] On the other hand, the calculation conditions of the access frequency can be the same or different. For example, when the data is just stored in the data storage structure, the access frequency is calculated based on the first access time and the last access time, and its heat attribute is determined based on the access frequency. Assuming that the data has not been accessed since it was stored in the data storage structure until the current time node, if its access frequency is still calculated based on its last access time, it will be found that the access frequency of the data has not changed, and the heat attribute has not changed. In fact, since the data has not been accessed for a long time, the heat attribute has obviously decreased. Therefore, at this time, the access frequency of the data should be recalculated based on the current time node (or an updated time node), and its heat attribute should be re-evaluated.

[0115] Therefore, in some feasible embodiments, when determining whether the heat attribute of the first stored data is still hot data, preferably, the time when the first stored data is stored or the first access time is selected as the start time, and the current time node is selected as the end time, and the access frequency of the first stored data is calculated according to the start time and the end time and the number of accesses between the two, and then the heat attribute of the first stored data is determined according to the access frequency and the source information of the first stored data.

[0116] As the storage time accumulates, the heat attribute of the first stored data may change.

[0117] S330: If the heat attribute of the first stored data is warm data or cold data, migrate the first stored data to a warm data storage unit or a cold data storage unit.

[0118] Since the storage media of the warm data storage unit and the cold data storage unit are different, in fact, the means of migrating data from the hot data storage unit to the warm data storage unit or the cold data storage unit are also different, but they are not described in detail here.

[0119] Of course, the thermal attribute of the first stored data may not change. In this case, the first stored data is still stored in the hot data storage unit.

[0120] It should be noted that, for the step of determining whether the first stored data is still hot data, its execution frequency or time interval can be set to automatically migrate the data in the hot data storage unit that is no longer hot data.

[0121] The conditions for executing the above steps may also be set, for example, when it is determined that the occupancy rate of the hot data storage unit is greater than or equal to the first threshold, the data in the hot data storage unit is automatically checked and migrated to see if it is still hot data. The execution frequency may also be combined with the execution condition to reserve space for the hot data storage unit and provide services for the data to be stored.

[0122] Further, after migrating the first stored data to the warm data storage unit or the cold data storage unit in step S330, the method may further include:

[0123] determining whether the occupancy rate of the thermal data storage unit is less than the first threshold;

[0124] If the occupancy rate of the hot data storage unit is less than the first threshold, the data stored in the first buffer is transferred to the hot data storage unit.

[0125] Since part of the data in the hot data storage unit may be migrated to the warm data storage unit or the cold data storage unit, the occupancy rate of the hot data storage unit will be reduced. At this time, the hot data in the first buffer zone can be transferred to the hot data storage unit to reserve the storage capacity of the first buffer zone, so that the hot data storage unit and the first buffer zone maintain a dynamic balance.

[0126] Similar to the method for storing hot data, the embodiment of the present specification may also include a step of storing the data to be stored that is determined to be warm data, such as Figure 5 As shown, the method includes:

[0127] S410: If the heat attribute of the data to be stored is warm data, determine whether the occupancy rate of the warm data storage unit is less than a second threshold;

[0128] The second threshold value can be set to 70% of the total storage capacity of the warm data storage unit according to actual needs. Of course, it can also be set to other proportional values.

[0129] S420: If the occupancy rate of the warm data storage unit is greater than or equal to a second threshold, storing the data to be stored in a second buffer;

[0130] S430: If the occupancy rate of the warm data storage unit is less than a second threshold, storing the data to be stored in the warm data storage unit.

[0131] An embodiment of the present specification provides a data storage method. When the occupancy rate of a warm data storage unit is high, data to be stored with a heat attribute of warm data is stored in a second buffer to avoid a crash caused by the warm data storage unit reaching the limit of its storage capacity. The setting of the second buffer makes the storage space more flexible for warm data.

[0132] Furthermore, if Figure 6 As shown, the method may also include:

[0133] S510: Acquire second stored data in the warm data storage unit;

[0134] S520: judging whether the thermal attribute of the second stored data is still warm data according to the access frequency and source information of the second stored data;

[0135] S530: If the thermal attribute of the second stored data is hot data or cold data, migrate the second stored data to the hot data storage unit or the cold data storage unit.

[0136] Similar to the first stored data in the hot data storage unit, the thermal attribute of the second stored data stored in the warm data storage unit may have changed. When it is no longer warm data, it is migrated to the hot data storage unit or the cold data storage unit according to its updated thermal attribute. Here, when obtaining the updated thermal attribute of the second stored data, preferably, the current time node is used as a reference to calculate its access frequency, and the updated thermal attribute of the second stored data is determined according to the determination condition of the thermal attribute that keeps pace with the times. If the thermal attribute of the second stored data is still warm data, the second stored data will continue to be stored in the warm data storage unit.

[0137] Slightly different from the first stored data, if the heat attribute of the first stored data changes, it must decrease; while the heat attribute of the second stored data may become hotter or colder, that is, it may develop in two directions.

[0138] If the thermal attribute of the second stored data is changed to warm data, the changed second stored data is used as new data to be stored, and it is determined whether to store it in the first buffer or the hot data storage space. Correspondingly, when the thermal attribute of the first stored data is changed to warm data, it is also necessary to determine the occupancy of the warm data storage unit, so as to store the first stored data with changed thermal attribute in the second buffer or the warm data storage unit, so as to achieve a dynamic balance of data storage in the entire data storage structure.

[0139] Of course, the heat attribute of the data to be stored may also be cold data. Therefore, the data storage method provided in the embodiment of this specification may also include:

[0140] If the heat attribute of the data to be stored is cold data, the data to be stored is stored in a cold data storage unit.

[0141] Based on the technical solution of a data storage method provided in an embodiment of this specification, a third buffer zone may be provided for the storage of cold data. The storage method of cold data may refer to the storage of hot data and warm data described above, which will not be described in detail here.

[0142] In summary, the data storage method provided in the embodiments of the present specification can not only realize the hierarchical storage of data, so that the thermal properties of the data are adapted to the performance of the storage medium, and avoid storage pollution caused by confusion in data storage at all levels; but also provide dynamic storage space for hot data and warm data; it has a wider scope of application, and can be applied to data storage scenarios in various industries, reducing the production and manufacturing costs of hierarchical data storage structures.

[0143] Based on the same inventive concept, the embodiment of this specification also provides a data storage device, such as Figure 7 As shown, the device may include:

[0144] A determination module 71, used to determine the thermal attribute of the data to be stored, wherein the thermal attribute is one of hot data, warm data or cold data;

[0145] A judging module 72, configured to judge whether the occupancy rate of the hot data storage unit is less than a first threshold value when the heat attribute of the data to be stored is hot data;

[0146] A first storage module 73, configured to store the data to be stored in a first buffer when the occupancy rate of the hot data storage unit is greater than or equal to a first threshold;

[0147] The second storage module 74 is configured to store the data to be stored in the thermal data storage unit when the occupancy rate of the thermal data storage unit is less than a first threshold.

[0148] The beneficial effects obtained by the device provided in the embodiments of this specification are consistent with the beneficial effects obtained by the above method and will not be repeated here.

[0149] like Figure 8 As shown, a computer device provided in an embodiment of the present invention, the computer device 802 may include one or more processors 804, such as one or more central processing units (CPUs), and each processing unit may implement one or more hardware threads. The computer device 802 may also include any memory 806, which is used to store any kind of information such as code, settings, data, etc. Non-restrictive, for example, the memory 806 may include any one or more combinations of the following: any type of RAM, any type of ROM, flash memory device, hard disk, optical disk, etc. More generally, any memory may use any technology to store information. Further, any memory may provide volatile or non-volatile retention of information. Further, any memory may represent a fixed or removable component of the computer device 802. In one case, when the processor 804 executes an associated instruction stored in any memory or a combination of memories, the computer device 802 may perform any operation of the associated instruction. The computer device 802 also includes one or more drive mechanisms 808 for interacting with any memory, such as a hard disk drive mechanism, an optical disk drive mechanism, etc.

[0150] The computer device 802 may also include an input / output module 810 (I / O) for receiving various inputs (via input devices 812) and for providing various outputs (via output devices 814). A specific output mechanism may include a presentation device 816 and an associated graphical user interface 818 (GUI). In other embodiments, the input / output module 810 (I / O), the input device 812, and the output device 814 may not be included, and the computer device 802 may be used as a computer device in a network. The computer device 802 may also include one or more network interfaces 820 for exchanging data with other devices via one or more communication links 822. One or more communication buses 824 couple the components described above together.

[0151] The communication link 822 may be implemented in any manner, for example, through a local area network, a wide area network (e.g., the Internet), a point-to-point connection, etc., or any combination thereof. The communication link 822 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc. governed by any protocol or combination of protocols.

[0152] Corresponds to Figure 2-Figure 6The method in this article also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above method are executed.

[0153] The embodiment of the present invention also provides a computer readable instruction, wherein when the processor executes the instruction, the program therein causes the processor to execute the following Figures 2 to 6 The method shown.

[0154] It should be understood that in the various embodiments of this document, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this document.

[0155] It should also be understood that in the embodiments of this article, the term "and / or" is only a description of the association relationship of the associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0156] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this article.

[0157] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0158] In the several embodiments provided herein, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, or can be electrical, mechanical or other forms of connection.

[0159] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of this article.

[0160] In addition, each functional unit in each embodiment of this invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of software functional unit.

[0161] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this article is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of this article. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

[0162] Specific embodiments are used in this article to illustrate the principles and implementation methods of this article. The description of the above embodiments is only used to help understand the methods and core ideas of this article. At the same time, for general technicians in this field, according to the ideas of this article, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on this article.

Claims

1. A data storage method, characterized in that: include Determining a thermal attribute of the data to be stored, the thermal attribute being one of hot data, warm data, or cold data; If the heat attribute of the data to be stored is hot data, determining whether the occupancy rate of the hot data storage unit is less than a first threshold; If the occupancy rate of the hot data storage unit is greater than or equal to a first threshold, the data to be stored is stored in a first buffer, and it is determined whether the occupancy rate of the first buffer is less than a first threshold value; if the occupancy rate of the first buffer is greater than or equal to the first threshold value, the hot data storage unit is expanded; If the occupancy rate of the hot data storage unit is less than a first threshold, storing the data to be stored in the hot data storage unit; If the heat attribute of the data to be stored is warm data, determining whether the occupancy rate of the warm data storage unit is less than a second threshold; If the occupancy rate of the warm data storage unit is greater than or equal to a second threshold, storing the data to be stored in a second buffer; If the occupancy rate of the warm data storage unit is less than a second threshold, storing the data to be stored in the warm data storage unit; If the heat attribute of the data to be stored is cold data, the data to be stored is stored in a cold data storage unit.

2. The method according to claim 1, characterized in that The determining the heat attribute of the data to be stored includes: Acquire the access frequency and source information of the data to be stored, wherein the source information includes industry information, system information and application information; The heat attribute of the data to be stored is determined according to the access frequency and the source information.

3. The method according to claim 1, characterized in that The method further comprises: Acquire first stored data in the thermal data storage unit; determining, according to the access frequency and source information of the first stored data, whether the heat attribute of the first stored data is still hot data; If the heat attribute of the first stored data is warm data or cold data, the first stored data is migrated to a warm data storage unit or a cold data storage unit.

4. The method according to claim 3, characterized in that After migrating the first stored data to a warm data storage unit or a cold data storage unit, the method further includes: Determine whether the occupancy rate of the thermal data storage unit is less than the first threshold; If the occupancy rate of the hot data storage unit is less than the first threshold, the data stored in the first buffer is transferred to the hot data storage unit.

5. The method according to claim 1, characterized in that The method further comprises: Acquire second stored data in the warm data storage unit; determining, according to the access frequency and source information of the second stored data, whether the thermal attribute of the second stored data is still warm data; If the thermal attribute of the second stored data is hot data or cold data, the second stored data is migrated to the hot data storage unit or the cold data storage unit.

6. A data storage device, characterized in that: include: A determination module, used to determine the thermal attribute of the data to be stored, wherein the thermal attribute is one of hot data, warm data or cold data; A judging module, configured to judge whether the occupancy rate of the hot data storage unit is less than a first threshold value when the heat attribute of the data to be stored is hot data; A first storage module, configured to store the data to be stored in a first buffer when the occupancy rate of the hot data storage unit is greater than or equal to a first threshold, and determine whether the occupancy rate of the first buffer is less than a first threshold value; if the occupancy rate of the first buffer is greater than or equal to the first threshold value, expand the hot data storage unit; A second storage module, configured to store the data to be stored in the thermal data storage unit when the occupancy rate of the thermal data storage unit is less than a first threshold; a warm data storage unit determination module, configured to determine whether the occupancy rate of the warm data storage unit is less than a second threshold value when the thermal attribute of the data to be stored is warm data; A third storage module, configured to store the data to be stored in a second buffer when the occupancy rate of the warm data storage unit is greater than or equal to a second threshold; A fourth storage module is used to store the data to be stored in the warm data storage unit when the occupancy rate of the warm data storage unit is less than a second threshold value. The fifth storage module is used to store the data to be stored in a cold data storage unit if the heat attribute of the data to be stored is cold data.

7. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.