[go: up one dir, main page]

CN116909611A - Electronic device firmware updating method, cleaning device and storage medium - Google Patents

Electronic device firmware updating method, cleaning device and storage medium Download PDF

Info

Publication number
CN116909611A
CN116909611A CN202310480907.1A CN202310480907A CN116909611A CN 116909611 A CN116909611 A CN 116909611A CN 202310480907 A CN202310480907 A CN 202310480907A CN 116909611 A CN116909611 A CN 116909611A
Authority
CN
China
Prior art keywords
firmware
electronic device
storage area
update file
functional
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.)
Pending
Application number
CN202310480907.1A
Other languages
Chinese (zh)
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.)
Yunjing Intelligent Innovation Shenzhen Co ltd
Yunjing Intelligent Shenzhen Co Ltd
Original Assignee
Yunjing Intelligent Innovation Shenzhen Co ltd
Yunjing Intelligent Shenzhen Co Ltd
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 Yunjing Intelligent Innovation Shenzhen Co ltd, Yunjing Intelligent Shenzhen Co Ltd filed Critical Yunjing Intelligent Innovation Shenzhen Co ltd
Priority to CN202310480907.1A priority Critical patent/CN116909611A/en
Publication of CN116909611A publication Critical patent/CN116909611A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

本申请公开了一种电子设备固件更新方法,电子设备包括第一芯片与第二芯片,上述方法包括:获取固件更新文件;根据固件更新文件,更新写入第一芯片的电子设备系统固件;根据更新后的电子设备系统固件,更新写入第二芯片的电子设备功能固件。如此,本申请通过优先升级系统固件、再根据系统固件对功能固件进行升级,无需对功能硬件的控制芯片分别独立写入,有效地简化了固件更新的操作流程。此外,根据系统固件对功能固件更新,能够对系统固件以及功能固件的版本进行统一,避免由于固件版本的不一致可能导致的控制故障或功能失效,提高清洁设备运行的可靠性。

This application discloses a method for updating firmware of an electronic device. The electronic device includes a first chip and a second chip. The method includes: obtaining a firmware update file; updating the electronic device system firmware written in the first chip according to the firmware update file; The updated electronic device system firmware updates the electronic device function firmware written into the second chip. In this way, this application prioritizes upgrading the system firmware and then upgrades the functional firmware according to the system firmware, eliminating the need to write independent writes to the control chips of the functional hardware, effectively simplifying the firmware update operation process. In addition, updating the functional firmware according to the system firmware can unify the versions of the system firmware and functional firmware, avoid control failures or functional failures that may be caused by inconsistent firmware versions, and improve the reliability of the operation of the cleaning equipment.

Description

电子设备固件更新方法、清洁设备以及存储介质Electronic device firmware update methods, cleaning equipment and storage media

技术领域Technical field

本申请涉及电子设备技术领域,具体涉及一种电子设备固件更新方法、清洁设备以及计算机可读存储介质。The present application relates to the technical field of electronic equipment, and specifically relates to an electronic equipment firmware update method, cleaning equipment and computer-readable storage media.

背景技术Background technique

相关技术中,将系统芯片与多个功能硬件对应的控制芯片合并到同一个设备中,进而实现控制的电子设备的应用越发广泛,系统芯片以及功能硬件的控制芯片的固件升级频次也越来越高,但由于在电子设备中系统芯片与功能硬件的控制芯片一般是分立设置的、且型号不一定完全匹配,可能会出现芯片间的固件版本与协同性出现差错的问题,导致设备运行出现故障。In related technologies, system chips and control chips corresponding to multiple functional hardware are merged into the same device to realize control of electronic devices. The applications are becoming more and more widespread, and the frequency of firmware upgrades of system chips and control chips of functional hardware is also becoming more and more frequent. High, but because the system chip and the control chip of the functional hardware in electronic equipment are generally set up separately, and the models do not necessarily match completely, there may be errors in the firmware versions and interoperability between the chips, causing equipment operation failures. .

发明内容Contents of the invention

本申请提供了一种电子设备固件更新方法、清洁设备以及计算机可读存储介质。This application provides an electronic device firmware update method, a cleaning device and a computer-readable storage medium.

本申请实施方式涉及电子设备包括第一芯片与第二芯片,电子设备固件更新方法则包括:The embodiment of the present application relates to an electronic device including a first chip and a second chip, and the electronic device firmware update method includes:

获取固件更新文件;Get firmware update files;

根据所述固件更新文件,更新写入所述第一芯片的电子设备系统固件;Update the electronic device system firmware written in the first chip according to the firmware update file;

根据更新后的所述电子设备系统固件,更新写入所述第二芯片的电子设备功能固件。Update the electronic device function firmware written in the second chip according to the updated electronic device system firmware.

如此,本申请通过优先升级系统固件、再根据系统固件对功能固件进行升级,无需对功能硬件的控制芯片分别独立写入,有效地简化了固件更新的操作流程。此外,根据系统固件对功能固件更新,能够对系统固件以及功能固件的版本进行统一,避免由于固件版本的不一致可能导致的控制故障或功能失效,提高清洁设备运行的可靠性。In this way, this application prioritizes upgrading the system firmware and then upgrades the functional firmware based on the system firmware. This eliminates the need to write independent writes to the control chips of the functional hardware, effectively simplifying the firmware update operation process. In addition, updating the functional firmware according to the system firmware can unify the versions of the system firmware and functional firmware, avoid control failures or functional failures that may be caused by inconsistent firmware versions, and improve the reliability of the operation of the cleaning equipment.

在某些实施方式中,所述获取固件更新文件,之后还包括:In some embodiments, obtaining the firmware update file further includes:

验证所述固件更新文件的签名信息;Verify the signature information of the firmware update file;

在所述签名信息错误的情况下,终止所述电子设备固件更新的进程。If the signature information is incorrect, the electronic device firmware update process is terminated.

如此,本申请能够在更新固件前有限验证固件更新文件的正确性与真实性,避免更新过程出错,进而避免设备的运行因固件更新文件的错误而出现故障。In this way, this application can verify the correctness and authenticity of the firmware update file to a limited extent before updating the firmware, thereby avoiding errors in the update process and thus preventing the operation of the device from malfunctioning due to errors in the firmware update file.

在某些实施方式中,所述根据所述固件更新文件,更新写入所述第一芯片的电子设备系统固件,包括:In some embodiments, updating the electronic device system firmware written in the first chip according to the firmware update file includes:

将所述电子设备置为第一状态,所述第一状态用于表示当前正在备份所述固件更新文件;Set the electronic device to a first state, where the first state is used to indicate that the firmware update file is currently being backed up;

在所述第一状态下,将所述固件更新文件写入所述第一芯片的备份存储区;In the first state, write the firmware update file into the backup storage area of the first chip;

根据写入所述备份存储区的所述固件更新文件,更新所述系统固件。The system firmware is updated according to the firmware update file written in the backup storage area.

如此,本申请能够在获取到固件更新文件后先将其写入系统芯片的备份存储区,以便于后续固件更新过程中向系统芯片写入固件更新文件、以及避免在写入过程中出现文件复制错误。In this way, the present application can first write the firmware update file into the backup storage area of the system chip after obtaining it, so as to facilitate writing the firmware update file to the system chip during the subsequent firmware update process and avoid file copying during the writing process. mistake.

在某些实施方式中,所述在所述第一状态下,将所述固件更新文件写入所述电子设备的备份存储区,包括:In some embodiments, writing the firmware update file to the backup storage area of the electronic device in the first state includes:

在将所述固件更新文件写入所述备份存储区的过程中,若所述电子设备发生重启,根据所述电子设备重启之前所述固件更新文件向所述备份存储区的写入进度,继续将所述固件更新文件写入所述备份存储区;或者During the process of writing the firmware update file to the backup storage area, if the electronic device restarts, continue based on the writing progress of the firmware update file to the backup storage area before the electronic device restarts. Write the firmware update file into the backup storage area; or

重新将所述固件更新文件写入所述备份存储区。The firmware update file is re-written into the backup storage area.

如此,本申请能够在电子设备于将固件更新文件写入备份存储区的过程中因掉电或其他原因意外重启的情况下恢复上述过程,避免固件更新过程中因掉电或其他意外原因导致的电子设备固件损坏问题。In this way, the present application can restore the above-mentioned process when the electronic device unexpectedly restarts due to power outage or other reasons during the process of writing the firmware update file to the backup storage area, thereby avoiding the possibility of power outage or other unexpected reasons during the firmware update process. Electronic device firmware corruption issues.

在某些实施方式中,所述根据写入所述备份存储区的所述固件更新文件,更新所述系统固件,包括:In some embodiments, updating the system firmware according to the firmware update file written in the backup storage area includes:

将所述电子设备置为第二状态,所述第二状态用于表示当前正在更新所述系统固件;Set the electronic device to a second state, where the second state is used to indicate that the system firmware is currently being updated;

在所述第二状态下,将写入所述备份存储区的所述固件更新文件覆盖写入所述第一芯片的固件存储区,更新所述系统固件。In the second state, the firmware update file written in the backup storage area is overwritten and written in the firmware storage area of the first chip to update the system firmware.

如此,本申请能够将写入备份存储区的固件更新文件写入系统芯片的固件存储区,以恢复备份的方式实现对系统固件的更新。In this way, the present application can write the firmware update file written in the backup storage area into the firmware storage area of the system chip, and update the system firmware by restoring the backup.

在某些实施方式中,所述根据写入所述备份存储区的所述固件更新文件,更新所述系统固件,还包括:In some embodiments, updating the system firmware according to the firmware update file written in the backup storage area further includes:

在所述将所述备份固件更新文件覆盖写入所述固件存储区的情况下,若所述电子设备重启,验证所述电子设备的状态;In the case where the backup firmware update file is overwritten and written into the firmware storage area, if the electronic device is restarted, verify the status of the electronic device;

在所述电子设备处于所述第二状态下的情况下,重新将写入所述备份存储区的所述固件更新文件覆盖写入所述固件存储区。When the electronic device is in the second state, the firmware update file written in the backup storage area is overwritten and written into the firmware storage area again.

如此,本申请能够通过从备份存储区向固件存储区恢复文件的方式,在电子设备于将固件更新文件从备份存储区写入固件存储区的过程中因掉电或其他原因意外重启的情况下恢复上述过程,避免固件更新过程中因掉电或其他意外原因导致的电子设备固件损坏问题。In this way, the present application can recover files from the backup storage area to the firmware storage area when the electronic device unexpectedly restarts due to power outage or other reasons during the process of writing the firmware update file from the backup storage area to the firmware storage area. Resume the above process to avoid the problem of electronic device firmware damage caused by power outage or other unexpected reasons during the firmware update process.

在某些实施方式中,所述根据写入所述备份存储区的所述固件更新文件,更新所述系统固件,之后还包括:In some embodiments, updating the system firmware according to the firmware update file written in the backup storage area further includes:

将所述电子设备置为第三状态,并控制所述电子设备重启,所述第三状态表示所述系统固件升级完毕。The electronic device is set to a third state, and the electronic device is controlled to restart. The third state indicates that the system firmware upgrade is completed.

如此,本申请能够通过设置自身状态并重启的方式应用新写入的固件,并结束系统固件的更新过程。In this way, this application can apply the newly written firmware by setting its own status and restarting, and end the system firmware update process.

在某些实施方式中,所述根据更新后的所述电子设备系统固件,更新写入所述第二芯片的电子设备功能固件,包括:In some embodiments, updating the electronic device function firmware written in the second chip according to the updated electronic device system firmware includes:

根据更新后的所述系统固件,获取所述功能固件的目标版本配置信息;Obtain the target version configuration information of the functional firmware according to the updated system firmware;

根据所述功能固件,获取所述功能固件的当前版本配置信息;According to the functional firmware, obtain the current version configuration information of the functional firmware;

在所述目标版本配置信息以及所述当前版本配置信息不匹配的情况下,根据更新后的所述系统固件,向所述第二芯片写入新数据,更新所述功能固件,以使更新后的所述系统固件与更新后的所述功能固件的版本相匹配。When the target version configuration information and the current version configuration information do not match, write new data to the second chip according to the updated system firmware, and update the functional firmware so that the updated The system firmware matches the updated version of the functional firmware.

如此,本申请能够根据已经更新好的系统固件中包括的功能固件信息,对各个功能硬件的控制芯片对应的功能固件进行更新,以保持系统固件与功能固件的版本匹配性,提高设备运行的可靠性。In this way, this application can update the functional firmware corresponding to the control chip of each functional hardware based on the functional firmware information included in the updated system firmware, so as to maintain the version matching between the system firmware and the functional firmware and improve the reliability of equipment operation. sex.

在某些实施方式中,所述根据所述电子设备功能固件,获取所述功能固件的当前版本配置信息,包括:In some embodiments, obtaining the current version configuration information of the functional firmware according to the functional firmware of the electronic device includes:

每间隔预设时长,获取所述功能固件的当前版本配置信息。At every preset interval, the current version configuration information of the functional firmware is obtained.

如此,本申请可以通过定时获取当前功能固件的版本配置信息,实现对功能固件的实时监控,从而实现随时根据系统固件对功能固件进行更新,以实时保证设备运行的可靠性。In this way, this application can achieve real-time monitoring of the functional firmware by regularly obtaining the version configuration information of the current functional firmware, thereby updating the functional firmware according to the system firmware at any time to ensure the reliability of equipment operation in real time.

本申请还提供一种清洁设备,包括存储器与处理器,所述存储器存储有计算机程序,在所述计算机程序被所述处理器执行的情况下,使得所述清洁设备执行如上述任一项实施方式所述的方法。This application also provides a cleaning device, including a memory and a processor. The memory stores a computer program. When the computer program is executed by the processor, the cleaning device executes any one of the above implementations. method as described.

本申请还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,在所述计算机程序被一个或多个处理器执行的情况下,实现如上述任一项实施方式所述的方法。This application also provides a computer-readable storage medium that stores a computer program. When the computer program is executed by one or more processors, the implementation of any of the above embodiments is implemented. method described.

本申请的实施方式的附加方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本申请的实施方式的实践了解到。Additional aspects and advantages of embodiments of the application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of embodiments of the application.

附图说明Description of the drawings

本申请上述的和/或附加的方面和优点从下面结合附图对实施例的描述中将变得明显和容易理解,其中:The above and/or additional aspects and advantages of the present application will become apparent and readily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

图1为本申请提供的电子设备固件更新方法的流程示意图;Figure 1 is a schematic flow chart of the electronic device firmware update method provided by this application;

图2为本申请提供的电子设备固件更新方法的流程示意图;Figure 2 is a schematic flow chart of the electronic device firmware update method provided by this application;

图3为本申请提供的电子设备固件更新方法的流程示意图;Figure 3 is a schematic flow chart of the electronic device firmware update method provided by this application;

图4为本申请提供的电子设备固件更新方法的流程示意图;Figure 4 is a schematic flow chart of the electronic device firmware update method provided by this application;

图5为本申请提供的电子设备固件更新方法的流程示意图;Figure 5 is a schematic flow chart of the electronic device firmware update method provided by this application;

图6为本申请提供的电子设备固件更新方法的流程示意图;Figure 6 is a schematic flow chart of the electronic device firmware update method provided by this application;

图7为本申请提供的电子设备固件更新方法的场景示意图。Figure 7 is a schematic diagram of a scenario of the electronic device firmware update method provided by this application.

具体实施方式Detailed ways

下面详细描述本申请的实施方式,实施方式的示例在附图中示出,其中,相同或类似的标号自始至终表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施方式是示例性的,仅用于解释本申请的实施方式,而不能理解为对本申请的实施方式的限制。The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements with the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the embodiments of the present application and cannot be understood as limiting the embodiments of the present application.

如图1所示,本申请提供了一种电子设备固件更新方法,其中电子设备包括第一芯片与第二芯片,上述方法具体包括如下步骤:As shown in Figure 1, this application provides a method for updating firmware of an electronic device, in which the electronic device includes a first chip and a second chip. The above method specifically includes the following steps:

01:获取固件更新文件;01: Get the firmware update file;

03:根据固件更新文件,更新写入第一芯片的电子设备系统固件;03: Update the electronic device system firmware written into the first chip according to the firmware update file;

05:根据更新后的电子设备系统固件,更新写入第二芯片的电子设备功能固件。05: Update the electronic device function firmware written into the second chip according to the updated electronic device system firmware.

本申请还提供一种电子设备固件更新装置,本申请的电子设备固件更新方法可以由电子设备固件更新装置实现。具体地,电子设备固件更新装置包括文件获取模块、系统固件更新模块以及功能固件更新模块,其中文件获取模块用于获取固件更新文件,系统固件更新模块用于根据固件更新文件,更新写入第一芯片的电子设备系统固件,功能固件更新模块用于根据更新后的电子设备系统固件,更新写入第二芯片的电子设备功能固件。The present application also provides an electronic device firmware update device. The electronic device firmware update method of the present application can be implemented by the electronic device firmware update device. Specifically, the electronic device firmware update device includes a file acquisition module, a system firmware update module and a functional firmware update module. The file acquisition module is used to acquire the firmware update file, and the system firmware update module is used to update the first file according to the firmware update file. The electronic device system firmware of the chip and the function firmware update module are used to update the electronic device function firmware written in the second chip according to the updated electronic device system firmware.

