Data storage method, system and device for distributed storage system, and storage medium

By dividing hard disk clusters in the distributed storage system and managing hard disks according to data type and wear degree, the problem of poor durability of QLC hard disks is solved, global wear balancing and hard disk usage balance are achieved, and operation and maintenance costs are reduced.

WO2024187900A1PCT designated stage expired Publication Date: 2024-09-19LANGCHAO ELECTRONIC INFORMATION IND CO LTD

Patent Information

Application Number
PCT/CN2023/141779
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-15
Filing Date
2023-12-26
Publication Date
2024-09-19

AI Technical Summary

Technical Problem

In distributed storage systems, the poor durability and low performance of QLC solid-state drives lead to uneven disk usage. Frequent replacement of hard disks increases operation and maintenance costs, and wear leveling has limited effect within a single hard disk.

Method used

By dividing the distributed storage system into multiple hard disk clusters, each cluster contains multiple hard disks of the same model, and dividing the hard disk cluster status according to the data type and wear degree, and giving priority to writing data to the hard disk cluster with low wear degree, it is realized Global wear leveling.

Benefits of technology

It effectively improves the durability of hard disks, reduces the need for frequent replacement of hard disks, reduces operation and maintenance costs, and achieves high cost performance of distributed storage systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023141779_19092024_PF_FP_ABST
    Figure CN2023141779_19092024_PF_FP_ABST
Patent Text Reader

Abstract

The present application is applied to the technical field of storage. Disclosed are a data storage method, system and device for a distributed storage system, and a storage medium. The distributed storage system comprises a plurality of hard disk clusters, wherein one hard disk cluster comprises a plurality of hard disks which have the same model number and are all added in the same batch to the distributed storage system. The method comprises: receiving data to be written, and determining the data type thereof; when the data type of said data is an ith data type, determining whether there is a hard disk cluster in an ith state currently; if there is a hard disk cluster in the ith state, selecting one hard disk cluster in the ith state; and writing said data into the selected hard disk cluster in the ith state, wherein the lower an estimated value of the number of times that said data is modified within a first duration, the higher the wear degree of the hard disk cluster into which said data is written. By applying the solution of the present application, the global wear balance of a distributed storage system is realized, the durability of a hard disk is ensured, and the situation in which a bad disk is frequently replaced is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Data storage method, system, device and storage medium of distributed storage system

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on March 15, 2023, with application number 202310247233.0, and entitled “Data storage method, system, device and storage medium for distributed storage system”, the entire contents of which are incorporated by reference into this application. Technical Field

[0003] The present application relates to the field of storage technology, and in particular to a data storage method, system, device and storage medium of a distributed storage system. Background Art

[0004] Flash memory media has undergone four generations of development. Currently, TLC (Triple Level Cell) is widely used, and QLC (Quad Level Cell) is about to enter mass production. Each generation boasts higher data density, lower price, lower endurance, lower performance, and improved energy efficiency compared to the previous one. These characteristics are determined by the physical properties of flash memory. However, QLC has two major drawbacks: low performance and poor endurance. Regarding poor endurance, namely the rapidly declining P / E (Program / Erase cycle), the current approach is to perform wear leveling within an SSD (Solid-State Drive). The current P / E of QLC has dropped to around 1000, but this approach has limited effectiveness in distributed systems, where tens of thousands of QLC SSDs exist, and the amount of data written to each disk is uneven. Due to the differences between new and old disks, some disks fail quickly, while others can last a long time. This negates the low cost of QLC, and the frequent replacement of failed disks increases operation and maintenance costs.

[0005] Summary of the Invention

[0006] The purpose of this application is to provide a data storage method, system, device and storage medium for a distributed storage system, so as to effectively improve the durability of hard disks and avoid frequent replacement of bad disks.

[0007] To solve the above technical problems, this application provides the following technical solutions:

[0008] A data storage method for a distributed storage system includes multiple hard disk clusters, each hard disk cluster includes multiple hard disks of the same model, and each hard disk in the same hard disk cluster is added to the distributed storage system in the same batch. The data storage method for the distributed storage system includes:

[0009] Receive data to be written and classify the data into data types; wherein, among the set N data types, an estimated number of modifications of the data to be written of the (i+1)th data type within a first time period is greater than the estimated number of modifications of the data to be written of the (i)th data type within the first time period, where N is a positive integer not less than 2;

[0010] When the data type of the data to be written is the i-th data type, determining whether there is a hard disk cluster in the i-th state;

[0011] If there is a disk cluster in the i-th state, select a disk cluster in the i-th state;

[0012] The data to be written is written into the selected hard disk cluster in the i-th state; wherein, among the set N hard disk clusters in the state, the wear degree of the hard disk cluster in the i+1-th state is lower than the wear degree of the hard disk cluster in the i-th state, and i is a positive integer.

[0013] Preferably, the data types of the data to be written are divided into:

[0014] Based on the file name of the data to be written, the data type of the data to be written is divided.

[0015] Preferably, based on the file name of the data to be written, the data type of the data to be written is divided into:

[0016] When the file name of the data to be written matches the preset j-th database, the data type of the data to be written is divided into the j-th data type; wherein j is a positive integer and 1≤j≤N-1;

[0017] When the file name of the data to be written does not match any of the preset N-1 databases, the data type of the data to be written is divided into the Nth data type.

[0018] Preferably, it also includes:

[0019] The preset deep learning model is trained using the file name as the training sample and the modification count of the training sample in the first time period as the training label of the training sample;

[0020] After the deep learning model is trained, different file names are input into the trained deep learning model in sequence, and the data of N-1 databases are updated based on the output results of the deep learning model.

[0021] Preferably, it also includes:

[0022] An adjustment instruction for the jth database is received, and a data item adding operation, a data item deleting operation, and / or a data item modifying operation is performed on the jth database according to the adjustment instruction.

[0023] Preferably, N=3, the first data type is a read-only data type, the second data type is a cold data type, the third data type is a hot data type, and the first state of the hard disk cluster is G readonly Status, the second status of the disk cluster is G cold Status, the third status of the disk cluster is G hot state.

[0024] Preferably, it also includes:

[0025] When the data to be written is of the first data type and it is determined that there is no disk cluster in the first state, the data to be written is written to G hot Status or G cold In the disk cluster of the status.

[0026] Preferably, it also includes:

[0027] When the data to be written is of the second data type and it is determined that there is no disk cluster in the second state, the data to be written is written to G hot In the disk cluster of the status.

[0028] Preferably, it also includes:

[0029] When the data to be written is of the third data type and it is determined that there is no disk cluster in the third state, a write failure prompt message is fed back.

[0030] Preferably, selecting a hard disk cluster in the i-th state includes:

[0031] According to the rule that the lower the wear degree of the hard disk cluster, the higher the priority, a hard disk cluster in the i-th state is selected.

[0032] Preferably, selecting a hard disk cluster in the i-th state according to the rule that the lower the wear degree of the hard disk cluster, the higher the priority, includes:

[0033] For each hard disk cluster in the i-th state, search in ascending order of wear degree;

[0034] When the current cluster write queue depth VG of any disk cluster in state i is found cur_queue_depth <Preset maximum cluster write queue depth VG max_queue_depth When , stop searching and use the hard disk cluster as the selected hard disk cluster in the i-th state;

[0035] After all disk clusters in the i-th state have been searched, there is no current cluster write queue depth VG cur_queue_depth <Preset maximum cluster write queue depth VG max_queue_depth When there are multiple hard disk clusters, the hard disk cluster with the smallest cluster busyness VGbusy is selected as the hard disk cluster in the i-th state;

[0036] The cluster busyness VGbusy of the hard disk cluster indicates the current cluster write queue depth VG cur_queue_depth Divide by the maximum cluster write queue depth VG max_queue_depth The value obtained afterwards.

[0037] Preferably, writing the data to be written into the selected hard disk cluster in the i-th state includes:

[0038] Select a target hard disk from the selected hard disk cluster in the i-th state according to the rule that the lower the hard disk wear, the higher the priority;

[0039] Write the data to be written to the selected target hard disk.

[0040] Preferably, selecting a target hard disk from the selected hard disk cluster in the i-th state according to the rule that the lower the wear degree of the hard disk, the higher the priority, includes:

[0041] Search each hard disk in the selected hard disk cluster in the i-th state in ascending order of wear degree;

[0042] When the current disk write queue depth VD of any disk in the disk cluster in the i-th state is found cur_queue_depth <Preset maximum hard disk write queue depth VD max_queue_depth When the hard disk is selected, the search stops and the hard disk is selected as the target hard disk;

[0043] After all hard disks in the hard disk cluster in the i-th state have been searched, there is no current hard disk write queue depth VD cur_queue_depth <Preset maximum hard disk write queue depth VD max_queue_depth When there are multiple hard disks, the hard disk with the smallest hard disk busyness VDbusy is selected as the target hard disk;

[0044] Among them, the hard disk busyness VDbusy represents the current hard disk write queue depth VD cur_queue_depth Divide by the maximum disk write queue depth VD max_queue_depth The value obtained afterwards.

[0045] Preferably, each hard disk cluster in the distributed storage system is set in the first media layer, and an SCM media layer is also set in the distributed storage system to store target type data through the SCM media layer and process non-block aligned write data through the SCM media layer.

[0046] Preferably, the first dielectric layer is a PLC dielectric layer or a QLC dielectric layer.

[0047] Preferably, in each hard disk cluster, data is stored in blocks of a set size, and the data storage method of the distributed storage system further includes:

[0048] Determine the P / E times of each block in the hard disk cluster in the i-th state, and calculate the average value of the P / E times of each block in the hard disk cluster;

[0049] If there are blocks in the disk cluster in the i-th state whose difference between the P / E times and the average value is lower than a set first value, all blocks whose difference between the P / E times and the average value is lower than the set first value are selected as blocks to be migrated;

[0050] If there is currently a hard disk cluster in the (i+1)th state, each block to be migrated in the hard disk cluster is migrated to the hard disk cluster in the (i+1)th state.

[0051] Preferably, it also includes:

[0052] After determining each block to be migrated, if there is no disk cluster in the i+1th state, the K blocks with the highest P / E times in the disk cluster in the i-th state are swapped with the data in the K blocks to be migrated in the disk cluster in the i-th state, completing the internal migration of the K blocks to be migrated in the disk cluster in the i-th state.

[0053] Here, K represents the number of blocks to be migrated determined in the disk cluster in the i-th state.

[0054] A data storage system of a distributed storage system includes multiple hard disk clusters, each hard disk cluster includes multiple hard disks of the same model, and each hard disk in the same hard disk cluster is added to the distributed storage system in the same batch. The data storage system of the distributed storage system includes:

[0055] a type classification module, configured to receive data to be written and classify the data into data types; wherein, among the set N data types, an estimated number of modifications of the data to be written of the i+1th data type within a first time period is greater than the estimated number of modifications of the data to be written of the ith data type within the first time period, where N is a positive integer not less than 2;

[0056] The hard disk cluster status judgment module is used to judge whether there is a hard disk cluster in the i-th state when the data type of the data to be written is the i-th data type; if there is a hard disk cluster in the i-th state, the hard disk cluster selection module is triggered;

[0057] A hard disk cluster selection module is used to select a hard disk cluster in the i-th state;

[0058] A write module is used to write the data to be written into the selected hard disk cluster in the i-th state; wherein, among the set N states of hard disk clusters, the wear degree of the hard disk cluster in the i+1-th state is lower than the wear degree of the hard disk cluster in the i-th state, and i is a positive integer.

[0059] A data storage device of a distributed storage system, comprising:

[0060] memory for storing computer programs;

[0061] The processor is configured to execute a computer program to implement the steps of the data storage method of the distributed storage system as described above.

[0062] A computer non-volatile readable storage medium stores a computer program, which implements the steps of the data storage method of the distributed storage system when executed by a processor.

[0063] Applying the technical solution provided by the embodiment of the present application, considering that in order to fully realize the high cost-effectiveness of flash memory media, it is not limited to wear leveling within a hard disk, but it is necessary to do global wear leveling based on a distributed storage system. Specifically, in the solution of the present application, the distributed storage system is divided into multiple hard disk clusters. Compared with directly managing each hard disk, the management data, i.e., metadata, required for the management of the hard disk cluster is lower, which is convenient for implementation. Moreover, for any one hard disk cluster, the hard disk cluster includes multiple hard disks of the same model, and each hard disk in the same hard disk cluster is added to the distributed storage system in the same batch. Through such a setting, it is conducive to conveniently realizing the wear leveling of each hard disk in the hard disk cluster. Then, by realizing the wear leveling between the hard disk clusters, the global wear leveling of the entire distributed storage system can be realized, which also ensures the durability of the hard disk and avoids the situation of frequently replacing bad disks.

[0064] Specifically, when performing wear leveling between hard disk clusters, this application divides the hard disk clusters into N states. After receiving data to be written, the data type to be written is divided. When the data to be written is classified as the i-th data type, it is determined whether a hard disk cluster in the i-th state currently exists. If so, a hard disk cluster in the i-th state is selected. Because different data types reflect the different frequencies of future modifications to the data to be written, and specifically, among the N data types, the estimated number of modifications to the data to be written of the i+1-th data type within the first time period is higher than the estimated number of modifications to the data to be written of the i-th data type within the first time period. And among the N hard disk clusters in the set states, the wear level of the hard disk cluster in the i+1-th state is lower than the wear level of the hard disk cluster in the i-th state. It can be seen that for data that requires little modification, that is, when the estimated number of modifications to the data to be written within the first time period is very low, the data to be written will be classified as the first data type and will be written to the hard disk cluster in the first state. The hard disk cluster in the first state has the highest wear level, which means that the hard disk cluster in the first state has already written a large amount of data, and therefore, the data being written is data that requires little modification. Writing to a hard drive wears it out, while reading from it does not. This indicates that, because data written to a hard drive cluster with a high wear level requires little modification, it can still be read even if the hard drive cluster is highly worn, thus fully utilizing its residual value. Accordingly, the more frequently the data to be written needs to be modified—that is, the higher the estimated number of modifications to the data to be written within the first time period—the more likely the data to be written will be written to a hard drive cluster with a lower wear level, allowing for more efficient use of the less wear-prone hard drive cluster and achieving global wear leveling for the distributed storage system.

[0065] In summary, this application divides the distributed storage system into multiple hard disk clusters, which is conducive to conveniently achieving global wear leveling of the distributed storage system, thereby ensuring the durability of the hard disks in the distributed storage system and avoiding the frequent replacement of bad disks. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0067] FIG1 is a flowchart of an implementation method of a distributed storage system in the present application;

[0068] FIG2 is a schematic diagram showing a principle framework for implementing global wear leveling in a specific embodiment of the present application;

[0069] FIG3 is a schematic diagram of a multi-layer flash memory architecture of a distributed storage system in a specific embodiment of the present application;

[0070] FIG4 is a schematic structural diagram of a data storage system of a distributed storage system in this application;

[0071] FIG5 is a schematic diagram of the structure of a data storage device of a distributed storage system in this application;

[0072] FIG6 is a schematic structural diagram of a computer non-volatile readable storage medium in the present application. DETAILED DESCRIPTION

[0073] The core of this application is to provide a data storage method for a distributed storage system, which divides the distributed storage system into multiple hard disk clusters, which is conducive to conveniently achieving global wear leveling of the distributed storage system, thereby ensuring the durability of the hard disks in the distributed storage system and avoiding the frequent replacement of bad disks.

[0074] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific embodiments. Obviously, the embodiments described are only a part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making any creative efforts are within the scope of protection of the present application.

[0075] Please refer to FIG1 , which is a flowchart of an implementation method for data storage in a distributed storage system of the present application. The distributed storage system includes multiple hard disk clusters, each of which includes multiple hard disks of the same model, and each hard disk in the same hard disk cluster is added to the distributed storage system in the same batch. The data storage method in the distributed storage system may include the following steps:

[0076] Step S101: receiving data to be written and classifying the data types of the data to be written;

[0077] Among them, among the set N data types, the estimated number of modifications of the data to be written of the i+1th data type within the first time period is higher than the estimated number of modifications of the data to be written of the ith data type within the first time period, and N is a positive integer not less than 2.

[0078] Specifically, in the solution of the present application, the concept of a hard disk cluster is defined. A distributed storage system may include multiple hard disk clusters, and one hard disk cluster may include multiple hard disks of the same model.

[0079] It should be noted that for different hard disk clusters, the number and models of hard disks included can be different, that is, the disks can be from different manufacturers, of different sizes, and added to the cluster at different times. They can be set up according to actual needs, which does not affect the implementation of this application. The hard disks in the same hard disk cluster have the same model, that is, the same hard disk cluster is composed of a group of hard disks with the same capacity and the same properties.

[0080] All hard disks in the same hard disk cluster are added to the distributed storage system in the same batch, and since this application realizes global wear balancing of the distributed storage system, the wear degree of each hard disk in the same hard disk cluster is similar, and if replacement is required, it is also replaced at the same time.

[0081] The specific type of hard disk described in this application can be set and adjusted as needed, and is usually an SSD hard disk. Of course, in other specific implementations, it can be other types of hard disks. However, it should be pointed out that since mechanical hard disks do not have the problem of friction loss, the number of writes is basically unlimited, and this application implements wear leveling to deal with solid-state hard disks that have a limit on the number of writes. Therefore, the hard disks in the scheme of this application are usually solid-state hard disks with a limit on the number of writes.

[0082] After receiving the data to be written, it is necessary to classify the data type. See Figure 2 for a schematic diagram of the principle framework for implementing global wear leveling. The media user in Figure 2 represents the data type classification of the data to be written, which is then passed to the flash allocation module in Figure 2 via a tag. The flash allocation module uses this tag to determine the data type and, in turn, to determine which disk cluster the data should be written to.

[0083] In the solution of this application, in order to achieve global wear leveling, the more frequently the data needs to be modified, the more it should be written to the hard disk cluster with lower wear. In other words, this application divides the data types of the data to be written according to the frequency of future modification of the data to be written. In other words, different data types reflect the different modification frequencies of the data to be written. Therefore, the data types of the data to be written are divided according to the different frequencies of future modification of the data to be written.

[0084] Among the N data types that are set, the estimated number of modifications of the data to be written of the i+1th data type within the first time period is higher than the estimated number of modifications of the data to be written of the i-th data type within the first time period, and N is a positive integer not less than 2, that is, at least 2 data types need to be set, and N represents the total number of data types.

[0085] That is to say, when the data to be written is of the i-th data type, it means that the estimated number of modifications of the data to be written within the first time length is in the i-th estimated value interval, and the N estimated value intervals are sorted from small to large in order from 1 to N.

[0086] It can be seen that when the data to be written is of the first data type, the estimated number of modifications of the data to be written within the first time length is the smallest, indicating that the data to be written hardly needs to be modified. When the data to be written is of the Nth data type, the estimated number of modifications of the data to be written within the first time length is the largest, indicating that the data to be written needs to be modified frequently.

[0087] In order to classify the data types of the data to be written according to the frequency of modification of the data to be written, there may be multiple specific implementations. For example, in a specific embodiment of the present application, the classification of the data types of the data to be written described in step S101 may specifically include:

[0088] Based on the file name of the data to be written, the data type of the data to be written is divided.

[0089] As described above, the present application divides the data types of the data to be written according to the frequency of future modifications of the data to be written. This implementation method takes into account whether the data to be written needs to be modified frequently, which can be reflected to a certain extent in the file name. Therefore, the frequency of modification of the data to be written can be predicted based on the file name of the data to be written, that is, the data type of the data to be written can be divided, which will be more convenient in implementation.

[0090] Furthermore, in a specific embodiment of the present application, based on the file name of the data to be written, the data type of the data to be written is divided, which may specifically include:

[0091] When the file name of the data to be written matches the preset j-th database, the data type of the data to be written is divided into the j-th data type; wherein j is a positive integer and 1≤j≤N-1;

[0092] When the file name of the data to be written does not match any of the preset N-1 databases, the data type of the data to be written is divided into the Nth data type.

[0093] In this application, N is a positive integer not less than 2, representing the total number of data types. It also represents the total number of disk cluster states. That is, the number of data types that are set corresponds to the number of disk cluster states that are set. By determining whether the file name of the data to be written matches the corresponding database, this implementation is very simple, meaning that this implementation can easily and quickly predict the specific type of the data to be written.

[0094] This implementation takes into account that N-1 databases can be set in advance, so that when the file name of the data to be written matches a certain database, the data type of the data to be written can be determined to be the data type corresponding to the database, that is, if the file name of the data to be written matches the j-th database among the N-1 databases, the data type of the data to be written is divided into the j-th data type.

[0095] In addition, it should be pointed out that the reason why N-1 databases are set up instead of N databases in this implementation is that no matter whether N-1 databases or N databases are set up, there may still be a situation where the file name of the data to be written does not match any database, that is, the set database is difficult to fully cover the file names of various data to be written in actual applications.

[0096] If no matching database is found, it means that the frequency of modification of the data to be written cannot be predicted. Therefore, in order to avoid excessive wear on the hard disk cluster with high wear, in this implementation, the data to be written in this situation is divided into the Nth data type, that is, the subsequent data to be written will be written to the hard disk cluster in the Nth state. The hard disk cluster in the Nth state is the hard disk cluster with the lowest wear among the hard disk clusters in various states.

[0097] Since in this implementation mode, the data type of the data to be written whose file name does not match any database needs to be classified as the Nth data type, there is no need to set up N databases in this implementation mode, but only N-1 databases can be set. That is, as long as the file name of the data to be written does not match the preset N-1 databases, regardless of whether the frequency of future modifications of the data to be written cannot be predicted or whether very frequent modifications are indeed required in the future, it is directly classified as the Nth data type.

[0098] In addition, the specific content of the N-1 databases can be set by the staff based on experience, and dynamic adjustment of the database content is also supported to better meet actual needs. For example, in a specific embodiment of the present application, it can also include:

[0099] An adjustment instruction for the jth database is received, and a data item adding operation, a data item deleting operation, and / or a data item modifying operation is performed on the jth database according to the adjustment instruction.

[0100] The adjustment instruction can be issued by the staff. When the adjustment instruction for the j-th database is received, the data items of the j-th database can be added, and / or deleted, and / or modified according to the adjustment instruction.

[0101] It should also be noted that whether the file name of the data to be written matches the preset j-th database, the specific matching rules can also be set according to actual needs. For example, in one scenario, one or more file name suffixes are set in the j-th database. As long as the suffix of the file name of the data to be written is consistent with any file name suffix in the j-th database, the file name of the data to be written is considered to match the preset j-th database.

[0102] For example, in a specific scenario where N = 3, two databases need to be set up, namely the first database and the second database. For example, if the file name of the data to be written has a suffix of avi, bmp, etc., it can be determined that the file name of the data to be written matches the first database, and the data to be written is classified as the first data type. Subsequently, the data to be written needs to be written to the hard disk cluster in the first state. For example, if the file name of the data to be written has a suffix of bak, log, etc., it can be determined that the file name of the data to be written matches the second database, and the data to be written is classified as the second data type. Subsequently, the data to be written needs to be written to the hard disk cluster in the second state.

[0103] Of course, matching based on the file name suffix is ​​only an example of a relatively simple implementation method. In other specific implementations, other more complex matching methods can also be set. For example, the file name header can be analyzed, and the analysis results of the file name header and the file name suffix can be combined to determine whether the file name of the data to be written matches the corresponding database. For another example, the overall pattern of the file name can be analyzed to determine whether the file name of the data to be written matches the corresponding database.

[0104] In a specific embodiment of the present application, it may further include:

[0105] The preset deep learning model is trained using the file name as the training sample and the modification count of the training sample in the first time period as the training label of the training sample;

[0106] After the deep learning model is trained, different file names are input into the trained deep learning model in sequence, and the data of N-1 databases are updated based on the output results of the deep learning model.

[0107] As described above, the specific contents in the N-1 databases all support dynamic adjustment. This implementation method takes into account that if the specific contents in the N-1 databases are set and adjusted based on the experience of the staff, the workload will be large, and the adjustment effect will also be affected by the staff's business level.

[0108] In this regard, in this implementation, data updates of N-1 databases can be implemented based on a deep learning model. Specifically, a deep learning model can be established and trained. During the training process, the training samples are the file names, and the training labels are the statistical values ​​of the number of modifications of the training samples within the first time period. In this way, after the deep learning model is trained, the file name is input into the trained deep learning model, and the deep learning model can output a prediction result corresponding to the file name. The prediction result represents an estimate of the number of modifications of the data with the file name in the first time period in the future.

[0109] After inputting each different file name into the trained deep learning model in turn, the data of N-1 databases can be updated based on the output results of the deep learning model. That is, different file names are placed in the corresponding database according to the output results of the deep learning model.

[0110] Step S102: When the data type of the data to be written is the i-th data type, determine whether there is a hard disk cluster in the i-th state; if there is a hard disk cluster in the i-th state, execute step S103.

[0111] Step S103: Select a hard disk cluster in the i-th state.

[0112] After the data types of the data to be written are classified, if the data to be written is of the i-th data type, then as long as a disk cluster in the i-th state currently exists, the data to be written can be subsequently written to the disk cluster in the i-th state.

[0113] As described above, in the scheme of the present application, among the set N data types, the estimated number of modifications of the data to be written of the i+1th data type within the first time period is higher than the estimated number of modifications of the data to be written of the i-th data type within the first time period, that is, the data to be written of the 1st data type hardly needs to be modified, while the data to be written of the Nth data type needs to be modified most frequently.

[0114] Among the N states of a disk cluster, the wear level of the disk cluster in the i+1th state is lower than that of the disk cluster in the ith state, where i is a positive integer. In other words, the wear level of the disk cluster in the ith state is within the ith wear level interval. Therefore, there are a total of N wear level intervals, sorted from largest to smallest in the order from 1 to N.

[0115] It can be seen that the more frequently the data to be written needs to be modified, that is, the higher the estimated number of times the data to be written will be modified within the first period, the harder it will be to select a hard disk cluster with lower wear to store the data to be written.

[0116] The wear level of a hard disk cluster refers to the degree of wear on that hard disk cluster. The higher the wear level, the lower the number of subsequent write operations that can be performed on the hard disk cluster, which in turn shortens the lifespan of the hard disk cluster. In a specific scenario, the wear level of a hard disk cluster can be represented by the amount of data already written to the hard disk cluster. Specifically, the wear level Vwl of a hard disk cluster can be defined as: the amount of data already written to the hard disk cluster / the sum of the total amount of writable data on all hard disks in the hard disk cluster. In other words, the more data currently written to the hard disk cluster, the higher the wear level Vwl, up to 100%.

[0117] In addition, as described above, N is the total number of data types set, and is also the total number of states of the hard disk cluster. In actual applications, considering that the present application divides the data types of the data to be written, it is equivalent to predicting the frequency of modification of the data to be written in the future. It can be understood that after the data to be written is written into the distributed storage system, the actual frequency of modification may be different in different occasions and time periods. Therefore, in actual applications, it is not necessary to divide the data types of the data to be written too finely, that is, the total number of states of the hard disk cluster does not need to be divided too much, and too many total states of the hard disk cluster are not easy to manage. Therefore, in a specific implementation, N can be set to 3. At this time, the first data type is specifically a read-only data type, the second data type is specifically a cold data type, the third data type is specifically a hot data type, and the first state of the hard disk cluster is G. readonly Status, the second status of the disk cluster is G cold Status, the third status of the disk cluster is G hot state.

[0118] It can be seen that in this implementation, for data that will hardly be modified in the future after being written, the data type is the first data type, that is, the read-only data type, which will be written to G readonly In a disk cluster with a stable state, backup files are such data.

[0119] G readonly The hard disk cluster in the state has a high degree of wear, but it can still be read. The read operation will not affect the life of the hard disk. The data that will hardly be modified in the future will be written to the G readonly In a hard disk cluster with a stable state, it is helpful to give full play to the value of such hard disk cluster.

[0120] Correspondingly, in this example, data that will be modified after writing but not modified too frequently has the second data type, that is, the cold data type, and will be written to G cold In the disk cluster of the status.

[0121] The data that will be modified frequently after being written is the third data type, that is, the hot data type, and will be written to G hot In the disk cluster of the status.

[0122] In the following text of this application, the implementation method of N=3 is also used as an example. Since N=3, when the wear level of the hard disk cluster Vwl<V1, the state of the hard disk cluster is G hot Status; when V1≤Vwl<V2, the status of the disk cluster is G cold Status; when Vwl≥V2, the status of the disk cluster is G readonly State, V1 and V2 described here are two preset parameter thresholds, which can be set and adjusted by the staff as needed. It can be understood that the set V1 is less than V2.

[0123] It should also be noted that when the data to be written is of the i-th data type, there may be multiple hard disk clusters in the current i-th state. In this case, it is necessary to select one hard disk cluster in the i-th state according to the set rules to write the data to be written into the selected hard disk cluster in the i-th state. The specific selection rules can be set and adjusted according to actual needs.

[0124] For example, in a specific embodiment of the present application, considering that there are multiple hard disk clusters in the i-th state, although the wear levels of these hard disk clusters belong to the same wear level range, there are still differences in the wear levels of each hard disk cluster in the i-th state. In this regard, in order to more effectively achieve global wear balancing of the distributed storage system in this embodiment, considering that the lower the wear level of the hard disk cluster, the higher the priority, a hard disk cluster in the i-th state can be selected. In other words, for each hard disk cluster in the i-th state, they can be sorted from low to high according to the wear level, and the hard disk cluster with low wear level can be selected first, so as to more effectively achieve global wear balancing of the distributed storage system.

[0125] In the embodiment of FIG2, there are 3 G hot The disk clusters in the state are marked as G1, G2 and G3. G1 has 6 SSDs, marked as d1 to d6, G2 has 4 SSDs, marked as d1 to d4, and G3 has 7 SSDs, marked as d1 to d7. hot The hard disk clusters in the status are arranged in order from small to large according to the wear degree Vwl, so that the hard disk cluster with low wear degree is selected first.

[0126] Furthermore, it is understandable that, since the wear degree of the hard disk cluster may change, the Vwl ranking of each hard disk cluster in the same state may also be dynamically updated in real time or periodically.

[0127] Furthermore, in a specific embodiment of the present application, selecting a hard disk cluster in the i-th state based on the rule that the lower the wear level of the hard disk cluster, the higher the priority may specifically include:

[0128] For each hard disk cluster in the i-th state, search in ascending order of wear degree;

[0129] When the current cluster write queue depth VG of any disk cluster in state i is found cur_queue_depth <Preset maximum cluster write queue depth VG max_queue_depth When , stop searching and use the hard disk cluster as the selected hard disk cluster in the i-th state;

[0130] After all disk clusters in the i-th state have been searched, there is no current cluster write queue depth VG cur_queue_depth <Preset maximum cluster write queue depth VG max_queue_depth When there are multiple hard disk clusters, the hard disk cluster with the smallest cluster busyness VGbusy is selected as the hard disk cluster in the i-th state;

[0131] The cluster busyness VGbusy of the hard disk cluster indicates the current cluster write queue depth VG cur_queue_depth Divide by the maximum cluster write queue depth VG max_queue_depth The value obtained afterwards.

[0132] This implementation not only takes into account the wear of the hard disk cluster, but also the current cluster write queue depth of the hard disk cluster, which is conducive to ensuring high concurrency, that is, it is conducive to achieving high IOPS (Input / Output Operations Per Second) and high bandwidth of the distributed storage system.

[0133] Specifically, for each hard disk cluster in the i-th state, the search will be carried out in order from the smallest to the largest wear level. The purpose of the search is to determine the current cluster write queue depth VG cur_queue_depth Is it less than the preset maximum cluster write queue depth VG max_queue_depth .

[0134] Taking Figure 2 as an example, in G hot Among the three hard disk clusters in the state, the first one to be searched is the hard disk cluster G1 with the lowest wear. If the current cluster write queue depth of G1 is VG cur_queue_depth Less than the preset maximum cluster write queue depth VG max_queue_depth, it means that G1 is not busy at present, so the search can be stopped and G1 is selected as the disk cluster in the i-th state according to the preset rules, so that the data to be written can be written to G1 later.

[0135] If G1 is currently very busy, the current cluster write queue depth VG cur_queue_depth Equal to or even exceeding the maximum cluster write queue depth VG max_queue_depth In this case, even if G1 has lower wear than G2 and G3, if G1 is selected to write the data to be written, it will increase the busyness of G1 and cause queue congestion, which is not conducive to achieving high IOPS and high bandwidth of the distributed storage system.

[0136] Therefore, in this implementation, G2 will continue to be searched. If the current cluster write queue depth of G2 is VG cur_queue_depth Less than the preset maximum cluster write queue depth VG max_queue_depth , it means that G2 is not busy at present, so the search can be stopped and G2 is selected as the disk cluster in the i-th state according to the preset rules, so that the data to be written can be written to G2 later.

[0137] If G1, G2, and G3 are all busy, there is no current cluster write queue depth VG cur_queue_depth <Preset maximum cluster write queue depth VG max_queue_depth When there are multiple hard disk clusters, the hard disk cluster with the smallest cluster busyness VGbusy is used as the hard disk cluster in the i-th state selected according to the preset rules.

[0138] The cluster busyness VGbusy of the hard disk cluster indicates the current cluster write queue depth VG of the hard disk cluster. cur_queue_depth Divide by the maximum cluster write queue depth VG max_queue_depth The value obtained later is VGbusy=VG cur_queue_depth / VG max_queue_depth .

[0139] Maximum cluster write queue depth VG max_queue_depth This value is related to hardware and indicates the maximum number of write requests that a disk cluster can process simultaneously. The value depends on the computing and storage resources of the disk cluster.

[0140] Step S104: writing the data to be written into the selected hard disk cluster in the i-th state.

[0141] After a hard disk cluster is selected for storing the data to be written, the data to be written can be written to the selected hard disk cluster.

[0142] In a specific implementation of the present application, step S104 may specifically include:

[0143] Select a target hard disk from the selected hard disk cluster in the i-th state according to the rule that the lower the hard disk wear, the higher the priority;

[0144] Write the data to be written to the selected target hard disk.

[0145] This implementation takes into account that after determining the hard disk cluster for storing the data to be written, the specific hard disk to be used for storing the data to be written is selected from the hard disk cluster. While the wear levels of the hard disks in the same hard disk cluster are generally the same, there are still some differences. To more effectively ensure wear balancing among the hard disks in the hard disk cluster, this implementation prioritizes hard disks with low wear levels as the selected target hard disks. In other words, the hard disks in the selected hard disk cluster can be sorted from low to high according to wear level, with hard disks with low wear levels being prioritized to more effectively achieve global wear balancing for the distributed storage system.

[0146] Furthermore, it is understandable that, since the wear degree of hard disks may change, the wear degree ranking of each hard disk in the hard disk cluster may be dynamically updated in real time or periodically.

[0147] Furthermore, in a specific embodiment of the present application, selecting a target hard disk from the selected hard disk cluster in the i-th state according to a rule that the lower the wear degree of the hard disk, the higher the priority, includes:

[0148] Search each hard disk in the selected hard disk cluster in the i-th state in ascending order of wear degree;

[0149] When the current disk write queue depth VD of any disk in the disk cluster in the i-th state is found cur_queue_depth <Preset maximum hard disk write queue depth VD max_queue_depth When the hard disk is selected, the search stops and the hard disk is selected as the target hard disk;

[0150] After all hard disks in the hard disk cluster in the i-th state have been searched, there is no current hard disk write queue depth VD cur_queue_depth <Preset maximum hard disk write queue depth VD max_queue_depth When there are multiple hard disks, the hard disk with the smallest hard disk busyness VDbusy is selected as the target hard disk;

[0151] Among them, the hard disk busyness VDbusy represents the current hard disk write queue depth VD cur_queue_depth Divide by the maximum disk write queue depth VDmax_queue_depth The value obtained afterwards.

[0152] In this implementation, the principle of selecting one hard disk cluster from each hard disk cluster in the i-th state is the same as in the previous implementation, that is, for each hard disk in the hard disk cluster, when selecting the target hard disk, not only the wear of the hard disk is considered, but also the current hard disk write queue depth of the hard disk is considered, which is conducive to ensuring high concurrency, that is, it is conducive to achieving high IOPS and high bandwidth of the distributed storage system.

[0153] Specifically, after selecting a hard disk cluster in the i-th state, each hard disk in the selected hard disk cluster will be searched in order of wear from small to large. The purpose of the search is to determine the current hard disk write queue depth VD cur_queue_depth Is it less than the preset maximum hard disk write queue depth VD max_queue_depth .

[0154] The first hard disk to be searched is the one with the lowest wear. If the current hard disk write queue depth VD cur_queue_depth Less than the preset maximum hard disk write queue depth VD max_queue_depth If the hard disk is not busy, the search can be stopped and the hard disk can be used as the target hard disk so that the data to be written can be written to the hard disk later.

[0155] If the hard disk with the lowest wear is currently very busy, the current hard disk write queue depth VD cur_queue_depth Equal to or even exceeding the maximum disk write queue depth VD max_queue_depth If the hard disk is selected to write the data to be written at this time, the busyness of the hard disk will be increased, causing queue congestion, which is not conducive to achieving high IOPS and high bandwidth of the distributed storage system.

[0156] Therefore, in this implementation mode, other hard disks will continue to be searched. The principle is the same as above and will not be repeated.

[0157] Similarly, if all hard disks in the hard disk cluster have been searched and are all busy, there is no current hard disk write queue depth VD cur_queue_depth <Preset maximum hard disk write queue depth VD max_queue_depth When there are multiple hard disks, the hard disk with the smallest hard disk busyness VDbusy is used as the target hard disk.

[0158] The hard disk busyness VDbusy indicates the current hard disk write queue depth VD cur_queue_depth Divide by the maximum disk write queue depth VD max_queue_depth The value obtained later is VDbusy=VD cur_queue_depth / VDmax_queue_depth .

[0159] Maximum disk write queue depth VD max_queue_depth This value is hardware-related and indicates the maximum number of write requests that a hard disk can process simultaneously. The value depends on the computing and storage resources of the hard disk.

[0160] It is understandable that in the present application, the state of the hard disk cluster will change over time. Still taking N=3 as an example, at the beginning, the state of a new hard disk cluster added to the distributed storage system is G hot As the data wears out, the wear level Vwl of the hard disk cluster will become higher and higher. When it is greater than or equal to V1, its status changes to G cold When the wear level Vwl of the hard disk cluster is greater than or equal to V2, its status changes to G readonly In actual application, when the state is G readonly When there are too many hard disk clusters in the status, the system can alarm and prompt to update the SSD disk.

[0161] In a specific embodiment of the present application, it may further include:

[0162] When the data to be written is of the second data type and it is determined that there is no disk cluster in the second state, the data to be written is written to G hot In the disk cluster of the status.

[0163] As described above, the state of the hard disk cluster will change over time. When the distributed storage system is first established, since no data has been written to each hard disk cluster, the wear degree is very low. That is, the state of each hard disk cluster is G hot At this time, if the data to be written is classified as the second data type, since there is no hard disk cluster in the second state, that is, there is no G cold The disk cluster in the state, therefore, the data to be written can be written to G hot In the disk cluster of the status.

[0164] In a specific embodiment of the present application, it may further include:

[0165] When the data to be written is of the first data type and it is determined that there is no disk cluster in the first state, the data to be written is written to G hot Status or G cold In the disk cluster of the status.

[0166] This implementation method takes into account that when the data to be written is classified as the first data type, if there is no hard disk cluster in the first state, that is, there is no G readonlyIf the disk cluster is in the state, the data to be written can be written to G hot Status or G cold In the disk cluster of the status.

[0167] In addition, it should be noted that there is currently no disk cluster in the first state. It may be that the wear of each disk cluster is relatively low. For example, in the example of N=3, it may be that the wear of each disk cluster is relatively low, and only G hot Status or G cold There may also be a hard disk cluster in the 1st state; there may also be a hard disk with high wear, but the hard disk is completely full and no new data can be written. In this case, it can also be regarded as a hard disk cluster that does not currently exist in the 1st state, and the data to be written needs to be written to the G hot Status or G cold In the disk cluster of the status.

[0168] In a specific embodiment of the present application, it may further include:

[0169] When the data to be written is of the third data type and it is determined that there is no disk cluster in the third state, a write failure prompt message is fed back.

[0170] This implementation method takes into account that when the data to be written is the third data type, if there is no hard disk cluster in the third state, that is, there is no G hot If the hard disk cluster is in the "no" state, it means that the storage space of the distributed storage system has been largely used and the remaining space is insufficient. Therefore, in order to avoid data loss, this implementation will directly feedback a prompt message of write failure.

[0171] In addition, in actual applications, an alarm can be sent to the system to remind staff to add additional resources to the distributed storage system in a timely manner.

[0172] In a specific embodiment of the present application, each hard disk cluster in the distributed storage system is set in the first media layer, and an SCM media layer is also provided in the distributed storage system to store target type data through the SCM media layer and process non-block-aligned write data through the SCM media layer.

[0173] The flash memory medium used in the solution of the present application can generally be QLC or PLC (Penta Level Cell, five-layer storage unit). Since global wear leveling is achieved, the service life is guaranteed while having high data density, high energy efficiency and low price, which means that a high cost-effectiveness is achieved.

