OTA differential upgrading method, terminal, OTA server and system

By negotiating the target matching zone number between the terminal and the OTA server to generate a differential upgrade package, the problem of existing OTA differential upgrades being unable to upgrade across versions is solved, thereby improving the upgrade success rate and reducing storage and network costs.

CN121635941APending Publication Date: 2026-03-10CHINA MOBILE M2M +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-05
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing OTA differential upgrade technology cannot support upgrades across multiple versions and requires direct reliance on older versions of the program, resulting in a high risk of upgrade failure.

Method used

When a new version of the program is detected on the terminal, the old version of the program is divided into multiple blocks of data, strong and weak digest values ​​are calculated to construct a hash check list, and the target matching zone number is negotiated with the OTA server to generate a differential upgrade package, without directly relying on the old version file.

Benefits of technology

It enables upgrades across multiple versions, reduces the storage burden on OTA servers, improves the upgrade success rate, and reduces network bandwidth usage and storage costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121635941A_ABST
    Figure CN121635941A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an OTA differential upgrading method, a terminal, an OTA server and a system.The method comprises the steps that when the terminal detects a new version program, an old version program is divided into block data according to the preset fixed block length, strong and weak digest values are calculated, a hash verification list is generated according to the block number and the strong and weak digest values of all the block data and sent to the OTA server, and the OTA is upgraded according to the hash verification list; and negotiating with the terminal according to the Hash verification list and the stored new version program to obtain a block number of the block data consistent with the new version program and the old version program, namely a target matching area number, and sending the target matching area number to the terminal. And then the terminal sends a differential upgrade package downloading request, so that the OTA server makes a differential upgrade package and sends the differential upgrade package to the terminal, and the terminal performs upgrade according to the differential upgrade package. The OTA server can generate the differential upgrade package only according to the new version program and the Hash verification list sent by the terminal, does not depend on the old version program directly, does not need to transmit a complete upgrade package, and supports cross-version upgrade.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of Internet of Things, and particularly relates to an OTA differential upgrade method, a terminal, an OTA server, a system, a device, a computer readable storage medium and a computer program product. BACKGROUND

[0002] OTA (Over the Air Technology) is a technology for updating and upgrading the firmware of a device through a wireless network or the Internet. At present, full upgrade and differential upgrade are mainly used in OTA upgrade. Although differential upgrade reduces the occupation of flash space, it requires the system to accurately track and manage all published versions and their differences. If the version management is chaotic or the old version file is lost, the differential upgrade may fail, and the differential upgrade can only be upgraded from a specific old version to a new version, and does not support cross-version upgrade. SUMMARY

[0003] The embodiments of the present application provide an OTA differential upgrade method, a terminal, an OTA server, a system, a device, a computer readable storage medium and a computer program product, which can support cross-version upgrade and do not directly depend on the old version program, thereby improving the success rate of differential upgrade.

[0004] In a first aspect, the embodiments of the present application provide an OTA differential upgrade method applied to a terminal, which comprises the following steps. In the case that the terminal detects a new version program, the old version program is divided into a plurality of block data according to a preset fixed block length, and the strong digest value and the weak digest value of each block data are calculated, and a hash check list is constructed based on the block number of the block data and the strong digest value and the weak digest value corresponding to the block data; The hash check list is sent to an over-the-air technology (OTA) server, so that the OTA server obtains a target matching area number through negotiation with the terminal based on the hash check list and the new version program stored in the OTA server for a preset number of times, wherein the target matching area number is the block number of the block data consistent between the new version program and the old version program; The target matching area number sent by the OTA server is received, and an upgrade package download request is sent to the OTA server, so that the OTA server generates a differential upgrade package based on the target matching area number in the upgrade package download request and the new version program; The differential upgrade package sent by the OTA server is received, an upgrade package data is generated based on the differential upgrade package, the target matching area number and the old version program, and the upgrade is performed based on the upgrade package data.

[0005] In a second aspect, an embodiment of the present application provides an OTA differential upgrade method applied to a server, comprising: receiving a hash check list sent by the terminal, the hash check list being constructed by the terminal based on a block number of each block data, and a strong digest value and a weak digest value corresponding to the block data, wherein the terminal splits the old version program into a plurality of block data according to a preset fixed block length, and calculates the strong digest value and the weak digest value of each block data when detecting the new version program; performing negotiation with the terminal based on the hash check list and the new version program stored in the OTA server for a preset number of times to obtain a target matching area number, wherein the target matching area number is a block number of the block data consistent between the new version program and the old version program; sending the target matching area number to the terminal, so that the terminal generates an upgrade package download request based on the target matching area number, and sends the upgrade package download request to the OTA server; generating a differential upgrade package based on the target matching area number in the upgrade package download request and the new version program; sending the differential upgrade package to the terminal, so that the terminal generates upgrade package data based on the differential upgrade package, the target matching area number and the old version program, and performs upgrade based on the upgrade package data.

[0006] In a third aspect, an embodiment of the present application provides an OTA differential upgrade method applied to a system, comprising: when the terminal detects a new version program, the terminal splits an old version program into a plurality of block data according to a preset fixed block length, and calculates a strong digest value and a weak digest value of each block data, and constructs a hash check list based on a block number of the block data, and the strong digest value and the weak digest value corresponding to the block data; the terminal sends the hash check list to an OTA server; the OTA server performs negotiation with the terminal based on the hash check list and the new version program stored in the OTA server for a preset number of times to obtain a target matching area number, wherein the target matching area number is a block number of the block data consistent between the new version program and the old version program; the terminal receives the target matching area number sent by the OTA server, and generates an upgrade package download request based on the target matching area number, and sends the upgrade package download request to the OTA server; the OTA server generates a differential upgrade package based on the target matching area number in the upgrade package download request and the new version program; the terminal receives the differential upgrade package sent by the OTA server; the terminal generates upgrade package data based on the differential upgrade package, the target matching area number and the old version program, and performs upgrade based on the upgrade package data.

[0007] In a fourth aspect, an embodiment of the present application provides a terminal for OTA differential upgrade, which comprises: a building module, configured to, in the case that the terminal detects a new version program, segment an old version program into a plurality of block data according to a preset fixed block length, calculate a strong digest value and a weak digest value of each block data, and build a hash check list based on the block number of the block data and the strong digest value and the weak digest value corresponding to the block data; a sending module, configured to send the hash check list to an OTA server, so that the OTA server obtains a target matching area number by negotiating with the terminal a preset number of times based on the hash check list and a new version program stored by the OTA server, wherein the target matching area number is the block number of the block data consistent between the new version program and the old version program; a receiving module, configured to receive the target matching area number sent by the OTA server; the sending module is further configured to send an upgrade package download request to the OTA server, so that the OTA server generates a differential upgrade package based on the target matching area number in the upgrade package download request and the new version program; the receiving module is further configured to receive the differential upgrade package sent by the OTA server; an upgrading module, configured to generate upgrade package data based on the differential upgrade package, the target matching area number and the old version program, and perform upgrading based on the upgrade package data.

[0008] In a fifth aspect, an embodiment of the present application provides a server for OTA differential upgrade, which comprises: a receiving module, configured to receive a hash check list sent by a terminal, wherein the hash check list is built by the terminal in the case that the terminal detects a new version program, the terminal segments an old version program into a plurality of block data according to a preset fixed block length, calculates a strong digest value and a weak digest value of each block data, and builds the hash check list based on the block number of the block data and the strong digest value and the weak digest value corresponding to the block data; a negotiating module, configured to obtain a target matching area number by negotiating with the terminal a preset number of times based on the hash check list and a new version program stored by the OTA server, wherein the target matching area number is the block number of the block data consistent between the new version program and the old version program; a sending module, configured to send the target matching area number to the terminal, so that the terminal generates an upgrade package download request based on the target matching area number and sends the upgrade package download request to the OTA server; a generating module, configured to generate a differential upgrade package based on the target matching area number in the upgrade package download request and the new version program; the sending module is further configured to send the differential upgrade package to the terminal, so that the terminal generates upgrade package data based on the differential upgrade package, the target matching area number and the old version program, and performs upgrading based on the upgrade package data.

[0009] In a sixth aspect, an embodiment of the present application provides an OTA differential upgrade system, which comprises the terminal according to the fourth aspect and the OTA server according to the fifth aspect.

[0010] In a seventh aspect, an embodiment of the present application provides an OTA differential upgrade device, which comprises a processor and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement the OTA differential upgrade method according to the first aspect or the second aspect.

[0011] In an eighth aspect, an embodiment of the present application provides a computer readable storage medium, which stores computer program instructions; the computer program instructions are executed by a processor to implement the OTA differential upgrade method according to the first aspect or the second aspect.

[0012] In a ninth aspect, an embodiment of the present application provides a computer program product, which comprises a computer program; the computer program is executed by a processor to implement the OTA differential upgrade method according to the first aspect or the second aspect.

[0013] The OTA differential upgrade method, the terminal, the OTA server, the system, the device, the computer readable storage medium and the computer program product provided by the embodiments of the present application can divide the old version program in the terminal into a plurality of block data by a preset fixed block length when the terminal detects a new version program, then calculate a pair of strong and weak digest values of each block data respectively, and generate a hash check list according to the block number of each block data and the corresponding pair of strong and weak digest values, and then send the hash check list to the OTA server. The OTA server can perform data negotiation with the terminal for a preset number of times according to the received hash check list and the stored new version program, so as to obtain the block number of the block data consistent with the new version program in the old version program, that is, the target matching area number and send it to the terminal. Then the terminal sends a differential upgrade package download request, so that the OTA server can make a differential upgrade package based on the differential upgrade package download request and send it to the terminal, and the terminal can perform version program upgrade according to the differential upgrade package. It can be seen that, by using the method in the embodiments of the present application, the OTA server can generate a differential upgrade package based on the hash check list generated by the terminal based on the old version program in the terminal and the stored new version program, without directly relying on the old version file, without transmitting the completed upgrade package, and supporting cross-version upgrade. BRIEF DESCRIPTION OF DRAWINGS

[0014] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments of the present invention will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0015] Figure 1 This is a flowchart illustrating a method for OTA differential upgrade applied to a terminal, provided by an embodiment of the present invention. Figure 2 This is a diagram illustrating the block division of the new version of the program; Figure 3 This is a diagram illustrating the build process of the upgrade package; Figure 4 This is a flowchart illustrating a method for OTA differential upgrade applied to an OTA server, provided by an embodiment of the present invention. Figure 5 This is a schematic diagram of an OTA differential upgrade method applied to a system according to an embodiment of the present invention; Figure 6 This is a schematic diagram of the structure of a terminal for OTA differential upgrade according to an embodiment of the present invention; Figure 7 This is a schematic diagram of the structure of an OTA server for OTA differential upgrade according to an embodiment of the present invention; Figure 8 This is a schematic diagram of the hardware structure of an OTA differential upgrade device provided in an embodiment of the present invention. Detailed Implementation

[0016] The features and exemplary embodiments of various aspects of the present invention will now be described in detail. To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are merely intended to explain the present invention and not to limit the present invention. For those skilled in the art, the present invention can be practiced without some of these specific details. The following description of the embodiments is merely to provide a better understanding of the present invention by illustrating examples of the invention.

[0017] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.

[0018] OTA (Over-The-Air) technology allows device manufacturers to remotely push new firmware versions to users after the devices have been deployed, fixing vulnerabilities, adding new features, or improving performance, thereby increasing user satisfaction. Existing firmware upgrade methods mainly include full upgrades and differential upgrades. A full upgrade involves transferring the complete software package or system image file from a server to the user's device, directly replacing the old version on the device. The advantage of this method is its simplicity and directness; it eliminates the need to consider version differences and compatibility issues, ensuring that the upgraded software or system is in the latest and most complete state. It is often used for applications that are not frequently updated or have minor updates. However, full upgrades require significant flash space to store the upgrade package, and because the complete upgrade package is exposed on the network, it not only consumes bandwidth and takes a long time to download, but also increases the risk of data leakage. Furthermore, it may allow others to intercept and tamper with the upgrade package content, posing a potential security threat to the user's device. Differential upgrade is a more efficient and resource-saving upgrade method. It analyzes the differences between the old and new versions, transmits only these difference data to the user's terminal device, and applies this difference data to the old version on the terminal device to generate the new version. It is commonly used for software or systems that require frequent updates and large amounts of content to be updated. While differential upgrade can reduce the size of the upgrade package, it requires maintaining difference files for multiple versions, and cannot create an upgrade package without the old version files. Furthermore, it does not support upgrades across multiple versions. Therefore, an improved method is needed to reduce the size of the upgrade package and enable cross-version upgrades without directly relying on the old version files. To address the problems of the prior art, this invention provides an OTA differential upgrade method, terminal, OTA server, system, device, computer-readable storage medium, and computer program product. When the terminal detects a new version of the program, it divides its stored old version of the program into blocks. Based on the block numbers of the divided block data and a pair of strong and weak digest values, it generates a hash checklist and sends it to the OTA server. Then, the OTA server negotiates with its stored new version of the program a preset number of times based on this hash checklist to obtain the block numbers of the block data in the old version of the program that do not need to be upgraded, i.e., the target matching area number. Subsequently, the OTA server can generate a differential upgrade package based on the target matching zone number and the new version of the program and send it to the terminal.As can be seen, in this embodiment of the invention, the terminal only needs to generate a hash verification list based on its old version program and send it to the OTA server. The OTA server can generate a differential upgrade package based on the new version program and the hash verification list. On the one hand, the OTA server only needs to store one new version program, which greatly reduces the storage burden. On the other hand, it does not limit which version of the program file is stored in the OTA server, so it can support upgrades across multiple versions. Furthermore, the terminal does not need to upload the old version program to the OTA server, so it does not need to directly depend on a specific old version program, thus improving the upgrade success rate.

[0019] The following section first introduces an OTA differential upgrade method provided by an embodiment of the present invention.

[0020] Figure 1 This diagram illustrates a flowchart of an OTA differential upgrade method for a terminal according to an embodiment of the present invention. Figure 1 As shown, the method may include the following steps: Step 110: When the terminal detects a new version of the program, the old version of the program is divided into multiple blocks of data according to a preset fixed block length. The strong digest value and weak digest value of each block of data are calculated. A hash verification list is constructed based on the block number of the block of data and the strong digest value and weak digest value corresponding to the block of data.