本申请还提供一种清洁设备,如清洁机器人、包含清洁机器人以及配套基站的清洁系统等设备,清洁设备可以执行本申请的电子设备固件更新方法。具体地,清洁设备包括存储器与处理器,其中存储器存储有计算机程序,处理器则用于获取固件更新文件,以及用于根据固件更新文件,更新写入第一芯片的电子设备系统固件,以及用于根据更新后的电子设备系统固件,更新写入第二芯片的电子设备功能固件。This application also provides a cleaning equipment, such as a cleaning robot, a cleaning system including a cleaning robot and a supporting base station, etc. The cleaning equipment can execute the electronic device firmware update method of this application. Specifically, the cleaning device includes a memory and a processor, where the memory stores a computer program, and the processor is used to obtain a firmware update file, and to update the electronic device system firmware written in the first chip according to the firmware update file, and use Update the electronic device function firmware written into the second chip according to the updated electronic device system firmware.

具体地,本申请涉及的电子设备一般包括多个芯片,包括第一芯片与第二芯片。其中第一芯片一般设置一个,用于充当电子设备的系统核心控制芯片,写入第一芯片的固件即为电子设备的系统固件。固件(firmware),也即硬件的驱动程序,用于使硬件在软件环境中能够正常运行。系统固件,一般指特定电子设备的操作系统,比如音乐播放器的操作系统、清洁设备的操作系统、电子辞典的操作系统等,均为系统固件。Specifically, the electronic device involved in this application generally includes multiple chips, including a first chip and a second chip. The first chip is generally provided to serve as the system core control chip of the electronic device, and the firmware written into the first chip is the system firmware of the electronic device. Firmware, also known as hardware driver, is used to enable the hardware to run normally in the software environment. System firmware generally refers to the operating system of a specific electronic device, such as the operating system of a music player, the operating system of a cleaning device, the operating system of an electronic dictionary, etc., all of which are system firmware.

上述电子设备还包括一个或多个第二芯片,用于充当电子设备中各个功能硬件的控制芯片,写入第二芯片的固件即为电子设备中各个功能硬件对应的功能固件。功能固件,一般指电子设备中用于使各个功能硬件对应的控制芯片在系统固件的软件环境下能够正常运行的驱动程序。比如清洁机器人中用于控制电动机的芯片对应的固件即为功能固件。The above-mentioned electronic device also includes one or more second chips used to serve as control chips for each functional hardware in the electronic device. The firmware written in the second chip is the functional firmware corresponding to each functional hardware in the electronic device. Functional firmware generally refers to the driver used in electronic equipment to enable the control chip corresponding to each functional hardware to operate normally in the software environment of the system firmware. For example, the firmware corresponding to the chip used to control the motor in a cleaning robot is functional firmware.

为了能够使电子设备的硬件运行不出现故障,则在电子设备的软件层面,系统固件与各功能固件之间的软件交互不能出现冲突或故障。而在相关技术中,系统固件升级后,由于各个功能固件需要在各个功能硬件控制芯片上各自独立地写入更新,则在功能固件未更新完毕的情况下,若系统固件与功能固件的版本不能兼容,则电子设备不能正常运转。In order to ensure that the hardware of the electronic device runs without failure, at the software level of the electronic device, there must be no conflicts or failures in the software interaction between the system firmware and each functional firmware. In related technologies, after the system firmware is upgraded, since each functional firmware needs to be independently written and updated on each functional hardware control chip, if the functional firmware has not been updated, if the versions of the system firmware and the functional firmware cannot be the same, If it is not compatible, the electronic device will not function properly.

故本申请提供的方案中,为了解决上述问题,在第一芯片与第二芯片之间添加了通信链路,以便于电子设备的系统在更新系统固件后能够将以系统固件为基准对各个功能固件进行更新。在某些示例中,电子设备首先通过与外界网络环境连接的通信链路下载获取固件更新文件,一般下载的固件更新文件保存于第一芯片中的一个临时存储区中。Therefore, in the solution provided by this application, in order to solve the above problem, a communication link is added between the first chip and the second chip, so that the system of the electronic device can use the system firmware as the basis for each function after updating the system firmware. The firmware is updated. In some examples, the electronic device first downloads and obtains the firmware update file through a communication link connected to the external network environment. Generally, the downloaded firmware update file is stored in a temporary storage area in the first chip.

为了保证更新不出现文件间的冲突,固件更新文件一般包括目标版本系统固件的全部文件,在写入第一芯片更新系统固件时则采用完全覆盖写入的方式。这样能够保证写入的系统固件是完整的,且其内部文件不会因部分覆盖而导致意料之外的不兼容问题。In order to ensure that there is no conflict between files in the update, the firmware update file generally includes all files of the target version of the system firmware. When writing the first chip update system firmware, a complete overwriting method is used. This ensures that the written system firmware is complete and that its internal files will not cause unexpected incompatibility issues due to partial overwriting.

在将固件更新文件完全写入第一芯片,完成系统固件的更新之后,利用第一芯片与第二芯片之间的通信链路,根据新版本系统固件中有关于各个功能固件的文件,向各第二芯片下发并写入新版本功能固件的更新文件。该更新文件可以包括新版本功能固件的全部文件,亦可以仅包括与当前版本功能固件间存在差异的文件。After the firmware update file is completely written into the first chip and the system firmware is updated, the communication link between the first chip and the second chip is used to update the system firmware to each function according to the files related to each functional firmware in the new version of the system firmware. The second chip issues and writes the update file of the new version of functional firmware. The update file may include all files of the new version of the functional firmware, or may only include files that are different from the current version of the functional firmware.

如此,本申请通过优先升级系统固件、再根据系统固件对功能固件进行升级,无需对功能硬件的控制芯片分别独立写入,有效地简化了固件更新的操作流程。此外,根据系统固件对功能固件更新,能够对系统固件以及功能固件的版本进行统一,避免由于固件版本的不一致可能导致的控制故障或功能失效,提高清洁设备运行的可靠性。In this way, this application prioritizes upgrading the system firmware and then upgrades the functional firmware based on the system firmware. This eliminates the need to write independent writes to the control chips of the functional hardware, effectively simplifying the firmware update operation process. In addition, updating the functional firmware according to the system firmware can unify the versions of the system firmware and functional firmware, avoid control failures or functional failures that may be caused by inconsistent firmware versions, and improve the reliability of the operation of the cleaning equipment.

如图2所示,在某些实施方式中,步骤01之后还包括:As shown in Figure 2, in some embodiments, after step 01, it also includes:

021:验证所述固件更新文件的签名信息,若签名信息错误,进入步骤022,若签名信息正确,进入步骤03;021: Verify the signature information of the firmware update file. If the signature information is wrong, go to step 022. If the signature information is correct, go to step 03;

022:终止电子设备固件更新的进程。022: Terminate the process of electronic device firmware update.

在某些实施方式中,电子设备固件更新装置还包括签名校验模块,用于验证所述固件更新文件的签名信息,以及用于终止电子设备固件更新的进程。In some embodiments, the electronic device firmware updating apparatus further includes a signature verification module for verifying the signature information of the firmware update file, and for terminating the electronic device firmware updating process.

在某些实施方式中,处理器还用于验证所述固件更新文件的签名信息,以及用于终止电子设备固件更新的进程。In some embodiments, the processor is further configured to verify the signature information of the firmware update file, and to terminate the process of updating the firmware of the electronic device.

具体地,为了保证在固件更新的过程中获取并保存的固件更新文件与发布者发布的固件更新文件一致,在某些示例中,在开始系统固件的更新之前,首先验证保存到临时存储区的固件更新文件的签名信息与电子设备通过外界网络环境获取到的该固件更新文件应有的签名信息是否一致,若一致则说明保存的固件更新文件可以用于系统固件的更新,若不一致则说明保存的固件更新文件可能被篡改,不能够用于固件更新。在这种情况下,应将系统固件的更新进程终止,避免固件更新后出现不可预知的问题。在更新进程终止后,若要继续进行固件更新,需要另外获取其他来源的固件更新文件,保证其签名信息与发布者发布的固件更新文件的签名信息一致。Specifically, in order to ensure that the firmware update file obtained and saved during the firmware update process is consistent with the firmware update file released by the publisher, in some examples, before starting the update of the system firmware, the file saved to the temporary storage area is first verified. Whether the signature information of the firmware update file is consistent with the signature information of the firmware update file obtained by the electronic device through the external network environment. If they are consistent, it means that the saved firmware update file can be used to update the system firmware. If they are inconsistent, it means that it is saved. The firmware update file may have been tampered with and cannot be used for firmware updates. In this case, the system firmware update process should be terminated to avoid unpredictable problems after the firmware update. After the update process is terminated, if you want to continue the firmware update, you need to obtain additional firmware update files from other sources to ensure that their signature information is consistent with the signature information of the firmware update file released by the publisher.

如此,本申请能够在更新固件前有限验证固件更新文件的正确性与真实性,避免更新过程出错,进而避免设备的运行因固件更新文件的错误而出现故障。In this way, this application can verify the correctness and authenticity of the firmware update file to a limited extent before updating the firmware, thereby avoiding errors in the update process and thus preventing the operation of the device from malfunctioning due to errors in the firmware update file.