[0174] This implementation further considers that data in a disk cluster is typically stored in blocks of a set size. A SCM (Storage-Class Memory) media layer can also be provided in the distributed storage system. By using the SCM media layer to process non-block-aligned write data, IOPS can be effectively improved. After large-block IO (Input / Output) is divided into blocks, some remaining data may represent non-block-aligned write data, i.e., IO with misaligned boundaries. Furthermore, some small-block IO also represents non-block-aligned write data.

[0175] In addition, in some embodiments, data that needs to be modified extremely frequently may not be stored in the first medium layer, that is, not stored in the SSD, but may be placed directly in the SCM to achieve high-speed reading and writing of such data, which is also beneficial to further improve the life of the distributed storage system.

[0176] Please refer to Figure 3, which is a schematic diagram of a multi-layer flash memory architecture of a distributed storage system in a specific embodiment. In the embodiment of Figure 3, a first dielectric layer and an SCM dielectric layer are provided. The first dielectric layer in Figure 3 is specifically a PLC dielectric layer, which is also the solution commonly chosen in practical applications. The PLC dielectric layer has the advantages of high data density, high energy efficiency, and low price. The global wear leveling strategy of this application effectively guarantees the service life of the PLC dielectric layer and improves its cost-effectiveness. In addition, in some cases, the first dielectric layer can also be a QLC dielectric layer.

[0177] In a specific embodiment of the present application, in each hard disk cluster, data is stored in blocks of a set size, and the data storage method of the distributed storage system further includes:

[0178] Determine the P / E times of each block in the hard disk cluster in the i-th state, and calculate the average value of the P / E times of each block in the hard disk cluster;

[0179] If there are blocks in the disk cluster in the i-th state whose difference between the P / E times and the average value is lower than a set first value, all blocks whose difference between the P / E times and the average value is lower than the set first value are selected as blocks to be migrated;

[0180] If there is currently a hard disk cluster in the (i+1)th state, each block to be migrated in the hard disk cluster is migrated to the hard disk cluster in the (i+1)th state.

[0181] This implementation further takes into account that, in the aforementioned implementation, the data types of the data to be written are divided, which is equivalent to predicting the frequency of future modifications of the data to be written. It is understandable that there will be deviations in the prediction results, and even for the same data to be written, the actual frequency of modification may be different in different occasions and time periods. Therefore, in this implementation, data migration will be performed.

[0182] The P / E count can also be called the erase / write cycle count. If the P / E count of a block is very low, it means that the data in the block is not frequently modified. Conversely, if the P / E count of a block is very high, it means that the data in the block is frequently modified.

[0183] Specifically, for the disk cluster in the i-th state, the P / E count of each block in the i-th disk cluster is determined, and the average P / E count of each block in the disk cluster is calculated. If the P / E count of a block is significantly lower than the average, that block is selected for migration. If a disk cluster in the i+1th state currently exists, each block in the i-th disk cluster for migration is migrated to the i+1th disk cluster.

[0184] For example, in G1 in Figure 2, the P / E times of two blocks are particularly low, indicating that these two blocks are rarely modified. Therefore, the data of these two blocks are migrated to G cold In the disk cluster of the status.

[0185] Furthermore, in a specific embodiment of the present application, it may also include:

[0186] After determining each block to be migrated, if there is no disk cluster in the i+1th state, the K blocks with the highest P / E times in the disk cluster in the i-th state are swapped with the data in the K blocks to be migrated in the disk cluster in the i-th state, completing the internal migration of the K blocks to be migrated in the disk cluster in the i-th state.

[0187] Here, K represents the number of blocks to be migrated determined in the disk cluster in the i-th state.

[0188] For example, for G readonly That is, for a hard disk cluster in the Nth state, it cannot be migrated because there is no hard disk cluster in the N+1th state.

[0189] For example, the i-th state is G cold When the state is G cold After a certain hard disk cluster in the state has determined several blocks to be migrated, it detects the readonlyIf the storage space of the disk cluster in the (i+1) state is exhausted, it is considered that there is no disk cluster in the (i+1) state, and the operation of this implementation method will be performed, that is, migration will be performed within the disk cluster. In other words, if the migration destination does not exist or the space at the migration destination is full, the blocks to be migrated will be migrated within the source disk cluster.

[0190] During internal migration, the data in the K blocks with the largest P / E times in the hard disk cluster in the i-th state are exchanged with the data in the K blocks to be migrated in the hard disk cluster, thereby further ensuring the wear balance of each block in the hard disk cluster.

[0191] For example, there are 100 blocks in a certain hard disk cluster, among which the P / E count of block 1 is 2, the P / E count of block 2 is 3, the P / E count of block 3 is 90, the P / E count of block 4 is 80, and the P / E counts of the remaining 96 blocks are all 30, for example. In this implementation, blocks 1 and 2 are the blocks to be migrated, and the two blocks with the largest P / E counts in the hard disk cluster are blocks 3 and 4. Therefore, the data of blocks 1 and 2 needs to be swapped with the data of blocks 3 and 4. For example, the data of block 1 can be swapped with the data of block 3, and the data of block 2 can be swapped with the data of block 4, so as to complete the internal migration of the two blocks to be migrated in the hard disk cluster.

[0192] Applying the technical solution provided by the embodiment of the present application, considering that in order to fully realize the high cost-effectiveness of flash memory media, it is not limited to wear leveling within a hard disk, but it is necessary to do global wear leveling based on a distributed storage system. Specifically, in the solution of the present application, the distributed storage system is divided into multiple hard disk clusters. Compared with directly managing each hard disk, the management data, i.e., metadata, required for the management of the hard disk cluster is lower, which is convenient for implementation. Moreover, for any one hard disk cluster, the hard disk cluster includes multiple hard disks of the same model, and each hard disk in the same hard disk cluster is added to the distributed storage system in the same batch. Through such a setting, it is conducive to conveniently realizing the wear leveling of each hard disk in the hard disk cluster. Then, by realizing the wear leveling between the hard disk clusters, the global wear leveling of the entire distributed storage system can be realized, which also ensures the durability of the hard disk and avoids the situation of frequently replacing bad disks.

[0193] Specifically, when performing wear leveling between hard disk clusters, this application divides the hard disk clusters into N states. After receiving data to be written, the data type to be written is divided. When the data to be written is classified as the i-th data type, it is determined whether a hard disk cluster in the i-th state currently exists. If so, a hard disk cluster in the i-th state is selected. Because different data types reflect the different frequencies of future modifications to the data to be written, and specifically, among the N data types, the estimated number of modifications to the data to be written of the i+1-th data type within the first time period is higher than the estimated number of modifications to the data to be written of the i-th data type within the first time period. And among the N hard disk clusters in the set states, the wear level of the hard disk cluster in the i+1-th state is lower than the wear level of the hard disk cluster in the i-th state. It can be seen that for data that requires little modification, that is, when the estimated number of modifications to the data to be written within the first time period is very low, the data to be written will be classified as the first data type and will be written to the hard disk cluster in the first state. The hard disk cluster in the first state has the highest wear level, which means that the hard disk cluster in the first state has already written a large amount of data, and therefore, the data being written is data that requires little modification. Writing to a hard drive wears it out, while reading from it does not. This indicates that, because data written to a hard drive cluster with a high wear level requires little modification, it can still be read even if the hard drive cluster is highly worn, thus fully utilizing its residual value. Accordingly, the more frequently the data to be written needs to be modified—that is, the higher the estimated number of modifications to the data to be written within the first time period—the more likely the data to be written will be written to a hard drive cluster with a lower wear level, allowing for more efficient use of the less wear-prone hard drive cluster and achieving global wear leveling for the distributed storage system.

[0194] In summary, this application divides the distributed storage system into multiple hard disk clusters, which is conducive to conveniently achieving global wear leveling of the distributed storage system, thereby ensuring the durability of the hard disks in the distributed storage system and avoiding the frequent replacement of bad disks.

[0195] Corresponding to the above method embodiment, the embodiment of the present application further provides a data storage system of a distributed storage system, which can be referenced in correspondence with the above.

[0196] The distributed storage system includes multiple hard disk clusters, each of which includes multiple hard disks of the same model. All hard disks in the same hard disk cluster are added to the distributed storage system in the same batch. As shown in FIG4 , the data storage system of the distributed storage system includes:

[0197] The type classification module 401 is configured to receive data to be written and classify the data into data types; wherein, among the set N data types, the estimated number of modifications of the data to be written of the (i+1)th data type within the first time period is greater than the estimated number of modifications of the data to be written of the (i)th data type within the first time period, where N is a positive integer not less than 2;