[0021] The old version program refers to the program data currently in use on the terminal, while the new version program refers to the upgraded version of the aforementioned old version. The new version program is not necessarily the latest version; it only needs to be newer than the old version. The aforementioned program can be the terminal's operating system or an application (APP) installed on the terminal. When the program developer uploads the complete firmware package, direct access link, or metadata corresponding to the new version program to the OTA server, they can assess the magnitude of the version change, such as small, minor, large, or significant, and set the initial fixed block length k based on the magnitude of the version change. The relationship between the version change magnitude and the initial fixed block length is as follows: as the version change magnitude increases, the initial fixed block length decreases. After the initial fixed block length is set, it can be sent to the terminal by the server when the terminal detects the new version program.

[0022] When the terminal launches the version program and detects a new version that needs upgrading, it will divide the local old version program into a series of fixed-size blocks according to the previously set initial fixed block length, and number the blocks. It can be understood that, except for the last block, which may be shorter than the fixed block length, the length of the remaining blocks is equal to the fixed block length.

[0023] The block numbering information can include the splitting round and the block's position in the old version of the program. For example, if this is the first split, dividing the data into 4 blocks based on the actual data length of the old version, then the block numbers should indicate the splitting round as 1, and each block number should also reflect its position; for example, the block number of an earlier block is lower than the block number of a later block. With this setting, even if there are two or more splitting rounds, the block numbers in different splitting rounds can be distinguished based on the splitting round information indicated in the numbering. For example, if there are 4 blocks after the first split and 6 blocks after the second split, then although the position order of the first 4 blocks after the second split is the same as the 4 blocks after the first split, they can still be effectively distinguished by the splitting round information in the numbering. If there is only one splitting round, the numbering can also be set to only reflect the block's position in the old version of the program. The above is just an example; the block numbering information can be set by the user according to their actual needs.

[0024] A hash value, also called a digest value or hash index, is a small numerical "fingerprint" obtained by compressing data using a hash function. A strong digest value for a block of data is calculated by using the block data as input to a strong digest algorithm, while a weak digest value is calculated by using the block data as input to a weak digest algorithm. Strong digest algorithms can be SHA-2 (Secure Hash Algorithm 2), such as SHA256, while weak digest algorithms can be SHA-1, etc. The calculation process for strong / weak digest values ​​is existing technology, and no specific limitations are made here regarding the choice of strong / weak digest algorithms.

[0025] After a previous version of the program was split, each block of data had a corresponding block number and a set of digest values ​​(strong digest value and weak digest value, respectively). Therefore, a hash check list could be built based on the block number and the corresponding set of digest values ​​of these block data.

[0026] Step 120: Send a hash verification list to the OTA server so that the OTA server can negotiate with the terminal a preset number of times based on the hash verification list and the new version of the program stored on the OTA server to obtain the target matching area number.

[0027] In this embodiment, the new version of the program stored on the OTA server can be the latest version. In this case, the complete firmware package, direct access link, or metadata of the latest version can be stored on the OTA server, which can greatly reduce the storage burden on the OTA server. If the terminal detects that a version update is needed and selects the new version stored on the OTA server as the update version, the terminal will establish communication with the OTA server.

[0028] The target matching region number is the block number of the block data that is consistent between the new and old versions of the program. After receiving the hash check list sent by the terminal, the OTA server can set a pointer for the new version of the program and sequentially search for it. Using the aforementioned preset fixed block length as a unit, it calculates the strong digest value and weak digest value of the new version of the program. In this way, block data of the new and old versions of the program with the same length can be compared using digital "fingerprints" such as strong digest values ​​and weak digest values. It can be understood that the length of the block data whose digest value was last calculated in the new version of the program may not be equal to the preset fixed block length, but by moving the pointer, it can obtain new version block data with the same length as the last block data in the new version of the program whose length is not equal to the preset fixed block length, and then compare the digest values.

[0029] The hash checksum list can use weak digest values ​​as keys. In this case, the OTA server can search the hash checksum list based on the weak digest values ​​of block data in the new version of the program. If a match is found, it means that the first weak digest value of block data A in the hash checksum list is the same as the second weak digest value of block data B in the new version of the program. Then, the strong digest values ​​are further compared. If the first strong digest value of block data A is also the same as the second strong digest value of block data B... This indicates that block data A and block data B are identical and have not been modified; they are considered a matching region, and the block number of block data B in the old version of the program is recorded. Then, the pointer moves forward in preset fixed-length units, continuing to search the data files following the new version of the program and comparing strong and weak digest values. This process is repeated until the end of the file in the new version of the program. The target matching region number is obtained by summing the numbers of all matching regions. It can be understood that the block data in the old version of the program corresponding to the target matching region number does not need to be changed, while the block data in the old version of the program corresponding to non-target matching region numbers needs to be updated.

[0030] The number of negotiations can be one, two, or more. Based on the foregoing, it can be understood that the number of negotiations between the terminal and the OTA server is consistent with the number of times the old version of the program in the terminal is split. That is, when the two only negotiate once, only one split of the old version of the program in the terminal is needed, and so on. Further details are omitted here.

[0031] Step 130: Receive the target matching zone number sent by the OTA server and send an upgrade package download request to the OTA server, so that the OTA server can generate a differential upgrade package based on the target matching zone number and the new version of the program in the upgrade package download request.

[0032] During the negotiation process, the matching area in the new version of the program has been marked, essentially dividing the new version into a matching area and a new area. After negotiation, the terminal records the corresponding matching area address based on the received target matching area number and sends a download request to the OTA server. Based on the target matching area number in the download request, the OTA server can compress and package it together with the data and length from the new area in the new version of the program to construct a differential upgrade package. Since the OTA server only needs to transmit the data from the new area, the size of the upgrade package can be effectively reduced.

[0033] Step 140: Receive the differential upgrade package sent by the OTA server, generate upgrade package data based on the differential upgrade package, the target matching area number and the old version program, and perform the upgrade based on the upgrade package data.

[0034] After receiving the differential upgrade package, the terminal extracts the data and length of the newly added area from it, and extracts the data of the matching area from the old version of the program according to the target matching area number, and together they construct the upgraded new version program file.

[0035] The OTA differential upgrade method provided in this embodiment can be applied to the upgrade process of the operating system of a terminal device, as well as the update process of the application (APP) installed on the terminal device. With the rapid development of technology, terminal devices equipped with easily portable and modular IoT operating systems such as OneOS are increasingly becoming bridges connecting the physical and digital worlds. These terminal devices, ranging from smart homes, smart city infrastructure, and industrial automation control systems to children's watches and electronic student IDs, are constantly expanding and deepening their functional requirements and application scenarios, demanding that the operating system be able to flexibly adapt to changes and quickly respond to the latest market and user needs. For IoT terminal devices equipped with the OneOS operating system, firmware upgrades have become a core driving force for their continuous evolution and maintaining competitiveness. If the terminal detects a new version of the OneOS operating system, the old OneOS operating system within the terminal device establishes a communication connection with the OTA server to complete the negotiation and ultimately achieve the update and upgrade of the OneOS operating system. In summary, this embodiment provides an OTA differential upgrade method. When the terminal detects a new version of the program, the old version is divided into several data blocks using a preset fixed block length. A hash checklist is created based on the block number, strong digest value, and weak digest value of each block and sent to the OTA server. The OTA server compares this hash checklist with the new version to determine the block numbers of the blocks in the old version that do not require upgrading (i.e., the target matching area numbers), which are received by the terminal. The terminal then sends an upgrade package download request to the OTA server to generate a differential upgrade package. The terminal can then receive the differential upgrade package and perform the upgrade. It can be seen that in this process, there is no need to upload the old version of the terminal to the OTA server for comparison; only the block numbers and strong / weak digest values ​​of the old version's block data need to be transmitted, combined with the new version's files, to complete the differential upgrade package. By not directly relying on the old version's program data, this method not only reduces network bandwidth usage to some extent but also lowers the storage costs of the OTA server. This method can be flexibly applied to various terminal devices, such as children's watches, electronic student IDs, smart meters, and shared devices.

