Differential data streaming method, device, system and medium for resource-constrained devices

By streaming the differential patch files in compressed blocks, the problem of insufficient memory on resource-constrained devices is solved, achieving efficient and reliable differential upgrades suitable for resource-constrained embedded devices.

CN122152345APending Publication Date: 2026-06-05ASR MICROELECTRONICS CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ASR MICROELECTRONICS CO LTD
Filing Date
2026-03-04
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Traditional differential upgrade methods have high memory requirements for resource-constrained embedded devices, cannot sequentially read complete differential patch files, and existing streaming upgrade solutions require modification of differential patch formats or toolchains, resulting in poor compatibility and low reliability of the upgrade process.

Method used

The system uses independent compressed blocks defined by the compression algorithm in the differential patch file as the basic processing unit. It generates new firmware data blocks through streaming acquisition and processing, and writes them block by block in the non-volatile storage area. It supports simultaneous synthesis and burning, and records running status information to achieve breakpoint recovery.

Benefits of technology

It significantly reduces memory requirements, improves upgrade efficiency and system reliability, maintains compatibility with existing toolchains, and supports recovery after abnormal interruptions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122152345A_ABST
    Figure CN122152345A_ABST
Patent Text Reader

Abstract

The application provides a differential data streaming processing method, device, system and medium for resource-constrained equipment, applied to the technical field of embedded system software upgrading, and the method comprises the following steps: obtaining the compression header information of a differential patch file from a server and storing the information in a non-volatile storage area to initialize a decompression environment, taking an independent compression block defined by a compression algorithm as a basic processing unit, requesting the corresponding compression block data from the server according to the current compression block identifier, decompressing the received compression block data and sequentially reading control block information from the data, performing differential synthesis on the old firmware data according to the control block information, generating new firmware data blocks corresponding to the compression blocks and writing the data blocks into a specified storage area, updating the compression block identifier and repeating the above steps of requesting, decompressing, synthesizing and writing until all the compression blocks are processed, so that the pipeline processing of synthesizing and burning simultaneously is realized, the demand for memory resources is significantly reduced, and the upgrading efficiency and system reliability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of embedded system software upgrade technology, specifically to a differential data streaming processing method, apparatus, system, and medium for resource-constrained devices. Background Technology

[0002] In embedded device software upgrade scenarios, differential upgrade technology is widely used to reduce the amount of data transmitted during upgrades. Common differential algorithms such as bsdiff / bspatch generate differential patch files by performing difference analysis on the old and new firmware. The device then uses the bspatch algorithm to differentially synthesize the old firmware, thereby generating the new firmware.

[0003] However, the traditional bspatch upgrade method has inherent limitations: it requires the device to be able to read the complete differential patch file sequentially and maintain the decompressed differential data in memory, resulting in a large memory footprint. For small embedded devices with limited resources (such as microcontroller systems with small RAM and Flash), it often cannot provide enough contiguous memory space to store the entire differential patch file.

[0004] To adapt to such resource-constrained devices, existing methods attempt to introduce streaming upgrade mechanisms. However, these solutions usually require redesigning the differential patch format or making deep modifications to the bspatch algorithm, which not only increases system complexity but also requires modifications to the existing toolchain, resulting in poor compatibility.

[0005] Therefore, a new differential data streaming processing scheme is needed to meet the actual needs of resource-constrained embedded devices. Summary of the Invention

[0006] In view of this, embodiments of this specification provide a differential data streaming processing method, apparatus, system, and medium for resource-constrained devices, which solves the problem that resource-constrained embedded devices cannot run traditional differential upgrades when memory is insufficient, without modifying the differential patch data format.