[0198] The disk cluster status determination module 402 is configured to determine whether a disk cluster in the i-th state currently exists when the data type of the data to be written is the i-th data type; if a disk cluster in the i-th state exists, the disk cluster selection module 403 is triggered;

[0199] The hard disk cluster selection module 403 is used to select a hard disk cluster in the i-th state;

[0200] The write module 404 is used to write the data to be written into the selected hard disk cluster in the i-th state; wherein, among the set N states of hard disk clusters, the wear degree of the hard disk cluster in the i+1-th state is lower than the wear degree of the hard disk cluster in the i-th state, and i is a positive integer.

[0201] In a specific embodiment of the present application, the type classification module 401 classifies the data types of the data to be written, including:

[0202] Based on the file name of the data to be written, the data type of the data to be written is divided.

[0203] In a specific embodiment of the present application, the type classification module 401 classifies the data types of the data to be written based on the file name of the data to be written, including:

[0204] When the file name of the data to be written matches the preset j-th database, the data type of the data to be written is divided into the j-th data type; wherein j is a positive integer and 1≤j≤N-1;

[0205] When the file name of the data to be written does not match any of the preset N-1 databases, the data type of the data to be written is divided into the Nth data type.

[0206] In a specific embodiment of the present application, a first update module is further included, which is used to:

[0207] The preset deep learning model is trained using the file name as the training sample and the modification count of the training sample in the first time period as the training label of the training sample;

[0208] After the deep learning model is trained, different file names are input into the trained deep learning model in sequence, and the data of N-1 databases are updated based on the output results of the deep learning model.

[0209] In a specific embodiment of the present application, a second update module is further included, which is used to:

[0210] An adjustment instruction for the jth database is received, and a data item adding operation, a data item deleting operation, and / or a data item modifying operation is performed on the jth database according to the adjustment instruction.

[0211] In a specific embodiment of the present application, N=3, the first data type is a read-only data type, the second data type is a cold data type, the third data type is a hot data type, and the first state of the hard disk cluster is G readonly Status, the second status of the disk cluster is G cold Status, the third status of the disk cluster is G hot state.

[0212] In a specific embodiment of the present application, a first execution module is further included, which is used to:

[0213] When the data to be written is of the first data type and it is determined that there is no disk cluster in the first state, the data to be written is written to G hot Status or G cold In the disk cluster of the status.

[0214] In a specific embodiment of the present application, a second execution module is further included, which is configured to:

[0215] When the data to be written is of the second data type and it is determined that there is no disk cluster in the second state, the data to be written is written to G hot In the disk cluster of the status.

[0216] In a specific embodiment of the present application, a third execution module is further included, which is used to:

[0217] When the data to be written is of the third data type and it is determined that there is no disk cluster in the third state, a write failure prompt message is fed back.

[0218] In a specific implementation of the present application, the hard disk cluster selection module 403 is specifically configured to:

[0219] According to the rule that the lower the wear degree of the hard disk cluster, the higher the priority, a hard disk cluster in the i-th state is selected.

[0220] In a specific implementation of the present application, the hard disk cluster selection module 403 is specifically configured to:

[0221] For each hard disk cluster in the i-th state, search in ascending order of wear degree;

[0222] When the current cluster write queue depth VG of any disk cluster in state i is found cur_queue_depth <Preset maximum cluster write queue depth VG max_queue_depth When , stop searching and use the hard disk cluster as the selected hard disk cluster in the i-th state;

[0223] After all disk clusters in the i-th state have been searched, there is no current cluster write queue depth VG cur_queue_depth <Preset maximum cluster write queue depth VG max_queue_depth When there are multiple hard disk clusters, the hard disk cluster with the smallest cluster busyness VGbusy is selected as the hard disk cluster in the i-th state;

[0224] The cluster busyness VGbusy of the hard disk cluster indicates the current cluster write queue depth VG cur_queue_depth Divide by the maximum cluster write queue depth VG max_queue_depth The value obtained afterwards.

[0225] In a specific implementation of the present application, the writing module 404 is specifically configured to:

[0226] Select a target hard disk from the selected hard disk cluster in the i-th state according to the rule that the lower the hard disk wear, the higher the priority;

[0227] Write the data to be written to the selected target hard disk.

[0228] In a specific implementation of the present application, the writing module 404 is specifically configured to:

[0229] Search each hard disk in the selected hard disk cluster in the i-th state in ascending order of wear degree;

[0230] When the current disk write queue depth VD of any disk in the disk cluster in the i-th state is found cur_queue_depth <Preset maximum hard disk write queue depth VD max_queue_depth When the hard disk is selected, the search stops and the hard disk is selected as the target hard disk;

[0231] After all hard disks in the hard disk cluster in the i-th state have been searched, there is no current hard disk write queue depth VD cur_queue_depth <Preset maximum hard disk write queue depth VD max_queue_depth When there are multiple hard disks, the hard disk with the smallest hard disk busyness VDbusy is selected as the target hard disk;

[0232] Among them, the hard disk busyness VDbusy represents the current hard disk write queue depth VD cur_queue_depth Divide by the maximum disk write queue depth VDmax_queue_depth The value obtained afterwards.

[0233] In a specific embodiment of the present application, each hard disk cluster in the distributed storage system is set in the first media layer, and an SCM media layer is also provided in the distributed storage system to store target type data through the SCM media layer and process non-block-aligned write data through the SCM media layer.

[0234] In a specific embodiment of the present application, the first dielectric layer is a PLC dielectric layer or a QLC dielectric layer.

[0235] In a specific embodiment of the present application, in each hard disk cluster, data is stored in blocks of a set size, and a migration module is also included for:

[0236] Determine the P / E times of each block in the hard disk cluster in the i-th state, and calculate the average value of the P / E times of each block in the hard disk cluster;

[0237] If there are blocks in the disk cluster in the i-th state whose difference between the P / E times and the average value is lower than a set first value, all blocks whose difference between the P / E times and the average value is lower than the set first value are selected as blocks to be migrated;

[0238] If there is currently a hard disk cluster in the (i+1)th state, each block to be migrated in the hard disk cluster is migrated to the hard disk cluster in the (i+1)th state.

[0239] In a specific embodiment of the present application, the migration module is further configured to:

[0240] After determining each block to be migrated, if there is no disk cluster in the i+1th state, the K blocks with the highest P / E times in the disk cluster in the i-th state are swapped with the data in the K blocks to be migrated in the disk cluster in the i-th state, completing the internal migration of the K blocks to be migrated in the disk cluster in the i-th state.

[0241] Here, K represents the number of blocks to be migrated determined in the disk cluster in the i-th state.

[0242] Corresponding to the above method and system embodiments, the embodiments of the present application further provide a data storage device of a distributed storage system and a computer non-volatile readable storage medium, which can be referenced in correspondence with the above.

[0243] The data storage device of the distributed storage system may include:

[0244] Memory 501, used for storing computer programs;

[0245] The processor 502 is configured to execute a computer program to implement the steps of the data storage method of the distributed storage system.

[0246] Referring to FIG6 , a computer program 61 is stored on a non-volatile computer-readable storage medium 60. When executed by a processor, the computer program 61 implements the steps of the data storage method for a distributed storage system as described in any of the above embodiments. The non-volatile computer-readable storage medium 60 herein includes random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium known in the art.

[0247] It should also be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.

[0248] Professionals may further 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 above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0249] Specific examples are used herein to illustrate the principles and implementation methods of this application. The description of the above embodiments is only intended to help understand the technical solution and core ideas of this application. It should be noted that, for those skilled in the art, without departing from the principles of this application, various improvements and modifications may be made to this application, and such improvements and modifications also fall within the scope of protection of this application.

Claims

1. A data storage method for a distributed storage system, characterized in that: The distributed storage system includes multiple hard disk clusters, each of which includes multiple hard disks of the same model, and each hard disk in the same hard disk cluster is added to the distributed storage system in the same batch. The data storage method of the distributed storage system includes: Receive data to be written, and classify the data types of the data to be written; wherein, among the set N data types, the estimated number of modifications of the data to be written of the i+1th data type within the first time length is higher than the estimated number of modifications of the data to be written of the ith data type within the first time length, and N is a positive integer not less than 2; When the data type of the data to be written is the i-th data type, determining whether there is a hard disk cluster in the i-th state currently; If there is a hard disk cluster in the i-th state, select a hard disk cluster in the i-th state; The data to be written is written into the selected hard disk cluster in the i-th state; wherein, among the hard disk clusters in the set N states, the wear degree of the hard disk cluster in the i+1-th state is lower than the wear degree of the hard disk cluster in the i-th state, and i is a positive integer.

