A smart data fragment reconstruction and repair method for file corruption recovery
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING HUIZHENG EXCELLENCE TECHNOLOGY CO LTD
- Filing Date
- 2026-04-22
- Publication Date
- 2026-06-30
AI Technical Summary
Existing data recovery technologies cannot effectively reassemble fragments when dealing with file fragments from streaming compression protocols due to physical sector truncation causing bit stream misalignment and loss of decoding context.
Candidate data blocks are extracted through a media scanning module, the state suspension module saves the decoding context, the bit stream reconstruction module aligns the bit stream boundaries, the anomaly verification module filters continuous data blocks, the pointer listening module verifies the continuity of data blocks, and the closed-loop iteration module performs iterative reorganization, bypassing the file system layer to directly access the physical storage medium.
It enables decoding context passing between discontinuous physical fragments, removes bitstream boundary alignment barriers, and improves the accuracy of reassembling composite files.
Smart Images

Figure CN122309215A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer data recovery technology, specifically to an intelligent data fragment reconstruction and repair method for recovering damaged files. Background Technology
[0002] In computer storage systems, when file system metadata is corrupted and underlying data is physically fragmented, conventional operating system file interfaces will be unable to read the target file normally. In this case, it is usually necessary to rely on underlying data recovery technology to directly scan the physical storage medium in order to extract and reassemble file data blocks. Existing data recovery methods are mostly based on the assumption of continuous allocation of the file system, or extract independent data blocks by scanning specific file signatures in physical sectors.
[0003] However, existing recovery techniques for composite files using streaming compression protocols have significant structural flaws. Streaming compression algorithms often generate variable-length binary bit streams. When these files become fragmented in the storage medium, the data is forcibly truncated at fixed physical sector boundaries. Since the truncation position is usually not aligned with the byte boundary, this directly leads to bit misalignment of data spanning non-contiguous physical clusters. Existing data recovery programs generally use complete bytes or physical sectors as the smallest unit of reading and processing, lacking a mechanism to handle residual bit streams that are not full of a single byte. This results in severe bit offsets in the concatenated data.
[0004] Based on this, the streaming decompression process relies heavily on the dynamic mapping tree and sliding window dictionary generated from the preceding data. When existing fragment recovery programs encounter physical breakpoints, they can usually only blindly piece together each fragment as an independent data unit for verification. This approach cannot pass the decoding context between non-contiguous physical fragments. When the decompression engine attempts to parse subsequent independent fragments, it will trigger an addressing exception due to the lack of historical dictionary references or missing mapping states, leading to the execution environment crashing. Therefore, existing technical solutions cannot establish continuity verification logic between fragments at the underlying level, making it difficult to effectively identify and reassemble compressed composite files in a highly fragmented state. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides an intelligent data fragment reconstruction and repair method for file corruption recovery. This method solves the problem that existing data recovery technologies cannot effectively reconstruct fragments when processing file fragments using streaming compression protocols, due to physical sector truncation causing bit stream misalignment and loss of decoding context.
[0006] To achieve the above objectives, the present invention provides the following technical solution: This invention provides an intelligent data fragment reconstruction and repair method for file corruption recovery, applied to a computing device. The processor of the computing device establishes a low-level data transmission channel with the physical storage medium through a storage controller. The processor is equipped with a media scanning module, a status suspension module, a bit stream reconstruction module, an anomaly verification module, a pointer monitoring module, and a closed-loop iteration module. The method includes the following steps: The media scanning module performs sector traversal on the physical storage medium through the storage controller, extracts free physical clusters to form a candidate data block set, and performs feature signature matching on the candidate data block set to determine the base data block of the target file; The state suspension module receives the reference data block and starts the streaming decompression operation. When the internal execution instruction pointer reaches the physical cluster end boundary of the reference data block, the decoding thread is paused, and the current sliding window dictionary data, mapping matrix and residual bit sequence in the bit buffer register are obtained to generate a physical endpoint state snapshot. The bit stream reconstruction module extracts the bit width parameter of the residual bit sequence in the physical endpoint state snapshot for the data block to be tested from the candidate data block set, calls the processor's arithmetic logic unit to perform cross-byte shift of the original byte sequence of the data block to be tested, and performs bit-level merging of the residual bit sequence with the shifted sequence to reconstruct a continuous logical bit stream. The anomaly verification module receives the reconstructed continuous logical bit stream, loads the sliding window dictionary data and mapping matrix from the physical endpoint state snapshot into the initial register, monitors the decompressed underlying state, and identifies and discards the test data block that triggers the illegal path mapping anomaly. Under the condition that no illegal path mapping exception is triggered, the pointer listening module reads the instruction containing length and distance parameters generated by the underlying decompression protocol, calculates whether the distance parameter exceeds the physical header boundary of the data block to be tested, and performs hash comparison on the historical dictionary data to determine the continuous data blocks when the boundary is determined. After extracting the plaintext character stream generated by decompressing the data block under test, the closed-loop iteration module verifies the structural closure state at the splicing point according to the application layer syntax specification of the target file format to confirm the continuity of the data block. After confirmation, it updates the virtual mapping table and performs iterative reorganization operation.
[0007] Furthermore, the media scanning module bypasses the logical volume manager and virtual file system layer within the operating system, and sends raw device communication instructions carrying the starting logical block address and read span parameters to the storage controller through the processor, reading the underlying raw data into the memory buffer in units of consecutive physical sectors.
[0008] Furthermore, the process of extracting free physical clusters to form a candidate data block set includes: parsing the file system metadata of the raw data loaded into the memory buffer to extract the allocated cluster set; dividing and generating a global cluster set by combining the total capacity of the physical storage medium with the system cluster size alignment parameters; calling the processor's logic operation unit to perform a difference operation on the global cluster set and the allocated cluster set to separate the allocated physical storage space, and extracting unindexed free physical clusters to form a candidate data block set.
[0009] Furthermore, the process of performing feature signature matching on the candidate data block set includes: traversing all physical cluster elements in the candidate data block set according to a preset step size, extracting byte fragments at the start or specific offset position of the physical cluster element, and performing binary comparison with the preset file preamble; when a file preamble that conforms to the specification is matched, locking the corresponding physical cluster element, removing it from the candidate data block set, and marking it as the base data block.
[0010] Furthermore, the status suspension module configures address monitoring logic in the streaming decompression operation to obtain the offset of the consumed input bytes in real time, and restricts the input prefetch of the decompression engine from crossing the end of the physical cluster of the current reference data block; when the input byte offset is detected to be equal to the preset physical cluster size threshold, a soft interrupt signal is sent to the processor.
[0011] Furthermore, the soft interrupt signal causes the decoding thread to trigger a suspension action after processing the last bit of the current byte. The state suspension module accesses the pointer through the memory address of the core state structure to extract the sliding window dictionary data of the most recently decoded output and the dynamic mapping matrix used to guide the subsequent bit stream parsing.
[0012] Furthermore, the process of generating a physical endpoint state snapshot includes combining the extracted sliding window dictionary data, mapping matrix, residual bit sequence, and bit width parameter representing its bit width to generate a data tuple snapshot for context passing across physical breakpoints.
[0013] Furthermore, the process of performing cross-byte shift includes: using a combination of logical left and logical right shift instructions of the processor, shifting the current byte in the original byte sequence of the data block to be tested to the left by a specified bit width according to the bit width parameter; performing a logical OR operation between the shifted data and the right overflow bit of the next adjacent byte, and iteratively calculating to generate a reconstructed byte sequence after shift compensation.
[0014] Furthermore, the process of reconstructing a continuous logical bit stream by bit-level merging includes: configuring the system's underlying zero-padding logic for cases where the next adjacent byte is missing at the end of the data block under test; using the residual bit sequence saved in the physical endpoint state snapshot as prefix data, and concatenating it with the generated reconstructed byte sequence in physical memory to form a continuous data structure, which is the continuous logical bit stream.
[0015] Furthermore, the process of loading the sliding window dictionary data and mapping matrix from the physical endpoint state snapshot into the initial register includes: re-initializing the streaming decompression engine instance in memory, bypassing the decompression engine's default dictionary clearing and mapping tree construction routines, and injecting the dictionary data and mapping matrix from the state snapshot into the registers and working memory area of the newly instantiated streaming decompression engine by overwriting memory pointers.
[0016] Furthermore, the process of identifying and discarding the test data block that triggers the illegal path mapping exception includes: when the decompression engine reads the bit stream and performs path addressing along the injected mapping matrix, if the leaf node reached does not define the corresponding plaintext character or the addressing pointer points to an invalid memory region, it is determined that an illegal path mapping exception has been triggered, and the test data block is determined to lack physical continuity and is discarded from the verification sequence.
[0017] Furthermore, the process of reading the instructions generated by the underlying decompression protocol, which include length and distance parameters, involves configuring listening logic at the function node responsible for generating length and distance parameters within the streaming decompression engine, and extracting the matching instructions from the underlying decompression protocol into the verification cache.
[0018] Furthermore, the process of calculating whether the distance parameter exceeds the physical header boundary of the data block under test includes: obtaining the total number of plaintext bytes output by the current decompression engine when processing the data block under test, determining whether the extracted absolute distance parameter is greater than the total number of plaintext bytes output, and if it is greater, then the boundary is determined to be exceeded.
[0019] Furthermore, the process of performing hash comparison on historical dictionary data to determine consecutive data blocks includes: using the out-of-bounds distance parameter and the corresponding length parameter to reverse map in the historical dictionary data, extracting the original byte sequence located at the specified position as the cross-block reference plaintext; performing hash calculation on the cross-block reference plaintext to generate a runtime hash value, and checking its consistency with the verification field in the target file format; if the comparison is consistent or subsequent decoding does not trigger a state crash, the data block to be tested is marked as a priority consecutive candidate block.
[0020] Furthermore, if the data block under test does not contain length and distance parameter instructions that would prevent the monitoring from taking effect, the closed-loop iteration module initiates a full-block state constraint mechanism to monitor whether the memory addressing of the dynamic mapping matrix is interrupted during the entire parsing cycle of the data block under test, so as to verify the continuity of the data block under the condition of no dictionary reference through the stability of the underlying execution state.
[0021] Furthermore, the process of verifying the structural closure state at the splice point according to the application layer syntax specification of the target file format includes: extracting the decompressed plaintext character fragments that cross the physical splice point and injecting them into a finite state automaton constructed according to the syntax rules of the target file; tracking the opening and closing states of tags in the plaintext or verifying the boundaries of structural segments; if the final state of the automaton does not remain within the preset set of valid receiving states, the data block to be tested is determined to be syntactically invalid and discarded.
[0022] Furthermore, the process of updating the virtual mapping table and performing iterative reorganization after confirmation includes: when the data block to be tested passes the automaton verification, its physical address is written into the virtual mapping table, and the data block is marked as a new reference data block; the driving judgment process jumps back to the physical endpoint state snapshot extraction step, and the updated virtual mapping table is used to continue to extract the next candidate data block for splicing verification until the termination condition corresponding to the target file format is met.
[0023] This invention provides an intelligent data fragment reconstruction and repair method for file corruption recovery. It has the following beneficial effects: 1. This invention actively triggers suspension when the decompression thread reaches the physical boundary of the reference data block, extracting endpoint state snapshots including sliding window dictionary data, dynamic mapping matrix, and residual bit sequence. This mechanism avoids the decompression engine from triggering abnormal operating environment due to physical sector truncation, and completely saves the historical calculation state inside the decoder, providing basic data support for the subsequent decoding context transfer between non-contiguous physical fragments.
[0024] 2. This invention extracts the bit width parameter of the residual bit sequence, performs logical shift compensation across physical boundaries on the original byte sequence of the subsequent data block to be tested, and performs bit-level concatenation with the residual bit sequence. This operation aligns the bit stream boundaries between non-contiguous data blocks at the physical level, clears the bit misalignment obstacles caused by fixed sector truncation in variable-length compression algorithms, and enables the recombined logical data block to meet the underlying structure requirements of continuous parsing by the streaming decompression engine.
[0025] 3. In the data block verification stage, this invention combines low-level screening based on the legality of the decompression path and the cross-boundary distance parameter, and introduces a finite state automaton at the application layer to perform syntax closure verification. This verification method transforms the traditional tentative comparison that relies on fragmented plaintext into a multi-level check based on the addressing rules of the low-level compression algorithm and the upper-level business syntax, eliminating the erroneous splicing of unrelated physical fragments and improving the accuracy of reconstructing composite files under fragmented storage media. Attached Figure Description
[0026] Figure 1 This is a schematic diagram of the system architecture of the present invention; Figure 2 This is a schematic diagram of the method flow of the present invention; Figure 3 This is a schematic diagram illustrating the principle of media pretreatment and reference positioning in this invention; Figure 4 This is a timing diagram illustrating the decoding boundary detection and context extraction of the present invention; Figure 5 This is a schematic diagram illustrating the principle of bitstream reconstruction and cross-byte shifting in this invention; Figure 6 This is a schematic diagram illustrating the principle of cross-boundary pointer listening and hash anchoring in this invention; Figure 7 This is a schematic diagram illustrating the plaintext syntax downgrade verification and closed-loop iteration principle of this invention; Figure 8 This is a schematic diagram comparing the success rates of the various methods of the present invention under different fragmentation levels; Figure 9 This is a schematic diagram comparing the mis-patch rates of the various methods of the present invention at different fragmentation levels.
[0027] Among them, 10 is the processor; 20 is the storage controller; 30 is the physical storage medium; 101 is the media scanning module; 102 is the status suspension module; 103 is the bit stream reconstruction module; 104 is the exception verification module; 105 is the pointer listening module; and 106 is the closed-loop iteration module. Detailed Implementation
[0028] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0029] Please see the appendix Figure 1 , Figure 1This is a schematic diagram of a system architecture according to an embodiment of the present invention. To implement the intelligent data fragment reconstruction and repair method for file corruption recovery provided by the present invention, the present invention provides a computing device hardware environment supporting the operation of this method. The computing device may include: a processor 10, a storage controller 20, and a physical storage medium 30.
[0030] The processor 10 establishes a low-level data transmission channel with the physical storage medium 30 through the storage controller 20, enabling the computing device to operate in an execution environment with raw device access permissions. The physical storage medium 30 is used to store the low-level binary data stream, and its storage space is physically aligned and allocated according to sectors of fixed capacity. After reading the raw data from the physical storage medium 30, the processor 10 can form candidate data blocks based on the file system cluster size or preset rules for subsequent reassembly and repair processing.
[0031] Processor 10 is configured to bypass the logical volume manager of the file system and directly issue low-level device communication commands to storage controller 20. The communication commands adopt the Small Computer System Interface Standard or the Non-volatile Memory Host Controller Interface Standard. Processor 10 reads the raw sector sequence inside physical storage medium 30 according to the communication commands.
[0032] The processor 10 is internally configured with various logic modules for executing the reorganization and repair method. These logic modules may include: a media scanning module 101, a status suspension module 102, a bit stream reconstruction module 103, an exception verification module 104, a pointer monitoring module 105, and a closed-loop iteration module 106.
[0033] The media scanning module 101 is used to traverse physical sectors, extract free clusters to form a candidate data block set, and match and determine the reference data block; The state suspension module 102 is used to pause the thread when decoding reaches the physical boundary, extract the underlying state parameters and generate a physical endpoint state snapshot; The bit stream reconstruction module 103 is used to perform cross-byte shifting and bit-level concatenation on the data block under test based on the bit width parameters of the state snapshot, and reconstruct the logical bit stream. The anomaly verification module 104 is used to import status snapshot parameters and monitor the decompression status, and to identify and discard erroneous data blocks based on illegal path mapping anomalies. Pointer listening module 105 is used to read the length-distance pairs in the decompression command, and perform hash comparison with the historical dictionary by calculating the cross-boundary distance parameter to determine consecutive data blocks; When there are no cross-boundary parameters, the closed-loop iteration module 106 extracts the decompressed plaintext stream, verifies the structural closure state at the splicing point according to the application layer syntax specification to confirm the continuity of the data block, and writes the physical address corresponding to the data block to be tested into a pre-established virtual mapping table after confirmation.
[0034] Please see the appendix Figure 2 , Figure 2 This is a schematic flowchart of a method according to an embodiment of the present invention. The present invention provides an intelligent data fragment reconstruction and repair method for file corruption recovery, wherein the target file is a file with an identifiable file feature signature, contains data segments that can be streamed and parsed or decompressed, and has verifiable application layer format constraints, and includes the following steps: S10, the media scanning module 101 performs sector traversal on the physical storage medium 30 through the storage controller 20, removes the allocated file clusters and extracts the free physical clusters to form a candidate data block set, and performs feature signature matching on the candidate data block set to determine the reference data block of the file. S20, the state suspension module 102 receives the reference data block and starts the streaming decompression operation. When the internal execution instruction pointer reaches the physical cluster end boundary of the reference data block, the decoding thread is paused, the current sliding window dictionary data, Huffman mapping matrix and residual bit sequence in bit buffer register are obtained, and a physical endpoint state snapshot is generated. S30, the bit stream reconstruction module 103 extracts the bit width parameter of the residual bit sequence in the state snapshot for the data block to be tested in the candidate data block set, calls the arithmetic logic unit of the processor 10 to perform cross-byte translation of the original byte sequence of the data block to be tested, merges the residual bit sequence with the translated sequence at the bit level, and reconstructs the logical bit stream. S40, the exception verification module 104 receives the reconstructed logic bit stream, loads the dictionary data and mapping matrix in the state snapshot into the initial register, monitors the state of the underlying arithmetic unit during the decompression process, and identifies and discards the test data block that triggers the illegal path mapping exception. S50, under the condition that the exception verification module 104 does not trigger an exception, the pointer listening module 105 reads the length-distance pair instruction generated by the underlying decompression protocol, calculates whether the distance parameter in the instruction exceeds the physical header boundary of the data block to be tested, and performs hash comparison on the historical dictionary data to determine the continuous data blocks when the boundary is determined to be exceeded. S60, after the test data block completes the underlying bit stream parsing and anomaly / cross-boundary verification, the closed-loop iteration module 106 extracts the plaintext character stream generated by the decompression of the test data block, and verifies the structural pairing and closure state at the concatenation of the plaintext of the test data block and the plaintext of the reference data block according to the application layer syntax specification of the corresponding file format. After confirming the continuity of the data block, the processor 10 performs pointer update and reorganization iteration operations.
[0035] Please see the appendix Figure 3 , Figure 3This is a schematic diagram of media preprocessing and reference positioning according to an embodiment of the present invention. In step S10, the media scanning module 101 performs detection and extraction of underlying physical data to build the data basis for subsequent reassembly operations. In this embodiment, the process specifically includes the following steps.
[0036] The media scanning module 101 bypasses the logical volume manager and virtual file system layer within the operating system. It sends a raw device communication instruction carrying the starting logical block address of the physical storage medium 30 and the read span parameter directly to the storage controller 20 through the processor. This enables the storage controller 20 to drive the read / write channel of the physical storage medium 30 according to the above parameters and read the underlying binary raw data into the memory buffer in units of consecutive physical sectors. For the issuance of the underlying storage device communication instruction and the direct memory access mechanism of the operating system, the present invention can call the system-level device control interface for conventional implementation. This device control interface is an existing technical means and will not be described in detail here.
[0037] The media scanning module 101 performs file system metadata parsing on the raw data loaded into the memory buffer to extract the residual master file table or file allocation table structure, and reads the disk allocation bitmap and cluster operation records registered therein to assemble the currently allocated cluster set that has been indexed by the file system. Combining the total capacity of the physical storage medium 30 with the cluster size alignment parameters of the file system, the physical address space is divided to generate a global cluster set.
[0038] As a preferred implementation, in engineering data recovery scenarios, it is necessary to extract data blocks that are not covered by the file system index. The principle is that after the file system pointer is corrupted, the data segments of the composite file are stored in unallocated physical sectors. The media scanning module 101 calls the processor's logic operation unit to perform a difference operation on the above two sets to separate the allocated physical storage space, extract the unindexed free physical clusters, and then form a candidate data block set. If the file system metadata is corrupted and the allocated cluster set cannot be extracted, the system is configured with degradation processing logic, that is, when the extraction of the allocation table structure fails, the global cluster set is directly equated to the candidate data block set to prevent the algorithm execution from being interrupted.
[0039] The above logic for extracting unindexed data blocks from a set can be expressed by the following formula: ; In the formula, This represents the final set of candidate data blocks. This represents the global cluster set within the physical storage medium 30, aligned and divided according to the system cluster size parameter; Represents the set of allocated clusters obtained from parsing file system metadata; symbol This represents the set difference operation; The size of the global cluster set is determined by dividing the total byte capacity of the physical storage medium (30 bytes) by the cluster size parameter. The cluster size parameter is typically configured as 4096 bytes or 8192 bytes depending on the common file system format. This results in the set of candidate data blocks after calculation. Each element in the array corresponds to an independent physical cluster block in physical storage medium 30 that has not been allocated by the system index.
[0040] The media scanning module 101 loads a preset target file feature signature library. Since composite file formats generally specify a binary file preamble for identifying the file type in their structural specifications, the media scanning module 101 traverses all physical cluster elements in the candidate data block set according to a preset step size. At the starting zero offset position of each physical cluster element, a byte fragment of a specific length is preferentially extracted and sent to the matcher for binary comparison with the preset file preamble. If no match is found and the target file format allows non-cluster head aligned start, the module continues to perform supplementary signature scanning at multiple candidate offset positions within the physical cluster element according to the preset offset step size.
[0041] When a file preamble conforming to the specification is matched at the beginning position of a physical cluster element, the system can initially determine that the physical cluster element carries the header data structure of the target composite file. The media scanning module 101 then locks the memory address range where the physical cluster element is located and removes it from the candidate data block set, officially marking the data in the memory address range as the basic legal input terminal, i.e., the reference data block, for subsequent startup of streaming decompression and dictionary state construction.
[0042] Please see the appendix Figure 4 , Figure 4 This is a timing diagram for decoding boundary detection and context extraction according to an embodiment of the present invention. For the aforementioned determined reference data block, the state suspension module 102 performs a low-level streaming decompression operation and extracts the breakpoint state during the process to obtain the environmental parameters inside the decompression engine. In this embodiment, the processing specifically includes the following steps.
[0043] The state suspension module 102 instantiates the streaming decompression engine in memory and allocates an internal buffer for storing output data. The original byte sequence of the physical cluster marked as the reference data block is input to the endpoint of the streaming decompression engine to start the bit-level decoding and restoration logic. To prevent the decompression engine from triggering a low-level addressing exception due to physical truncation when processing the end of the physical sector, the state suspension module 102 configures address monitoring logic in the reading processing code of the streaming decompression engine to obtain the offset of the currently consumed input bytes in real time, and restricts the input prefetch of the decompression engine from crossing the end of the physical cluster of the current reference data block. For decompression engines with prefetch cache, the byte count of prefetch or backoff read is turned off before the physical cluster size threshold is reached. When the address probe detects that the input byte offset is equal to the preset physical cluster size threshold, a soft interrupt signal is sent to the processor.
[0044] The soft interrupt signal causes the main decoding loop thread of the streaming decompression engine to immediately trigger a suspension action and stop advancing the input pointer after processing the last bit of the current byte. The physical cluster size threshold is usually set to 4096 bytes or 8192 bytes according to the underlying file system format to ensure alignment with the actual physical media storage boundary. The sliding window initialization and mapping tree establishment process of the underlying data decompression is instantiated by calling the application interface of the decompression library.
[0045] When the decoding thread is interrupted and the input data stream is paused, the state suspension module 102 reads the internal memory space of the streaming decompression engine to obtain the current decoding context runtime environment. As a preferred approach, in order to achieve direct access to the originally encapsulated internal dynamic parameters, the system preferably adopts a self-developed streaming decompression engine with modifiable source code, or encapsulates and modifies an existing open-source / secondary-developable decompression engine, and configures the memory address of the core state structure as an access pointer at the code level. The state suspension module 102 extracts the sliding window dictionary data of the most recently decoded output and the dynamic mapping matrix used to guide subsequent bit stream parsing through this access pointer.
[0046] Because the physical mismatch between the fixed byte alignment characteristics of the disk's underlying storage and the variable-length encoding characteristics can lead to residual data at the end of bytes, the state suspension module 102 further reads the residual binary bit sequence that fails to form a complete decoding instruction in the underlying bit buffer register, as well as the bit width parameter that represents the specific number of bits in the sequence. Then, it combines all the core parameters captured above to generate a physical endpoint state snapshot that can pass context across physical breakpoints. This snapshot mechanism enables the system to save the underlying operation state of the decoder at the physical sector truncation point, avoiding state loss caused by physical breakpoints.
[0047] The physical endpoint state snapshot extracted by the state suspension module 102 is expressed by the data tuple formula as follows: ; In the formula, A snapshot of the generated physical endpoint state; Construct symbols for data tuples; This is a sequence of historical plaintext bytes output stored in the sliding window of the streaming decompression engine. This is the dynamic mapping matrix that is currently active. This is the remaining binary bit sequence in the bit buffer register that has not yet been consumed by the decoder; The bit width parameter is the residual binary bit sequence, and the value range of the bit width parameter is [0,7].
[0048] The upper limit of the length of the historical output plaintext byte sequence is determined by the maximum dictionary addressing size preset by the underlying compression protocol. The bit width parameter is limited by the physical structure of a single byte and its value range is a closed interval of natural numbers from 0 to 7. The dynamic decoding parameters in memory are converted into a static set through the above-mentioned tuple snapshot construction system, which provides a data foundation for the physical layer bit stream reconstruction and state recovery in subsequent steps.
[0049] Please see the appendix Figure 5 , Figure 5 This is a schematic diagram of bitstream reconstruction and cross-byte shift according to an embodiment of the present invention. For the aforementioned generated physical endpoint state snapshot, the bitstream reconstruction module 103 performs a bitstream reassembly operation on the data block to be tested to align the boundary between the physical storage unit and the algorithm parsing bit. In this embodiment, the processing specifically includes the following steps.
[0050] The bit stream reconstruction module 103 extracts the residual binary bit sequence and its corresponding bit width parameters from the state snapshot. Based on the preset traversal strategy, it takes out a data block to be tested from the candidate data block set and reads its physical byte sequence. Considering that the physical storage medium 30 is strictly aligned according to eight-bit bytes, and the compressed data stream usually breaks inside the byte at the physical sector boundary, if it is directly spliced at the byte level without bit alignment compensation, it will change the starting reading position of the subsequent variable-length encoded sequence, thereby causing the subsequent instruction parsing logic to be misaligned. Therefore, it is necessary to perform translation calibration on the physically cut data at the bit level.
[0051] The bit stream reconstruction module 103 calls the processor's arithmetic logic unit to perform cross-byte shift calculations on the original byte sequence of the data block to be tested based on the extracted bit width parameters. As a preferred method, the system uses a combination of underlying logical left shift and logical right shift instructions to shift the current byte to the left by a specified bit width and perform a logical OR operation with the bit overflowing to the right of the next adjacent byte to complete the bit shift of the physical layer data.
[0052] The above cross-byte shift calculation logic can be expressed by the following formula: ; In the formula, The first byte in the reconstructed byte sequence generated after displacement compensation 1 byte; The first byte in the original byte sequence of the data block to be tested 1 byte; This is a logical left shift operator at the hardware level; The bit width parameter recorded in the status snapshot; This is a bitwise logical OR operator; The first byte in the original byte sequence of the data block to be tested 1 byte; This is a logical right shift operator at the hardware level; It has a fixed physical bit width of one byte.
[0053] A reconstructed byte sequence is generated by iteratively calculating the continuous byte sequence of the entire data block under test, for cases where the end of the data block is missing. In such cases, the system's underlying configuration uses zero-padding logic to prevent memory out-of-bounds access errors.
[0054] After completing the cross-byte shift calculation, the bit stream reconstruction module 103 uses the residual binary bit sequence saved in the state snapshot as prefix data and concatenates it with the reconstructed byte sequence generated above in physical memory to reconstruct a continuous logical bit stream. This continuous logical bit stream connects the physically truncated data segments in the data structure, so that the subsequent decompression process can parse it according to the standard compression protocol.
[0055] The bit-level merging process of the residual sequence and the shifted data described above can be expressed by the following formula: ; In the formula, This is the final continuous logic bit stream generated by splicing. This is the residual binary bit sequence extracted from the state snapshot; This is a concatenation operator for the underlying data stream; This is the complete reconstructed byte sequence generated by cross-byte shifting.
[0056] For the continuous logical bit stream generated by the aforementioned reconstruction, the anomaly verification module 104 performs a filtering operation based on the underlying decoding rules to initially remove erroneous fragments that do not belong to the original file continuous stream. In this embodiment, the processing specifically includes the following steps.
[0057] As a preferred approach, the anomaly verification module 104 reinitializes a streaming decompression engine instance in memory and bypasses the engine's default dictionary clearing and mapping tree construction routines. It extracts the sliding window dictionary data and dynamic mapping matrix saved in the physical endpoint state snapshot, and loads the dictionary data and mapping matrix into the underlying state register and working memory area of the newly instantiated decompression engine by overwriting memory pointers. This context inheritance mechanism enables the newly instantiated decompression engine to inherit the decoding state of the previous physical breakpoint, thereby providing a historical reference benchmark for the parsing of the data block under test.
[0058] After the state injection is completed, the exception verification module 104 sends the continuous logic bit stream into the input channel of the decompression engine to start the bit stream parsing loop. Considering that the data block under test is extracted from the global physical space and its internal data may not match the current mapping matrix, the exception verification module 104 sets the instrumentation listening logic in the code table traversal function, symbol decoding function or exception callback interface of the streaming decompression engine to obtain the underlying software exception, out-of-bounds interruption or explicit error return status triggered by reading illegal leaf nodes during the bit stream translation process in real time.
[0059] When the decompression engine reads specific binary bits and performs path addressing along the injected mapping matrix, if the reached leaf node does not have a corresponding plaintext character defined or the addressing pointer points to an invalid memory region due to bit stream corruption, the exception verification module 104 defines this type of parsing error caused by encoding mismatch as an illegal path mapping exception. The above exception judgment logic is expressed by the state passing formula as follows: ; In the formula, This is a Boolean-type exception flag bit output by the exception verification module 104; This provides underlying path addressing and node validity verification functions. The current parsing bit in a continuous logic bit stream A binary bit segment; This is a dynamic mapping matrix inherited from the state snapshot.
[0060] Once the exception flag is triggered, the exception verification module 104 determines that the current data block under test and the reference data block are not physically or logically continuous. Then, it returns a discard instruction to the system main control thread to remove the data block under test from the current verification sequence and drives the system to extract the next data block under test from the candidate data block set for a new round of splicing verification. For the conventional memory initialization and exception acquisition framework configuration of the decompression engine, the standard library memory allocation interface can be called for conventional implementation in this invention. This memory allocation interface is an existing technical means and will not be described in detail in this article.
[0061] Please see the appendix Figure 6 , Figure 6 This is a schematic diagram of cross-boundary pointer monitoring and hash anchoring according to an embodiment of the present invention. For the data block under test that does not trigger an illegal path mapping exception in the exception verification module 104, the pointer monitoring module 105 performs monitoring and cross-boundary verification operations on the output instructions of the underlying decompression protocol to ensure the uniqueness of the evidence chain and the physical continuity of the data at the logical level. In this embodiment, the processing specifically includes the following steps.
[0062] As a preferred approach, the pointer monitoring module 105 connects to the instruction output pipeline of the streaming decompression engine when the exception verification module 104 does not trigger an exception. This is because mainstream lossless compression protocols generally use dictionary matching algorithms to generate instruction pairs containing length and distance parameters when eliminating duplicate data. The pointer listening module 105 configures listening logic at the function node responsible for length-distance pair generation, output, or status callback within the decompression engine. This allows it to read the length-distance pair instructions generated by the underlying decompression protocol when parsing the current data block under test in real time, and extract these instructions from the underlying structure into the verification buffer for subsequent cross-boundary logic operations. The conventional implementation of the dictionary matching algorithm in the compression protocol and the basic memory implantation method of the listening code can be implemented by calling the system programming interface. The system programming interface is an existing technology and will not be elaborated on further in this paper.
[0063] The pointer monitoring module 105 reads the length-distance pair instructions in the verification buffer and extracts the distance parameter. Simultaneously, it obtains the total number of plaintext bytes output by the current streaming decompression engine while processing the data block under test. By constructing cross-boundary judgment logic, it calculates whether the distance parameter indicates an addressing action that crosses the physical header boundary of the current data block under test. This cross-boundary distance calculation logic is expressed by the inequality formula: ; In the formula, The boolean value for the cross-boundary determination result; The absolute distance parameter is extracted from the intercepted length-distance pair instruction. It is limited by the dictionary space of the underlying compression protocol, and its value range is a closed interval of positive integers [1, 32768]. This is a greater than logical comparison operator; This represents the total number of plaintext bytes generated in the current data block under test from the initial parsing position to the current position.
[0064] When the calculation determines that the inequality is true, it indicates that the address pointer of the current instruction has crossed the physical boundary of the data block under test and pointed to the injected historical dictionary data. Based on this, the pointer monitoring module 105 has obtained a cross-boundary verification parameter for establishing the relationship between blocks.
[0065] When determining that the distance parameter is out of bounds, the pointer listening module 105 uses the out-of-bounds distance parameter and the length parameter to perform a reverse mapping of the absolute physical address in the inherited historical dictionary data, and extracts the original byte sequence located at the specified position in the historical dictionary as the cross-block reference plaintext. Considering that when the corrupted data bit stream is incorrectly flipped, an out-of-bounds parameter that conforms to the syntax rules will be generated.
[0066] To ensure the accuracy of cross-block references and eliminate erroneous instructions caused by data collisions, the pointer monitoring module 105 calls the processor's hash operation unit or software hash routine to perform hash calculation on the extracted cross-block reference plaintext to generate a runtime hash value. Then, the runtime hash value is checked against the consistency of the verification fields available in the target file format. The verification fields are preferably CRC, Adler32, checksum or equivalent integrity fields carried by the file format itself. When the target file format does not provide the aforementioned verification field, hash consistency is not used as a necessary criterion. Instead, the plaintext of the cross-block reference is used as a candidate continuity evidence, and secondary confirmation is performed in conjunction with the stability of subsequent continuous decoding and application layer syntax verification.
[0067] Indirect verification is performed by monitoring whether subsequent decoding processes throw unrecoverable state exceptions due to context corruption.
[0068] If the hash comparison is inconsistent or the subsequent decoding triggers a state collapse exception, it is determined that the data block under test is not a real contiguous block. The pointer listening module 105 returns a discard instruction to the system and directly drives the extraction of the next candidate data block for re-verification. Conversely, if the hash comparison is consistent or the subsequent decoding does not trigger a state collapse, it indicates that there is a reasonable logical coupling relationship between the compression instructions inside the current data block under test and the historical context of the reference data block. The pointer monitoring module 105 then marks the data block under test as a priority continuous candidate block and performs candidate anchoring. The final continuity confirmation is based on the results of subsequent syntax verification and iterative update.
[0069] Please see the appendix Figure 7 , Figure 7 This is a schematic diagram of plaintext syntax downgrade verification and closed-loop iteration according to an embodiment of the present invention. For the test data block that has completed the underlying instruction listening, the closed-loop iteration module 106 performs downgrade verification based on application layer syntax and system mapping table reorganization operation to achieve iterative convergence of the recovery process. In this embodiment, the processing specifically includes the following steps.
[0070] The closed-loop iteration module 106 monitors the instruction output characteristics of the decompression engine. Considering that in a specific data distribution scenario, the data block under test mainly consists of literals and does not contain length-distance pair instructions, the pre-set cross-boundary pointer listening logic will not take effect due to the lack of input parameters. As a preferred approach, the closed-loop iteration module 106 activates the full block state constraint mechanism to enable the decompression engine to fully process the remaining logical bit stream of the current data block under test. It detects whether the underlying state is abnormal by monitoring whether the memory addressing of the dynamic mapping matrix goes out of bounds or is interrupted during the entire parsing cycle.
[0071] The degradation processing logic is expressed by the state accumulation decision formula as follows: ; In the formula, The overall state validity determination result of the data block to be tested is represented by a Boolean variable whose value range is limited to the set {0,1}. This is the index number of the bit segment being parsed; This represents the total number of remaining valid binary bits contained in the data block to be tested. This is a state security verification function for a single bitstream parsing process; The current parsing bit in a continuous logic bit stream A binary bit segment; This is the currently active dynamic mapping matrix.
[0072] This mechanism verifies the continuity of data blocks under conditions without dictionary reference instructions by examining the stability of the underlying execution state.
[0073] After confirming that no abnormalities have occurred in the underlying decompression state, the closed-loop iteration module 106 extracts the decompressed plaintext character fragments that cross the physical splicing points and injects them into a finite state automaton constructed according to the target application layer file syntax rules to perform syntactic verification.
[0074] For target files using XML, HTML, OOXML or other markup structures, the closed-loop iteration module 106 uses a finite state automaton to track the opening and closing states of various tags in the text in order to investigate decoding errors or tag truncation caused by bit stream misalignment. For target files in non-tagged binary format, a finite state automaton or equivalent syntax checker is constructed based on the file format's length field, section boundaries, directory entries, block check fields, object header and footer identifiers, or equivalent structure rules to verify the structural continuity at the splice.
[0075] The above automaton verification logic can be expressed by the state transition formula as follows: ; In the formula, The internal parsing state of the finite state automaton is determined at the next moment after the input character. This is a state transition mapping function constructed based on the application layer syntax of the target file; The current state is the finite state automaton's parsed state. The input characters are single-byte characters read sequentially from the concatenated plaintext. Their value range strictly corresponds to the width of an unsigned single byte, i.e., the closed interval of decimal integers [0, 255].
[0076] The configuration and memory instantiation of the state transition table for a conventional finite state automaton can be implemented in code according to the publicly available format specifications of the target file.
[0077] If the final state of the automaton does not remain within the preset set of valid receiving states, the closed-loop iteration module 106 determines that the syntax of the current data block to be tested is invalid and discards it, and then directly drives the system to extract the next candidate data block and re-concatenate and verify it. Conversely, once the data block under test passes the above verification, the closed-loop iteration module 106 confirms that the data block under test is a continuous data block, extracts the physical address corresponding to the data block and writes it into the virtual mapping table maintained in the system memory to update the pointer logic relationship of the file fragments, and then marks the confirmed data block as a new reference data block and triggers the system iterative reorganization mechanism.
[0078] Based on the updated system state, the closed-loop iteration module 106 drives the decision process to jump back to the physical endpoint state snapshot extraction stage, and uses the updated virtual mapping table to continue extracting the next candidate data block for splicing and scanning.
[0079] The iterative process will continue to loop until the termination condition corresponding to the target file format is met. The termination condition includes a global end identifier, a complete closure of the directory / index structure, a pass of the verification field, or an equivalent file completion judgment condition, thereby completing the closed-loop retrieval and reorganization output of the entire composite file storage space.
[0080] The following provides a specific application example, and combines experimental verification and effect comparison to demonstrate the technical means of the present invention.
[0081] In the application scenario of drone aerial photography and recording flight logs and structured reports, the structured report adopts the OOXML format based on the ZIP compression protocol. When the drone loses power due to a sudden drop in battery, the file allocation table or master file table of the storage device is not updated and becomes corrupted. This causes the underlying storage of the structured report to be physically truncated and scattered in multiple non-contiguous physical clusters on the SD card, with each physical cluster being 4096 bytes in size.
[0082] In the specific process of implementing reorganization and repair, the media scanning module 101 first bypasses the damaged file allocation table and performs a full scan of the SD card through the raw device interface. Physical clusters not covered by the file system index are included in the candidate data block set. Subsequently, the system matches the ZIP leading hexadecimal signature 50 4B 03 04 of the OOXML standard in the set and locks the physical cluster that matches the signature as the base data block.
[0083] Next, the state suspension module 102 begins streaming decoding of the compressed Extensible Markup Language document within the reference data block. When the decoder reaches the physical boundary of the 4096th byte of the physical cluster, the system pauses the decoding thread and acquires a state snapshot at this time. This state snapshot contains the historical decompressed plaintext tags within a 32KB sliding window, the current Huffman tree mapping matrix, and 5 residual binary bits left in the register due to physical boundary bit alignment misalignment. At this time, the record bit width parameter is 5.
[0084] Subsequently, the system retrieves a test data block from the candidate data block set. The bit stream reconstruction module 103 performs a logical shift of all the original bytes of the test data block to the left by 5 bits based on the extracted 5 effective bit width, and concatenates them with the 3 bits overflowing to the right of the previous byte. The system merges the shifted data with the 5 residual bits saved in the state snapshot, thereby reconstructing a strictly aligned continuous logical bit stream at the physical level.
[0085] After completing the bitstream reconstruction, the anomaly verification module 104 imports the previously saved Huffman tree matrix and starts decoding monitoring. If the address pointer points to an undefined illegal Huffman leaf node and generates garbled bitstream due to mismatched spliced data, the system will directly discard the erroneous data block and extract the next candidate data block for retesting.
[0086] When a test data block does not trigger the above-mentioned exception, the pointer monitoring module 105 reads a verification instruction with a length of 15 and a distance of 4050 output by the underlying decoding protocol. After calculation and comparison, since the distance parameter 4050 is greater than the 50 bytes that the current test data block has just been decompressed from the starting position, the system determines that the instruction has out-of-bounds addressing to the historical dictionary of the previous reference data block. The pointer monitoring module 105 then extracts the 15 bytes at the corresponding position in the historical dictionary and performs hash verification. After confirming that the logical association is established, the test data block is anchored as a continuous data block.
[0087] Finally, the closed-loop iterative module 106 extracts the plaintext character stream at the physical splice point and sends it to the finite state automaton for application-layer syntax checking. When the system finds that the previous data block decompresses flight log content with paragraph and text start tags at the end, and the current data block decompresses at the beginning with error code content and corresponding text and paragraph closing tags, it determines that the markup language tags are perfectly closed. After confirming the continuity of the data structure, the system writes the physical address of the data block into the virtual mapping table, updates it as a new baseline data block, and continues to start iterative verification until the global end character of the archive structure is encountered, finally achieving lossless recovery of the target file.
[0088] Experimental verification and effect comparison: The experiment was conducted on a computing device configured with an Intel Core i7 processor, 16GB of memory, and access to the underlying raw device.
[0089] The system uses 100GB virtual RAW physical storage media with 30 images. The physical sector and system cluster size are strictly aligned to 4096 bytes. 1000 mainstream composite format files (mainly OOXML files with streaming Deflate compression and ZIP archive files, with file sizes ranging from 1MB to 50MB) are randomly written to the media.
[0090] The file allocation table and directory entry metadata of the file system are manually erased, and different degrees of physical storage fragmentation are introduced through a random cluster allocation strategy (setting three fragmentation levels: low 5%, medium 15%, and high 30%) to simulate the underlying data distribution state when the device is powered off or severely logically damaged.
[0091] The method of this invention is compared with existing conventional data recovery techniques: Method A (traditional file engraving method): Extraction is performed solely based on the file header and footer signatures and continuous sector reading (ignoring fragmentation).
[0092] Method B (byte-level dictionary probing): attempts to splice and decompress non-contiguous clusters, but does not perform bit alignment compensation and underlying state snapshot inheritance at the physical truncation point.
[0093] Method C (the present invention): The medium scanning module 101 is enabled to extract candidate blocks, the state suspension and bit stream reconstruction module 103 is used to solve the bit truncation problem across physical boundaries, and the pointer listening and closed-loop iteration module 106 is combined to perform cross-boundary anchoring.
[0094] The main evaluation metrics are as follows: Successful recovery rate: the percentage of files that can be completely reassembled with correct application layer syntax parsing and consistent file hash verification; Mis-assembly rate: the probability that the algorithm incorrectly identifies unrelated physical fragments as continuous data blocks and forcibly splices them together.
[0095] The recovery performance of the three methods under different degrees of fragmentation was statistically analyzed, and the experimental results are shown in the table below:
[0096] From the table above and Figure 8 and Figure 9 We can obtain: Although all three methods showed some recovery capability in low-fragmentation scenarios, as the degree of fragmentation increased to medium (15%) and high (30%), the success rate of method A and method B dropped sharply, and the mis-patch rate increased dramatically. This was because physical truncation caused serious bitstream misalignment and state collapse during the parsing of subsequent variable-length compressed codes.
[0097] The present invention (method C) can still maintain a success rate of 89.2% in a highly fragmented environment of 30%, which proves that the bit stream reconstruction module 103 performs cross-byte shift for the residual bit sequence, and the anomaly verification module 104 and the pointer listening module 105 work together to perform cross-boundary distance verification, which can repair the context break at the physical boundary.
[0098] Regarding the error rate, this invention introduces the application layer plaintext syntax verification of the closed-loop iteration module 106 as the final check, which controls the probability of error splicing to below 0.05%, thus solving the technical defect of the traditional trial-and-error method that is prone to introducing dirty data.
[0099] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for intelligent data defragmentation and repair for file corruption recovery, the method configured to be executed in a computing device, the method comprising: The computing device includes a processor and a physical storage medium. The processor establishes an underlying data transmission channel with the physical storage medium through a storage controller. The method includes the following steps: The system iterates through the physical storage medium to extract free physical clusters, forms a candidate data block set, and performs feature matching on the candidate data block set to determine the baseline data block. The reference data block is streamed and decompressed. When the physical boundary of the reference data block is reached, the decompression thread is suspended, and the sliding window dictionary data, dynamic mapping matrix, residual bit sequence and bit width parameter of the residual bit sequence are extracted to generate an endpoint state snapshot. Extract the data block to be tested from the candidate data block set, perform cross-byte shift on the original byte sequence of the data block to be tested according to the bit width parameter, and merge the residual bit sequence with the shifted sequence bit-level to reconstruct a continuous logical bit stream; The sliding window dictionary data and the dynamic mapping matrix are loaded into the decompression engine, and the continuous logical bit stream is decoded and verified. The continuous data blocks are identified based on the legality of the decoding path and the cross-boundary distance parameter. After extracting the decompressed plaintext of the continuous data blocks, structural closure verification is performed according to the application layer syntax specification. After the verification is successful, the mapping relationship of the data blocks is updated and iterative reorganization is performed.
2. The intelligent data fragment reconstruction and repair method for file corruption recovery according to claim 1, characterized in that, The steps of traversing the physical storage medium to extract free physical clusters, forming a candidate data block set, and performing feature matching on the candidate data block set to determine the baseline data block include: Parse file system metadata to extract the allocated cluster set; The global cluster set is divided according to the total capacity of the physical storage medium and the physical cluster alignment parameters; The difference between the global cluster set and the allocated cluster set is calculated to separate the space that has been indexed by the file system, and the unindexed free physical clusters are used as the candidate data block set.
3. The intelligent data fragment reconstruction and repair method for file corruption recovery according to claim 1, characterized in that, The step of performing streaming decompression on the reference data block and suspending the decompression thread when reaching the physical boundary of the reference data block includes: The offset of the consumed input bytes is acquired in real time during the streaming decompression process; When the offset of the consumed input bytes is detected to be consistent with the preset physical cluster capacity threshold, an interrupt signal is triggered to stop advancing the input pointer, and the sliding window dictionary data and the dynamic mapping matrix are extracted from the decompression engine memory space in the paused state.
4. The intelligent data fragment reconstruction and repair method for file corruption recovery according to claim 1, characterized in that, The steps of performing cross-byte shifting on the original byte sequence of the data block under test according to the bit width parameter, and merging the residual bit sequence with the shifted sequence bit-level to reconstruct a continuous logical bit stream include: Based on the bit width parameter, perform a logical left shift on the current byte of the data block under test, and perform a logical right shift on the next adjacent byte; Perform a bitwise OR operation on the results of the logical left shift and logical right shift, and iteratively generate a reconstructed byte sequence after shift compensation; The residual bit sequence is used as prefix data and concatenated with the reconstructed byte sequence in memory to generate the continuous logical bit stream.
5. The intelligent data fragment reconstruction and repair method for file corruption recovery according to claim 1, characterized in that, The step of identifying consecutive data blocks based on the decoding path validity and cross-boundary distance parameters includes: When the decompression engine performs path addressing on the continuous logical bit stream according to the loaded dynamic mapping matrix, it monitors the validity of the addressing pointer; If the leaf node reached by the addressing pointer does not have a corresponding plaintext character defined, or if the addressing pointer points to an invalid memory region, an illegal path mapping exception is triggered, the data block under test is determined to be non-contiguous, and the data block under test is discarded.
6. The intelligent data fragment reconstruction and repair method for file corruption recovery according to claim 1, characterized in that, The step of identifying consecutive data blocks based on the decoding path validity and cross-boundary distance parameters includes: Under conditions where no exception is triggered, read the decoding instructions generated by the decompression engine during the decoding process, which include length and distance parameters; Obtain the total number of plaintext bytes output by the decompression engine when processing the data block under test; When the distance parameter exceeds the total number of plaintext bytes output, it is determined that the decoding instruction crosses the physical header boundary of the data block under test, and a cross-boundary reference relationship is established between the data block under test and the sliding window dictionary data.
7. The intelligent data fragment reconstruction and repair method for file corruption recovery according to claim 6, characterized in that, The steps following the establishment of the cross-boundary reference relationship between the data block to be tested and the sliding window dictionary data include: By using the out-of-bounds distance parameter and the corresponding length parameter, the sliding window dictionary data is mapped in reverse to extract the corresponding byte sequence as cross-block reference plaintext; A runtime hash value is generated by performing a hash calculation on the cross-block reference plaintext. The runtime hash value is then checked against the verification field in the target file format. If the check matches, the data block to be tested is marked as a priority contiguous data block.
8. The intelligent data fragment reconstruction and repair method for file corruption recovery according to claim 6, characterized in that, The step of identifying consecutive data blocks based on the decoding path validity and cross-boundary distance parameters further includes: When the decompression engine does not generate a decoding instruction containing a distance parameter, the decompression engine is constrained to fully process the remaining data of the continuous logical bit stream, and the memory addressing of the dynamic mapping matrix is monitored for interruption during the entire parsing cycle. The continuous data block is determined based on the stability of the underlying execution state.
9. The intelligent data fragment reconstruction and repair method for file corruption recovery according to claim 1, characterized in that, The steps for performing structural closure verification according to the application layer syntax specification include: The decompressed plaintext is injected into a finite state automaton constructed according to the application layer syntax rules of the target file to track the open and closed states of the tags in the decompressed plaintext; If the final state of the finite state automaton does not remain within the preset set of valid receiving states, then the syntax of the data block under test is determined to be invalid and the data block under test is discarded.
10. The intelligent data fragment reconstruction and repair method for file corruption recovery according to claim 1, characterized in that, The steps of updating the mapping relationship of data blocks and performing iterative reorganization after successful verification include: After the structure closure verification is passed, the physical addresses of the consecutive data blocks are extracted and written into the virtual mapping table in the system memory; The consecutive data blocks are marked as new baseline data blocks, and the process jumps back to the step of extracting the endpoint state snapshot. The next candidate data block is extracted using the virtual mapping table for verification until the termination condition corresponding to the target file format is met.