[0036] In one embodiment, before dividing the old version of the program into multiple data blocks according to a preset fixed block length, the OTA differential upgrade method may further include: The terminal receives the preset block length negotiated by the OTA server a preset number of times.

[0037] The aforementioned preset block length includes the preset fixed block length. It's worth noting that when the negotiation count is 1, the preset block length is equal to the preset fixed block length, meaning it contains only one length value. When the negotiation count is 2 or more, the preset block length includes the preset fixed block length from the first segmentation, as well as the preset block lengths from the subsequent segmentations, meaning it contains multiple length values. The number of length values ​​remains consistent with the segmentation count in older versions of the program.

[0038] In one embodiment, the hash verification list may include version information, which is used by the OTA server to determine whether the version of the new version of the program stored on the OTA server is consistent with the version information after receiving the hash verification list; if the version of the new version of the program stored on the OTA server is inconsistent with the version information, the version program corresponding to the version information is obtained from the cloud server.

[0039] The version information in this embodiment can be any version that is newer than the old version currently used by the terminal. It is not limited to the latest version. The specific version is determined by the user's selection on the terminal.

[0040] The OTA server selects one of several newer program versions for storage. For example, it can choose to store information related to the latest version, while information for other versions is stored on a cloud server. The information for the latest version can be the complete firmware package. To further reduce storage costs, the complete firmware package can be placed on the cloud server, with only the direct access link or metadata of the latest version stored as relevant information on the OTA server. Other newer versions can be stored on the cloud server at a lower frequency or in compressed form. If the version information in the hash checksum list sent by the terminal matches the latest version stored on the OTA server, direct communication can be established with the OTA server for negotiation. In this case, the preset fixed block length is set by the magnitude of the changes from the older version to the latest version. If they do not match, i.e., the terminal chooses to upgrade to a non-latest version, the OTA server retrieves the non-latest version from the cloud server, effectively replacing the previously stored latest version, and then establishes communication with the terminal. In this case, the preset fixed block length is set by the magnitude of the changes from the older version to the non-latest version, and the negotiation proceeds in the same manner.

[0041] In other words, the OTA server does not need to store multiple newer versions of program data at the same time, and it also eliminates the need to store old version program files on the terminal. Instead, it only stores one newer version of program data, which is replaced when needed. This significantly reduces the storage burden on the OTA server, achieves efficient use of storage resources, and supports the rapid generation of differential upgrade packages between any versions, greatly improving the flexibility and reliability of upgrade operations and accelerating the iteration speed of terminal program products.

[0042] In one embodiment, the terminal sends a hash checklist to the OTA server, which the OTA server uses to negotiate with the terminal a preset number of times based on the hash checklist and a new version of the program stored on the OTA server, including: The terminal sends the i-th generated hash check list to the over-the-air (OTA) update server. The terminal receives the block number, strong digest value, and weak digest value of the block data in the hash check list generated by the OTA server in the i-th time and compares them with the strong digest value and weak digest value of the OTA block number stored in the OTA server to obtain the matching area number in the i-th time, where i≥1; Based on the matching region number of the i-th time, the data in the old version of the program, excluding the matching region number of the i-th time, is divided into multiple blocks according to the preset block length corresponding to the (i+1)-th time. The strong digest value and weak digest value of each block are calculated, and the hash verification list for the (i+1)-th time is constructed based on the block number of the block and the corresponding strong digest value and weak digest value of the block. The preset block length corresponding to the (i+1)-th time is less than or equal to the preset block length corresponding to the i-th time. The terminal sends the (i+1)th hash check list to the OTA server, so that the OTA server can obtain the target matching area number based on the (i+1)th hash check list.

[0043] The following is a detailed explanation of this embodiment, taking the three-way negotiation as an example. In this example, the terminal chooses to upgrade to the latest version of the program, and the latest version of the program is also stored in the OTA server.

[0044] The terminal detects a new version and needs to establish communication with the OTA server. Therefore, based on the preset fixed block length k issued by the OTA server, the original old version program in the terminal is divided into a series of fixed-size first blocks. Except for the last first block, which may be shorter than the preset fixed block length k, the length of the remaining first blocks is equal to the preset fixed block length. After numbering these first blocks, a strong and weak digest pair is calculated for each divided first block and combined with the block number of the old version program's first block to obtain hash checklist 1, which uses the weak digest value as the key.

[0045] The terminal sends hash checklist 1 to the OTA server, enabling the OTA server to set a pointer for the latest version of the program file. This facilitates searching for the latest version of the program in chronological order and calculating the strong and weak digest values ​​of the latest version of the program using k as the length unit. If the weak digest value of a block of data C in the new version of the program is not found in hash checklist 1, or if the first block of data D is found based on the weak digest value but its strong digest value is inconsistent with that of block of data C, it indicates that block of data C in the new version of the program contains differing data. However, block of data C may not necessarily contain only differing data. In this case, to more accurately extract the matching area in the new version of the program during this negotiation process, the pointer does not move directly forward by a preset fixed block length k, but only moves forward by one byte offset, and records the byte corresponding to that offset in the non-matching area, which is the newly added area mentioned above. Then, continue calculating a set of strong and weak digest values ​​for block data E using a preset fixed block length k. Search for the content in hash checklist 1 using the weak digest value. If a content is found, it means that at least one first block data F in the old version program has the same weak digest value as block data E. Furthermore, if the strong digest value of the first block data F also matches the strong digest value of block data E, it indicates that block data E in the new version program is not a newly added area, and the first block data F in the old version program does not need to be modified. Then, record the block number of the first block data F. Continue performing the above comparisons until the entire new version program has been traversed. At this point, the new version program is divided into newly added areas and matching areas. The length of the matching area is always k, except when the length of the last first block data in the old version program is less than k, in which case the length of its corresponding matching area is also less than k and the same as the length of the last first block data. The length of the new region is uncertain. As can be understood from the above, compared to the old version of the program, the new version of the program is not divided all at once during a negotiation process. Instead, it is dynamically divided in a sliding manner based on the actual comparison of strong and weak digest values. There will be cases where bytes are allocated into the new region one by one. Therefore, the length of the new region is uncertain.

[0046] Based on the above steps, the matching area number after the first negotiation can be obtained. After receiving the matching area number after the first negotiation, the terminal will record the corresponding address of the matching area number in the old version program. Then, according to the preset block length k / 2 corresponding to the second negotiation issued by the OTA server, the data area in the old version program except for the corresponding address of the matching area number in the old version program will be divided to obtain several second blocks of data. Block numbers will be set for each block, and a pair of strong and weak digest values ​​will be calculated to form the hash check list 2 to be used in the second negotiation and sent to the OTA server.

[0047] After receiving the hash check list 2, the OTA server sequentially searches for the newly added area data found in the first negotiation, calculates the strong and weak digest values ​​with a preset block length k / 2, searches the hash check list 2 using the weak digest value, finds the newly added area and matching area in the second negotiation in the same way, records the matching area number corresponding to the second negotiation, and then sends it to the terminal.

