CN111045714B - Firmware updating method and device, earphone and computer readable storage medium - Google Patents

Firmware updating method and device, earphone and computer readable storage medium Download PDF

Info

Publication number
CN111045714B
CN111045714B CN201911318512.1A CN201911318512A CN111045714B CN 111045714 B CN111045714 B CN 111045714B CN 201911318512 A CN201911318512 A CN 201911318512A CN 111045714 B CN111045714 B CN 111045714B
Authority
CN
China
Prior art keywords
firmware
program
version
new
memory block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911318512.1A
Other languages
Chinese (zh)
Other versions
CN111045714A (en
Inventor
李松洋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Goertek Inc
Original Assignee
Goertek Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Goertek Inc filed Critical Goertek Inc
Priority to CN201911318512.1A priority Critical patent/CN111045714B/en
Priority to PCT/CN2019/130284 priority patent/WO2021120327A1/en
Publication of CN111045714A publication Critical patent/CN111045714A/en
Application granted granted Critical
Publication of CN111045714B publication Critical patent/CN111045714B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/654Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/082Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality

Abstract

The application discloses a firmware updating method, a device, an earphone and a computer readable storage medium, wherein the firmware updating method comprises the following steps: after receiving the OTA update package of the new firmware, storing the new firmware to a second space block in the FLASH; the second space block is not overlapped with the first space block stored with the firmware of the current version; backing up the resource data of the current version firmware stored in the first memory block to a second memory block; according to the resource data of the new firmware version obtained through analysis, resource data integration is carried out on the second memory block; and jumping the program pointer to the new firmware. According to the method and the device, the current version firmware and the new version firmware are stored in the FLASH separately, and the resource data of the new version firmware is integrated by combining the resource data of the current version firmware in the memory, so that smooth switching of the two versions of firmware can be effectively realized under the condition that equipment is not restarted, a user can continuously use the equipment during firmware updating, and user experience and firmware updating efficiency are improved.

Description

Firmware updating method and device, earphone and computer readable storage medium
Technical Field
The present application relates to the field of electronic product technologies, and in particular, to a firmware updating method and apparatus, an earphone, and a computer-readable storage medium.
Background
Many electronic devices, such as bluetooth headsets, etc., need to solve bugs existing in old versions of firmware through firmware update, or optimize and supplement some current functions, so as to provide better sound quality and interaction experience for users. Due to the function singleness of the electronic equipment such as the earphone and the like, the electronic equipment generally does not have operating systems such as Linux and Android, so that firmware updating cannot be realized by adopting a hot patch technology. In the prior art, generally, firmware is stored in an external FLASH, the firmware is moved by restarting a device, and the old version firmware is stored in an overlay manner, so that the purpose of updating the firmware is achieved. The time required by the firmware updating mode is generally long, and a user can not use the equipment any more during the restarting period, so that the user experience is reduced.
In view of the above, it is an important need for those skilled in the art to provide a solution to the above technical problems.
Disclosure of Invention
The application aims to provide a firmware updating method, a firmware updating device, an earphone and a computer readable storage medium, so that firmware updating can be realized without restarting equipment, and further firmware updating efficiency and user experience are improved.
To solve the above technical problem, in a first aspect, the present application discloses a firmware updating method, including:
after receiving an OTA update package of a new firmware version, storing the new firmware version to a second space block in the FLASH; the second space block is non-overlapped with the first space block stored with the firmware of the current version;
backing up the resource data of the current version firmware stored in the first memory block to a second memory block;
according to the resource data of the new firmware version obtained through analysis, performing resource data integration on the second memory block;
and jumping a program pointer to the new firmware.
Optionally, after the performing resource data integration on the second memory block, the method further includes:
modifying a preset firmware selection mark according to the address of the second space block; the preset firmware selection mark is used for selecting the firmware to be operated after the equipment is restarted.
Optionally, the jumping the program pointer to the new firmware version includes:
setting a program jump point at the corresponding position of the new version firmware according to the current program operating point of the current version firmware;
and jumping a program pointer from the current program running point of the current version firmware to the program jumping point of the new version firmware.
Optionally, the jumping a program pointer from the current program running point of the current version firmware to the program jumping point of the new version firmware includes:
skipping the program pointer from the current program running point of the current version firmware to the bootloader program so as to perform address conversion processing on the first memory block and the second memory block;
and jumping the program pointer to the program jump point of the new version firmware from the bootloader program.
Optionally, the performing address translation processing on the first memory block and the second memory block includes:
and performing address conversion processing on the first memory block and the second memory block based on an external address conversion chip and a peripheral memory.
Optionally, the OTA update package is an OTA full update package or an OTA differential update package.
Optionally, before the receiving the OTA update package of the new firmware version, the method further includes:
and after detecting the message to be updated of the firmware, sending a firmware update request to a terminal so that the terminal can send the OTA update package of the new firmware.
In a second aspect, the present application also discloses a firmware updating apparatus, including:
the storage unit is used for storing the new firmware to a second space block in the FLASH after receiving an OTA update package of the new firmware; the second space block is non-overlapped with the first space block stored with the firmware of the current version;
the backup unit is used for backing up the resource data of the current version firmware stored in the first memory block to the second memory block;
the integration unit is used for integrating the resource data of the second memory block according to the resource data of the new firmware version obtained through analysis;
and the jumping unit is used for jumping the program pointer to the new firmware.
Optionally, the apparatus further includes a setting unit, configured to modify a preset firmware selection flag according to an address of the second space block after the integration unit performs resource data integration on the second memory block; the preset firmware selection mark is used for selecting the firmware to be operated after the equipment is restarted.
Optionally, the jumping unit is specifically configured to:
setting a program jump point at the corresponding position of the new version firmware according to the current program operating point of the current version firmware; and jumping a program pointer from the current program running point of the current version firmware to the program jumping point of the new version firmware.
Optionally, the jumping unit includes:
a conversion module, configured to jump the program pointer from the current program running point of the current version firmware to the bootloader program, so as to perform address conversion processing on the first memory block and the second memory block;
and the jump module is used for jumping the program pointer to the program jump point of the new firmware version by the bootloader program.
Optionally, the skip module is specifically configured to: and performing address conversion processing on the first memory block and the second memory block based on an external address conversion chip and a peripheral memory.
Optionally, the OTA update package is an OTA full update package or an OTA differential update package.
Optionally, the OTA updating method further includes a requesting unit, configured to send a firmware updating request to a terminal after detecting a message that the firmware is to be updated, so that the terminal sends the OTA updating packet of the new firmware version.
In a third aspect, the present application also discloses a headset, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the steps of any of the firmware update methods described above.
In a fourth aspect, the present application also discloses a computer-readable storage medium having a computer program stored therein, which when executed by a processor is configured to implement the steps of any one of the firmware update methods described above.
The firmware updating method provided by the application comprises the following steps: after receiving an OTA update package of a new firmware version, storing the new firmware version to a second space block in the FLASH; the second space block is non-overlapped with the first space block stored with the firmware of the current version; backing up the resource data of the current version firmware stored in the first memory block to a second memory block; according to the resource data of the new firmware version obtained through analysis, performing resource data integration on the second memory block; and jumping a program pointer to the new firmware.
Therefore, the current version firmware and the new version firmware are separately stored in the FLASH, and the resource data of the new version firmware is integrated in the memory by combining the resource data of the current version firmware, so that the two versions of firmware can be smoothly switched without restarting the equipment, a user can continuously use the equipment during the firmware updating period, the time required by the firmware updating is effectively shortened, and the user experience and the firmware updating efficiency are greatly improved. The firmware updating device, the earphone and the computer readable storage medium provided by the application also have the beneficial effects.
Drawings
In order to more clearly illustrate the technical solutions in the prior art and the embodiments of the present application, the drawings that are needed to be used in the description of the prior art and the embodiments of the present application will be briefly described below. Of course, the following description of the drawings related to the embodiments of the present application is only a part of the embodiments of the present application, and it will be obvious to those skilled in the art that other drawings can be obtained from the provided drawings without any creative effort, and the obtained other drawings also belong to the protection scope of the present application.
FIG. 1 is a flowchart illustrating a firmware update method according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram illustrating resource distribution of firmware in a memory according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram of a storage structure of a FLASH disclosed in an embodiment of the present application;
fig. 4 is a schematic diagram illustrating a storage structure of a memory according to an embodiment of the present disclosure;
fig. 5 is a schematic diagram of memory address translation disclosed in an embodiment of the present application;
fig. 6 is a schematic diagram illustrating an implementation manner of memory address translation disclosed in an embodiment of the present application;
FIG. 7 is a flowchart illustrating another firmware update method disclosed in an embodiment of the present application;
fig. 8 is a schematic diagram of an OTA update package according to an embodiment of the present application;
FIG. 9 is a block diagram of a firmware update apparatus according to an embodiment of the present disclosure;
fig. 10 is a block diagram of a structure of an earphone disclosed in an embodiment of the present application.
Detailed Description
The core of the application is to provide a firmware updating method, a firmware updating device, an earphone and a computer readable storage medium, so that firmware updating can be realized without restarting equipment, and further firmware updating efficiency and user experience are improved.
In order to more clearly and completely describe the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Currently, many electronic devices, such as bluetooth headsets, etc., need to solve bugs existing in old versions of firmware through firmware update, or optimize and supplement some current functions, so as to provide better sound quality and interaction experience for users. Due to the function singleness of the electronic equipment such as the earphone and the like, the electronic equipment generally does not have operating systems such as Linux and Android, so that firmware updating cannot be realized by adopting a hot patch technology. In the prior art, generally, firmware is stored in an external FLASH, the firmware is moved by restarting a device, and the old version firmware is stored in an overlay manner, so that the purpose of updating the firmware is achieved. The time required by the firmware updating mode is generally long, and a user can not use the equipment any more during the restarting period, so that the user experience is reduced. In view of the above, the present application provides a firmware updating method, which can effectively solve the above problems.
Referring to fig. 1, an embodiment of the present application discloses a firmware updating method. The firmware updating method can be particularly applied to electronic equipment such as Bluetooth earphones and the like, and mainly comprises the following steps:
s101: after receiving the OTA (Over the Air) update package of the new firmware, the new firmware is stored to the second space block in the FLASH.
Specifically, when the firmware in the electronic device needs to be updated, the electronic device detects a message that the firmware is to be updated, and creates a firmware update task in the background. And, the electronic device may send a firmware update request to the terminal so that the terminal sends an OTA update package of the new version of firmware.
The terminal is in communication connection with the electronic equipment, and can receive the request of the electronic equipment and send the update package to the electronic equipment. The terminal can have an interactive function for a user to input information to select whether to update the firmware. For example, the terminal may be embodied as a user mobile phone, a tablet, a palmtop computer, and the like.
It should be noted that in the embodiment of the present application, two different space blocks are used in FLASH to store the current version firmware and the new version firmware, respectively. The storage area of the current version firmware stored in the FLASH is a first space block, and the other area, namely a second space block, in the FLASH is used for storing the received new version firmware.
After receiving the OTA update package of the new firmware transmitted by the terminal, the electronic device may store the new firmware in the second space block in the FLASH. The second space block is not overlapped with the first space block in the FLASH, wherein the first space block stores the firmware of the current version. That is, the firmware updating method provided in the embodiment of the present application does not move the new version firmware to the location of the current version firmware in an overlay manner, so that the device does not need to be shut down, and the new version firmware can be stored in the second space block in the FLASH of the electronic device while the current version firmware is running.
S102: and backing up the resource data of the current version firmware stored in the first memory block to the second memory block.
Specifically, when the firmware of the business app is running, the firmware generally includes resources such as a code segment, an initialized data segment, an uninitialized data segment, a heap, a stack, and the like, referring to fig. 2, fig. 2 is a resource distribution diagram of the firmware in the memory according to the embodiment of the present application. Generally, the resources of a firmware include the following:
the code segment, text, is usually used for storing program execution code, and may include some read-only constant variables, such as string constants and the like;
the initialized data segment is usually used for storing initialized global variables in a program and belongs to static memory allocation;
uninitialized data segments, also called bss segments, are usually used to store global variables and static variables that are uninitialized or initialized to 0 in a program;
heap, used for depositing the memory segment that is distributed dynamically in the course runs, its size is not fixed, can expand or reduce dynamically;
the stack is used for storing local variables of the program; or for passing parameters and return values when the function is called; the method has the characteristic of first-in first-out and is suitable for saving/restoring the calling site.
It should be noted that, similarly to the case that the FLASH memory is occupied by the current version firmware and the new version firmware respectively in two different space blocks, in the embodiment of the present application, two storage areas are also similarly set in the memory to store resource data of the two versions of firmware respectively, so as to operate the corresponding versions of firmware. The first memory block is used for storing resource data of a current version of firmware, and the second memory block is used for storing resource data of a new version of firmware.
In order to implement background silent update of firmware without restarting the electronic device, in the embodiment of the present application, the resource data of the current version firmware stored in the first memory block is backed up to the second memory block, so that the resource data of the two versions of firmware are integrated in the following.
S103: and according to the resource data of the new firmware version obtained by analysis, performing resource data integration on the second memory block.
Specifically, after the resource data of the new version of firmware is analyzed, the resource data integration processing may be performed on the second memory block, so as to integrate the resource data of the current version of firmware and the resource data of the new version of firmware. It is easy to understand that the new version of firmware may perform bug fixing, function optimization, new function addition, and the like on the current version of firmware, and therefore, the resource data of the current version of firmware may be subjected to integration operations such as constraint, deletion, modification, addition, and the like, so that the business app program can smoothly perform after entering the new version of firmware.
S104: and jumping the program pointer to the new firmware.
Specifically, after the integration of the resource data of the second memory block is completed, the program pointer may be skipped from the currently running current version firmware to enter the new version firmware for running. The resource data of the new version firmware in the memory is integrated with the resource data of the current version, so that the smooth switching of the two versions of firmware can be effectively realized under the condition of not restarting the equipment.
The firmware updating method provided by the embodiment of the application comprises the following steps: after receiving the OTA update package of the new firmware, storing the new firmware to a second space block in the FLASH; the second space block is not overlapped with the first space block stored with the firmware of the current version; backing up the resource data of the current version firmware stored in the first memory block to a second memory block; according to the resource data of the new firmware version obtained through analysis, resource data integration is carried out on the second memory block; and jumping the program pointer to the new firmware.
Therefore, the current version firmware and the new version firmware are separately stored in the FLASH, and the resource data of the new version firmware is integrated in the memory by combining the resource data of the current version firmware, so that the two versions of firmware can be smoothly switched without restarting the equipment, a user can continuously use the equipment during the firmware updating period, the time required by the firmware updating is effectively shortened, and the user experience and the firmware updating efficiency are greatly improved.
As a specific embodiment, on the basis of the foregoing, the firmware updating method provided in this embodiment of the present application further includes, after performing resource data integration on the second memory block:
modifying the preset firmware selection mark according to the address of the second space block; the preset firmware selection flag is used for selecting the firmware to be run after the device is restarted.
Specifically, since the embodiment of the present application stores two different versions of firmware in FLASH, the firmware that the electronic device selects to run after being restarted needs to be set. Therefore, the preset firmware selection flag is set in the embodiment of the application, and when the bootloader program is restarted and run by the electronic device, the firmware to be run is selected according to the preset firmware selection flag.
On the basis of the above, referring to fig. 3, fig. 3 is a schematic view of a storage structure of a FLASH disclosed in the embodiment of the present application.
Generally, a software system of an electronic device is divided into two parts: hardware initialization program and business app software. For a simple embedded device, in order to facilitate firmware OTA update, a software system of the embedded device is generally divided into two parts, namely a bootloader program and business app firmware. The bootloader program is generally used to complete hardware initialization, service app firmware migration, and a function of jumping to the service app firmware, where the function of migrating the service app firmware refers to a function of migrating a new version of firmware in the external FLASH to a current version of firmware in a covered manner in the shutdown condition when it is detected that the firmware needs to be updated in the prior art.
The storage structure of FLASH shown in fig. 3 adopts a software mode of bootloader + app, and stores:
the bootloader is used for completing initialization work of electronic equipment hardware and carrying out skip operation according to a preset firmware selection mark;
presetting a firmware selection mark, which is the basis for the bootloader to select which firmware to jump to;
the firmware 1 is the current version firmware of the device service app and is stored in a first space block, and the corresponding compiling link address is addr;
firmware 2, which is a new version of the device service app, is stored in the second space block, and the corresponding compiling link address is addr: d;
other information of the device.
On the basis of the above, referring to fig. 4, fig. 4 is a schematic view of a storage structure of a memory disclosed in the embodiment of the present application. In this embodiment, the memory includes:
the critical ram area is used for jumping from the current version firmware to the new version firmware for use, and the addr: a1 is used as a starting address;
the first memory block is used for storing resource data used by the current version firmware, and takes addr: a2 as a starting address;
and the second memory block is used for storing the resource data used by the new firmware, and takes addr: a3 as a starting address.
As a specific embodiment, in the firmware updating method provided in the embodiment of the present application, based on the above, the jumping the program pointer to the new firmware version in step S104 may specifically include:
setting a program jump point at a corresponding position of the new version firmware according to a current program operating point of the current version firmware;
and jumping the program pointer from the current program running point of the current version firmware to the program jumping point of the new version firmware.
Specifically, in order to implement seamless switching operation of two versions of firmware, so that the new version of firmware directly replaces operation at the current operation interface of the current version of firmware, the embodiment of the present application further sets a program jump point in the new version of firmware as a jump entry of the program pointer.
As a specific embodiment, the firmware updating method provided in the embodiment of the present application, based on the above contents, jumps a program pointer from a current program running point of a current version of firmware to a program jump point of a new version of firmware, and includes:
skipping a program pointer from a current program running point of the current version firmware to a bootloader program so as to perform address conversion processing on the first memory block and the second memory block;
and jumping the program pointer to a program jump point of the new firmware version by the bootloader program.
Specifically, considering that the "new version firmware" updated this time will become the "current version firmware" updated next time, in order to avoid modifying the compiling addresses of the current version firmware and the new version firmware at the next update, in this embodiment of the application, after the resource data is integrated in step S103 of the update this time, the address conversion between the first memory block and the second memory block may be performed.
Referring to fig. 5, fig. 5 is a schematic diagram of memory address translation disclosed in the embodiment of the present application. After address conversion, the first memory block before conversion will become the second memory block after conversion, and the second memory block before conversion will become the first memory block after conversion.
It is easy to understand that, when performing the memory address translation, it is necessary to quit the program from the currently running current version firmware, that is, jump the program pointer from the current program running point of the current version firmware to the bootloader program, so as to perform the address translation on the first memory block and the second memory block.
As a specific embodiment, the firmware updating method provided in this embodiment of the present application, based on the foregoing, performs address conversion processing on a first memory block and a second memory block, and includes:
and performing address conversion processing on the first memory block and the second memory block based on the externally connected address conversion chip and the peripheral memory.
It is easy to understand that when the memory resource of the electronic device is sufficient, the memory resource can be directly utilized to perform address conversion; but when the memory resource of the electronic equipment is insufficient, the address conversion can be carried out based on the external address conversion chip and the peripheral memory. Specifically, referring to fig. 6, fig. 6 is a schematic diagram illustrating an implementation manner of memory address translation disclosed in the embodiment of the present application.
The soc (system on chip or system on chip) is an integrated circuit of the memory and the FLASH in the electronic device.
The external address conversion chip is an addr switch and is used for converting the address of the peripheral memory; the special chip may be specifically adopted, and may also be implemented based on a Programmable Logic Device such as a CPLD (Complex Programmable Logic Device), an FPGA (Field Programmable Gate Array), and the like.
The peripheral memory is external ram, and SDRAM, DDR, etc. can be selected.
As shown in fig. 7, fig. 7 is a flowchart illustrating another firmware updating method according to an embodiment of the present application, which mainly includes:
s201: and sending a firmware updating request to the terminal after detecting the message to be updated of the firmware.
S202: and after receiving the OTA updating package of the new firmware, storing the new firmware to a second space block in the FLASH.
The second space block is not overlapped with the first space block stored with the current version firmware.
S203: and backing up the resource data of the current version firmware stored in the first memory block to the second memory block.
S204: and according to the resource data of the new firmware version obtained by analysis, performing resource data integration on the second memory block.
S205: and modifying the preset firmware selection mark according to the address of the second space block.
S206: and setting a program jump point at the corresponding position of the new version firmware according to the current program operating point of the current version firmware.
S207: and jumping the program pointer from the current program running point of the current version firmware to the bootloader program so as to perform address conversion processing on the first memory block and the second memory block.
S208: and jumping the program pointer to a program jump point of the new firmware version by the bootloader program.
As a specific embodiment, in the firmware updating method provided by the embodiment of the present application, on the basis of the foregoing, the OTA update package is an OTA complete update package or an OTA differential update package.
In particular, the new version of firmware may be transmitted in the form of an OTA full update package or an OTA differential update package. The content of the OTA differential update package can be combined with the content of the current version firmware to form a complete update package of the new version firmware.
For an OTA complete update package as an example, the structure of the data package can refer to fig. 8, and fig. 8 is a schematic diagram of a structure of an OTA update package according to an embodiment of the present disclosure.
The packet 1 indicates the first packet of the OTA update packet, and includes a header (header), a checksum (checksum) of firmware contents, a storage location (storage location), a firmware length (firmware length), and the like. Wherein, the checksum is used for verifying the correctness and integrity of the firmware content; the firmware length, i.e., firmware length, may be specifically in bytes.
The packet 2, the packet 3, the packet …, the packet n +1, and the like are all subsequent other packets, including the firmware serial number and the firmware content.
Referring to fig. 9, an embodiment of the present application discloses a firmware updating apparatus, which mainly includes:
the storage unit 301 is configured to store the new firmware in the second space block of the FLASH after receiving the OTA update packet of the new firmware; the second space block is not overlapped with the first space block stored with the firmware of the current version;
a backup unit 302, configured to backup resource data of a current version firmware stored in a first memory block to a second memory block;
an integrating unit 303, configured to perform resource data integration on the second memory block according to the resource data of the new firmware version obtained through analysis;
and a jump unit 304, configured to jump the program pointer to the new firmware version.
Therefore, the firmware updating device disclosed in the embodiment of the application can effectively realize the smooth switching of the two versions of firmware without restarting the equipment by separately storing the current version of firmware and the new version of firmware in the FLASH and combining the resource data of the current version of firmware in the memory, so that a user can continuously use the equipment during the firmware updating period, meanwhile, the time required by the firmware updating is effectively shortened, the user experience and the firmware updating efficiency are greatly improved,
for details of the firmware updating apparatus, reference may be made to the foregoing detailed description of the firmware updating method, which is not repeated herein.
As a specific embodiment, the firmware updating apparatus disclosed in the embodiment of the present application further includes, on the basis of the foregoing content:
a setting unit, configured to modify the preset firmware selection flag according to the address of the second space block after the integration unit 303 performs resource data integration on the second memory block; the preset firmware selection flag is used for selecting the firmware to be run after the device is restarted.
Optionally, the jumping unit 304 is specifically configured to:
setting a program jump point at a corresponding position of the new version firmware according to a current program operating point of the current version firmware; and jumping the program pointer from the current program running point of the current version firmware to the program jumping point of the new version firmware.
Optionally, the jumping unit 304 specifically includes:
the conversion module is used for jumping the program pointer from a current program running point of the current version firmware to the bootloader program so as to perform address conversion processing on the first memory block and the second memory block;
and the jump module is used for jumping the program pointer to a program jump point of the new version firmware from the bootloader program.
Optionally, the skip module is specifically configured to: and performing address conversion processing on the first memory block and the second memory block based on the externally connected address conversion chip and the peripheral memory.
Optionally, the OTA update package is an OTA full update package or an OTA differential update package.
Optionally, the terminal further includes a request unit, configured to send a firmware update request to the terminal after detecting the message that the firmware is to be updated, so that the terminal sends an OTA update package of the new firmware version.
Referring to fig. 10, an embodiment of the present application discloses an earphone, including:
a memory 401 for storing a computer program;
a processor 402 for executing the computer program to implement the steps of any of the firmware update methods described above.
Further, the present application discloses a computer-readable storage medium, in which a computer program is stored, and the computer program is used for implementing the steps of any one of the firmware updating methods described above when being executed by a processor.
For details of the above earphone and computer readable storage medium, reference may be made to the foregoing detailed description of the firmware updating method, and details thereof will not be repeated here.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the equipment disclosed by the embodiment, the description is relatively simple because the equipment corresponds to the method disclosed by the embodiment, and the relevant parts can be referred to the method part for description.
It is further noted that, throughout this document, relational terms such as "first" and "second" are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Furthermore, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The technical solutions provided by the present application are described in detail above. The principles and embodiments of the present application are explained herein using specific examples, which are provided only to help understand the method and the core idea of the present application. It should be noted that, for those skilled in the art, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall into the protection scope of the present application.

Claims (9)

1. A firmware update method, comprising:
after receiving an OTA update package of a new firmware version, storing the new firmware version to a second space block in the FLASH; the second space block is non-overlapped with the first space block stored with the firmware of the current version;
backing up the resource data of the current version firmware stored in the first memory block to a second memory block;
according to the resource data of the new firmware version obtained through analysis, performing resource data integration on the second memory block;
skipping a program pointer to the new firmware version;
wherein jumping the program pointer to the new version of firmware comprises:
setting a program jump point at the corresponding position of the new version firmware according to the current program operating point of the current version firmware;
and jumping a program pointer from the current program running point of the current version firmware to the program jumping point of the new version firmware by running a bootloader program.
2. The firmware updating method according to claim 1, further comprising, after the performing resource data integration on the second memory block:
modifying a preset firmware selection mark according to the address of the second space block; the preset firmware selection mark is used for selecting the firmware to be operated after the equipment is restarted.
3. The firmware updating method according to claim 2, wherein the jumping a program pointer from the current program running point of the current version of firmware to the program jumping point of the new version of firmware comprises:
skipping the program pointer from the current program running point of the current version firmware to the bootloader program so as to perform address conversion processing on the first memory block and the second memory block;
and jumping the program pointer to the program jump point of the new version firmware from the bootloader program.
4. The firmware updating method according to claim 3, wherein the performing the address translation processing on the first memory block and the second memory block includes:
and performing address conversion processing on the first memory block and the second memory block based on an external address conversion chip and a peripheral memory.
5. Firmware update method according to any of claims 1 to 4, wherein the OTA update package is an OTA full update package or an OTA differential update package.
6. The firmware update method according to claim 5, further comprising, before the receiving the OTA update package of the new firmware version:
and after detecting the message to be updated of the firmware, sending a firmware update request to a terminal so that the terminal can send the OTA update package of the new firmware.
7. A firmware update apparatus, comprising:
the storage unit is used for storing the new firmware to a second space block in the FLASH after receiving an OTA update package of the new firmware; the second space block is non-overlapped with the first space block stored with the firmware of the current version;
the backup unit is used for backing up the resource data of the current version firmware stored in the first memory block to the second memory block;
the integration unit is used for integrating the resource data of the second memory block according to the resource data of the new firmware version obtained through analysis;
the skipping unit is used for skipping the program pointer to the new firmware;
wherein the jumping unit is specifically configured to:
setting a program jump point at the corresponding position of the new version firmware according to the current program operating point of the current version firmware;
and jumping a program pointer from the current program running point of the current version firmware to the program jumping point of the new version firmware by running a bootloader program.
8. An earphone, comprising:
a memory for storing a computer program;
a processor for executing the computer program to carry out the steps of the firmware update method according to any one of claims 1 to 6.
9. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, is adapted to carry out the steps of the firmware updating method according to any one of claims 1 to 6.
CN201911318512.1A 2019-12-19 2019-12-19 Firmware updating method and device, earphone and computer readable storage medium Active CN111045714B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201911318512.1A CN111045714B (en) 2019-12-19 2019-12-19 Firmware updating method and device, earphone and computer readable storage medium
PCT/CN2019/130284 WO2021120327A1 (en) 2019-12-19 2019-12-31 Firmware updating method and apparatus, and headset and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911318512.1A CN111045714B (en) 2019-12-19 2019-12-19 Firmware updating method and device, earphone and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN111045714A CN111045714A (en) 2020-04-21
CN111045714B true CN111045714B (en) 2022-03-01

Family

ID=70237924

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911318512.1A Active CN111045714B (en) 2019-12-19 2019-12-19 Firmware updating method and device, earphone and computer readable storage medium

Country Status (2)

Country Link
CN (1) CN111045714B (en)
WO (1) WO2021120327A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111651179B (en) * 2020-05-29 2022-02-22 歌尔科技有限公司 Earphone, program upgrading method thereof, control device and readable storage medium
CN111666091B (en) * 2020-06-12 2023-08-29 成都极米科技股份有限公司 System updating method, device, electronic equipment and computer readable storage medium
CN112860316B (en) * 2021-02-08 2024-03-08 中科院软件研究所南京软件技术研究院 Kernel and BSP transplanting method of openEular open source system
CN113342376B (en) * 2021-06-23 2022-08-30 支付宝(杭州)信息技术有限公司 Method and device for upgrading operating system of Internet of things equipment
CN113778489B (en) * 2021-09-14 2024-01-30 上海芯钛信息科技有限公司 Method and system for supporting non-stop OTA from hardware level
CN115437672A (en) * 2022-09-15 2022-12-06 深圳思凌科技术有限公司 User program updating method, device, equipment and storage medium based on SOC chip
CN115469910B (en) * 2022-11-15 2023-02-03 浙江日风电气股份有限公司 Photovoltaic inverter firmware updating method, device, system and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101770383A (en) * 2010-01-22 2010-07-07 中兴通讯股份有限公司 Method and device for on-line upgrade of cross-platform version
CN105912356A (en) * 2016-03-31 2016-08-31 武汉光迅科技股份有限公司 Optical module firmware program online upgrade method supporting version fallback
CN106874032A (en) * 2017-01-04 2017-06-20 青岛海信宽带多媒体技术有限公司 Method, device and optical module that optical module firmware is upgraded
CN110275728A (en) * 2019-06-28 2019-09-24 瓴盛科技有限公司 Update the system and method for firmware

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7007049B2 (en) * 2002-11-18 2006-02-28 Innopath Software, Inc. Device memory management during electronic file updating
US8707297B2 (en) * 2006-07-26 2014-04-22 Dell Products L.P. Apparatus and methods for updating firmware
JP5342302B2 (en) * 2009-03-30 2013-11-13 株式会社日立ソリューションズ Firmware update system, firmware distribution server, and program
CN105094903B (en) * 2015-07-16 2019-02-22 广州飞米电子科技有限公司 The method and device that firmware is upgraded
CN106095480B (en) * 2016-05-31 2019-09-17 青岛海信宽带多媒体技术有限公司 A kind of method and device of optical module firmware upgrading
CN106293835A (en) * 2016-08-09 2017-01-04 捷开通讯(深圳)有限公司 A kind of method and system of smart machine firmware upgrade
CN112491600A (en) * 2018-03-07 2021-03-12 华为技术有限公司 Method and device for upgrading network card firmware, network card and equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101770383A (en) * 2010-01-22 2010-07-07 中兴通讯股份有限公司 Method and device for on-line upgrade of cross-platform version
CN105912356A (en) * 2016-03-31 2016-08-31 武汉光迅科技股份有限公司 Optical module firmware program online upgrade method supporting version fallback
CN106874032A (en) * 2017-01-04 2017-06-20 青岛海信宽带多媒体技术有限公司 Method, device and optical module that optical module firmware is upgraded
CN110275728A (en) * 2019-06-28 2019-09-24 瓴盛科技有限公司 Update the system and method for firmware

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"基于STM32的Bootloader实验系统设计";顾东袁等;《实验技术与管理》;20191130;第36卷(第11期);第89-93页 *

Also Published As

Publication number Publication date
WO2021120327A1 (en) 2021-06-24
CN111045714A (en) 2020-04-21

Similar Documents

Publication Publication Date Title
CN111045714B (en) Firmware updating method and device, earphone and computer readable storage medium
US8898662B2 (en) Method and device for generating software installation packet
CN105511911B (en) The generation method and device of system firmware upgrade package
CN110750288B (en) Native engineering configuration method and device, electronic equipment and storage medium
CN105138382B (en) A kind of method and terminal of android system upgrading
CN108958844B (en) Application program control method and terminal
US11853820B2 (en) Cross-process communication method, apparatus, and device
CN102646043B (en) Mobile terminal software upgrading method, update device and mobile terminal
WO2019062703A1 (en) Update method, and embedded system
CN105677335A (en) Method and device for increasing first starting speed of mobile terminal
CN104375849A (en) Core loading method and device
CN103491434B (en) A kind of application programe switch-over method of Set Top Box based on Android
CN102346673A (en) Method and device for upgrading mobile phone system
CN105224401A (en) Scheduled task control method and device
CN105677421B (en) Customization method and system for desktop starter of mobile terminal
CN103049287A (en) Mobile terminal and method for installing application programs of mobile terminal
WO2019022827A1 (en) Systems and methods for providing patchable rom firmware
CN105938436A (en) Startup control method of operation system and terminal
CN106997302A (en) Firmware upgrade method, device and audio-frequence player device
CN104077161A (en) Client application updating method and device
CN111427594A (en) Application program running method and device
CN108037932B (en) SPI-NAND configuration file acquisition method and device
WO2023213263A1 (en) Program compiling method, program starting method, and device and storage medium
CN102375759B (en) Utilize the method that finite state machine prevents code rewriting
CN102243587A (en) Method for upgrading read only memory (ROM) program in embedded system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant