Software differential upgrading method of acquisition terminal

Differential packets are generated through differential upgrade method and frame-by-frame transmission verification is solved, and the power acquisition terminal upgrade package is reduced in size and slow in transmission speed, achieving the effect of reducing the volume of upgrade package, fast transmission speed and high upgrading efficiency, and is suitable for different old versions of acquisition terminals.

CN120447943APending Publication Date: 2025-08-08QINGDAO ITECHENE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510610555.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-13
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

In the software upgrade of power acquisition terminals, the upgrade package is large in size, slow in transmission speed, and cannot effectively adapt to the upgrade needs of different old versions.

Method used

The differential upgrade method is adopted, and differential packages are generated by comparing new and old version files, transmitting and verifying frame by frame, and patching and updating the acquisition terminal using differential packages, and generating chain patches to support upgrades of different old versions.

Benefits of technology

Significantly reduce the volume of upgraded packets, improve transmission speed, reduce packet loss rate and traffic consumption, improve upgrade efficiency and success rate, and adapt to the upgrade needs of multiple old versions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120447943A_ABST
    Figure CN120447943A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of software upgrading of acquisition terminals, in particular to a software differential upgrading method of an acquisition terminal, which comprises the following steps of: S1, comparing files in new and old versions of software, and generating a differential package according to the file difference; s2, transmitting the differential packets frame by frame and verifying the differential packets; s3, patching and updating all the to-be-updated files on the acquisition terminal by using the differential package; and S4, completing upgrading of the acquisition terminal. According to the invention, the volume of the upgrade package is greatly reduced from the MB level to the KB level; the transmission speed is high, and the packet loss rate and the traffic consumption are effectively reduced; chained patches are generated for software of different old versions, and the same patch chain is supported to be used on acquisition terminals of different old versions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of acquisition terminal software upgrade, and in particular to a software differential upgrade method for an acquisition terminal. Background Art

[0002] In the power industry's data collection terminals, the size of APPs is gradually increasing and requires frequent updates. However, after stable operation, the changes in each update are often very small. Currently, there are two ways to upgrade data collection terminals: (1) full upgrade, that is, completely updating the kernel and all APPs. However, the upgrade package of this method is too large. Even after compression, it takes 200MB-300MB to complete the upgrade. The file transfer speed is slow and cannot be resumed after interruption. (2) Only upgrade applications and files with major changes. However, under typical working conditions, such as when upgrading 5 APPs, the upgrade package is still about tens of MB. Currently, there is a method in other fields to perform binary differential on APP files before upgrading, but this method is not suitable for power collection terminal upgrades, and the differential effect of compressed files is poor. Summary of the Invention

[0003] The present invention aims to solve the above problems and provides a software differential upgrade method for an acquisition terminal. The technical solution adopted is as follows: A software differential upgrade method for an acquisition terminal comprises the following steps: S1. Compare the files in the new and old versions of the software and generate a differential package based on the file differences; S2. Transmit differential packets frame by frame and perform verification; S3. Use the differential package to patch all files to be updated on the acquisition terminal; S4. The acquisition terminal completes the upgrade.

[0004] Based on the above solution, step S1 includes: S1.1. Obtain the complete upgrade package for both the old and new versions of the software; S1.2. Unpack the complete upgrade packages for both the old and new versions of the software; S1.3. Decompress and unpack the unpacked APP installation package; S1.4. Compare the unpacked and decompressed files one by one with the old and new versions, and generate patch files based on the differences between the old and new versions. S1.5. For the APP installation package, generate the signature information to be attached to the device after packaging based on the APP installation package in the new version complete upgrade package; S1.6. Compress the patch file, patch operation script, and upgrade operation script to generate a differential package.

[0005] Based on the above scheme, step S1.4 includes, S1.4.1. Determine whether the file type is an executable file. If so, execute steps S1.4.2.a-S1.4.2.e. If not, execute steps S1.4.3.a-S1.4.3.b. S1.4.2.a. Analyze the file format and parse the offset and length information corresponding to each component; S1.4.2.b. Remove information from segments not relevant to the operation; S1.4.2.c. Align each segment; S1.4.2..d. Compare the new and old versions of the corresponding files based on the storage structure of instructions, data, and relocation information within the segment; S1.4.2.e. Record the starting location, type, and content of each difference and store them in a temporary file. S1.4.3.a. Traverse the files and compare the contents of the corresponding files in the new and old versions; S1.4.3.b. Record the starting location, type, and content of each difference and store them in a temporary file. S1.4.4. Categorize the differences stored in the temporary file and generate patch files based on the differences. S1.4.5. Compress the patch file.

