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

Abstract

The application discloses a method for updating firmware of electronic equipment, which comprises a first chip and a second chip, wherein the method comprises the following steps: acquiring a firmware update file; updating the system firmware of the electronic equipment written in the first chip according to the firmware updating file; and updating the electronic equipment function firmware written in the second chip according to the updated electronic equipment system firmware. Therefore, the application upgrades the system firmware preferentially and upgrades the functional firmware according to the system firmware, and the control chip of the functional hardware does not need to be written in independently, thus effectively simplifying the operation flow of firmware updating. In addition, the functional firmware is updated according to the system firmware, the system firmware and the versions of the functional firmware can be unified, control faults or functional failures possibly caused by inconsistent versions of the firmware are avoided, and the running reliability of the cleaning equipment is improved.

Description

Electronic device firmware updating method, cleaning device and storage medium
Technical Field
The present application relates to the technical field of electronic devices, and in particular, to a method for updating firmware of an electronic device, a cleaning device, and a computer readable storage medium.
Background
In the related art, the system chip and the control chip corresponding to the plurality of functional hardware are combined into the same device, so that the electronic device for realizing control is more widely applied, and the firmware upgrading frequency of the system chip and the control chip of the functional hardware is higher, but because the system chip and the control chip of the functional hardware are generally arranged separately in the electronic device and the models are not necessarily completely matched, the problem that errors occur in firmware version and synergy among the chips possibly occurs, and the operation of the device is caused to be faulty.
Disclosure of Invention
The application provides an electronic device firmware updating method, a cleaning device and a computer readable storage medium.
The embodiment of the application relates to electronic equipment, which comprises a first chip and a second chip, and the method for updating the firmware of the electronic equipment comprises the following steps:
acquiring a firmware update file;
updating the system firmware of the electronic equipment written in the first chip according to the firmware updating file;
and updating the electronic equipment function firmware written in the second chip according to the updated electronic equipment system firmware.
Therefore, the application upgrades the system firmware preferentially and upgrades the functional firmware according to the system firmware, and the control chip of the functional hardware does not need to be written in independently, thus effectively simplifying the operation flow of firmware updating. In addition, the functional firmware is updated according to the system firmware, the system firmware and the versions of the functional firmware can be unified, control faults or functional failures possibly caused by inconsistent versions of the firmware are avoided, and the running reliability of the cleaning equipment is improved.
In some embodiments, the obtaining the firmware update file further includes:
verifying signature information of the firmware update file;
and in the case of the signature information error, terminating the process of updating the firmware of the electronic equipment.
Therefore, the application can verify the correctness and the authenticity of the firmware update file in a limited way before updating the firmware, avoid error in the updating process, and further avoid the operation of the equipment from faults caused by the error of the firmware update file.
In some embodiments, updating the electronic device system firmware written to the first chip according to the firmware update file includes:
setting the electronic equipment to a first state, wherein the first state is used for indicating that the firmware update file is currently backed up;
writing the firmware update file into a backup storage area of the first chip in the first state;
and updating the system firmware according to the firmware update file written into the backup storage area.
Therefore, the application can write the firmware update file into the backup storage area of the system chip after the firmware update file is obtained, so that the firmware update file can be written into the system chip in the subsequent firmware update process, and file copying errors in the writing process can be avoided.
In some embodiments, the writing the firmware update file to the backup storage area of the electronic device in the first state includes:
if the electronic equipment is restarted in the process of writing the firmware update file into the backup storage area, continuing to write the firmware update file into the backup storage area according to the writing progress of the firmware update file into the backup storage area before restarting the electronic equipment; or alternatively
And re-writing the firmware update file into the backup storage area.
Therefore, the method and the device can restore the process under the condition that the electronic equipment is accidentally restarted due to power failure or other reasons in the process of writing the firmware update file into the backup storage area, and avoid the problem of damage to the firmware of the electronic equipment caused by power failure or other accidental reasons in the process of updating the firmware.
In some embodiments, the updating the system firmware according to the firmware update file written to the backup storage area includes:
setting the electronic device to a second state, the second state being indicative of the system firmware being currently updated;
and in the second state, the firmware updating file written into the backup storage area is rewritten into the firmware storage area of the first chip, and the system firmware is updated.
Therefore, the 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 in a backup recovery mode.
In some embodiments, the updating the system firmware according to the firmware update file written to the backup storage area further comprises:
under the condition that the backup firmware update file is rewritten in the firmware storage area, if the electronic equipment is restarted, the state of the electronic equipment is verified;
and when the electronic equipment is in the second state, overwriting the firmware update file written into the backup storage area into the firmware storage area.
Therefore, the method and the device can restore the process by restoring the file from the backup storage area to the firmware storage area, and can avoid the problem of damage to the firmware of the electronic equipment caused by power failure or other unexpected reasons in the process of updating the firmware by restoring the process under the condition that the electronic equipment is accidentally restarted due to power failure or other reasons in the process of writing the firmware updating file from the backup storage area into the firmware storage area.
In some embodiments, the updating the system firmware according to the firmware update file written to the backup storage area further comprises:
and setting the electronic equipment to a third state, and controlling the electronic equipment to restart, wherein the third state indicates that the system firmware is upgraded.
Thus, the application can apply the newly written firmware by setting the state of the application and restarting the system firmware updating process.
In some embodiments, the updating the electronic device function firmware written in the second chip according to the updated electronic device system firmware includes:
acquiring target version configuration information of the functional firmware according to the updated system firmware;
acquiring current version configuration information of the functional firmware according to the functional firmware;
and under the condition that the target version configuration information and the current version configuration information are not matched, writing new data into the second chip according to the updated system firmware, and updating the functional firmware so as to enable the updated system firmware to be matched with the updated version of the functional firmware.
Therefore, the application can update the functional firmware corresponding to the control chip of each functional hardware according to the updated functional firmware information included in the system firmware, so as to maintain the version matching of the system firmware and the functional firmware and improve the running reliability of the equipment.
In some embodiments, the obtaining, according to the electronic device function firmware, current version configuration information of the function firmware includes:
and acquiring the configuration information of the current version of the functional firmware every preset time interval.
Therefore, the application can realize the real-time monitoring of the functional firmware by acquiring the version configuration information of the current functional firmware at regular time, thereby realizing the update of the functional firmware according to the system firmware at any time and ensuring the running reliability of the equipment in real time.
The application also provides a cleaning device comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the cleaning device to perform a method as described in any of the embodiments above.
The application also provides a computer readable storage medium storing a computer program which, when executed by one or more processors, implements a method as in any of the embodiments above.
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.
Drawings
The foregoing and/or additional aspects and advantages of the application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings, in which:
fig. 1 is a flow chart of a firmware updating method of an electronic device according to the present application;
fig. 2 is a flow chart of a firmware updating method of an electronic device according to the present application;
FIG. 3 is a flowchart of a method for updating firmware of an electronic device according to the present application;
fig. 4 is a flow chart of a firmware updating method of an electronic device according to the present application;
FIG. 5 is a flowchart of a method for updating firmware of an electronic device according to the present application;
FIG. 6 is a flowchart of a method for updating firmware of an electronic device according to the present application;
fig. 7 is a schematic diagram of a scenario of an electronic device firmware update method provided by the present application.
Detailed Description
Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are exemplary only for explaining the embodiments of the present application and are not to be construed as limiting the embodiments of the present application.
As shown in fig. 1, the present application provides a method for updating firmware of an electronic device, where the electronic device includes a first chip and a second chip, and the method specifically includes the following steps:
01: acquiring a firmware update file;
03: updating the system firmware of the electronic equipment written in the first chip according to the firmware updating file;
05: and updating the electronic equipment function firmware written in the second chip according to the updated electronic equipment system firmware.
The application also provides an electronic equipment firmware updating device, and the electronic equipment firmware updating method can be realized by the electronic equipment firmware updating device. Specifically, the electronic device firmware updating apparatus includes a file obtaining module, a system firmware updating module and a functional firmware updating module, wherein the file obtaining module is used for obtaining a firmware updating file, the system firmware updating module is used for updating the electronic device system firmware written in the first chip according to the firmware updating file, and the functional firmware updating module is used for updating the electronic device functional firmware written in the second chip according to the updated electronic device system firmware.
The application also provides a cleaning device, such as a cleaning robot, a cleaning system comprising the cleaning robot and a matched base station, and the like, and the cleaning device can execute the electronic device firmware updating method. The cleaning device comprises a memory and a processor, wherein the memory stores a computer program, and the processor is used for acquiring a firmware update file, updating the electronic device system firmware written in the first chip according to the firmware update file, and updating the electronic device function firmware written in the second chip according to the updated electronic device system firmware.
Specifically, the electronic device according to the present application generally includes a plurality of chips, including a first chip and a second chip. The first chip is generally provided with one system core control chip for serving as the electronic device, and the firmware written into the first chip is the system firmware of the electronic device. Firmware (firmware), i.e., a driver of hardware, is used to enable the hardware to operate normally in a software environment. The system firmware generally refers to an operating system of a specific electronic device, such as an operating system of a music player, an operating system of a cleaning device, an operating system of an electronic dictionary, and the like, and is the system firmware.
The electronic device further comprises one or more second chips, wherein the second chips are used as control chips of all functional hardware in the electronic device, and the firmware written into the second chips is the functional firmware corresponding to all functional hardware in the electronic device. The functional firmware generally refers to a driver program in the electronic device, which is used for enabling a control chip corresponding to each functional hardware to normally operate in a software environment of the system firmware. For example, firmware corresponding to a chip for controlling the motor in the cleaning robot is functional firmware.
In order to enable hardware operation of the electronic device to fail, no conflict or failure of software interaction between system firmware and functional firmware can occur at the software level of the electronic device. In the related art, after the system firmware is updated, since each functional firmware needs to be independently written into each functional hardware control chip for updating, if the versions of the system firmware and the functional firmware are not compatible under the condition that the functional firmware is not updated, the electronic device cannot normally operate.
Therefore, in the scheme provided by the application, in order to solve the problems, a communication link is added between the first chip and the second chip, so that after the system firmware of the electronic device is updated, the system firmware of the electronic device can be used as a reference to update each functional firmware. In some examples, the electronic device first downloads and obtains a firmware update file through a communication link connected to an external network environment, and the downloaded firmware update file is generally stored in a temporary storage area in the first chip.
In order to ensure that the updating does not conflict with each other, the firmware updating file generally comprises all files of the target version system firmware, and a mode of completely overwriting is adopted when the first chip updating system firmware is written. This ensures that the written system firmware is complete and that its internal files do not cause unexpected incompatibility problems due to partial coverage.
After the firmware updating file is completely written into the first chip and the updating of the system firmware is completed, the updating file of the new version functional firmware is issued and written into each second chip by utilizing the communication link between the first chip and the second chip according to the files related to each functional firmware in the new version system firmware. The update file may include all files of the new version of the functional firmware or may include only files having differences from the current version of the functional firmware.
Therefore, the application upgrades the system firmware preferentially and upgrades the functional firmware according to the system firmware, and the control chip of the functional hardware does not need to be written in independently, thus effectively simplifying the operation flow of firmware updating. In addition, the functional firmware is updated according to the system firmware, the system firmware and the versions of the functional firmware can be unified, control faults or functional failures possibly caused by inconsistent versions of the firmware are avoided, and the running reliability of the cleaning equipment is improved.
As shown in fig. 2, in some embodiments, step 01 further comprises:
021: verifying the signature information of the firmware update file, if the signature information is wrong, entering step 022, and if the signature information is correct, entering step 03;
022: the process of updating the firmware of the electronic device is terminated.
In some embodiments, the electronic device firmware updating apparatus further comprises a signature verification module for verifying signature information of the firmware update file, and for terminating a process of the electronic device firmware update.
In some embodiments, the processor is further configured to verify signature information of the firmware update file, and to terminate the process of the electronic device firmware update.
Specifically, in order to ensure that the firmware update file acquired and stored in the process of updating the firmware is consistent with the firmware update file issued by the issuer, in some examples, before starting updating the system firmware, signature information of the firmware update file stored in the temporary storage area is verified to be consistent with the due signature information of the firmware update file acquired by the electronic device through the external network environment, if so, the stored firmware update file can be used for updating the system firmware, and if not, the stored firmware update file can be tampered and cannot be used for updating the firmware. In this case, the update process of the system firmware should be terminated to avoid unpredictable problems after the firmware update. After the update process is terminated, if the firmware update is to be continued, other firmware update files from other sources need to be obtained, so that the signature information of the firmware update files is ensured to be consistent with the signature information of the firmware update files issued by the issuers.
Therefore, the application can verify the correctness and the authenticity of the firmware update file in a limited way before updating the firmware, avoid error in the updating process, and further avoid the operation of the equipment from faults caused by the error of the firmware update file.
As shown in fig. 3, in certain embodiments, step 03 comprises:
031: setting the electronic equipment to a first state, wherein the first state is used for representing that a firmware update file is currently backed up;
032: writing the firmware update file into a backup storage area of the first chip in a first state;
033: and updating the system firmware according to the firmware update file written into the backup storage area.
In some embodiments, the system firmware update module is configured to set the electronic device to a first state, the first state being configured to indicate that the firmware update file is currently being backed up, and to write the firmware update file to the backup storage area of the first chip in the first state, and to update the system firmware based on the firmware update file written to the backup storage area.
In some embodiments, the processor is further configured to set the electronic device to a first state, the first state being configured to indicate that the firmware update file is currently being backed up, and to write the firmware update file to the backup storage area of the first chip in the first state, and to update the system firmware based on the firmware update file written to the backup storage area.
Specifically, the update process of the system firmware is specifically described next. In some examples, the first chip is provided with an area dedicated to storing upgrade status flags, where the area stores data including at least three types, one of which indicates a status of a firmware update file currently being backed up, two of which indicates a status of system firmware currently being upgraded, and three of which indicates a status of system firmware upgrade completion. Before starting the upgrade process of the system firmware, the upgrade status flag is first set to be 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 the firmware update file stored in the temporary storage area is written into the backup storage area of the first chip. The backup storage area is generally used for storing backup of system firmware, the first chip is also provided with a firmware storage area used for storing the system firmware to enable the system firmware to normally operate, and data writing between the backup storage area and the firmware storage area is more convenient compared with that of the temporary storage area. In addition, in order to ensure that the backed-up data cannot be damaged easily, so that the recovery of the equipment can be ensured, the backup storage area adopts a general nonvolatile memory, such as ROM, EPROM, EEPROM, and the like.
After the firmware update file is written into the backup storage area, the system firmware is updated by taking the firmware update file stored in the backup storage area as a reference, so that the stability of the content transmission of the firmware update file in the updating process can be effectively ensured, and file copying errors in the updating process are avoided.
Therefore, the application can write the firmware update file into the backup storage area of the system chip after the firmware update file is obtained, so that the firmware update file can be written into the system chip in the subsequent firmware update process, and file copying errors in the writing process can be avoided.
In certain embodiments, step 032 comprises:
if the electronic equipment is restarted in the process of writing the firmware update file into the backup storage area, continuing to write the firmware update file into the backup storage area according to the writing progress of the firmware update file into the backup storage area before restarting the electronic equipment; or alternatively
And re-writing the firmware update file into the backup storage area.
In some embodiments, the system firmware update module is further configured to continue writing the firmware update file to the backup storage area according to a 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.
In some embodiments, the processor is further configured to continue writing the firmware update file to the backup storage area according to a progress of writing 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.
Specifically, for an electronic device, the updating process of the system firmware or the operating system is the weakest period in the use process, once the device is powered down or the device is stopped due to other interference conditions in the updating process of the system firmware or the operating system, after restarting, the written file cannot ensure that the newly written file and the uncovered file can jointly support the operation of the firmware or the operating system because the firmware or the operating system at the bottom layer of the system is covered and written with a part, and at the moment, the electronic device cannot be started and operated normally, namely the condition of changing the brick of the updated power-down device is commonly called.
To avoid this, the present application preferably writes the firmware update file to the backup storage area of the first chip prior to the formal update, rather than directly updating the system firmware from the temporary storage area, and such a buffer setting can avoid the influence of the device power down on the system firmware itself immediately after the update process begins.
In some examples, during the process of writing the firmware update file into the backup storage area of the first chip, if the electronic device is powered down or restarted due to other interference, the system is still started normally according to the current version of the system firmware because the system firmware has not changed. Then the system can detect the state of the electronic equipment before restarting by detecting the upgrade state flag bit, and if the electronic equipment is still backing up the firmware update file, the process of writing the firmware update file into the backup storage area before restarting is not completed. In some examples, the system may also compare the consistency of the file stored in the current backup storage area with the obtained firmware update file, and if not, indicate that the process of writing the firmware update file to the backup storage area before restarting is not completed.
In this case, the system may find a progress of writing the firmware update file into the backup storage area before restarting according to a difference between the file stored in the current backup storage area and the acquired firmware update file, and then continue writing the firmware update file into the backup storage area. In other examples, to ensure the consistency of the backup file process, the system may also completely resume writing the firmware update file to the backup storage area. The specific mode of reapplying the firmware update file is not limited to the above two modes, and can be adjusted according to the actual application scene and situation.
Therefore, the method and the device can restore the process under the condition that the electronic equipment is accidentally restarted due to power failure or other reasons in the process of writing the firmware update file into the backup storage area, and avoid the problem of damage to the firmware of the electronic equipment caused by power failure or other accidental reasons in the process of updating the firmware.
As shown in fig. 4, in certain embodiments, step 033 comprises:
0331: setting the electronic device to a second state, the second state being indicative of the system firmware being updated;
0332: and in the second state, the firmware updating file written into the backup storage area is rewritten into the firmware storage area of the first chip, and the system firmware is updated.
In some embodiments, the system firmware update module is configured to set the electronic device to a second state, where the second state is configured to indicate that the system firmware is currently being updated, and to overwrite the firmware update file written to the backup storage area in the firmware storage area of the first chip in the second state to update the system firmware.
In some embodiments, the processor is further configured to set the electronic device to a second state, the second state being configured to indicate that the system firmware is currently being updated, and to overwrite the firmware update file written to the backup storage area in the firmware storage area of the first chip in the second state to update the system firmware.
Specifically, after the firmware update file is successfully written into the backup storage area, the preparation work part in the update process of the system firmware is already completed, and then the data in the backup storage area needs to be rewritten into the firmware storage area, so that the purpose of writing the new version of the system firmware into the first chip is realized.
In some examples, to represent the current firmware upgrade state of the electronic device, the first chip upgrade state flag is located as second data corresponding to the second state of the electronic device, i.e., the state in which system firmware is currently being updated. Then, the system directly writes the firmware update file written in the backup storage area into the firmware storage area of the first chip in an overlapping manner so as to achieve the purpose of updating the system firmware. The overwriting mode may be to directly overwrite the firmware update file written in the backup memory area into the firmware memory area, i.e. the original file stored in the firmware memory area will be directly overwritten and erased by the newly written file, or to compare the files in the backup memory area and the firmware memory area, and overwrite the file with difference into the firmware memory area to form new version of system firmware.
Therefore, the 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 in a backup recovery mode.
In certain embodiments, step 033 further comprises:
under the condition that the backup firmware updating file is rewritten in the firmware storage area, if the electronic equipment is restarted, the state of the electronic equipment is verified;
and when the electronic equipment is in the second state, the firmware updating file written into the backup storage area is rewritten into the firmware storage area.
In some embodiments, the system firmware update module is further configured to verify a status of the electronic device if the electronic device is restarted in a case where the backup firmware update file is overwritten into the firmware storage area, and to overwrite the firmware update file written into the backup storage area into the firmware storage area in a case where the electronic device is in the second status.
In some embodiments, the processor is further configured to verify a state of the electronic device if the electronic device is restarted in the event that the backup firmware update file is overwritten into the firmware storage area, and to overwrite the firmware update file written into the backup storage area into the firmware storage area in the event that the electronic device is in the second state.
Specifically, for an electronic device, the updating process of the system firmware or the operating system is the weakest period in the using process, once the device is powered down or the device is stopped due to other interference conditions in the updating process of the system firmware or the operating system, after restarting, the written file cannot ensure that the newly written file and the uncovered file can jointly support the operation of the firmware or the operating system because the firmware or the operating system at the bottom layer of the system is covered and written with a part, and at the moment, the electronic device cannot be started and operated normally, namely the condition of changing the brick of the updated power-down device is commonly called.
In order to avoid this situation, in the updating process of the system firmware provided by the application, the firmware update file is written into the backup storage area of the first chip preferentially, namely, the area originally used for storing the system backup file so as to facilitate the system recovery is used for storing the firmware update file, in other words, in the updating process of the firmware update, the firmware update file is actually written into the firmware storage area as the backup file directly, and the updating of the system firmware is realized by utilizing the mode originally used for recovering the backup. In the updating mode, under the condition that the electronic equipment is stopped accidentally and restarted to cause the original firmware to be destroyed due to writing new data, the updating of the system firmware is realized by recovering the backup mode, and after the process that the firmware updating file stored in the backup storage area is written into the firmware storage area is finished and the equipment is restarted, the system firmware is the complete new version system firmware and can normally operate.
In some examples, the electronic device is unexpectedly powered down or is unexpectedly shut down if during the writing of the firmware update file of the backup memory area into the firmware memory area. After restarting, firstly confirming the upgrade status flag bit, if the upgrade status flag bit indicates that the current equipment is still in the second status of upgrading the system firmware, restarting the process of writing the firmware update file of the backup storage area into the firmware storage area, and actively controlling the electronic equipment to restart to enable the newly written system firmware when the process is finished. After restarting, the newly written system firmware is validated and started, and the operation of the electronic equipment is restored to be normal.
Therefore, the method and the device can restore the process under the condition of unexpected restarting due to power failure or other reasons in the process of writing the firmware updating file into the firmware storage area from the backup storage area by the electronic equipment in a mode of restoring the file from the backup storage area to the firmware storage area, and can avoid the problem of firmware damage of the electronic equipment caused by power failure or other unexpected reasons in the firmware updating process.
As shown in fig. 5, in some embodiments, step 03 further comprises:
04: and setting the electronic equipment to a third state, and controlling the electronic equipment to restart, wherein the third state indicates that the system firmware is upgraded.
In some embodiments, the electronic device firmware updating apparatus further includes a system firmware updating termination module configured to set the electronic device to a third state, and control the electronic device to restart, where the third state indicates that the system firmware is updated.
In some embodiments, the processor is further configured to set the electronic device to a third state, and control the electronic device to restart, where the third state indicates that the system firmware is upgraded.
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 system firmware. On the basis of the above embodiment, since the system verifies the data of the current upgrade status flag after restarting, in order to avoid trapping in the loop of infinitely rewriting the firmware update file, before restarting the electronic device to apply the new version of system firmware, the first chip first sets the data of the upgrade status flag to the third data, corresponds to the third state of the electronic device, that is, corresponds to the state of the electronic device in which the current system firmware of the electronic device is upgraded, and then performs restarting. In so doing, the electronic device is booted with the new version of system firmware upon reboot.
Thus, the application can apply the newly written firmware by setting the state of the application and restarting the system firmware updating process.
As shown in fig. 6, in certain embodiments, step 05 comprises:
051: acquiring target version configuration information of the functional firmware according to the updated system firmware;
052: acquiring current version configuration information of the functional firmware according to the functional firmware;
053: and under the condition that the target version configuration information and the current version configuration information are not matched, writing new data into the second chip according to the updated system firmware, and updating the functional firmware.
In some embodiments, the functional firmware updating module is configured to obtain, according to the updated system firmware, the target version configuration information of the functional firmware, and to obtain, according to the functional firmware, the current version configuration information of the functional firmware, and to write, in the case that the target version configuration information and the current version configuration information do not match, new data to the second chip according to the updated system firmware, and update the functional firmware.
In some embodiments, the processor is further configured to obtain, according to the updated system firmware, the target version configuration information of the functional firmware, and to obtain, according to the functional firmware, the current version configuration information of the functional firmware, and to write, in case the target version configuration information and the current version configuration information do not match, new data to the second chip according to the updated system firmware, and update the functional firmware.
Specifically, after the system firmware is updated, the system acquires the version number of the functional firmware which can be matched and supported by the current version system firmware and the functional firmware configuration file corresponding to the version number from the updated system firmware, compares the acquired information with the version numbers of the functional firmware and the functional firmware configuration files corresponding to the functional hardware of the current electronic equipment, and if the acquired information is inconsistent with the version numbers of the functional firmware and the functional firmware configuration files, the functional firmware needs to be updated according to the system firmware through a communication link between the first chip and the second chip.
Generally, the system firmware of the same version and the functional firmware can be matched and supported, and the system firmware can also be compatible and supported for the functional firmware of a plurality of historical versions before the current version, namely, the updating of the functional firmware is not accompanied by the updating of the functional firmware every time, but when the version of the system firmware is newer and is not compatible with the old version of the functional firmware, the functional firmware needs to be updated together according to the new version of the system firmware. In order to make the system firmware compatible with the functional firmware long enough, the version number of the updated functional firmware should be the same as the version number of the new version of the system firmware when the functional firmware is updated according to the system firmware. In addition, in order to make the compatibility of the system firmware to the functional firmware better, when the functional firmware is updated according to the system firmware, the updated version of the functional firmware should be updated to the version which can be most stably compatible and supported by the new version of the system firmware.
For example, in some examples, the version of the system firmware that is updated currently is v1.5.1.6, the version of the compatible functional firmware ranges from v1.5.1.3 to v1.5.1.6, and the version of the functional firmware of the functional hardware corresponding to a certain second chip currently is v1.5.1.1, that is, the version of the functional firmware is not in the compatible supporting range of the updated system firmware, and the functional firmware needs to be updated according to the system firmware. At this time, the system acquires version configuration information of the functional firmware from the second chip, and simultaneously acquires version configuration information of the new version functional firmware from the first chip according to the system firmware which is updated just, and compares the acquired two sets of version configuration information, wherein the comparison result is unmatched. Therefore, the system sends the file needed in the updating process of the functional firmware from the first chip to the second chip and writes the file into the second chip according to the file content of the new version functional firmware contained in the system firmware or the file content generated by the new version functional firmware, so as to realize the updating of the functional firmware. The version of the updated functional firmware only needs to be updated in the range of v1.5.1.3-v1.5.1.6.
Therefore, the application can update the functional firmware corresponding to the control chip of each functional hardware according to the updated functional firmware information included in the system firmware, so as to maintain the version matching of the system firmware and the functional firmware and improve the running reliability of the equipment.
In certain embodiments, step 052 comprises:
and acquiring the configuration information of the current version of the functional firmware every preset time.
In some embodiments, the function firmware updating module is further configured to obtain current version configuration information of the function firmware for a preset duration at each interval.
In some embodiments, the processor is further configured to obtain current version configuration information of the functional firmware for a preset duration of time.
Specifically, except for the time after the update of the system firmware is finished, in the daily operation of the electronic device, unexpected errors may occur in the operation of the functional firmware in the system, so that the functional firmware is suddenly not matched or compatible with the system firmware. In order to avoid the influence of the situation on the normal use of the electronic equipment, the system acquires the current version configuration information of the functional firmware once every preset time so as to be convenient to compare with the version configuration information provided by the current system firmware and observe whether the current version configuration information is matched with the version configuration information. If the error condition of the functional firmware occurs, the error condition can be discovered in such a way, and then the matching relation between the functional firmware and the system firmware is recovered by the method for updating the functional firmware version, so that the operation of the equipment is prevented from being failed. For the preset duration, a balance point can be selected from the system operation efficiency and the monitoring strength of equipment abnormality to set, and the balance point can be generally set to any value between 20s and 40s, and in some examples, the preset duration is set to be 30s, namely, the current version configuration information of the functional firmware is acquired every 30 s.
Therefore, the application can realize the real-time monitoring of the functional firmware by acquiring the version configuration information of the current functional firmware at regular time, thereby realizing the update of the functional firmware according to the system firmware at any time and ensuring the running reliability of the equipment in real time.
As shown in fig. 7, an electronic device firmware updating method provided by an embodiment of the present application is described next by way of example. The first chip at least comprises an upgrade state flag bit, a firmware storage area, a backup storage area, a temporary storage area and the like. Firstly, a first chip stores a firmware update file acquired from an external network environment into a temporary storage area, then starts a system firmware update process, takes an upgrade status flag position as first data to represent that the firmware update file is currently backed up, and copies and writes the firmware update file into a backup storage area from the temporary storage area. And after the copying and writing are completed, the upgrading state mark position is second data to indicate that the system firmware is currently updated, and meanwhile, the firmware updating file is rewritten into the firmware storage area from the backup storage area so as to obtain new version of system firmware. After the writing is completed, the upgrading state mark position is third data, which indicates that the updating of the system firmware is completed, and then the functional firmware corresponding to the second chip for controlling other functional hardware on the equipment can be updated according to the new version of the system firmware.
The present application also provides a computer-readable storage medium storing a computer program, which, when executed by one or more processors, implements the method for updating firmware of an electronic device according to any one of the above embodiments.
In the description of the present specification, reference to the terms "certain embodiments," "in one example," "illustratively," and the like, means that a particular feature, structure, material, or characteristic described in connection with the embodiments or examples is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and further implementations are included within the scope of the preferred embodiment of the present application in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
While embodiments of the present application have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the application, and that variations, modifications, alternatives and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the application.

