Storage device data security backup migration method and device and storage medium
Through the method of file data division and feature vector filtering tables, the problem of data recovery complexity in incremental backup is solved, and efficient and reliable data backup and recovery is achieved.
Patent Information
- Application Number
- CN202510416731.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2045-04-03
AI Technical Summary
When existing data backup technology is based on incremental backups, it is impossible to ensure backup efficiency and data reliability while avoiding the need to restore previous backups one by one when restoring data.
The file data is divided into multiple data blocks through the file data division method, the feature parameters of each data block are obtained and the feature vector is constructed, and the feature filter table is used for initial and re-backup processing to ensure the uniqueness and reliability of the data blocks.
While ensuring backup efficiency, it avoids the recovery of previous backups one by one, improves the accuracy and speed of data recovery, and reduces the complexity and recovery time of the backup process.
Smart Images

Figure CN120448185A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data backup, and in particular to a storage device data security backup and migration method, device and storage medium. Background Art
[0002] Data backup technology refers to a technical means of copying data in a computer system to other storage media to prevent data loss or damage. It uses specific software and hardware devices to perform regular or real-time data copying operations according to predetermined strategies and plans, and stores the backup data in a safe location so that the data can be quickly restored when needed.
[0003] Existing data backup methods mainly include full backup, incremental backup and differential backup; full backup is a complete copy of all data; incremental backup only backs up data that has been changed since the last backup; differential backup backs up data that has been changed since the last full backup; and when data backup technology backs up file data based on incremental backup, since incremental backup depends on the previous backup chain, if one of the incremental backup files is damaged or lost, it may cause the subsequent version recovery process to be unable to proceed, affecting data reliability; and when restoring data, it is necessary to restore the last full backup first, and then restore subsequent historical version data in sequence; if the number of incremental backups is large, this process will be cumbersome and prone to errors, resulting in prolonged recovery time; for example For example, if a system failure occurs after the 10th incremental backup, it is necessary to restore the full backup first, and then restore the historical version data of 1 to 10 times in sequence. Problems in any link may affect the complete recovery of the data. For example, the patent application with publication number CN115168111A discloses a cache-based object storage massive data backup method and system. This solution is based on incremental backup. Although it saves backup time and improves backup efficiency during non-backup, the recovery process is complicated when restoring files, and the reliability of data backup is low. Therefore, when the existing data backup technology backs up file data based on incremental backup, it is impossible to ensure backup efficiency and reliability of backup data while avoiding the need to restore all previous backups one by one when restoring data. Summary of the Invention
[0004] The present invention aims to solve at least one of the technical problems in the prior art to some extent. By using a file data partitioning method to perform data partitioning processing on the file data in a storage device, a collection of file data blocks is obtained; the characteristic parameters of all file data blocks in the collection of file data blocks are obtained, and the characteristic vector of the file data block is obtained, denoted as the file data block characteristic information; a data block screening characteristic vector is constructed, and a document characteristic screening table is constructed according to the file data block characteristic information, and an initial backup process is performed; based on the file data partitioning method and the document characteristic screening table, the file data is backed up again; to solve the problem that when the existing data backup technology backs up file data based on incremental backup, it is impossible to ensure both the backup efficiency and the reliability of the backup data, and avoid restoring each backup one by one when restoring data.
[0005] To achieve the above object, in the first aspect, the present application provides a method for secure backup and migration of storage device data, including the following steps:
[0006] Use a file data partitioning method to perform data partitioning processing on the file data in the storage device to obtain a collection of file data blocks;
[0007] Obtain the characteristic parameters of all file data blocks in the collection of file data blocks, and obtain the characteristic vector of the file data block, denoted as the file data block characteristic information;
[0008] Construct a data block screening characteristic vector, construct a document characteristic screening table according to the file data block characteristic information, and perform an initial backup process;
[0009] Based on the file data partitioning method and the document characteristic screening table, perform a second backup process on the file data.
[0010] Further, using the file data partitioning method to perform data partitioning processing on the file data in the storage device to obtain a collection of file data blocks includes the following sub-steps:
[0011] Convert the data bytes of the file data to be backed up from binary to hexadecimal to obtain the first file data, and use the file data partitioning method to perform data partitioning processing on the first file data, including: traversing the data bytes of the first file data, obtaining the largest data byte and the smallest data byte, and respectively denoting them as the largest data byte and the smallest data byte in sequence;
[0012] Set the size of the first standard window to a1, the size of the first sliding window to a2, a2 < a1; place the initial standard window at the starting position of the first file data, and obtain the maximum value and the minimum value of all data bytes within the initial standard window at this time, and respectively denote them as the extremely large data byte and the extremely small data byte in sequence;
[0013] If the maximum data byte is equal to the maximum data byte, then obtain the second largest value of all data bytes in the initial standard window at this time and mark it as the maximum reference byte, otherwise mark the maximum data byte as the maximum reference byte; if the minimum data byte is equal to the minimum data byte, then obtain the second smallest value of all data bytes in the initial standard window at this time and mark it as the minimum reference byte, otherwise mark the minimum data byte as the minimum reference byte.
[0014] Furthermore, performing data partitioning processing on the file data in the storage device using the file data partitioning method to obtain a collection of file data blocks further includes the following sub-steps:
[0015] Place the first sliding window in connection with the first standard window and behind the first standard window; obtain the maximum and minimum values of all data bytes in the first sliding window, and record them in order as the sliding maximum byte and the sliding minimum byte; if the sliding maximum byte is greater than the maximum reference byte or the sliding minimum byte is less than the minimum reference byte, use the end position of the sliding window at this time as the data partition point to perform data partitioning, obtain file data blocks, and record the number of data partitions;
[0016] Otherwise, slide the first sliding window in the direction away from the first standard window with a sliding step of a2; obtain the maximum and minimum values of all data bytes in the first sliding window again, and compare them again until the data partition point is found to partition the data, obtain file data blocks, and record the number of data partitions;
[0017] After each data division to obtain a file data block, the first standard window is placed again at the starting position of the remaining first file data, and the operation is repeated to divide the first file data into multiple file data blocks. According to the number of data divisions, the corresponding file data block is recorded as the i-th file data block, where i represents the number of data divisions; all file data blocks are recorded as a file data block collection.
[0018] Furthermore, obtaining characteristic parameters of all file data blocks in the file data block collection and obtaining characteristic vectors of the file data blocks, which are recorded as file data block characteristic information, includes the following sub-steps:
[0019] Set the original feature value to M0, M0 < 255, and record M0 in binary as MH0; for any file data block in the file data block collection, record it as the first data block, obtain all data bytes in the first data block, record it as the first byte sequence; convert all data bytes in the first byte sequence from hexadecimal to binary and decimal, and record them in order as the second byte sequence and the third byte sequence respectively;
[0020] Shift MH0 left circularly by k1 bits to obtain HK0, perform an XOR operation on HK0 and the first data byte in the second byte sequence to obtain MH1; then shift MH1 left circularly by k1 bits to obtain HK1, perform an XOR operation on HK1 and the second data byte in the second byte sequence to obtain MH2; repeat the process of processing all data bytes in the second byte sequence in turn, and record the final output value as MHn; convert MHn to decimal and take the modulus of k2 to obtain TM1, which is recorded as the first eigenvalue TM1 of the corresponding file data block, where k2 is the set modulus value.
[0021] Furthermore, obtaining characteristic parameters of all file data blocks in the file data block collection and obtaining characteristic vectors of the file data blocks, which are recorded as file data block characteristic information, further includes the following sub-steps:
[0022] Set the first weight to q1, the second weight to q2, and the third weight to q3; q1+q2=10, and q1>0, q2>0, q3>0; record the data bytes in the third byte sequence in order as ZK1, ZK2, ..., ZKn; based on M0, calculate M1, M1=q1*M0+q2*ZK1+0*q3, to obtain M1; then calculate M2, M2=q1*M1+q2*ZK2+1*q3, to obtain M2; then calculate M3, M3=q1*M2+q2*ZK3+2*q3; repeat the process of processing all data bytes in the third byte sequence in turn, and after completion, obtain Mn modulo k2 to obtain TM2, which is recorded as the second eigenvalue TM2 of the corresponding file data block;
[0023] Recording the data bytes with odd position numbers in the second byte sequence as odd byte sequences, and recording the data bytes with even position numbers as even byte sequences;
[0024] The data bytes in the odd-byte sequence are sequentially denoted as QK1, QK2, ..., QKj; QK1 and QK2 are XORed, and the result of the first XOR operation is XORed with QK3, and the result of the second XOR operation is XORed with QK4; the XOR operation is repeated for all data bytes of the odd-byte sequence in a loop, and after completion, the result of the last XOR operation is modulo k2 to obtain TM3; this is denoted as the third eigenvalue TM3 of the corresponding file data block;
[0025] The data bytes in the even-numbered byte sequence are sequentially denoted as OK1, OK2, ..., OKj; the upper 4 bits and the lower 4 bits of OK1 are XORed, and the result of the first XOR operation is XORed with the lower 4 bits of OK2; the result of the second XOR operation is XORed with the upper 4 bits of OK2; the result of the third XOR operation is XORed with the lower 4 bits of OK3; the XOR operation is repeated on the lower 4 bits and the upper 4 bits of all data bytes in the even-numbered byte sequence. After completion, the result of the last XOR operation is modulo k2 to obtain TM4; this is denoted as the fourth eigenvalue TM4 of the corresponding file data block.
[0026] Furthermore, obtaining characteristic parameters of all file data blocks in the file data block collection and obtaining characteristic vectors of the file data blocks, which are recorded as file data block characteristic information, further includes the following sub-steps:
[0027] For TM1, TM2, TM3, and TM4 of the corresponding file data block, if TM1, TM2, TM3, and TM4 are different from each other, they are recorded as characteristic parameters of the corresponding file data block, and the corresponding TM1, TM2, TM3, and TM4 are combined into a characteristic vector, recorded as TX = {TN1, TN2, TN3, TN4}, and marked as the characteristic vector of the file data block, where TN1, TN2, TN3, and TN4 represent the different TM1, TM2, TM3, and TM4 in order;
[0028] If TM1, TM2, TM3, and TM4 have the same value, then increase the same value in TM1, TM2, TM3, and TM4 by 1, 2, and 3 in sequence until there are no more identical values. The processed TM1, TM2, TM3, and TM4 are recorded as the feature parameters of the corresponding file data block, combined into a feature vector TX, and marked as the feature vector of the file data block;
[0029] Repeatedly obtain the characteristic parameters and characteristic vectors of all file data blocks in the file data block collection, and record them as file data block characteristic information.
[0030] Furthermore, constructing a data block screening feature vector, and constructing a document feature screening table based on the file data block feature information, and performing the initial backup process includes the following sub-steps:
[0031] Set k2k3-bit binary numbers, record them as initial binary numbers, set all initial binary numbers to 0; and combine them in a random order to form a data block screening feature vector, record them as TS1 = {t1x1, t1x2, ..., t1xk2}; repeatedly set multiple data block screening feature vectors, record them as TS1, TS2, ..., TSx in sequence, mark them as the original feature screening table, and mark all data block screening feature vectors in the original feature screening table as available;
[0032] For the feature vectors of all file data blocks in the file data block feature information, the original feature screening table is assigned in sequence according to the corresponding file data blocks, including: for the feature vector of any file data block, recorded as the first feature vector, the corresponding TN1, TN2, TN3 and TN4 are obtained; and the data block screening feature vector with the smallest sequence number and in an available state is obtained from the original feature screening table, recorded as the first screening feature vector, and the value of the component with the corresponding sequence number in the first screening feature vector is increased by 1 according to the values of TN1, TN2, TN3 and TN4;
[0033] For any data block filtering feature vector, if half of the components of the data block filtering feature vector are not 0, or if k3 digits of any component of the data block filtering feature vector are all 1, then mark the data block filtering feature vector as disabled;
[0034] After completion, a document feature screening table is obtained, and all file data blocks of the file data to be backed up are respectively backed up for the first time, and the initial backup positions are respectively recorded.
[0035] Furthermore, based on the file data partitioning method and the document feature screening table, the file data is backed up again, including the following sub-steps:
[0036] When file data needs to be backed up again, the file data is partitioned using a file data partitioning method to obtain re-partitioned data blocks, and characteristic vectors of each re-partitioned data block are obtained, and re-backup screening is performed, including: for any characteristic vector of the re-partitioned data block, it is recorded as a second characteristic vector, TN1, TN2, TN3 and TN4 of the second characteristic vector are obtained, and recorded as TY1, TY2, TY3 and TN4 in sequence; if there is a data block screening characteristic vector in the document feature screening table, and the components of the TY1, TY2, TY3 and TY4 positions of the data block screening characteristic vector are not 0, then the corresponding re-partitioned data block is marked as a backed-up data block, otherwise it is marked as a non-backed-up data block; and the marking is repeated for all re-partitioned data blocks;
[0037] Back up the unbacked-up data blocks again, and record the corresponding backup positions. Then obtain the initial backup positions of the backed-up data blocks and form a new backup record with the corresponding backup positions.
[0038] In a second aspect, the present application provides an electronic device comprising a processor and a memory, wherein the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the steps in the above method are performed.
[0039] In a third aspect, the present application provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in the above method are performed.
[0040] The beneficial effects of the present invention are as follows: the present invention performs data partitioning processing on file data in a storage device by utilizing a file data partitioning method to obtain a file data block collection; obtains characteristic parameters of all file data blocks in the file data block collection, and obtains characteristic vectors of the file data blocks, which are recorded as file data block characteristic information; constructs a data block screening characteristic vector, and constructs a document characteristic screening table based on the file data block characteristic information, and performs an initial backup process; and performs a secondary backup process on the file data based on the file data partitioning method and the document characteristic screening table. This can ensure backup efficiency and reliability of backup data while avoiding the problem of having to restore all previous backups one by one when restoring data.
[0041] The present invention divides file data into multiple data blocks of variable length through a file data partitioning method, so that the size of the data block matches the data type and density, avoiding space waste that may be caused by fixed-length partitioning, and avoiding the extremely uneven partitioning of the traditional partitioning method; obtaining the feature vector of the data block and constructing a document feature screening table. The advantage is that the feature vector can accurately describe the unique attributes of the data block and ensure the uniqueness of the data block. By constructing the document feature screening table, the data blocks that meet the conditions can be quickly located and screened out based on the feature vector; the data blocks are screened during the backup process, and a new backup file is formed according to the position of the backup data block. The advantage is that repeated backup of unchanged data is avoided, and backup efficiency is guaranteed. When restoring data, the data can be quickly restored to a specified state based on the storage position information of the new and old data blocks recorded in the new backup file, thereby improving the accuracy and speed of data recovery. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 It is a principle block diagram of the system of the present invention;
[0043] Figure 2 This is a schematic diagram of file data division according to the present invention;
[0044] Figure 3Schematic diagram for calculating the fourth eigenvalue of the present invention;
[0045] Figure 4 Schematic diagram of the structure of the electronic device of the present invention. Detailed implementation manners
[0046] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0047] Example 1, please refer to Figure 1 As shown, in a first aspect, the present application provides a method for secure backup and migration of storage device data, including the following steps:
[0048] Step S1, perform data partitioning processing on the file data in the storage device by using a file data partitioning method to obtain a set of file data blocks; Step S1 includes the following sub-steps:
[0049] Step S101, convert the data bytes of the file data to be backed up from binary to hexadecimal to obtain the first file data;
[0050] Step S102, perform data partitioning processing on the first file data by using a file data partitioning method; Step S102 includes the following sub-steps:
[0051] Step S1021, traverse the data bytes of the first file data to obtain the largest data byte and the smallest data byte, and record them as the maximum data byte and the minimum data byte in sequence;
[0052] Step S1022, set the size of the first standard window as a1 and the size of the first sliding window as a2, where a2 < a1; place the initial standard window at the starting position of the first file data, and obtain the maximum and minimum values of all data bytes within the initial standard window at this time, and record them as the extremely large data byte and the extremely small data byte in sequence; In this embodiment, a1 is 6 and a2 is 2, with the unit being the number of byte counts, that is, a1 is 6 data bytes and a2 is 2 data bytes;
[0053] Step S1023: If the maximum data byte is equal to the maximum data byte, then the second largest value of all data bytes in the initial standard window at this time is obtained and marked as the maximum reference byte, otherwise the maximum data byte is marked as the maximum reference byte; if the minimum data byte is equal to the minimum data byte, then the second smallest value of all data bytes in the initial standard window at this time is obtained and marked as the minimum reference byte, otherwise the minimum data byte is marked as the minimum reference byte; for example, if the maximum data byte is 0XFF, the maximum data byte is also 0XFF, and the second largest data byte is 0XFE, then 0XFE is marked as the maximum reference byte; the bytes equal to the maximum data byte and the bytes equal to the minimum data byte are not marked as reference bytes in order to prevent the division point from being found during subsequent division.
[0054] Step S1024, please refer to Figure 2 As shown, the first sliding window is placed in connection with the first standard window and placed behind the first standard window; the maximum value and the minimum value of all data bytes in the first sliding window are obtained and recorded in sequence as the sliding maximum byte and the sliding minimum byte; if the sliding maximum byte is greater than the maximum reference byte or the sliding minimum byte is less than the minimum reference byte, the end position of the sliding window at this time is used as the data partitioning point to perform data partitioning, obtain file data blocks, and record the number of data partitioning; by continuously comparing the maximum value and the minimum value of the data in the sliding window with the reference value in the standard window; when the data in the sliding window fluctuates greatly, the position can be used as the data partitioning point in time; the mutation point in the data can be captured, and data with similar characteristics can be divided into the same data block, thereby improving the rationality of data partitioning;
[0055] Step S1025: Otherwise, the first sliding window is slid away from the first standard window with a sliding step of a2. The maximum and minimum values of all data bytes in the first sliding window are obtained again and compared again until a data partitioning point is found. The data is partitioned to obtain file data blocks and the number of data partitions is recorded. The sliding step is equal to the sliding window size to improve the efficiency of data partitioning.
[0056] Step S1026: After each data partitioning to obtain a file data block, the first standard window is again placed at the starting position of the remaining first file data, and the operation is repeated to partition the first file data into multiple file data blocks. Based on the number of data partitions, the corresponding file data block is recorded as the i-th file data block, where i represents the number of data partitions. That is, each time a data block is partitioned, the operation is repeated starting from the starting position of the remaining data to partition the data into multiple data blocks.
[0057] Step S103, recording all file data blocks as a file data block collection;
[0058] During the specific implementation process, the maximum and minimum data bytes are obtained by traversing the first file data, and the maximum and minimum data bytes and possible second largest and second smallest values are further analyzed within each standard window; this enables the partitioning process to fully consider the overall distribution characteristics of the data, especially the extreme values of the data; different file data may have different numerical ranges and distribution patterns, and this analysis method based on data extreme values can adaptively determine the partitioning points according to the characteristics of the data itself, rather than using fixed partitioning rules, thereby more accurately reflecting the inherent structure of the data; since the partitioning points are dynamically determined based on the actual characteristics of the data, the differences between different data blocks will be relatively small; this helps to improve the overall consistency of the data and reduce the complexity of the backup process.
[0059] Step S2, obtaining characteristic parameters of all file data blocks in the file data block collection, and obtaining characteristic vectors of the file data blocks, which are recorded as file data block characteristic information; Step S2 includes the following sub-steps:
[0060] Step S201: Set the original feature value to M0, M0<255, and record M0 in binary as MH0; for any document data block in the document data block collection, record it as the first data block, obtain all data bytes in the first data block, record it as the first byte sequence;
[0061] Step S202: Convert all data bytes in the first byte sequence from hexadecimal to binary and decimal, and record them as the second byte sequence and the third byte sequence in sequence. In this embodiment, M0=0.
[0062] Step S203: cyclically shift MH0 left by k1 bits to obtain HK0, perform an XOR operation on HK0 and the first data byte in the second byte sequence to obtain MH1; then cyclically shift MH1 left by k1 bits to obtain HK1, perform an XOR operation on HK1 and the second data byte in the second byte sequence to obtain MH2; repeat the process of processing all data bytes in the second byte sequence in sequence, and record the final output value as MHn; convert MHn into decimal and perform modulus calculation with k2 to obtain TM1, which is recorded as the first eigenvalue TM1 of the corresponding document data block, where k2 is a set modulus value. In this embodiment, k2 is 200.
[0063] In this embodiment, k1=3; circular left shift refers to shifting all bits of a binary number to the left by a specified number of bits, while putting the bits shifted out from the left back to the right. For example, 11010010 is circularly shifted left by 3 bits to 01001011; k2 is a set modulus value, and taking the modulus of k2, that is, dividing by k2 and taking the remainder, is intended to scale the first eigenvalue TM1 to a certain range; the circular left shift operation can make full use of each bit of data information, while the exclusive OR operation is more sensitive to slight changes in the data and can resist local interference and noise of the data to a certain extent, making the calculation of the eigenvalue more stable and reliable; the exclusive OR operation means that if two numbers are both 1 or both 0, the result is 0, otherwise the result is 1;
[0064] Step S204: Set the first weight to q1, the second weight to q2, and the third weight to q3; q1+q2=10, and q1>0, q2>0, and q3>0; record the data bytes in the third byte sequence in order as ZK1, ZK2, ..., ZKn; calculate M1 based on M0, M1=q1*M0+q2*ZK1+0*q3, and obtain M1; then calculate M2, M2=q1*M1+q2*ZK2+1*q3, and obtain M2; then calculate M3, M3=q1*M2+q2*ZK3+2*q3; repeat the loop to process all data bytes in the third byte sequence in sequence, and after completion, obtain Mn modulo k2 to obtain TM2, which is recorded as the second eigenvalue TM2 of the corresponding document data block;
[0065] In this embodiment, q1=4, q2=6, and q3=2. The original eigenvalue and the decimal byte sequence of the data block are combined and weighted using different weights. This allows the second eigenvalue to not only consider the original feature information, but also fully utilize the numerical information of each byte in the data block, thereby more comprehensively reflecting the characteristics of the data block. The weighted calculation method makes the calculation of the eigenvalue relatively stable and will not fluctuate violently due to changes in individual bytes. At the same time, due to the integration of multiple factors, the second eigenvalue has a certain resistance to local noise and interference in the data, thereby improving the reliability of the eigenvalue.
[0066] Step S205: Record the data bytes with odd position numbers in the second byte sequence as an odd byte sequence, and record the data bytes with even position numbers as an even byte sequence;
[0067] Step S206: The data bytes in the odd-byte sequence are sequentially denoted as QK1, QK2, ..., QKj; QK1 is XORed with QK2, the result of the first XOR operation is XORed with QK3, and the result of the second XOR operation is XORed with QK4; the XOR operation is repeated for all data bytes in the odd-byte sequence, and after completion, the result of the last XOR operation is modulo k2 to obtain TM3; this is denoted as the third eigenvalue TM3 of the corresponding document data block; performing the XOR operation only on the odd-byte sequence can extract local features of the data at odd byte positions in the data block;
[0068] Step S207, please refer to Figure 3 As shown, the data bytes in the even byte sequence are sequentially recorded as OK1, OK2, ..., OKj; the upper 4 bits and the lower 4 bits of OK1 are XORed, and the result of the first XOR operation is XORed with the lower 4 bits of OK2; the result of the second XOR operation is XORed with the upper 4 bits of OK2; the result of the third XOR operation is XORed with the lower 4 bits of OK3; the XOR operation is repeated on the lower 4 bits and the upper 4 bits of all data bytes of the even byte sequence, and after completion, the result of the last XOR operation is modulo k2 to obtain TM4; recorded as the fourth eigenvalue TM4 of the corresponding document data block; the upper 4 bits and the lower 4 bits of the even byte sequence are XORed respectively. This method goes deep into the internal structure of the byte and can mine more subtle feature information inside the byte; different from the third eigenvalue extracting local features of odd bytes, the fourth eigenvalue focuses on the feature distribution inside the even bytes;
[0069] Step S208: For TM1, TM2, TM3, and TM4 of the corresponding document data block, if TM1, TM2, TM3, and TM4 are different from each other, they are recorded as feature parameters of the corresponding document data block, and the corresponding TM1, TM2, TM3, and TM4 are combined into a feature vector, recorded as TX = {TN1, TN2, TN3, TN4}, and marked as the feature vector of the document data block, where TN1, TN2, TN3, and TN4 represent the different TM1, TM2, TM3, and TM4 in order.
[0070] Step S209: If TM1, TM2, TM3, and TM4 have the same value, then the same values in TM1, TM2, TM3, and TM4 are incremented by 1, 2, and 3 in sequence until no more identical values exist. The processed TM1, TM2, TM3, and TM4 are recorded as feature parameters of the corresponding document data block, combined into a feature vector TX, and labeled as the feature vector of the document data block. For example, if TM1, TM2, TM3, and TM4 are 22, 22, 22, and 32, respectively, then the processed values are 22+1, 22+2, 22, and 32, i.e., 23, 24, 22, and 32.
[0071] Step S210, repeatedly obtaining feature parameters and feature vectors of all document data blocks in the document data block collection, and recording them as document data block feature information;
[0072] In the specific implementation process, the feature parameters of the document data blocks do not have the same values. The advantages are: ensuring that each feature parameter of each document data block is unique, reducing redundancy and correlation between features; this helps to more comprehensively and accurately characterize the characteristics of the document data block, facilitates more accurate identification and distinction of different document data blocks, and improves the feature vector's ability to identify document data blocks, so that in subsequent screening, each document data block can be more accurately located and distinguished; and the uniqueness and independence of the feature parameters can increase the confidentiality and anti-attack capabilities of the data; if the feature values are the same, it is possible to obtain the pattern of the data or forge it by analyzing the same feature values; and the absence of feature parameters with the same values can improve the security and stability of the data and reduce the risk of data being cracked or tampered with.
[0073] Step S3: constructing a data block screening feature vector, constructing a document feature screening table based on the file data block feature information, and performing initial backup processing; Step S3 includes the following sub-steps:
[0074] Step S301: Set k2 k3-bit binary numbers, record them as initial binary numbers, set all initial binary numbers to 0; and combine them in a random order to form a data block screening feature vector, record them as TS1 = {t1x1, t1x2, ..., t1xk2}; repeatedly set multiple data block screening feature vectors, record them as TS1, TS2, ..., TSx in sequence, mark them as the original feature screening table, and mark all data block screening feature vectors in the original feature screening table as available; for example, k2 = 200, k3 = 4; then TS1 = {0000, 0000, ..., 0000}, a total of 200 components with the value of 0000;
[0075] Step S302, for the feature vectors of all document data blocks in the document data block feature information, assigning values to the original feature screening table in sequence according to the corresponding document data blocks, including: for the feature vector of any document data block, recorded as the first feature vector, obtaining the corresponding TN1, TN2, TN3, and TN4; obtaining the data block screening feature vector with the smallest sequence number and in an available state from the original feature screening table, recorded as the first screening feature vector, and adding 1 to the values of the components with corresponding sequence numbers in the first screening feature vector according to the values of TN1, TN2, TN3, and TN4; that is, starting from TS1, if TS1 is not available, then screening TS2 until a suitable data block screening feature vector is found; for example, if TS1 is available, TN1, TN2, TN3, and TN4 are 23, 24, 22, and 32, respectively, then adding 1 to the 23rd, 24th, 22nd, and 32nd components of TS1;
[0076] Step S303: For any data block screening feature vector, if half of the components of the data block screening feature vector are not 0, or if k3 digits of any component of the data block screening feature vector are all 1, then the data block screening feature vector is marked as disabled. For example, if the third component in TS1 is already 1111, then it is marked as disabled. Or if there are 200 components in TS1 and 100 or more of them are not 0, then it is also marked as disabled.
[0077] Step S304: After the completion, a document feature screening table is obtained, and all document data blocks of the document data to be backed up are respectively backed up for the first time, and the initial backup positions are respectively recorded;
[0078] During the specific implementation process, when too many components of the data block screening feature vector are not 0, it may cause confusion in the subsequent feature judgment of the document data block, resulting in the erroneous judgment of data blocks that do not belong to certain features as having such features. Marking it as disabled can prevent such misjudgment and ensure the accuracy of the screening; prevent data overflow or anomaly: if the k3 digits of any component of the data block screening feature vector are all 1, this may indicate that the component has reached the upper limit of its representation range, and continued use may cause data overflow or other abnormal situations; marking it as disabled can avoid program errors or inaccurate results due to such abnormal situations in subsequent processing.
[0079] Step S4, based on the file data partitioning method and the document feature screening table, backing up the file data again; Step S4 includes the following sub-steps:
[0080] Step S401: When document data needs to be backed up again, the document data is partitioned using a document data partitioning method to obtain re-partitioned data blocks.
[0081] Step S402, and obtain the feature vectors of each re-divided data block, and perform a backup screening again, including: for any feature vector of the re-divided data block, record it as the second feature vector, obtain TN1, TN2, TN3 and TN4 of the second feature vector, and record them as TY1, TY2, TY3 and TY4 in order; if there is a data block screening feature vector in the document feature screening table, and the components of the TY1, TY2, TY3 and TN4 positions of the data block screening feature vector are not 0, then mark the corresponding re-divided data block as backed up data block, otherwise it is marked as a non-backed-up data block; repeat the marking process for all sub-divided data blocks; for example, if TY1, TY2, TY3, and TY4 are 23, 25, 26, and 59 respectively, and the 23rd, 25th, 26th, and 59th components in TS1 are not 0, then the corresponding data blocks are marked as backup data blocks; because the feature vector of each data block is unique, each data block can be accurately identified through this uniqueness, and the backup status of the data block can be identified by whether the component at a specific position in the feature vector is 0, which can clearly distinguish between backed-up and non-backed-up data blocks;
[0082] Step S403: Back up the unbacked-up data blocks again, record the corresponding backup positions, obtain the initial backup positions of the backed-up data blocks, and form a new backup record with the corresponding backup positions.
[0083] During the specific implementation process, the backup location of the unbacked-up data block is recorded, and a new backup record is formed together with the initial backup location of the backed-up data block, so that the backup location information of the data is clearer and more organized; it is convenient for subsequent query, recovery and management of the data, and can quickly locate different backup versions of the data, thereby improving the efficiency and convenience of data management; and when restoring data, there is no need to restore all previous backups one by one, and the data block backup status can be directly judged based on the document feature screening table and the data block feature vector, and the required data block can be quickly located and the file data can be restored, greatly shortening the recovery time; and through direct positioning recovery, it does not rely on the sequential recovery of all previous backups, which reduces the risk of data inconsistency due to problems in the intermediate links, and can better ensure the integrity and consistency of the restored data.
[0084] Example 2, please refer to Figure 4 As shown, Figure 4The present invention provides a structural schematic diagram of an electronic device, which may include: 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. The memory stores computer-readable instructions, and the processor can call instructions from the memory. When the computer-readable instructions are executed by the processor, the processor executes the steps of a method for secure data backup and migration of storage device data to achieve the following functions: using a file data partitioning method to partition file data in the storage device to obtain a collection of file data blocks; obtaining characteristic parameters of all file data blocks in the collection of file data blocks and obtaining a characteristic vector of the file data blocks, which is recorded as file data block characteristic information; constructing a data block screening characteristic vector, and constructing a document feature screening table based on the file data block characteristic information, and performing an initial backup process; and performing a second backup process on the file data based on the file data partitioning method and the document feature screening table.
[0085] In addition, the logical instructions in the above-mentioned memory can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0086] Example 3. The present application also provides a computer-readable storage medium. The present application provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the above storage device data security backup and migration method are executed to achieve the following functions: using the file data partitioning method to perform data partitioning processing on the file data in the storage device to obtain a file data block collection; obtaining the characteristic parameters of all file data blocks in the file data block collection, and obtaining the characteristic vector of the file data block, recorded as file data block characteristic information; constructing a data block screening feature vector, and constructing a document feature screening table based on the file data block characteristic information, and performing initial backup processing; based on the file data partitioning method and the document feature screening table, performing a second backup processing on the file data.
[0087] Through the description of the above embodiments, the embodiments of the present invention can be provided as methods, systems or computer program products. Based on this understanding, the above technical solutions, in essence or in other words, the part that contributes to the prior art, can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiment.
[0088] In the embodiments provided in this application, it should be understood that the disclosed system or method can be implemented in other ways. The embodiments described above are merely illustrative. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or units can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of systems, modules and units can be electrical, mechanical or other forms.
[0089] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for securely backing up and migrating storage device data, characterized in that: It includes the following steps: Use the file data partitioning method to perform data partitioning on the file data in the storage device to obtain a collection of file data blocks; Obtain the characteristic parameters of all file data blocks in the collection of file data blocks, and obtain the characteristic vector of the file data blocks, denoted as the file data block characteristic information; Construct a data block screening characteristic vector, and construct a document characteristic screening table based on the file data block characteristic information, and perform an initial backup process; Based on the file data partitioning method and the document characteristic screening table, perform a secondary backup process on the file data.
2. A storage device data security backup and migration method according to claim 1, characterized in that: Using the file data partitioning method to perform data partitioning on the file data in the storage device to obtain a collection of file data blocks includes the following sub-steps: Convert the data bytes of the file data to be backed up from binary to hexadecimal to obtain the first file data, and use the file data partitioning method to perform data partitioning on the first file data, including: traversing the data bytes of the first file data, obtaining the largest data byte and the smallest data byte, and sequentially denoting them as the largest data byte and the smallest data byte; Set the size of the first standard window to a1, and the size of the first sliding window to a2, where a2 < a1; place the initial standard window at the starting position of the first file data, and obtain the maximum and minimum values of all data bytes within the initial standard window at this time, and sequentially denote them as the maximum data byte and the minimum data byte; If the maximum data byte is equal to the largest data byte, obtain the second largest value of all data bytes within the initial standard window at this time, and mark it as the maximum reference byte, otherwise mark the maximum data byte as the maximum reference byte; if the minimum data byte is equal to the smallest data byte, obtain the second smallest value of all data bytes within the initial standard window at this time, and mark it as the minimum reference byte, otherwise mark the minimum data byte as the minimum reference byte.
3. A storage device data security backup and migration method according to claim 2, characterized in that: Using the file data partitioning method to perform data partitioning on the file data in the storage device to obtain a collection of file data blocks further includes the following sub-steps: Connect the first sliding window to the first standard window and place it behind the first standard window; obtain the maximum and minimum values of all data bytes within the first sliding window, and sequentially denote them as the sliding maximum byte and the sliding minimum byte; if the sliding maximum byte is greater than the maximum reference byte or the sliding minimum byte is less than the minimum reference byte, then use the end position of the sliding window at this time as the data partitioning cut point for data partitioning to obtain file data blocks, and record the number of data partitionings; Otherwise, slide the first sliding window away from the first standard window with a sliding step of a2; And obtain the maximum and minimum values of all data bytes within the first sliding window again, and perform the comparison again until a data partitioning cut point is found for data partitioning to obtain file data blocks, and record the number of data partitionings; After each data partitioning to obtain a file data block, place the first standard window at the starting position of the remaining first file data again, repeat the operation, divide the first file data into multiple file data blocks, and according to the number of data partitionings, denote the corresponding file data block as the i-th file data block, where i represents the number of data partitionings; All file data blocks are recorded as a file data block collection.
4. A storage device data security backup and migration method according to claim 3, characterized in that: Obtaining characteristic parameters of all file data blocks in the file data block collection and obtaining a characteristic vector of the file data block, recorded as file data block characteristic information, includes the following sub-steps: Set the original feature value to M0, M0 < 255, and record M0 in binary as MH0; for any file data block in the file data block collection, record it as the first data block, obtain all data bytes in the first data block, record it as the first byte sequence; convert all data bytes in the first byte sequence from hexadecimal to binary and decimal, and record them in order as the second byte sequence and the third byte sequence respectively; Shift MH0 left circularly by k1 bits to obtain HK0, perform an XOR operation on HK0 and the first data byte in the second byte sequence to obtain MH1; then shift MH1 left circularly by k1 bits to obtain HK1, perform an XOR operation on HK1 and the second data byte in the second byte sequence to obtain MH2; repeat the process of processing all data bytes in the second byte sequence in turn, and record the final output value as MHn; convert MHn to decimal and take the modulus of k2 to obtain TM1, which is recorded as the first eigenvalue TM1 of the corresponding file data block, where k2 is the set modulus value.
5. A storage device data security backup and migration method according to claim 4, characterized in that: Obtaining characteristic parameters of all file data blocks in the file data block collection and obtaining a characteristic vector of the file data block, recorded as file data block characteristic information, further includes the following sub-steps: Set the first weight to q1, the second weight to q2, and the third weight to q3; q1+q2=10, and q1>0, q2>0, q3>0; record the data bytes in the third byte sequence in order as ZK1, ZK2, ..., ZKn; based on M0, calculate M1, M1=q1*M0+q2*ZK1+0*q3, to obtain M1; then calculate M2, M2=q1*M1+q2*ZK2+1*q3, to obtain M2; then calculate M3, M3=q1*M2+q2*ZK3+2*q3; repeat the process of processing all data bytes in the third byte sequence in turn, and after completion, obtain Mn modulo k2 to obtain TM2, which is recorded as the second eigenvalue TM2 of the corresponding file data block; Recording the data bytes with odd position numbers in the second byte sequence as odd byte sequences, and recording the data bytes with even position numbers as even byte sequences; The data bytes in the odd-byte sequence are sequentially denoted as QK1, QK2, ..., QKj; QK1 and QK2 are XORed, and the result of the first XOR operation is XORed with QK3, and the result of the second XOR operation is XORed with QK4; the XOR operation is repeated for all data bytes of the odd-byte sequence in a loop, and after completion, the result of the last XOR operation is modulo k2 to obtain TM3; this is denoted as the third eigenvalue TM3 of the corresponding file data block; The data bytes in the even-numbered byte sequence are sequentially denoted as OK1, OK2, ..., OKj; the upper 4 bits of OK1 are XORed with the lower 4 bits, and the result of the first XOR operation is XORed with the lower 4 bits of OK2; Then perform an XOR operation on the result obtained from the second XOR operation and the upper four bits of OK2; Then perform an XOR operation on the result of the third XOR operation and the lower four bits of 0K3; Repeat the loop to perform XOR operations on the lower four bits and upper four bits of all data bytes in the even-numbered byte sequence. After completion, take the result of the last XOR operation modulo k2 to obtain TM4; record it as the fourth eigenvalue TM4 of the corresponding file data block.
6. A storage device data secure backup and migration method according to claim 5, characterized in that: Obtaining characteristic parameters of all file data blocks in the file data block collection and obtaining a characteristic vector of the file data block, recorded as file data block characteristic information, further includes the following sub-steps: For TM1, TM2, TM3, and TM4 of the corresponding file data block, if TM1, TM2, TM3, and TM4 are different from each other, they are recorded as characteristic parameters of the corresponding file data block, and the corresponding TM1, TM2, TM3, and TM4 are combined into a characteristic vector, recorded as TX = {TN1, TN2, TN3, TN4}, and marked as the characteristic vector of the file data block, where TN1, TN2, TN3, and TN4 represent the different TM1, TM2, TM3, and TM4 in order; If TM1, TM2, TM3, and TM4 have the same value, then increase the same value in TM1, TM2, TM3, and TM4 by 1, 2, and 3 in sequence until there are no more identical values. The processed TM1, TM2, TM3, and TM4 are recorded as the feature parameters of the corresponding file data block, combined into a feature vector TX, and marked as the feature vector of the file data block; Repeatedly obtain the characteristic parameters and characteristic vectors of all file data blocks in the file data block collection, and record them as file data block characteristic information.
7. A storage device data secure backup and migration method according to claim 6, characterized in that: Constructing a data block screening feature vector, constructing a document feature screening table based on the file data block feature information, and performing initial backup processing includes the following sub-steps: Set k2k3-bit binary numbers, record them as initial binary numbers, set all initial binary numbers to 0; and combine them in a random order to form a data block screening feature vector, record them as TS1 = {t1x1, t1x2, ..., t1xk2}; repeatedly set multiple data block screening feature vectors, record them as TS1, TS2, ..., TSx in sequence, mark them as the original feature screening table, and mark all data block screening feature vectors in the original feature screening table as available; For the feature vectors of all file data blocks in the file data block feature information, the original feature screening table is assigned in sequence according to the corresponding file data blocks, including: for the feature vector of any file data block, recorded as the first feature vector, the corresponding TN1, TN2, TN3 and TN4 are obtained; and the data block screening feature vector with the smallest sequence number and in an available state is obtained from the original feature screening table, recorded as the first screening feature vector, and the value of the component with the corresponding sequence number in the first screening feature vector is increased by 1 according to the values of TN1, TN2, TN3 and TN4; For any data block filtering feature vector, if half of the components of the data block filtering feature vector are not 0, or if k3 digits of any component of the data block filtering feature vector are all 1, then mark the data block filtering feature vector as disabled; After completion, a document feature screening table is obtained, and all file data blocks of the file data to be backed up are respectively backed up for the first time, and the initial backup positions are respectively recorded.
8. A storage device data secure backup and migration method according to claim 7, characterized in that: Based on the file data partitioning method and the document feature screening table, the file data is backed up again, including the following sub-steps: When file data needs to be backed up again, the file data is partitioned using a file data partitioning method to obtain re-partitioned data blocks, and characteristic vectors of each re-partitioned data block are obtained, and re-backup screening is performed, including: for any characteristic vector of the re-partitioned data block, it is recorded as a second characteristic vector, TN1, TN2, TN3 and TN4 of the second characteristic vector are obtained, and recorded as TY1, TY2, TY3 and TN4 in sequence; if there is a data block screening characteristic vector in the document feature screening table, and the components of the TY1, TY2, TY3 and TY4 positions of the data block screening characteristic vector are not 0, then the corresponding re-partitioned data block is marked as a backed-up data block, otherwise it is marked as a non-backed-up data block; and the marking is repeated for all re-partitioned data blocks; Back up the unbacked-up data blocks again, and record the corresponding backup positions. Then obtain the initial backup positions of the backed-up data blocks and form a new backup record with the corresponding backup positions.
9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps in the method according to any one of claims 1 to 8 are executed.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are executed.
Citation Information
Patent Citations
Method for optimizing HDFS storage structure
CN107944041A
Green cloud computing-oriented repeated data deletion method and system
CN108415671A
Hbase data backup method and system, electronic equipment and storage medium
CN117520056A
Storage block screening method and system of storage device
CN118331505A
Internet of Things file storage method and system
CN118467492A