[0007] The embodiments in this specification provide the following technical solutions: This specification provides an embodiment of a differential data streaming processing method for resource-constrained devices, applied at the device end. The differential data streaming processing method includes: Step S1: Obtain the compressed header information of the differential patch file from the server and store the compressed header information in a non-volatile storage area to initialize the decompression environment; Step S2: Using the independent compressed blocks defined by the compression algorithm in the differential patch file as the basic processing unit, and requesting data of at least one compressed block from the server according to the current compressed block identifier; Step S3: Decompress the data of the compressed block and read the control block information sequentially from the decompressed data; Step S4: Perform the corresponding differential synthesis operation on the old firmware data according to the control block information to generate a new firmware data block corresponding to the current compression block, and write the new firmware data block into the specified new firmware storage area. Step S5: After completing the processing of the compressed block, update the current compressed block identifier, and repeat steps S2 to S4 until all compressed blocks are processed.

[0008] This specification also provides an embodiment of a differential data streaming processing device for resource-constrained devices, the differential data streaming processing device comprising: An initialization module is used to obtain the compressed header information of the differential patch file from the server and store the compressed header information in a non-volatile storage module to initialize the decompression environment; The streaming data request module is used to request at least one compressed block data from the server based on the current compressed block identifier, using the independent compressed blocks defined by the compression algorithm in the differential patch file as the basic processing unit. The decompression processing module is used to decompress the compressed block data and sequentially read control block information from the decompressed data; The differential processing module is used to perform a corresponding differential synthesis operation on the old firmware data according to the control block information, generate a new firmware data block corresponding to the current compression block, and write the new firmware data block into the specified new firmware storage area. The running status management module is used to maintain the current compressed block identifier and update the current compressed block identifier after the differential processing module completes the processing of the compressed block; The upgrade control module is used to control the streaming data request module, the decompression processing module, the differential processing module, and the running status management module to repeatedly execute the above operations until all compressed blocks are processed.

[0009] This specification also provides a differential data streaming processing system for resource-constrained devices, the differential data streaming processing system comprising: a server and a device; The server is configured to generate a differential patch file and provide the compression header information of the differential patch file to the device to initialize the decompression environment of the device; and to receive a request from the device that uses the independent compression blocks defined by the compression algorithm in the differential patch file as the basic processing unit, and send the corresponding compression block data to the device according to the request. The device is used to execute the aforementioned differential data streaming processing method.

[0010] This specification also provides a computer storage medium storing computer-executable instructions, which, when executed by a processor, perform the aforementioned differential data streaming processing method.

[0011] Compared with the prior art, the beneficial effects that at least one technical solution adopted in the embodiments of this specification can achieve include at least: 1. This application achieves streaming acquisition and processing of differential data by using independent compression blocks defined by the compression algorithm in the differential patch file as the basic processing unit. The device does not need to load the complete differential patch file at once, which significantly reduces the demand for memory resources. 2. This application completes the streaming upgrade without modifying the original differential patch data format, maintaining full compatibility with the existing differential toolchain and avoiding additional format modification or algorithm reconstruction costs; 3. This application achieves a pipelined processing of simultaneous synthesis and burning by writing the generated new firmware data blocks one by one into a non-volatile storage area, which further improves upgrade efficiency and system reliability. Attached Figure Description

[0012] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 This is a flowchart of a differential data streaming processing method in this application; Figure 2 This is a block diagram of a differential data streaming processing device according to this application. Detailed Implementation

[0014] The embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0015] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. This application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, in the absence of conflict, the following embodiments and features in the embodiments can be combined with each other. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0016] It should be noted that various aspects of embodiments within the scope of the appended claims are described below. It will be apparent that the aspects described herein can be embodied in a wide variety of forms, and any particular structure and / or function described herein is merely illustrative. Based on this application, those skilled in the art will understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number and aspects set forth herein can be used to implement the device and / or practice the method. Additionally, this device and / or method can be implemented using structures and / or functionalities other than one or more of the aspects set forth herein.

[0017] It should also be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this application. The drawings only show the components related to this application and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the shape, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0018] Additionally, specific details are provided in the following description to facilitate a thorough understanding of the examples. However, those skilled in the art will understand that practice can be carried out without these specific details.

[0019] In the software maintenance of embedded systems (especially IoT terminals and microcontroller devices), differential upgrade techniques (such as bsdiff / bspatch) have become the mainstream solution because they can significantly reduce the size of upgrade packages. However, in actual deployments, many embedded devices are limited by small RAM or Flash capacity and cannot perform traditional differential upgrades.