Claims (11)

1. An electronic device firmware updating method, wherein the electronic device includes a first chip and a second chip, the method comprising:
acquiring a firmware update file;
updating the system firmware of the electronic equipment written in the first chip according to the firmware updating file;
and updating the electronic equipment function firmware written in the second chip according to the updated electronic equipment system firmware.
2. The method of claim 1, wherein the obtaining a firmware update file further comprises:
verifying signature information of the firmware update file;
and in the case of the signature information error, terminating the process of updating the firmware of the electronic equipment.
3. The method of claim 1, wherein updating the electronic device system firmware written to the first chip based on the firmware update file comprises:
setting the electronic equipment to a first state, wherein the first state is used for indicating that the firmware update file is currently backed up;
writing the firmware update file into a backup storage area of the first chip in the first state;
and updating the system firmware according to the firmware update file written into the backup storage area.
4. The method of claim 3, wherein in the first state, writing the firmware update file to a backup storage area of the electronic device comprises:
if the electronic equipment is restarted in the process of writing the firmware update file into the backup storage area, continuing to write the firmware update file into the backup storage area according to the writing progress of the firmware update file into the backup storage area before restarting the electronic equipment; or alternatively
And re-writing the firmware update file into the backup storage area.
5. The method of claim 3, wherein updating the system firmware based on the firmware update file written to the backup storage area comprises:
setting the electronic device to a second state, the second state being indicative of the system firmware being currently updated;
and in the second state, the firmware updating file written into the backup storage area is rewritten into the firmware storage area of the first chip, and the system firmware is updated.
6. The method of claim 5, wherein updating the system firmware based on the firmware update file written to the backup storage area further comprises:
under the condition that the backup firmware update file is rewritten in the firmware storage area, if the electronic equipment is restarted, the state of the electronic equipment is verified;
and when the electronic equipment is in the second state, overwriting the firmware update file written into the backup storage area into the firmware storage area.
7. The method of any of claims 3-6, wherein updating the system firmware based on the firmware update file written to the backup storage area further comprises:
and setting the electronic equipment to a third state, and controlling the electronic equipment to restart, wherein the third state indicates that the system firmware is upgraded.
8. The method of claim 1, wherein updating the electronic device function firmware written to the second chip based on the updated electronic device system firmware comprises:
acquiring target version configuration information of the functional firmware according to the updated system firmware;
acquiring current version configuration information of the functional firmware according to the functional firmware;
and under the condition that the target version configuration information and the current version configuration information are not matched, writing new data into the second chip according to the updated system firmware, and updating the functional firmware so as to enable the updated system firmware to be matched with the updated version of the functional firmware.
9. The method of claim 8, wherein the obtaining, from the electronic device functional firmware, current version configuration information for the functional firmware comprises:
and acquiring the configuration information of the current version of the functional firmware every preset time interval.
10. A cleaning device comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the cleaning device to perform the method of any one of claims 1-9.
11. A computer readable storage medium, characterized in that it stores a computer program, which, when executed by one or more processors, implements the method of any of claims 1-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 (1)