2. The data storage method of the distributed storage system according to claim 1, characterized in that: The dividing the data type of the data to be written includes: Based on the file name of the data to be written, the data type of the data to be written is divided.

3. The data storage method of the distributed storage system according to claim 2, characterized in that: The dividing the data type of the data to be written based on the file name of the data to be written includes: When the file name of the data to be written matches the preset j-th database, the data type of the data to be written is divided into the j-th data type; wherein j is a positive integer and 1≤j≤N-1; When the file name of the data to be written does not match any of the preset N-1 databases, the data type of the data to be written is divided into an Nth data type.

4. The data storage method of the distributed storage system according to claim 3, characterized in that: Also includes: Using the file name as a training sample and the statistical value of the number of modifications of the training sample within the first time period as a training label of the training sample, training the preset deep learning model; After the deep learning model is trained, different file names are input into the trained deep learning model in sequence, and based on the output results of the deep learning model, data of N-1 databases are updated.

5. The data storage method of the distributed storage system according to claim 3, characterized in that: Also includes: An adjustment instruction for the jth database is received, and a data item adding operation, a data item deleting operation, and / or a data item modifying operation is performed on the jth database according to the adjustment instruction.

6. The data storage method of the distributed storage system according to claim 1, characterized in that: N=3, the first data type is a read-only data type, the second data type is a cold data type, the third data type is a hot data type, and the first state of the disk cluster is G readonly Status, the second status of the disk cluster is G cold Status, the third status of the disk cluster is G hot state.

7. The data storage method of the distributed storage system according to claim 6, characterized in that: Also includes: When the data to be written is of the first data type and it is determined that there is no hard disk cluster in the first state, the data to be written is written into G hot Status or G cold In the disk cluster with status.

8. The data storage method of the distributed storage system according to claim 6, characterized in that: Also includes: When the data to be written is of the second data type and it is determined that there is no hard disk cluster in the second state, the data to be written is written into G hot In the disk cluster with status.

9. The data storage method of the distributed storage system according to claim 6, characterized in that: Also includes: When the data to be written is of the third data type and it is determined that there is no hard disk cluster in the third state currently, a prompt message indicating write failure is fed back.

10. The data storage method of the distributed storage system according to claim 1, characterized in that: The step of selecting a hard disk cluster in the i-th state includes: According to the rule that the lower the wear degree of the hard disk cluster, the higher the priority, a hard disk cluster in the i-th state is selected.

11. The data storage method of the distributed storage system according to claim 10, characterized in that: The method of selecting a hard disk cluster in the i-th state according to the rule that the lower the wear degree of the hard disk cluster, the higher the priority, includes: For each hard disk cluster in the i-th state, search in order from the smallest to the largest wear degree; When the current cluster write queue depth VG of any disk cluster in the i-th state is found cur_queue_depth <Preset maximum cluster write queue depth VG max_queue_depth When , stop searching and use the hard disk cluster as the selected hard disk cluster in the i-th state; After all disk clusters in the i-th state have been searched, there is no current cluster write queue depth VG cur_queue_depth <Preset maximum cluster write queue depth VG max_queue_depth When there are disk clusters in the i-th state, the disk cluster with the smallest cluster busyness VGbusy is selected as the disk cluster in the i-th state; The cluster busyness VGbusy of the disk cluster represents the current cluster write queue depth VG cur_queue_depth Divide by the maximum cluster write queue depth of VG max_queue_depth The value obtained afterwards.

12. The data storage method of the distributed storage system according to claim 1, characterized in that: Writing the data to be written into the selected hard disk cluster in the i-th state includes: According to the rule that the lower the wear degree of the hard disk, the higher the priority, the target hard disk is selected from the selected hard disk cluster in the i-th state; The data to be written is written into the selected target hard disk.

13. The data storage method of the distributed storage system according to claim 12, characterized in that: The step of selecting a target hard disk from the selected hard disk cluster in the i-th state according to the rule that the lower the wear degree of the hard disk, the higher the priority, includes: Search each hard disk in the selected hard disk cluster in the i-th state in order of the wear degree from small to large; When the current disk write queue depth VD of any disk in the disk cluster in the i-th state is found cur_queue_depth <Preset maximum hard disk write queue depth VD max_queue_depth When the hard disk is selected, the search stops and the hard disk is selected as the target hard disk; After all hard disks in the hard disk cluster in the i-th state have been searched, there is no current hard disk write queue depth VD cur_queue_depth <Preset maximum hard disk write queue depth VD max_queue_depth When there are multiple hard disks, the hard disk with the smallest hard disk busyness VDbusy is selected as the target hard disk; The hard disk busyness VDbusy of the hard disk indicates the current hard disk write queue depth VD cur_queue_depth Divide by the maximum disk write queue depth VD max_queue_depth The value obtained afterwards.

14. The data storage method of the distributed storage system according to claim 1, characterized in that: Each of the hard disk clusters in the distributed storage system is arranged in a first medium layer. The distributed storage system is also provided with an SCM medium layer to store target type data through the SCM medium layer and process non-block aligned write data through the SCM medium layer.

15. The data storage method of the distributed storage system according to claim 14, characterized in that: The first dielectric layer is a PLC dielectric layer or a QLC dielectric layer.

16. The data storage method of a distributed storage system according to any one of claims 1 to 15, characterized in that: In each hard disk cluster, data is stored in blocks of a set size. The data storage method of the distributed storage system also includes: Determine the P / E times of each block in the hard disk cluster in the i-th state, and calculate the average value of the P / E times of each block in the hard disk cluster; When there are blocks in the hard disk cluster in the i-th state whose difference between the P / E times and the average value is lower than the set first value, all blocks whose difference between the P / E times and the average value is lower than the set first value are taken as blocks to be migrated; If there is currently a hard disk cluster in the (i+1)th state, each of the blocks to be migrated in the hard disk cluster is migrated to the hard disk cluster in the (i+1)th state.

17. The data storage method of the distributed storage system according to claim 16, characterized in that: Also includes: After determining each of the blocks to be migrated, if there is no hard disk cluster in the i+1th state, then the K blocks with the largest P / E times in the hard disk cluster in the i-th state are exchanged with the data in the K blocks to be migrated in the hard disk cluster in the i-th state, so as to complete the internal migration of the K blocks to be migrated in the hard disk cluster in the i-th state; Here, K represents the number of blocks to be migrated determined in the hard disk cluster in the i-th state.

18. A data storage system of a distributed storage system, characterized in that: The distributed storage system includes multiple hard disk clusters, each of which includes multiple hard disks of the same model, and each hard disk in the same hard disk cluster is added to the distributed storage system in the same batch. The data storage system of the distributed storage system includes: A type classification module, used for receiving data to be written and classifying the data types of the data to be written; wherein, among the set N data types, the estimated number of modifications of the data to be written of the i+1th data type within the first time length is higher than the estimated number of modifications of the data to be written of the ith data type within the first time length, and N is a positive integer not less than 2; A hard disk cluster status judgment module, used for judging whether there is a hard disk cluster in the i-th state when the data type of the data to be written is the i-th data type; if there is a hard disk cluster in the i-th state, triggering the hard disk cluster selection module; The hard disk cluster selection module is used to select a hard disk cluster in the i-th state; A writing module is used to write the data to be written into the selected hard disk cluster in the i-th state; wherein, among the hard disk clusters in the set N states, the wear degree of the hard disk cluster in the i+1th state is lower than the wear degree of the hard disk cluster in the i-th state, and i is a positive integer.

19. A data storage device of a distributed storage system, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the computer program to implement the steps of the data storage method of the distributed storage system as described in any one of claims 1 to 17.

20. A computer non-volatile readable storage medium, characterized in that: The computer non-volatile readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data storage method of the distributed storage system according to any one of claims 1 to 17 are implemented.

Citation Information

Patent Citations

  • Method for prolonging service life of cloud storage SSD (Solid State Disk) device

    CN102393809A

  • Data distribution method for decentralized distributed heterogeneous storage system

    CN109196459A

  • Solid state disk, wear balancing method thereof and terminal equipment

    CN112817880A

  • Data storage method, system and equipment of distributed storage system and storage medium

    CN115934007A

  • RAID groups based on endurance sets

    US9946471B1

Cited By

  • Data storage method and related device

    CN118939201A