[0048] After receiving the second matching zone number, the terminal records the corresponding address of the matching zone number in the old version of the program. According to the preset block length k / 4 of the third negotiation issued by the OTA server, the data area in the old version of the program other than the address corresponding to the matching zone number obtained in the first two times is divided to obtain several third blocks of data. The block numbers are set and a pair of strong and weak digest values ​​are calculated respectively. The hash check list 3 to be used in the third negotiation is sent to the OTA server.

[0049] After receiving hash checklist 3, the OTA server sequentially searches the newly added region data found in the first two negotiations, calculates the strong and weak digest values ​​using a preset block length k / 4, and uses the weak digest value to search hash checklist 3. Following the same method, it finds the newly added region and matching region from the third negotiation, records the matching region number corresponding to the third negotiation, and then sends it to the terminal. At this point, the three negotiations are complete, and the new version of the program has been divided into target newly added regions and target matching regions. Figure 2 The diagram shows the block partitioning of the new version of the program. As can be seen, after three rounds of negotiation, the data area of ​​the newly added region is more precise and detailed, which can reduce the size of subsequent differential upgrade packages.

[0050] After receiving the third matching zone number, the terminal records the corresponding address of the matching zone number in the old version of the program. At this point, the three-way negotiation is complete. The terminal will then summarize the matching zone numbers obtained from the three negotiations to obtain the target matching zone number and send an upgrade package download request to the OTA server.

[0051] After receiving the upgrade package download request, the OTA server will compress and package the data and length of the target new area, as well as the target matching area number, into a differential upgrade package and send it to the terminal.

[0052] like Figure 3The diagram illustrates the construction of the upgrade package. After receiving the differential upgrade package, the terminal parses it, extracting the target new area data and its length sequentially. It then extracts the target matching area data from the old version of the program based on the target matching area number. New block data is constructed using the target new area data and the target matching area data. After reconstructing the new version data of all blocks, the upgraded version program file, i.e., the upgrade package data, is obtained. The terminal can then perform the upgrade based on the upgrade package data. After the upgrade is complete, the terminal can send the upgrade result back to the OTA server, informing the OTA server that the terminal has successfully upgraded.

[0053] In summary, by dynamically sliding the newly added regions in each negotiation and progressively refining the division of these regions across three negotiations, not only is the extraction efficiency of a single negotiation increased, but the extraction accuracy of the new regions is also improved. In other words, by combining three-way negotiation with a binary search algorithm, the block length can be dynamically adjusted to construct highly matching new regions, ensuring high accuracy in matching regions while reducing unnecessary new regions. This effectively reduces the upgrade package size, lowers storage and transmission costs, and shortens the overall upgrade time, minimizing the impact on normal terminal device operation. Furthermore, exchanging only hash checksum lists and matching region numbers during data negotiation, rather than the massive amount of raw data, significantly saves network bandwidth resources. In addition, the streamlined differential upgrade package format ensures low resource consumption, enabling it to adapt to a wider range of terminal devices, demonstrating its broad applicability and strong compatibility.

[0054] In one embodiment, during the process of obtaining the target matching area number through a predetermined number of negotiations between the terminal and the OTA server based on a hash check list and a new version of the program stored on the OTA server, the data is encrypted before transmission.

[0055] To fully guarantee the security and accuracy of data transmission, each interaction's data undergoes meticulous inspection and verification throughout the pre-set number of negotiations and the differential upgrade package download process. This ensures data integrity and accuracy, preventing unauthorized data tampering and providing a robust security guarantee for the negotiation process. During the differential upgrade package download process, each data packet is precisely verified to ensure the downloaded differential upgrade package is complete and error-free.

[0056] In one embodiment, the OTA differential upgrade method may further include the following before upgrading based on upgrade package data: The terminal receives upgrade request information from users, which may include upgrade time; and performs upgrades based on upgrade time and upgrade packages.

[0057] Users can not only freely choose the upgrade version, but this embodiment of the invention also provides users with the option of upgrade time. Such an optimized user experience and feedback mechanism can make the upgrade process more flexible and personalized.

[0058] like Figure 4 As shown in the figure, this embodiment of the invention also provides a method for OTA differential upgrade applied to an OTA server, the method including: Step 410: Receive the hash verification list sent by the terminal.

[0059] The hash check list is a list of hashes that the terminal constructs when it detects a new version of the program. It divides the old version of the program into multiple blocks of data according to a preset fixed block length, calculates the strong digest value and weak digest value of each block of data, and constructs the hash check list based on the block number of the block of data and the corresponding strong digest value and weak digest value of the block of data. Step 420: Based on the hash check list and the new version of the program stored on the OTA server, negotiate with the terminal a preset number of times to obtain the target matching area number.

[0060] The target matching area number is the block number of the block data that is consistent between the new version of the program and the old version of the program.

[0061] Step 430: Send the target matching area number to the terminal so that the terminal can generate an upgrade package download request based on the target matching area code and send the upgrade package download request to the OTA server. Step 440: Generate a differential upgrade package based on the target matching region number in the upgrade package download request and the new version of the program; Step 450: Send a differential upgrade package to the terminal so that the terminal can generate upgrade package data based on the differential upgrade package, the target matching area number and the old version of the program, and perform the upgrade based on the upgrade package data.

[0062] In this embodiment of the invention, the terminal only needs to generate a hash verification list based on its own old version of the program, and the OTA server can obtain the differential upgrade package based solely on the stored new version of the program and the hash verification list. It can be seen that in this embodiment, the OTA server has a lower storage burden, lower transmission costs during negotiation between the OTA server and the terminal, and higher upgrade efficiency.

[0063] In one embodiment, when the preset number of attempts is greater than or equal to 2, the OTA server, based on the hash check list and the new version of the program stored on the OTA server, negotiates with the terminal a preset number of times to obtain the target matching area number, which may include: The OTA server receives the i-th generated hash check list sent by the terminal; The block number, strong digest value, and weak digest value of the block data in the hash check list generated in the i-th time are compared with the strong digest value and weak digest value of the OTA block number stored in the OTA server to obtain the matching area number of the i-th time, where i≥1; The OTA server sends the matching zone number of the i-th time to the terminal, so that the terminal can divide the data in the old version of the program, excluding the matching zone number of the i-th time, into multiple blocks according to the preset block length corresponding to the (i+1)-th time. The terminal calculates the strong digest value and weak digest value of each block and constructs the hash check list of the (i+1)-th time based on the block number of the block and the corresponding strong digest value and weak digest value of the block. The preset block length corresponding to the (i+1)-th time is less than or equal to the preset block length corresponding to the i-th time. The OTA server receives the (i+1)th hash check list sent by the terminal; The OTA server obtains the target matching area number based on the hash check list of the (i+1)th iteration.

[0064] As can be seen in this embodiment, as the number of negotiations increases, the division of the data areas that need to be upgraded in the old version program becomes more detailed, enabling the accurate extraction of data areas that are consistent between the old and new versions of the program, and ultimately achieving an effective reduction in the size of the differential upgrade package.

[0065] In one embodiment, data is encrypted and transmitted during the process of obtaining the target matching area number by negotiating with the terminal a preset number of times based on the hash check list and the new version of the program stored on the OTA server.

[0066] Encrypting data before transmission during each negotiation process ensures data security and prevents data from being tampered with during transmission.

