Restore the method and system of manufacture in a kind of firmware upgrade process
Technical field
The invention belongs to restore in firmware upgrade technical field more particularly to a kind of firmware upgrade process manufacture method and
System.
Background technology
For general embedded device, in development phase and service stage, can all be frequently necessary to carry out firmware liter
Grade;By often also needing to restore manufacture configuration after page firmware updating, to ensure that equipment can normally start;Whole process
Equipment is just needed to start twice.
It is more time-consuming for such a problem in the production test stage, for small lot production, often encounter firmware
The problem of update, needs to carry out recovery manufacture to equipment after the completion of firmware update, again if by the way that flash is welded burning
The method burn-on again, more wasteful working hour, while defective products is also easy tod produce, but upgraded by the page and need startup two again
It is secondary, equally it is to expend the time.
In order to solve the above-mentioned technical problem, and people have carried out long-term exploration, such as Chinese patent disclose it is a kind of solid
Part update method and terminal [publication number:CN106843946A], it can not directly be upgraded in the existing basic version firmware of terminal
When target version firmware, according to the firmware information of the firmware information of basic version firmware and target version firmware, intermediate version is obtained
The firmware information of this firmware;Firmware upgrade operation is executed according to the firmware information of the intermediate releases firmware, with from the basis
Version firmware upgrade is to the intermediate releases firmware;Firmware upgrade behaviour is executed according to the firmware information of the target version firmware
Make, with from the intermediate releases firmware upgrade to the target version firmware;Wherein, the intermediate releases firmware can be simultaneous simultaneously
Hold the basic version firmware and target version firmware.
Said program passes through offer while compatible basic version firmware and target version firmware for the time-consuming situation of upgrading
Mode avoid can only by tear open machine complete version updating the case where, save renewal time, but said program only from one
Angle realizes the purpose for saving renewal time, for time-consuming situation, additionally it is possible to start with from other angles.
Invention content
Regarding the issue above, the present invention provides restoring the method for manufacture in a kind of firmware upgrade process;
The another object of this programme be to provide it is a kind of based on the above method can restore in firmware upgrade process manufacture
System.
In order to achieve the above objectives, present invention employs following technical proposals:
Restore the method for manufacture in a kind of firmware upgrade process, including:
A. firmware is upgraded according to upgrade file input by user, and detects whether that there are factory resets to refer to
It enables, if so, thening follow the steps B;
B. then the configuration trace that simultaneously erased user leaves in firmware is restarted and is set to restore the default setting of firmware
It is standby.
In the method for restoring manufacture in above-mentioned firmware upgrade process, further include before step A:
It provides and upgrades the page manually so that user manually controls escalation process.
Include firmware in the manual upgrading page in the method for restoring manufacture in above-mentioned firmware upgrade process
Current version information, upgrade file input frame and recovery manufacture choice box, and by judging whether user selects to restore manufacture choosing
It selects frame and detects whether that there are factory reset instructions.
In the method for restoring manufacture in above-mentioned firmware upgrade process, step A is specifically included:
A1. the upgrading page manually is provided after entering upgrade step, and receives upgrade file input by user;
A2. whether detection user has selected to restore manufacture choice box, if so, thening follow the steps B;
And step B is specifically included
After completing upgrading to the firmware in original configuration subregion according to upgrade file input by user, by user configuration subregion
Firmware after upgrading in original configuration subregion, is then copied in user configuration, lays equal stress on by the configuration erasing that interior user leaves
Open equipment.
In the method for restoring manufacture in above-mentioned firmware upgrade process, in step A2, if detecting, user does not select
Restore manufacture choice box, does not then execute step B and execute step C:
C. after then completing upgrading to the firmware in original configuration subregion, retain the configuration in user configuration subregion, and restart
Equipment.
It is a kind of to restore the system of manufacture in firmware upgrade process, including upgraded module, wipe module and restart mould
Block, wherein
Upgraded module, for being upgraded firmware according to upgrade file input by user;
Module is wiped, for wiping the configuration trace that leaves in firmware of user during upgrading to restore firmware
Default setting;
Module is restarted, in restarting equipment after the completion of upgrading.
In the above-mentioned system that can restore manufacture in firmware upgrade process, the system also includes interactive unit,
For being manually controlled to firmware upgrade process for user.
In the above-mentioned system that can restore manufacture in firmware upgrade process, the interactive unit includes current letter
It ceases display module, upgrade file input module and restores manufacture selecting module, wherein
Current information display module, the current version information for showing firmware;
Upgrade file input module, for inputting corresponding upgrade file for user with firmware updating;
Restore manufacture selecting module, recovery manufacture is carried out at the same time during firmware upgrade for being chosen whether for user
Setting.
In the above-mentioned system that can restore manufacture in firmware upgrade process, the system also includes detection module,
For whether factory reset being selected to be detected user, when detecting that user selects factory reset, lead to
Know that erasing module carries out factory reset to firmware simultaneously during upgrading.
In the above-mentioned system that can restore manufacture in firmware upgrade process, the erasing module is specifically used for erasing
The configuration that user leaves in user configuration subregion is to restore the default setting of firmware in user configuration subregion;
The upgraded module includes sub- upgraded module and replication module, wherein
Sub- upgraded module, for upgrading the firmware in original configuration subregion according to upgrade file input by user;
Replication module, being used for will be original after erasing module is completed to the factory reset of firmware in user configuration subregion
Firmware in configuration subregion after upgrading is copied in user configuration.
The present invention has the following advantages compared to the prior art:
The action for completing to restore manufacture while firmware updating is realized by way of software, reduces manual operation step
Suddenly, shorten update time, improve upgrading efficiency.
Description of the drawings
Fig. 1 is the method flow diagram of the embodiment of the present invention one;
Fig. 2 is to upgrade page schematic diagram in the embodiment of the present invention one manually;
Fig. 3 is that the prior art upgrades page schematic diagram manually;
Fig. 4 is the method flow diagram of the embodiment of the present invention two;
Fig. 5 is the system structure diagram of the embodiment of the present invention three.
Reference numeral:Equipment 1;Upgraded module 11;Sub- upgraded module 111;Replication module 112;Wipe module 12;Restart mould
Block 13;Interactive unit 14;Current information display module 141;Upgrade file input module 142;Restore manufacture selecting module 143;
Detection module 15.
Specific implementation mode
Although operations are described as the processing of sequence by flow chart, many of which operation can by concurrently,
Concomitantly or simultaneously implement.The sequence of operations can be rearranged.Processing can be terminated when its operations are completed,
It is also possible to the additional step being not included in attached drawing.Processing can correspond to method, function, regulation, subroutine, son
Program etc..
Term "and/or" used herein above includes the arbitrary and institute of the associated item listed by one of them or more
There is combination.When a unit is referred to as " connecting " or when " coupled " to another unit, can be connected or coupled to described
Another unit, or may exist temporary location.
Term used herein above is not intended to limit exemplary embodiment just for the sake of description specific embodiment.Unless
Context clearly refers else, otherwise singulative used herein above "one", " one " also attempt to include plural number.Also answer
When understanding, term " include " and or " include " used herein above provide stated feature, integer, step, operation,
The presence of unit and/or component, and do not preclude the presence or addition of other one or more features, integer, step, operation, unit,
Component and/or a combination thereof.
The present invention is used for firmware upgrade, solves the prior art and needs flash welding the method that burning is burn-on again,
Or to lead to problems such as escalation process take long for the method firmware updating for restarting twice, is the preferred embodiment of the present invention below
And in conjunction with attached drawing, technical scheme of the present invention will be further described, but the present invention is not limited to these Examples.
Embodiment one
The firmware upgrade of the prior art is exactly often simple firmware upgrade, and after completing to upgrade, equipment 1 opens again
It is dynamic, it then carries out restoring manufacture configuration, more wasteful time again, the present embodiment is directed to this problem, and specially proposing can be
The method that factory reset is carried out at the same time during firmware upgrade, whole process need to only start once, improve upgrading efficiency.
It should be noted that it is original configuration file that the firmware of embedded device 1, which generally has two parts of configuration files, portion,
The configuration inside flash is namely write on, is not modifiable configuration, that is, manufacture configuration.
Other one point of configuration file is user configuration, when equipment 1 is dispatched from the factory, user configuration i.e. original configuration it is standby
Part;After equipment 1 is dispatched from the factory, user can need that administrator's password, SSID, network access etc. is arranged according to oneself, after changing
Configuration is just stored in user configuration, this portion configuration can be changed.
The meaning for restoring manufacture is exactly that original configuration file is covered user profile, so that the configuration energy of equipment 1
It is enough restored to the same when manufacture.
Specifically, as shown in Figure 1, restoring the method for manufacture in firmware upgrade process disclosed in the present embodiment, including:
A. firmware is upgraded according to upgrade file input by user, and detects whether that there are factory resets to refer to
It enables, if so, thening follow the steps B;
B. the configuration trace that simultaneously erased user leaves in firmware is to restore the default setting of firmware, then restarting equipment
1。
Also, further include before step A:
It provides and upgrades the page manually so that user manually controls escalation process.
Further, as shown in Fig. 2, including the current version information of firmware in the manual upgrading page, for example,
Current version information shown in Fig. 2 is 22.22.1.16;Upgrade file input frame and recovery manufacture choice box, upgrade file are defeated
It can be connection frame to enter frame, and user clicks in Fig. 2 can search corresponding upgrade file after browsing from equipment 1;Restore
Choice box dispatch from the factory in a manner of choosing, is detected whether when whether user chooses recovery manufacture choice box in the presence of recovering by judgement
Factory's setting instruction when user chooses the frame before the configuration words sample that restores to dispatch from the factory in Fig. 2, represents user and selects to restore manufacture configuration,
At this point, testing result be there are factory reset instructions, otherwise, then represent user need not during upgrading simultaneously into
Restore manufacture configuration.
The manual upgrading page of the prior art is as shown in figure 3, furthermore, it is necessary to illustrate, if not used in user equipment 1
Family needs the upgrade file of selection, then downloads junction by Tu2Huo Tu3Zhong officials and click " clicking here " printed words from official website
Download corresponding upgrade file.
Embodiment two
As shown in figure 4, the method for restoring manufacture in firmware upgrade process disclosed in the present embodiment includes:
A1. powered on to equipment 1, into upgrade step after the upgrading page manually is provided, receive user and select in the device 1
Upgrade file;
A2. before determining upgrading, user chooses whether to choose recovery manufacture as needed, and whether equipment 1 detects user
Factory reset is selected, if so, thening follow the steps B;
Step B is specifically included:
After completing upgrading to the firmware in original configuration subregion according to upgrade file input by user, by user configuration subregion
Firmware after upgrading in original configuration subregion, is then copied in user configuration to complete by the configuration erasing that interior user leaves
Factory reset, and restarting equipment 1.
The upgrading of equipment 1 is completed and what is used after restarting is exactly manufacture configuration after upgrading, since then, upgrading completion.
Further, in step A2, if detecting, user does not select factory reset, that is to say, that user does not have
The option for restoring manufacture in Fig. 2 is chosen, then after completing upgrading to the firmware in original configuration subregion, is retained in user configuration subregion
Configuration, and restarting equipment 1.Equipment 1 starts after completing upgrading, and what is used is exactly user configuration, at this point, subsequently can be self-healing
Manufacture.
Firmware upgrade and recovery manufacture were synthesized a step by the present embodiment for the step of two actions originally, by firmware
The time of upgrading+recovery manufacture shortens half, and improving upgrading efficiency can especially in the production line be easier to, and larger
Testing efficiency and production efficiency are improved in degree.
Also, the present embodiment retaining device 1 " restore manufacture " function of itself, user can Self-operating as needed, will
The optional option of " restoring manufacture " as " firmware upgrade ", the scope of application are wider.
Embodiment three
As shown in figure 5, present embodiment discloses a kind of system that can restore manufacture in firmware upgrade process, the system
In the equipment 1 for needing to carry out firmware upgrade comprising upgraded module 11 wipes module 12 and restarts module 13, wherein
Upgraded module 11, for being upgraded firmware according to upgrade file input by user;
Module 12 is wiped, for wiping the configuration trace that leaves in firmware of user during upgrading to restore firmware
Default setting;
Module 13 is restarted, for completing the updating operation to firmware, and the erasing completion pair of module 12 in upgraded module 11
After the factory reset of firmware, alternatively, the restarting equipment 1 after upgraded module is completed to the updating operation of firmware.
Further, the system also includes interactive units 14, for being controlled manually to firmware upgrade process for user
System.
Also, interactive unit 14 here includes current information display module 141,142 and of upgrade file input module
Restore manufacture selecting module 143, wherein
Current information display module 141, the current version information for showing firmware;
Upgrade file input module 142, for inputting corresponding upgrade file for user with firmware updating;
Restore manufacture selecting module 143, recovery is carried out at the same time during firmware upgrade for being chosen whether for user
Default setting.
Further, whether the system also includes detection modules 15, for selecting factory reset to carry out user
Detection, when detecting that user selects factory reset, notice erasing module 12 is during upgrading simultaneously to solid
Part carries out factory reset.
The erasing module 12 is specifically used in erasing user configuration subregion the configuration that leaves of user to restore user configuration
The default setting of firmware in subregion;
The upgraded module 11 includes sub- upgraded module 111 and replication module 112, wherein
Sub- upgraded module 111, for upgrading the firmware in original configuration subregion according to upgrade file input by user;
Replication module 112, for after erasing module 12 is completed to the factory reset of firmware in user configuration subregion
Firmware after upgrading in original configuration subregion is copied in user configuration.
Specific embodiment described herein is only to be given an example to the present invention.The technical field of the invention
Technical staff can make various modifications or additions to the described embodiments or substitute by a similar method, but
Without departing from the spirit of the invention or going beyond the scope defined by the appended claims.
In addition, although equipment 1 is used more herein;Upgraded module 11;Sub- upgraded module 111;Replication module 112;
Wipe module 12;Restart module 13;Interactive unit 14;Current information display module 141;Upgrade file input module 142;Restore
Manufacture selecting module 143;The terms such as detection module 15, but it does not preclude the possibility of using other terms.Use these terms
Be only for the convenience of describing and explaining the nature of the invention be construed as any one of the additional limitations all and be with
What spirit of that invention was disagreed.