# US 2024/0201980 A1 · Firmware update method having self-restoration mechanism

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2024/0201980 A1
- Document ID: US20240201980A1
- Status: Published application
- Kind: A1
- Application number: 18/198,421
- Filed: 2023-05-17
- Published: 2024-06-20
- Earliest claimed: 2022-12-15
- Assignees: Suzhou Pankore Integrated Circuit Technology Co. Ltd.
- Applicants: Suzhou PanKore Integrated Circuit Technology Co. Ltd.
- Inventors: JUN-MEI XU; XIAO-DAN XU; XU-LIANG SHEN
- Web page: https://patentgrep.com/patent/US20240201980A1

## CPC

- G06F 8/658: Incremental updates; Differential updates
- G06F 8/65: Updates (security arrangements therefor G06F21/57)
- G06F 11/1433: {during software upgrading}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A firmware update method having a self-restoration mechanism is performed by a terminal device. The firmware update method includes the following steps: downloading a differential upgrade package and a differential restoration package through a communication network channel; performing an upgrade operation to current firmware of the terminal device with the differential upgrade package to upgrade the current firmware to a target firmware, wherein the current firmware is changed into incompletely-upgraded firmware after the upgrade operation starts and before the upgrade operation finishes successfully; and verifying whether the upgrade operation fails, and when the upgrade operation fails, performing a restoration operation to the incompletely-upgraded firmware with the differential restoration package to restore the incompletely-upgraded firmware to the current firmware.

## Claims

### Claim 1

A firmware update method having a self-restoration mechanism and being performed by a server and a terminal device cooperatively, the firmware update method comprising:
using the server to obtain to-be-upgraded firmware that is equal to or equivalent to current firmware of the terminal device, and obtain target firmware;
using the server to perform a first differential operation to the to-be-upgraded firmware based on the target firmware, and thereby generating a differential upgrade package;
using the server to perform a second differential operation to the target firmware based on the to-be-upgraded firmware, and thereby generating a differential restoration package;
using the terminal device to download the differential upgrade package and the differential restoration package through a communication channel;
using the terminal device to perform an upgrade operation to the current firmware of the terminal device with the differential upgrade package so as to upgrade the current firmware to the target firmware, wherein the current firmware is changed into incompletely-upgraded firmware after the upgrade operation starts and before the upgrade operation finishes successfully; and
using the terminal device to verify whether the upgrade operation fails, and when the upgrade operation fails, using the terminal device to perform a restoration operation to the incompletely-upgraded firmware with backup of partial data of the current firmware and/or with the differential restoration package so as to restore the incompletely-upgraded firmware to the current firmware.

### Claim 2 (depends on 1)

The firmware update method of claim 1, wherein the to-be-upgraded firmware is divided into N to-be-upgraded blocks, the N to-be-upgraded blocks are from a first to-be-upgraded block to an Nth to-be-upgraded block in turn, and the N is an integer greater than one; the target firmware is divided into N target blocks, and the N target blocks are from a first target block to an Nth target block; the first differential operation includes a differential operation between each of the N target blocks and the N to-be-upgraded blocks; and the second differential operation includes a differential operation between a Kth to-be-upgraded block and K target block(s), the K is a positive integer not greater than the N, and the K target block(s) is/are from the first target block to a Kth target block.

### Claim 3 (depends on 1)

The firmware update method of claim 1, wherein the current firmware is divided into N blocks, the N blocks are from a first block to an Nth block in turn, each of the N blocks represents firmware data of a storage block, the N is an integer greater than one, and the upgrade operation includes: using the differential upgrade package to upgrade the N blocks in turn.

### Claim 4 (depends on 3)

The firmware update method of claim 3, wherein the upgrade operation includes:
before upgrading a Kth block of the N blocks, setting an upgrade state of the Kth block for a beginning state, wherein the K is a positive integer not greater than the N;
after setting the upgrade state of the Kth block for the beginning state, duplicating data of the Kth block to generate backup of the data of the Kth block;
after generating the backup of the data of the Kth block, setting the upgrade state of the Kth block for a backup state;
after setting the upgrade state of the Kth block for the backup state, using the differential upgrade package to upgrade the Kth block;
when the Kth block is upgraded successfully, setting the upgrade state of the Kth block for a completion state; and
when the Kth block is not upgraded successfully, turning to the restoration operation.

### Claim 5 (depends on 4)

The firmware update method of claim 4, wherein using the differential upgrade package to upgrade the Kth block includes: generating upgraded firmware data of the Kth block according to firmware data relevant to the Kth block and the differential upgrade package; and after generating the upgraded firmware data of the Kth block successfully, overwriting firmware data of the Kth block with the upgraded firmware data of the Kth block.

### Claim 6 (depends on 4)

The firmware update method of claim 4, wherein the restoration operation includes: when the Kth block is not upgraded successfully, performing the restoration operation to the Kth block with the backup of the data of the Kth block.

### Claim 7 (depends on 4)

The firmware update method of claim 4, wherein the K is greater than one, and the restoration operation includes: when the Kth block is not upgraded successfully, performing the restoration operation to K blocks with the backup of the data of the Kth block and the differential restoration package, wherein the K blocks are from the Kth block to the first block.