如图3所示,在某些实施方式中,步骤03包括:As shown in Figure 3, in some embodiments, step 03 includes:

031:将电子设备置为第一状态,第一状态用于表示当前正在备份固件更新文件;031: Set the electronic device to the first state. The first state is used to indicate that the firmware update file is currently being backed up;

032:在第一状态下,将固件更新文件写入第一芯片的备份存储区;032: In the first state, write the firmware update file into the backup storage area of the first chip;

033:根据写入备份存储区的固件更新文件,更新系统固件。033: Update the system firmware according to the firmware update file written to the backup storage area.

在某些实施方式中,系统固件更新模块用于将电子设备置为第一状态,第一状态用于表示当前正在备份固件更新文件,以及用于在第一状态下,将固件更新文件写入第一芯片的备份存储区,以及用于根据写入备份存储区的固件更新文件,更新系统固件。In some embodiments, the system firmware update module is used to put the electronic device into a first state, the first state is used to indicate that the firmware update file is currently being backed up, and is used to write the firmware update file in the first state. The backup storage area of the first chip is used to update the system firmware according to the firmware update file written in the backup storage area.

在某些实施方式中,处理器还用于将电子设备置为第一状态,第一状态用于表示当前正在备份固件更新文件,以及用于在第一状态下,将固件更新文件写入第一芯片的备份存储区,以及用于根据写入备份存储区的固件更新文件,更新系统固件。In some implementations, the processor is further configured to put the electronic device into a first state, where the first state is used to indicate that the firmware update file is currently being backed up, and to write the firmware update file to the first state in the first state. A backup storage area of a chip, and used to update the system firmware according to the firmware update file written in the backup storage area.

具体地,接下来具体说明系统固件的更新过程。在某些示例中,第一芯片设置有专门用于存储升级状态标志位的区域,该区域存储的数据至少包括三种,其一表示当前正在备份固件更新文件的状态,其二表示当前正在升级系统固件的状态,其三表示当前系统固件升级完成的状态。在开始系统固件的升级过程之前,首先将升级状态标志位置为第一数据,对应于电子设备的第一状态,也即当前正在备份固件更新文件的状态,然后将存储于临时存储区的固件更新文件写入到第一芯片的备份存储区中。备份存储区,一般用于存放系统固件的备份,第一芯片中还设置有用于储存系统固件以使系统固件正常运行的固件存储区,备份存储区与固件存储区之间的数据写入相较于临时存储区而言更方便。另外,为了保证备份的数据不会轻易出现损毁、以使设备的恢复能够得到保证,备份存储区采用的一般是非易失性存储器,如ROM、EPROM、EEPROM等,本申请提供的方案利用备份存储区这一特性可以保证固件更新文件的存储稳定性。Specifically, the system firmware update process will be described in detail next. In some examples, the first chip is provided with an area specifically used to store upgrade status flag bits. The data stored in this area includes at least three types, one of which indicates that the firmware update file is currently being backed up, and the second indicates that the upgrade is currently being performed. The status of the system firmware, the third indicates the status of the current system firmware upgrade completion. Before starting the system firmware upgrade process, first set the upgrade status flag position to the first data, corresponding to the first status of the electronic device, that is, the status of the firmware update file currently being backed up, and then update the firmware stored in the temporary storage area. The file is written to the backup storage area of the first chip. The backup storage area is generally used to store backups of system firmware. The first chip is also provided with a firmware storage area for storing system firmware so that the system firmware can operate normally. Data writing between the backup storage area and the firmware storage area is compared. More convenient for temporary storage area. In addition, in order to ensure that the backed-up data will not be easily damaged and that the recovery of the device can be guaranteed, the backup storage area generally uses non-volatile memory, such as ROM, EPROM, EEPROM, etc. The solution provided by this application uses backup storage This feature ensures the storage stability of firmware update files.

在将固件更新文件写入备份存储区后,以备份存储区中存储的固件更新文件为基准更新系统固件,这样的方式能够有效保证更新过程中固件更新文件内容传输的稳定性,避免更新过程中出现文件复制错误。After the firmware update file is written to the backup storage area, the system firmware is updated based on the firmware update file stored in the backup storage area. This method can effectively ensure the stability of the transmission of the firmware update file content during the update process and avoid A file copy error occurred.

如此,本申请能够在获取到固件更新文件后先将其写入系统芯片的备份存储区,以便于后续固件更新过程中向系统芯片写入固件更新文件、以及避免在写入过程中出现文件复制错误。In this way, the present application can first write the firmware update file into the backup storage area of the system chip after obtaining it, so as to facilitate writing the firmware update file to the system chip during the subsequent firmware update process and avoid file copying during the writing process. mistake.

在某些实施方式中,步骤032包括:In some embodiments, step 032 includes:

在将固件更新文件写入备份存储区的过程中,若电子设备发生重启,根据电子设备重启之前固件更新文件向备份存储区的写入进度,继续将固件更新文件写入备份存储区;或者During the process of writing the firmware update file to the backup storage area, if the electronic device restarts, continue to write the firmware update file to the backup storage area based on the progress of writing the firmware update file to the backup storage area before the electronic device restarts; or

重新将固件更新文件写入备份存储区。Re-write the firmware update file to the backup storage area.

在某些实施方式中,系统固件更新模块还用于根据电子设备重启之前固件更新文件向备份存储区的写入进度,继续将固件更新文件写入备份存储区,以及用于重新将固件更新文件写入备份存储区。In some embodiments, the system firmware update module is also used to continue writing the firmware update file to the backup storage area based on the writing progress of the firmware update file to the backup storage area before the electronic device is restarted, and to re-write the firmware update file to the backup storage area. Write to the backup store.

在某些实施方式中,处理器还用于根据电子设备重启之前固件更新文件向备份存储区的写入进度,继续将固件更新文件写入备份存储区,以及用于重新将固件更新文件写入备份存储区。In some embodiments, the processor is also configured to continue writing the firmware update file to the backup storage area based on the writing progress of the firmware update file to the backup storage area before the electronic device is restarted, and to re-write the firmware update file to the backup storage area. Backup storage area.

具体地,对于电子设备而言,系统固件或操作系统的更新过程中是使用过程中最脆弱的时段,一旦在系统固件或操作系统的更新过程中设备出现掉电或其他干扰情况导致设备停止运转,那么在重新启动之后,由于系统底层的固件或操作系统被覆盖写入了一部分,且写入的文件不能够保证新写入的文件和没有被覆盖的文件能够共同支持固件或操作系统的运行,此时电子设备不能正常启动与运行,也即俗称的“更新掉电设备变砖头”的情况。Specifically, for electronic devices, the update process of system firmware or operating system is the most vulnerable period during use. Once the device experiences a power outage or other interference during the update process of system firmware or operating system, the device stops functioning. , then after restarting, because the underlying firmware or operating system of the system has been overwritten and written partially, and the written files cannot guarantee that the newly written files and the unoverwritten files can jointly support the operation of the firmware or operating system , at this time, the electronic equipment cannot start and operate normally, which is commonly known as "update power-off equipment becomes bricked".

为了避免这一情况,本申请在正式更新之前优先将固件更新文件优先写入到第一芯片的备份存储区中,而非直接从临时存储区更新系统固件,这样的缓冲设置能够避免在更新过程刚刚开始时设备掉电对系统固件本身造成影响。In order to avoid this situation, this application gives priority to writing the firmware update file to the backup storage area of the first chip before the official update, rather than directly updating the system firmware from the temporary storage area. Such a buffer setting can avoid The initial power outage of the device affects the system firmware itself.

在某些示例中,在将固件更新文件写入到第一芯片的备份存储区的过程中,若此时电子设备掉电或因其他干扰出现重新启动的情况,由于系统固件还没有出现变化,因此系统依然根据当前版本的系统固件正常启动。然后系统可以通过检测升级状态标志位的方式检测重启前电子设备所处的状态,若仍为当前正在备份固件更新文件的,则说明在重启前固件更新文件向备份存储区写入的过程没有做完。在某些示例中,系统也可以通过比对当前备份存储区内保存的文件与获取到的固件更新文件的一致性,若不一致则说明在重启前固件更新文件向备份存储区写入的过程没有做完。In some examples, during the process of writing the firmware update file to the backup storage area of the first chip, if the electronic device loses power or is restarted due to other interference, since the system firmware has not changed yet, Therefore, the system still starts normally based on the current version of the system firmware. The system can then detect the state of the electronic device before restarting by detecting the upgrade status flag bit. If the firmware update file is still being backed up, it means that the process of writing the firmware update file to the backup storage area was not done before the restart. over. In some examples, the system can also compare the consistency of the files saved in the current backup storage area with the obtained firmware update file. If they are inconsistent, it means that the process of writing the firmware update file to the backup storage area before restarting was not successful. Done.

在这种情况下,系统可以根据当前备份存储区内保存的文件与获取到的固件更新文件之间的差异,找到重启前将固件更新文件写入备份存储区的进度,并接续该进度继续向备份存储区写入固件更新文件。在另一些示例中,为了保证备份文件过程的稳妥性,系统也可以完全重新开始向备份存储区写入固件更新文件。具体重新应用固件更新文件方式并不限于上述两种,可以根据实际的应用场景与情况进行调整。In this case, the system can find the progress of writing the firmware update file to the backup storage area before restarting based on the difference between the file saved in the current backup storage area and the obtained firmware update file, and continue to proceed with the progress. Firmware update files are written to the backup storage area. In other examples, in order to ensure the stability of the backup file process, the system can also completely restart writing the firmware update file to the backup storage area. The specific method of re-applying the firmware update file is not limited to the above two, and can be adjusted according to the actual application scenario and situation.

如此,本申请能够在电子设备于将固件更新文件写入备份存储区的过程中因掉电或其他原因意外重启的情况下恢复上述过程,避免固件更新过程中因掉电或其他意外原因导致的电子设备固件损坏问题。In this way, the present application can restore the above-mentioned process when the electronic device unexpectedly restarts due to power outage or other reasons during the process of writing the firmware update file to the backup storage area, thereby avoiding the possibility of power outage or other unexpected reasons during the firmware update process. Electronic device firmware corruption issues.

如图4所示,在某些实施方式中,步骤033包括:As shown in Figure 4, in some embodiments, step 033 includes:

0331:将电子设备置为第二状态,第二状态用于表示当前正在更新系统固件;0331: Set the electronic device to the second state. The second state is used to indicate that the system firmware is currently being updated;

0332:在第二状态下,将写入备份存储区的固件更新文件覆盖写入第一芯片的固件存储区,更新系统固件。0332: In the second state, overwrite the firmware update file written in the backup storage area to the firmware storage area of the first chip to update the system firmware.

在某些实施方式中,系统固件更新模块用于将电子设备置为第二状态,第二状态用于表示当前正在更新系统固件,以及用于在第二状态下,将写入备份存储区的固件更新文件覆盖写入第一芯片的固件存储区,更新系统固件。In some embodiments, the system firmware update module is used to put the electronic device into a second state, the second state is used to indicate that the system firmware is currently being updated, and is used to write to the backup storage area in the second state. The firmware update file overwrites and writes the firmware storage area of the first chip to update the system firmware.

在某些实施方式中,处理器还用于将电子设备置为第二状态,第二状态用于表示当前正在更新系统固件,以及用于在第二状态下,将写入备份存储区的固件更新文件覆盖写入第一芯片的固件存储区,更新系统固件。In some embodiments, the processor is further configured to put the electronic device into a second state, the second state is used to indicate that the system firmware is currently being updated, and to write the firmware in the backup storage area in the second state. The update file overwrites and writes the firmware storage area of the first chip to update the system firmware.

具体地,在固件更新文件成功写入备份存储区后,系统固件的更新过程中准备工作部分已然完成,接下来需要将备份存储区中的数据覆盖写入固件存储区,以实现向第一芯片写入新版本的系统固件的目的。Specifically, after the firmware update file is successfully written into the backup storage area, the preparatory work in the system firmware update process has been completed. Next, the data in the backup storage area needs to be overwritten and written into the firmware storage area to realize the transfer to the first chip. The purpose of writing a new version of system firmware.

在某些示例中,为了表示当前电子设备的固件升级状态,将第一芯片升级状态标志位置为第二数据,对应于电子设备的第二状态,也即当前正在更新系统固件的状态。然后,系统直接将备份存储区中写入的固件更新文件以覆盖的方式写入第一芯片的固件存储区,以达到更新系统固件的目的。其中,覆盖写入的方式可以是直接将备份存储区中写入的固件更新文件完全覆盖写入固件存储区,即固件存储区中原本储存的文件会被新写入的文件直接覆盖抹除,也可以是比较备份存储区与固件存储区中的文件,将存在差异的文件覆盖写入固件存储区,以形成新版本的系统固件。In some examples, in order to indicate the current firmware upgrade status of the electronic device, the first chip upgrade status flag is set to the second data, corresponding to the second status of the electronic device, that is, the status in which the system firmware is currently being updated. Then, the system directly writes the firmware update file written in the backup storage area to the firmware storage area of the first chip in an overwriting manner to achieve the purpose of updating the system firmware. Among them, the method of overwriting can be to directly overwrite the firmware update file written in the backup storage area and write it into the firmware storage area. That is, the files originally stored in the firmware storage area will be directly overwritten and erased by the newly written files. Alternatively, the files in the backup storage area and the firmware storage area can be compared, and the files with differences can be overwritten and written into the firmware storage area to form a new version of the system firmware.

如此,本申请能够将写入备份存储区的固件更新文件写入系统芯片的固件存储区,以恢复备份的方式实现对系统固件的更新。In this way, the present application can write the firmware update file written in the backup storage area into the firmware storage area of the system chip, and update the system firmware by restoring the backup.

在某些实施方式中,步骤033还包括:In some embodiments, step 033 also includes:

在将备份固件更新文件覆盖写入固件存储区的情况下,若电子设备重启,验证电子设备的状态;When the backup firmware update file is overwritten into the firmware storage area, if the electronic device is restarted, verify the status of the electronic device;

在电子设备处于第二状态下的情况下,重新将写入备份存储区的固件更新文件覆盖写入固件存储区。When the electronic device is in the second state, the firmware update file written in the backup storage area is overwritten and written into the firmware storage area again.

在某些实施方式中,系统固件更新模块还用于在将备份固件更新文件覆盖写入固件存储区的情况下,若电子设备重启,验证电子设备的状态,以及用于在电子设备处于第二状态下的情况下,重新将写入备份存储区的固件更新文件覆盖写入固件存储区。In some embodiments, the system firmware update module is also used to verify the status of the electronic device if the electronic device restarts when the backup firmware update file is overwritten and written into the firmware storage area, and is used to verify the status of the electronic device when the electronic device is in the second state. If the status is in the status, re-write the firmware update file written to the backup storage area to the firmware storage area.

在某些实施方式中,处理器还用于在将备份固件更新文件覆盖写入固件存储区的情况下,若电子设备重启,验证电子设备的状态,以及用于在电子设备处于第二状态下的情况下,重新将写入备份存储区的固件更新文件覆盖写入固件存储区。In some embodiments, the processor is also configured to verify the status of the electronic device if the electronic device restarts when the backup firmware update file is overwritten and written into the firmware storage area, and is configured to verify the status of the electronic device when the electronic device is in the second state. In the case of , re-write the firmware update file written to the backup storage area to the firmware storage area.

具体地,对于电子设备而言,系统固件或操作系统的更新过程是使用过程中最脆弱的时段,一旦在系统固件或操作系统的更新过程中设备出现掉电或其他干扰情况导致设备停止运转,那么在重新启动之后,由于系统底层的固件或操作系统被覆盖写入了一部分,且写入的文件不能够保证新写入的文件和没有被覆盖的文件能够共同支持固件或操作系统的运行,此时电子设备不能正常启动与运行,也即俗称的“更新掉电设备变砖头”的情况。Specifically, for electronic devices, the update process of system firmware or operating system is the most vulnerable period during use. Once the device experiences a power outage or other interference during the update process of system firmware or operating system, causing the device to stop functioning, Then after restarting, because the underlying firmware or operating system of the system has been overwritten and partially written, and the written files cannot guarantee that the newly written files and the unoverwritten files can jointly support the operation of the firmware or operating system, At this time, the electronic equipment cannot start and operate normally, which is commonly known as "update power-off equipment becomes bricked".

为了避免这一情况,本申请提供的系统固件的更新过程中优先将固件更新文件写入了第一芯片的备份存储区,即将原本用于存储系统备份文件以便于系统恢复的区域用于存储固件更新文件,换言之在固件更新写入的过程中实际上是将固件更新文件当作备份文件直接写入固件存储区,利用原本是恢复备份的方式实现系统固件的更新。这样的更新方式,在电子设备意外停止运转,并重启导致原有的固件因为写入新数据而被破坏的情况下,通过恢复备份的方式实现了系统固件的更新,备份存储区保存的固件更新文件写入固件存储区的过程完毕并重启设备后,系统固件即为完整的新版本系统固件,能够正常运行。In order to avoid this situation, during the update process of the system firmware provided by this application, the firmware update file is first written into the backup storage area of the first chip, that is, the area originally used to store system backup files to facilitate system recovery is used to store the firmware. The update file, in other words, during the process of writing the firmware update, the firmware update file is actually written directly into the firmware storage area as a backup file, and the system firmware is updated using the original backup method. With this update method, when the electronic device unexpectedly stops operating and restarts, causing the original firmware to be destroyed due to writing of new data, the system firmware is updated by restoring the backup, and the firmware saved in the backup storage area is updated. After the process of writing the file to the firmware storage area is completed and the device is restarted, the system firmware will be a complete new version of the system firmware and can run normally.