[0020] Regarding existing solutions, such as the prior art submitted in the aforementioned background section, through problem analysis and exploration of solutions, it was found that: On the one hand, the traditional bspatch upgrade method usually requires the device to be able to read the complete differential patch file sequentially and to store and decompress the differential patch data in memory, resulting in excessive memory consumption. Many resource-constrained devices cannot meet this requirement and it is difficult to run the upgrade program normally. On the other hand, although some existing solutions adapt to resource-constrained devices by introducing streaming upgrade mechanisms, these solutions often require redesigning the differential patch format or making deep modifications to the bspatch algorithm, which not only significantly increases system complexity but also requires modification of the existing toolchain, resulting in poor compatibility.

[0021] In the process of improving the traditional differential upgrade method to address the issue of insufficient memory causing it to fail, it was further discovered that if an abnormal power outage or system restart occurs during the upgrade process, all progress will be lost and the entire upgrade process must be restarted, resulting in poor reliability of the upgrade process.

[0022] Based on this, this specification proposes a differential data streaming processing scheme for resource-constrained devices. This scheme achieves streaming processing without modifying the differential patch data format through the following steps: First, it obtains the compressed header information of the differential patch file from the server and stores it in a non-volatile storage area to initialize the decompression environment. Then, using the independent compressed blocks defined by the compression algorithm in the differential patch file as the basic processing unit, it requests data for at least one compressed block from the server based on the current compressed block identifier. Next, it decompresses the received compressed block data and sequentially reads the control block information. Based on this control block information, it performs a differential synthesis operation on the old firmware data, generating a new firmware data block corresponding to the compressed block and writing it to the designated storage area. After completing the processing of the current compressed block, it updates the compressed block identifier and repeats the above request, decompression, synthesis, and writing steps until all compressed blocks are processed. This achieves a pipelined processing of synthesis and burning simultaneously, significantly reducing the demand for memory resources and improving upgrade efficiency and system reliability.

[0023] The technical solutions provided by the various embodiments of this application are described below with reference to the accompanying drawings.

[0024] like Figure 1 As shown in the embodiments of this specification, a differential data streaming processing method for resource-constrained devices is provided and applied to the device side. The differential data streaming processing method includes: Step S1: Obtain the compressed header information of the differential patch file from the server and store the compressed header information in a non-volatile storage area to initialize the decompression environment.

[0025] During implementation, after generating the differential patch file, the server will not modify the content or format of the differential patch; it only needs to support the following capabilities: Differential patch data is provided in the order of compressed blocks; Based on the starting identifier and number of compressed blocks requested by the device, return the corresponding compressed block data; Provides the compressed header information of the differential patch file for device-side initialization of the decompression environment.

[0026] Once the device obtains the compressed header information of the differential patch file, it stores it in a non-volatile storage area, such as Flash memory, and uses this compressed header information to initialize the decompression environment, preparing for subsequent data decompression in units of compressed blocks. This avoids repeatedly obtaining the compressed header with each request, effectively reducing communication overhead with the server.

[0027] In addition, the device records the identifier of the currently processed compressed block in the non-volatile storage area, with the initial value set to 0.

[0028] Step S2: Using the independent compressed blocks defined by the compression algorithm in the differential patch file as the basic processing unit, and according to the current compressed block identifier, request data of at least one compressed block from the server.

[0029] Specifically, the device requests differential patch data from the server according to the preset number of compressed blocks, and the server returns the corresponding number of compressed block data after receiving the request.

[0030] Typically, the number of compressed blocks is dynamically set based on the device's memory size. If the device's memory is particularly small, the preset number can be set to 1, meaning that one compressed block is requested each time, in order to minimize instantaneous memory usage.

[0031] It should be noted that the compressed block is an independent compression unit in the differential patch. Each compressed block can be decompressed independently, which enables the device to perform streaming acquisition and processing on a block-by-block basis without relying on the context information of the preceding and following blocks, providing a basis for on-demand requests and breakpoint resume.