[0006] Preferably, when there are multiple old versions, steps S1.1 to S1.5 are repeated for each old version to generate a chain patch.

[0007] Preferably, the step S2 includes: S2.1. Send the upgrade file frame by frame; S2.2. Read the file transfer mask to determine whether the acquisition terminal has received all frames; if there are missing frames, execute step S2.3; if all frames have been received, execute step S2.4; S2.3. Resend missing frames; S2.4. Perform an integrity check on the file; if the check is successful, enter the upgrade process and execute step S3; if the check is unsuccessful, repeat step S2.1.

[0008] Preferably, the step S3 includes: S3.1. Decompress the differential packet; S3.2. Read the version of the software running on the acquisition terminal and extract the patches for all files in the differential package that correspond to the running version; S3.3. Obtain all files that need to be updated by the acquisition terminal provider; S3.4. Patch all files one by one; S3.5. Perform integrity checks on each patched file. S3.6. For the app files, compress and package the patched executable files, library files, and configuration files to generate an app installation package and attach the signature information. S3.7. Create a complete new version software upgrade package by combining the patched files and the generated app installation package. S3.8. Use the new version software upgrade package to complete the software upgrade of the acquisition terminal.

[0009] A software differential upgrade method for an acquisition terminal, applied to the acquisition terminal, comprises the following steps: A1. Receive and verify the differential packet from the master station frame by frame. The differential packet is generated by comparing the files in the new and old versions of the software and for file differences; A2. Use the differential package to patch all files to be updated; A3. Upgrade completed.

[0010] Based on the above solution, the steps to generate differential packets include: A1.1.1. Obtain the complete upgrade package for both the old and new versions of the software; A1.1.2. Unpack the complete upgrade packages for both the old and new versions of the software; A1.1.3. Decompress and unpack the unpacked app installation package; A1.1.4. Compare the decompressed and unpacked files one by one with the old and new versions, and generate patch files based on the differences between the old and new versions. A1.1.5. For the app installation package, generate the signature information to be attached to the device after packaging based on the app installation package in the new version complete upgrade package; A1.1.6. Compress the patch file, patching script, and upgrade script to generate a differential package.

[0011] Based on the above solution, when there are multiple old versions, steps A1.1.1-A1.1.5 are repeated for each old version to generate a chain patch.

[0012] Preferably, the step A2 includes: A2.1. Decompress the differential package; A2.2. Read the version of the software running on the acquisition terminal and extract the patches for all files in the differential package that correspond to the running version; A2.3. Obtain all files that need to be updated by the acquisition terminal provider; A2.4. Patch all files one by one; A2.5. Perform integrity checks on each patched file. A2.6. For app files, compress and package the patched executable files, library files, and configuration files to generate an app installation package and attach the signature information. A2.7. Combine the patched files and the generated app installation package to create a complete new version software upgrade package. A2.8. Use the new version software upgrade package to complete the software upgrade of the acquisition terminal.

[0013] The beneficial effects of the present invention are: Significantly reduce the size of the upgrade package, reducing it from tens or hundreds of MB to the KB level. When only a few lines of code are modified, the upgrade package is only about 10KB in size, thereby reducing file transfer pressure and increasing transfer speed. Fast transmission speed, customized optimization and alignment for power communication protocols to improve transmission speed and effectively reduce packet loss rate and traffic consumption; Generate chain patches for different old versions of software, support the use of the same patch chain on different old versions of acquisition terminals, and effectively reduce the size of the chain patch upgrade package, improve transmission speed, upgrade efficiency and upgrade success rate; Compared with other difference patch generation methods, it has high compression rate and fast patch generation and application speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 : A flowchart of a software differential upgrade method for an acquisition terminal disclosed in the present invention; Figure 2 : A schematic diagram of a process for generating a differential packet disclosed in the present invention; Figure 3 : A schematic diagram of a process for generating a patch file disclosed in the present invention; Figure 4 : A schematic diagram of a process of transmitting differential packets frame by frame and verifying the differential packets disclosed in the present invention; Figure 5 : A schematic diagram of a process for patching and updating files to be updated on a collection terminal disclosed in the present invention; Figure 6 : Schematic diagram of the difference between generating chain patches and direct patches disclosed in the present invention. DETAILED DESCRIPTION

