Data storage method and distributed system
By obtaining the data heat index and the current storage method and determining the target storage method, the problem that redundant storage in the existing technology cannot take into account both read and write efficiency and security is solved, and a more reasonable data storage adjustment is achieved.
Patent Information
- Application Number
- CN202210299799.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-24
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2042-03-24
AI Technical Summary
Existing technologies cannot reasonably balance read and write efficiency and security requirements in data redundancy storage, and the adjustments are too simplistic.
By obtaining the heat index and current storage mode of the original data, the target storage mode is determined, and the data storage is updated based on the target storage mode to meet the read and write efficiency and security requirements.
It achieves a balance between read and write efficiency and security requirements in data storage, making storage more reasonable and meeting diverse user needs.
Smart Images

Figure CN114637750B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present specification relate to the technical field of computer technology, and in particular, to a data storage method. BACKGROUND
[0002] In order to improve the security of data, redundant storage is widely used in data storage scenarios.
[0003] In the related art, redundant storage can be implemented in a copy manner, an erasure code (EC) manner, and the like. The copy manner refers to storing a copy of original data, and the erasure code manner refers to storing each data block obtained by cutting the original data by an erasure code.
[0004] However, when adjusting the redundant storage in the above manner, the redundancy of the storage result is usually adjusted from the perspective of the difference in security requirements, and the demand that can be met is too single and not reasonable enough. Therefore, a more reasonable solution is needed. SUMMARY
[0005] Therefore, the embodiments of the present specification provide a data storage method. One or more embodiments of the present specification also relate to a distributed system, a data storage device, a computing device, a computer-readable storage medium, and a computer program to solve the technical defects in the prior art.
[0006] According to a first aspect of the embodiments of the present specification, a data storage method is provided, applied to a metadata node of a distributed system, including:
[0007] obtaining a hotness index of original data and a current storage manner of the original data;
[0008] determining a target storage manner of the original data according to the hotness index and the current storage manner;
[0009] updating storage of the original data based on the target storage manner.
[0010] According to a second aspect of the embodiments of the present specification, a distributed system is provided, including: a metadata node and a data storage node;
[0011] The metadata node is configured to obtain a hotness index of original data and a current storage manner of the original data; determine a target storage manner of the original data according to the hotness index and the current storage manner, and send a storage instruction based on the target storage manner to the data storage node;
[0012] The data storage node is configured to update storage of the original data based on the storage instruction.
[0013] According to a third aspect of the embodiments of the present specification, a computing device is provided, comprising:
[0014] a memory and a processor;
[0015] The memory is configured to store computer-executable instructions, and the processor is configured to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the data storage method.
[0016] According to a fourth aspect of the embodiments of the present specification, a computer-readable storage medium is provided, which stores computer-executable instructions, which, when executed by a processor, implement the steps of the data storage method.
[0017] According to a fifth aspect of the embodiments of the present specification, a computer program is provided, which, when executed in a computer, causes the computer to perform the steps of the data storage method.
[0018] One embodiment of the present specification realizes obtaining a heat index of original data and a current storage manner of the original data, determining a target storage manner of the original data according to the heat index and the current storage manner, and updating storage of the original data based on the target storage manner.
[0019] In the embodiments of the present specification, different storage manners can meet different read-write efficiency requirements. In addition, the heat index of the original data can reflect the read-write efficiency requirement of the original data. Therefore, the target storage manner corresponding to the heat index of the original data can be determined according to the heat index of the original data and the current storage manner. On this basis, the storage of the original data is updated based on the target storage manner, which can ensure that the storage of the original data can meet the read-write efficiency requirement. In addition, any storage manner is a storage manner capable of meeting the security requirement. Therefore, through the adjustment of the storage manner, it is ensured that the adjustment can take into account the read-write efficiency requirement and the security requirement, the requirement met is more comprehensive, and the storage is more reasonable. BRIEF DESCRIPTION OF DRAWINGS
[0020] Figure 1 is a flowchart of a data storage method provided by one embodiment of the present specification;
[0021] Figure 2 is a processing procedure flowchart of storage updating in the case of copy storage in a data storage method provided by one embodiment of the present specification;
[0022] Figure 3 is a processing procedure flowchart of storage updating in the case of erasure coding storage in a data storage method provided by one embodiment of the present specification;
[0023] Figure 4 is an example diagram of an application scenario of a data storage method provided by an embodiment of the present specification in a distributed system;
[0024] Figure 5 is a structural schematic diagram of a distributed system provided by an embodiment of the present specification;
[0025] Figure 6 is a structural schematic diagram of a data storage device provided by an embodiment of the present specification;
[0026] Figure 7 is a structural block diagram of a computing device provided by an embodiment of the present specification. DETAILED DESCRIPTION
[0027] In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present specification. However, the present specification can be practiced without the specific details, other than in the examples described herein. Those of ordinary skill in the art, and others, can readily ascertain many ways of making and using the present specification without departing from the scope of the present specification, and the present specification is not limited by the following examples.
[0028] The terminology used in one or more embodiments of the present specification is for the purpose of describing particular embodiments only and is not intended to be limiting of one or more embodiments of the present specification. As used in one or more embodiments of the present specification and the accompanying claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in one or more embodiments of the present specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0029] It will be understood that, although the terms first, second, etc. can be used herein to describe various information, these terms are not intended to denote a temporal or chronological order. Rather, these terms are used solely to distinguish one from another only. For example, without departing from the scope of one or more embodiments of the present specification, first can be termed second, and similarly, second can be termed first. Depending on the context, the word "if' as used herein can be interpreted to mean "when" or "in response to determining" or "in response to a determination".
[0030] First, the noun terms related to one or more embodiments of the present specification are explained.
[0031] Distributed system: is a loosely coupled system composed of multiple processors interconnected by communication lines.
[0032] MetaNode: A centralized node in a distributed system for storing metadata. Metadata, also known as intermediary data or relay data, is data about data, mainly information describing data properties, used to support functions such as indicating storage location, historical data, resource lookup, file recording, etc. For example, metadata can typically be state information of stored files, location information of data segments (chunks) of stored files, length information of chunks, etc.
[0033] DataNode: A node in a distributed system that stores data blocks, typically responsible for writing, storing, reading, deleting, etc. of data block replicas.
[0034] Client: A component in a distributed system that provides users with metadata-based operations and data read / write.
[0035] EC (Erasure Coding): An error correction algorithm. The basic principle is to segment the transmitted signal, add certain checks, and make each segment interrelated. Even if part of the signal is lost during transmission, the receiving end can still calculate the complete information through the algorithm. In data storage, EC divides data into segments, i.e. data blocks, expands and encodes redundant data blocks, and stores them in different locations, such as different disks, storage nodes, etc. Using EC algorithm to divide the original data into blocks, the total number of data blocks = original data block number + check block number, i.e. n = k + m. EC technology allows recovery of the original data in the scenario of any m data block damage in data storage. The original data block is the data block obtained by directly dividing the original data.
[0036] A distributed storage system often divides a byte stream written into the system into small segments (chunks), and stores the chunks in the form of EC stripes, copies in different nodes of the distributed system. Among them, the EC stripe is the data block obtained after the data is processed by the erasure code. For example, one chunk is stored as three copies, and another chunk is stored as an EC stripe containing three parity data blocks and eight original data blocks. The stored data can be used for subsequent reading. Compared with multiple copies, the redundancy ratio of the EC stripe is lower; the fewer the number of copies, the lower the redundancy ratio; the wider the EC stripe, the lower the redundancy ratio. Among them, the redundancy ratio is the ratio of the total amount of disaster recovery data to the original data, and the disaster recovery data is specifically the copies, data blocks of the EC stripe. When reading data, for the original data stored by copies, any one copy can be read to obtain the data, and the more the number of copies, the more data sources available for reading. For the original data stored by EC, the original data blocks can be reconstructed to obtain the data, and the wider the EC stripe, the more data blocks needed for reconstruction. In this way, the copy storage method can be directly read and copied, so the read-write efficiency is higher than that of the erasure code storage. And the redundancy ratio of the EC stripe is lower, and correspondingly, under the same disaster recovery capability, the occupied storage space is smaller.
[0037] On the basis of the above, in the present specification, a data storage method is provided, and the present specification also relates to a distributed system, a data storage device, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.
[0038] Reference is made to Figure 1 , Figure 1 A flowchart of a data storage method according to one embodiment of the present specification is shown, which is applied to a metadata node of a distributed system, and specifically includes the following steps:
[0039] S102, obtaining a hotness index of the original data and a current storage mode of the original data.
[0040] Among them, the original data includes the data stored in the distributed system. In one case, the original data can be the data center stored in the distributed system, and the data allowed to be updated. The current storage mode of the original data is the storage mode of the original data in the distributed system before updating the storage of the original data. For example, the current storage mode of the original data can be copy storage or erasure code storage, etc. The copy storage includes: storing the original data and at least one copy of the original data. The erasure code storage includes: dividing the original data into blocks by using a preset erasure code algorithm, and storing the obtained multiple data blocks. And the hotness index of the original data is an index that can reflect the read-write efficiency demand of the original data. Therefore, in an optional implementation, the above obtaining the hotness index of the original data can specifically include the following steps:
[0041] The read-write frequency of the original data is obtained, and a hotness index of the original data is obtained based on the read-write frequency.
[0042] Specifically, in the data structure, the frequency refers to a defined variable in its function, and is the total number of basic operations of the defined variable in the function before the execution of the statement. For example, the client can collect the read-write frequency of the original data, that is, the read / write frequency, and periodically send the read-write frequency of the original data to the metadata node through the heartbeat connection. In this way, the hotness index of the original data can be obtained without complex calculation and analysis, which is more convenient.
[0043] In one case, the metadata node can periodically request the client for the hotness index of the original data. Alternatively, the metadata node can receive an access request of the client for the original data, which can include a read request or a write request, and thus the metadata node can directly collect the read-write frequency of the original data. For the original data in the form of replica storage, the read-write frequency of any replica is the same as that of the same source replica, that is, the read-write frequency is the read-write frequency of the same source data. The source data refers to the data that is the source of the original data stored in the distributed system, for example, the data used to copy the replica or the data used to obtain the EC stripe.
[0044] In one case, the above-mentioned obtaining of the hotness index of the original data can specifically include the following steps:
[0045] The project data interacting with the access request of the original data is obtained, and the hotness index of the original data is obtained by counting the obtained project data. For example, the original data is video data, and the project data interacting with the access request of the video data includes data such as the number of collections, the number of plays, and the number of comments. The data such as the number of collections, the number of plays, and the number of comments are counted to obtain the hotness index of the video data.
[0046] In an optional embodiment, the distributed system stores a plurality of data of a target user;
[0047] Correspondingly, before the above-mentioned obtaining of the hotness index of the original data, the data storage method provided by the embodiments of the present disclosure can further include the following steps:
[0048] A storage configuration interface corresponding to the plurality of data is displayed, and storage configuration information sent by a client of the target user is received;
[0049] Correspondingly, the above-mentioned obtaining of the hotness index of the original data can specifically include the following steps:
[0050] According to the storage configuration information, original data among the multiple data are determined, and a heat index of the original data is obtained.
[0051] In a specific application, the metadata node can send the rendering data of the storage configuration interface corresponding to multiple data to the client of the target user, thereby receiving the storage configuration information sent by the client of the target user. The storage configuration information is used to characterize the storage specifications of the original data. Exemplarily, the storage configuration information may at least include: the data identifier of the original data targeted by the storage configuration information and the minimum fault tolerance, that is, the disaster recovery capability, and may also include the upper and lower limits of data redundancy, whether storage updates are allowed, etc. Exemplarily, the minimum fault tolerance may be that two data blocks can be lost, and the upper and lower limits of data redundancy are 1.375-10, etc.
[0052] On the basis of the above, the original data among the multiple data is determined based on the storage configuration information. Specifically, this may include: matching the storage configuration information with the multiple data, and obtaining the original data if the match is successful. Alternatively, information on whether storage updates are allowed is extracted from the storage configuration information. If the extraction result indicates that storage updates are allowed, the data among the multiple data corresponding to the data identifier contained in the storage configuration information is determined as the original data. In this way, the distributed system can change the configuration of the file within the redundancy range and ensure the minimum fault tolerance capability of the storage update results. Through this embodiment, the user can independently set the storage specifications of the original data, thereby ensuring that the storage of the original data better meets the user's needs.
[0053] Any method for obtaining a heat index may be used in this specification, and this embodiment does not impose any limitation thereto.
[0054] S104: Determine the target storage mode of the original data according to the popularity index and the current storage mode.
[0055] In specific applications, the target storage method refers to the storage method that matches the heat index. Moreover, different storage methods can meet different read and write efficiency requirements. The heat index of the original data can reflect the read and write efficiency requirements for the original data. Therefore, the target storage method corresponding to the heat index of the original data can be determined based on the heat index of the original data and the current storage method. The specific method of determining the target storage method of the original data based on the heat index and the current storage method may include: searching for the target storage method of the original data from the pre-established correspondence between the heat index, the current storage method and the target storage method. Or, illustratively, the target storage of the original data can be determined based on the current storage method according to the different conditions satisfied by the heat index. In order to facilitate understanding and reasonable layout, this example will be specifically described in the form of an optional embodiment later.
[0056] S106, update the storage of the original data based on the target storage mode.
[0057] In a specific application, the storage of the original data is updated based on the target storage mode, which can ensure that the storage of the original data can meet the read-write efficiency requirement. Moreover, any storage mode is a storage mode that can meet the security requirement. Therefore, through the adjustment of the storage mode, it is ensured that the adjustment can take into account the read-write efficiency requirement and the security requirement, the requirement met is more comprehensive, and the storage is more reasonable. Moreover, corresponding to different target storage modes, the specific way of updating the storage of the original data based on the target storage mode is different, in order to facilitate understanding and reasonable layout, the specific way is described in the form of optional embodiments. Moreover, in an optional implementation, after the above updating the storage of the original data based on the target storage mode, the data storage method provided by the embodiments of the present specification can further include the following steps:
[0058] obtain the updated storage result;
[0059] update the storage record of the original data based on the updated storage result.
[0060] The storage record of the original data can be in the form of metadata of the updated storage result. For example, the storage record can include: the storage location of the original data after the storage is updated, storage configuration information, and the like. The storage location can be the storage location of each segment of the copy and the storage location of the EC stripe. The storage configuration information is used to represent the storage specification of the original data. For example, the storage configuration information can at least include: the data identifier of the original data to which the storage configuration information is directed and the minimum fault tolerance capability, that is, the disaster tolerance capability, and can further include the upper and lower limits of the data redundancy, whether to allow storage update, and the like. For example, the minimum fault tolerance capability can be that two data blocks can be lost, the upper and lower limits of the data redundancy are 1.375-10, and the like.
[0061] In the embodiments of the present specification, different storage modes can meet different read-write efficiency requirements. Moreover, the heat index of the original data can reflect the read-write efficiency requirement of the original data. Therefore, the target storage mode corresponding to the heat index of the original data can be determined according to the heat index of the original data and the current storage mode. On this basis, the storage of the original data is updated based on the target storage mode, which can ensure that the storage of the original data can meet the read-write efficiency requirement. Moreover, any storage mode is a storage mode that can meet the security requirement. Therefore, through the adjustment of the storage mode, it is ensured that the adjustment can take into account the read-write efficiency requirement and the security requirement, the requirement met is more comprehensive, and the storage is more reasonable.
[0062] In an alternative embodiment, the above-mentioned target storage mode-based updating of the storage of the original data can specifically include the following steps:
[0063] In the case where the target storage mode is different from the current storage mode, the current quantity of the disaster recovery data in the original data under the current storage mode is identified;
[0064] According to the current quantity, the target quantity of the disaster recovery data in the original data under the target storage mode is determined, and the storage of the original data is updated using the target storage mode according to the target quantity.
[0065] The storage mode change determines the target storage mode through the current redundancy of the disaster recovery data, ensures that the security is consistent before and after the adjustment, and is more in line with the demand.
[0066] In specific applications, the current quantity of the disaster recovery data in the original data under the current storage mode can represent the disaster recovery effect of the current storage mode. For example, the current quantity of the disaster recovery data can be the number of copies, the number of check blocks, and the like in the original data under the current storage mode. Moreover, the target storage mode is different from the current storage mode, indicating that the read-write efficiency requirement has changed, and the security performance, i.e., the disaster recovery capability requirement, is likely to remain unchanged. On this basis, in order to determine the target storage mode through the current quantity of the disaster recovery data, ensure that the disaster recovery capability is consistent before and after the storage update, and be more in line with user requirements, the steps of the present embodiment can be performed. Illustratively, the disaster recovery capability of copy storage is to tolerate 2 copies lost, so the number of copies is 3. Correspondingly, when converted to erasure code storage, the disaster recovery capability is to tolerate 2 losses, so m is 2 in the erasure code algorithm, and the splitting parameter of the erasure code algorithm that has the same disaster recovery effect as copy storage can be obtained according to the redundancy of the erasure code algorithm. The redundancy of the erasure code algorithm is the ratio of the total number of data blocks to m, so the value of the splitting parameter k of the erasure code algorithm that has the same disaster recovery effect as copy storage can be determined according to the above-mentioned redundancy.
[0067] In an alternative embodiment, the above-mentioned determination of the target storage mode of the original data according to the heat index and the current storage mode can specifically include the following steps:
[0068] If the heat index meets the first heat condition, the target storage mode of the original data is determined to be the copy storage mode;
[0069] If the heat index meets the second heat condition, the target storage mode of the original data is determined to be the erasure code storage mode.
[0070] In specific applications, a heat index meeting the first heat condition may include: the heat index falling within a first heat range, or the heat index being greater than or equal to a first heat threshold. The replica storage method involves storing multiple copies of the original data. The heat index meeting the second heat condition may include: the heat index falling within a second heat range, or the heat index being less than a second heat threshold. The erasure coding storage method utilizes an erasure coding algorithm to obtain and store multiple data blocks of the original data. This allows replica storage to be used for relatively high-heat original data, meaning data with higher read / write efficiency requirements, while erasure coding can be used for relatively low-heat original data, meaning data with lower read / write efficiency requirements. Subsequent storage updates of the original data using the target storage method ensure that the replica storage meets the high read / write efficiency requirements of high-heat data. Furthermore, low-heat data, meaning original data whose heat index meets the second heat condition, is transferred from replica storage to EC storage, saving storage space and alleviating the storage space usage caused by the EC to replica conversion. This achieves the goal of both improving read / write efficiency and reducing storage space usage.
[0071] In an optional embodiment, determining the target storage mode of the original data based on the popularity index and the current storage mode may specifically include the following steps:
[0072] Comparing the heat index with the third heat condition, and determining whether to adjust the current amount of disaster recovery data of the original data based on the comparison result;
[0073] If the adjustment is determined, the target quantity of disaster recovery data is determined based on the comparison result and the current quantity, and the current storage method is updated according to the target quantity to obtain the target storage method of the original data.
[0074] In a specific application, comparing the heat index with the third heat condition may specifically include: judging whether the heat index belongs to the third heat interval or the size relationship between the heat index and the third heat threshold. In this way, determining whether to adjust the current number of disaster recovery data of the original data based on the comparison result may specifically include: if the heat index belongs to the third heat interval, then determining the adjustment; or, if the heat index is not equal to the third heat threshold, then determining the adjustment. The adjustment in this embodiment is also the target storage method, which means that the redundant storage method remains unchanged, and the number of redundant data, that is, disaster recovery data, is adjusted. Therefore, the target number of disaster recovery data can be determined based on the comparison result and the current number, and the current storage method can be updated according to the target number to obtain the target storage method of the original data. In this way, the number of disaster recovery data is adjusted according to the comparison result to ensure that the adjustment result is more accurate. And the adjustment method is consistent with the current storage method, so the problem of reduced adjustment efficiency caused by changing the storage method for adjustment can be reduced.
[0075] According to the comparison result and the current quantity, the target quantity of the disaster recovery data is determined, and specifically, the target quantity of the disaster recovery data can be obtained by summing the preset increment and the current quantity when the hotness index belongs to the first sub-interval in the third hotness interval, and the target quantity of the disaster recovery data can be obtained by subtracting the preset increment from the current quantity when the hotness index belongs to the second sub-interval in the third hotness interval. The lower limit of the first sub-interval is greater than the upper limit of the second sub-interval. The preset increment is a positive value, and can be set according to the minimum fault tolerance capability, the upper and lower limits of the data redundancy, and other configuration information in the storage configuration information. Alternatively, according to the comparison result and the current quantity, the target quantity of the disaster recovery data is determined, and specifically, the target quantity of the disaster recovery data can be obtained by summing the preset increment and the current quantity when the hotness index is greater than or equal to the third hotness threshold, and the target quantity of the disaster recovery data can be obtained by subtracting the preset increment from the current quantity when the hotness index is less than the third hotness threshold.
[0076] In an optional embodiment, the current storage mode is updated according to the target quantity to obtain a target storage mode of the original data, and specifically, the following steps can be included:
[0077] In the case where the current storage mode is erasure code storage, the slice parameters corresponding to the erasure code storage are updated according to the target quantity to obtain the target storage mode;
[0078] In the case where the current storage mode is copy storage, the number of copies of the original data is adjusted to the target quantity to obtain the target storage mode.
[0079] In a specific application, the erasure code storage includes: dividing the original data into blocks by using an erasure code algorithm, and the total number of data blocks obtained is equal to the number of original data blocks plus the number of check blocks, that is, n=k+m, and the erasure code technology allows the original data to be recovered in the case where any m data blocks are damaged in data storage. Among them, the original data block is a data block obtained by directly dividing the original data. Therefore, the slice parameters corresponding to the erasure code storage can include at least one of the number of original data blocks and the number of check blocks. In this way, the disaster recovery data of the original data is updated by using the slice result, which can ensure the effectiveness of the adjustment compared with directly adjusting the number of disaster recovery data: the original data can still be recovered after the number of disaster recovery data is reduced, and the disaster recovery effect is effective; the occupied storage space is relatively lower after the number of disaster recovery data is increased, and the advantage of the erasure code algorithm is retained. Moreover, the update of the copy storage is to adjust the number of copies of the original data to the target quantity, so that the number of copies is directly copied for the case of increasing the number of copies, and the number of copies is directly deleted for the case of reducing the number of copies, and the read-write efficiency is higher.
[0080] For example, Figure 2The data storage method provided by one embodiment of the present specification is shown in the processing procedure flowchart of storage update in the case of replica storage. The embodiment introduces a scheduler and multiple executors. The scheduler is centrally deployed in the distributed system. One scheduler can be deployed specially, or the scheduler can be a process under the metadata node MetaNode, or the scheduler can be part of the working process of the metadata node MetaNode. For data stored in the form of replicas, increasing or decreasing the number of replicas only needs to go through chunk-level replication and deletion. Taking the scheduler as an example, the change process includes: 1. The MetaNode obtains all chunks of the original data for storage update, and selects nodes / replicas for replica increase or deletion. For example, the file File1 is divided into chunks 0 to 5. For this, chunk 0 3 replicas -> 5 replicas: update chunk 0 from 3 replicas storage to 5 replicas storage; chunk 1 3 replicas -> 5 replicas: update chunk 1 from 3 replicas storage to 5 replicas storage. Moreover, the instruction for deleting replicas is sent directly by the scheduler of the MetaNode to the executors storing the corresponding replicas. The replica replication task is sent to the scheduler in chunk granularity. 2. The scheduler selects executors for each chunk replica replication task according to certain rules. For example, the task of chunk 0 3 replicas -> 5 replicas and the task of chunk 1 3 replicas -> 5 replicas are executed by executor 1 and executor 3, respectively. 3. After the executors complete the above-mentioned replica replication task, they send a replication success notification to the scheduler. For example, executor 3 completes the above-mentioned replication. 4. The scheduler feeds back the storage update result to the metadata node. For example, the scheduler feeds back the result of updating chunk 1 to 5 replicas storage to the metadata node.
[0081] To this end, in an optional embodiment, the above-mentioned storage update of the original data based on the target storage mode can specifically include the following steps:
[0082] According to the target storage mode, determine the storage indication for the original data;
[0083] Send the storage indication to the scheduler of the distributed system, so that the scheduler obtains the processing performance indicators of each storage node in the distributed system, and determines the target storage node in each storage node according to the processing performance indicators and the storage indication, and sends the storage indication to the target storage node to instruct the target storage node to update the storage of the original data.
[0084] In a specific application, the processing performance indicator can be the number of storage tasks of each storage node, the size of the data volume to which the storage task is directed, and the like. The storage indication includes at least parameters for performing the target storage mode on the original data, such as the number of copies, the number of slices, and the like, for determining the number of execution nodes. The executor is generally on the DataNode, which can be a separate process of the DataNode or a part of the working process of the DataNode. In this way, when selecting the executor, that is, the target storage node, the executor with too large task volume and too high task number can be reduced, thereby improving the storage efficiency. The target storage node updates the storage of the original data, which can specifically include copying the copies by the executor to the specified location, wherein the specified location can be a storage space in the target storage node or a specified storage node, which are both reasonable and can be set according to the application scenario.
[0085] In an optional embodiment, the target storage mode is copy storage, and the storage indication includes node information of a source node corresponding to the original data and node information of a destination node.
[0086] Correspondingly, the step of sending the storage indication to the scheduler of the distributed system can specifically include the following steps:
[0087] The storage indication is sent to the scheduler of the distributed system, so that the scheduler determines the target storage node in each storage node according to the node information of the source node and the node information of the destination node.
[0088] The source node refers to the node of the source data storing the original data, and the source data can include the original data or a copy of the original data. The destination node refers to the node for copy storage of the source data. According to the node information of the source node and the node information of the destination node, the target storage node in each storage node can be determined, which can include: the source node itself, the destination node itself, the node with a distance less than a distance threshold from the source node, or the node with a distance less than a distance threshold from the destination node, are determined as the target storage node in each storage node.
[0089] Extension: The distance between the two nodes meets the distance condition. In this way, the embodiment can select the source node, the destination node, the node with relatively higher data transmission efficiency from the source node, and the node with relatively higher data transmission efficiency from the destination node as the target storage node to perform the task, thereby saving the time consumed for data transmission during data reading and storage, and improving the efficiency of storage update.
[0090] For example, Figure 3The data storage method provided by one embodiment of the present specification is shown in the processing procedure flowchart of storage update in the case of erasure code storage. For the change of erasure code data redundancy and the change of storage mode, such as the change from erasure code to copy and the change from copy to erasure code, the processing granularity is file-level rewriting. The storage update flow can include: 1. The metadata node MetaNode determines the new configuration and sends the file copy task to the scheduler for file-level data copy. For example, the new configuration is to rewrite File1 as 8+3 EC. 2. The scheduler of the metadata node selects an executor from multiple executors to execute the copy task and sends the new configuration to the selected executor. For example, the configuration of "copy File1 as 8+3 EC" is sent to executor 3, that is, executor 3 is instructed to store File1 as 8+3 EC. Moreover, the scheduler can avoid selecting executors with more copy tasks to ensure higher efficiency. 3. The executor performs storage update according to the new configuration and feeds back the copy success message to the scheduler. Wherein, the copy success represents the completion of the update storage. 4. The scheduler returns the execution result to the metadata node MetaNode after the task is executed, and the metadata node MetaNode replaces the original file with the newly copied file and deletes the original file after a certain period of time. For example, after the scheduler feeds back the result, the metadata node replaces File1 with the 8+3 EC file: the storage information of File1 is replaced with the storage information of 8+3 EC.
[0091] Moreover, when the executor performs the task, the network and disk bandwidth usage of the executor can be observed, and the background copy rate can be adjusted to avoid affecting the foreground application. Therefore, in an optional embodiment, the above-mentioned storage update of the original data based on the target storage mode can specifically include the following steps:
[0092] According to the target storage mode, the target storage node in the distributed system and the storage indication for the original data are determined;
[0093] The storage indication is sent to the target storage node, so that the target storage node obtains the current available computing resource, allocates the target computing resource based on the current available computing resource, and updates the storage of the original data based on the storage indication according to the target computing resource.
[0094] In a specific application, the current available computing resource is a computing resource that is not currently occupied by the target storage node. For example, the current available computing resource can include a network bandwidth of a disk that is currently available to the target storage node, an acceptable load size, and the like. Moreover, based on the current available computing resource, allocating the target computing resource can include: dividing the target computing resource from the current available computing resource according to an allocation ratio. The allocation ratio can be a pre-set fixed value, for example, 70%. For example, the current available computing resource can be obtained by obtaining a historical load of the target storage node in a last storage update stage, for example, a bandwidth occupied by a client accessing the target storage node, and calculating a difference between the historical load and a total bandwidth of the target storage node. In a case, a minimum computing resource can be pre-set, and if the above current available computing resource is less than the minimum computing resource, the minimum computing resource is taken as the current available computing resource. In addition, the scheduler can poll the executor to obtain a task completion condition.
[0095] The application of the data storage method provided in the specification in a distributed system is described below. Figure 4 The application of the data storage method provided in the specification in a distributed system is described below. Figure 4 An application scenario example diagram of a data storage method provided in an embodiment of the specification in a distributed system is shown, and specifically includes the following steps:
[0096] Step 1, the storage system, that is, the distributed system, provides a file, that is, original data, and the configuration range can be controlled by a user. The user can set the minimum fault tolerance capability (for example, two data blocks can be lost) and the upper and lower limits of data redundancy (for example, 1.375-10) of the file through a client, for example, Client1 and Client2. The distributed system can change the configuration of the file within the redundancy range and ensure the minimum fault tolerance capability of the file. For example, the client sets the configuration information of the variable configuration file File1, that is, the storage of the updateable file File1, as follows: redundancy 1.375-5, minimum fault tolerance 2, that is, two disaster recovery data can be lost without affecting the integrity of the original data. Moreover, there can be alternative configurations: copies 3 / 4 / 5, EC8+3, 6+3, 4+3, and 2+3.
[0097] Step 2, the client Client collects the read / write frequency of the variable configuration file and periodically informs the metadata node MetaNode of the access frequency of the file through a heartbeat. For example, Client1 informs the metadata node MetaNode of the read / write frequency of the file F1, and Client2 informs the metadata node MetaNode of the read / write frequency of the file F1. The file F1 can refer to the file File1.
[0098] Step 3, the metadata node MetaNode collects the frequency, refers to the access frequency distribution of all files that need to be collected, that is, the files that can be stored and updated, and performs different storage updates on files with different access frequencies. For example, increase the redundancy of relatively high-frequency access files, and reduce the redundancy of relatively low-frequency access files. For example, File4 with relatively low-frequency access, File4 changes from 5 copies to 3 copies.
[0099] Step 4, for the data stored by the copy, increasing or decreasing the number of copies only needs to pass through the copy replication and deletion at the segment chunk level, and the cost is small. For the change of the data redundancy of the erasure code and the change of the storage mode (for example, the change from the erasure code storage to the copy storage, the change from the copy storage to the erasure code storage, etc.), the processing granularity is the file level rewriting. Therefore, the adjustment of the copy redundancy change of the copy storage is more likely to occur than the change of the data redundancy of the erasure code and the change of the storage mode.
[0100] The original data in the embodiment can be regarded as a file capable of automatic scaling configuration. In the data reading and writing process, by recording the global data reading frequency, the frequently accessed data is copied to the hot data friendly configuration (such as a high copy number of copies), and the cold data is downgraded to the cold data friendly configuration (such as a wide strip EC). In the configuration updating process, data migration is involved, and the present patent provides a complete migration protocol, defines the priority of different file configuration updates, and enables the priority to be realized through scheduling arrangement, and the configuration update behavior has low interference to the foreground service.
[0101] Corresponding to the method embodiment, the present specification also provides a distributed system embodiment, Figure 5 A structure schematic diagram of a distributed system provided by an embodiment of the present specification is shown. As shown in the figure, Figure 5 The distributed system 500 includes a metadata node 502 and a data storage node 504.
[0102] The metadata node 502 is configured to obtain a hotness index of original data and a current storage mode of the original data, determine a target storage mode of the original data according to the hotness index and the current storage mode, and send a storage instruction based on the target storage mode to the data storage node;
[0103] The data storage node 504 is configured to update the storage of the original data based on the storage instruction.
[0104] In the embodiments of the present specification, different storage modes can meet different read-write efficiency requirements. In addition, the heat index of the original data can reflect the read-write efficiency requirement for the original data. Therefore, the target storage mode corresponding to the heat index of the original data can be determined according to the heat index of the original data and the current storage mode. On this basis, the storage of the original data is updated based on the target storage mode, which can ensure that the storage of the original data can meet the read-write efficiency requirement. In addition, any storage mode is a storage mode that can meet the security requirement. Therefore, through the adjustment of the storage mode, it is ensured that the adjustment can take into account the read-write efficiency requirement and the security requirement, the requirement met is more comprehensive, and the storage is more reasonable.
[0105] Optionally, the metadata node 502 is further configured to:
[0106] In the case where the target storage mode is different from the current storage mode, the current number of disaster tolerance data in the original data under the current storage mode is identified;
[0107] According to the current number, the target number of disaster tolerance data in the original data under the target storage mode is determined, and the storage indication based on the target storage mode is determined according to the target number and by using the target storage mode.
[0108] Optionally, the metadata node 502 is further configured to:
[0109] If the heat index meets the first heat condition, the target storage mode of the original data is determined as the replica storage mode;
[0110] If the heat index meets the second heat condition, the target storage mode of the original data is determined as the erasure code storage mode.
[0111] Optionally, the metadata node 502 is further configured to:
[0112] The heat index is compared with the third heat condition, and whether to adjust the current number of disaster tolerance data of the original data is determined according to the comparison result;
[0113] If it is determined to adjust, the target number of disaster tolerance data is determined according to the comparison result and the current number, and the current storage mode is updated according to the target number to obtain the target storage mode of the original data.
[0114] Optionally, the metadata node 502 is further configured to:
[0115] In the case where the current storage mode is the erasure code storage, the slice parameter corresponding to the erasure code storage is updated according to the target number to obtain the target storage mode;
[0116] In a case where the current storage mode is replica storage, the number of copies of the original data is adjusted to a target number, and a target storage mode is obtained.
[0117] Optionally, the metadata node 502 is further configured to:
[0118] According to the target storage mode, a target storage node in the distributed system and a storage instruction for the original data are determined, and the storage instruction is sent to the target storage node.
[0119] The data storage node 504 is further configured to obtain current available computing resources of the target storage node, allocate target computing resources based on the current available computing resources, and update the storage of the original data based on the storage instruction according to the target computing resources.
[0120] Optionally, the metadata node 502 is further configured to:
[0121] According to the target storage mode, a storage instruction for the original data is determined, and the storage instruction is sent to a scheduler of the distributed system to enable the scheduler to obtain processing performance indicators of each storage node in the distributed system, and determine a target storage node in each storage node according to the processing performance indicators and the storage instruction, and send the storage instruction to the target storage node to instruct the target storage node to update the storage of the original data.
[0122] Optionally, the target storage mode is replica storage, and the storage instruction includes node information of a source node corresponding to the original data and node information of a destination node.
[0123] Correspondingly, the metadata node 502 is further configured to:
[0124] The storage instruction is sent to a scheduler of the distributed system to enable the scheduler to determine a target storage node in each storage node according to the node information of the source node and the node information of the destination node.
[0125] Optionally, the metadata node 502 is further configured to:
[0126] Obtain the updated storage result.
[0127] Based on the updated storage result, the storage record of the original data is updated.
[0128] Optionally, the metadata node 502 is further configured to:
[0129] Obtain the read-write frequency of the original data, and obtain a heat indicator of the original data based on the read-write frequency.
[0130] Optionally, the distributed system stores a plurality of data of a target user.
[0131] Correspondingly, the metadata node 502 is further configured to:
[0132] display a storage configuration interface corresponding to the plurality of data, and receive storage configuration information sent by a client of a target user;
[0133] According to the storage configuration information, determine the original data in the plurality of data, and obtain the heat index of the original data.
[0134] The above is a schematic scheme of a distributed system according to an embodiment. It should be noted that the technical scheme of the distributed system and the technical scheme of the data storage method described above belong to the same concept. The details of the technical scheme of the distributed system that are not described in detail can be referred to the description of the technical scheme of the data storage method.
[0135] Corresponding to the method embodiments described above, the present specification also provides data storage device embodiments, Figure 6 The structure of a data storage device provided by an embodiment of the present specification is shown. As shown in Figure 6 The device includes:
[0136] The reference information acquisition module 602 is configured to obtain the heat index of the original data and the current storage mode of the original data.
[0137] The target mode determination module 604 is configured to determine the target storage mode of the original data according to the heat index and the current storage mode.
[0138] The data storage update module 606 is configured to update the storage of the original data based on the target storage mode.
[0139] In the embodiments of the present specification, different storage modes can meet different read-write efficiency requirements. Moreover, the heat index of the original data can reflect the read-write efficiency requirement of the original data. Therefore, the target storage mode corresponding to the heat index of the original data can be determined according to the heat index of the original data and the current storage mode. On this basis, updating the storage of the original data based on the target storage mode can ensure that the storage of the original data can meet the read-write efficiency requirement. Moreover, any storage mode is a storage mode that can meet the security requirement. Therefore, by adjusting the storage mode, it is ensured that the adjustment can take into account the read-write efficiency requirement and the security requirement, so that the requirement is more comprehensive and the storage is more reasonable.
[0140] Optionally, the data storage update module 606 is further configured to:
[0141] In the case where the target storage mode is different from the current storage mode, identify the current number of disaster recovery data in the original data under the current storage mode.
[0142] According to the current quantity, a target quantity of the disaster recovery data in the original data in the target storage mode is determined, and storage of the original data is updated according to the target quantity and by using the target storage mode.
[0143] Optionally, the target mode determination module 604 is further configured to:
[0144] If the hotness index meets the first hotness condition, the target storage mode of the original data is determined as the replica storage mode.
[0145] If the hotness index meets the second hotness condition, the target storage mode of the original data is determined as the erasure code storage mode.
[0146] Optionally, the target mode determination module 604 is further configured to:
[0147] The hotness index is compared with a third hotness condition, and whether to adjust the current quantity of the disaster recovery data of the original data is determined according to a comparison result.
[0148] If it is determined to adjust, a target quantity of the disaster recovery data is determined according to the comparison result and the current quantity, the current storage mode is updated according to the target quantity, and a target storage mode of the original data is obtained.
[0149] Optionally, the target mode determination module 604 is further configured to:
[0150] In a case where the current storage mode is the erasure code storage, a slice parameter corresponding to the erasure code storage is updated according to the target quantity, and the target storage mode is obtained.
[0151] In a case where the current storage mode is the replica storage, a replica quantity of the original data is adjusted to the target quantity, and the target storage mode is obtained.
[0152] Optionally, the data storage updating module 606 is further configured to:
[0153] According to the target storage mode, a target storage node in the distributed system and a storage indication for the original data are determined.
[0154] The storage indication is sent to the target storage node, so that the target storage node obtains a current available computing resource, allocates a target computing resource based on the current available computing resource, and updates storage of the original data based on the storage indication according to the target computing resource.
[0155] Optionally, the data storage updating module 606 is further configured to:
[0156] According to the target storage mode, a storage indication for the original data is determined.
[0157] The storage instruction is sent to a scheduler of the distributed system, so that the scheduler acquires processing performance indexes of the storage nodes in the distributed system, and determines a target storage node in the storage nodes according to the processing performance indexes and the storage instruction. The storage instruction is sent to the target storage node, so as to instruct the target storage node to update storage of the original data.
[0158] Optionally, the target storage mode is copy storage; the storage instruction comprises node information of a source node corresponding to the original data and node information of a destination node.
[0159] Correspondingly, the data storage updating module 606 is further configured to:
[0160] The storage instruction is sent to a scheduler of the distributed system, so that the scheduler acquires processing performance indexes of the storage nodes in the distributed system, and determines a target storage node in the storage nodes according to the processing performance indexes and the storage instruction. The storage instruction is sent to the target storage node, so as to instruct the target storage node to update storage of the original data.
[0161] Optionally, the apparatus further comprises a record updating module configured to:
[0162] Acquire the updated storage result;
[0163] Update a storage record of the original data based on the updated storage result.
[0164] Optionally, the reference information acquiring module 602 is further configured to:
[0165] Acquire a read-write frequency of the original data, and obtain a heat index of the original data based on the read-write frequency.
[0166] Optionally, the distributed system stores a plurality of data of a target user.
[0167] Correspondingly, the reference information acquiring module 602 is further configured to:
[0168] Before acquiring the heat index of the original data, a storage configuration interface corresponding to the plurality of data is displayed, and storage configuration information sent by a client of the target user is received;
[0169] According to the storage configuration information, the original data in the plurality of data is determined, and the heat index of the original data is acquired.
[0170] The above is a schematic scheme of the data storage apparatus of the embodiment. It should be noted that the technical scheme of the data storage apparatus and the technical scheme of the data storage method described above belong to the same concept. The technical scheme of the data storage apparatus is not described in detail, and the description of the technical scheme of the data storage method can be referred to.
[0171] Figure 7A structural block diagram of a computing device is shown, in accordance with one embodiment of the present specification. The components of the computing device 700 include, but are not limited to, a memory 710 and a processor 720. The processor 720 is connected to the memory 710 through a bus 730, and a database 750 is used to store data.
[0172] The computing device 700 also includes an access device 740 that enables the computing device 700 to communicate via one or more networks 760. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 740 can include one or more of any type of network interface (e.g., a network interface card (NIC)), wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and the like.
[0173] In one embodiment of the present specification, the above-mentioned components of the computing device 700, as well as other components not shown in the Figure 7 may be connected to each other, such as through a bus. It should be understood that Figure 7 The structural block diagram of the computing device shown is for the purpose of example only, and is not a limitation on the scope of the present specification. Other components can be added or replaced as needed by those skilled in the art.
[0174] The computing device 700 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smartwatch, smart glasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or a PC. The computing device 700 can also be a mobile or stationary server.
[0175] The processor 720 is configured to execute the following computer-executable instructions, which implement the steps of the data storage method described above.
[0176] The above describes a schematic scheme of the computing device of the embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the data storage method described above belong to the same concept, and the details of the technical scheme of the computing device that are not described in detail can be referred to the description of the technical scheme of the data storage method.
[0177] An embodiment of the present specification further provides a computer-readable storage medium storing computer-executable instructions, which implement the steps of the data storage method described above when executed by a processor.
[0178] The above describes a schematic scheme of the computer-readable storage medium of the embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the data storage method described above belong to the same concept, and the details of the technical scheme of the storage medium that are not described in detail can be referred to the description of the technical scheme of the data storage method.
[0179] An embodiment of the present specification further provides a computer program, which causes a computer to perform the steps of the data storage method described above when the computer program is executed in the computer.
[0180] The above describes a schematic scheme of the computer program of the embodiment. It should be noted that the technical scheme of the computer program and the technical scheme of the data storage method described above belong to the same concept, and the details of the technical scheme of the computer program that are not described in detail can be referred to the description of the technical scheme of the data storage method.
[0181] The above describes specific embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in a different order and still accomplish desirable results. Additionally, the processes depicted in the figures do not necessarily require the particular order shown, or sequential order to achieve desirable results. In some implementations, multitasking and parallel processing can be advantageous.
[0182] The computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, software distribution medium, etc.
[0183] It should be noted that, for the foregoing method embodiments, in order to facilitate description, they are all described as a combination of a series of actions, but those skilled in the art should know that the present application is not limited to the order of the actions described, because according to the present application, certain steps can be performed in other order or at the same time. Secondly, those skilled in the art should know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present application.
[0184] In the above embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0185] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The alternative embodiments do not describe all the details and limit the present application to the specific embodiments described. Obviously, according to the content of the present application, many modifications and changes can be made. The present application selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present application, so that those skilled in the art can well understand and use the present application. The present application is limited by the claims and their entire scope and equivalents.
Claims
1. A data storage method, applied to a metadata node of a distributed system, comprising: Obtaining a heat index of the original data and a current storage mode of the original data; Determining a target storage mode for the original data based on the popularity index and the current storage mode; Based on the target storage mode, updating the storage of the original data; Wherein, updating the storage of the original data based on the target storage mode includes: In a case where the target storage mode is different from the current storage mode, identifying a current amount of disaster recovery data in the original data under the current storage mode, the current amount being used to indicate a disaster recovery capability before the storage mode is updated; Based on the current quantity, determine the target quantity of disaster recovery data in the original data under the target storage method, and according to the target quantity, use the target storage method to update the storage of the original data, wherein the target quantity is used to ensure that the disaster recovery capability after the storage method is updated is consistent with the disaster recovery capability before the storage method is updated.
2. The data storage method according to claim 1, wherein determining the target storage mode of the original data based on the popularity index and the current storage mode comprises: If the heat index meets the first heat condition, determining that the target storage mode of the original data is a copy storage mode; If the heat index meets the second heat condition, it is determined that the target storage mode of the original data is an erasure code storage mode.
3. The data storage method according to claim 1, wherein determining the target storage mode of the original data based on the popularity index and the current storage mode comprises: comparing the heat index with a third heat condition, and determining whether to adjust the current amount of disaster recovery data of the original data according to the comparison result; If adjustment is determined, the target quantity of the disaster recovery data is determined according to the comparison result and the current quantity, the current storage mode is updated according to the target quantity, and the target storage mode of the original data is obtained.
4. The data storage method according to claim 3, wherein updating the current storage mode according to the target quantity to obtain the target storage mode of the original data comprises: When the current storage mode is erasure code storage, updating slice parameters corresponding to the erasure code storage according to the target number to obtain a target storage mode; In a case where the current storage mode is copy storage, the number of copies of the original data is adjusted to the target number to obtain a target storage mode.
5. The data storage method according to any one of claims 1 to 4, wherein updating the storage of the original data based on the target storage mode comprises: Determining a target storage node in the distributed system and a storage instruction for the original data according to the target storage mode; The storage indication is sent to the target storage node so that the target storage node obtains currently available computing resources, allocates target computing resources based on the currently available computing resources, and updates the storage of the original data based on the storage indication according to the target computing resources.
6. The data storage method according to any one of claims 1 to 4, wherein updating the storage of the original data based on the target storage mode comprises: determining a storage instruction for the original data according to the target storage mode; The storage indication is sent to the scheduler of the distributed system so that the scheduler obtains the processing performance index of each storage node in the distributed system, and determines the target storage node among the storage nodes based on the processing performance index and the storage indication, and sends the storage indication to the target storage node to instruct the target storage node to update the storage of the original data.
7. The data storage method according to claim 6, wherein the target storage mode is replica storage; the storage indication includes node information of a source node corresponding to the original data and node information of a destination node; Accordingly, the sending the storage instruction to the scheduler of the distributed system includes: The storage instruction is sent to a scheduler of the distributed system, so that the scheduler determines a target storage node among the storage nodes according to the node information of the source node and the node information of the destination node.
8. The data storage method according to any one of claims 1 to 4, further comprising, after updating the storage of the original data based on the target storage mode: Get the updated storage result; Based on the updated storage result, the storage record of the original data is updated.
9. The data storage method according to any one of claims 1 to 4, wherein obtaining the heat index of the original data comprises: The read and write frequencies of the original data are obtained, and based on the read and write frequencies, a heat index of the original data is obtained.
10. The data storage method according to any one of claims 1 to 4, wherein the distributed system stores multiple data of target users; Accordingly, before obtaining the heat index of the original data, the method further includes: Displaying a storage configuration interface corresponding to the plurality of data, and receiving storage configuration information sent by a client of the target user; The heat index of the original data is obtained, including: According to the storage configuration information, original data among the multiple data are determined, and a heat index of the original data is obtained.
11. A distributed system comprising: Metadata nodes and data storage nodes; The metadata node is configured to obtain a heat index of the original data and a current storage mode of the original data; Determining a target storage mode for the original data according to the heat index and the current storage mode, and sending a storage instruction based on the target storage mode to the data storage node; The data storage node is configured to update storage of the original data based on the storage indication; Wherein, updating the storage of the original data based on the target storage mode includes: In a case where the target storage mode is different from the current storage mode, identifying a current amount of disaster recovery data in the original data under the current storage mode, the current amount being used to indicate a disaster recovery capability before the storage mode is updated; Based on the current quantity, determine the target quantity of disaster recovery data in the original data under the target storage method, and according to the target quantity, use the target storage method to update the storage of the original data, wherein the target quantity is used to ensure that the disaster recovery capability after the storage method is updated is consistent with the disaster recovery capability before the storage method is updated.
12. A computing device comprising: memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the data storage method according to any one of claims 1 to 10 are implemented.
13. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, implement the steps of the data storage method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Data redundancy fault-tolerance adaptation management device, service device, system and method
CN103631666A
A method and apparatus for redundant storage of data
CN109522151A
Data storage method and device
CN112748868A