A storage device data security backup migration method, device and storage medium
By using file data partitioning and feature vector construction, the problem of cumbersome incremental backup and recovery processes in existing technologies is solved, achieving efficient and reliable data backup and recovery.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN LIDA ELECTRONICS CO LTD
- Filing Date
- 2025-04-03
- Publication Date
- 2026-04-21
AI Technical Summary
Existing data backup technologies based on incremental backups cannot guarantee backup efficiency and reliability while avoiding the need to restore each backup individually during data recovery, resulting in a cumbersome and error-prone recovery process.
The file data is divided into multiple data blocks using a file data partitioning method. The feature parameters of each data block are obtained, a feature vector is constructed, and a document feature filtering table is built. An initial backup is performed, and a second backup is performed based on this method.
While ensuring backup efficiency and reliability, it avoids the problem of restoring each backup one by one when restoring data, thus improving the accuracy and speed of data recovery.
Smart Images

Figure CN120448185B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data backup technology, specifically to a method, device, and storage medium for secure data backup and migration of storage devices. Background Technology
[0002] Data backup technology refers to a technique that copies data from 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 secure 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. A full backup completely copies all data; an incremental backup only backs up data that has changed since the last backup; and a differential backup backs up data that has changed since the last full backup. However, when data backup technology uses incremental backups to back up file data, because incremental backups rely on previous backup chains, if one of the incremental backup files is damaged or lost, it may prevent subsequent version recovery processes from proceeding, affecting data reliability. Furthermore, when restoring data, it is necessary to first restore the last full backup, and then restore subsequent historical versions of data sequentially. If there are many incremental backups, this process becomes cumbersome and prone to errors, leading to extended recovery time. For example… For example, if a system failure occurs after the 10th incremental backup, a full backup needs to be restored first, followed by restoring historical versions 1 through 10 sequentially. A problem in any step could affect the complete recovery of the data. For instance, patent application CN115168111A discloses a method and system for backing up massive amounts of object storage data based on caching. This solution is based on incremental backup. Although it saves backup time and improves backup efficiency during the backup process, the recovery process is complex and the reliability of the data backup is low. Therefore, existing data backup technologies based on incremental backup cannot guarantee backup efficiency and data reliability while avoiding the need to restore each backup 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 primary backup processing is performed; based on the file data partitioning method and the document characteristic screening table, secondary backup processing is performed on the file data; to solve the problem that when the existing data backup technology performs backup on file data based on incremental backup, it is impossible to ensure the backup efficiency and the reliability of the backup data while avoiding the need to restore each previous backup one by one when restoring data.
[0005] To achieve the above object, in a 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, and construct a document characteristic screening table according to the file data block characteristic information, and perform primary backup processing;
[0009] Based on the file data partitioning method and the document characteristic screening table, perform secondary backup processing on the file data.
[0010] Further, using 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 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 a 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 largest data byte is equal to the largest 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 largest reference byte; otherwise, mark the largest data byte as the largest reference byte. If the smallest data byte is equal to the smallest 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 smallest reference byte; otherwise, mark the smallest data byte as the smallest reference byte.
[0014] Furthermore, the process of partitioning file data in the storage device using file data partitioning methods to obtain a collection of file data blocks also includes the following sub-steps:
[0015] Place the first sliding window connected to the first standard window and placed after 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 maximum sliding byte and the minimum sliding byte; if the maximum sliding byte is greater than the maximum reference byte or the minimum sliding byte is less than the minimum reference byte, then take the end position of the sliding window at this time as the data partitioning point to partition the data, obtain file data blocks, and record the number of data partitions;
[0016] 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 in the first sliding window again, compare them again, until a data partitioning point is found to partition the data, obtain file data blocks, and record the number of data partitions;
[0017] After each data partitioning to obtain file data blocks, the first standard window is placed again at the beginning of the remaining first file data. This process is repeated to divide the first file data into multiple file data blocks. The corresponding file data block is denoted as the i-th file data block according to the number of data partitionings, where i represents the number of data partitionings. All file data blocks are denoted as the file data block set.
[0018] Further, obtaining the feature parameters of all file data blocks in the file data block set and obtaining the feature vector of the file data block, denoted as the file data block feature information, includes the following sub-steps:
[0019] Set the original feature value to M0, M0<255, and denote M0 in binary as MH0; for any file data block in the file data block set, denote it as the first data block, obtain all data bytes in the first data block, and denote it as the first byte sequence; convert all data bytes in the first byte sequence from hexadecimal to binary and decimal respectively, and denote them as the second byte sequence and the third byte sequence in order;
[0020] Shift MH0 left by k1 bits to get HK0. XOR HK0 with the first data byte in the second byte sequence to get MH1. Shift MH1 left by k1 bits to get HK1. XOR HK1 with the second data byte in the second byte sequence to get MH2. Repeat this loop to process all data bytes in the second byte sequence. The final output value is denoted as MHn. Convert MHn to decimal and take the modulo of k2 to get TM1, which is denoted as the first feature value TM1 of the corresponding file data block. k2 is the set modulo value.
[0021] Furthermore, obtaining the feature parameters of all file data blocks in the file data block set and obtaining the feature vector of the file data blocks, denoted as the file data block feature information, also 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; denot the data bytes in the third byte sequence sequentially 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 loop to process all data bytes in the third byte sequence, and after completion, take Mn modulo k2 to obtain TM2, which is denoted as the second feature value TM2 of the corresponding file data block;
[0023] The data bytes with odd position numbers in the second byte sequence are denoted as the odd-numbered byte sequence, and the data bytes with even position numbers are denoted as the even-numbered byte sequence;
[0024] The data bytes in the odd-numbered byte sequence are sequentially labeled QK1, QK2, ..., QKj. QK1 and QK2 are XORed, and the result of the first XOR operation is XORed with QK3. The result of the second XOR operation is then XORed with QK4. This process is repeated for all data bytes in the odd-numbered byte sequence. After completion, the result of the last XOR operation is modulo k2 to obtain TM3. This TM3 is recorded as the third characteristic value of the corresponding file data block.
[0025] The data bytes in the even-numbered byte sequence are sequentially labeled OK1, OK2, ..., OKj. The high 4 bits and low 4 bits of OK1 are XORed, and the result of the first XOR operation is XORed with the low 4 bits of 0K2. The result of the second XOR operation is then XORed with the high 4 bits of 0K2. The result of the third XOR operation is then XORed with the low 4 bits of 0K3. This process is repeated for 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 TM4 is recorded as the fourth characteristic value of the corresponding file data block.
[0026] Furthermore, obtaining the feature parameters of all file data blocks in the file data block set and obtaining the feature vector of the file data blocks, denoted as the file data block feature information, also 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 all different, they are recorded as feature parameters of the corresponding file data block. The corresponding TM1, TM2, TM3, and TM4 are combined into a feature vector, denoted as TX = {TN1, TN2, TN3, TN4}, which is marked as the feature vector of the file data block. 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 the same value in TM1, TM2, TM3, and TM4 is incremented by 1, 2, and 3 respectively, 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 feature parameters and feature vectors of all file data blocks in the file data block set, and denot them as file data block feature information.
[0030] Further, a data block filtering feature vector is constructed, and a document feature filtering table is built based on the file data block feature information. The initial backup process includes the following sub-steps:
[0031] Set k2 k3-bit binary numbers as the initial binary numbers, and set all the initial binary numbers to 0; combine them in random order to form a data block filtering feature vector, denoted as TS1 = {t1x1, t1x2, ..., t1xk2}; repeatedly set multiple data block filtering feature vectors, denoted as TS1, TS2, ..., TSx, and mark them as the original feature filtering table; mark all data block filtering feature vectors in the original feature filtering table as available.
[0032] For the feature vectors of all file data blocks in the file data block feature information, the original feature filtering table is assigned values sequentially according to the corresponding file data block order, including: for any file data block feature vector, denoted as the first feature vector, obtain the corresponding TN1, TN2, TN3 and TN4; and obtain the data block filtering feature vector with the smallest sequence number and in an available state from the original feature filtering table, denoted as the first filtering feature vector, and increment the value of the component with the corresponding sequence number in the first filtering feature vector 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 all k3 digits of any component of the data block filtering feature vector are 1, then the data block filtering feature vector is marked as disabled.
[0034] After completion, a document feature filtering table is obtained, and all file data blocks of the file data to be backed up are backed up for the first time, and the location of the first backup is recorded.
[0035] Furthermore, based on the file data partitioning method and document feature filtering 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 further partitioned data blocks. The feature vectors of each further partitioned data block are then obtained, and a further backup filtering process is performed. This includes: for any feature vector of a further partitioned data block, denoted as the second feature vector, the TN1, TN2, TN3, and TN4 of the second feature vector are obtained and denoted as TY1, TY2, TY3, and TN4 in sequence. If a data block filtering feature vector exists in the document feature filtering table, and the components at positions TY1, TY2, TY3, and TY4 of this data block filtering feature vector are not 0, then the corresponding further partitioned data block is marked as a backed-up data block; otherwise, it is marked as an unbacked-up data block. This marking process is repeated for all further partitioned data blocks.
[0037] For unbacked-up data blocks, perform a second backup and record the corresponding second backup location. Also, obtain the initial backup location of the already backed-up data blocks and combine it with the corresponding second backup location to form a new backup record.
[0038] Secondly, this application provides an electronic device including a processor and a memory, the memory storing computer-readable instructions, which, when executed by the processor, perform the steps of the method described above.
[0039] Thirdly, this application provides a storage medium on which a computer program is stored, which, when executed by a processor, performs the steps of the method described above.
[0040] The beneficial effects of this invention are as follows: This invention utilizes a file data partitioning method to partition file data in a storage device, obtaining a collection of file data blocks; it acquires the feature parameters of all file data blocks in the collection and obtains the feature vectors of the file data blocks, denoted as file data block feature information; it constructs a data block filtering feature vector and builds a document feature filtering table based on the file data block feature information, and performs an initial backup; based on the file data partitioning method and the document feature filtering table, it performs a second backup of the file data; this can ensure backup efficiency and the reliability of backup data while avoiding the problem of having to restore each backup one by one when restoring data;
[0041] This invention divides file data into multiple variable-length data blocks using a file data partitioning method. This ensures that the size of the data blocks matches the data type and density, avoiding the space waste that can occur with fixed-length partitioning and preventing the extremely uneven partitioning that can occur with traditional methods. It obtains feature vectors from the data blocks and constructs a document feature filtering table. The advantage of this method is that the feature vectors accurately describe the unique attributes of the data blocks, ensuring their uniqueness. By constructing the document feature filtering table, data blocks that meet the criteria can be quickly located and filtered based on the feature vectors. During the backup process, data blocks are filtered, and new backup files are created based on the location of the backup data blocks. This avoids duplicate backups of unchanged data, ensuring backup efficiency. When restoring data, based on the storage location information of the new and old data blocks recorded in the new backup file, the data can be quickly restored to a specified state, improving the accuracy and speed of data recovery. Attached Figure Description
[0042] Figure 1 This is a schematic diagram of the system of the present invention;
[0043] Figure 2 This is a schematic diagram illustrating the file data partitioning of 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. Specific 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. Apparently, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0047] Embodiment 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: Use a file data partitioning method to perform data partitioning processing on the file data in the storage device 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: Use a file data partitioning method to perform data partitioning processing on the first file data. Step S102 includes the following sub-steps:
[0051] Step S1021: Traverse the data bytes of the first file data, obtain the largest data byte and the smallest data byte, and record them in order as the largest data byte and the smallest data byte respectively;
[0052] [This line break is maintained as in the original] Step S1022: Set the size of the first standard window as a1, 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 in order as the extremely large data byte and the extremely small data byte respectively. In this embodiment, a1 is 6, a2 is 2, and the unit is the number of data bytes, that is, a1 is 6 data bytes and a2 is 2 data bytes;
[0053] Step S1023: If the largest data byte equals the largest data byte, then obtain the second largest value of all data bytes within the initial standard window and mark it as the largest reference byte; otherwise, mark the largest data byte as the largest reference byte. If the smallest data byte equals the smallest data byte, then obtain the second smallest value of all data bytes within the initial standard window and mark it as the smallest reference byte; otherwise, mark the smallest data byte as the smallest reference byte. For example, if the largest data byte is 0xFF, the largest data byte is also 0xFF, and the second largest data byte is 0xFE, then mark 0xFE as the largest reference byte. Not marking bytes equal to the largest data byte and bytes equal to the smallest data byte as reference bytes is to prevent the division point from being unavailable during subsequent partitioning.
[0054] For step S1024, please refer to [link / reference]. Figure 2 As shown, a first sliding window is placed connected to a first standard window and positioned after the first standard window. The maximum and minimum values of all data bytes within the first sliding window are obtained and recorded sequentially as the maximum sliding byte and the minimum sliding byte. If the maximum sliding byte is greater than the maximum reference byte or the minimum sliding byte is less than the minimum reference byte, the end position of the sliding window at this point is used as the data partitioning cutoff point to partition the data, resulting in file data blocks. The number of data partitions is recorded. By continuously comparing the maximum and minimum values of the data within the sliding window with the reference values in the standard window, when there are significant fluctuations in the data within the sliding window, this position can be used as the data partitioning cutoff point in a timely manner. This allows for the capture of abrupt changes in the data, enabling data with similar characteristics to be partitioned into the same data block, thus improving the rationality of data partitioning.
[0055] Step S1025: Otherwise, slide the first sliding window away from the first standard window with a sliding step size of a2; and obtain the maximum and minimum values of all data bytes in the first sliding window again, compare them again, until a data partitioning cut point is found to partition the data, obtain file data blocks, and record the number of data partitions; the sliding step size is equal to the sliding window size, which can improve the efficiency of data partitioning.
[0056] Step S1026: After each data division to obtain file data blocks, 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. The corresponding file data block is recorded as the i-th file data block according to the number of data divisions, where i represents the number of data divisions. That is, after each data block is divided, the operation is repeated from the starting position of the remaining data to divide the data into multiple data blocks.
[0057] Step S103: Record all file data blocks as a file data block set;
[0058] In practice, the largest and smallest data bytes are obtained by traversing the first file data, and the largest and smallest data bytes, as well as possible second largest and second smallest values, are further analyzed within each standard window. This allows the partitioning process to fully consider the overall distribution characteristics of the data, especially the extreme values. Different file data may have different numerical ranges and distribution patterns. 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, thus more accurately reflecting the inherent structure of the data. Since the partitioning points are dynamically determined according to 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 involves obtaining the feature parameters of all file data blocks in the file data block set and obtaining the feature vector of each file data block, denoted as the file data block feature information. Step S2 includes the following sub-steps:
[0060] Step S201: Set the original feature value to M0, M0<255, and denote M0 in binary as MH0; for any document data block in the document data block set, denote it as the first data block, and obtain all data bytes in the first data block, denote it as the first byte sequence;
[0061] Step S202: Convert all data bytes in the first byte sequence from hexadecimal to binary and then to decimal, and record them as the second byte sequence and the third byte sequence in order; in this embodiment, M0 = 0;
[0062] Step S203: 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. 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 loop to process all data bytes in the second byte sequence. The final output value is denoted as MHn. Convert MHn to decimal and take the modulo of k2 to obtain TM1, which is denoted as the first feature value TM1 of the corresponding document data block. k2 is the set modulo value. In this embodiment, k2 is 200.
[0063] In this embodiment, k1 = 3; circular left shift means shifting all bits of a binary number to the left by a specified number of bits, while simultaneously placing the shifted-out bits back to the right. For example, 11010010 circularly shifted left by 3 bits becomes 01001011; k2 is a set modulo value. Taking the modulo of k2 means dividing by k2 and taking the remainder, the purpose of which is to scale the first feature value TM1 to a certain range; the circular left shift operation can make full use of every bit of information in the data, while the XOR operation is more sensitive to small changes in the data and can resist local interference and noise in the data to a certain extent, making the calculation of the feature value more stable and reliable; the XOR operation means that if two numbers are both 1 or both are 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, q3 > 0; denot the data bytes in the third byte sequence as ZK1, ZK2, ..., ZKn in sequence; calculate M1 based on M0, 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 loop to process all data bytes in the third byte sequence in sequence, and after completion, take Mn modulo k2 to obtain TM2, which is denoted as the second feature value TM2 of the corresponding document data block;
[0065] In this embodiment, q1 = 4, q2 = 6, and q3 = 2; the original feature values and the decimal byte sequence of the data block are combined and weighted by different weights; this allows the second feature value to not only consider the original feature information but also make full use of the numerical information of each byte in the data block, thus reflecting the features of the data block more comprehensively; the weighted calculation method makes the calculation of the feature value relatively stable and will not fluctuate drastically due to changes in individual bytes; at the same time, due to the integration of multiple factors, the second feature value has a certain resistance to local noise and interference in the data, improving the reliability of the feature value;
[0066] Step S205: Record the data bytes with odd position numbers in the second byte sequence as the odd number byte sequence, and record the data bytes with even position numbers as the even number byte sequence;
[0067] Step S206: The data bytes in the odd-numbered byte sequence are sequentially labeled 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; this process is repeated to XOR all data bytes in the odd-numbered byte sequence. After completion, the result of the last XOR operation is modulo k2 to obtain TM3; this is recorded as the third feature value TM3 of the corresponding document data block. XORing is only performed on the odd-numbered byte sequence, which allows for the extraction of local features of data at odd-numbered byte positions within the data block.
[0068] For step S207, please refer to... Figure 3 As shown, the data bytes in the even-numbered byte sequence are sequentially denoted as OK1, OK2, ..., OKj. The high 4 bits and low 4 bits of OK1 are XORed, and the result of the first XOR operation is XORed with the low 4 bits of OK2. The result of the second XOR operation is then XORed with the high 4 bits of OK2. The result of the third XOR operation is then XORed with the low 4 bits of OK3. This process is repeated, performing XOR operations on the low 4 bits and high 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, which is denoted as the fourth feature value TM4 of the corresponding document data block. Performing XOR operations on the high 4 bits and low 4 bits of the even-numbered byte sequence delves into the internal structure of the bytes, revealing more subtle feature information. Unlike the third feature value, which extracts local features from odd-numbered bytes, the fourth feature value focuses on the feature distribution within even-numbered 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, denoted as TX = {TN1, TN2, TN3, TN4}, which is 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 sequentially add 1, 2, and 3 to the same value in TM1, TM2, TM3, and TM4; until no duplicate values exist. Then, record the processed TM1, TM2, TM3, and TM4 as the feature parameters of the corresponding document data block, combine them into a feature vector TX, and mark it as the feature vector of the document data block. For example, if TM1, TM2, TM3, and TM4 are 22, 22, 22, and 32 in sequence, then after processing they are 22+1, 22+2, 22, and 32, i.e., 23, 24, 22, and 32.
[0071] Step S210: Repeatedly obtain the feature parameters and feature vectors of all document data blocks in the document data block set, and record them as document data block feature information;
[0072] In practical implementation, ensuring that no two feature parameters of a document data block have the same value has the following advantages: It guarantees the uniqueness of each feature parameter for each document data block, reducing redundancy and correlation between features. This helps to more comprehensively and accurately characterize the document data block's features, facilitating more accurate identification and differentiation of different document data blocks, and improving the feature vector's ability to identify document data blocks. This allows for more precise location and differentiation of each document data block in subsequent filtering. Furthermore, the uniqueness and independence of feature parameters increase data confidentiality and resistance to attacks. If feature values are identical, it's possible to analyze these identical values to obtain data patterns or forge data; the absence of identical feature parameters improves data security and stability, reducing the risk of data being cracked or tampered with.
[0073] Step S3 involves constructing a data block filtering feature vector, building a document feature filtering table based on the file data block feature information, and performing an initial backup process. Step S3 includes the following sub-steps:
[0074] Step S301: Set k2 k3-bit binary numbers as initial binary numbers, and set all initial binary numbers to 0; combine them in random order to form a data block filtering feature vector, denoted as TS1 = {t1x1, t1x2, ..., t1xk2}; repeatedly set multiple data block filtering feature vectors, denoted as TS1, TS2, ..., TSx, and mark them as the original feature filtering table; mark all data block filtering feature vectors in the original feature filtering table as available; for example, k2 = 200, k3 = 4; then TS1 = {0000, 0000, ..., 0000}, a total of 200 components with the value 0000;
[0075] Step S302: For the feature vectors of all document data blocks in the document data block feature information, the original feature filtering table is assigned values sequentially according to the corresponding document data block order. This includes: for any feature vector of a document data block, denoted as the first feature vector, obtaining the corresponding TN1, TN2, TN3, and TN4; and obtaining the data block filtering feature vector with the smallest sequence number and in an available state from the original feature filtering table, denoted as the first filtering feature vector, and incrementing the value of the corresponding sequence number component in the first filtering feature vector by 1 according to the values of TN1, TN2, TN3, and TN4; that is, starting from TS1, if TS1 is not in an available state, then filtering TS2, until a suitable data block filtering feature vector is found; for example, if TS1 is in an available state, and TN1, TN2, TN3, and TN4 are 23, 24, 22, and 32 respectively, then the 23rd, 24th, 22nd, and 32nd components in TS1 are incremented by 1;
[0076] Step S303: For any data block filtering feature vector, if half of the components of the data block filtering feature vector are not 0, or if all k3 digits of any component of the data block filtering feature vector are 1, then the data block filtering feature vector is marked as disabled; for example, if the 3rd component in TS1 is already 1111, then it is marked as disabled; or if there are 200 components in TS1, and more than or equal to 100 components are not 0, then it is also marked as disabled.
[0077] Step S304: After completion, a document feature filtering table is obtained, and all document data blocks of the document data to be backed up are backed up for the first time, and the location of the first backup is recorded for each block.
[0078] In practice, when too many components of the data block filtering feature vector are not zero, it may cause confusion in subsequent feature judgments of document data blocks, leading to the erroneous identification of data blocks that do not belong to certain features as having those features. Marking it as disabled can prevent such misjudgments and ensure the accuracy of filtering. It also prevents data overflow or anomalies: if all k3 digits of any component of the data block filtering feature vector are 1, it may indicate that the component has reached the upper limit of its representation range, and continued use may lead to data overflow or other anomalies. Marking it as disabled can prevent program errors or inaccurate results due to such anomalies in subsequent processing.
[0079] Step S4 involves backing up the file data again based on the file data partitioning method and the document feature filtering table. Step S4 includes the following sub-steps:
[0080] Step S401: When the document data needs to be backed up again, the document data is divided using the document data partitioning method to obtain the re-divided data blocks.
[0081] Step S402 involves obtaining the feature vectors of each re-divided data block and performing a second backup filtering, including: for any feature vector of a re-divided data block, denoted as the second feature vector, obtaining TN1, TN2, TN3, and TN4 of the second feature vector, and denoting them as TY1, TY2, TY3, and TY4 in sequence; if there is a data block filtering feature vector in the document feature filtering table, and the components at positions TY1, TY2, TY3, and TN4 of the data block filtering feature vector are not 0, then the corresponding re-divided data block is marked as backed up. If a data block is not backed up, it is marked as a backup data block; this process is repeated for all newly partitioned 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 block is marked as a backup data block. Because the feature vector of each data block is unique, this uniqueness allows for accurate identification of each data block. The backup status of a data block is identified by whether a component at a specific position in the feature vector is 0, which clearly distinguishes between backed-up and unbacked-up data blocks.
[0082] Step S403: Perform a backup of the unbacked-up data blocks, record the corresponding backup location, and obtain the initial backup location of the backed-up data blocks, and combine it with the corresponding backup location to form a new backup record.
[0083] In the specific implementation process, the backup locations of unbacked-up data blocks are recorded and combined with the initial backup locations of backed-up data blocks to form a new backup record. This makes the backup location information of the data clearer and more organized, facilitating subsequent data querying, recovery, and management. It enables quick location of different backup versions of the data, improving the efficiency and convenience of data management. Moreover, when restoring data, it is not necessary to restore each backup one by one. The backup status of data blocks can be determined directly based on the document feature filtering table and data block feature vectors, quickly locating the required data blocks and restoring file data, significantly shortening the recovery time. Furthermore, by directly locating and restoring data, without relying on the order of previous backups, the risk of data inconsistency caused by intermediate problems is reduced, better ensuring the integrity and consistency of the restored data.
[0084] Example 2, please refer to Figure 4 As shown, Figure 4A schematic diagram of an electronic device is provided, which may include a processor, a communication interface, a memory, and a communication bus. The processor, communication interface, and memory communicate with each other via the communication bus. The memory stores computer-readable instructions, and the processor can call these instructions. When the processor executes a computer-readable instruction, it performs steps as described in a storage device data security backup and migration method to achieve the following functions: partitioning the file data in the storage device using a file data partitioning method to obtain a set of file data blocks; obtaining the feature parameters of all file data blocks in the set and obtaining the feature vectors of the file data blocks, denoted as file data block feature information; constructing a data block filtering feature vector and building a document feature filtering table based on the file data block feature information, and performing an initial backup; and performing a second backup based on the file data partitioning method and the document feature filtering table.
[0085] Furthermore, the logical instructions in the aforementioned memory can be implemented as software functional units and sold or used as independent products, and can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0086] Example 3: This application also provides a computer-readable storage medium. This application provides a storage medium storing a computer program. When the computer program is executed by a processor, it performs the steps of the storage device data security backup and migration method described above to achieve the following functions: dividing the file data in the storage device using a file data partitioning method to obtain a set of file data blocks; obtaining the feature parameters of all file data blocks in the set of file data blocks and obtaining the feature vectors of the file data blocks, denoted as file data block feature information; constructing a data block filtering feature vector, and constructing a document feature filtering table based on the file data block feature information, and performing an initial backup; and performing a second backup of the file data based on the file data partitioning method and the document feature filtering table.
[0087] Based on the above description of the embodiments, the embodiments of the present invention can be provided as methods, systems, or computer program products. Based on this understanding, the technical solutions described above, or the parts that contribute to the prior art, can be embodied in the form of software products. These computer software products can be stored in computer-readable storage media, such as ROM / RAM, magnetic disks, optical disks, etc., and include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or certain parts of the embodiments.
[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 functional division, and there may be other division methods in actual implementation. Furthermore, multiple modules or units may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interfaces. The indirect coupling or communication connection between systems, modules, and units may 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 this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for secure backup and migration of data from a storage device, characterized in that, Includes the following steps: The file data in the storage device is divided into data blocks using a file data partitioning method to obtain a collection of file data blocks; Obtain the feature parameters of all file data blocks in the file data block set, and obtain the feature vector of the file data block, which is denoted as the file data block feature information; Construct a data block filtering feature vector, and build a document feature filtering table based on the file data block feature information, and perform initial backup processing; Based on the file data partitioning method and document feature filtering table, the file data is backed up again. The process of constructing a data block filtering feature vector, building a document feature filtering table based on the file data block feature information, and performing initial backup processing includes the following sub-steps: Set k2 k3-bit binary numbers as the initial binary numbers, and set all the initial binary numbers to 0; combine them in random order to form a data block filtering feature vector, denoted as TS1={t1x1, t1x2, ..., t1xk2}; repeatedly set multiple data block filtering feature vectors, denoted as TS1, TS2, ..., TSx, and mark them as the original feature filtering table; mark all data block filtering feature vectors in the original feature filtering table as available. For the feature vectors of all file data blocks in the file data block feature information, the original feature filtering table is assigned values sequentially according to the corresponding file data block order, including: for any file data block feature vector, denoted as the first feature vector, obtain the corresponding TN1, TN2, TN3 and TN4; and obtain the data block filtering feature vector with the smallest sequence number and in an available state from the original feature filtering table, denoted as the first filtering feature vector, and increment the value of the component with the corresponding sequence number in the first filtering feature vector 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 all k3 digits of any component of the data block filtering feature vector are 1, then the data block filtering feature vector is marked as disabled. After completion, a document feature filtering table is obtained, and an initial backup is performed on all file data blocks of the file data to be backed up, and the initial backup location is recorded for each block. Based on the file data partitioning method and document feature filtering table, the process of backing up file data again includes the following sub-steps: When the file data needs to be backed up again, use the file data partitioning method to perform data partitioning on the file data, obtain the re-partitioned data blocks, and acquire the feature vectors of each re-partitioned data block, and perform re-backup screening, including: For the feature vector of any re-partitioned data block, denoted as the second feature vector, obtain TN1, TN2, TN3, and TN4 of the second feature vector, and denote them as TY1, TY2, TY3, and TN4 in sequence; If there is a data block screening feature vector in the document feature screening table, and the components at the TY1, TY2, TY3, and TY4 positions of the data block screening feature vector are not all 0, then mark the corresponding re-partitioned data block as a backed-up data block, otherwise mark it as an un-backed-up data block; Repeat marking all re-partitioned data blocks. Perform re-backup on the un-backed-up data blocks, record the corresponding re-backup positions, and obtain the initial backup positions of the backed-up data blocks, and form new backup records with the corresponding re-backup positions.
2. The method for secure backup and migration of data on a storage device according to claim 1, characterized in that, Use the file data partitioning method to perform data partitioning on the file data in the storage device, and obtaining the file data block collection 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: Traverse the data bytes of the first file data, obtain the largest data byte and the smallest data byte, and denote them as the largest data byte and the smallest data byte in sequence. Set the size of the first standard window to a1, 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 denote them as the extremely large data byte and the extremely small data byte in sequence. If the extremely large data byte is equal to the largest data byte, then obtain the second largest value of all data bytes within the initial standard window at this time, and mark it as the extremely large reference byte, otherwise mark the extremely large data byte as the extremely large reference byte; If the extremely small data byte is equal to the smallest data byte, then obtain the second smallest value of all data bytes within the initial standard window at this time, and mark it as the extremely small reference byte, otherwise mark the extremely small data byte as the extremely small reference byte.
3. The method for secure backup and migration of data on a storage device 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, and obtaining the file data block collection 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 denote them as the sliding maximum byte and the sliding minimum byte in sequence; If the sliding maximum byte is greater than the extremely large reference byte or the sliding minimum byte is less than the extremely small 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 the file data block, and record the number of data partitions. Otherwise, slide the first sliding window in the direction away from the first standard window, and the sliding step size is a2. Then, obtain the maximum and minimum values of all data bytes within the first sliding window again, compare them again, until a data partitioning point is found to partition the data, obtain file data blocks, and record the number of data partitions; After each data partitioning to obtain file data blocks, the first standard window is placed again at the beginning of the remaining first file data. This process is repeated to divide the first file data into multiple file data blocks. The corresponding file data block is denoted as the i-th file data block according to the number of data partitionings, where i represents the number of data partitionings. All file data blocks are denoted as a set of file data blocks.
4. The method for secure backup and migration of data on a storage device according to claim 3, characterized in that, Obtaining the feature parameters of all file data blocks in the file data block set and obtaining the feature vector of the file data block, denoted as the file data block feature information, includes the following sub-steps: Set the original feature value to M0, M0<255, and denote M0 in binary as MH0; for any file data block in the file data block set, denote it as the first data block, obtain all data bytes in the first data block, and denote it as the first byte sequence; convert all data bytes in the first byte sequence from hexadecimal to binary and decimal respectively, and denote them as the second byte sequence and the third byte sequence in order; Shift MH0 left by k1 bits to get HK0. XOR HK0 with the first data byte in the second byte sequence to get MH1. Shift MH1 left by k1 bits to get HK1. XOR HK1 with the second data byte in the second byte sequence to get MH2. Repeat this loop to process all data bytes in the second byte sequence. The final output value is denoted as MHn. Convert MHn to decimal and take the modulo of k2 to get TM1, which is denoted as the first feature value TM1 of the corresponding file data block. k2 is the set modulo value.
5. A method for secure backup and migration of data on a storage device according to claim 4, characterized in that, Obtaining the feature parameters of all file data blocks in the file data block set and obtaining the feature vector of the file data block, denoted as the file data block feature information, also 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; denot the data bytes in the third byte sequence sequentially as ZK1, ZK2, ..., ZKn; based on M0, calculate M1, M1 = q1 * M0 + q2 * ZK1 + 0 * q3, obtaining M1; then calculate M2, M2 = q1 * M1 + q2 * ZK2 + 1 * q3, obtaining M2; then calculate M3, M3 = q1 * M2 + q2 * ZK3 + 2 * q3; repeat the loop to process all data bytes in the third byte sequence, and after completion, take Mn modulo k2 to obtain TM2, which is denoted as the second feature value TM2 of the corresponding file data block; The data bytes with odd position numbers in the second byte sequence are denoted as the odd-numbered byte sequence, and the data bytes with even position numbers are denoted as the even-numbered byte sequence; The data bytes in the odd-numbered byte sequence are sequentially labeled QK1, QK2, ..., QKj. QK1 and QK2 are XORed, and the result of the first XOR operation is XORed with QK3. The result of the second XOR operation is then XORed with QK4. This process is repeated for all data bytes in the odd-numbered byte sequence. After completion, the result of the last XOR operation is modulo k2 to obtain TM3. This TM3 is recorded as the third characteristic value of the corresponding file data block. The data bytes in the even-numbered byte sequence are sequentially labeled OK1, OK2, ..., OKj; the high 4 bits and low 4 bits of OK1 are XORed, and the result of the first XOR operation is XORed with the low 4 bits of OK2. Then perform an XOR operation between the result of the second XOR operation and the high four bits of 0K2; 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 an XOR operation on the lower four bits and the higher four bits of all data bytes in the even-numbered byte sequence. After completion, take the modulo of the result of the last XOR operation with k2 to obtain TM4; denoted as the fourth characteristic value TM4 of the corresponding file data block.
6. A method for secure backup and migration of data on a storage device according to claim 5, characterized in that, Obtaining the feature parameters of all file data blocks in the file data block set and obtaining the feature vector of the file data block, denoted as the file data block feature information, also includes the following sub-steps: For TM1, TM2, TM3, and TM4 of the corresponding file data block, if TM1, TM2, TM3, and TM4 are all different, they are recorded as feature parameters of the corresponding file data block. The corresponding TM1, TM2, TM3, and TM4 are combined into a feature vector, denoted as TX={TN1, TN2, TN3, TN4}, which is marked as the feature vector of the file data block. 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 the same value in TM1, TM2, TM3, and TM4 is incremented by 1, 2, and 3 respectively, 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 feature parameters and feature vectors of all file data blocks in the file data block set, and denot them as file data block feature information.
7. An electronic device, characterized in that, It includes a processor and a memory, the memory storing computer-readable instructions that, when executed by the processor, perform the steps of the method as described in any one of claims 1-6.
8. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it performs the steps of the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Cache-based object storage mass data backup method and system
CN115168111A
Green cloud computing-oriented repeated data deletion method and system
CN108415671A
Method and device for determining backup node in global deduplication storage scene
CN119356943A