在某些示例中,若在备份存储区的固件更新文件写入固件存储区的过程中,电子设备意外掉电或意外停止运转。重启后首先确认升级状态标志位,若其表明当前设备仍处于正在升级系统固件的第二状态,则重新开始将备份存储区的固件更新文件写入固件存储区的过程,至该过程结束时主动控制电子设备重启以启用新写入的系统固件。重启后,新写入的系统固件生效并启用,电子设备的运行恢复正常。In some examples, if the electronic device unexpectedly loses power or stops operating unexpectedly during the process of writing the firmware update file in the backup storage area to the firmware storage area. After restarting, first confirm the upgrade status flag. If it indicates that the current device is still in the second state of upgrading the system firmware, then restart the process of writing the firmware update file in the backup storage area to the firmware storage area. At the end of the process, it will automatically Control electronics reboot to enable newly written system firmware. After restarting, the newly written system firmware takes effect and is enabled, and the operation of the electronic device returns to normal.

如此,本申请能够通过从备份存储区向固件存储区恢复文件的方式,在电子设备将固件更新文件从备份存储区写入固件存储区的过程中,因掉电或其他原因意外重启的情况下恢复上述过程,可避免固件更新过程中因掉电或其他意外原因导致的电子设备固件损坏问题。In this way, this application can recover files from the backup storage area to the firmware storage area, in the process of the electronic device writing the firmware update file from the backup storage area to the firmware storage area, and it restarts unexpectedly due to power outage or other reasons. Restoring the above process can avoid the problem of electronic device firmware damage caused by power outage or other unexpected reasons during the firmware update process.

如图5所示,在某些实施方式中,步骤03之后还包括:As shown in Figure 5, in some embodiments, after step 03, it also includes:

04:将电子设备置为第三状态,并控制电子设备重启,第三状态表示系统固件升级完毕。04: Set the electronic device to the third state and control the electronic device to restart. The third state indicates that the system firmware upgrade is completed.

在某些实施方式中,电子设备固件更新装置还包括系统固件更新终止模块,用于将电子设备置为第三状态,并控制电子设备重启,第三状态表示系统固件升级完毕。In some embodiments, the electronic device firmware updating device further includes a system firmware update termination module, which is used to set the electronic device to a third state and control the electronic device to restart. The third state indicates that the system firmware upgrade is completed.

在某些实施方式中,处理器还用于将电子设备置为第三状态,并控制电子设备重启,第三状态表示系统固件升级完毕。In some embodiments, the processor is also used to set the electronic device to a third state and control the electronic device to restart. The third state indicates that the system firmware upgrade is completed.

具体地,在固件更新文件写入固件存储区后,需要重新启动电子设备以实现新版本系统固件的应用。在上文所述的实施方式的基础上,由于重启后系统会验证当前升级状态标志位的数据,为了避免陷入无限重新写入固件更新文件的循环,在重启电子设备以应用新版本系统固件之前,第一芯片首先将升级状态标志位的数据置为第三数据,对应电子设备的第三状态,也即对应于电子设备当前系统固件升级完毕的状态,然后再执行重新启动。这样做,则重新启动后即以新版本的系统固件启动电子设备。Specifically, after the firmware update file is written into the firmware storage area, the electronic device needs to be restarted to implement the application of the new version of the system firmware. Based on the implementation described above, since the system will verify the data of the current upgrade status flag after restarting, in order to avoid falling into an endless cycle of rewriting the firmware update file, before restarting the electronic device to apply the new version of the system firmware , the first chip first sets the data of the upgrade status flag bit to the third data, corresponding to the third status of the electronic device, that is, corresponding to the status of the current system firmware upgrade of the electronic device, and then performs a restart. By doing so, the electronic device will start with a new version of the system firmware after a reboot.

如此,本申请能够通过设置自身状态并重启的方式应用新写入的固件,并结束系统固件的更新过程。In this way, this application can apply the newly written firmware by setting its own status and restarting, and end the system firmware update process.

如去6所示,在某些实施方式中,步骤05包括:As shown in step 6, in some embodiments, step 05 includes:

051:根据更新后的系统固件,获取功能固件的目标版本配置信息;051: Obtain the target version configuration information of the functional firmware based on the updated system firmware;

052:根据功能固件,获取功能固件的当前版本配置信息;052: According to the function firmware, obtain the current version configuration information of the function firmware;

053:在目标版本配置信息以及当前版本配置信息不匹配的情况下,根据更新后的系统固件,向第二芯片写入新数据,更新功能固件。053: When the target version configuration information and the current version configuration information do not match, write new data to the second chip according to the updated system firmware, and update the functional firmware.

在某些实施方式中,功能固件更新模块用于根据更新后的系统固件,获取功能固件的目标版本配置信息,以及用于根据功能固件,获取功能固件的当前版本配置信息,以及用于在目标版本配置信息以及当前版本配置信息不匹配的情况下,根据更新后的系统固件,向第二芯片写入新数据,更新功能固件。In some embodiments, the functional firmware update module is used to obtain the target version configuration information of the functional firmware based on the updated system firmware, and is used to obtain the current version configuration information of the functional firmware based on the functional firmware, and is used to perform the target version on the target If the version configuration information does not match the current version configuration information, new data is written to the second chip according to the updated system firmware, and the functional firmware is updated.

在某些实施方式中,处理器还用于根据更新后的系统固件,获取功能固件的目标版本配置信息,以及用于根据功能固件,获取功能固件的当前版本配置信息,以及用于在目标版本配置信息以及当前版本配置信息不匹配的情况下,根据更新后的系统固件,向第二芯片写入新数据,更新功能固件。In some implementations, the processor is further configured to obtain the target version configuration information of the functional firmware based on the updated system firmware, and to obtain the current version configuration information of the functional firmware based on the functional firmware, and to obtain the target version configuration information of the functional firmware based on the updated system firmware. If the configuration information does not match the current version configuration information, new data is written to the second chip according to the updated system firmware, and the functional firmware is updated.

具体地,在系统固件更新完成后,系统从更新好的系统固件中获取当前版本系统固件能够匹配支持的功能固件的版本号以及与该版本号对应的功能固件配置文件,并将上述获取到的信息与当前电子设备的各个功能硬件对应的功能固件的版本号以及功能固件配置文件进行比较,若二者不一致则需要通过第一芯片与第二芯片之间的通讯链路根据系统固件对功能固件进行更新。Specifically, after the system firmware update is completed, the system obtains the version number of the current version of the system firmware that can match the supported functional firmware and the functional firmware configuration file corresponding to the version number from the updated system firmware, and obtains the above-mentioned The information is compared with the version number of the functional firmware and the functional firmware configuration file corresponding to each functional hardware of the current electronic device. If the two are inconsistent, the functional firmware needs to be updated according to the system firmware through the communication link between the first chip and the second chip. Make an update.

一般同一版本的系统固件与功能固件一定能够匹配支持,系统固件也能够对当前版本之前的多个历史版本的功能固件兼容支持,也即并非是每次系统固件的更新都伴随着功能固件的更新,但当系统固件的版本较新、不再兼容功能固件的过旧版本的情况下,功能固件就需要根据新版本的系统固件一同更新。为了能够使系统固件对功能固件兼容的时间足够长,在根据系统固件更新功能固件时应将功能固件更新后的版本号与新版本的系统固件的版本号相同。另外,为了能够使系统固件对功能固件的兼容性更好,在根据系统固件更新功能固件时应将功能固件更新后的版本更新到新版本系统固件能够最稳定兼容支持的版本。Generally, system firmware and functional firmware of the same version must be matched and supported. System firmware can also be compatible with functional firmware of multiple historical versions before the current version. That is, not every update of system firmware is accompanied by an update of functional firmware. However, when the system firmware version is newer and is no longer compatible with the older version of the functional firmware, the functional firmware needs to be updated together with the new version of the system firmware. In order to make the system firmware compatible with the functional firmware for a long enough time, when updating the functional firmware according to the system firmware, the updated version number of the functional firmware should be the same as the version number of the new version of the system firmware. In addition, in order to make the system firmware more compatible with the functional firmware, when updating the functional firmware based on the system firmware, the updated version of the functional firmware should be updated to the version that the new version of the system firmware is most stable compatible with and supported.

