A kind of automatically upgrading firmware method and its storage medium based on storage medium
Technical field
The present invention relates to the technical fields of firmware upgrade, and in particular to a kind of automatically upgrading firmware side based on storage medium
Method and its storage medium.
Background technique
The software upgrading of current some professional electrical apparatus usually requires technical professional and passes through laptop
Human assistance upgrading or upgraded by dedicated upgrading platelet, if the software of client is once when something goes wrong,
It is generally necessary to which the long period just can solve problem, in addition, equipment supplier is also required to be equipped with more technical team and material resources money
Services client is carried out in source, and cost consumption is larger, working efficiency is low.
Summary of the invention
It is an object of the invention to solve the problems of the prior art, a kind of firmware based on storage medium is provided and is risen automatically
Grade method and its storage medium, the automatically upgrading firmware method is simple, upgrading is convenient, and in no professional, uses
Family can voluntarily carry out updating operation, reduce human and material resources cost, be convenient for remote maintenance.
To reach above-mentioned purpose, the present invention adopts the following technical scheme:
A kind of automatically upgrading firmware method based on storage medium contains upgrade procedure in the storage medium;The side
Method includes: that storage medium and electronic equipment to be upgraded are established connection;Main MCU in electronic equipment to be upgraded starts and sweeps automatically
The upgrade file of the upgrade procedure in storage medium is retouched, and compares file name;If file name is consistent, electronic equipment to be upgraded
In main MCU then by storage medium the write-in of single upgrade file or multiple upgrade files be sequentially written in;Multiple liters are written
Grade file when, main MCU the last one upgrading, and upgrade before judge whether main MCU needs to upgrade, if desired upgrade, then last
A upgrade file, which jumps to application layer after writing direct into the ROM of main MCU or FLASH, to be terminated to upgrade, if without upgrading,
Jumping directly to application layer terminates to upgrade.
Further, when comparing file name, main MCU in the equipment to be upgraded is by the upgrade file in upgrade procedure
File name be compared with the file name that the file name of corresponding secondary MCU or main MCU are pre-set.
Further, when the upgrade procedure in the storage medium contains multiple upgrade files, in electronic equipment to be upgraded
Main MCU successively the upgrade file scanned is ranked up during automatically scanning storage medium.
Further, the main MCU in the electronic equipment to be upgraded is successively read the content of each upgrade file, and main
MCU is written into the ROM or FLASH of corresponding secondary MCU after every content for having read a upgrade file.
Further, when the upgrade procedure in the storage medium contains a upgrade file, the electronics to be upgraded is set
After main MCU in standby reads the upgrade file contents, be written into the ROM for the main MCU or secondary MCU for needing to upgrade or
In FLASH.
Further, the storage medium is that portable storage equipment or cloud store.
A kind of storage medium in the automatically upgrading firmware method applied to above-mentioned based on storage medium, including memory
And processor;The memory is used to store the upgrade procedure;The processor is for calling upgrading in the memory
The upgrade file of program.
Compared with the existing technology, the beneficial effect of acquirement is technical solutions according to the invention:
(1) disposably all MCU in Multiple MCU System are upgraded by the upgrade procedure in storage medium, is avoided
There are multiple MCU in MCU system and need the case where individually being upgraded, upgrading efficiency can be effectively improved.
(2) upgraded by the entrained upgrade procedure in storage medium, simple, convenient, client is not having
Professional technician can be easy to use, easy to operate since progress firmware upgrade in the case where field;Convenient for remote maintenance,
Reduce human and material resources cost.
(3) it by storage mediums such as USB flash disk, cloud storages, carries or extracts and is convenient, fast.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present invention, constitutes a part of the invention, this hair
Bright illustrative embodiments and their description are used to explain the present invention, and are not constituted improper limitations of the present invention.In the accompanying drawings:
Fig. 1 is the process of the firmware upgrade method in the embodiment of the present invention one in storage medium when only one upgrade file
Schematic diagram;
Fig. 2 is to have the process of firmware upgrade method when multiple upgrade files to show in storage medium in the embodiment of the present invention two
It is intended to.
Specific embodiment
In order to be clearer and more clear technical problems, technical solutions and advantages to be solved, tie below
Drawings and examples are closed, the present invention will be described in further detail.It should be appreciated that specific embodiment described herein is only used
To explain the present invention, it is not intended to limit the present invention.
Embodiment one
Firmware upgrade side when only one upgrade file in storage medium of the embodiment of the present invention is shown referring to Fig. 1, Fig. 1
The flow diagram of method.As shown in Figure 1, the embodiment of the invention provides a kind of automatically upgrading firmware sides based on storage medium
Method, storage medium here refer to cloud memory module or portable portable memory module (such as USB flash disk), which is situated between
Contain upgrade procedure in matter, for being iterated update for the firmware in mobile phone, computer or other electronic products.
It specifically, should consolidating based on storage medium when the upgrade procedure in storage medium contains only a upgrade file
For part automatically updating method specifically includes the following steps: storage is established connection with electronic equipment to be upgraded, which can be for electrically
The connection types such as connection, wireless communication connection or network communication connection.
It establishes after connection, the main MCU in electronic equipment to be upgraded starts the liter in starting and automatically scanning storage medium
The upgrade file of grade program, and compare file name;Specifically, the main MCU in equipment to be upgraded will upgrade journey in storage medium
The file name of the upgrade file of sequence is pre-set with the file name of secondary MCU corresponding in equipment to be upgraded or main MCU
File name is compared.
At this point, main MCU in electronic equipment to be upgraded is literary by the single upgrading in storage medium if file name is consistent
Part be written into the ROM or FLASH for needing the main MCU that updates or secondary MCU for needing to update it is interior after, jump to system application layer
Terminate upgrading.
Embodiment two
Firmware upgrade method when there are multiple upgrade files in storage medium of the embodiment of the present invention is shown referring to Fig. 1, Fig. 1
Flow diagram.As shown in Figure 1, the embodiment of the invention provides a kind of automatically upgrading firmware method based on storage medium,
Here storage medium refers to cloud memory module or portable portable memory module (such as USB flash disk), the storage medium
Inside contain upgrade procedure, for being iterated update for the firmware in mobile phone, computer or other electronic products.
Specifically, the firmware based on storage medium is somebody's turn to do when the upgrade procedure in storage medium contains multiple upgrade files certainly
Dynamic upgrade method specifically includes the following steps: storage with electronic equipment to be upgraded is established connection, the connection can be electrically connected,
The connection types such as wireless communication connection or network communication connection.
It establishes after connection, the main MCU in electronic equipment to be upgraded starts the liter in starting and automatically scanning storage medium
The upgrade file of grade program, and compare file name.Specifically, after the main MCU starting in electronic equipment to be upgraded, sequentially
Also each upgrade file is sequentially ranked up while being scanned to the upgrade file in storage medium, such as by traversing of probe
To upgrade file be sequentially named as the first upgrade file, the second upgrade file, third upgrade file ... etc.;Compare filename
When title, main MCU in equipment to be upgraded by the file name of the upgrade file in storage medium upgrade procedure sequentially with it is corresponding
The file name that the file name of secondary MCU or main MCU are pre-set sequentially is compared.
When file name compares, if the file that the file name of corresponding corresponding secondary MCU or main MCU are pre-set
Title is consistent, just carries out firmware upgrade, the content of each upgrade file is successively read by the main MCU in equipment to be upgraded, and main
MCU is written into the ROM or FLASH of corresponding secondary MCU after every content for having read a upgrade file;Tool
Body, after the content that a upgrade file has been read by the main MCU in equipment to be upgraded, it is written into corresponding filename
In the ROM or FLASH of the secondary MCU claimed, then, the main MCU in equipment to be upgraded continues to read the content of next upgrade file,
And the upgrade file newly read is written into the ROM or FLASH of the secondary MCU of corresponding file name again, and so on, directly
To by institute update in need secondary MCU updated later be left the last one upgrade file, at this point, the master in equipment to be upgraded
MCU judges whether its own needs to upgrade, and if desired upgrades, then the last one upgrade file write direct to the ROM of main MCU or
Jumping to application layer after in FLASH terminates to upgrade, if jumping directly to application layer terminates to upgrade without upgrading.
Embodiment three
The present embodiment also provides the storage in a kind of automatically upgrading firmware method applied to above-mentioned based on storage medium and is situated between
Matter, the storage medium include memory and processor;Memory is used to store the upgrade procedure;Processor is deposited for calling
The upgrade file of upgrade procedure in reservoir to receive the instruction of the main MCU in equipment to be upgraded, and presses above-mentioned automatically upgrading firmware
Method calls upgrade file to main MCU.
Using above-described embodiment as can be seen that the present invention is based in the automatically upgrading firmware method of storage medium, by depositing
Upgrade procedure in storage media disposably upgrades all MCU in Multiple MCU System, avoids the occurrence of more in MCU system
A MCU needs the case where individually being upgraded, and can effectively improve upgrading efficiency.
Upgraded by the entrained upgrade procedure in storage medium, simple, convenient, client is in no profession
Technical staff can be easy to use, easy to operate since progress firmware upgrade in the case where field;Convenient for remote maintenance, reduce
Human and material resources cost.
By storage mediums such as USB flash disk, cloud storages, carries or extract and is convenient, fast.
Description above describe the preferred embodiments of the type of this practical sample, it is to be understood that the type of this practical sample not limits to
In above-described embodiment, and excluding other embodiments should not be regarded as.Enlightenment through the invention, those skilled in the art combine
The change that the known or prior art, knowledge are carried out also should be regarded as in the protection scope that this hair is invented.