[0067] In one embodiment, the hash verification list may include version information; based on the hash verification list and the new version of the program stored on the OTA server, obtaining the target matching region number through a preset number of negotiations with the terminal may include: Determine whether the version of the new version of the program stored on the OTA server is consistent with the version information. If the version of the new program stored on the OTA server is inconsistent with the version information, the version program corresponding to the version information is obtained from the cloud server. Based on the hash check list and the version program obtained from the cloud server, the target matching area number is obtained by negotiating with the terminal a preset number of times.

[0068] By introducing cloud storage technology, cloud servers can store data for newer versions of the program. When necessary, the cloud server and OTA server can replace the program version, so that the OTA server only needs to store one version of the program file under any circumstances, which can effectively reduce the storage burden of the OTA server.

[0069] In one embodiment, before receiving the hash check list from the receiving terminal, the method may further include: Send a preset block length negotiated a preset number of times to the terminal. The preset block length may include a preset fixed block length.

[0070] The more negotiation rounds, the more length values ​​are included in the preset block length, resulting in a more detailed division of candidate new data regions between the old and new versions of the program. This effectively reduces the size of the differential upgrade package, thereby saving network bandwidth resources. The number of negotiation rounds can be set according to actual conditions or user needs to avoid excessive negotiation rounds leading to low upgrade efficiency.

[0071] This invention also provides a method for OTA differential upgrades applied to a system, the system including a terminal and an OTA server, the method including: When the terminal detects a new version of the program, the terminal divides the old version of the program into multiple blocks of data according to a preset fixed block length, calculates the strong digest value and weak digest value of each block of data, and constructs a hash verification list based on the block number of the block of data and the strong digest value and weak digest value corresponding to the block of data. The terminal sends a hash checklist to the OTA server; The OTA server negotiates with the terminal a preset number of times based on the hash check list and the new version of the program stored on the OTA server to obtain the target matching area number, where the target matching area number is the block number of the block data that is consistent between the new version of the program and the old version of the program. The terminal receives the target matching area number sent by the OTA server, generates an upgrade package download request based on the target matching area number, and sends the upgrade package download request to the OTA server. The OTA server generates a differential upgrade package based on the target matching region number and the new version of the program in the upgrade package download request; The terminal receives the differential upgrade package sent by the OTA server; The terminal generates upgrade package data based on the differential upgrade package, the target matching area number, and the old version of the program, and then performs the upgrade based on the upgrade package data.

[0072] like Figure 5 The diagram illustrates an OTA differential upgrade method for a system according to an embodiment of the present invention. Figure 5In the process, the firmware package of the new version of the program is uploaded to the OTA server. The terminal performs a version check and finds that a new version exists. Then, the terminal establishes communication with the OTA server, negotiates for a preset number of times, divides the files of the new version of the program into a complete distribution of old and new data, and sends a differential upgrade package download request to the OTA server. After receiving the differential upgrade package download request from the terminal device, the OTA server constructs the differential upgrade package and sends it to the terminal. Then, the terminal upgrades its local original old version of the program to the new version using the differential upgrade package. After a successful upgrade, the terminal sends an upgrade result to the OTA server to inform the OTA server that the terminal has been upgraded successfully. If a failure occurs, an upgrade failure result is also sent to the OTA server to facilitate subsequent diagnosis of the cause of the failure and targeted solutions. Either the upgrade is restarted, or the fault location is located and the upgrade is continued. No specific restrictions are made here.

[0073] Figure 6 A schematic diagram of the structure of a terminal for OTA differential upgrade according to an embodiment of the present invention is provided. For example... Figure 6 As shown, the terminal may include: The construction module 610 is used to divide the old version of the program into multiple blocks of data according to a preset fixed block length when the terminal detects a new version of the program, calculate the strong digest value and weak digest value of each block of data, and construct a hash verification list based on the block number of the block of data and the strong digest value and weak digest value corresponding to the block of data.

[0074] The sending module 620 is used to send a hash check list to the OTA server, so that the OTA server can negotiate with the terminal a preset number of times based on the hash check list and the new version of the program stored on the OTA server to obtain the target matching area number.

[0075] The target matching area number is the block number of the block data that is consistent between the new version of the program and the old version of the program.

[0076] The receiving module 630 is used to receive the target matching area number sent by the OTA server.

[0077] The sending module 620 is also used to send an upgrade package download request to the OTA server, so that the OTA server can generate a differential upgrade package based on the target matching area number and the new version program in the upgrade package download request.

[0078] The receiving module 630 is also used to receive differential upgrade packages sent by the OTA server.

[0079] Upgrade module 640 is used to generate upgrade package data based on differential upgrade package, target matching area number and old version program, and to perform upgrade based on upgrade package data.

[0080] In one embodiment, when the preset number of times is greater than or equal to 2, the sending module 620 is further configured to: Send the i-th generated hash checklist to the Over-the-Air (OTA) update server; The receiving OTA server compares the block number, strong digest value, and weak digest value of the block data in the hash check list generated in the i-th time with the strong digest value and weak digest value of the OTA block number stored in the OTA server to obtain the matching area number in the i-th time, where i≥1; Based on the matching region number of the i-th time, the data in the old version of the program, excluding the matching region number of the i-th time, is divided into multiple blocks according to the preset block length corresponding to the (i+1)-th time. The strong digest value and weak digest value of each block are calculated, and the hash verification list for the (i+1)-th time is constructed based on the block number of the block and the corresponding strong digest value and weak digest value of the block. The preset block length corresponding to the (i+1)-th time is less than or equal to the preset block length corresponding to the i-th time. Send the (i+1)th hash check list to the OTA server so that the OTA server can obtain the target matching area number based on the (i+1)th hash check list.

[0081] In one embodiment, an OTA differential upgrade terminal may further include a block length receiving module, used to receive a preset block length negotiated a preset number of times from the OTA server before dividing the old version program into multiple blocks of data according to a preset fixed block length. The preset block length may include a preset fixed block length.

[0082] In one embodiment, an OTA differential upgrade terminal may further include an upgrade request receiving module for receiving user upgrade request information, which may include upgrade time; and upgrade based on upgrade package based on upgrade time.

[0083] Figure 7 A schematic diagram of the structure of an OTA server for OTA differential upgrade according to an embodiment of the present invention is provided, as follows: Figure 7 As shown, the OTA server may include: The receiving module 710 is used to receive the hash verification list sent by the terminal. The hash verification list is a hash verification list that the terminal constructs based on the block number of the block data, the block number of the block data, and the corresponding strong digest value and weak digest value when it detects a new version of the program. The negotiation module 720 is used to negotiate with the terminal a preset number of times to obtain the target matching area number based on the hash check list and the new version of the program stored on the OTA server. The target matching area number is the block number of the block data that is consistent between the new version of the program and the old version of the program. The sending module 730 is used to send the target matching area number to the terminal so that the terminal can generate an upgrade package download request based on the target matching area code and send the upgrade package download request to the OTA server. The generation module 740 is used to generate a differential upgrade package based on the target matching area number and the new version of the program in the upgrade package download request. The sending module 730 is also used to send a differential upgrade package to the terminal, so that the terminal can generate upgrade package data based on the differential upgrade package, the target matching area number and the old version program, and perform an upgrade based on the upgrade package data.