比如在某些示例中,当前更新完成的系统固件版本为v1.5.1.6,其兼容的功能固件版本范围为v1.5.1.3~v1.5.1.6,而当前某第二芯片对应的功能硬件的功能固件的版本为v1.5.1.1,也即当前功能固件的版本不在更新过后的系统固件的兼容支持范围内,需要根据系统固件对功能固件进行更新。此时系统会从第二芯片获取功能固件的版本配置信息,同时从第一芯片根据刚更新好的系统固件获取新版本功能固件的版本配置信息,将获取到的两组版本配置信息进行比对,比对结果为不匹配。故此时系统根据系统固件中包含的新版本功能固件的文件内容或引导新版本功能固件生成的文件内容,将功能固件更新过程需要的文件从第一芯片发送到第二芯片并写入第二芯片,以实现功能固件的更新。更新后功能固件的版本只需在v1.5.1.3~v1.5.1.6的范围内择一更新即可。For example, in some examples, the currently updated system firmware version is v1.5.1.6, and its compatible function firmware version range is v1.5.1.3~v1.5.1.6, and the functions corresponding to a certain second chip are currently The functional firmware version of the hardware is v1.5.1.1, which means that the current functional firmware version is not within the compatible support range of the updated system firmware, and the functional firmware needs to be updated according to the system firmware. At this time, the system will obtain the version configuration information of the functional firmware from the second chip, and at the same time obtain the version configuration information of the new version of the functional firmware from the first chip based on the newly updated system firmware, and compare the obtained two sets of version configuration information. , the comparison result is no match. Therefore, at this time, the system sends the files required for the functional firmware update process from the first chip to the second chip and writes them into the second chip based on the file content of the new version of the functional firmware contained in the system firmware or the file content generated by booting the new version of the functional firmware. , to achieve functional firmware updates. The updated functional firmware version only needs to be updated within the range of v1.5.1.3~v1.5.1.6.

如此,本申请能够根据已经更新好的系统固件中包括的功能固件信息,对各个功能硬件的控制芯片对应的功能固件进行更新,以保持系统固件与功能固件的版本匹配性,提高设备运行的可靠性。In this way, this application can update the functional firmware corresponding to the control chip of each functional hardware based on the functional firmware information included in the updated system firmware, so as to maintain the version matching between the system firmware and the functional firmware and improve the reliability of equipment operation. sex.

在某些实施方式中,步骤052包括:In some embodiments, step 052 includes:

每间隔预设时长,获取功能固件的当前版本配置信息。Every preset interval, the current version configuration information of the function firmware is obtained.

在某些实施方式中,功能固件更新模块还用于每间隔预设时长,获取功能固件的当前版本配置信息。In some implementations, the functional firmware update module is also used to obtain the current version configuration information of the functional firmware at preset intervals.

在某些实施方式中,处理器还用于每间隔预设时长,获取功能固件的当前版本配置信息。In some implementations, the processor is also configured to obtain the current version configuration information of the functional firmware at preset intervals.

具体地,除了系统固件更新完毕后这一时间以外,在电子设备的日常运行中,功能固件在系统中的运行有可能出现意外的错误,从而导致功能固件与系统固件突然不匹配或不兼容的情况。为了避免这种情况对电子设备正常使用的影响,每隔预设时长,系统就会获取一次功能固件的当前版本配置信息,以便于与当前系统固件提供的版本配置信息进行比较,观察其是否匹配。如果出现了功能固件出错的情况,即可以通过这样的方式发现,然后通过上文所述的更新功能固件版本的方法将功能固件与系统固件之间的匹配关系恢复,避免设备运行出现故障。对于预设时长,可以在系统运行效率和对设备异常的监控力度之中选择一个平衡点来设定,一般可以设置为20s~40s之间的任意值,在某些示例中设置预设时长为30s,即每30s获取一次功能固件的当前版本配置信息。Specifically, in addition to the time after the system firmware is updated, during the daily operation of the electronic device, unexpected errors may occur in the operation of the functional firmware in the system, resulting in a sudden mismatch or incompatibility between the functional firmware and the system firmware. Condition. In order to avoid the impact of this situation on the normal use of electronic equipment, the system will obtain the current version configuration information of the functional firmware every preset period of time in order to compare it with the version configuration information provided by the current system firmware to observe whether it matches. . If a functional firmware error occurs, it can be discovered in this way, and then the matching relationship between the functional firmware and the system firmware can be restored by updating the functional firmware version as described above to avoid equipment operation failures. For the preset time, you can choose a balance point between system operating efficiency and monitoring of equipment abnormalities. Generally, it can be set to any value between 20s and 40s. In some examples, the preset time is set to 30s, that is, the current version configuration information of the functional firmware is obtained every 30s.

如此,本申请可以通过定时获取当前功能固件的版本配置信息,实现对功能固件的实时监控,从而实现随时根据系统固件对功能固件进行更新,以实时保证设备运行的可靠性。In this way, this application can achieve real-time monitoring of the functional firmware by regularly obtaining the version configuration information of the current functional firmware, thereby updating the functional firmware according to the system firmware at any time to ensure the reliability of equipment operation in real time.

如图7所示,接下来示例性说明本申请实施方式提供的电子设备固件更新方法。第一芯片中至少包括升级状态标志位、固件存储区、备份存储区以及临时存储区等部分。首先第一芯片将从外部网络环境获取到的固件更新文件保存到临时存储区,然后开始系统固件更新过程,将升级状态标志位置为第一数据,表示当前正在备份固件更新文件,同时从临时存储区将固件更新文件复制写入到备份存储区中。复制写入完成后,将升级状态标志位置为第二数据,表示当前正在更新系统固件,同时从备份存储区将固件更新文件覆盖写入固件存储区,以得到新版本的系统固件。在写入完成后,将升级状态标志位置为第三数据,表示系统固件更新完成,然后即可以根据新版本的系统固件,对设备上用于控制其他功能硬件的第二芯片对应的功能固件进行更新。As shown in FIG. 7 , the electronic device firmware update method provided by the embodiment of the present application is exemplified below. The first chip at least includes upgrade status flag bits, firmware storage area, backup storage area and temporary storage area. First, the first chip saves the firmware update file obtained from the external network environment to the temporary storage area, and then starts the system firmware update process, setting the upgrade status flag position to the first data, indicating that the firmware update file is currently being backed up, and at the same time, it reads the firmware update file from the temporary storage area. Copy and write the firmware update file to the backup storage area. After the copy and write is completed, the upgrade status flag position is set to the second data, indicating that the system firmware is currently being updated, and at the same time, the firmware update file is overwritten from the backup storage area into the firmware storage area to obtain a new version of the system firmware. After the writing is completed, the upgrade status flag position is set to the third data, indicating that the system firmware update is completed, and then the functional firmware corresponding to the second chip used to control other functional hardware on the device can be updated based on the new version of the system firmware. renew.

本申请还提供一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,在计算机程序被一个或多个处理器执行的情况下,实现如上述任一项实施方式的电子设备固件更新方法。This application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by one or more processors, the electronic device firmware update according to any of the above embodiments is implemented. method.

在本说明书的描述中,参考术语“某些实施方式”、“一个例子中”、“示例地”等的描述意指结合实施方式或示例描述的具体特征、结构、材料或者特点包含于本申请的至少一个实施方式或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施方式或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施方式或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。In the description of this specification, reference to the terms "certain embodiments," "in an example," "exemplarily," etc., means that a specific feature, structure, material, or characteristic described in connection with the embodiment or example is included herein. In at least one embodiment or example. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, those skilled in the art may combine and combine different embodiments or examples and features of different embodiments or examples described in this specification unless they are inconsistent with each other.

流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本申请的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本申请的实施例所属技术领域的技术人员所理解。Any process or method descriptions in flowcharts or otherwise described herein may be understood to represent modules, segments, or portions of code that include one or more executable instructions for implementing the specified logical functions or steps of the process. , and the scope of the preferred embodiments of the present application includes additional implementations in which functions may be performed out of the order shown or discussed, including in a substantially simultaneous manner or in the reverse order, depending on the functionality involved, which shall It should be understood by those skilled in the technical field to which the embodiments of this application belong.

尽管上面已经示出和描述了本申请的实施方式,可以理解的是,上述实施方式是示例性的,不能理解为对本申请的限制,本领域的普通技术人员在本申请的范围内可以对上述实施方式进行变化、修改、替换和变型。Although the embodiments of the present application have been shown and described above, it can be understood that the above-mentioned embodiments are exemplary and cannot be construed as limitations of the present application. Those of ordinary skill in the art can make modifications to the above-mentioned embodiments within the scope of the present application. The embodiments are subject to changes, modifications, substitutions and variations.

Claims (11)

