Data recovery method and terminal
By obtaining and restoring word segmentation data in mobile applications, the problem of difficulty in recovering encrypted and zeroed data in the prior art is solved, and efficient recovery of data in mobile applications is achieved, which is suitable for sharded storage systems.
Patent Information
- Application Number
- CN202111664755.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2041-12-31
AI Technical Summary
Existing data recovery technologies are difficult to recover encrypted and zeroed data in mobile applications, especially in higher versions of Android systems.
By obtaining word segmentation data, including word segmentation fragment identification and corresponding data blocks, traverse word segmentation fragments according to the incremental relationship of word segmentation fragment identification, obtain the data blocks of the target word segmentation fragment and restore the word segmentation fragment content, and finally obtain the restored data, and compare the undeleted data to obtain the deleted data.
The encryption and zeroed data is restored, suitable for all systems that perform sharded storage, ensuring the accuracy of data recovery.
Smart Images

Figure CN114492427B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a data recovery method and a terminal. Background Art
[0002] As mobile phone manufacturers and application manufacturers pay more attention to data security, they continue to improve the methods of data protection, not only strengthening the protection of existing data, but also gradually strengthening the irrecoverability of deleted data. For example, most mobile applications use SQLite to store data, and the common method of completely erasing data is to set the corresponding bytes to zero after deletion, making traditional data recovery methods ineffective.
[0003] As data protection methods improve, recovery technology has never stopped being explored. After years of research and development, the field of mobile phone data recovery has evolved from traditional SQLite file recovery technology to subsequent image file fragmentation, database backup files, session files, index database and other recovery technologies. Each technology can improve the ability to recover valid data at a certain stage.
[0004] As mobile phone manufacturers and application manufacturers have strengthened their security, all the recovery technologies currently available on the market are difficult to recover usable data. For example, image file fragments cannot be recovered due to encryption of high-version Android systems, and the Android-side index database is encrypted and deleted and reset to zero, which also makes it impossible to recover valid data. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide a data recovery method to achieve data recovery.
[0006] In order to solve the above technical problems, a technical solution adopted by the present invention is:
[0007] A data recovery method comprises the steps of:
[0008] Acquire word segmentation data, the word segmentation data including a word segmentation fragment identifier and a data block corresponding to the word segmentation fragment identifier;
[0009] Traversing the word segmentation fragments according to the increasing relationship of the word segmentation fragment identifiers, when traversing to a target word segmentation fragment, obtaining the target data block corresponding to the target word segmentation fragment, and restoring the word segmentation fragment content according to the target data block;
[0010] splicing the word segmentation fragment contents according to the word segmentation fragment identifiers to obtain restored data;
[0011] The restored data is compared with the non-deleted data to obtain the deleted data.
[0012] In order to solve the above technical problems, another technical solution adopted by the present invention is:
[0013] A data recovery terminal comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0014] Acquire word segmentation data, the word segmentation data including a word segmentation fragment identifier and a data block corresponding to the word segmentation fragment identifier;
[0015] Traversing the word segmentation fragments according to the increasing relationship of the word segmentation fragment identifiers, when traversing to a target word segmentation fragment, obtaining the target data block corresponding to the target word segmentation fragment, and restoring the word segmentation fragment content according to the target data block;
[0016] splicing the word segmentation fragment contents according to the word segmentation fragment identifiers to obtain restored data;
[0017] The restored data is compared with the non-deleted data to obtain the deleted data.
[0018] The beneficial effect of the present invention is that in order to facilitate data retrieval, data storage is now not only used as complete data storage, but also fragmented and indexed to facilitate data search. When the complete data is deleted, the corresponding fragmented data is usually not deleted. At this time, the fragmented word identifiers of the fragmented words obtained by the fragmentation are arranged in ascending order, and the fragmented word contents corresponding to the fragmented words are traversed and restored, and finally the restored data is obtained by splicing. Since the fragmented data of the undeleted data will also be stored, the deleted data can be obtained after deduplication with the undeleted data, thereby realizing data recovery, and the present invention is applicable to all systems that perform fragmented storage, such as full-text retrieval systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 A flowchart of a data recovery method according to an embodiment of the present invention;
[0020] Figure 2 A schematic diagram of the structure of a data recovery terminal according to an embodiment of the present invention;
[0021] Figure 3 A schematic diagram of word segmentation fragment identification according to an embodiment of the present invention;
[0022] Figure 4 A schematic diagram of a data block according to an embodiment of the present invention;
[0023] Figure 5 A schematic diagram of a sliding window according to an embodiment of the present invention;
[0024] Figure 6 A schematic diagram of original data according to an embodiment of the present invention;
[0025] Figure 7 A schematic diagram of restoring data according to an embodiment of the present invention;
[0026] Figure 8 is a schematic diagram of an unmarked sliding window according to an embodiment of the present invention;
[0027] Fig. 9 A process diagram of a data recovery method according to an embodiment of the present invention;
[0028] Fig.10 A system block diagram of a data recovery method according to an embodiment of the present invention;
[0029] Description of labels:
[0030] 1. A data recovery terminal; 2. A processor; 3. A memory. DETAILED DESCRIPTION
[0031] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.
[0032] Please refer to Figure 1 , a data recovery method, comprising the steps of:
[0033] Acquire word segmentation data, the word segmentation data including a word segmentation fragment identifier and a data block corresponding to the word segmentation fragment identifier;
[0034] Traversing the word segmentation fragments according to the increasing relationship of the word segmentation fragment identifiers, when traversing to a target word segmentation fragment, obtaining the target data block corresponding to the target word segmentation fragment, and restoring the word segmentation fragment content according to the target data block;
[0035] splicing the word segmentation fragment contents according to the word segmentation fragment identifiers to obtain restored data;
[0036] The restored data is compared with the non-deleted data to obtain the deleted data.
[0037] From the above description, it can be seen that the beneficial effects of the present invention are: in order to facilitate data retrieval, data storage is now not only used as complete data storage, but also fragmented and indexed to facilitate data search. When the complete data is deleted, the corresponding fragmented data is usually not deleted. At this time, the fragmented word identifiers of the fragmented words obtained by the fragmentation are arranged in ascending order, and the fragmented word contents corresponding to the fragmented words are traversed and restored, and finally the restored data is obtained by splicing. Since the fragmented data of the undeleted data will also be stored, the deleted data can be obtained after deduplication with the undeleted data, thereby realizing data recovery, and it is suitable for all systems that perform fragmented storage such as full-text retrieval systems.
[0038] Furthermore, the word segmentation fragments are traversed according to the increasing relationship of the word segmentation fragment identifiers, and when a target word segmentation fragment is traversed, the target data block corresponding to the target word segmentation fragment is obtained, and the word segmentation fragment content is restored according to the target data block. Specifically,
[0039] Traversing the word segmentation fragments according to the increasing relationship of the word segmentation fragment identifiers, when traversing to the target word segmentation fragment, determining whether the word segmentation fragment identifiers of the target word segmentation fragment and the previous word segmentation fragment are continuous, if so, retaining the buffer data of the previous word segmentation fragment, obtaining the target data block corresponding to the target word segmentation fragment, and restoring the word segmentation fragment content according to the target data block of the buffer data set; and splicing the word segmentation fragment content with the word segmentation fragment content corresponding to the previous word segmentation fragment;
[0040] Otherwise, the target data block corresponding to the target word segmentation fragment is directly obtained, and the word segmentation fragment content is restored according to the target data block.
[0041] From the above description, it can be seen that since a complete piece of data may be divided into multiple word fragments and there will usually be correlation in the word segmentation process, when parsing, if the word fragments identify continuous word fragments, the cache content of the previous word fragment will be saved to improve the accuracy of the parsing result, that is, to ensure the accuracy of the restored data.
[0042] Further, the step of obtaining the target data block corresponding to the target word segmentation fragment and restoring the word segmentation fragment content according to the target data block includes:
[0043] Obtaining an index positioning byte in the target data block, and obtaining a parsing position according to the index positioning byte;
[0044] Starting from the parsing position, a sliding window structure is obtained, and the position to be determined is obtained according to the sliding window structure, the value of the position to be determined is calculated using the first preset formula or the second preset formula, and parsing is started from the parsing position according to the sliding window structure to restore the content of the word segmentation fragments.
[0045] From the above description, it can be seen that after obtaining the parsed position, due to different word segmentation algorithms having different sliding window structures, some sliding window values are the actual meaning values, and some sliding window values need to be converted to obtain their actual meanings. At this time, it is necessary to use the formula corresponding to the specific word segmentation algorithm and the position to be determined to obtain the implicit meaning of the value stored in the sliding window, so as to confirm the content of each sliding window and determine the content of the word segmentation fragments.
[0046] Further, obtaining a preset word segmentation algorithm;
[0047] The first preset formula and the second preset formula are obtained according to the preset word segmentation algorithm.
[0048] As can be seen from the above description, there are many word segmentation algorithms. Different preset formulas are obtained according to different word segmentation algorithms, so that the parsing result of the sliding window can be consistent with the original meaning to avoid errors.
[0049] Further, comparing the restored data with the non-deleted data to obtain the deleted data includes:
[0050] The restored data is compared with the non-deleted data, and the restored data that does not correspond to the non-deleted data is marked as deleted data.
[0051] From the above description, it can be seen that since there may be some characters in the original data that will not be fragmented to form word fragments, the similarity can be obtained at this time to determine whether the restored data corresponds to the undeleted data, rather than judging by consistency, to improve the accuracy of the deleted data in the final output.
[0052] Please refer to Figure 2 , a data recovery terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0053] Acquire word segmentation data, the word segmentation data including a word segmentation fragment identifier and a data block corresponding to the word segmentation fragment identifier;
[0054] Traversing the word segmentation fragments according to the increasing relationship of the word segmentation fragment identifiers, when traversing to a target word segmentation fragment, obtaining the target data block corresponding to the target word segmentation fragment, and restoring the word segmentation fragment content according to the target data block;
[0055] splicing the word segmentation fragment contents according to the word segmentation fragment identifiers to obtain restored data;
[0056] The restored data is compared with the non-deleted data to obtain the deleted data.
[0057] The beneficial effect of the present invention is that in order to facilitate data retrieval, data storage is now not only used as complete data storage, but also fragmented and indexed to facilitate data search. When the complete data is deleted, the corresponding fragmented data is usually not deleted. At this time, the fragmented word identifiers of the fragmented words obtained by the fragmentation are arranged in ascending order, and the fragmented word contents corresponding to the fragmented words are traversed and restored, and finally the restored data is obtained by splicing. Since the fragmented data of the undeleted data will also be stored, the deleted data can be obtained after deduplication with the undeleted data, thereby realizing data recovery, and the present invention is applicable to all systems that perform fragmented storage, such as full-text retrieval systems.
[0058] Furthermore, the word segmentation fragments are traversed according to the increasing relationship of the word segmentation fragment identifiers, and when a target word segmentation fragment is traversed, the target data block corresponding to the target word segmentation fragment is obtained, and the word segmentation fragment content is restored according to the target data block. Specifically,
[0059] Traversing the word segmentation fragments according to the increasing relationship of the word segmentation fragment identifiers, when traversing to the target word segmentation fragment, determining whether the word segmentation fragment identifiers of the target word segmentation fragment and the previous word segmentation fragment are continuous, if so, retaining the buffer data of the previous word segmentation fragment, obtaining the target data block corresponding to the target word segmentation fragment, and restoring the word segmentation fragment content according to the target data block of the buffer data set; and splicing the word segmentation fragment content with the word segmentation fragment content corresponding to the previous word segmentation fragment;
[0060] Otherwise, the target data block corresponding to the target word segmentation fragment is directly obtained, and the word segmentation fragment content is restored according to the target data block.
[0061] From the above description, it can be seen that since a complete piece of data may be divided into multiple word fragments and there will usually be correlation in the word segmentation process, when parsing, if the word fragments identify continuous word fragments, the cache content of the previous word fragment will be saved to improve the accuracy of the parsing result, that is, to ensure the accuracy of the restored data.
[0062] Further, the step of obtaining the target data block corresponding to the target word segmentation fragment and restoring the word segmentation fragment content according to the target data block includes:
[0063] Obtaining an index positioning byte in the target data block, and obtaining a parsing position according to the index positioning byte;
[0064] Starting from the parsing position, a sliding window structure is obtained, and the position to be determined is obtained according to the sliding window structure, the value of the position to be determined is calculated using the first preset formula or the second preset formula, and parsing is started from the parsing position according to the sliding window structure to restore the content of the word segmentation fragments.
[0065] From the above description, it can be seen that after obtaining the parsed position, due to different word segmentation algorithms having different sliding window structures, some sliding window values are the actual meaning values, and some sliding window values need to be converted to obtain their actual meanings. At this time, it is necessary to use the formula corresponding to the specific word segmentation algorithm and the position to be determined to obtain the implicit meaning of the value stored in the sliding window, so as to confirm the content of each sliding window and determine the content of the word segmentation fragments.
[0066] Further, obtaining a preset word segmentation algorithm;
[0067] The first preset formula and the second preset formula are obtained according to the preset word segmentation algorithm.
[0068] As can be seen from the above description, there are many word segmentation algorithms. Different preset formulas are obtained according to different word segmentation algorithms, so that the parsing result of the sliding window can be consistent with the original meaning to avoid errors.
[0069] Further, comparing the restored data with the non-deleted data to obtain the deleted data includes:
[0070] The restored data is compared with the non-deleted data, and the restored data that does not correspond to the non-deleted data is marked as deleted data.
[0071] From the above description, it can be seen that since there may be some characters in the original data that will not be fragmented to form word fragments, the similarity can be obtained at this time to determine whether the restored data corresponds to the undeleted data, rather than judging by consistency, to improve the accuracy of the deleted data in the final output.
[0072] The above-mentioned data recovery method and terminal of the present invention can be applied to a system with data fragmentation, such as an FTS (Full Text Search) system, and is described below through a specific implementation method:
[0073] Please refer to Figure 1 , Embodiment 1 of the present invention is:
[0074] A data recovery method, specifically comprising:
[0075] S1. Acquire word segmentation data, wherein the word segmentation data includes a word segmentation fragment identifier and a data block corresponding to the word segmentation fragment identifier;
[0076] Please refer to Figure 3 , id in the figure is a schematic diagram of the word segmentation fragment identification;
[0077] S2, traversing the word fragments according to the increasing relationship of the word fragment identifiers, when traversing to the target word fragment, obtaining the target data block corresponding to the target word fragment, and restoring the word fragment content according to the target data block, specifically:
[0078] S21, traversing the word fragments according to the increasing relationship of the word fragment identifiers, when traversing to the target word fragment, determining whether the word fragment identifiers of the target word fragment and the previous word fragment are continuous, if so, executing S22, otherwise, executing S23;
[0079] Please refer to Figure 3 , Figure 3 The IDs corresponding to RecNo12 and 13 are the continuous word fragment identifiers;
[0080] S22, after retaining the buffer data of the previous word segmentation fragment, obtaining the target data block corresponding to the target word segmentation fragment, and restoring the word segmentation fragment content according to the target data block of the buffer data set; and splicing the word segmentation fragment content with the word segmentation fragment content corresponding to the previous word segmentation fragment;
[0081] S23, directly obtaining the target data block corresponding to the target word segmentation fragment, and restoring the word segmentation fragment content according to the target data block, including:
[0082] S231, obtaining an index positioning byte in the target data block, and obtaining a parsing position according to the index positioning byte;
[0083] Please refer to Figure 4 , which is a schematic diagram of the target data block, such as Figure 4 The data block in the FTS system is obtained when the data is fragmented. The third and fourth bytes are index positioning bytes, and the index position 0275 can be obtained. The index value can be obtained from this position to determine the parsing position.
[0084] S232, starting from the parsing position, obtaining a sliding window structure, and obtaining a position to be determined according to the sliding window structure, calculating a value of the position to be determined using the first preset formula or the second preset formula, and parsing from the parsing position according to the sliding window structure to restore the word fragment content;
[0085] Wherein, before S232, the method includes: acquiring the sliding window structure, the first preset formula and the second preset formula according to the preset word segmentation algorithm;
[0086] Please refer to Figure 5 , is a schematic diagram of the sliding window. Type a is the rule of the first sliding window of each fragmented data block, i.e., the sliding window structure, which is composed of the segmentation content length, 1-byte padding, segmentation content byte, index content ID, number of copies (0=2÷2-1) and segmentation ID; type b is the rule of the subsequent sliding window, i.e., the structure of the sliding window, which is composed of the byte inheritance number (0=1-1), segmentation content length, segmentation content byte, index content ID, number of copies (0=2÷2-1) and segmentation ID; the data of each sliding window is parsed through these two rules;
[0087] Among them, the length of the segmented content represents the number of bytes occupied by the segmented content; the index content ID represents the identifier of the index content corresponding to the sliding window; the number of copies represents the number of backups of the sliding window, and the segmentation ID represents the position of the sliding window in the target segmented fragment. If the segmented fragment content of a target segmented fragment is associated with that of other segmented fragments, the segmentation ID starts numbering from a preset number. For example, 01 indicates that the content of the target segmented fragment is not associated with that of other segmented fragments, and a value greater than 01 indicates that the segmented fragment content of the target segmented fragment is associated with that of other segmented fragments; the byte inheritance number represents the number of bytes inherited from the segmented content bytes in the previous segmented fragment.
[0088] In an alternative embodiment, the first preset formula is:
[0089] S N × 128 0 +(S N-1 – 128) × 128 1 +…+(S1 – 128) × 128 N-1 ;
[0090] The second preset formula is:
[0091] (S N × 128 0 +(S N-1 – 128) × 128 1 +…+(S1 – 128) × 128 N-1 ) ÷ 2 – 1
[0092] Among them, N represents the number of bytes participating in the calculation, and S N represents the value of the Nth byte.
[0093] Then, the second preset formula is used when calculating the number of copies, and the first preset formula is used when calculating the index content ID, the segmentation ID, and the byte inheritance number;
[0094] It can be known that if the byte inheritance number is 1, it means inheriting 1 byte from the previous segmented fragment. At this time, the cache data corresponding to the previous segmented fragment needs to be obtained; as Figure 4 in 02 02 BA 86 17 02 06; it means inheriting one byte 0xE4 ( Figure 4 the byte at the 0x3E position in
[0095] From the above, please refer to Figure 8, on the left is the content of the sliding window corresponding to the right character. The UTF8 encoding of "没" is 0xE6B2A1. The first byte 0x02 of the sliding window indicates inheriting 1 byte (1 = 2 - 1), the second byte 0x02 indicates that the subsequent two bytes 0xB2 and 0xA1 are parts of the word segmentation. The fifth byte 0x13 indicates that the message ID where this word segmentation is located is 19, the sixth byte 0x02 indicates that the copy number is 0 (0 = 2 ÷ 2 - 1), and the seventh byte indicates that the word segmentation ID is 2 (for multiple word segmentations within one piece of data, the word segmentation ID starts to accumulate from 2). The same applies to "加" and "密", and the obtained word segmentation IDs are 3 and 4 respectively. After reorganizing this message, the complete content "没加密" is obtained;
[0096] S3. Concatenate the content of the word segmentation fragments according to the word segmentation fragment identifiers to obtain the restored data;
[0097] Please refer to Figure 6 , for the schematic of the original data, Figure 7 for the schematic of the restored data. Since some symbols do not generate word segmentations, there will be certain differences between the two;
[0098] S4. Compare the restored data and the undeleted data to obtain the deleted data, including:
[0099] Compare the restored data and the undeleted data, and mark the restored data that does not correspond to the undeleted data as deleted data; among them, compare the similarity between the undeleted data and the restored data. If the similarity exceeds the threshold, it is considered that this restored data and the undeleted data correspond, that is, they are the same piece of data.
[0100] Please refer to Figure 2 , the second embodiment of the present invention is:
[0101] A data recovery terminal 1 includes a processor 2, a memory 3, and a computer program stored on the memory 3 and executable on the processor 2. When the processor 2 executes the computer program, each step in the first embodiment is implemented.
[0102] In summary, the present invention provides a data recovery method and terminal. Utilizing the feature that existing data is sharded for convenient retrieval, when the original data is deleted, the corresponding sharded data is obtained for analysis, and the restored data is obtained according to the sharded data. Since both deleted data and undeleted data have corresponding shards and word segmentation fragments, it is also possible to judge whether the restoration is accurate according to whether the restored data and the undeleted data are consistent. Finally, by removing duplicates with the undeleted data, the deleted data can be obtained, which can ensure the accuracy of the restored deleted data, and data recovery can be achieved as long as there is a system that establishes indexes and performs sharding, with strong practicability.
[0103] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A data recovery method, characterized in that: Includes steps: Acquire word segmentation data, the word segmentation data including a word segmentation fragment identifier and a data block corresponding to the word segmentation fragment identifier; Traversing the word segmentation fragments according to the increasing relationship of the word segmentation fragment identifiers, when traversing to the target word segmentation fragment, obtaining the target data block corresponding to the target word segmentation fragment, and restoring the word segmentation fragment content according to the target data block; including: obtaining the index positioning byte in the target data block, and obtaining the parsing position according to the index positioning byte; starting from the parsing position, obtaining the sliding window structure, and obtaining the position to be determined according to the sliding window structure, calculating the value of the position to be determined, calculating the index content ID, the word segmentation ID and the byte inheritance number related position using the first preset formula, calculating the number of copies related position using the second preset formula, and parsing from the parsing position according to the sliding window structure to restore the word segmentation fragment content; wherein the sliding window structure includes type a and type b, type a is the rule of the first sliding window of each fragment data block, consisting of word segmentation content length, 1-byte padding, word segmentation content bytes, index content ID, number of copies and word segmentation ID; type b is the rule of subsequent sliding windows, consisting of byte inheritance number, word segmentation content length, word segmentation content bytes, index content ID, number of copies and word segmentation ID; splicing the word segmentation fragment contents according to the word segmentation fragment identifiers to obtain restored data; The restored data is compared with the non-deleted data to obtain the deleted data.
2. A data recovery method according to claim 1, characterized in that: The step of traversing the word fragments according to the increasing relationship of the word fragment identifiers, and when traversing to a target word fragment, obtaining the target data block corresponding to the target word fragment, and restoring the word fragment content according to the target data block is specifically as follows: Traversing the word segmentation fragments according to the increasing relationship of the word segmentation fragment identifiers, when traversing to the target word segmentation fragment, determining whether the word segmentation fragment identifiers of the target word segmentation fragment and the previous word segmentation fragment are continuous, if so, retaining the buffer data of the previous word segmentation fragment, obtaining the target data block corresponding to the target word segmentation fragment, and restoring the word segmentation fragment content according to the buffer data set and the target data block; and concatenating the word segmentation fragment content with the word segmentation fragment content corresponding to the previous word segmentation fragment; Otherwise, the target data block corresponding to the target word segmentation fragment is directly obtained, and the word segmentation fragment content is restored according to the target data block.
3. A data recovery method according to claim 1, characterized in that: Also included is obtaining a preset word segmentation algorithm; The first preset formula and the second preset formula are obtained according to the preset word segmentation algorithm.
4. A data recovery method according to claim 1, characterized in that: Comparing the restored data with the non-deleted data to obtain the deleted data includes: The restored data is compared with the non-deleted data, and the restored data that does not correspond to the non-deleted data is marked as deleted data.
5. A data recovery terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the following steps are implemented: Acquire word segmentation data, the word segmentation data including a word segmentation fragment identifier and a data block corresponding to the word segmentation fragment identifier; Traversing the word segmentation fragments according to the increasing relationship of the word segmentation fragment identifiers, when traversing to the target word segmentation fragment, obtaining the target data block corresponding to the target word segmentation fragment, and restoring the word segmentation fragment content according to the target data block; including: obtaining the index positioning byte in the target data block, and obtaining the parsing position according to the index positioning byte; starting from the parsing position, obtaining the sliding window structure, and obtaining the position to be determined according to the sliding window structure, calculating the value of the position to be determined, calculating the index content ID, the word segmentation ID and the byte inheritance number related position using the first preset formula, calculating the number of copies related position using the second preset formula, and parsing from the parsing position according to the sliding window structure to restore the word segmentation fragment content; wherein the sliding window structure includes type a and type b, type a is the rule of the first sliding window of each fragment data block, consisting of word segmentation content length, 1-byte padding, word segmentation content bytes, index content ID, number of copies and word segmentation ID, and type b is the rule of subsequent sliding windows, consisting of byte inheritance number, word segmentation content length, word segmentation content bytes, index content ID, number of copies and word segmentation ID; splicing the word segmentation fragment contents according to the word segmentation fragment identifiers to obtain restored data; The restored data is compared with the non-deleted data to obtain the deleted data.
6. A data recovery terminal according to claim 5, characterized in that: The step of traversing the word fragments according to the increasing relationship of the word fragment identifiers, and when traversing to a target word fragment, obtaining a target data block corresponding to the target word fragment, and restoring the word fragment content according to the target data block is specifically as follows: Traversing the word segmentation fragments according to the increasing relationship of the word segmentation fragment identifiers, when traversing to the target word segmentation fragment, determining whether the word segmentation fragment identifiers of the target word segmentation fragment and the previous word segmentation fragment are continuous, if so, retaining the buffer data of the previous word segmentation fragment, obtaining the target data block corresponding to the target word segmentation fragment, and restoring the word segmentation fragment content according to the buffer data set and the target data block; and concatenating the word segmentation fragment content with the word segmentation fragment content corresponding to the previous word segmentation fragment; Otherwise, the target data block corresponding to the target word segmentation fragment is directly obtained, and the word segmentation fragment content is restored according to the target data block.
7. A data recovery terminal according to claim 5, characterized in that: Also included is obtaining a preset word segmentation algorithm; The first preset formula and the second preset formula are obtained according to the preset word segmentation algorithm.
8. A data recovery terminal according to claim 5, characterized in that: Comparing the restored data with the non-deleted data to obtain the deleted data includes: The restored data is compared with the non-deleted data, and the restored data that does not correspond to the non-deleted data is marked as deleted data.
Citation Information
Patent Citations
Method, apparatus and storage medium for processing data
CN109298836A