[0084] In one embodiment, when the preset number of iterations is greater than or equal to 2, the negotiation module 720 can also be used for: The received terminal sends the i-th generated hash check list; The block number, strong digest value, and weak digest value of the block data in the hash check list generated in the i-th time are compared with the strong digest value and weak digest value of the OTA block number stored in the OTA server to obtain the matching area number of the i-th time, where i≥1; The terminal sends the matching region number of the i-th time to the terminal so that the terminal can divide the data in the old version of the program, excluding the matching region number of the i-th time, into multiple blocks according to the preset block length corresponding to the (i+1)-th time. The terminal calculates the strong digest value and weak digest value of each block and constructs the hash check list of the (i+1)-th time based on the block number of the block and the corresponding strong digest value and weak digest value of the block. The preset block length corresponding to the (i+1)-th time is less than or equal to the preset block length corresponding to the i-th time. The (i+1)th hash check list sent by the receiving terminal; The target matching region number is obtained based on the hash check list of the (i+1)th iteration.

[0085] In one embodiment, the negotiation module 720 can also be used to encrypt and transmit data during the process of obtaining the target matching area number by negotiating with the terminal a preset number of times based on the hash check list and the new version of the program stored on the OTA server.

[0086] In one embodiment, the negotiation module 720 can also be used for: Determine whether the version of the new version of the program stored on the OTA server is consistent with the version information included in the hash check list; If the version of the new program stored on the OTA server is inconsistent with the version information, the version program corresponding to the version information is obtained from the cloud server. Based on the hash check list and the version program obtained from the cloud server, the target matching area number is obtained by negotiating with the terminal a preset number of times.

[0087] In one embodiment, an OTA server for OTA differential upgrades may further include a block length sending module, used to send a preset block length negotiated a preset number of times to the terminal before dividing the old version program into multiple blocks of data according to a preset fixed block length. The preset block length includes a preset fixed block length.

[0088] This invention also provides an OTA differential upgrade system, which may include the terminal and OTA server described in the above embodiments. This invention further provides an OTA differential upgrade device, which may include: a processor and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement the OTA differential upgrade method applied to a terminal as described in the above embodiments, or the processor reads and executes the computer program instructions to implement the OTA differential upgrade method applied to a server as described in the above embodiments.

[0089] Figure 8 The diagram shows a hardware structure schematic of an OTA differential upgrade device provided by an embodiment of the present invention.

[0090] An OTA differential upgrade device may include a processor 801 and a memory 802 storing computer program instructions.

[0091] Specifically, the processor 801 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of the present invention.

[0092] Memory 802 may include mass storage for data or instructions. For example, and not limitingly, memory 802 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. In one instance, memory 802 may include removable or non-removable (or fixed) media, or memory 802 may be non-volatile solid-state memory. Memory 802 may be internal or external to the integrated gateway disaster recovery device.

[0093] In one embodiment, memory 802 may be read-only memory (ROM). In one instance, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these.

[0094] Memory 802 may include read-only memory (ROM), random access memory (RAM), disk storage media device, optical storage media device, flash memory device, electrical, optical, or other physical / tangible memory storage device. Therefore, generally, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of this disclosure.

[0095] The processor 801 reads and executes computer program instructions stored in the memory 802 to achieve... Figure 1 or Figure 2 The illustrated embodiment presents a method for OTA differential upgrade.

[0096] In one example, an OTA differential upgrade device may further include a communication interface 808 and a bus 804. Wherein, as Figure 8 As shown, the processor 801, memory 802, and communication interface 808 are connected through bus 804 and complete communication with each other.

[0097] The communication interface 808 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of the present invention.

[0098] Bus 804 includes hardware, software, or both, that couples components of an online data traffic metering device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 804 may include one or more buses. While specific buses are described and illustrated in embodiments of the invention, the invention contemplates any suitable bus or interconnect.

[0099] Furthermore, in conjunction with the OTA differential upgrade method described in the above embodiments, this application embodiment can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the OTA differential upgrade methods described in the above embodiments.

[0100] This application also provides a computer program product, including a computer program that, when executed, implements any of the OTA differential upgrade methods described in the above embodiments.

[0101] It should be clarified that the present invention is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of the present invention.

[0102] The functional blocks shown in the above-described structural diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this invention are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, read-only memory (ROM), flash memory, erasable read-only memory (EROM), floppy disks, compact disc read-only memory (CD-ROM), optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0103] It should also be noted that the exemplary embodiments mentioned in this invention describe methods or systems based on a series of steps or apparatus. However, this invention is not limited to the order of the steps described above; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0104] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.

[0105] The above description is merely a specific embodiment of the present invention. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the protection scope of the present invention.

Claims

1. A method for OTA differential upgrade, characterized in that, The method is applied to a terminal and comprises the following steps: In the case that a terminal detects a new version program, the old version program is divided into a plurality of block data according to a preset fixed block length, and a strong digest value and a weak digest value of each block data are calculated, and a hash check list is constructed based on the block number of the block data and the strong digest value and the weak digest value corresponding to the block data; The hash check list is sent to an over-the-air technology (OTA) server, so that the OTA server obtains a target matching area number through negotiation with the terminal based on the hash check list and a new version program stored in the OTA server for a preset number of times, wherein the target matching area number is the block number of the block data consistent between the new version program and the old version program; The target matching area number sent by the OTA server is received, and an upgrade package download request is sent to the OTA server, so that the OTA server generates a differential upgrade package based on the target matching area number in the upgrade package download request and the new version program; The differential upgrade package sent by the OTA server is received, and upgrade package data is generated based on the differential upgrade package, the target matching area number and the old version program, and upgrading is performed based on the upgrade package data.

2. The method of claim 1, wherein, In the case that the preset number of times is greater than or equal to 2, the hash check list is sent to an over-the-air technology (OTA) server, so that the OTA server obtains a target matching area number through negotiation with the terminal based on the hash check list and a new version program stored in the OTA server for a preset number of times, comprising the following steps: The hash check list generated for the i-th time is sent to an over-the-air technology (OTA) server; The i-th matching area number is obtained by comparing the block number, the strong digest value and the weak digest value of the block data in the hash check list generated for the i-th time with the strong digest value and the weak digest value of the OTA block number stored in the OTA server, wherein i≥1; Based on the i-th matching area number, data other than the i-th matching area number in the old version program is divided into a plurality of block data according to a preset block length corresponding to the i+1-th time, and a strong digest value and a weak digest value of each block data are calculated, and an i+1-th hash check list is constructed based on the block number of the block data and the strong digest value and the weak digest value corresponding to the block data; wherein the preset block length corresponding to the i+1-th time is less than or equal to the preset block length corresponding to the i-th time; The i+1-th hash check list is sent to the OTA server, so that the OTA server obtains a target matching area number based on the i+1-th hash check list.

3. The method according to claim 1 or 2, characterized in that, The data is transmitted after being encrypted in the process in which the terminal and the OTA server obtain a target matching area number through negotiation with the terminal based on the hash check list and a new version program stored in the OTA server for a preset number of times.

4. The method of claim 1, wherein, The hash check list comprises version information, so that the OTA server determines whether the version of the new version program stored in the OTA server is consistent with the version of the version information after receiving the hash check list; In the case that the version of the new version program stored in the OTA server is inconsistent with the version of the version information, the version program corresponding to the version information is obtained from the cloud server.

5. The method of claim 1, wherein, Before the upgrading based on the upgrade package data, the method further comprises: receiving the user's upgrade requirement information, the upgrade requirement information comprising an upgrade time; upgrading based on the upgrade package based on the upgrade time.