[0015] The present invention will be further described below with reference to the accompanying drawings and examples: Example 1 like Figures 1 to 5 As shown, a software differential upgrade method for an acquisition terminal includes the following steps: S1. Compare the files in the new and old versions of the software and generate a differential package based on the file differences; Step S1 includes, S1.1. Get the complete upgrade package of the old and new versions of the software, the complete upgrade package includes the upgrade package identification file header, self-extracting program and a compressed package containing the APP installation package and other files; S1.2. Unpack the complete upgrade packages for both the old and new versions of the software to obtain the app installation package and other files, including script files such as upgrade scripts, maintenance scripts, and database scripts, resource files such as fonts and images, and configuration files such as version configuration and log configuration. S1.3. Decompress and unpack the unpacked APP installation package to obtain executable files, dependent libraries, configuration files, startup and installation management scripts, etc. S1.4. Compare the decompressed and unpacked files one by one with the old and new versions, and generate patch files based on the differences between the new and old versions. Step S1.4 includes, S1.4.1. Determine whether the file type is an executable file. If so, execute steps S1.4.2.a-S1.4.2.e. If not, execute steps S1.4.3.a-S1.4.3.b. S1.4.2.a. Analyze the file format and parse the offset and length information corresponding to each component; S1.4.2.b. Remove information from segments not relevant to the runtime, such as symbol tables and comment sections not used at runtime. S1.4.2.c. Align each segment; S1.4.2..d. Compare the new and old versions of the corresponding files based on the storage structure of instructions, data, and relocation information within the segment; S1.4.2.e. Record the starting location, type, and content of each difference and store them in a temporary file. S1.4.3.a. Traverse the files and compare the contents of the corresponding files in the new and old versions; S1.4.3.b. Record the starting location, type, and content of each difference and store them in a temporary file. S1.4.4. Classify the differences stored in the temporary file according to starting location, type, and difference content, and generate patch files based on these categories; S1.4.5. Compress patch files to further reduce transmission size; S1.5. For the APP installation package, generate the signature information to be attached to the device after packaging based on the APP installation package in the new version complete upgrade package; S1.6. Compress the patch file, patch operation script, and upgrade operation script to generate a differential package.

[0016] Preferably, when there are multiple old versions, steps S1.1 to S1.5 are repeated for each old version to generate a chain patch.

[0017] There are two upgrade options for differential upgrades across multiple versions: chain upgrade and direct upgrade. For example, if you upgrade from V1.0 to V2.0, there are two intermediate versions, V1.1 and V1.2. The methods for generating patches through chain upgrade and direct upgrade are as follows: Figure 6 It should be noted that the size of the upgrade package in the figure is for reference only and may differ from the actual size of the upgrade package.

[0018] For devices that can connect to the public network and have their own master station, you can request the corresponding direct patch based on the version number. In this case, the direct patch will be smaller. A direct upgrade from V1.0 to V2.0 only requires direct patch 1 (2MB), while a chain upgrade requires chain patch 1 + chain patch 2 + chain patch 3 (1MB + 1MB + 1MB = 3MB).

[0019] However, for acquisition terminals, chain patching is more suitable. This is because acquisition terminals cannot connect to the public network, and the master station directly issues a unified upgrade package, preventing the issuance of different direct patches based on version. In this case, all patches from V1.0 to V2.0 need to be installed into the same upgrade file so that the upgrade file can be applied to all terminals with software versions between V1.0 and V2.0. In this case, a direct patch requires direct patch 1 + direct patch 2 + direct patch 3 (2MB + 1.5MB + 1MB = 4.5MB), while a chain patch only requires chain patch 1 + chain patch 2 + chain patch 3 (1MB + 1MB + 1MB = 3MB). In the actual upgrade process, chain patch packages are smaller, so using chain patching can effectively reduce the size of the upgrade packages issued by the master station, thereby improving transmission speed and upgrade success rate.

[0020] S2. Transmit differential packets frame by frame and perform verification; The step S2 includes: S2.1. Send the upgrade file frame by frame via the power communication protocol (such as DLT698.45); S2.2. After the download is completed, read the file transfer mask to determine whether the acquisition terminal has received all frames; if there is a missing, execute step S2.3; if all frames are received, execute step S2.4; S2.3. Resend missing frames, reducing transmission pressure and improving file transmission accuracy by resending them frame by frame; S2.4. Perform an integrity check on the file; if the check is successful, enter the upgrade process and execute step S3; if the check is unsuccessful, repeat step S2.1.

[0021] S3. Use the differential package to patch all files to be updated on the acquisition terminal; The step S3 includes: S3.1. Decompress the differential packet; S3.2. Read the version of the software running on the acquisition terminal and extract the patches for all files in the differential package that correspond to the running version; S3.3. Obtain all files that need to be updated by the acquisition terminal provider; S3.4. Patch all files one by one; S3.5. Perform integrity checks on each patched file, using methods including but not limited to MD5 or SHA checksums. S3.6. For the app files, compress and package the patched executable files, library files, and configuration files to generate an app installation package and attach the signature information. S3.7. Create a complete new version software upgrade package by combining the patched files and the generated app installation package. S3.8. Use the new version software upgrade package to complete the software upgrade of the acquisition terminal.

[0022] S4. The acquisition terminal completes the upgrade.

[0023] Example 2 A software differential upgrade method for an acquisition terminal, applied to the acquisition terminal, comprises the following steps: A1. Receive and verify the differential packet from the master station frame by frame. The differential packet is generated by comparing the files in the new and old versions of the software and for file differences; The steps to generate a differential package include: A1.1.1. Obtain the complete upgrade package for both the old and new versions of the software; A1.1.2. Unpack the complete upgrade packages for both the old and new versions of the software; A1.1.3. Decompress and unpack the unpacked app installation package; A1.1.4. After decompression and unpacking, compare the old and new versions one by one, and generate a patch file for the differences between the old and new versions; the patch file is generated in the same way as in step S1.4 of Example 1; A1.1.5. For the app installation package, generate the signature information to be attached to the device after packaging based on the app installation package in the new version complete upgrade package; A1.1.6. Compress the patch file, patching script, and upgrade script to generate a differential package.

[0024] Preferably, when there are multiple old versions, steps A1.1.1-A1.1.5 are repeated for each old version to generate a chain patch.

[0025] The steps of receiving and checking differential packets frame by frame include: A1.2.1. Send the upgrade file frame by frame via the power communication protocol (such as DLT698.45); After A1.2.2 is sent, read the file transfer mask to determine whether the acquisition terminal has received all frames; if there are missing frames, execute step A1.2.3; if all frames have been received, execute step A1.2.4; A1.2.3. Resend missing frames, reducing transmission pressure and improving file transmission accuracy by resending them frame by frame. A1.2.4. Perform an integrity check on the file; if the check is successful, proceed to the upgrade process and execute step S3; if the check is unsuccessful, repeat step A1.2.1.

[0026] A2. Use the differential package to patch all files to be updated; Said step A2 comprises: A2.1. Decompress the differential package; A2.2. Read the version of the software running on the acquisition terminal and extract the patches for all files in the differential package that correspond to the running version; A2.3. Obtain all files that need to be updated by the acquisition terminal provider; A2.4. Patch all files one by one; A2.5. Perform integrity checks on each patched file. A2.6. For app files, compress and package the patched executable files, library files, and configuration files to generate an app installation package and attach the signature information. A2.7. Combine the patched files and the generated app installation package to create a complete new version software upgrade package. A2.8. Use the new version software upgrade package to complete the software upgrade of the acquisition terminal.

[0027] A3. Upgrade completed.

[0028] The present invention has been described above by way of examples, but the present invention is not limited to the above specific embodiments. Any changes or modifications based on the present invention fall within the scope of protection claimed by the present invention.

Claims

1. A software differential upgrade method for an acquisition terminal, characterized in that: The following steps are included: S1. Compare the files in the new and old versions of the software and generate a differential package based on the file differences; S2. Transmit differential packets frame by frame and perform verification; S3. Use the differential package to patch all files to be updated on the acquisition terminal; S4. The acquisition terminal completes the upgrade.

2. The software differential upgrade method of a data acquisition terminal according to claim 1, characterized in that: Step S1 includes, S1.

1. Obtain the complete upgrade package for both the old and new versions of the software; S1.

2. Unpack the complete upgrade packages for both the old and new versions of the software; S1.

3. Decompress and unpack the unpacked APP installation package; S1.

4. Compare the decompressed and unpacked files one by one with the old and new versions, and generate patch files based on the differences between the new and old versions. S1.

5. For the APP installation package, generate the signature information to be attached to the device after packaging based on the APP installation package in the new version complete upgrade package; S1.

6. Compress the patch file, patch operation script, and upgrade operation script to generate a differential package.

3. The software differential upgrade method of a data acquisition terminal according to claim 2, characterized in that: Step S1.4 includes, S1.4.

1. Determine whether the file type is an executable file. If so, execute steps S1.4.2.a-S1.4.2.e. If not, execute steps S1.4.3.a-S1.4.3.b. S1.4.2.a. Analyze the file format and parse the offset and length information corresponding to each component; S1.4.2.b. Remove information from segments not relevant to the operation; S1.4.2.c. Align each segment; S1.4.2..d. Compare the new and old versions of the corresponding files based on the storage structure of instructions, data, and relocation information within the segment; S1.4.2.e. Record the starting location, type, and content of each difference and store them in a temporary file. S1.4.3.a. Traverse the files and compare the contents of the corresponding files in the new and old versions; S1.4.3.b. Record the starting location, type, and content of each difference and store them in a temporary file. S1.4.

4. Categorize the differences stored in the temporary file and generate patch files based on the differences. S1.4.

5. Compress the patch file.

4. The software differential upgrade method of a data acquisition terminal according to claim 2, characterized in that: When there are multiple old versions, steps S1.1 to S1.5 are repeated for each old version to generate a chain patch.

5. The software differential upgrade method of a data acquisition terminal according to claim 1, characterized in that: The step S2 includes: S2.

1. Send the upgrade file frame by frame; S2.

2. Read the file transfer mask to determine whether the acquisition terminal has received all frames; If there is a missing frame, execute step S2.3; if all frames are received, execute step S2.4; S2.

3. Resend missing frames; S2.

4. Perform an integrity check on the file; if the check is successful, enter the upgrade process and execute step S3; if the check is unsuccessful, repeat step S2.

1.

6. The software differential upgrade method of a data acquisition terminal according to claim 1, characterized in that: The step S3 includes: S3.

1. Decompress the differential packet; S3.

2. Read the version of the software running on the acquisition terminal and extract the patches for all files in the differential package that correspond to the running version; S3.

3. Obtain all files that need to be updated by the acquisition terminal provider; S3.

4. Patch all files one by one; S3.

5. Perform integrity checks on each patched file. S3.

6. For the app files, compress and package the patched executable files, library files, and configuration files to generate an app installation package and attach the signature information. S3.

7. Create a complete new version software upgrade package by combining the patched files and the generated app installation package. S3.

8. Use the new version software upgrade package to complete the software upgrade of the acquisition terminal.

7. A software differential upgrade method for an acquisition terminal, characterized in that: Applied to the acquisition terminal, including the following steps: A1. Receive and verify the differential packet from the master station frame by frame. The differential packet is generated by comparing the files in the new and old versions of the software and for file differences; A2. Use the differential package to patch all files to be updated; A3. Upgrade completed.

8. The method for upgrading the software differential of an acquisition terminal according to claim 7, characterized in that: The steps to generate a differential package include: A1.1.

1. Obtain the complete upgrade package for both the old and new versions of the software; A1.1.

2. Unpack the complete upgrade packages for both the old and new versions of the software; A1.1.

3. Decompress and unpack the unpacked app installation package; A1.1.

4. Compare the decompressed and unpacked files one by one with the old and new versions, and generate patch files based on the differences between the old and new versions. A1.1.

5. For the app installation package, generate the signature information to be attached to the device after packaging based on the app installation package in the new version complete upgrade package; A1.1.

6. Compress the patch file, patching script, and upgrade script to generate a differential package.

9. The method for upgrading the software differential of an acquisition terminal according to claim 8, characterized in that: When there are multiple old versions, repeat steps A1.1.1-A1.1.5 for each old version and generate a chain patch.

10. The method for differential software upgrade of a data acquisition terminal according to claim 7, characterized in that: Said step A2 comprises: A2.

1. Decompress the differential package; A2.

2. Read the version of the software running on the acquisition terminal and extract the patches for all files in the differential package that correspond to the running version; A2.

3. Obtain all files that need to be updated by the acquisition terminal provider; A2.

4. Patch all files one by one; A2.

5. Perform integrity checks on each patched file. A2.

6. For app files, compress and package the patched executable files, library files, and configuration files to generate an app installation package and attach the signature information. A2.

7. Combine the patched files and the generated app installation package to create a complete new version software upgrade package. A2.

8. Use the new version software upgrade package to complete the software upgrade of the acquisition terminal.