Summary of the invention
Based on this, it is necessary to aiming at the problem that prior art upgrades low efficiency, provide a kind of operating system update method andDevice.
A kind of operating system update method, comprising the following steps:
It is corresponding getting corresponding first upgrade file of BOOT, corresponding second upgrade file of system main program and MCUThird upgrade file after, by the corresponding backup subregion of upgrade command writing system, and be arranged upgrading BOOT first mark;
BOOT is upgraded according to first mark, upgrade command and first upgrade file, then setting risesSecond mark of grade system main program, and needed for the first parameter needed for upgrade-system main program and upgrading MCU second is joinedNumber is transmitted separately to system main program and MCU;
Respond second mark and parse second upgrade file, according to the upgrade command, first parameter andSecond upgrade file upgrades system main program, then the third mark of setting upgrading MCU, and will upgrade MCU instituteThe third parameter needed is transmitted to MCU;
Respond the third mark and parse the third upgrade file, and according to the upgrade command, second parameter,Third parameter and the third upgrade file upgrade MCU.
A kind of operating system update device, comprising:
Writing module, for getting corresponding second upgrading of corresponding first upgrade file of BOOT, system main programAfter file and the corresponding third upgrade file of MCU, by the corresponding backup subregion of upgrade command writing system, and upgrading is setThe first mark of BOOT;
First upgraded module, for according to first mark, upgrade command and first upgrade file to BOOT intoThen the second mark of upgrade-system main program is arranged in row upgrading, and by the first parameter and liter needed for upgrade-system main programSecond parameter needed for grade MCU is transmitted separately to system main program and MCU;
Second upgraded module parses second upgrade file for responding second mark, is ordered according to the upgradingEnable, first parameter and second upgrade file upgrade system main program, then setting upgrading MCU third markWill, and third parameter needed for upgrading MCU is transmitted to MCU;
Third upgraded module parses the third upgrade file for responding the third mark, and according to the upgradingOrder, second parameter, third parameter and the third upgrade file upgrade MCU.
Aforesaid operations method for upgrading system and device, by writing BOOT, MCU and the corresponding upgrade file of system main programEnter the corresponding backup subregion of system, the second mark of upgrade-system main program is set after upgrading to BOOT, responds instituteThe upgrading process that the second mark enters system main program is stated, then the third mark of setting upgrading MCU, responds the third markInto the upgrading process of MCU, disposably BOOT, MCU and system main program can be upgraded, upgrading is high-efficient, using justBenefit.
Specific embodiment
The embodiment of operating system update method of the invention is described with reference to the accompanying drawing.
Fig. 1 is the operating system update method flow diagram of one embodiment.As shown in Figure 1, operating system liter of the inventionGrade method can comprise the following steps that
S1 is getting corresponding first upgrade file of BOOT, corresponding second upgrade file of system main program and MCU pairsAfter the third upgrade file answered, by the corresponding backup subregion of upgrade command writing system, and the first mark of upgrading BOOT is setWill;
In this step, the corresponding second upgrading text of corresponding first upgrade file of BOOT, system main program can first be obtainedPart and the corresponding third upgrade file of MCU.First upgrade file, the second upgrade file and can be obtained by two waysThree upgrade files.Method first is that directly download first upgrade file, the second upgrade file and third upgrade file, and will underThe upgrade file of load is saved in internal storage device.Method is second is that access movable storage device, and read the mobile storageFirst upgrade file, the second upgrade file and third upgrade file in equipment.
By taking android system as an example, it is corresponding that corresponding first upgrade file of BOOT, android system main program can be obtainedThe second upgrade file and the corresponding third upgrade file of MCU.Sustainable monitoring OTA (Over-the-AirTechnology, over the air) PUSH message, and after receiving OTA PUSH message, upgrading text is downloaded from serverPart.Alternatively, the sustainable access for monitoring movable storage device, and after having detected movable storage device access, scan instituteState the upgrade file in movable storage device.
Then, MCU, the cache of the upgrade command write-in android system of BOOT and Android main program will can be dividedIn the recovery catalogue in area.For example, can define upgrade_all order as to MCU, the three of BOOT and Android main programUnify upgrade command, and by the upgrade_all order be written android system cache subregion recovery catalogueIn.The upgrade_all order is for recording the mark of upgrade-system.
Boot environmental variance upgrade_boot can be set as 1, and restart android system, into bootstrapBootloader detects environmental variance upgrade_boot.The boot environmental variance upgrade_boot is upgrading BOOTFirst mark.
S2 upgrades BOOT according to first mark, upgrade command and first upgrade file, is then arrangedSecond mark of upgrade-system main program, and will be second needed for the first parameter needed for upgrade-system main program and upgrading MCUParameter is transmitted separately to system main program and MCU;
As shown in Fig. 2, can be upgraded according to such as under type to BOOT:
S21 reads first upgrade file after reading the upgrade command;
S22, first upgrade file is verified;
S23, if first upgrade file be it is complete and correct, wipe BOOT storage region, described first is upgradedThe corresponding storage region of BOOT, starting system of laying equal stress on is written in file.
Still by taking android system as an example, the first upgrade file boot.bin can be read, boot.bin is verified, ifBoot.bin be it is complete and correct, corresponding storage region can be wiped by SPI Flash, and BOOT is written into boot.binCorresponding storage region.It is to be written finish after, system can be restarted.
After completing BOOT upgrading process, the second mark of settable upgrade-system main program, and by upgrade-system masterFirst parameter needed for program is transmitted separately to system main program and MCU with the second parameter needed for upgrading MCU.System is detectingTo after second mark, the upgrading process of main program can be executed automatically.
S3 responds second mark and parses second upgrade file, according to the upgrade command, first parameterSystem main program is upgraded with second upgrade file, then the third mark of setting upgrading MCU, and MCU will be upgradedRequired third parameter is transmitted to MCU;
In this step, system can detect whether that there are second marks, if detecting, can respond second markParse second upgrade file.Then, it can detect whether that there are the upgrade commands, and if it exists, can order according to the upgradingEnable, first parameter and second upgrade file upgrade system main program, then setting upgrading MCU third markWill, and third parameter needed for upgrading MCU is transmitted to MCU.Wherein, according to the upgrade command, first parameter and instituteState the second upgrade file the concrete mode that system main program is upgraded may is that in the BOOT program after calling upgrading theOne parameter, and whether include the upgrade command in the corresponding backup subregion of detection system, if comprising can be according to first ginsengSeveral and second upgrade file executes the upgrading process of system main program.
As shown in figure 3, in one embodiment, the upgrading process of system main program can be executed according to such as under type:
S31 reads second upgrade file and the first parameter;
S32 verifies second upgrade file and the first parameter;
S33 will be described if second upgrade file is complete and correct, the storage region of erasing system main programThe corresponding storage region of the system main program, starting system of laying equal stress on is written in second upgrade file and the first parameter.
Still by taking android system as an example, the second upgrade file update.zip can be read, and decompressed.It then, can be rightThe second upgrade file after decompression is verified.It can examine whether SF file matches with RSA file, MANIFEST.MF and signatureIt is whether consistent in file, and described in the second upgrade file and MANIFEST after decompression it is whether consistent.If describedTwo upgrade files be it is complete and correct, can by boot.img be written BOOT subregion, recovery is written into recovery.imgSubregion updates system subregion, and upgrades all firmwares.
After the upgrading process for completing system main program, erasable second mark, the third mark of setting upgrading MCUWill, and third parameter needed for upgrading MCU is transmitted to MCU.
S4 responds the third mark and parses the third upgrade file, and according to the upgrade command, second ginsengNumber, third parameter and the third upgrade file upgrade MCU.Specifically, in the BOOT program after upgrading can be calledThe second parameter and upgrading after system main program in third parameter, and in the corresponding backup subregion of detection system whether includeThe upgrade command;If comprising executing MCU upgrading according to second parameter, third parameter and the third upgrade fileProcess.
As shown in figure 4, in one embodiment, the upgrading process of MCU can be executed according to such as under type:
S41 reads the third upgrade file, the second parameter and third parameter;
S42 verifies the third upgrade file, the second parameter and third parameter;
S43, if the third upgrade file, the second parameter and third parameter be it is complete and correct, wipe the storage of MCUThe corresponding storage region of the MCU is written in the third upgrade file, the second parameter and third parameter by region, and again onElectricity.
Aforesaid operations method for upgrading system, can be after obtaining a upgrade file, to BOOT, system main program and MCUThree-in-one upgrading is carried out, upgrading efficiency is improved.Also, upgrade file can not only be obtained by downloading mode, but also can be passed throughThe mode of insertion movable storage device obtains, and convenient for users and operation improves user experience.
The embodiment of operating system update device of the invention is described with reference to the accompanying drawing.
Fig. 5 is the structural schematic diagram of the operating system update device of one embodiment.As shown in figure 5, operation of the inventionSystem upgrade device can include:
Writing module 10, for get corresponding first upgrade file of BOOT, system main program second liter correspondingAfter grade file and the corresponding third upgrade file of MCU, by the corresponding backup subregion of upgrade command writing system, and upgrading is setThe first mark of BOOT;
The write module 10 can first obtain corresponding second upgrading of corresponding first upgrade file of BOOT, system main programFile and the corresponding third upgrade file of MCU.Can be obtained by two ways first upgrade file, the second upgrade file andThird upgrade file.Method is first is that directly download first upgrade file, the second upgrade file and third upgrade file, and incite somebody to actionThe upgrade file of downloading is saved in internal storage device.Method is second is that access movable storage device, and read the movement and depositStore up first upgrade file, the second upgrade file and the third upgrade file in equipment.
By taking android system as an example, it is corresponding that corresponding first upgrade file of BOOT, android system main program can be obtainedThe second upgrade file and the corresponding third upgrade file of MCU.Sustainable monitoring OTA (Over-the-AirTechnology, over the air) PUSH message, and after receiving OTA PUSH message, upgrading text is downloaded from serverPart.Alternatively, the sustainable access for monitoring movable storage device, and after having detected movable storage device access, scan instituteState the upgrade file in movable storage device.
Then, MCU, the cache of the upgrade command write-in android system of BOOT and Android main program will can be dividedIn the recovery catalogue in area.For example, can define upgrade_all order as to MCU, the three of BOOT and Android main programUnify upgrade command, and by the upgrade_all order be written android system cache subregion recovery catalogueIn.The upgrade_all order is for recording the mark of upgrade-system.
Boot environmental variance upgrade_boot can be set as 1, and restart android system, into bootstrapBootloader detects environmental variance upgrade_boot.The boot environmental variance upgrade_boot is upgrading BOOTFirst mark.
First upgraded module 20, for indicating according to described first, upgrade command and first upgrade file are to BOOTUpgraded, then the second mark of upgrade-system main program be set, and by the first parameter needed for upgrade-system main program andSecond parameter needed for upgrading MCU is transmitted separately to system main program and MCU;
First upgraded module 20 can include:
First reading unit, for reading first upgrade file after reading the upgrade command;
First verification unit, for being verified to first upgrade file;
First writing unit, if for first upgrade file being complete and correct, erasable BOOT storage region,By the corresponding storage region of first upgrade file write-in BOOT, starting system of laying equal stress on.
Still by taking android system as an example, the first upgrade file boot.bin is can be read in the first reading unit, and the first verification is singleMember can verify boot.bin, if boot.bin be it is complete and correct, the first writing unit can be wiped by SPI FlashThe corresponding storage region of BOOT is written except corresponding storage region, and by boot.bin.It is to be written finish after, can restart and beSystem.
After completing BOOT upgrading process, the second mark of the settable upgrade-system main program of the first upgraded module 20,And by the first parameter needed for upgrade-system main program and upgrading MCU needed for the second parameter be transmitted separately to system main program andMCU.System can execute the upgrading process of main program after detecting second mark automatically.
Second upgraded module 30 parses second upgrade file for responding second mark, according to the upgradingOrder, first parameter and second upgrade file upgrade system main program, then the third of setting upgrading MCUMark, and third parameter needed for upgrading MCU is transmitted to MCU;
Second upgraded module 30 can detect whether that there are second marks, if detecting, can respond second markParse second upgrade file.Then, it can detect whether that there are the upgrade commands, and if it exists, can order according to the upgradingEnable, first parameter and second upgrade file upgrade system main program, then setting upgrading MCU third markWill, and third parameter needed for upgrading MCU is transmitted to MCU.Wherein, second upgraded module 30 may include the first calling listMember, for calling the first parameter in the BOOT program after upgrading, first detection unit, for the corresponding backup point of detection systemIt whether include the upgrade command, the first upgrade unit, if for comprising can be according to first parameter and described second in areaThe upgrading process of upgrade file execution system main program.
In one embodiment, the first upgrade unit can include:
Second reading unit, for reading second upgrade file and the first parameter;
Second verification unit, for being verified to second upgrade file and the first parameter;
Second writing unit, if for second upgrade file be it is complete and correct, erasable system main programSecond upgrade file and the first parameter are written the corresponding storage region of the system main program, and restarted by storage regionSystem.
Still by taking android system as an example, the second upgrade file update.zip is can be read in the second reading unit, and is solvedPressure.Then, the second verification unit can verify the second upgrade file after decompression.SF file can be examined is with RSA fileIt is whether consistent in no matching, MANIFEST.MF and signature file, and the second upgrade file after decompression and institute in MANIFESTWhether what is described is consistent.If second upgrade file be it is complete and correct, boot.img can be written for the second writing unitRecovery.img is written recovery subregion, updates system subregion, and upgrade all firmwares by BOOT subregion.
After the upgrading process for completing system main program, erasable second mark of the second upgraded module 30, settingUpgrade the third mark of MCU, and third parameter needed for upgrading MCU is transmitted to MCU.
Third upgraded module 40 parses the third upgrade file for responding the third mark, and according to the literGrade order, second parameter, third parameter and the third upgrade file upgrade MCU.The third upgraded module40 can include: the second call unit, for the main journey of system after calling the second parameter in the BOOT program after upgrading and upgradingThird parameter in sequence;Second detection unit, for whether including the upgrade command in the corresponding backup subregion of detection system;Second upgrade unit, if for comprising executing MCU according to second parameter, third parameter and the third upgrade fileUpgrade process.
In one embodiment, the second upgrade unit can include:
Third reading unit, for reading the third upgrade file, the second parameter and third parameter;
Third verification unit, for being verified to the third upgrade file, the second parameter and third parameter;
Third writing unit, if for the third upgrade file, the second parameter and third parameter be it is complete and correct,The third upgrade file, the second parameter and third parameter, are written that the MCU is corresponding to be deposited by the storage region of erasable MCUStorage area domain, and re-power.
Aforesaid operations system upgrade device, can be after obtaining a upgrade file, to BOOT, system main program and MCUThree-in-one upgrading is carried out, upgrading efficiency is improved.Also, upgrade file can not only be obtained by downloading mode, but also can be passed throughThe mode of insertion movable storage device obtains, and convenient for users and operation improves user experience.
Operating system update device of the invention and operating system update method of the invention correspond, in aforesaid operationsTechnical characteristic and its advantages that the embodiment of method for upgrading system illustrates are suitable for the implementation of operating system update deviceIn example, hereby give notice that.
Each technical characteristic of embodiment described above can be combined arbitrarily, for simplicity of description, not to above-mentioned realityIt applies all possible combination of each technical characteristic in example to be all described, as long as however, the combination of these technical characteristics is not depositedIn contradiction, all should be considered as described in this specification.
The embodiments described above only express several embodiments of the present invention, and the description thereof is more specific and detailed, but simultaneouslyIt cannot therefore be construed as limiting the scope of the patent.It should be pointed out that coming for those of ordinary skill in the artIt says, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to protection of the inventionRange.Therefore, the scope of protection of the patent of the invention shall be subject to the appended claims.