CN112152836B - Remote firmware automatic upgrading method, system and chip for small storage capacity equipment - Google Patents

Remote firmware automatic upgrading method, system and chip for small storage capacity equipment Download PDF

Info

Publication number
CN112152836B
CN112152836B CN202010801456.3A CN202010801456A CN112152836B CN 112152836 B CN112152836 B CN 112152836B CN 202010801456 A CN202010801456 A CN 202010801456A CN 112152836 B CN112152836 B CN 112152836B
Authority
CN
China
Prior art keywords
firmware
module
upgrading
program
zone bit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010801456.3A
Other languages
Chinese (zh)
Other versions
CN112152836A (en
Inventor
李永勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhuhai Amicro Semiconductor Co Ltd
Original Assignee
Zhuhai Amicro Semiconductor 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 Zhuhai Amicro Semiconductor Co Ltd filed Critical Zhuhai Amicro Semiconductor Co Ltd
Priority to CN202010801456.3A priority Critical patent/CN112152836B/en
Publication of CN112152836A publication Critical patent/CN112152836A/en
Application granted granted Critical
Publication of CN112152836B publication Critical patent/CN112152836B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a method, a system and a chip for automatically upgrading remote firmware of small storage capacity equipment, belongs to the field of remote firmware upgrading, and aims to solve the problem that the existing remote firmware upgrading method needs to backup a firmware program to be upgraded, so that the storage space of the equipment is limited and the remote upgrading of the small storage capacity equipment is not facilitated. The upgrading method of the invention has comprehensive verification on the firmware in the upgrading process, ensures the safe operation of the firmware to realize smooth upgrading, does not need the backup of firmware programs when in remote upgrading, automatically enters a special upgrading mode to remotely download the firmware if the upgrading is abnormal in the upgrading process, covers the original firmware in the flash of the equipment by using the downloaded firmware, and carries out upgrading after verifying again. The invention is mainly used for remotely upgrading the firmware.

Description

Method, system and chip for automatically upgrading remote firmware of small storage capacity equipment
Technical Field
The invention belongs to the field of remote firmware upgrade.
Background
And firmware upgrading refers to upgrading the embedded firmware of the hardware equipment. The firmware upgrading can improve the functions of the machine, enhance the stability of the machine and repair bugs of the machine. Since the high version often repairs part of BUG (BUG) of the low version, the upgraded version undergoing firmware upgrade generally has better performance than the original version, obtains optimized effect, and enables users to have better experience.
Because the hardware equipment upgraded in the firmware upgrade is often the hardware equipment which is not intelligent enough, and is difficult to be like the control mode of software upgrade, after the new version is released, the version information is automatically detected through the intelligent terminal, the updating instruction input from the outside is received, and then the updating is carried out. Therefore, under the condition that the hardware equipment cannot automatically detect and update the firmware, the hardware equipment needs to be upgraded and controlled on site one by one in a manual mode, and the upgrading is not convenient. Some methods for automatically upgrading remote firmware also exist in the prior art.
However, in the existing remote firmware automatic upgrading method, in order to ensure the safe operation of the firmware to be upgraded, generally wifi is used, an application program on a system receives the firmware program to be upgraded, data verification is performed and then upgrading is performed, and in the process of downloading the firmware program to be upgraded, after all the firmware programs to be upgraded are directly downloaded through wifi, the downloaded firmware program to be upgraded is backed up and then upgraded after being stored in a flash of equipment; if the downloaded firmware program to be upgraded is abnormal in the upgrading process, the firmware program to be upgraded which is backed up is utilized to be upgraded for upgrading, so that a larger space is needed for storing the backup; however, for embedded devices, not all devices have a large flash memory space, and the limitation of the memory space is not favorable for upgrading the devices, so the above problems need to be solved urgently.
Disclosure of Invention
The invention aims to solve the problems that the existing remote firmware upgrading method needs to backup a firmware program to be upgraded, so that the storage space of equipment is limited and the remote upgrading of small-storage-capacity equipment is not facilitated, and therefore, the invention provides a remote firmware automatic upgrading method, system and chip of the small-storage-capacity equipment.
The remote firmware automatic upgrading method of small storage capacity equipment, the flash of the equipment stores bootstrap program, data configuration area, special upgrading program and firmware area; wherein the content of the first and second substances,
a firmware area for storing firmware;
the data configuration area is used for recording the firmware running conditions, wherein the firmware running conditions comprise normal running zone bit conditions, program abnormal zone bit conditions, normal shutdown zone bit conditions, zone bit conditions to be upgraded, current starting frequency conditions and last starting frequency conditions; the automatic upgrading method is characterized by comprising the following steps:
step one, equipment is electrified and restarted;
step two, the boot program guides and reads the firmware running condition recorded in the firmware area and the data configuration area;
step three, judging whether a zone bit to be upgraded exists or not, if so, executing the step four, and if not, executing the step five;
step four, entering a special upgrading mode, and downloading the firmware to be upgraded in a networking manner;
judging whether a normal operation zone bit exists or not, and judging whether the current starting times are changed compared with the last starting times or not; if so, judging that the normal operation zone bit exists and the starting times are changed, and executing a sixth step; otherwise, if the result is negative, judging that the normal operation zone bit does not exist and/or the starting times do not change, and executing the step seven;
step six, performing CRC on the firmware, judging whether the verification is successful, if so, executing the step eight, and if not, executing the step four;
step seven, judging whether a program abnormal zone bit exists; if so, executing the step four; if not, executing the step ten;
step eight, under the condition of keeping the equipment networking, the firmware normally runs to realize upgrading, the firmware running condition in the running process is recorded, and the firmware running condition is written into the data configuration area, and the step nine is executed;
step nine, judging whether an upgrade instruction written by the outside or written by the equipment is detected; if so, executing the step one; if not, executing the step eight;
step ten, judging whether a normal shutdown flag bit exists or not; if so, executing the step six; if not, executing the step eleven;
recording the situations that no program abnormal zone bit exists and no normal shutdown zone bit exists in a data configuration area, and executing a step twelve;
step twelve, judging whether the times of the absence of the program abnormal zone bit and the normal shutdown zone bit in the data configuration area exceed 3 times; if so, executing the step four; and if not, executing the step six.
Further, in step four, entering a special upgrading mode, and the specific process of downloading the firmware to be upgraded in a networking manner is as follows:
the special upgrading program in the flash is networked with the cloud server through WiFi, and after the firmware to be upgraded is downloaded from the cloud server, the downloaded firmware to be upgraded is used for covering the original firmware in the flash.
Further, the boot program and the dedicated upgrade program in the flash are not allowed to be erased.
The remote firmware automatic upgrading system of the small storage capacity equipment is realized based on a flash in the equipment, and a bootstrap program, a data configuration area, a special upgrading program and a firmware area are stored in the flash of the equipment; wherein the content of the first and second substances,
a firmware area for storing firmware;
the data configuration area is used for recording the firmware running conditions, wherein the firmware running conditions comprise normal running zone bit conditions, program abnormal zone bit conditions, normal shutdown zone bit conditions, zone bit conditions to be upgraded, current starting frequency conditions and last starting frequency conditions;
the upgrading system comprises a power-on restarting module, a reading module, a flag bit judging module to be upgraded, a special upgrading module, a normal operation flag bit and starting frequency judging module, a CRC (cyclic redundancy check) checking module, a program abnormal flag bit judging module, a firmware operating module, an upgrading instruction detecting module, a normal shutdown flag bit judging module, a recording module and a frequency judging module when the abnormal flag bit and the normal shutdown flag bit do not exist at the same time;
the power-on restarting module is used for performing power-on restarting on the equipment, and the reading module starts to work after the equipment is powered on and restarted;
the reading module is used for reading the firmware running condition recorded in the firmware area and the data configuration area through the guidance of a boot program, sending the flag bit condition to be upgraded in the firmware running condition to the flag bit judgment module to be upgraded, sending the normal running flag bit condition, the current starting frequency condition and the last starting frequency condition in the firmware running condition to the normal running flag bit and starting frequency judgment module, and sending the normal shutdown flag bit condition in the firmware running condition to the normal shutdown flag bit judgment module;
the system comprises a to-be-upgraded flag bit judging module, a special upgrading module and a special upgrading module, wherein the to-be-upgraded flag bit judging module is used for judging whether a to-be-upgraded flag bit exists or not, and when the to-be-upgraded flag bit exists, an instruction of entering a special upgrading mode is sent to the special upgrading module; when the flag bit to be upgraded does not exist, the normal operation flag bit and starting frequency judging module judges whether the normal operation flag bit exists or not and judges whether the current starting frequency is changed compared with the last starting frequency or not;
if the normal operation zone bit and the starting frequency judging module judge that the normal operation zone bit exists and the starting frequency changes, performing CRC on the firmware through a CRC checking module; if not, then the mobile terminal can be switched to the normal mode,
if the normal operation zone bit and the starting frequency judging module judge that the normal operation zone bit does not exist and/or the starting frequency does not change, judging whether the program abnormal zone bit exists or not through the program abnormal zone bit judging module, and if the program abnormal zone bit exists, sending an instruction of entering a special upgrading mode to the special upgrading module; if the program abnormal zone bit does not exist, judging whether a normal shutdown zone bit exists or not through a normal shutdown zone bit judging module; if the normal shutdown flag bit exists, performing CRC (cyclic redundancy check) on the firmware through a CRC check module; if the normal shutdown flag bit does not exist, recording the condition that the program abnormal flag bit does not exist and the normal shutdown flag bit does not exist into the data configuration area through the recording module, judging whether the times of the program abnormal flag bit and the normal shutdown flag bit in the data configuration area that do not exist simultaneously exceed 3 times through a time judging module when the abnormal flag bit and the normal shutdown flag bit do not exist simultaneously, and sending a special upgrading mode entering instruction to a special upgrading module if the judging result is yes; if the judgment result is negative, performing CRC on the firmware through a CRC check module;
the CRC check module is used for performing CRC check on the firmware, when the CRC check is successful, the firmware is normally operated to realize upgrading under the condition that a user keeps equipment networking through the firmware operation module, the firmware operation condition in the operation process is recorded, and after the firmware operation condition is written into the data configuration area, whether an upgrade instruction written by the outside or the equipment is detected or not is judged through the upgrade instruction detection module; when an upgrade instruction written by the outside or written by the equipment is detected, the equipment is powered on and restarted through a power-on restart module; when the upgrade instruction written by the outside or the equipment itself is not detected, the firmware running module continues to keep the current working state;
and the special upgrading module is used for enabling a special upgrading program in the flash to be networked with the cloud server through WiFi, and after downloading the firmware to be upgraded from the cloud server, covering the original firmware in the flash by using the downloaded firmware to be upgraded.
Further, the boot program and the dedicated upgrade program in the flash are not allowed to be erased.
And the automatic upgrading chip is internally stored with a program corresponding to the automatic upgrading method of the remote firmware of the small storage capacity equipment.
The remote firmware automatic upgrading chip is internally stored with the remote firmware automatic upgrading system of the small storage capacity equipment.
The invention has the following beneficial effects:
the method and the system for automatically upgrading the remote firmware of the small-storage-capacity equipment comprehensively check the firmware in the upgrading process, ensure the safe operation of the firmware to realize smooth upgrading, do not need to backup the firmware program when the equipment is upgraded remotely, automatically enter a special upgrading mode if the upgrading is abnormal in the upgrading process, remotely download the firmware, cover the original firmware in the flash of the equipment by using the downloaded firmware, and upgrade the firmware after checking again.
The invention relates to a remote firmware automatic upgrading method and a system of small storage capacity equipment, which provide a safe upgrading mode, consider abnormal conditions such as abnormal power failure, abnormal program runaway, abnormal restart, running crash and the like which may occur in the running process of firmware, and verify the changes of an abnormal flag bit, a normal shutdown flag bit and the starting times of the program to ensure that the equipment does not become bricks, always have the opportunity to automatically enter the upgrading mode, update a firmware program and ensure the safety of the equipment.
The method can overcome the abnormal problems in the running of the firmware, including the possible abnormal conditions of abnormal power failure, abnormal program running, abnormal restart, running crash and the like, wherein the abnormal power failure, the abnormal program running and the running crash can be verified through the abnormal program flag bit, and the abnormal restart can be verified through the normal shutdown flag bit, so that the normal firmware of the equipment is upgraded and protected, and the normal use of the functions of the equipment is ensured.
The remote firmware automatic upgrading method of the small storage capacity equipment or the remote firmware automatic upgrading system of the small storage capacity equipment are stored in the remote firmware automatic upgrading chip.
Drawings
Fig. 1 is a flow chart of a method for automatically upgrading remote firmware of a small storage capacity device according to the present invention.
Fig. 2 is a schematic diagram of a remote firmware automatic upgrade system for a small storage capacity device according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict.
Referring to fig. 1, a method for automatically upgrading a remote firmware of a small storage capacity device according to this embodiment is described, in which a boot program, a data configuration area, a dedicated upgrade program, and a firmware area are stored in a flash of the device; wherein the content of the first and second substances,
a firmware area for storing firmware;
the data configuration area is used for recording the firmware running conditions, wherein the firmware running conditions comprise normal running zone bit conditions, program abnormal zone bit conditions, normal shutdown zone bit conditions, zone bit conditions to be upgraded, current starting frequency conditions and last starting frequency conditions;
the automatic upgrading method comprises the following steps:
step one, equipment is electrified and restarted;
step two, the boot program guides and reads the firmware running condition recorded in the firmware area and the data configuration area;
step three, judging whether a flag bit to be upgraded exists or not, if so, executing the step four, and if not, executing the step five;
step four, entering a special upgrading mode, and downloading the firmware to be upgraded in a networking manner;
judging whether a normal operation zone bit exists or not, and judging whether the current starting times are changed compared with the last starting times or not; if so, judging that the normal operation zone bit exists and the starting times are changed, and executing a sixth step; otherwise, if the result is negative, judging that the normal operation zone bit does not exist and/or the starting times do not change, and executing a seventh step;
step six, performing CRC on the firmware, judging whether the verification is successful, if so, executing the step eight, and if not, executing the step four;
judging whether a program abnormal flag bit exists or not; if so, executing the step four; if not, executing the step ten;
step eight, under the condition of keeping equipment networking, the firmware normally runs to realize upgrading, records the firmware running condition in the running process, writes the firmware running condition into a data configuration area, and executes the step nine;
step nine, judging whether an upgrade instruction written by the outside or written by the equipment is detected; if so, executing the step one; if not, executing the step eight;
step ten, judging whether a normal shutdown flag bit exists or not; if so, executing the step six; if not, executing the step eleven;
recording the situations that no program abnormal zone bit exists and no normal shutdown zone bit exists into a data configuration area, and executing a step twelve;
step twelve, judging whether the times of the program abnormal zone bit and the normal shutdown zone bit in the data configuration area do not exist simultaneously exceed 3 times; if so, executing the step four; and if not, executing the step six.
According to the remote firmware automatic upgrading method for the small-storage-capacity equipment, the firmware is comprehensively verified in the upgrading process, the safe operation of the firmware is guaranteed so as to realize smooth upgrading, the equipment does not need to backup a firmware program in the remote upgrading process, the storage space of the equipment is saved, the method is suitable for the equipment with small storage space, if the upgrading is abnormal in the upgrading process, the special upgrading mode is automatically entered, the firmware is remotely downloaded, the downloaded firmware is used for covering the original firmware in the flash of the equipment, and the upgrading is performed after the verification is performed again.
In specific application, the CRC in the sixth step can detect the condition that the firmware program in the firmware area is damaged due to sudden power failure in the upgrading process, if the condition of sudden power failure exists, the firmware program can not run, if the CRC is successfully verified, the condition that the firmware program is damaged due to power failure does not exist, if the CRC is failed, the condition that the firmware program is damaged due to power failure is verified, at the moment, a special upgrading mode needs to be entered, remote firmware downloading is carried out, and the newly downloaded firmware is used for replacing the original firmware in the firmware area.
If the abnormal condition of program abnormal runaway or running crash occurs, the abnormal condition can be obtained by judging whether the program abnormal zone bit exists or not in the seventh step, if the abnormal condition exists, the program abnormal zone bit exists, and if the abnormal condition does not exist, the program abnormal zone bit does not exist.
When the starting times of the firmware are detected, if the conditions of abnormal restarting and abnormal power-off restarting of the firmware program exist, the starting times of the firmware can be detected through the change of the starting times of the firmware, the boot program can read the last starting times of the firmware, when the firmware is started at the current time, whether the currently recorded times of the boot program are the same as the last recorded starting times or not can be judged, and if the currently recorded times of the boot program are not the same as the last recorded starting times, the firmware is proved to be operated at least. If the two identifications do not exist, the situation that the power failure occurs accidentally is likely to happen, because the device cannot record the identification bit program abnormal identification and the normal shutdown identification under the condition of the accidental power failure. If the program abnormal identifier exists, the program is proved to run, the program runs without time for writing the identifier, a special upgrading mode needs to be entered, networking upgrading is carried out, wherein the program abnormal identifier can be obtained by capturing the program abnormal running and writing the program abnormal running into a data configuration area by a CPU, equipment can execute restarting operation because the program abnormal identifier is detected, and then the corresponding steps are repeated by a bootstrap program to enter the special upgrading mode.
When the identification of the normal operation zone bit of the firmware is detected, if the zone bit is detected to be absent, the firmware program is considered to be possibly abnormal, the abnormal zone bit of the program and the normal shutdown zone bit are detected at this time, and if the abnormal zone bit of the program exists, the special upgrading mode needs to be directly entered; if the normal shutdown flag bit exists, the normal shutdown is proved, and the firmware is directly started; if the program abnormal zone bit does not exist and the normal shutdown zone bit does not exist, recording the situation, if the times of judging whether the program abnormal zone bit and the normal shutdown zone bit in the data configuration area do not exist simultaneously exceed 3 times or not, and if the times of judging that the program abnormal zone bit and the normal shutdown zone bit do not exist simultaneously exceed 3 times continuously, considering that the firmware program is abnormal, and entering a special upgrading mode.
If the device is unexpectedly powered off and/or abnormally powered off, the abnormal situation can be obtained through whether the normal power-off zone bit exists or not in the step ten, if the normal power-off zone bit exists, the situation of unexpected power-off and/or abnormal power-off does not exist, and if the normal power-off zone bit does not exist, the situation of unexpected power-off and/or abnormal power-off exists.
In the firmware operation process, when detecting that the firmware program operates to a corresponding branch in a set program operation time, writing a normal operation flag bit into the data configuration area; when detecting that the firmware program does not run to the corresponding branch within a set program running time, not writing a normal running flag bit into the data configuration area; therefore, the embodiment determines whether the firmware program normally runs by judging whether the firmware program in the predetermined time runs to the corresponding branch.
In the fourth step, a special upgrade mode is entered, and the specific process of downloading the firmware to be upgraded in the internet is as follows:
the special upgrading program in the flash is networked with the cloud server through WiFi, and after the firmware to be upgraded is downloaded from the cloud server, the downloaded firmware to be upgraded is used for covering the original firmware in the flash.
In the preferred embodiment, in specific application, only when special upgrading is needed, remote firmware downloading is carried out and original firmware in the flash is covered, and the remotely downloaded firmware is not needed to be backed up, so that the storage space of the equipment is saved.
The preferred embodiment is that the boot program and the dedicated upgrade program in the flash do not allow erasure.
Referring to fig. 2, the present embodiment is described, in which the remote firmware automatic upgrade system for a small storage capacity device is implemented based on a flash in the device, where a boot program, a data configuration area, a dedicated upgrade program, and a firmware area are stored in the flash of the device; wherein, the first and the second end of the pipe are connected with each other,
a firmware area for storing firmware;
the data configuration area is used for recording the firmware running conditions, wherein the firmware running conditions comprise normal running zone bit conditions, program abnormal zone bit conditions, normal shutdown zone bit conditions, zone bit conditions to be upgraded, current starting frequency conditions and last starting frequency conditions;
the upgrading system comprises a power-on restarting module 1, a reading module 2, a flag bit judging module 3 to be upgraded, a special upgrading module 4, a normal operation flag bit and starting frequency judging module 5, a CRC (cyclic redundancy check) module 6, a program abnormal flag bit judging module 7, a firmware operating module 8, an upgrading instruction detecting module 9, a normal shutdown flag bit judging module 10, a recording module 11 and a frequency judging module 12 when the abnormal flag bit and the normal shutdown flag bit do not exist at the same time;
the power-on restarting module 1 is used for performing power-on restarting on the equipment, and the reading module 2 starts to work after the equipment is powered on and restarted;
the reading module 2 is used for reading the firmware running condition recorded in the firmware and data configuration area in the firmware area through the guidance of a bootstrap program, sending the flag bit condition to be upgraded in the firmware running condition to the flag bit judgment module 3 to be upgraded, sending the normal running flag bit condition, the current starting frequency condition and the last starting frequency condition in the firmware running condition to the normal running flag bit and starting frequency judgment module 5, and sending the normal shutdown flag bit condition in the firmware running condition to the normal shutdown flag bit judgment module 10;
the flag bit to be upgraded judging module 3 is used for judging whether a flag bit to be upgraded exists or not, and when the flag bit to be upgraded exists, sending an instruction of entering a special upgrading mode to the special upgrading module 4; when the flag bit to be upgraded does not exist, the normal operation flag bit and starting frequency judging module 5 judges whether the normal operation flag bit exists or not and judges whether the current starting frequency is changed compared with the last starting frequency or not;
if the normal operation zone bit and the starting frequency judging module 5 judges that the normal operation zone bit exists and the starting frequency changes, performing CRC on the firmware through a CRC checking module 6; if not, then,
if the normal operation zone bit and the starting frequency judging module 5 judges that the normal operation zone bit does not exist and/or the starting frequency does not change, the program abnormal zone bit judging module 7 judges whether the program abnormal zone bit exists or not, and if the program abnormal zone bit exists, an instruction of entering a special upgrading mode is sent to the special upgrading module 4; if the program abnormal zone bit does not exist, judging whether a normal shutdown zone bit exists or not through a normal shutdown zone bit judgment module 10; if the normal shutdown flag bit exists, performing CRC (cyclic redundancy check) on the firmware through a CRC check module 6; if the normal shutdown flag bit does not exist, recording the condition that the program abnormal flag bit does not exist and the normal shutdown flag bit does not exist into the data configuration area through the recording module 11, judging whether the times of the program abnormal flag bit and the normal shutdown flag bit in the data configuration area that do not exist simultaneously exceed 3 times through the times judging module 12 when the abnormal flag bit and the normal shutdown flag bit do not exist simultaneously, and sending a special upgrading mode entering instruction to the special upgrading module 4 when the judging result is yes; if the judgment result is negative, performing CRC on the firmware through a CRC checking module 6;
the CRC check module 6 is used for performing CRC check on the firmware, when the CRC check is successful, the firmware is normally operated to realize upgrade under the condition that a user keeps the equipment networking through the firmware operation module 8, the firmware operation condition in the operation process is recorded, and after the firmware operation condition is written into the data configuration area, whether an upgrade instruction written by the outside or the equipment is detected or not is judged through the upgrade instruction detection module 9; when an upgrade instruction written by the outside or written by the equipment is detected, the equipment is powered on and restarted through the power-on restarting module 1; when the external active writing or the upgrading instruction written by the device is not detected, the firmware running module 8 continues to keep the current working state;
and the special upgrading module 4 is used for enabling a special upgrading program in the flash to be networked with the cloud server through WiFi, and after downloading the firmware to be upgraded from the cloud server, covering the original firmware in the flash with the downloaded firmware to be upgraded.
The remote firmware automatic upgrading system of the small storage capacity equipment realizes automatic upgrading through mutual matching among the modules, the remote firmware automatic upgrading system of the small storage capacity equipment comprehensively verifies the firmware in the upgrading process, ensures safe operation of the firmware so as to realize smooth upgrading, does not need to backup the firmware program during remote upgrading, saves the storage space of the equipment, is suitable for the equipment with small storage space, automatically enters a special upgrading mode if upgrading is abnormal in the upgrading process, remotely downloads the firmware, covers the original firmware in the flash of the equipment by using the downloaded firmware, and upgrades the firmware after verifying the firmware again.
In the specific application process, CRC (cyclic redundancy check) can detect the condition that the firmware program in the firmware area is damaged due to sudden power failure in the upgrading process, if the condition of sudden power failure exists, the firmware program can not run, if the CRC is successfully verified, the condition that the firmware program is damaged due to power failure does not exist, if the CRC is failed, the condition that the firmware program is damaged due to power failure is verified, at the moment, a special upgrading mode needs to be entered, remote firmware downloading is carried out, and the newly downloaded firmware is used for replacing the original firmware in the firmware area.
If the abnormal condition that the program is abnormally flown or runs and crashes occurs, the abnormal condition can be obtained by judging whether the abnormal zone bit of the program exists or not, if the abnormal condition exists, the abnormal zone bit of the program exists, and if the abnormal condition does not exist, the abnormal zone bit of the program does not exist.
When the starting times of the firmware are detected, if the conditions of abnormal restarting and abnormal power-off restarting of the firmware program exist, the starting times of the firmware can be detected through the change of the starting times of the firmware, the boot program can read the last starting times of the firmware, when the firmware is started at the current time, whether the currently recorded times of the boot program are the same as the last recorded starting times or not can be judged, and if the currently recorded times of the boot program are not the same, the firmware is proved to be operated at least. If the two identifications are not available, the situation that power is cut off accidentally is likely to happen, because the device cannot record the identification bit program abnormal identification and the normal shutdown identification under the condition of power failure accidentally. If the program exception identifier exists, the program is proved to run, the program runs without time for writing the identifier, and a special upgrading mode needs to be entered for network upgrading, wherein the program exception identifier can be obtained by capturing the program exception running write data configuration area by a CPU, equipment can execute restarting operation because the program exception identifier is detected, and the corresponding steps are repeated by a bootstrap program to enter the special upgrading mode.
When the identification of the normal operation zone bit of the firmware is detected, if the zone bit is detected to be absent, the firmware program is considered to be possibly abnormal, the abnormal zone bit of the program and the normal shutdown zone bit are detected at this time, and if the abnormal zone bit of the program exists, the special upgrading mode needs to be directly entered; if the normal shutdown flag bit exists, the normal shutdown is proved, and the firmware is directly started; if the program abnormal zone bit does not exist and the normal shutdown zone bit does not exist, recording the situation, if the times of judging whether the program abnormal zone bit and the normal shutdown zone bit in the data configuration area do not exist simultaneously exceed 3 times or not, and if the times of judging that the program abnormal zone bit and the normal shutdown zone bit do not exist simultaneously exceed 3 times continuously, considering that the firmware program is abnormal, and entering a special upgrading mode.
If the device is unexpectedly powered off and/or abnormally powered off, the abnormal situation can be obtained through whether the normal power-off zone bit exists or not in the step ten, if the normal power-off zone bit exists, the situation of unexpected power-off and/or abnormal power-off does not exist, and if the normal power-off zone bit does not exist, the situation of unexpected power-off and/or abnormal power-off exists.
In the firmware operation process, when detecting that the firmware program operates to a corresponding branch in a set program operation time, writing a normal operation flag bit into the data configuration area; when detecting that the firmware program does not run to the corresponding branch within a set program running time, not writing a normal running flag bit into the data configuration area; therefore, the embodiment determines whether the firmware program normally runs by judging whether the firmware program in the predetermined time runs to the corresponding branch.
In the preferred embodiment, the remote firmware automatic upgrade system for small storage capacity devices, the boot program and the special upgrade program in the flash are not allowed to be erased.
In the remote firmware automatic upgrade chip according to this embodiment, a program corresponding to the remote firmware automatic upgrade method for the small storage capacity device is stored in the automatic upgrade chip.
The remote firmware automatic upgrading chip of the embodiment is a remote firmware automatic upgrading system with the small storage capacity equipment stored in the automatic upgrading chip.
Although the invention herein has been described with reference to particular embodiments, it is to be understood that these embodiments are merely illustrative of the principles and applications of the present invention. It is therefore to be understood that numerous modifications may be made to the illustrative embodiments and that other arrangements may be devised without departing from the spirit and scope of the present invention as defined by the appended claims. It should be understood that features described in different dependent claims and herein may be combined in ways different from those described in the original claims. It is also to be understood that features described in connection with individual embodiments may be used in other described embodiments.

Claims (7)

1. The remote firmware automatic upgrading method of small storage capacity equipment, the flash of the equipment stores bootstrap program, data configuration area, special upgrading program and firmware area; wherein the content of the first and second substances,
a firmware area for storing firmware;
the data configuration area is used for recording the firmware running conditions, wherein the firmware running conditions comprise normal running zone bit conditions, program abnormal zone bit conditions, normal shutdown zone bit conditions, zone bit conditions to be upgraded, current starting frequency conditions and last starting frequency conditions; the automatic upgrading method is characterized by comprising the following steps:
step one, equipment is electrified and restarted;
step two, the boot program guides and reads the firmware running condition recorded in the firmware area and the data configuration area;
step three, judging whether a zone bit to be upgraded exists or not, if so, executing the step four, and if not, executing the step five;
step four, entering a special upgrading mode, and downloading the firmware to be upgraded in a networking manner;
judging whether a normal operation zone bit exists or not, and judging whether the current starting times are changed compared with the last starting times or not; if so, judging that the normal operation zone bit exists and the starting times are changed, and executing a sixth step; otherwise, if the result is negative, judging that the normal operation zone bit does not exist and/or the starting times do not change, and executing the step seven;
step six, performing CRC on the firmware, judging whether the verification is successful, if so, executing the step eight, and if not, executing the step four;
step seven, judging whether a program abnormal zone bit exists; if so, executing the step four; if not, executing the step ten;
step eight, under the condition of keeping the equipment networking, the firmware normally runs to realize upgrading, the firmware running condition in the running process is recorded, and the firmware running condition is written into the data configuration area, and the step nine is executed;
step nine, judging whether an upgrade instruction written by the outside or written by the equipment is detected; if so, executing the step one; if not, executing the step eight;
step ten, judging whether a normal shutdown flag bit exists or not; if so, executing the step six; if not, executing the step eleven;
recording the situations that no program abnormal zone bit exists and no normal shutdown zone bit exists in a data configuration area, and executing a step twelve;
step twelve, judging whether the times of the absence of the program abnormal zone bit and the normal shutdown zone bit in the data configuration area exceed 3 times; if so, executing the step four; and if not, executing the step six.
2. The method for automatically upgrading the remote firmware of the small-storage-capacity device according to claim 1, wherein in step four, the dedicated upgrade mode is entered, and the specific process of downloading the firmware to be upgraded in a networking manner is as follows:
the special upgrading program in the flash is networked with the cloud server through WiFi, and after the firmware to be upgraded is downloaded from the cloud server, the downloaded firmware to be upgraded is used for covering the original firmware in the flash.
3. The method of claim 1, wherein the boot program and the dedicated upgrade program in the flash are not allowed to be erased.
4. The remote firmware automatic upgrading system of the small storage capacity equipment is realized based on a flash in the equipment, and a bootstrap program, a data configuration area, a special upgrading program and a firmware area are stored in the flash of the equipment; wherein the content of the first and second substances,
a firmware area for storing firmware;
the data configuration area is used for recording the firmware running conditions, wherein the firmware running conditions comprise normal running zone bit conditions, program abnormal zone bit conditions, normal shutdown zone bit conditions, zone bit conditions to be upgraded, current starting frequency conditions and last starting frequency conditions;
the upgrading system is characterized by comprising a power-on restarting module (1), a reading module (2), a flag bit judging module (3) to be upgraded, a special upgrading module (4), a normal operation flag bit and starting times judging module (5), a CRC (cyclic redundancy check) checking module (6), a program abnormal flag bit judging module (7), a firmware operating module (8), an upgrading instruction detecting module (9), a normal shutdown flag bit judging module (10), a recording module (11) and a times judging module (12) when the abnormal flag bit and the normal shutdown flag bit do not exist simultaneously;
the power-on restarting module (1) is used for performing power-on restarting on the equipment, and the reading module (2) starts to work after the equipment is powered on and restarted;
the reading module (2) is used for reading the firmware running condition recorded in the firmware and data configuration area in the firmware area through the guidance of a bootstrap program, sending the flag bit condition to be upgraded in the firmware running condition to the flag bit judgment module (3) to be upgraded, sending the normal running flag bit condition, the current starting frequency condition and the last starting frequency condition in the firmware running condition to the normal running flag bit and starting frequency judgment module (5), and sending the normal shutdown flag bit condition in the firmware running condition to the normal shutdown flag bit judgment module (10);
the to-be-upgraded flag bit judging module (3) is used for judging whether the to-be-upgraded flag bit exists or not, and when the to-be-upgraded flag bit exists, sending an instruction of entering a special upgrading mode to the special upgrading module (4); when the flag bit to be upgraded does not exist, the normal operation flag bit and starting frequency judging module (5) judges whether the normal operation flag bit exists or not and judges whether the current starting frequency is changed compared with the last starting frequency or not;
if the normal operation zone bit and the starting frequency judging module (5) judge that the normal operation zone bit exists and the starting frequency changes, performing CRC on the firmware through a CRC checking module (6); if not, then the mobile terminal can be switched to the normal mode,
if the normal operation zone bit and the starting frequency judging module (5) judges that the normal operation zone bit does not exist and/or the starting frequency does not change, the program abnormal zone bit judging module (7) judges whether the program abnormal zone bit exists or not, and if the program abnormal zone bit exists, a special upgrading mode entering instruction is sent to the special upgrading module (4); if the program abnormal zone bit does not exist, judging whether a normal shutdown zone bit exists or not through a normal shutdown zone bit judging module (10); if the normal shutdown flag bit exists, performing CRC (cyclic redundancy check) on the firmware through a CRC check module (6); if the normal shutdown zone bit does not exist, recording the condition that the program abnormal zone bit does not exist and the normal shutdown zone bit does not exist into the data configuration area through the recording module (11), judging whether the times of the program abnormal zone bit and the normal shutdown zone bit which do not exist simultaneously in the data configuration area exceed 3 times through the times judging module (12) when the abnormal zone bit and the normal shutdown zone bit do not exist simultaneously, and sending a command of entering a special upgrading mode to the special upgrading module (4) when the judging result is yes; if the judgment result is negative, performing CRC on the firmware through a CRC check module (6);
the CRC checking module (6) is used for performing CRC checking on the firmware, when the CRC checking is successful, the firmware is normally operated to realize upgrading under the condition that a user keeps equipment networking through the firmware operating module (8), the firmware operating condition in the operating process is recorded, and after the firmware operating condition is written into the data configuration area, whether an upgrade instruction written in by the outside or written in by the equipment is detected or not is judged through the upgrade instruction detecting module (9); when an upgrade instruction written by the outside or the equipment is detected, the equipment is powered on and restarted through the power-on restarting module (1); when the external active writing or the upgrading instruction written by the equipment is not detected, the firmware running module (8) continues to keep the current working state;
and the special upgrading module (4) is used for enabling a special upgrading program in the flash to be networked with the cloud server through WiFi, and after downloading the firmware to be upgraded from the cloud server, covering the original firmware in the flash with the downloaded firmware to be upgraded.
5. The automatic firmware upgrade system for small storage capacity devices according to claim 4, wherein the boot program and the dedicated upgrade program in the flash do not allow erasing.
6. A remote firmware automatic upgrade chip, characterized in that, the automatic upgrade chip stores a program corresponding to the remote firmware automatic upgrade method of the small storage capacity device according to one of claims 1 to 3.
7. The remote firmware automatic upgrade chip is characterized in that the automatic upgrade chip stores therein a remote firmware automatic upgrade system of the small storage capacity device according to claim 4 or 5.
CN202010801456.3A 2020-08-11 2020-08-11 Remote firmware automatic upgrading method, system and chip for small storage capacity equipment Active CN112152836B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010801456.3A CN112152836B (en) 2020-08-11 2020-08-11 Remote firmware automatic upgrading method, system and chip for small storage capacity equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010801456.3A CN112152836B (en) 2020-08-11 2020-08-11 Remote firmware automatic upgrading method, system and chip for small storage capacity equipment

Publications (2)

Publication Number Publication Date
CN112152836A CN112152836A (en) 2020-12-29
CN112152836B true CN112152836B (en) 2022-12-13

Family

ID=73887922

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010801456.3A Active CN112152836B (en) 2020-08-11 2020-08-11 Remote firmware automatic upgrading method, system and chip for small storage capacity equipment

Country Status (1)

Country Link
CN (1) CN112152836B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103761122A (en) * 2013-12-31 2014-04-30 青岛歌尔声学科技有限公司 Chip firmware updating method and system
CN109343873A (en) * 2018-08-28 2019-02-15 九阳股份有限公司 A kind of intelligent appliance remote upgrade control method
CN110457055A (en) * 2019-07-29 2019-11-15 珠海市一微半导体有限公司 A kind of firmware upgrade control method, system and controlling terminal towards fast charge agreement
CN110730104A (en) * 2019-10-29 2020-01-24 乐鑫信息科技(上海)股份有限公司 Method for upgrading multi-device batch firmware of mesh network device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103761122A (en) * 2013-12-31 2014-04-30 青岛歌尔声学科技有限公司 Chip firmware updating method and system
CN109343873A (en) * 2018-08-28 2019-02-15 九阳股份有限公司 A kind of intelligent appliance remote upgrade control method
CN110457055A (en) * 2019-07-29 2019-11-15 珠海市一微半导体有限公司 A kind of firmware upgrade control method, system and controlling terminal towards fast charge agreement
CN110730104A (en) * 2019-10-29 2020-01-24 乐鑫信息科技(上海)股份有限公司 Method for upgrading multi-device batch firmware of mesh network device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LXI仪器固件远程升级设计与实现;刘兆庆等;《测控技术》;20120718(第07期);全文 *

Also Published As

Publication number Publication date
CN112152836A (en) 2020-12-29

Similar Documents

Publication Publication Date Title
CN107179909B (en) Software upgrading method and device and computer readable storage medium
CN101281469B (en) Embedded type system and start-up load application method
CN105260215A (en) Method of updating vehicle-mounted automobile data recorder terminal by USB flash disk
WO2020062887A1 (en) Firmware upgrading method and system based on flash micro-controller, and flash micro-controller
CN108345464A (en) A kind of the startup method and Android vehicle device of Android system
CN105677398A (en) Universal embedded computer software on-line upgrading method
CN103970564A (en) Automatic repairing and upgrading method of embedded operating system and embedded operating system with automatic repairing and upgrading functions
CN112612524A (en) Method, device and equipment for starting Linux system and storage medium
CN101807152A (en) Basic output and input system for self verification of selection read only memory and verification method thereof
CN112015447B (en) System updating method and device of electronic equipment, electronic equipment and storage medium
CN111767172A (en) Self-repairing method for set top box based on watchdog and bootloader
CN109634781A (en) One kind is based on embedded program two-region Backup Images system and starting method
CN113641390B (en) System upgrading method, device, equipment and storage medium
CN115718610A (en) Reliable method for updating application program of single chip microcomputer
CN112152836B (en) Remote firmware automatic upgrading method, system and chip for small storage capacity equipment
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
KR100832269B1 (en) Program update method and system for wireless communication terminal
CN114610355A (en) Upgrading method and device suitable for power chip control software
JP2002175193A (en) Device and method for rewriting program
CN113778485A (en) System operation method and device of electronic chip, electronic chip and storage medium
WO2012062132A1 (en) Self-programming method and device for file system based on nand flash memory
CN111813597A (en) Air conditioner
CN111190627A (en) System upgrading method and device
CN107015827B (en) Embedded system and method for automatically operating third-party extension program thereof
CN117270914B (en) System upgrading method, device, equipment and medium of terminal equipment

Legal Events

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