A method and device for switching cloud disk mode
By classifying and evaluating the importance of cloud disk storage data and selecting the appropriate cloud disk type for storage, the complexity and data security of cloud disk mode switching in the existing technology is solved, and efficient and secure cloud disk storage and switching are achieved.
Patent Information
- Application Number
- CN202410748368.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2044-06-12
AI Technical Summary
The prior art increases system complexity when switching cloud disk mode, resulting in high maintenance costs and complex error processing, and data is easily lost or damaged during storage.
By classifying stored data and performing preliminary and secondary classification based on training models and preset classification categories, the importance index of data is determined, and then the appropriate cloud disk type is selected for storage, so as to realize the rapid switching of cloud disk mode and secure data migration.
It improves the efficiency of cloud disk storage and data security, reduces system complexity and maintenance costs, and improves customer user experience and data retrieval efficiency.
Smart Images

Figure CN118605809B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular to a method and device for switching cloud disk modes. Background Art
[0002] With the development of science and technology, cloud disks are used more and more frequently, which brings great convenience to people's work and life. In reality, the cloud market often provides a single cloud disk mode, or a high-speed cloud disk, or an ordinary cloud disk. However, some problems may be encountered during the use of cloud disks, such as the cloud disk storage capacity is saturated and the cloud disk needs to be expanded or the cloud disk mode needs to be changed. However, this often relies on the customer to actively send a cloud disk mode switching request. When the cloud disk itself has a problem, the customer itself is not aware of it, resulting in the loss or damage of customer data. At the same time, in the existing technology, for the cloud disk switching method, the cloud disk mode can only be switched by re-matching each data block in the cloud disk. Although the cloud disk mode is switched by re-matching each data block, such an operation may increase the complexity of the system. This data block-level operation requires fine control and management, which may lead to higher maintenance costs and more complex error handling mechanisms. In the process of re-matching the data block to the hard disk, the data storage is often directly matched to the cloud disk without classifying the data. The unclassified data is directly transferred to the fixed cloud disk. If any error or interruption occurs, it may cause data damage or loss. While some data backup and recovery measures can be taken to reduce this risk, data security is always a concern.
[0003] Therefore, how to efficiently switch the current cloud disk mode and ensure data security has become an urgent problem to be solved. Summary of the invention
[0004] The present invention aims to solve at least one of the technical problems in the above-mentioned technologies to a certain extent. To this end, the first object of the present invention is to propose a method for switching cloud disk modes, which can achieve fast switching of cloud disk modes and ensure data security by classifying stored data and adapting to cloud disk types.
[0005] The second object of the present invention is to provide a device for switching cloud disk modes.
[0006] To achieve the above object, a first embodiment of the present invention provides a method for switching cloud disk modes, comprising:
[0007] Perform periodic detection on the current cloud disk to obtain the cloud disk detection result;
[0008] When it is determined that the cloud disk mode needs to be switched according to the cloud disk detection result, the storage data in the current cloud disk is obtained, and the storage data is classified to obtain the data classification result;
[0009] Determine the cloud disk type corresponding to each data classification result based on the data classification result;
[0010] Get the target cloud disk corresponding to the cloud disk type;
[0011] The stored data corresponding to each data classification result is migrated to the target cloud disk.
[0012] Preferably, the periodic detection of the current cloud disk to obtain the cloud disk detection result includes:
[0013] Get the current cloud disk's running information per unit time;
[0014] Calculate the failure rate of the current cloud disk based on the operation information of the current cloud disk per unit time;
[0015] The failure rate of the current cloud disk is used as the cloud disk detection result.
[0016] Preferably, the calculating the failure rate of the current cloud disk based on the operation information of the current cloud disk per unit time includes:
[0017]
[0018] Among them, Y i represents the failure rate of the i-th cloud disk; τ i represents the reliability coefficient of the ith cloud disk; α is the cloud disk startup parameter factor; α∈[0.0002, 0.0005]; γ represents the cloud disk shutdown parameter factor; γ∈[0.005, 0.01]; R i represents the effective utilization rate of the ith cloud disk space; E i represents the actual energy consumed by the ith cloud disk in unit time T, E i =(P i ×T+F i ×B i +G i ×C i )×3.14d i ×ρ i ×ω i ;P i represents the operating power of the ith cloud disk; F i represents the energy required to start the i-th cloud disk; B i represents the number of times the ith cloud disk is started within a unit time T; G i represents the energy required when the ith cloud disk stops spinning; C i represents the number of times the ith cloud disk stops spinning within a unit time T; d i represents the innermost diameter of the ith cloud disk; ρ i represents the bit density of the i-th cloud disk; ω irepresents the average rotation speed of the ith cloud disk in unit time T; q i Indicates the occupied capacity of the i-th cloud disk; H i represents the preset energy consumed by the ith cloud disk in unit time T; Q i Indicates the total capacity of the i-th cloud disk.
[0019] Preferably, when determining that the cloud disk mode needs to be switched according to the cloud disk detection result, the method includes:
[0020] The failure rate of the cloud disk is compared with a preset failure threshold, and when the failure rate of the cloud disk is greater than or equal to the preset failure threshold, it is determined that a cloud disk mode switch is required.
[0021] Preferably, the acquiring of the stored data in the current cloud disk and classifying the stored data to obtain the data classification result includes:
[0022] Get the classification sample data set;
[0023] The classification sample data set is input into the neural network model for training, and when the training result is determined to be qualified, an initial classification model is obtained;
[0024] The initial classification model is optimized based on the cross-validation method to obtain the optimized classification model;
[0025] Inputting the stored data into the optimized classification model for classification to obtain a number of initial classification results;
[0026] Taking any initial classification result, calculating the similarity between the initial classification result and the classification result of each category in the preset category, and obtaining a similarity set consisting of a plurality of similarities;
[0027] Obtain the maximum similarity value in the similarity set, compare the maximum similarity value with a preset similarity threshold, and if the maximum similarity value is greater than or equal to the preset similarity threshold, use the preset category corresponding to the maximum similarity value as the target category of the initial classification result; if the maximum similarity value is less than the preset similarity threshold, use the initial classification result as the result to be classified;
[0028] Traverse each initial classification result to obtain several target classification results and several results to be classified; merge several results to be classified to obtain a merged result to be classified;
[0029] The merged results of the items to be classified and several target classification results are taken as the data classification results.
[0030] Preferably, determining the cloud disk type corresponding to each data classification result based on the data classification result includes:
[0031] Calculate the data importance index corresponding to each classification result in the classification results based on a preset algorithm;
[0032] If the data importance index is greater than or equal to the preset index threshold, the classification result corresponding to the data importance index being greater than or equal to the preset index threshold is stored based on the high-speed cloud disk;
[0033] If the data importance index is less than the preset index threshold, the classification result corresponding to the data importance index being less than the preset index threshold is stored based on a common cloud disk;
[0034] Traverse each classification result and determine the high-speed cloud disk or ordinary cloud disk corresponding to each classification result.
[0035] Preferably, the calculating the data importance index corresponding to each classification result in the classification results based on a preset algorithm includes:
[0036]
[0037] Among them, Z i Indicates the data importance index corresponding to the i-th classification result; T i,j represents the data feature corresponding to the jth data in the i-th classification result; M represents the total number of data in the i-th classification result, and N represents the total number of classification results; p i,j It represents the number of times the jth data in the i-th classification result is called per unit time; P represents the number of times all data in all classification results are called per unit time.
[0038] Preferably, the step of migrating the stored data corresponding to each data classification result to a target cloud disk in the target cloud disk set includes:
[0039] Obtain the historical migration rate, historical read / write rate, and space utilization rate of each target cloud disk in the target cloud disk set, and determine the storage priority of each target cloud disk based on the historical migration rate, historical read / write rate, and space utilization rate of each target cloud disk;
[0040] Determine a data migration strategy; the data migration strategy includes an import strategy and an export strategy; the import strategy includes an import thread strategy and a data distribution strategy;
[0041] Based on the storage priority and data migration strategy of each target cloud disk, the storage data corresponding to each data classification result is migrated to the target cloud disk.
[0042] Preferably, after migrating the stored data corresponding to each data classification result to a target cloud disk in the target cloud disk set, the method further includes:
[0043] The migrated data in the target cloud disk is verified based on the backup data in the current cloud disk. When it is determined that the verification result is qualified, the data migration of the storage data in the current cloud disk is completed.
[0044] To achieve the above object, a second embodiment of the present invention provides a device for switching cloud disk modes, including:
[0045] The detection module is used to perform periodic detection on the current cloud disk and obtain the cloud disk detection result;
[0046] The classification module is used to obtain the storage data in the current cloud disk and classify the storage data to obtain the data classification result when it is determined that the cloud disk mode needs to be switched according to the cloud disk detection result;
[0047] A determination module, used to determine the cloud disk type corresponding to each data classification result based on the data classification result;
[0048] Data migration module, used to:
[0049] Get the target cloud disk set corresponding to the cloud disk type;
[0050] The stored data corresponding to each data classification result is migrated to a target cloud disk in the target cloud disk set.
[0051] The present invention proposes a method and device for switching cloud disk modes. By periodically detecting the current cloud disk, the status of the current cloud disk is monitored to ensure the normal operation of the cloud disk storage. When the detection result requires switching the cloud disk mode, the prior art uses a method of re-matching each data block to the cloud disk to achieve the switching of the cloud disk mode, but such an operation may increase the complexity of the system. The present invention adopts the method of first classifying the data, performing a first preliminary classification on the stored data based on the training model, and calculating the similarity between the first preliminary classification result and the preset classification category to perform a secondary classification. While improving the accuracy of the classification, the data that does not meet the preset classification is merged, thereby improving the accuracy of the data classification and reducing the subsequent calculation amount based on the data matching cloud disk type. The data importance index of each data classification result is calculated based on the data classification result, and the data with a high importance index is preferentially stored in the efficient cloud disk, and the data with a relatively low importance index is stored in the ordinary cloud disk, thereby improving the efficiency of the cloud disk storage and enhancing the customer experience. The stored data corresponding to each data classification result is migrated to the target cloud disk, and the data is classified and stored, which can more effectively organize and manage the data and improve the retrieval efficiency and availability of the data. Different types of data have different access frequencies and importance. By classifying and storing data, data can be stored on the most suitable storage medium according to its characteristics, thereby maximizing the use of storage resources and achieving a balance between cost and performance; classifying and storing data can reduce the load pressure of the storage system, optimize data access speed and response time, and improve the overall performance of the system. Especially for scenarios of large-scale data storage and access, data classification storage can effectively improve the throughput and stability of the system.
[0052] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description and the accompanying drawings.
[0053] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0055] Figure 1 is a flow chart of a method for switching cloud disk modes according to an embodiment of the present invention;
[0056] Figure 2 It is a flow chart of performing periodic detection on the current cloud disk and obtaining the cloud disk detection result according to an embodiment of the present invention;
[0057] Figure 3 It is a block diagram of a device for cloud disk mode switching according to an embodiment of the present invention. DETAILED DESCRIPTION
[0058] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0059] Example 1
[0060] like Figure 1 As shown, a method for switching cloud disk mode includes steps S1-S4:
[0061] S1: Perform periodic detection on the current cloud disk to obtain the cloud disk detection result;
[0062] S2: when it is determined that the cloud disk mode needs to be switched according to the cloud disk detection result, the storage data in the current cloud disk is obtained, and the storage data is classified to obtain the data classification result;
[0063] S3: Determine the cloud disk type corresponding to each data classification result based on the data classification result;
[0064] S4: Obtain a target cloud disk set corresponding to the cloud disk type; and migrate the storage data corresponding to each data classification result to a target cloud disk in the target cloud disk set.
[0065] In this embodiment, the cloud disk detection result is the failure rate of the cloud disk within a preset time period.
[0066] In this embodiment, the cloud disk mode is divided into a high-speed cloud disk mode, a normal cloud disk mode and a hybrid cloud disk mode; the hybrid cloud disk mode is the combination of a high-speed cloud disk and a normal cloud disk.
[0067] In this embodiment, the cloud disk mode switching includes switching the high-speed cloud disk mode to the hybrid cloud disk mode and switching the ordinary cloud disk mode to the hybrid cloud disk mode.
[0068] In this embodiment, the cloud disk types include high-speed cloud disks and ordinary cloud disks.
[0069] The beneficial effects of the above technical solution are: by periodically detecting the current cloud disk, the status of the current cloud disk is monitored to ensure the normal operation of the cloud disk storage; when the detection result requires switching the cloud disk mode, the prior art uses a method of re-matching each data block to the cloud disk to achieve the switching of the cloud disk mode, but such an operation may increase the complexity of the system. The present invention adopts the method of first classifying the data, performing a first preliminary classification on the stored data based on the training model, and calculating the similarity between the first preliminary classification result and the preset classification category to perform a secondary classification; while improving the accuracy of the classification, the data that does not meet the preset classification is merged, thereby improving the accuracy of the data classification and reducing the subsequent calculation amount based on the data matching cloud disk type; the data importance index of each data classification result is calculated based on the data classification result, and the data with a high importance index is stored in the efficient cloud disk first, and the data with a relatively low importance index is stored in the ordinary cloud disk, thereby improving the efficiency of the cloud disk storage and enhancing the customer experience; the stored data corresponding to each data classification result is migrated to the target cloud disk, and the data is classified and stored, which can more effectively organize and manage the data and improve the retrieval efficiency and availability of the data; different types of data have different access frequencies and importance. By classifying and storing data, data can be stored on the most suitable storage medium according to its characteristics, thereby maximizing the use of storage resources and achieving a balance between cost and performance; classifying and storing data can reduce the load pressure of the storage system, optimize data access speed and response time, and improve the overall performance of the system. Especially for scenarios of large-scale data storage and access, data classification storage can effectively improve the throughput and stability of the system.
[0070] Example 2
[0071] like Figure 2 As shown, the periodic detection of the current cloud disk to obtain the cloud disk detection result includes steps S11-S13:
[0072] S11: Obtaining the operation information of the current cloud disk within a unit time;
[0073] S12: Calculate the failure rate of the current cloud disk based on the operation information of the current cloud disk per unit time;
[0074] S13: Using the current cloud disk failure rate as the cloud disk detection result.
[0075] In this embodiment, the operation information of the current cloud disk per unit time includes: the capacity occupied by the cloud disk, the effective utilization rate of the cloud disk, the preset energy consumption of the cloud disk per unit time T, the actual energy consumed by the cloud disk, the energy required to start the cloud disk, the number of times the cloud disk is started per unit time T, the energy required when the cloud disk stops, the number of times the cloud disk stops per unit time T, the innermost circle diameter of the cloud disk, the bit density of the cloud disk, the average rotation speed of the cloud disk, etc.
[0076] The beneficial effect of the above technical solution is that by periodically detecting cloud disk information and calculating the failure rate, timely warning of current cloud disk failures can be achieved. Once the failure rate exceeds the set threshold, the system can issue an alarm in time and take corresponding preventive measures to avoid losses caused by data loss or system downtime. Regular detection of cloud disk failure rates helps to accurately evaluate the operating status of cloud disks, discover potential problems in time and repair them, thereby improving the stability and reliability of cloud disks.
[0077] Example 3
[0078] The calculating the failure rate of the current cloud disk based on the operation information of the current cloud disk within a unit time includes:
[0079]
[0080] Among them, Y i represents the failure rate of the i-th cloud disk; τ i represents the reliability coefficient of the ith cloud disk; α is the cloud disk startup parameter factor; α∈[0.0002, 0.0005]; γ represents the cloud disk shutdown parameter factor; γ∈[0.005, 0.01]; R i represents the effective utilization rate of the ith cloud disk space; E i represents the actual energy consumed by the ith cloud disk in unit time T, E i =(P i ×T+F i ×B i +G i ×C i )×3.14d i ×ρ i ×ω i ;P i represents the operating power of the ith cloud disk; F i represents the energy required to start the i-th cloud disk; B i represents the number of times the ith cloud disk is started within a unit time T; G i represents the energy required when the ith cloud disk stops spinning; C i represents the number of times the ith cloud disk stops spinning within a unit time T; d i represents the innermost diameter of the ith cloud disk; ρ i represents the bit density of the i-th cloud disk; ω i represents the average rotation speed of the ith cloud disk in unit time T; q i Indicates the occupied capacity of the i-th cloud disk; H i represents the preset energy consumed by the ith cloud disk in unit time T; Q i Indicates the total capacity of the i-th cloud disk.
[0081] In this embodiment, the reliability coefficient of the cloud disk is empirically defined based on the parameters of the cloud disk itself and the product quality of the manufacturer.
[0082] In this embodiment, energy (E) is a physical quantity of an object that changes state or generates motion; the calculation formula for energy is:
[0083] Energy (E) = Power (P) x Time (t)
[0084] Energy can be calculated from the power consumed in performing work, or from the mass, acceleration, and displacement of an object;
[0085] Therefore P i ×T and F i ×B i +C i ×C i The dimensions are consistent.
[0086] In this embodiment, α is related to the number of times the i-th cloud disk is started within a unit time T. The greater the number of times the i-th cloud disk is started within a unit time T, the greater the value of α.
[0087] In this embodiment, γ is related to the number of times the ith cloud disk stops rotating within a unit time T. The greater the number of times the ith cloud disk stops rotating within a unit time T, the smaller the value of γ.
[0088] The beneficial effect of the above technical solution is: this embodiment evaluates the failure rate of the cloud disk by multiple aspects such as the reliability, activity level, physical characteristics, usage and preset benchmarks of the cloud disk, so as to more accurately understand the health status and potential risks of the cloud disk, so as to take appropriate measures to prevent or mitigate potential failures, and provide valuable reference for the design and optimization of the cloud storage system by comparing the performance and reliability of different cloud disks or cloud disks in different time periods.
[0089] Example 4
[0090] When it is determined according to the cloud disk detection result that the cloud disk mode needs to be switched, the method includes:
[0091] The failure rate of the cloud disk is compared with a preset failure threshold, and when the failure rate of the cloud disk is greater than or equal to the preset failure threshold, it is determined that a cloud disk mode switch is required.
[0092] The beneficial effects of the above technical solution are: the working status of the cloud disk can be monitored in time during the system operation and switching prompts can be issued according to the set fault threshold, which can effectively reduce the risk of data loss caused by cloud disk failure and ensure the availability of the system and the integrity of the data. Through timely cloud disk mode switching, the system can quickly restore a stable operating state, reduce business interruption time, and improve system reliability and stability.
[0093] Example 5
[0094] The obtaining of the stored data in the current cloud disk and classifying the stored data to obtain the data classification result includes:
[0095] Get the classification sample data set;
[0096] The classification sample data set is input into the neural network model for training, and when the training result is determined to be qualified, an initial classification model is obtained;
[0097] The initial classification model is optimized based on the cross-validation method to obtain the optimized classification model;
[0098] Inputting the stored data into the optimized classification model for classification to obtain a number of initial classification results;
[0099] Taking any initial classification result, calculating the similarity between the initial classification result and the classification result of each category in the preset category, and obtaining a similarity set consisting of a plurality of similarities;
[0100] Obtain the maximum similarity value in the similarity set, compare the maximum similarity value with a preset similarity threshold, and if the maximum similarity value is greater than or equal to the preset similarity threshold, use the preset category corresponding to the maximum similarity value as the target category of the initial classification result; if the maximum similarity value is less than the preset similarity threshold, use the initial classification result as the result to be classified;
[0101] Traverse each initial classification result to obtain several target classification results and several results to be classified; merge several results to be classified to obtain a merged result to be classified;
[0102] The merged results of the items to be classified and several target classification results are taken as the data classification results.
[0103] In this embodiment, the method for calculating the similarity between the initial classification result and the classification result of each category in the preset category includes:
[0104] Obtain the data features corresponding to each piece of data in the initial classification result;
[0105] The data features corresponding to each piece of data in the initial classification result and the standard data features corresponding to the classification results of each category in the preset category are calculated based on a preset algorithm to obtain a similarity set consisting of several similarities corresponding to the initial classification result;
[0106] The preset algorithm includes:
[0107]
[0108] Among them, X i,j represents the similarity between the data features of the i-th initial classification result and the standard data features of the j-th preset classification in the preset category; Z i,j represents the mth data feature in the i-th initial classification result; y represents the total number of data features in the i-th initial classification result; W j,m represents the mth standard data feature of the jth preset classification;
[0109] In this embodiment, it is assumed that the maximum similarities corresponding to the six initial classification results A, B, C, D, E, and F are 0.9, 0.8, 0.7, 0.6, 0.5, and 0.4, and the preset similarity threshold is 0.65. The three initial classification results A, B, and C correspond to the target category, and D, E, and F are merged as the merged results to be classified.
[0110] The beneficial effect of the above technical solution is that an initial classification model for specific data features can be obtained by training the classification sample data set through a neural network model. This method is based on the principle of machine learning and can automatically learn and identify complex patterns in data, thereby improving the accuracy and efficiency of classification; the initial classification model is optimized by using the cross-validation method, which can further improve the generalization ability and classification accuracy of the model. Cross-validation divides the data set into multiple subsets, and repeatedly trains and tests the model to evaluate the performance of the model, and adjusts the model parameters accordingly to obtain a more robust and accurate classification model; after the stored data is input into the optimized classification model for classification, the classification result can be verified by calculating the similarity between the initial classification result and the classification result of each category in the preset category, and comparing it with the preset similarity threshold. This step can ensure the reliability of the classification result and reduce the risk of misclassification; for the results to be classified that do not meet the similarity threshold, by merging processing, it can provide convenience for subsequent data processing and analysis; the above technical solution provides an efficient, accurate, flexible and scalable cloud disk storage data classification method, which can provide users with better data management and usage experience.
[0111] Example 6
[0112] The determining, based on the data classification results, the cloud disk type corresponding to each data classification result includes:
[0113] Calculate the data importance index corresponding to each classification result in the classification results based on a preset algorithm;
[0114] If the data importance index is greater than or equal to the preset index threshold, the classification result corresponding to the data importance index being greater than or equal to the preset index threshold is stored based on the high-speed cloud disk;
[0115] If the data importance index is less than the preset index threshold, the classification result corresponding to the data importance index being less than the preset index threshold is stored based on a common cloud disk;
[0116] Traverse each classification result and determine the high-speed cloud disk or ordinary cloud disk corresponding to each classification result.
[0117] In this embodiment, the data importance index is a result of comprehensive evaluation based on the data features corresponding to each piece of data in the classification result and the number of calls of the data per unit time.
[0118] In this embodiment, the classification results corresponding to the data importance index being greater than or equal to the preset index threshold are stored based on the high-speed cloud disk, that is, in this embodiment, they are stored based on the target cloud disk in the high-speed cloud disk.
[0119] In this embodiment, the classification results corresponding to the data importance index being less than the preset index threshold are stored based on the common cloud disk, that is, based on the target cloud disk in the common cloud disk in this embodiment.
[0120] The beneficial effects of the above technical solution are: reasonable allocation of storage resources according to the importance of data, improving the efficiency of data storage and access. By storing important data in a high-speed cloud disk, the data can be quickly accessed and processed to meet the timely demand for high-value data; while storing general data in an ordinary cloud disk can save costs and make rational use of storage resources. Such data classification and storage strategies can optimize data management and storage efficiency, and improve the overall performance of the system and user experience.
[0121] Example 7
[0122] The calculating, based on a preset algorithm, a data importance index corresponding to each classification result in the classification results includes:
[0123]
[0124] Among them, Z i Indicates the data importance index corresponding to the i-th classification result; T i,j represents the data feature corresponding to the jth data in the i-th classification result; M represents the total number of data in the i-th classification result, and N represents the total number of classification results; p i,j It represents the number of times the jth data in the i-th classification result is called per unit time; P represents the number of times all data in all classification results are called per unit time.
[0125] The beneficial effects of the above technical scheme are: the technical scheme takes into account multiple factors such as data characteristics, number of calls and access frequency, which can comprehensively evaluate the importance of data and more accurately judge the value of data in storage; by considering the importance of data characteristics, its value can be quantitatively evaluated according to the content and attributes of the data, ensuring that the processing of different types of data is more accurate; the technical scheme also takes into account the number of data calls and the number of accesses per unit time. These indicators reflect the actual use of the data and can better reflect the actual importance of the data; through mathematical calculation methods, various factors are comprehensively considered and quantified into a data importance index, making the evaluation of data importance more objective and scientific; by accurately evaluating the importance of data, storage resources can be reasonably allocated, important data can be stored in high-speed cloud disks, access efficiency can be improved, and storage resources can be saved; ordinary data can be stored in ordinary cloud disks, making the entire storage system more efficient and optimized.
[0126] Example 8
[0127] The step of migrating the stored data corresponding to each data classification result to a target cloud disk in the target cloud disk set includes:
[0128] Obtain the historical migration rate, historical read / write rate, and space utilization rate of each target cloud disk in the target cloud disk set, and determine the storage priority of each target cloud disk based on the historical migration rate, historical read / write rate, and space utilization rate of each target cloud disk;
[0129] Determine a data migration strategy; the data migration strategy includes an import strategy and an export strategy; the import strategy includes an import thread strategy and a data distribution strategy;
[0130] Based on the storage priority and data migration strategy of each target cloud disk, the storage data corresponding to each data classification result is migrated to the target cloud disk.
[0131] In this embodiment, a specific implementation method of determining the storage priority of each target cloud disk based on the historical migration rate, historical read / write rate and space utilization rate of each target cloud disk may be:
[0132] Set weight coefficients for historical migration rate, historical read / write rate, and space utilization, for example, the weight coefficients for historical migration rate, historical read / write rate, and space utilization are 0.3, 0.3, and 0.4. The storage priority of each target cloud disk is obtained by multiplying the historical migration rate, historical read / write rate, and space utilization with the corresponding weight coefficients and summing them.
[0133] In this embodiment, the specific implementation method for determining the data migration strategy is: based on the characteristic information of the stored data corresponding to each data classification result, the stored data corresponding to each data classification result is imported into a thread strategy control including parallel processing, batch import, retry mechanism and priority management, etc., and the data distribution strategy during the data storage process includes business demand distribution, data synchronization, fault recovery, etc.
[0134] In this embodiment, the import thread strategy includes parallel processing: through multi-threading or parallel processing technology, parallel processing is achieved during the data import process to improve data import efficiency, which is particularly useful when processing large amounts of data; batch import: data is imported in batches, and the amount of data processed in each batch is controllable, which is conducive to monitoring and debugging; batch import also helps to reduce system resource usage and alleviate system pressure; priority management: different priorities are set according to the importance and urgency of the data to ensure that important data can be imported first and ensure the normal operation of the business; retry mechanism: set a retry strategy during the data import process. When an import failure or interruption occurs, a retry can be automatically or manually triggered to ensure data integrity and accuracy; monitoring and logging: establish a complete monitoring system and logging mechanism to monitor the status and performance of the data import process in real time, identify problems in a timely manner and make adjustments.
[0135] In this embodiment, the data distribution strategy includes distribution according to business needs: according to different business needs and data access frequency, data is reasonably distributed to different data storage nodes or databases to improve data access speed and efficiency; horizontal sharding: data is horizontally sharded according to a certain field and distributed to different nodes or cloud disks to achieve horizontal expansion and load balancing of data; vertical sharding: according to the field characteristics of the data table, the fields are stored separately in different tables or cloud disks to improve query efficiency and data management flexibility; caching strategy: for frequently accessed hot data, a caching strategy can be adopted to cache data in the cache server to reduce the number of database accesses and improve performance; data synchronization: for distributed systems, to ensure the synchronization and consistency of data, data synchronization tools or technologies can be used to achieve real-time synchronization and replication of data; fault recovery: establish a fault recovery mechanism for data distribution. When a node or cloud disk fails, the data can be quickly restored or switched to a backup node to ensure the availability and stability of the system.
[0136] The beneficial effects of the above technical solution are: by determining the storage priority according to the historical migration rate and space utilization of each target cloud disk, the data migration task can be effectively allocated, and cloud disks with high speed and sufficient space can be given priority as target storage, thereby maximizing the data migration efficiency; by considering factors such as historical read and write rates and space utilization, the storage priority of the target cloud disk can be reasonably determined, so that storage resources can be better utilized, resource waste and imbalance can be avoided, and optimized management of storage resources can be achieved; by determining the storage priority according to the historical read and write rates, hot data can be stored on the target cloud disk with faster read and write speeds, thereby improving data access speed, improving system performance and user experience; by reasonably planning data migration strategies, including import strategies and export strategies, resource consumption and time costs in the data migration process can be reduced, operating costs can be reduced, and data management efficiency can be improved; through the reasonable design and implementation of data distribution strategies and import process strategies, errors and failures in the data migration process can be avoided, the stability and reliability of the system can be improved, and the security and integrity of the data can be ensured.
[0137] Example 9
[0138] After the storage data corresponding to each data classification result is migrated to the target cloud disk in the target cloud disk set, the method further includes:
[0139] The migrated data in the target cloud disk is verified based on the backup data in the current cloud disk. When it is determined that the verification result is qualified, the data migration of the storage data in the current cloud disk is completed.
[0140] In this embodiment, the verification methods include comparison verification, data sampling, integrity verification, metadata verification and data consistency check.
[0141] The beneficial effects of the above technical solution are: by verifying the data after migrating it to the target cloud disk, it can ensure that the migrated data is completely consistent with the source data, avoiding data loss or damage during the migration process, thereby ensuring data integrity; verifying the consistency of the migrated data with the backup data helps to eliminate possible errors or problems in data migration, improve data security, and ensure that the data is not damaged or leaked during the migration process; migrating the data stored in the current cloud disk after the verification result is qualified can reduce the risk in the data migration process. Ensure that the data in the target cloud disk meets expectations before deleting or cleaning the data in the source cloud disk to avoid data loss caused by misoperation; through the verification process, possible problems in the data migration process can be discovered and solved in advance, avoiding repair or repeated data migration after migration, thereby improving data migration efficiency; ensuring the accuracy and stability of data migration can enhance user trust and satisfaction, ensure the security and integrity of user data, and enhance user experience.
[0142] like Figure 3 As shown, the second embodiment of the present invention proposes a device for switching cloud disk modes, including:
[0143] The detection module is used to perform periodic detection on the current cloud disk and obtain the cloud disk detection result;
[0144] The classification module is used to obtain the storage data in the current cloud disk and classify the storage data to obtain the data classification result when it is determined that the cloud disk mode needs to be switched according to the cloud disk detection result;
[0145] A determination module, used to determine the cloud disk type corresponding to each data classification result based on the data classification result;
[0146] Data migration module, used to:
[0147] Get the target cloud disk set corresponding to the cloud disk type;
[0148] The stored data corresponding to each data classification result is migrated to a target cloud disk in the target cloud disk set.
[0149] The beneficial effects of the above technical solution are: by periodically detecting the current cloud disk, the status of the current cloud disk is monitored to ensure the normal operation of the cloud disk storage; when the detection result requires switching the cloud disk mode, the prior art uses a method of re-matching each data block to the cloud disk to achieve the switching of the cloud disk mode, but such an operation may increase the complexity of the system. The present invention adopts the method of first classifying the data, performing a first preliminary classification on the stored data based on the training model, and calculating the similarity between the first preliminary classification result and the preset classification category to perform a secondary classification; while improving the accuracy of the classification, the data that does not meet the preset classification is merged, thereby improving the accuracy of the data classification and reducing the subsequent calculation amount based on the data matching cloud disk type; the data importance index of each data classification result is calculated based on the data classification result, and the data with a high importance index is stored in the efficient cloud disk first, and the data with a relatively low importance index is stored in the ordinary cloud disk, thereby improving the efficiency of the cloud disk storage and enhancing the customer experience; the stored data corresponding to each data classification result is migrated to the target cloud disk, and the data is classified and stored, which can more effectively organize and manage the data and improve the retrieval efficiency and availability of the data; different types of data have different access frequencies and importance. By classifying and storing data, data can be stored on the most suitable storage medium according to its characteristics, thereby maximizing the use of storage resources and achieving a balance between cost and performance; classifying and storing data can reduce the load pressure of the storage system, optimize data access speed and response time, and improve the overall performance of the system. Especially for scenarios of large-scale data storage and access, data classification storage can effectively improve the throughput and stability of the system.
[0150] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for switching cloud disk mode, characterized in that: include: Perform periodic detection on the current cloud disk to obtain the cloud disk detection result; When it is determined that the cloud disk mode needs to be switched according to the cloud disk detection result, the storage data in the current cloud disk is obtained, and the storage data is classified to obtain the data classification result; Determine the cloud disk type corresponding to each data classification result based on the data classification result; Get the target cloud disk set corresponding to the cloud disk type; Migrating the stored data corresponding to each data classification result to a target cloud disk in the target cloud disk set; The obtaining of the stored data in the current cloud disk and classifying the stored data to obtain the data classification result includes: Get the classification sample data set; Inputting the classification sample data set into the neural network model for training, and obtaining the initial classification model when the training result is determined to be qualified; The initial classification model is optimized based on the cross-validation method to obtain the optimized classification model; Inputting the stored data into the optimized classification model for classification to obtain a number of initial classification results; Taking any initial classification result, calculating the similarity between the initial classification result and the classification result of each category in the preset category, and obtaining a similarity set consisting of a plurality of similarities; Obtain the maximum similarity value in the similarity set, compare the maximum similarity value with a preset similarity threshold, and if the maximum similarity value is greater than or equal to the preset similarity threshold, use the preset category corresponding to the maximum similarity value as the target category of the initial classification result; if the maximum similarity value is less than the preset similarity threshold, use the initial classification result as the result to be classified; Traverse each initial classification result to obtain several target classification results and several results to be classified; merge several results to be classified to obtain a merged result to be classified; The merged results of the to-be-classified items and several target classification results are used as the data classification results; The determining, based on the data classification results, the cloud disk type corresponding to each data classification result includes: Calculate the data importance index corresponding to each classification result in the classification results based on a preset algorithm; If the data importance index is greater than or equal to the preset index threshold, the classification result corresponding to the data importance index being greater than or equal to the preset index threshold is stored based on the high-speed cloud disk; If the data importance index is less than the preset index threshold, the classification result corresponding to the data importance index being less than the preset index threshold is stored based on a common cloud disk; Traverse each classification result and determine the high-speed cloud disk or ordinary cloud disk corresponding to each classification result.
2. The method for switching cloud disk mode according to claim 1, characterized in that: The periodic detection of the current cloud disk to obtain the cloud disk detection result includes: Get the current cloud disk's running information per unit time; Calculate the failure rate of the current cloud disk based on the operation information of the current cloud disk per unit time; The failure rate of the current cloud disk is used as the cloud disk detection result.
3. The method for switching cloud disk mode according to claim 2, characterized in that: The calculating the failure rate of the current cloud disk based on the operation information of the current cloud disk within a unit time includes: Among them, Y i represents the failure rate of the i-th cloud disk; τ i represents the reliability coefficient of the ith cloud disk; α is the cloud disk startup parameter factor; α∈[0.0002, 0.0005]; γ represents the cloud disk shutdown parameter factor; γ∈[0.005, 0.01]; R i represents the effective utilization rate of the ith cloud disk space; E i represents the actual energy consumed by the ith cloud disk in unit time T, E i =(P i ×T+F i ×B i +G i ×C i )×3.14d i ×ρ i ×ω i ;P i represents the operating power of the ith cloud disk; F i represents the energy required to start the i-th cloud disk; B i represents the number of times the ith cloud disk is started within a unit time T; G i represents the energy required when the i-th cloud disk stops spinning; C i represents the number of times the ith cloud disk stops spinning within a unit time T; d i represents the innermost diameter of the ith cloud disk; ρ i represents the bit density of the i-th cloud disk; ω i represents the average rotation speed of the ith cloud disk in unit time T; q i Indicates the occupied capacity of the i-th cloud disk; H i represents the preset energy consumed by the ith cloud disk in unit time T; Q i Indicates the total capacity of the i-th cloud disk.
4. The method for switching cloud disk mode according to claim 3, characterized in that: When it is determined according to the cloud disk detection result that the cloud disk mode needs to be switched, the method includes: The failure rate of the cloud disk is compared with a preset failure threshold, and when the failure rate of the cloud disk is greater than or equal to the preset failure threshold, it is determined that a cloud disk mode switch is required.
5. The method for switching cloud disk mode according to claim 1, characterized in that: The calculating, based on a preset algorithm, a data importance index corresponding to each classification result in the classification results includes: Among them, Z i Indicates the data importance index corresponding to the i-th classification result; T i,j represents the data feature corresponding to the jth data in the i-th classification result; M represents the total number of data in the i-th classification result, and N represents the total number of classification results; p i,j It represents the number of times the jth data in the i-th classification result is called per unit time; P represents the number of times all data in all classification results are called per unit time.
6. The method for switching cloud disk mode according to claim 1, characterized in that: The step of migrating the stored data corresponding to each data classification result to a target cloud disk in the target cloud disk set includes: Obtain the historical migration rate, historical read / write rate, and space utilization rate of each target cloud disk in the target cloud disk set, and determine the storage priority of each target cloud disk based on the historical migration rate, historical read / write rate, and space utilization rate of each target cloud disk; Determine a data migration strategy; the data migration strategy includes an import strategy and an export strategy; the import strategy includes an import thread strategy and a data distribution strategy; Based on the storage priority and data migration strategy of each target cloud disk, the storage data corresponding to each data classification result is migrated to the target cloud disk.
7. The method for switching cloud disk mode according to claim 1, characterized in that: After the storage data corresponding to each data classification result is migrated to the target cloud disk in the target cloud disk set, the method further includes: The migrated data in the target cloud disk is verified based on the backup data in the current cloud disk. When it is determined that the verification result is qualified, the data migration of the storage data in the current cloud disk is completed.
8. A device for switching cloud disk modes, characterized in that: include: The detection module is used to perform periodic detection on the current cloud disk and obtain the cloud disk detection result; The classification module is used to obtain the storage data in the current cloud disk and classify the storage data to obtain the data classification result when it is determined that the cloud disk mode needs to be switched according to the cloud disk detection result; A determination module, used to determine the cloud disk type corresponding to each data classification result based on the data classification result; Data migration module, used to: Get the target cloud disk set corresponding to the cloud disk type; Migrating the stored data corresponding to each data classification result to a target cloud disk in the target cloud disk set; The classification module is used to obtain the storage data in the current cloud disk and classify the storage data when it is determined that the cloud disk mode needs to be switched according to the cloud disk detection result, and the method for obtaining the data classification result includes: Get the classification sample data set; Inputting the classification sample data set into the neural network model for training, and obtaining the initial classification model when the training result is determined to be qualified; The initial classification model is optimized based on the cross-validation method to obtain the optimized classification model; Inputting the stored data into the optimized classification model for classification to obtain a number of initial classification results; Taking any initial classification result, calculating the similarity between the initial classification result and the classification result of each category in the preset category, and obtaining a similarity set consisting of a plurality of similarities; Obtain the maximum similarity value in the similarity set, compare the maximum similarity value with a preset similarity threshold, and if the maximum similarity value is greater than or equal to the preset similarity threshold, use the preset category corresponding to the maximum similarity value as the target category of the initial classification result; if the maximum similarity value is less than the preset similarity threshold, use the initial classification result as the result to be classified; Traverse each initial classification result to obtain several target classification results and several results to be classified; merge several results to be classified to obtain a merged result to be classified; The merged results of the to-be-classified items and several target classification results are used as the data classification results; The determining, based on the data classification results, the cloud disk type corresponding to each data classification result includes: Calculate the data importance index corresponding to each classification result in the classification results based on a preset algorithm; If the data importance index is greater than or equal to the preset index threshold, the classification result corresponding to the data importance index being greater than or equal to the preset index threshold is stored based on the high-speed cloud disk; If the data importance index is less than the preset index threshold, the classification result corresponding to the data importance index being less than the preset index threshold is stored based on a common cloud disk; Traverse each classification result and determine the high-speed cloud disk or ordinary cloud disk corresponding to each classification result.
Citation Information
Patent Citations
Cloud disk allocation method and device, electronic equipment and storage medium
CN111722806A
Request processing method and device, electronic equipment and computer storage medium
CN112925472A