* 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

Cited By (1)

* 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

Similar Documents

Publication Publication Date Title
US8539471B2 (en) Updating firmware of an electronic device
US20100169709A1 (en) System Of Updating Firmware And Method Thereof, And Method Of Creating Firmware
US7082549B2 (en) Method for fault tolerant updating of an electronic device
US6907602B2 (en) Method for updating firmware of computer device
US7971199B1 (en) Mobile device with a self-updating update agent in a wireless network
US20110307879A1 (en) Program update device, program update method, and information processing device
US8136108B2 (en) Updating firmware with multiple processors
WO2022007656A1 (en) Bootloader software updating method and apparatus, embedded controller, and storage medium
JP2000357095A (en) Method and device for downloading software to embedded system
CN105260215A (en) Method of updating vehicle-mounted automobile data recorder terminal by USB flash disk
CN108345464A (en) A kind of the startup method and Android vehicle device of Android system
CN116909611A (en) Electronic device firmware updating method, cleaning device and storage medium
CN115718610A (en) Reliable method for updating application program of single chip microcomputer
EP1584005B1 (en) Mobile handset with a fault tolerant update agent
JP2001331327A (en) Electronic equipment
CN111273928B (en) Bootloader design method for self-upgrading
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
CN117407020A (en) OTA upgrade refreshing method and device, electronic equipment and storage medium
JP3805195B2 (en) Program rewriting apparatus and program rewriting method
Cisco Software Upgrade Notes
Cisco Software Upgrade Notes
CN113176891A (en) Program programming method of ECU with backup function based on Bootloader
Cisco Software Upgrade Notes
CN111611000A (en) High-reliability firmware over-the-air upgrading method and 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