[0032] Step S3: Decompress the data of the compressed block and read the control block information sequentially from the decompressed data.

[0033] Specifically, the acquired compressed block data is decompressed into memory sequentially, and during the decompression process, the control block information in the differential patch is read and processed sequentially.

[0034] Step S4: Perform the corresponding differential synthesis operation on the old firmware data according to the control block information to generate a new firmware data block corresponding to the current compression block, and write the new firmware data block into the specified new firmware storage area.

[0035] During implementation, based on the control block information, various parameters corresponding to the current processing unit are obtained, such as the differential size, the size of the new data, and the jump offset. Based on these parameters, the device performs the following operations: reads data of a specified length from the old firmware and performs a synthesis operation with the differential data to generate a new firmware data fragment; then writes the new data directly into the new firmware data block; finally, adjusts the read pointer of the old firmware according to the jump offset to prepare for subsequent processing. Through the above steps, the differential synthesis operation corresponding to the current compressed block is completed, a new firmware data block corresponding to the current compressed block is generated, and it is written into the specified new firmware storage area.

[0036] Step S5: After completing the processing of the compressed block, update the current compressed block identifier, and repeat steps S2 to S4 until all compressed blocks are processed.

[0037] By using a looping iterative mechanism based on compressed blocks, a new firmware data block is generated and written to a designated storage area after each processing step, achieving a pipelined processing of "generating one block and writing one block" to gradually complete the processing of all compressed blocks and finally generate a complete new firmware, which significantly reduces the memory consumption on the device side.

[0038] In some implementations, during the differential synthesis operation, the running status information of the current processing progress is maintained in real time; The operating status information includes at least: the information and processing progress of the current control block, the current differential operation type, the read offset information of the current old firmware data, and the write offset information of the current new firmware data.

[0039] During implementation, in the differential processing process, the device continuously maintains and updates the following operational status information: Currently processed compressed block identifiers; Information and processing progress of the current control block, including but not limited to the length of the remaining unprocessed differential data in the current control information, the length of the remaining unprocessed new data in the current control information, and the old firmware data jump offset corresponding to the current control information; The current differential operation type, i.e. the current differential processing stage, includes at least: differential data processing stage, new data processing stage, and data jump stage; The current offset position for reading old firmware data; The current write offset position of the new firmware data.

[0040] By maintaining the above-mentioned operational status information in real time, the device can accurately grasp the execution progress of differential synthesis at each processing granularity, and also provide a complete data foundation for state persistence and breakpoint recovery.

[0041] In some implementations, when the control information in the differential patch or its corresponding differential data spans multiple compression blocks, the device can achieve continuous processing and recovery across compression blocks by recording the remaining processing length of the current control information and the current differential processing stage.

[0042] In some implementations, when a preset limit for the number of compressed blocks is reached, the running status information and the identifiers of the currently processed compressed blocks are persistently stored in a non-volatile storage area.

[0043] In practice, the preset limit for the number of compressed blocks is the location where the data processing of the preset number of compressed blocks requested from the server is completed. When the processing progress reaches the preset limit for the number of compressed blocks, the current control block status information, the current offset information between the old and new firmware data, and the type of differential operation currently being performed are persistently stored in the non-volatile storage area. The currently processed compressed block identifiers are also updated and stored, thereby ensuring that the device can restore a consistent differential processing state at any compressed block boundary.

[0044] In some implementations, the differential data streaming method further includes: resuming interrupted data transmissions; When an abnormal interruption occurs, the compression head information, the currently processed compression block identifier, and the running status information are read from the non-volatile storage area; Determine the current compressed block identifier based on the currently processed compressed block identifier; Based on the current compressed block identifier, request the corresponding compressed block data from the server; The compressed block data is decompressed according to the compression header information; Based on the aforementioned operational status information, differential data streaming processing is resumed and continues.

[0045] In practice, abnormal interruption generally refers to an abnormal power outage or restart during the upgrade process. After the device restarts, it does not need to re-execute the completed differential processing operation, but only needs to continue execution from the boundary of the most recently saved compressed block, thereby avoiding duplicate processing and resource waste, and significantly improving the reliability and resource utilization efficiency of the upgrade process.