1.一种电子设备固件更新方法,其特征在于,所述电子设备包括第一芯片与第二芯片,所述方法包括:1. A method for updating firmware of an electronic device, characterized in that the electronic device includes a first chip and a second chip, and the method includes: 获取固件更新文件;Get firmware update files; 根据所述固件更新文件,更新写入所述第一芯片的电子设备系统固件;Update the electronic device system firmware written in the first chip according to the firmware update file; 根据更新后的所述电子设备系统固件,更新写入所述第二芯片的电子设备功能固件。Update the electronic device function firmware written in the second chip according to the updated electronic device system firmware. 2.根据权利要求1所述的方法,其特征在于,所述获取固件更新文件,之后还包括:2. The method according to claim 1, characterized in that said obtaining a firmware update file further includes: 验证所述固件更新文件的签名信息;Verify the signature information of the firmware update file; 在所述签名信息错误的情况下,终止所述电子设备固件更新的进程。If the signature information is incorrect, the electronic device firmware update process is terminated. 3.根据权利要求1所述的方法,其特征在于,所述根据所述固件更新文件,更新写入所述第一芯片的电子设备系统固件,包括:3. The method of claim 1, wherein updating the electronic device system firmware written in the first chip according to the firmware update file includes: 将所述电子设备置为第一状态,所述第一状态用于表示当前正在备份所述固件更新文件;Set the electronic device to a first state, where the first state is used to indicate that the firmware update file is currently being backed up; 在所述第一状态下,将所述固件更新文件写入所述第一芯片的备份存储区;In the first state, write the firmware update file into the backup storage area of the first chip; 根据写入所述备份存储区的所述固件更新文件,更新所述系统固件。The system firmware is updated according to the firmware update file written in the backup storage area. 4.根据权利要求3所述的方法,其特征在于,所述在所述第一状态下,将所述固件更新文件写入所述电子设备的备份存储区,包括:4. The method according to claim 3, characterized in that, in the first state, writing the firmware update file into the backup storage area of the electronic device includes: 在将所述固件更新文件写入所述备份存储区的过程中,若所述电子设备发生重启,根据所述电子设备重启之前所述固件更新文件向所述备份存储区的写入进度,继续将所述固件更新文件写入所述备份存储区;或者During the process of writing the firmware update file to the backup storage area, if the electronic device restarts, continue based on the writing progress of the firmware update file to the backup storage area before the electronic device restarts. Write the firmware update file into the backup storage area; or 重新将所述固件更新文件写入所述备份存储区。The firmware update file is re-written into the backup storage area. 5.根据权利要求3所述的方法,其特征在于,所述根据写入所述备份存储区的所述固件更新文件,更新所述系统固件,包括:5. The method of claim 3, wherein updating the system firmware according to the firmware update file written in the backup storage area includes: 将所述电子设备置为第二状态,所述第二状态用于表示当前正在更新所述系统固件;Set the electronic device to a second state, where the second state is used to indicate that the system firmware is currently being updated; 在所述第二状态下,将写入所述备份存储区的所述固件更新文件覆盖写入所述第一芯片的固件存储区,更新所述系统固件。In the second state, the firmware update file written in the backup storage area is overwritten and written in the firmware storage area of the first chip to update the system firmware. 6.根据权利要求5所述的方法,其特征在于,所述根据写入所述备份存储区的所述固件更新文件,更新所述系统固件,还包括:6. The method of claim 5, wherein updating the system firmware according to the firmware update file written in the backup storage area further includes: 在所述将所述备份固件更新文件覆盖写入所述固件存储区的情况下,若所述电子设备重启,验证所述电子设备的状态;In the case where the backup firmware update file is overwritten and written into the firmware storage area, if the electronic device is restarted, verify the status of the electronic device; 在所述电子设备处于所述第二状态下的情况下,重新将写入所述备份存储区的所述固件更新文件覆盖写入所述固件存储区。When the electronic device is in the second state, the firmware update file written in the backup storage area is overwritten and written into the firmware storage area again. 7.根据所述权利要求3-6任一项所述的方法,其特征在于,所述根据写入所述备份存储区的所述固件更新文件,更新所述系统固件,之后还包括:7. The method according to any one of claims 3-6, characterized in that, updating the system firmware according to the firmware update file written in the backup storage area, and then further comprising: 将所述电子设备置为第三状态,并控制所述电子设备重启,所述第三状态表示所述系统固件升级完毕。The electronic device is set to a third state, and the electronic device is controlled to restart. The third state indicates that the system firmware upgrade is completed. 8.根据权利要求1所述的方法,其特征在于,所述根据更新后的所述电子设备系统固件,更新写入所述第二芯片的电子设备功能固件,包括:8. The method according to claim 1, wherein updating the electronic device function firmware written in the second chip according to the updated electronic device system firmware includes: 根据更新后的所述系统固件,获取所述功能固件的目标版本配置信息;Obtain the target version configuration information of the functional firmware according to the updated system firmware; 根据所述功能固件,获取所述功能固件的当前版本配置信息;According to the functional firmware, obtain the current version configuration information of the functional firmware; 在所述目标版本配置信息以及所述当前版本配置信息不匹配的情况下,根据更新后的所述系统固件,向所述第二芯片写入新数据,更新所述功能固件,以使更新后的所述系统固件与更新后的所述功能固件的版本相匹配。When the target version configuration information and the current version configuration information do not match, write new data to the second chip according to the updated system firmware, and update the functional firmware so that the updated The system firmware matches the updated version of the functional firmware. 9.根据权利要求8所述的方法,其特征在于,所述根据所述电子设备功能固件,获取所述功能固件的当前版本配置信息,包括:9. The method according to claim 8, characterized in that, obtaining the current version configuration information of the functional firmware according to the functional firmware of the electronic device includes: 每间隔预设时长,获取所述功能固件的当前版本配置信息。At every preset interval, the current version configuration information of the functional firmware is obtained. 10.一种清洁设备,其特征在于,所述清洁设备包括存储器与处理器,所述存储器存储有计算机程序,在所述计算机程序被所述处理器执行的情况下,使得所述清洁设备执行如权利要求1-9任一项所述的方法。10. A cleaning device, characterized in that the cleaning device includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the cleaning device is caused to execute The method according to any one of claims 1-9. 11.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,在所述计算机程序被一个或多个处理器执行的情况下,实现所述权利要求1-9任一项所述的方法。11. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, and when the computer program is executed by one or more processors, the claim 1- The method described in any one of 9.
CN202310480907.1A 2023-04-27 2023-04-27 Electronic device firmware updating method, cleaning device and storage medium Pending CN116909611A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310480907.1A CN116909611A (en) 2023-04-27 2023-04-27 Electronic device firmware updating method, cleaning device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310480907.1A CN116909611A (en) 2023-04-27 2023-04-27 Electronic device firmware updating method, cleaning device and storage medium

Publications (1)

Publication Number Publication Date
CN116909611A true CN116909611A (en) 2023-10-20

Family

ID=88349938

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310480907.1A Pending CN116909611A (en) 2023-04-27 2023-04-27 Electronic device firmware updating method, cleaning device and storage medium

Country Status (1)

Country Link
CN (1) CN116909611A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117215621A (en) * 2023-11-02 2023-12-12 北京紫光青藤微系统有限公司 Method, device and system for updating firmware of electronic equipment
CN119690491A (en) * 2024-11-14 2025-03-25 北京一起教育科技发展有限公司 Unified differential OTA method, system, product and medium for dot matrix pen
CN120276755A (en) * 2025-06-03 2025-07-08 苏州元脑智能科技有限公司 Firmware refreshing method, device, equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117215621A (en) * 2023-11-02 2023-12-12 北京紫光青藤微系统有限公司 Method, device and system for updating firmware of electronic equipment
CN119690491A (en) * 2024-11-14 2025-03-25 北京一起教育科技发展有限公司 Unified differential OTA method, system, product and medium for dot matrix pen
CN120276755A (en) * 2025-06-03 2025-07-08 苏州元脑智能科技有限公司 Firmware refreshing method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN116909611A (en) Electronic device firmware updating method, cleaning device and storage medium
US20100169709A1 (en) System Of Updating Firmware And Method Thereof, And Method Of Creating Firmware
CN103299276B (en) Software Update Process for Embedded Devices
US8539471B2 (en) Updating firmware of an electronic device
CN104025047B (en) Information processor, information processing method and computer program
US20110004871A1 (en) Embedded electronic device and firmware updating method thereof
US20110320794A1 (en) Flash System And Method For Updating The Flash System
TWI490876B (en) System startup boot processing method and device
CN101188516B (en) A highly reliable and self-adapted remote update method for network device software system
CN104427119B (en) Communication terminal and its processing method of Nonvolatile data
CN103562875A (en) Failsafe firmware update
CN115718610A (en) A Reliable Method for Updating the Application Program of Single Chip Microcomputer
CN118656101A (en) Baseboard management controller firmware upgrade method, device, equipment and medium
CN114265603B (en) System upgrade method, device and electronic device based on asymmetric partitioning
CN104427120B (en) Communication terminal and its processing method of Nonvolatile data
CN117407020A (en) OTA upgrade refreshing method and device, electronic equipment and storage medium
CN116257384A (en) Terminal startup method, electronic device, and computer-readable storage medium
CN113157303A (en) Upgrading method, embedded system, terminal and computer storage medium
JP2005284902A (en) Terminal device, control method and control program thereof, host device, control method and control program thereof, and method, system, and program for remote updating
CN113176891B (en) Bootloader-based ECU (electronic control Unit) program programming method with backup function
TWI889987B (en) Storage device and method and article for bootup activation of firmware images
CN119806571A (en) Firmware upgrade method, electronic device and computer readable storage medium
CN113691845A (en) A power-off protection method for partition upgrade of digital set-top box
CN111857753A (en) A kind of BMC startup method and related device
US9971659B1 (en) Memory programming providing corruption protection

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