### Claim 8 (depends on 7)

The firmware update method of claim 7, wherein the restoration operation includes:
checking an upgrade state of each of the K blocks;
when the upgrade state of an Ith block of the K blocks is the backup state, replacing current data of the Ith block with backup of original data of the Ith block, wherein the I is a positive integer not greater than the K; and
when the upgrade state of the Ith block is the completion state, restoring the Ith block with the differential restoration package.

### Claim 9 (depends on 3)

The firmware update method of claim 3, wherein after the upgrade operation starts and before the upgrade operation finishes successfully, if the terminal device reboots, the upgrade operation includes: checking an upgrade state of each of the N blocks and checking whether the N blocks are executed successfully; and when the upgrade state of any of the N blocks is not a completion state or when the terminal device does not run successfully based on present firmware data of the terminal device, turning to the restoration operation.

### Claim 10 (depends on 1)

The firmware update method of claim 1, further comprising:
after the upgrade operation fails, using the terminal device to perform the upgrade operation to the incompletely-upgraded firmware with the differential upgrade package again; and
when a number of failures in execution of the upgrade operation reaches a predetermined number, using the terminal device to perform the restoration operation to the incompletely-upgraded firmware.

### Claim 11

A firmware update method having a self-restoration mechanism and being performed by a terminal device, the firmware update method comprising:
using the terminal device to download a differential upgrade package and a differential restoration package through a communication channel;
using the terminal device to perform an upgrade operation to current firmware of the terminal device with the differential upgrade package so as to upgrade the current firmware to the target firmware, wherein the current firmware is changed into incompletely-upgraded firmware after the upgrade operation starts and before the upgrade operation finishes successfully; and
using the terminal device to verify whether the upgrade operation fails, and when the upgrade operation fails, using the terminal device to perform a restoration operation to the incompletely-upgraded firmware with backup of partial data of the current firmware and/or with the differential restoration package so as to restore the incompletely-upgraded firmware to the current firmware.

### Claim 12 (depends on 11)

The firmware update method of claim 11, wherein the communication channel is a wireless channel of a wireless communication network.

### Claim 13 (depends on 11)

The firmware update method of claim 11, wherein the current firmware is divided into N blocks, the N blocks are from a first block to an Nth block in turn, each of the N blocks represents firmware data of a storage block, the N is an integer grater than one, and the upgrade operation includes: using the differential upgrade package to upgrade the N blocks in turn.

### Claim 14 (depends on 13)

The firmware update method of claim 13, wherein the upgrade operation includes:
before upgrading a Kth block of the N blocks, setting an upgrade state of the Kth block for a beginning state, wherein the K is a positive integer not greater than the N;
after setting the upgrade state of the Kth block for the beginning state, duplicating data of the Kth block to generate backup of the data of the Kth block;
after generating the backup of the data of the Kth block, setting the upgrade state of the Kth block for a backup state;
after setting the upgrade state of the Kth block for the backup state, using the differential upgrade package to upgrade the Kth block;
when the Kth block is upgraded successfully, setting the upgrade state of the Kth block for a completion state; and
when the Kth block is not upgraded successfully, turning to the restoration operation.

### Claim 15 (depends on 14)

The firmware update method of claim 14, wherein using the differential upgrade package to upgrade the Kth block includes: generating upgraded firmware data of the Kth block according to firmware data relevant to the Kth block and the differential upgrade package; and after generating the upgraded firmware data of the Kth block successfully, overwriting firmware data of the Kth block with the upgraded firmware data of the Kth block.

### Claim 16 (depends on 14)

The firmware update method of claim 14, wherein the restoration operation includes: when the Kth block is not upgraded successfully, performing the restoration operation to the Kth block with the backup of the data of the Kth block.

### Claim 17 (depends on 14)

The firmware update method of claim 14, wherein the K is greater than one, and the restoration operation includes: when the Kth block is not upgraded successfully, performing the restoration operation to K blocks with the backup of the data of the Kth block and the differential restoration package, wherein the K blocks are from the Kth block to the first block.

### Claim 18 (depends on 17)

The firmware update method of claim 17, wherein the restoration operation includes:
checking an upgrade state of each of the K blocks;
when the upgrade state of an Ith block of the K blocks is the backup state, replacing current data of the Ith block with backup of original data of the Ith block, wherein the I is a positive integer not greater than the K; and
when the upgrade state of the Ith block is the completion state, restoring the Ith block with the differential restoration package.

### Claim 19 (depends on 13)

The firmware update method of claim 13, wherein after the upgrade operation starts and before the upgrade operation finishes successfully, if the terminal device reboots, the upgrade operation includes: checking an upgrade state of each of the N blocks and checking whether the N blocks are executed successfully; and when the upgrade state of any of the N blocks is not a completion state or when the terminal device does not run successfully based on present firmware data of the terminal device, turning to the restoration operation.

### Claim 20 (depends on 11)

The firmware update method of claim 11, further comprising:
after the upgrade operation fails, using the terminal device to perform the upgrade operation to the incompletely-upgraded firmware with the differential upgrade package again; and
when a number of failures in execution of the upgrade operation reaches a predetermined number, using the terminal device to perform the restoration operation to the incompletely-upgraded firmware.