[0046] In some implementations, the compression algorithm includes the bzlib compression algorithm or the zlib compression algorithm; The size of the independent compressed block after compression is not fixed.

[0047] Specifically, the differential patch file consists of multiple independent compressed blocks, each with a variable size after compression and capable of independent decompression. Taking bzlib as an example, its compressed data is composed of a series of independent compressed blocks. These compressed blocks serve as the native data boundaries of the compression algorithm and can be used as the basic units for streaming processing without any additional markings. This provides a natural basis for block-based requests, decompression, and synthesis, enabling the device to perform streaming processing at the compressed block level without any modification to the original differential patch format. This significantly reduces the system implementation complexity while maintaining full compatibility with existing toolchains.

[0048] In some embodiments, the differential data streaming processing method further includes: After all compressed blocks have been processed, request verification information for the new firmware from the server; The new firmware is validated for consistency based on the verification information.

[0049] During implementation, after all compressed blocks have been processed, the hash value of the new firmware can be requested from the server. At the same time, the hash value of the generated new firmware can be calculated locally and compared with the hash value obtained from the server. If the comparison results match, the new firmware is confirmed to be complete and error-free, and the upgrade is successful. If they do not match, the error handling process is triggered, such as recording error logs, upgrading again, or reverting to the old firmware version.

[0050] By introducing a verification mechanism, the device can effectively verify the integrity and correctness of the new firmware data, avoiding firmware damage caused by data transmission errors, writing anomalies, or synthesis deviations, thereby improving the reliability of the upgrade process and ensuring that the device can start and run normally after the upgrade.

[0051] This application utilizes the native independent compression blocks of the compression algorithm in the differential patch file as streaming processing units, achieving low-memory streaming differential synthesis without requiring any modifications to the differential patch data format and generation toolchain, thus significantly reducing the memory usage on the device side.

[0052] This application uses a runtime status recording mechanism based on compressed block boundaries to support abnormal interruption recovery during the upgrade process, effectively improving the upgrade success rate. It is suitable for small embedded devices with limited RAM and storage resources.

[0053] Based on the same inventive concept, this application also provides a differential data streaming processing device for resource-constrained devices, the differential data streaming processing device comprising: An initialization module is used to obtain the compressed header information of the differential patch file from the server and store the compressed header information in a non-volatile storage module to initialize the decompression environment; The streaming data request module is used to request at least one compressed block data from the server based on the current compressed block identifier, using the independent compressed blocks defined by the compression algorithm in the differential patch file as the basic processing unit. The decompression processing module is used to decompress the compressed block data and sequentially read control block information from the decompressed data; The differential processing module is used to perform a corresponding differential synthesis operation on the old firmware data according to the control block information, generate a new firmware data block corresponding to the current compression block, and write the new firmware data block into the specified new firmware storage area. The running status management module is used to maintain the current compressed block identifier and update the current compressed block identifier after the differential processing module completes the processing of the compressed block; The upgrade control module is used to control the streaming data request module, the decompression processing module, the differential processing module, and the running status management module to repeatedly execute the above operations until all compressed blocks are processed.

[0054] In some implementations, the running status management module is also used to maintain the running status information of the current processing progress in real time during the differential synthesis operation, and to persistently store the running status information and the currently processed compressed block identifier to the non-volatile storage module when the preset compressed block boundary is reached. The upgrade control module is also used to read the compression header information, the currently processed compression block identifier, and the running status information from the non-volatile storage module when an abnormal interruption occurs; and to control the streaming data request module, the decompression processing module, and the differential processing module to resume and continue executing differential data streaming processing based on the read information.

[0055] Specifically, the differential data streaming processing device includes at least a processor, a memory, and a communication interface, and each functional module is implemented by the processor executing program instructions stored in the memory.

[0056] like Figure 2 As shown, in terms of functional structure, the device includes at least: an upgrade control module, a streaming data request module, a decompression processing module, a differential processing module, a running status management module, and a non-volatile storage module. The above modules work together to realize streaming processing and breakpoint recovery of differential upgrade without modifying the differential patch data format.

[0057] The specific functions of each module are as follows: The upgrade control module is used to control the overall differential upgrade process, and its main functions include: Initiate the differential upgrade process; Determine if there is any runtime status information that can be used to restore the upgrade process; Based on the assessment results, choose to execute the normal upgrade initialization process or the breakpoint recovery process; Control the execution order and collaboration relationships between various functional modules.

[0058] The streaming data request module is used to request differential patch data from the server based on the current differential upgrade progress, including: Request differential data from the server based on the current compressed block identifier; The number of independent compressed blocks in the compression algorithm is used as the unit of request; It supports multiple requests for differential patch data to achieve streaming acquisition.

[0059] The decompression module is used to decompress the compressed block data acquired via streaming, including: Decompress the received compressed block data in the order of the compressed blocks; The decompressed data is provided to the differential processing module for further processing.

[0060] The differential processing module is used to perform differential processing operations for differential patches, including: Sequentially read the control information from the differential patch; Perform differential data processing, new data processing, and data jump operations based on the control information; During the processing, the offset positions of the new firmware data and the old firmware data are continuously updated.

[0061] The runtime status management module is used to manage runtime status information during the differential upgrade process, including: Maintain the current control information status of differential processing; Maintain the current data offset position of the new firmware and the data offset position of the old firmware; Determine whether the current differential processing progress has reached the preset compression block boundary; Upon reaching the boundary of the compressed block, a save operation of the running status information is triggered.

[0062] The non-volatile memory module is used to store critical information related to the differential upgrade process, including: Stores the compressed header information of the differential patch; Store the current compressed block identifier; Store differential upgrade running status information; Provides data support for recovery of differential upgrades after abnormal power outages or restarts of the equipment.

[0063] The collaboration relationships between modules are as follows: During differential upgrade process: The upgrade control module is responsible for overall process scheduling; The streaming data request module requests compressed block data from the server according to the instructions of the upgrade control module; The decompression module decompresses the requested compressed block data; The differential processing module performs differential operations based on the decompressed data; The operation status management module updates the operation status information in real time during differential processing and triggers status saving when the compression block boundary is reached; The non-volatile storage module persistently stores runtime state information to support breakpoint recovery.

[0064] This application focuses on embedded devices that use differential patching for software upgrades. These devices typically have limited storage and memory resources. The differential patch file is generated using existing differential tools, and its data format remains unchanged during the upgrade process. By recording the key operating states during the differential upgrade process, the application achieves streaming execution of the differential patch and breakpoint recovery after abnormal interruption, effectively solving the upgrade requirements of resource-constrained devices.

[0065] Based on the same inventive concept, this application also provides a differential data streaming processing system for resource-constrained devices, the differential data streaming processing system comprising: a server and a device; The server is configured to generate a differential patch file and provide the compression header information of the differential patch file to the device to initialize the decompression environment of the device; and to receive a request from the device that uses the independent compression blocks defined by the compression algorithm in the differential patch file as the basic processing unit, and send the corresponding compression block data to the device according to the request. The device is used to execute the differential data streaming processing method described in any embodiment of this application.

[0066] Based on the same inventive concept, this application also provides a computer storage medium storing computer-executable instructions, which, when executed by a processor, perform: the differential data streaming processing method as described in any embodiment of this application.

[0067] In this specification, the same or similar parts between the various embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the descriptions of the embodiments described later are relatively simple, and relevant parts can be referred to the descriptions of the foregoing embodiments.

[0068] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A differential data streaming processing method for resource-constrained devices, characterized in that, When applied to the device side, the differential data streaming processing method includes: Step S1: Obtain the compressed header information of the differential patch file from the server and store the compressed header information in a non-volatile storage area to initialize the decompression environment; Step S2: Using the independent compressed blocks defined by the compression algorithm in the differential patch file as the basic processing unit, and requesting data of at least one compressed block from the server according to the current compressed block identifier; Step S3: Decompress the data of the compressed block and read the control block information sequentially from the decompressed data; Step S4: Perform the corresponding differential synthesis operation on the old firmware data according to the control block information to generate a new firmware data block corresponding to the current compression block, and write the new firmware data block into the specified new firmware storage area. Step S5: After completing the processing of the compressed block, update the current compressed block identifier, and repeat steps S2 to S4 until all compressed blocks are processed.

