A distributed storage mode control method, device, equipment and storage medium
By analyzing the read and write status information of user data and dynamically switching the distributed storage mode, the resource waste and insufficient performance caused by mismatch between storage mode and data access in the prior art are solved, and efficient storage space utilization and reading and writing are achieved Performance improvement.
Patent Information
- Application Number
- CN202111599778.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-24
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2041-12-24
AI Technical Summary
The existing distributed storage model is difficult to balance the efficiency of data disaster recovery and storage resource utilization, resulting in high storage costs and insufficient read and write performance.
By analyzing the read and write status information of user data, dynamically switch the storage mode, from copy mode to encoding mode or a mode combining encoding and copy, intelligent adjustments are made according to the data access situation.
It improves the efficiency of storage space, takes into account the read and write performance of stored data, and avoids the problems of waste of resources and insufficient performance.
Smart Images

Figure CN114398006B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data storage technology, and in particular to a distributed storage mode control method, device, equipment and storage medium. Background Art
[0002] Distributed object storage can store unstructured data in traditional replication mode or encoding mode, among which erasure coding mode is a commonly used encoding mode.
[0003] Among them, the copy mode can provide a certain data disaster recovery capability, but the storage resources occupied by this mode are doubled, which will lead to higher and higher storage costs; the encoding mode achieves data disaster recovery through encoding, which can save a certain amount of storage space, but data reconstruction is required when reading data, which consumes a lot of computing resources.
[0004] In related technologies, the storage mode is usually set by the operation and maintenance personnel and is rarely changed afterwards. However, according to the "80 / 20 principle" and actual observations, only a portion of user data is actively read and written, and most of the data is in a dormant state for a long time. Storing the increasing amount of dormant data in a replica mode will reduce the efficiency of storage resource utilization and lead to resource waste.
[0005] Therefore, how to improve the utilization efficiency of storage space while taking into account the read and write performance of stored data is an urgent problem to be solved. Summary of the invention
[0006] The purpose of the embodiments of the present invention is to provide a distributed storage mode control method, device, equipment and storage medium to improve the use efficiency of storage space while taking into account the read and write performance of stored data. The specific technical solution is as follows:
[0007] In a first aspect, an embodiment of the present invention provides a distributed storage mode control method, which is applied to an electronic device, and the method includes:
[0008] Determine target user data for which storage mode control is to be performed; wherein the target user data is user data stored in the storage cluster, and the types of storage modes include encoding mode, replica mode, and a mode combining encoding and replica;
[0009] Using the read and write status information of the target user data in the first historical period, identifying a first storage mode corresponding to the target user data; wherein the first storage mode is a storage mode adapted to the target user data in the first historical period;
[0010] Using the read and write state information of the target user data in a second historical period, predicting a second storage mode corresponding to the target user data; wherein the second storage mode is a storage mode adapted to the target user data in a specified period after the current time;
[0011] Determine whether the first storage mode and the second storage mode are the same, and obtain a determination result;
[0012] Based on the judgment result, determining a target storage mode to be adapted for the target user data;
[0013] If the target storage mode is different from the current storage mode of the target user data, a storage mode conversion process is performed on the target user data based on the target storage mode.
[0014] In a second aspect, an embodiment of the present invention provides a distributed storage mode control device, which is applied to an electronic device, and the device includes:
[0015] A first determination module is used to determine target user data to be subjected to storage mode control; wherein the target user data is user data stored in the storage cluster, and the types of storage modes include encoding mode, replica mode, and a mode combining encoding and replica;
[0016] an identification module, configured to identify a first storage mode corresponding to the target user data by using the read and write state information of the target user data in the first historical period; wherein the first storage mode is a storage mode adapted to the target user data in the first historical period;
[0017] A prediction module, used to predict a second storage mode corresponding to the target user data by using the read and write state information of the target user data in a second historical period; wherein the second storage mode is a storage mode adapted to the target user data in a specified period after a current time;
[0018] A judging module, configured to judge whether the first storage mode and the second storage mode are the same, and obtain a judging result;
[0019] A second determination module, configured to determine a target storage mode to be adapted for the target user data based on the determination result;
[0020] The conversion module is used to perform storage mode conversion processing on the target user data based on the target storage mode if the target storage mode is different from the current storage mode of the target user data.
[0021] In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0022] Memory, used to store computer programs;
[0023] The processor is used to implement any of the steps of the above-mentioned distributed storage mode control method when executing the program stored in the memory.
[0024] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned distributed storage mode control methods are implemented.
[0025] Beneficial effects of the embodiments of the present invention:
[0026] The solution provided by the embodiment of the present invention uses the read-write status information of the target user data in the first historical period to identify the first storage mode corresponding to the target user data; then, uses the read-write status information of the target user data in the second historical period to predict the second storage mode corresponding to the target user data; by judging whether the first storage mode and the second storage mode are the same, a judgment result is obtained; based on the judgment result, the target storage mode to be adapted for the target user data is determined; if the target storage mode is different from the current storage mode of the target user data, a storage mode conversion instruction is sent to the main control node, so that the main control node converts the storage mode of the user data to the target storage mode after receiving the storage mode conversion instruction. It can be seen that in this solution, the storage mode is dynamically controlled based on the read-write status information of the user data, that is, the storage mode is intelligently switched, so that the problem of storage space waste or unsatisfactory read-write performance caused by the mismatch between the storage mode and the access status of the user data can be alleviated. Therefore, through this solution, the use efficiency of the storage space can be improved and the read-write performance of the storage data can be taken into account.
[0027] Of course, it is not necessary to achieve all of the advantages described above at the same time to implement any product or method of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0029] Figure 1A flow chart of a distributed storage mode control method provided by an embodiment of the present invention;
[0030] Figure 2 An overall architecture diagram of a data storage system provided by an embodiment of the present invention;
[0031] Figure 3 A schematic diagram of a storage mode setting principle provided by an embodiment of the present invention;
[0032] Figure 4 A flowchart of an algorithm for recent state discrimination provided by an embodiment of the present invention;
[0033] Figure 5 A flow chart of a long-term trend prediction provided by an embodiment of the present invention;
[0034] Figure 6 A decision flow chart of a comprehensive decision module provided by an embodiment of the present invention;
[0035] Figure 7 An algorithm flow chart of a decision execution conversion module provided by an embodiment of the present invention;
[0036] Figure 8 A schematic diagram of the structure of a distributed storage mode control device provided by an embodiment of the present invention;
[0037] Fig. 9 The present invention is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0038] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field based on this application belong to the scope of protection of the present invention.
[0039] It has become a general trend to migrate applications to the cloud and realize cloud deployment. Cloud storage is the core performance of cloud computing clusters. The storage read and write capabilities of cloud computing clusters have a crucial impact on cluster performance. Existing distributed object storage can store unstructured data in traditional copy mode or encoding mode. However, both methods have their own limitations.
[0040] Among them, the replica mode, also known as the pure replica mode, is a commonly used storage mode that can provide certain data disaster recovery capabilities, but the storage resources occupied by this mode are doubled, which will bring a large cloud storage overhead and lead to increasingly high storage costs. The encoding mode, also known as the pure encoding mode, is more common in distributed file storage systems, such as ceph (a unified distributed storage system), etc.; data disaster recovery through the encoding mode can save a certain amount of storage space, but data reconstruction is required when reading data, which consumes a lot of computing resources; and when reconstruction is performed in the event of data loss, the node will be downgraded, resulting in slow response, which is not as fast as the replica mode.
[0041] In related technologies, the storage method is usually set by the operation and maintenance personnel and is rarely changed afterwards. However, according to the "80 / 20 principle" and actual observations, only a portion of user data in distributed object storage is actively read and written, and most of the data is in a dormant state for a long time. Storing the increasing amount of dormant data in a copy will reduce the efficiency of storage resource utilization and lead to resource waste.
[0042] Based on the above content, in order to improve the utilization efficiency of storage space while taking into account the read and write performance of stored data, an embodiment of the present invention provides a distributed storage mode control method, device, equipment and storage medium.
[0043] The following first introduces a distributed storage mode control method provided by an embodiment of the present invention.
[0044] A distributed storage mode control method provided in an embodiment of the present invention can be applied to electronic devices. Exemplarily, in one implementation, the electronic device can be a device independent of the main control node in the storage cluster, and communicates with the main control node in the storage cluster. In this implementation, the electronic device is independent of the main control node, physically separated from the cluster storage layer, and does not occupy the machine resources of the storage cluster. Moreover, in a specific application, the electronic device can be a server or a terminal device, such as a smart phone, a tablet computer, or a desktop computer, which is reasonable.
[0045] Exemplarily, in another implementation, the electronic device may also be a master control node in a storage cluster. In this implementation, the master control node may also implement intelligent control of the storage mode of user data while having the management function for each storage node in the storage cluster.
[0046] Specifically, the execution subject of the distributed storage mode control method can be a distributed storage mode control device. Exemplarily, when the distributed storage mode control method is applied to the main control node, the distributed storage mode control device can be a computer program running in the main control node, and the computer program can be used to implement the switching control of the storage mode. Exemplarily, when the distributed storage mode control method is applied to a terminal device independent of the main control node, the distributed storage mode control device can be a functional software running in the terminal device, such as: storage mode control software. Exemplarily, when the distributed storage mode control method is applied to a server independent of the main control node, the distributed storage mode control device can be a computer program running in the server, and the computer program can be used to implement the switching control of the storage mode. It can be understood that no matter whether the distributed storage mode control method is applied to a terminal device or a server independent of the main control node, the distributed storage mode control device is deployed separately in a device, physically separated from the storage layer of the cluster, that is, separated from the storage nodes in the storage cluster, so as not to occupy the machine resources of the storage cluster.
[0047] It should be noted that the storage layer provided in the embodiment of the present invention is the core place for the distributed object storage cluster to store data, which can realize the distributed storage of large-scale unstructured data such as pictures, videos, and voices. The embodiment of the present invention provides three storage modes for operation and maintenance personnel to select and configure according to user needs:
[0048] Storage mode 1: replica mode. In this mode, data is always stored in replica mode. The number of replicas is not limited in the embodiment of the present invention. For example, the replica mode can be a three-replica replica mode.
[0049] Storage mode 2: Coding mode, where the coding mode can be an erasure code mode. The coding process of the erasure code mode is as follows: a redundant matrix is obtained by multiplying the matrix composed of the original data with the reversible transformation matrix, and the redundant matrix is converted into a redundant data block. The redundant data block is combined with the original data block to jointly realize redundant backup of the original data.
[0050] Storage mode three: A mode that combines encoding and replication, also known as encoding-replication fast response mode. While data is stored in encoding mode, a replica of the original data is reconstructed for storage to ensure that high-frequency user access to read and write data will not be delayed or interrupted due to sudden data read and write anomalies, such as data transmission interruption or data loss.
[0051] A distributed storage mode control method provided by an embodiment of the present invention may include the following steps:
[0052] Determine target user data for which storage mode control is to be performed; wherein the target user data is user data stored in the storage cluster, and the types of storage modes include encoding mode, replica mode, and a mode combining encoding and replica;
[0053] Using the read and write status information of the target user data in the first historical period, identifying a first storage mode corresponding to the target user data; wherein the first storage mode is a storage mode adapted to the target user data in the first historical period;
[0054] Using the read and write state information of the target user data in a second historical period, predicting a second storage mode corresponding to the target user data; wherein the second storage mode is a storage mode adapted to the target user data in a specified period after the current time;
[0055] Determine whether the first storage mode and the second storage mode are the same, and obtain a determination result;
[0056] Based on the judgment result, determining a target storage mode to be adapted for the target user data;
[0057] If the target storage mode is different from the current storage mode of the target user data, a storage mode conversion process is performed on the target user data based on the target storage mode.
[0058] In the scheme provided by the embodiment of the present invention, the first storage mode corresponding to the target user data is identified by using the read-write status information of the target user data in the first historical period; then, the second storage mode corresponding to the target user data is predicted by using the read-write status information of the target user data in the second historical period; by judging whether the first storage mode and the second storage mode are the same, a judgment result is obtained; based on the judgment result, the target storage mode to be adapted for the target user data is determined; if the target storage mode is different from the current storage mode of the target user data, a storage mode conversion instruction is sent to the main control node, so that the main control node converts the storage mode of the user data to the target storage mode after receiving the storage mode conversion instruction. It can be seen that in this scheme, the storage mode is dynamically controlled based on the read-write status information of the user data, that is, the storage mode is intelligently switched, so that the problem of storage space waste or unsatisfactory read-write performance caused by the mismatch between the storage mode and the access situation of the user data can be alleviated. Therefore, through this scheme, the use efficiency of the storage space can be improved and the read-write performance of the storage data can be taken into account.
[0059] The distributed storage mode control method provided by the embodiment of the present invention is introduced below in conjunction with the accompanying drawings.
[0060] like Figure 1As shown, the distributed storage mode control method provided in the embodiment of the present invention is applied to an electronic device; the method may include steps S101-S106:
[0061] S101, determining target user data to be subjected to storage mode control; wherein the target user data is user data stored in a storage cluster, and the types of storage modes include an encoding mode, a replica mode, and a mode combining encoding and replica;
[0062] In this embodiment, the target user data may be any stored user data, and the method for determining the target user data may be: determining each user data as the target user data in sequence according to the storage time of each user data in the storage cluster, or determining each user data as the target user data in sequence according to the importance of each user data in the storage cluster, and so on, so as to select the target user data that currently needs to be controlled in the storage mode. In addition, the present invention does not limit the specific method for determining the target user data.
[0063] The initial storage mode of the user data stored in the storage cluster can adopt the default storage mode, such as the replica mode; or the operation and maintenance personnel can set the required storage mode according to user needs. In addition, for the initial storage mode, the weight set by the operation and maintenance personnel can be higher than the weight of the default configuration. If the operation and maintenance personnel do not actively set it, the default storage mode will be used as the initial storage mode of the user data.
[0064] Exemplarily, in a specific implementation, the initial storage mode of the target user data may be a storage mode set according to a system default storage rule; wherein the system default storage rule includes:
[0065] If the security level of the target user data is the first level, the initial storage mode is the copy mode; if the security level of the target user data is the second level, the initial storage mode is a combination of encoding and copy; if the security level of the target user is the third level, the initial storage mode is the encoding mode; wherein, the first level is higher than the second level, and the second level is higher than the third level. Operation and maintenance personnel can comprehensively judge the security level requirements required for data storage based on customer needs and the actual generation and application scenarios of data. It can be understood that the above-mentioned "first level", "second level" and "third level" are only used to distinguish different security levels in terms of naming. In specific applications, the specific names used for the "first level", "second level" and "third level" can be "high level", "intermediate level" and "low level" respectively, and of course are not limited to this.
[0066] In addition, it should be noted that in the distributed storage mode control method of this embodiment, the storage mode control for the target user data can be performed periodically, and S101-S106 can be executed when entering each cycle.
[0067] S102, using the read and write state information of the target user data in the first historical period, identifying a first storage mode corresponding to the target user data; wherein the first storage mode is a storage mode adapted to the target user data in the first historical period;
[0068] Among them, the read-write status information may include: information characterizing the frequency of reading and writing. In this case, the read-write status information may be the frequency of reading and writing within each unit time, for example, the frequency of reading and writing per day; of course, the read-write status information is not limited to the above-mentioned information about the frequency of reading and writing, for example: the read-write status information may include: information on the amount of data read and written, which is also reasonable. The first historical time period may be a recent historical time period starting from the current time point, for example: the previous week, the previous three weeks, the previous five weeks, and so on. In addition, the first storage mode may be: a copy mode, an encoding mode, or a mode combining encoding and copy. By analyzing the read-write status information of the target user data in the first historical time period, a storage mode that is compatible with the target user data in the first historical time period is identified as the first storage mode.
[0069] It can be understood that since the read and write status information of the target user data in the first historical time period represents the read and write status of the target user data in the first historical time period, the storage mode that is compatible with the read and write status of the target user data in the first historical time period can be identified by analyzing the read and write status information of the target user data in the first historical time period.
[0070] Exemplarily, if the read and write frequency in the first historical time period is high, the storage mode adapted to the recent read and write status of the target user data may be a copy mode to meet the need for fast read and write response; if the read and write frequency in the first historical time period is low, the storage mode adapted to the recent read and write status of the target user data may be an encoding mode to meet the need to save storage space; if the read and write frequency in the first historical time period is moderate, the storage mode adapted to the recent read and write status of the target user data may be a storage mode combining encoding and copy to ensure that high-frequency user access to read and write will not be delayed or interrupted due to sudden data loss.
[0071] It should be noted that the read and write status information of the target user data in the first historical period may be obtained from the historical log information of the target user data. The specific acquisition method is not limited in the embodiment of the present invention.
[0072] S103, predicting a second storage mode corresponding to the target user data by using the read and write state information of the target user data in the second historical period; wherein the second storage mode is a storage mode adapted to the target user data in a specified period after the current time;
[0073] The second historical period can be a long historical period starting from the current time point, such as the previous half year, the previous year, etc. The second storage mode can be a copy mode, an encoding mode, or a mode combining encoding and copy. By analyzing the read and write status information of the target user data in the second historical period, a storage mode that is compatible with the target user data in a specified period after the current time is predicted as the second storage mode. Exemplarily, the specified period can be a period close to the current time, such as one week, two weeks, etc. after the current time.
[0074] It can be understood that since the read and write status information of the target user data in the second historical time period represents the read and write status of the target user data in the second historical time period, by analyzing the read and write status information of the target user data in the second historical time period, the pattern of changes in the read and write status of the target user data in the second historical time period can be discovered, and thus based on the pattern of changes in the read and write status, a storage mode that matches the read and write status of the target user data in a specified time period after the current time can be predicted.
[0075] Optionally, in an implementation, the process of predicting the second storage mode corresponding to the target user data by using the read / write state information of the target user data in the second historical period may be: inputting the read / write state information of the target user data in the second historical period into a pre-trained mode prediction model to obtain a mode prediction result as the second storage mode corresponding to the target user data;
[0076] The pattern prediction model is a model trained based on sample read / write status information and corresponding label values, wherein the sample read / write status information is the read / write status information of the sample user data in a sample period, and the label value is a storage mode adapted to the sample user data in the specified period after the sample period. In addition, the duration of the sample period can be the same as the duration of the aforementioned second historical period, so that the trained pattern prediction model can predict the read / write status information in the second historical period.
[0077] Exemplarily, the pattern prediction model can be a machine learning model for implementing classification, such as a deep neural network model. The read and write status information within the sample period can be: the read and write frequency of the sample user data within the previous N-1 years to the previous N years, where N is an arbitrary positive integer; the label value of the sample data is the true value of the storage mode of the sample user data within one week after the sample period. The training process of the model can be: input the read and write status information within the sample period into the initial deep neural network model, obtain the output result of the storage mode adapted to the sample user data within one week after the sample period, and adjust the parameters of the deep neural network model by minimizing the difference between the output result and the label value to obtain a pattern prediction model that meets the requirements. Among them, the specific representation form of the sample read and write status information input to the model can be in the form of a vector, of course, but is not limited to this.
[0078] Exemplarily, the mode prediction model can also be a mathematical model for implementing storage mode prediction, and the read-write status information within the sample period can be: the read-write frequency of the sample user data within the previous N-1 years to the previous N years, where N is an arbitrary positive integer; the label value of the sample data is the true value of the storage mode of the sample user data within one week after the sample period. The training process of the model can be: establish a mathematical expression between the output and input of the model, where the input of the model is the read-write status information within the sample period, and the output of the model is the output result of the storage mode adapted to the sample user data within one week after the sample period, and verify whether the model is accurate by comparing the output result of the model with the label value, and modify the parameters in the mathematical expression based on the error between the output result of the model and the label value, so as to train a mathematical model that meets the requirements.
[0079] S104, determining whether the first storage mode and the second storage mode are the same, and obtaining a determination result;
[0080] It can be understood that if the first storage mode obtained through the above steps is the same as the second storage mode, it means that the recent read and write frequency of the target user data is consistent with the long-term read and write frequency law, and the predicted second storage mode is considered reliable. If the first storage mode is different from the second storage mode, it means that the recent read and write frequency of the target user data is significantly different from the long-term read and write frequency law, and the predicted second storage mode is considered unreliable.
[0081] S105, based on the determination result, determining a target storage mode to be adapted for the target user data;
[0082] In this embodiment, the target storage mode is the storage mode to be set for the target user data. The target storage mode may be the predicted second storage mode, or the current storage mode of the target user data.
[0083] Exemplarily, in a specific implementation, based on the judgment result, determining the target storage mode to be adapted for the target user data may include steps A1-A2:
[0084] A1, if the determination result indicates that the first storage mode and the second storage mode are different, determining the current storage mode of the target user data as the target storage mode to be adapted for the target user data;
[0085] A2: If the judgment result indicates that the first storage mode and the second storage mode are the same, the second storage mode is determined as the target storage mode to be adapted for the target user data.
[0086] It can be understood that the judgment result of step S104 represents whether the recent read and write frequency of the target user data is consistent with the long-term read and write frequency pattern, that is, whether the predicted second storage mode is reliable. Therefore, the second storage mode or the current storage mode of the target user data can be used as the target storage mode based on the judgment result.
[0087] S106: If the target storage mode is different from the current storage mode of the target user data, a storage mode conversion process is performed on the target user data based on the target storage mode.
[0088] It is understandable that the read and write frequency of user data may change during the storage process, and there may be a situation where the read and write frequency is high during a certain period of time and low during another period of time. If the user data is stored in a fixed storage mode, the storage mode of the user data may not match the read and write frequency of the user data, thereby causing a waste of storage space and problems of unsatisfactory read and write performance. Therefore, after the target storage mode is determined in step S105, if the target storage mode is different from the current storage mode of the target user data, the storage mode of the user data can be converted to the target storage mode so that the storage mode of the user data matches the read and write state of the user data.
[0089] Optionally, in an implementation manner, if the electronic device to which the distributed storage mode control method is applied is a device independent of the main control node, then, based on the target storage mode, performing storage mode conversion processing on the target user data may include:
[0090] A storage mode conversion instruction about the target user data and carrying the target storage mode is sent to the main control node, so that the main control node converts the storage mode of the target user data into the target storage mode after receiving the storage mode conversion instruction.
[0091] Optionally, in another implementation, if the electronic device to which the distributed storage mode control method is applied is a main control node, then, based on the target storage mode, performing storage mode conversion processing on the target user data may include:
[0092] Convert the storage mode of the target user data to the target storage mode.
[0093] It can be understood that since the user data is stored on each storage node in the storage cluster, the storage mode of the user data is controlled by the main control node in the storage cluster. Therefore, if the electronic device to which the distributed storage mode control method is applied is a device independent of the main control node, a storage mode conversion instruction can be sent to the main control node through an interface that communicates with the main control node, so that the main control node converts the storage mode of the target user data to the target storage mode after receiving the storage mode conversion instruction; if the electronic device to which the distributed storage mode control method is applied is the main control node, then the storage mode of the target user data can be directly converted to the target storage mode.
[0094] In addition, to facilitate understanding of the solution, the following uses different target storage modes as examples to introduce a specific implementation method for converting the storage mode of the target user data into the target storage mode.
[0095] Exemplarily, if the current storage mode of the target user data is a copy mode and the target storage mode is an encoding mode, the process of converting the storage mode of the target user data to the target storage mode may be: performing a dot product operation on the data matrix of the target user data and the encoding matrix to generate a redundant matrix, concatenating the redundant matrix and the data matrix and storing them in blocks, thereby converting the storage mode into the encoding mode.
[0096] Exemplarily, if the current storage mode of the target user data is the encoding mode and the target storage mode is the copy mode, the storage mode of the target user data can be converted into the target storage mode through data reconstruction. The specific conversion process can be: splicing the data blocks stored in the encoding matrix and the data matrix, performing a dot product operation on the spliced matrix and the inverse matrix of the above encoding matrix to obtain the original data of the target user data, and then generating a copy of the target user data.
[0097] It should be noted that after the storage mode of the target user data is converted to the target storage mode, the stored data in the original storage mode of the target user data may be deleted.
[0098] Of course, the specific conversion process of the storage mode shown above is only an example, and the embodiment of the present invention does not limit the conversion process of the storage mode.
[0099] In the scheme provided by this embodiment, the first storage mode corresponding to the target user data is identified by using the read-write status information of the target user data in the first historical period; then, the second storage mode corresponding to the target user data is predicted by using the read-write status information of the target user data in the second historical period; by judging whether the first storage mode and the second storage mode are the same, a judgment result is obtained; based on the judgment result, the target storage mode to be adapted for the target user data is determined; if the target storage mode is different from the current storage mode of the target user data, a storage mode conversion instruction is sent to the main control node, so that the main control node converts the storage mode of the user data to the target storage mode after receiving the storage mode conversion instruction. It can be seen that in this scheme, the storage mode is dynamically controlled based on the read-write status information of the user data, that is, the storage mode is intelligently switched, so that the problem of storage space waste or unsatisfactory read-write performance caused by the mismatch between the storage mode and the access situation of the user data can be alleviated. Therefore, through this scheme, the use efficiency of the storage space can be improved and the read-write performance of the storage data can be taken into account.
[0100] Optionally, in an implementation, using the read and write status information of the target user data in the first historical period to identify the first storage mode corresponding to the target user data may include steps B1-B5:
[0101] B1, determining the read and write status information of the target user data in each target sub-period; wherein each target sub-period is each sub-period included in the first historical period; wherein each target sub-period may be each sub-period obtained by evenly dividing the first historical period;
[0102] For example, if the first historical period is three weeks long, it can be evenly divided into three target sub-periods, each of which is one week long.
[0103] B2, for each target sub-period, based on the read and write status information of the target user data in the target sub-period, calculating the evaluation index value of the read and write status in the target sub-period;
[0104] The evaluation index value of the read / write frequency may be an index value for evaluating the read / write status of the target user data in the target sub-period. If the read / write status information includes information representing the frequency of read / write, then the evaluation index value may be an average value, a median, etc. of the read / write frequency data in the target sub-period. Furthermore, the embodiment of the present invention does not limit the specific form of the evaluation index value.
[0105] Exemplarily, in a specific implementation, if the target sub-period is one week, the evaluation index value in the target sub-period may be the average value of the read and write frequencies in the week. Exemplarily, in another specific implementation, if the target sub-period is one week, the evaluation index value in the target sub-period may be the median of the read and write frequencies of each day in the week.
[0106] B3, if the number of the determined evaluation index values that meet the first condition is greater than the target number, determining that the first storage mode corresponding to the target user data is the encoding mode; wherein the first condition is less than a first preset threshold, and the target number is half of the number of the determined evaluation index values;
[0107] In this implementation, the first preset threshold value can be set to a lower value of the read and write frequency of the target user data. It can be understood that after calculating the evaluation index value of the read and write status in each target sub-period through step B2, if more than half of the evaluation index values among the multiple index values are less than the first preset threshold value, the read and write frequency of the target user data in the first historical period is low. At this time, it is determined that the first storage mode corresponding to the target user data is the encoding mode to save storage space.
[0108] B4, if the number of the determined evaluation index values that meet the second condition is greater than the target number, determining that the first storage mode corresponding to the target user data is the copy mode; the second condition is greater than a second preset threshold, and the second preset threshold is greater than the first preset threshold;
[0109] In this implementation, the second preset threshold value can be set to a higher value of the read and write frequency of the target user data. It can be understood that after calculating the evaluation index value of the read and write status in each target sub-period through step B2, if more than half of the evaluation index values among the multiple index values are greater than the second preset threshold value, the read and write frequency of the target user data in the first historical period is high. At this time, it is determined that the first storage mode corresponding to the target user data is the copy mode to improve the read and write performance of the data.
[0110] B5: Otherwise, determine that the first storage mode corresponding to the target user data is a mode combining encoding and copying.
[0111] That is, if the read and write frequency of the target user data in the first historical period is moderate, the first storage mode is determined to be a storage mode combining encoding and replica. It can be understood that the storage mode combining encoding and replica can ensure high-frequency user access reading and writing while taking into account both read and write performance and storage space utilization, without delay or interruption due to sudden data loss.
[0112] It can be seen that through this implementation method, the first storage mode adapted to the target user data in the first historical period can be quickly and effectively determined through the read and write status information of the user data in the first historical period.
[0113] In order to better explain the content of the embodiments of the present invention, Figure 2-Figure 7 The contents of the embodiments of the present invention are introduced.
[0114] Figure 2 The overall architecture diagram of the data storage system including the multi-storage mode intelligent control system is shown. Figure 2 As shown, the application-side client is mounted through the distributed storage cluster gateway and the distributed object storage system to realize the functions of data storage and access. Among them, the distributed object storage system includes a distributed storage layer and a multi-storage mode intelligent control system. The distributed storage layer is a storage layer for storing user data. In the storage layer, a special storage pool is created for the user, and the relevant parameters and resource configuration are set. The storage mode of user data is set for the data storage pool. The multi-storage mode intelligent control system is a system for implementing the distributed storage mode control method in the above-mentioned embodiment, which is composed of a read-write status information acquisition module and an intelligent control system. Specifically, the intelligent control system is an electronic device that implements the above-mentioned distributed storage mode control method in the embodiment of the present invention.
[0115] Among them, the read-write status information collection module can be deployed in the storage layer to collect the read-write status information of user data in each storage mode, and transmit the collected read-write status information to the intelligent control system through the communication interface for analysis by the recent status judgment module and the long-term trend prediction module.
[0116] The intelligent control system can be deployed on a server alone, physically separated from the storage layer. It is used to combine the historical and real-time read and write status information of each user data in the storage layer to perform recent status judgment and long-term trend prediction, so as to make decisions on the best storage mode for each user data storage, and convert the decision information of the comprehensive decision module into specific implementation steps through the decision execution conversion module. Finally, through the storage mode control module, according to the specific implementation steps, specific execution instructions are generated and transmitted to the distributed storage layer through the communication interface, that is, to the main control node in the storage cluster, so that it executes the corresponding storage mode switching operation, thereby realizing the intelligent switching of the storage mode.
[0117] In the distributed storage layer, the initial storage mode of user data storage is set by initializing the storage mode setting module. Figure 3As shown, the initial storage mode can adopt the storage mode configured by the system by default, such as the replica mode, or the operation and maintenance personnel can set the required storage mode according to user needs. Among them, the storage modes that the operation and maintenance personnel can select and configure according to user needs can include storage mode 1, storage mode 2, and storage mode 3, which are respectively: replica mode, encoding mode, and encoding-replica fast response mode.
[0118] Among them, the weight set by the operation and maintenance personnel is higher than the weight of the system default configuration. The operation and maintenance personnel comprehensively judge the security level requirements required for data storage based on customer needs and the actual generation and application scenarios of data. The security level in the system is set to three levels: advanced (corresponding to the first level above), intermediate (corresponding to the second level above) and general (corresponding to the third level above). Among them, the initial storage mode corresponding to "advanced" is: storage mode 1, that is, copy mode; the initial storage mode corresponding to "general" is: storage mode 2, that is, encoding mode; the initial storage mode corresponding to "intermediate" is: storage mode 3, that is, encoding-copy fast response mode, corresponding to the storage mode combining encoding and copy in the above text. If the operation and maintenance personnel do not actively set it here, the system will use the storage mode configured by the system default as the initial storage mode for data storage. After that, the intelligent control system will intelligently decide the appropriate storage mode and automatically convert the storage mode.
[0119] Figure 4 The following is a flowchart showing a specific algorithm of the recent state discrimination module: Figure 4 As shown, the following steps are included:
[0120] (1) Obtain the read-write frequency of the user data storage in the previous three weeks (corresponding to the read-write status information in the first historical period mentioned above) from the storage read-write status information acquisition module, and use the average read-write frequency of each week in the previous three weeks (corresponding to the evaluation index value mentioned above) as input, that is, X = {X1, X2, X3};
[0121] (2) Determine whether there are two or more data in the input X that are greater than the mode threshold M2 (corresponding to the second preset threshold mentioned above); if so, output Mode1=T1, that is, the storage mode Mode1 (corresponding to the first storage mode mentioned above) is storage mode 1; if not, execute step (3);
[0122] (3) determining whether there are two or more data in the input X that are smaller than the mode threshold M1 (corresponding to the first preset threshold mentioned above); if so, outputting Mode1=T2, that is, the storage mode Mode1 is the storage mode 2;
[0123] (4) Otherwise, if two or more data in the input X are greater than the mode threshold M1 and less than the mode threshold M2, the output Mode1=T3, that is, the storage mode Mode1 is the storage mode three.
[0124] Figure 5 A schematic diagram of the long-term trend forecasting module is shown. Figure 5 As shown, the following steps are included:
[0125] (1) Obtaining the read and write frequency of user data in the past year (corresponding to the read and write status information in the second historical period mentioned above) from the storage read and write status information acquisition module as input data;
[0126] (2) Next, the input data is input into a long-term trend prediction model (corresponding to the pattern prediction model mentioned above); wherein the long-term trend prediction model can be a mathematical model based on the reading and writing frequency of the user data in the past year, and the changing pattern of the reading and writing frequency of the user data in the past year is mined, thereby establishing a prediction model;
[0127] (3) The model output result is a storage mode that matches the read and write frequency within one week after the current time, namely Mode 2 (corresponding to the second storage mode mentioned above).
[0128] Figure 6 A flowchart showing the decision-making process of the “comprehensive decision-making module” is shown below. Figure 6 As shown in the figure, the core algorithm logic of the comprehensive decision-making module is as follows:
[0129] Input: the output value Mode1 of the recent state judgment module and the output value Mode2 of the long-term trend prediction module;
[0130] Core algorithm formula:
[0131] Output: the storage mode Mode to be converted (corresponding to the target storage mode mentioned above).
[0132] Mode1 and Mode2 are XORed. If Y mode The value is 1, indicating that the storage mode of the last three weeks reflected by the output value Mode1 of the recent state judgment module is significantly different from the read-write frequency law of the user data storage in the past year. In this case, the original mode is maintained and the judgment is made in the next judgment cycle. At this time, the output Mode=0;
[0133] If Y modeThe value of is 0, indicating that the storage mode judgment results of the recent state judgment module and the long-term trend prediction module for the next week are consistent. This reflects that the read and write frequency of user data storage in the past three weeks is basically consistent with the usage pattern in the past year. At this time, the judgment of the storage mode for the next week is more reliable. At this time, the output is: Mode = Mode1 = Mode2, and its value is one of the three storage modes T1, T2, and T3. In this case, the storage mode can be switched to the corresponding T1, T2 or T3.
[0134] Figure 7 A flowchart showing the decision execution conversion module performing decision conversion. Figure 7 As shown, the algorithm logic of the internal execution of the decision execution conversion module is as follows:
[0135] Input: storage mode Mode to be converted and original storage mode Mode0; where Mode = {0, T1, T2, T3};
[0136] When Mode=0, it means that the current user data keeps the original storage mode unchanged;
[0137] When receiving the output of the comprehensive decision module: Mode = one of the values of T1, T2, T3, it will be compared with the original storage mode Mode0 of the current user data:
[0138] When Mode0 = Mode, the storage mode does not change;
[0139] When Mode0≠Mode, the original storage mode is changed to the storage mode corresponding to the current Mode value.
[0140] In order to more clearly understand the content of the embodiment of the present invention, the specific implementation steps of the storage mode control are introduced below with reference to a specific example.
[0141] In this example, the distributed storage system uses distributed object storage, such as the distributed file storage system ceph. The specific implementation steps of storage mode control are as follows:
[0142] Step 1: Complete the mounting of the client and the distributed storage system. At the storage layer, create a dedicated storage pool for the user, set relevant parameters and resource configuration, and set the storage mode of user data for the data storage pool.
[0143] Step 2: "Initialize storage mode setting module" sets the initial storage mode of the user data storage pool pool.
[0144] Step 3: Collect the read and write status information of the data storage pool pool under each storage mode, and transmit it to the "storage mode decision and execution system" through the communication interface for analysis by the "recent state judgment module" and the "long-term trend prediction module".
[0145] Step 4: The "recent state identification module" collects and extracts the storage mode changes of each pool in the previous three weeks based on the historical read-write state data of each data storage pool in the distributed storage layer. The "long-term trend prediction module" generates the read-write state prediction model of each data storage pool through mathematical modeling based on the historical state data of each data storage pool in the distributed storage layer, and predicts the data read-write state in the next week.
[0146] Step 5: Based on the "recent state judgment module" and the "long-term trend prediction module", make a decision on the best storage mode for each data storage pool.
[0147] Step 6: Convert the decision information of the “comprehensive decision module” into specific implementation steps through the “decision execution conversion module”.
[0148] Step 7: Generate specific execution instructions through the "storage mode control module" according to the implementation steps, and transmit them to the main control node of the storage cluster through the communication interface, so that it executes the corresponding commands and completes the switching of the storage mode.
[0149] It can be seen that through this solution, the three storage modes can be automatically switched to achieve maximum storage space saving while ensuring high data disaster recovery backup security, that is, improving the efficiency of storage space use and taking into account the read and write performance of stored data; in addition, this solution also has the following advantages:
[0150] By setting a storage mode that combines encoding and replication, when the damage of the encoded data block exceeds the disaster recovery redundancy, the user's reading and writing will not be affected due to the existence of replica data, so that the customer is unaware and the user experience is improved; by independently deploying the storage mode control system, the system communicates with the main control node of the distributed storage cluster, and can operate the conversion of the user's data storage mode by sending instructions. At the same time, the operation and maintenance personnel take performance-enhancing operations such as adding read-write cache to the distributed storage cluster to increase the read-write rate, which is not affected by the system; by decoupling the storage mode control system from the storage performance of the original distributed storage cluster, the original distributed storage cluster's data consistency is not affected while the intelligent attributes of the original distributed storage cluster are increased.
[0151] Corresponding to the above method embodiment, the present invention also provides a distributed storage mode control device, which is applied to electronic equipment, such as Figure 8 As shown, the device comprises:
[0152] A first determination module 810 is used to determine target user data to be subjected to storage mode control; wherein the target user data is user data stored in the storage cluster, and the types of storage modes include encoding mode, replica mode, and a mode combining encoding and replica;
[0153] An identification module 820, configured to identify a first storage mode corresponding to the target user data by using the read and write state information of the target user data in the first historical period; wherein the first storage mode is a storage mode adapted to the target user data in the first historical period;
[0154] A prediction module 830 is used to predict a second storage mode corresponding to the target user data by using the read and write state information of the target user data in a second historical period; wherein the second storage mode is a storage mode adapted to the target user data in a specified period after a current time;
[0155] A determination module 840 is used to determine whether the first storage mode and the second storage mode are the same, and obtain a determination result;
[0156] A second determination module 850 is used to determine a target storage mode to be adapted for the target user data based on the judgment result;
[0157] The conversion module 860 is configured to perform storage mode conversion processing on the target user data based on the target storage mode if the target storage mode is different from the current storage mode of the target user data.
[0158] Optionally, the electronic device communicates with a main control node in the storage cluster; and the conversion module is specifically used for:
[0159] If the target storage mode is different from the current storage mode of the target user data, a storage mode conversion instruction carrying the target storage mode regarding the target user data is sent to the main control node, so that the main control node converts the storage mode of the target user data to the target storage mode after receiving the storage mode conversion instruction.
[0160] Optionally, the second determining module includes:
[0161] a first judgment submodule, configured to determine the current storage mode of the target user data as the target storage mode to be adapted for the target user data if the judgment result indicates that the first storage mode and the second storage mode are different;
[0162] The second judgment submodule is configured to determine the second storage mode as the target storage mode to be adapted for the target user data if the judgment result indicates that the first storage mode and the second storage mode are the same.
[0163] Optionally, the identification module includes:
[0164] A determination submodule, used to determine the read and write status information of the target user data in each target sub-period; wherein each target sub-period is each sub-period included in the first historical period;
[0165] A calculation submodule, configured to calculate, for each target sub-period, a judgment index value on the read-write status in the target sub-period based on the read-write status information of the target user data in the target sub-period;
[0166] A first setting submodule, configured to determine that the first storage mode corresponding to the target user data is the encoding mode if the number of the determined evaluation index values that meets the first condition is greater than the target number; wherein the first condition is less than a first preset threshold, and the target number is half of the number of the determined evaluation index values;
[0167] A second setting submodule is configured to determine that the first storage mode corresponding to the target user data is the copy mode if the number of the determined evaluation index values that meets the second condition is greater than the target number; the second condition is greater than a second preset threshold, and the second preset threshold is greater than the first preset threshold;
[0168] The third setting submodule is used to determine that the first storage mode corresponding to the target user data is the mode combining the encoding and the copy.
[0169] Optionally, the read / write status information represents information about the frequency of reading and writing; and the calculation submodule is specifically used to:
[0170] For each target sub-period, based on the read and write status information of the target user data in the target sub-period, an average value of the read and write frequency in the target sub-period is calculated.
[0171] Optionally, the prediction module includes:
[0172] An inference submodule, used for inputting the read and write state information of the target user data in the second historical period into a pre-trained pattern prediction model to obtain a pattern prediction result as a second storage mode corresponding to the target user data;
[0173] Among them, the pattern prediction model is a model trained based on sample read and write status information and corresponding label values. The sample read and write status information is: the read and write status information of the sample user data within the sample time period, and the label value is the storage mode adapted to the sample user data within the specified time period after the sample time period.
[0174] Optionally, the initial storage mode of the target user data is a storage mode set according to a system default storage rule;
[0175] The system default storage rules include:
[0176] If the security level of the target user data is the first level, the initial storage mode is the copy mode;
[0177] If the security level of the target user data is the second level, the initial storage mode is a mode combining the encoding and the copy;
[0178] If the security level of the target user is the third level, the initial storage mode is the encoding mode;
[0179] The first level is higher than the second level, and the second level is higher than the third level.
[0180] The embodiment of the present invention further provides an electronic device, such as Fig. 9 As shown, it includes a processor 901, a communication interface 902, a memory 903 and a communication bus 904, wherein the processor 901, the communication interface 902, and the memory 903 communicate with each other through the communication bus 904.
[0181] Memory 903, used for storing computer programs;
[0182] The processor 901 is used to implement the steps of the distributed storage mode control method described in any of the above embodiments when executing the program stored in the memory 903.
[0183] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0184] The communication interface is used for communication between the above electronic device and other devices.
[0185] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0186] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0187] In another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned distributed storage mode control methods are implemented.
[0188] In another embodiment provided by the present invention, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the distributed storage mode control method described in any one of the above embodiments.
[0189] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.
[0190] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0191] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0192] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A distributed storage mode control method, characterized in that: Applied to electronic equipment, the method comprises: Determine target user data for which storage mode control is to be performed; wherein the target user data is user data stored in the storage cluster, and the types of storage modes include encoding mode, replica mode, and a mode combining encoding and replica; Using the read and write status information of the target user data in the first historical period, identifying a first storage mode corresponding to the target user data; wherein the first storage mode is a storage mode adapted to the target user data in the first historical period; Using the read and write state information of the target user data in a second historical period, predicting a second storage mode corresponding to the target user data; wherein the second storage mode is a storage mode adapted to the target user data in a specified period after the current time; Determine whether the first storage mode and the second storage mode are the same, and obtain a determination result; Based on the judgment result, determining a target storage mode to be adapted for the target user data; If the target storage mode is different from the current storage mode of the target user data, performing storage mode conversion processing on the target user data based on the target storage mode; Among them, determining the target storage mode to which the target user data is to be adapted based on the judgment result includes: if the judgment result indicates that the first storage mode and the second storage mode are different, determining the current storage mode of the target user data as the target storage mode to which the target user data is to be adapted; if the judgment result indicates that the first storage mode and the second storage mode are the same, determining the second storage mode as the target storage mode to which the target user data is to be adapted.
2. The method according to claim 1, characterized in that The electronic device communicates with a main control node in the storage cluster; Based on the target storage mode, performing storage mode conversion processing on the target user data includes: A storage mode conversion instruction about the target user data and carrying the target storage mode is sent to the main control node, so that the main control node converts the storage mode of the target user data to the target storage mode after receiving the storage mode conversion instruction.
3. The method according to any one of claims 1 to 2, characterized in that: The using the read / write status information of the target user data in the first historical period to identify the first storage mode corresponding to the target user data includes: Determine the read and write status information of the target user data in each target sub-period; wherein each target sub-period is each sub-period included in the first historical period; For each target sub-period, based on the read / write status information of the target user data in the target sub-period, calculating the evaluation index value about the read / write status in the target sub-period; If, among the determined evaluation index values, the number of evaluation index values that meet the first condition is greater than the target number, determining that the first storage mode corresponding to the target user data is the encoding mode; wherein the first condition is less than a first preset threshold, and the target number is half of the number of determined evaluation index values; If, among the determined evaluation index values, the number of evaluation index values that meet the second condition is greater than the target number, determining that the first storage mode corresponding to the target user data is the copy mode; the second condition is greater than a second preset threshold, and the second preset threshold is greater than the first preset threshold; Otherwise, it is determined that the first storage mode corresponding to the target user data is the mode combining the encoding and the copy.
4. The method according to claim 3, characterized in that The read / write status information includes: information characterizing the frequency at which read / write occurs; For each target sub-period, based on the read / write status information of the target user data in the target sub-period, calculating the evaluation index value of the read / write status in the target sub-period, including: For each target sub-period, based on the read and write status information of the target user data in the target sub-period, an average value of the read and write frequency in the target sub-period is calculated.
5. The method according to any one of claims 1-2, characterized in that: The predicting the second storage mode corresponding to the target user data by using the read and write state information of the target user data in the second historical period includes: Inputting the read and write state information of the target user data in the second historical period into a pre-trained mode prediction model to obtain a mode prediction result as a second storage mode corresponding to the target user data; Among them, the pattern prediction model is a model trained based on sample read and write status information and corresponding label values. The sample read and write status information is: the read and write status information of the sample user data within the sample time period, and the label value is the storage mode adapted to the sample user data within the specified time period after the sample time period.
6. The method according to any one of claims 1-2, characterized in that: The initial storage mode of the target user data is the storage mode set according to the system default storage rule; The system default storage rules include: If the security level of the target user data is the first level, the initial storage mode is the copy mode; If the security level of the target user data is the second level, the initial storage mode is a mode combining the encoding and the copy; If the security level of the target user is the third level, the initial storage mode is the encoding mode; The first level is higher than the second level, and the second level is higher than the third level.
7. A distributed storage mode control device, characterized in that: Applied to electronic equipment, the device comprises: A first determination module is used to determine target user data to be subjected to storage mode control; wherein the target user data is user data stored in the storage cluster, and the types of storage modes include encoding mode, replica mode, and a mode combining encoding and replica; an identification module, configured to identify a first storage mode corresponding to the target user data by using the read and write state information of the target user data in the first historical period; wherein the first storage mode is a storage mode adapted to the target user data in the first historical period; A prediction module, used to predict a second storage mode corresponding to the target user data by using the read and write state information of the target user data in a second historical period; wherein the second storage mode is a storage mode adapted to the target user data in a specified period after a current time; A judging module, configured to judge whether the first storage mode and the second storage mode are the same, and obtain a judging result; A second determination module, configured to determine a target storage mode to be adapted for the target user data based on the determination result; a conversion module, configured to, if the target storage mode is different from the current storage mode of the target user data, perform storage mode conversion processing on the target user data based on the target storage mode; Among them, determining the target storage mode to which the target user data is to be adapted based on the judgment result includes: if the judgment result indicates that the first storage mode and the second storage mode are different, determining the current storage mode of the target user data as the target storage mode to which the target user data is to be adapted; if the judgment result indicates that the first storage mode and the second storage mode are the same, determining the second storage mode as the target storage mode to which the target user data is to be adapted.
8. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein: The processor, the communication interface, and the memory communicate with each other via a communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 6 when executing a program stored in a memory.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 6 are implemented.