6. The method of claim 1, wherein, Before the old version program is divided into a plurality of block data according to the preset fixed block length, the method further comprises: receiving the preset block length negotiated for a preset number of times by the OTA server, the preset block length comprising a preset fixed block length.

7. A method of OTA differential upgrade, characterized by, Applied to an OTA server, the method comprises: receiving a hash check list sent by a terminal, the hash check list being constructed by the terminal in the case that a new version program is detected, the old version program being divided into a plurality of block data according to a preset fixed block length, a strong digest value and a weak digest value of each block data being calculated, and the hash check list being constructed based on the block number of the block data and the strong digest value and the weak digest value corresponding to the block data; based on the hash check list and the new version program stored in the OTA server, a target matching area number is obtained through negotiation with the terminal for a preset number of times, wherein the target matching area number is the block number of the block data consistent between the new version program and the old version program; sending the target matching area number to the terminal, so that the terminal generates an upgrade package download request based on the target matching area number and sends the upgrade package download request to the OTA server; generating a differential upgrade package based on the target matching area number in the upgrade package download request and the new version program; sending the differential upgrade package to the terminal, so that the terminal generates an upgrade package data based on the differential upgrade package, the target matching area number and the old version program, and upgrades based on the upgrade package data.

8. The method of claim 7, wherein, In the case that the preset number of times is greater than or equal to 2, the target matching area number is obtained through negotiation with the terminal for a preset number of times based on the hash check list and the new version program stored in the OTA server, comprising: receiving the hash check list generated by the terminal for the i-th time; comparing the block number, the strong digest value and the weak digest value of the block data in the hash check list generated for the i-th time with the strong digest value and the weak digest value of the OTA block number stored in the OTA server, to obtain the matching area number for the i-th time, wherein i≥1; sending the terminal the i-th matching area number for the terminal to divide data in the old version program except the i-th matching area number into a plurality of block data according to a preset block length corresponding to the i+1-th time, and to calculate a strong digest value and a weak digest value of each block data, and to construct an i+1-th hash check list based on the block number of the block data and the strong digest value and the weak digest value corresponding to the block data; wherein the preset block length corresponding to the i+1-th time is less than or equal to the preset block length corresponding to the i-th time; receiving the i+1-th hash check list sent by the terminal; obtaining a target matching area number based on the i+1-th hash check list.

9. The method of claim 7, wherein, In the process of obtaining the target matching area number by negotiating with the terminal for a preset number of times based on the hash check list and the new version program stored in the OTA server, the data is transmitted after being encrypted.

10. The method of claim 7, wherein, The hash check list includes version information; the process of obtaining the target matching area number by negotiating with the terminal for a preset number of times based on the hash check list and the new version program stored in the OTA server includes: determining whether the version of the new version program stored in the OTA server is consistent with the version of the version information; in the case where the version of the new version program stored in the OTA server is inconsistent with the version of the version information, obtaining the version program corresponding to the version information from the cloud server; obtaining the target matching area number by negotiating with the terminal for a preset number of times based on the hash check list and the version program obtained from the cloud server.

11. The method of claim 7, wherein, Before receiving the hash check list sent by the terminal, the method further includes: sending a preset block length negotiated for a preset number of times to the terminal, wherein the preset block length includes a preset fixed block length.

12. A method of OTA differential upgrade, characterized by, The method is applied to a system including a terminal and an OTA server, and includes: in the case where the terminal detects a new version program, the terminal divides an old version program into a plurality of block data according to a preset fixed block length, and calculates a strong digest value and a weak digest value of each block data, and constructs a hash check list based on the block number of the block data and the strong digest value and the weak digest value corresponding to the block data; the terminal sends the hash check list to the OTA server; the OTA server obtains a target matching area number by negotiating with the terminal for a preset number of times based on the hash check list and a new version program stored in the OTA server, wherein the target matching area number is the block number of the block data consistent between the new version program and the old version program; the terminal receives the target matching area number sent by the OTA server, generates an upgrade package download request based on the target matching area number, and sends the upgrade package download request to the OTA server; the OTA server generates a differential upgrade package based on the target matching area number in the upgrade package download request and the new version program; the terminal receives the differential upgrade package sent by the OTA server; The terminal generates upgrade package data based on the differential upgrade package, the target matching area number and the old version program, and performs upgrade based on the upgrade package data.

13. A terminal for OTA differential upgrade, characterized by, The terminal comprises: A construction module, configured to, in a case where the terminal detects a new version program, segment the old version program into a plurality of block data according to a preset fixed block length, calculate a strong digest value and a weak digest value of each block data, and construct a hash check list based on the block number of the block data and the strong digest value and the weak digest value corresponding to the block data; A sending module, configured to send the hash check list to an OTA server, so that the OTA server obtains a target matching area number by negotiating with the terminal a preset number of times based on the hash check list and a new version program stored by the OTA server, wherein the target matching area number is the block number of the block data consistent between the new version program and the old version program; A receiving module, configured to receive the target matching area number sent by the OTA server; The sending module is further configured to send an upgrade package download request to the OTA server, so that the OTA server generates a differential upgrade package based on the target matching area number in the upgrade package download request and the new version program; The receiving module is further configured to receive the differential upgrade package sent by the OTA server; An upgrade module, configured to generate upgrade package data based on the differential upgrade package, the target matching area number and the old version program, and perform upgrade based on the upgrade package data.

14. An OTA server for OTA differential upgrade, characterized in that, The OTA server comprises: A receiving module, configured to receive a hash check list sent by a terminal, wherein the hash check list is constructed by the terminal in a case where the terminal detects a new version program, by segmenting an old version program into a plurality of block data according to a preset fixed block length, calculating a strong digest value and a weak digest value of each block data, and constructing a hash check list based on the block number of the block data and the strong digest value and the weak digest value corresponding to the block data; A negotiation module, configured to obtain a target matching area number by negotiating with the terminal a preset number of times based on the hash check list and a new version program stored by the OTA server, wherein the target matching area number is the block number of the block data consistent between the new version program and the old version program; A sending module, configured to send the target matching area number to the terminal, so that the terminal generates an upgrade package download request based on the target matching area number and sends the upgrade package download request to the OTA server; A generation module, configured to generate a differential upgrade package based on the target matching area number in the upgrade package download request and the new version program; The sending module is further configured to send the differential upgrade package to the terminal, so that the terminal generates upgrade package data based on the differential upgrade package, the target matching area number and the old version program, and performs upgrade based on the upgrade package data.

15. A system for OTA differential upgrade, characterized by, The OTA differential upgrade system comprises the terminal of claim 13 and the OTA server of claim 14.

16. A device for OTA differential upgrade, characterized in that, The device comprises a processor and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement the method for OTA differential upgrade according to any one of claims 1 to 6, or the processor reads and executes the computer program instructions to implement the method for OTA differential upgrade according to any one of claims 7 to 11.

17. A computer readable storage medium characterized by: The computer storage medium stores computer program instructions, and the computer program instructions are executed by the processor to implement the method for OTA differential upgrade according to any one of claims 1 to 6, or the computer program instructions are executed by the processor to implement the method for OTA differential upgrade according to any one of claims 7 to 11.

18. A computer program product, characterised in that, The computer program is executed by the processor to implement the method for OTA differential upgrade according to any one of claims 1 to 6, or the computer program is executed by the processor to implement the method for OTA differential upgrade according to any one of claims 7 to 11.