2. The differential data streaming processing method according to claim 1, characterized in that, During the differential synthesis operation, the running status information of the current processing progress is maintained in real time; The operating status information includes at least: the information and processing progress of the current control block, the current differential operation type, the read offset information of the current old firmware data, and the write offset information of the current new firmware data.

3. The differential data streaming processing method according to claim 2, characterized in that, When the preset number of compressed blocks is reached, the running status information and the identifier of the currently processed compressed block are persistently stored in a non-volatile storage area.

4. The differential data streaming processing method according to claim 3, characterized in that, The differential data streaming processing method also includes: resuming interrupted data transmission; When an abnormal interruption occurs, the compression head information, the currently processed compression block identifier, and the running status information are read from the non-volatile storage area; Determine the current compressed block identifier based on the currently processed compressed block identifier; Based on the current compressed block identifier, request the corresponding compressed block data from the server; The compressed block data is decompressed according to the compression header information; Based on the aforementioned operational status information, differential data streaming processing is resumed and continues.

5. The differential data streaming processing method according to claim 1, characterized in that, The compression algorithm includes the bzlib compression algorithm or the zlib compression algorithm; The size of the independent compressed block after compression is not fixed.

6. The differential data streaming processing method according to any one of claims 1-5, characterized in that, The differential data streaming processing method further includes: After all compressed blocks have been processed, request verification information for the new firmware from the server; The new firmware is validated for consistency based on the verification information.

7. A differential data streaming processing device for resource-constrained devices, characterized in that, The differential data streaming processing device includes: An initialization module is used to obtain the compressed header information of the differential patch file from the server and store the compressed header information in a non-volatile storage module to initialize the decompression environment; The streaming data request module is used to request at least one compressed block data from the server based on the current compressed block identifier, using the independent compressed blocks defined by the compression algorithm in the differential patch file as the basic processing unit. The decompression processing module is used to decompress the compressed block data and sequentially read control block information from the decompressed data; The differential processing module is used to perform a corresponding differential synthesis operation on the old firmware data according to the control block information, generate a new firmware data block corresponding to the current compression block, and write the new firmware data block into the specified new firmware storage area. The running status management module is used to maintain the current compressed block identifier and update the current compressed block identifier after the differential processing module completes the processing of the compressed block; The upgrade control module is used to control the streaming data request module, the decompression processing module, the differential processing module, and the running status management module to repeatedly execute the above operations until all compressed blocks are processed.

8. The differential data streaming processing apparatus according to claim 7, characterized in that, The operation status management module is also used to maintain the operation status information of the current processing progress in real time during the differential synthesis operation, and persistently store the operation status information and the currently processed compressed block identifier to the non-volatile storage module when the preset compressed block boundary is reached. The upgrade control module is also used to read the compression header information, the currently processed compression block identifier, and the running status information from the non-volatile storage module when an abnormal interruption occurs; and to control the streaming data request module, the decompression processing module, and the differential processing module to resume and continue executing differential data streaming processing based on the read information.

9. A differential data streaming processing system for resource-constrained devices, characterized in that, The differential data streaming processing system includes: a server and a device; The server is configured to generate a differential patch file and provide the compression header information of the differential patch file to the device to initialize the decompression environment of the device; and to receive a request from the device that uses the independent compression blocks defined by the compression algorithm in the differential patch file as the basic processing unit, and send the corresponding compression block data to the device according to the request. The device is used to execute the differential data streaming processing method as described in any one of claims 1 to 6.

10. A computer storage medium, characterized in that, The computer storage medium stores computer-executable instructions, which, when executed by a processor, perform the differential data streaming processing method as described in any one of claims 1-6.