CN107908416A - Microcontroller firmware upgrade method, device and computer-readable recording medium - Google Patents

Microcontroller firmware upgrade method, device and computer-readable recording medium Download PDF

Info

Publication number
CN107908416A
CN107908416A CN201711499175.1A CN201711499175A CN107908416A CN 107908416 A CN107908416 A CN 107908416A CN 201711499175 A CN201711499175 A CN 201711499175A CN 107908416 A CN107908416 A CN 107908416A
Authority
CN
China
Prior art keywords
script
firmware
version
clouds
subregion
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201711499175.1A
Other languages
Chinese (zh)
Inventor
陈艳春
苟睿琳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen TCL New Technology Co Ltd
Original Assignee
Huizhou TCL Home Appliances Group 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 Huizhou TCL Home Appliances Group Co Ltd filed Critical Huizhou TCL Home Appliances Group Co Ltd
Priority to CN201711499175.1A priority Critical patent/CN107908416A/en
Publication of CN107908416A publication Critical patent/CN107908416A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Abstract

The invention discloses a kind of microcontroller firmware upgrade method, including:Obtain the first version information of high in the clouds script firmware and the second edition information of current Run Script firmware;The first version information and second edition information are contrasted, judge whether the version of high in the clouds script firmware is higher than the version of current Run Script firmware;When the version of high in the clouds script firmware is higher than the version of current Run Script firmware, the script file of the corresponding script firmware in high in the clouds is downloaded to default script subregion.The invention also discloses a kind of microcontroller device for upgrading firmware, computer-readable recording medium.The present invention solves the problem of needing supplier to provide technical support when the prior art is updated upgrading to microcontroller firmware, upgrading difficulty is big.

Description

Microcontroller firmware upgrade method, device and computer-readable recording medium
Technical field
The present invention relates to field of intelligent control technology, more particularly to a kind of microcontroller firmware upgrade method, device and calculating Machine readable storage medium storing program for executing.
Background technology
Currently in intelligent appliance field, the basic scheme using " home wiring control plate+IOT Internet of Things chip ", it is so-called Line upgrading is also concentrated mainly on IOT Internet of Things chip firmware itself.To find out its cause, mainly IOT Internet of Things chip producer is basic All it is provided with more mature online upgrading scheme, but appliance plate MCU, for a long time all without the need of online upgrading firmware Ask.Cause, very more MCU is without the scheme for improving ripe online upgrading firmware at present.Upon power-up, MCU first can One section of bootloader program is performed since the bootloader subregions in flash subarea, bootloader is exactly to press substantially The firmware file for the version specified according to certain logic strategy loading is run, wherein different firmwares are stored in the form of image In different flash subareas.Therefore when upgrading to the microcontroller of the prior art, MCU chip producer is at least needed to provide:flash The method of interface and the subregion switching of subregion;The scheme of bootloader programs is provided.If the bootloader schemes of acquiescence Can not meet demand, then user must be customized exploitation.Since bootloader is in close relations with hardware, even if there is chip Producer's technical support is also still difficult, and time cycle input is very long.Moreover when MCU chip scheme changes, but it is necessary Re-start and targetedly develop, there is no reusability to say substantially.To sum up, in the prior art, microcontroller firmware is carried out more Supplier is needed to provide technical support during new upgrading, upgrading difficulty is big.
The content of the invention
It is a primary object of the present invention to provide a kind of microcontroller firmware upgrade method, device and computer-readable storage medium Matter, it is intended to solve in the prior art, to need supplier to provide technical support when being updated upgrading to microcontroller firmware, upgrading is difficult Spend the problem of big.
To achieve the above object, the present invention provides a kind of microcontroller firmware upgrade method, the microcontroller firmware upgrade side Method includes:
Obtain the first version information of high in the clouds script firmware and the second edition information of current Run Script firmware;
The first version information and second edition information are contrasted, judge whether the version of high in the clouds script firmware is high In the version of current Run Script firmware;
When the version of high in the clouds script firmware is higher than the version of current Run Script firmware, downloads the corresponding script in high in the clouds and consolidate The script file of part is to default script subregion.
Preferably, it is described to be contrasted the first version information and second edition information, judge high in the clouds script firmware Version whether be higher than current Run Script firmware version the step of after further include:
When the version of high in the clouds script firmware is not higher than the version of current Run Script firmware, from the last item first edition The contrast of this information proceeds by timing when completing;
Judge whether timing time value is equal to preset time value;
When timing time value is when the preset time value, step is performed:Obtain the first version letter of high in the clouds script firmware The second edition information of breath and current Run Script firmware.
Preferably, the default script subregion at least two, the first version information for obtaining high in the clouds script firmware Include with before the step of second edition information of current Run Script firmware:
Obtain the version information of the script firmware of each default script subregion;
The version information of acquisition is contrasted, determines the highest script firmware of version;
The corresponding script file of the highest script firmware of version is imported into script engine, so that the script engine is to institute State script file and carry out parsing execution.
Preferably, before the step of script file to default script subregion of the corresponding script firmware in the download high in the clouds also Including:
When the version of high in the clouds script firmware is higher than the version of current Run Script firmware, current Run Script firmware is determined Script file where the first default script subregion;
Script file to the default script subregion for downloading the corresponding script firmware in high in the clouds includes:
The script file of the corresponding script firmware in download high in the clouds is into the default script subregion except the first default script The second default script subregion outside subregion.
Preferably, include before the step of version information of the script firmware for obtaining each default script subregion:
The related software and hardware resources of initialization, and registration Script and preset programming language interface layer.
Preferably, the related software and hardware resources include at least embedded OS, hardware driving layer, firmware version dimension Protect support module and script engine.
Preferably, wrapped after the step of script file to default script subregion of the corresponding script firmware in the download high in the clouds Include:
Restarting firmware instructions are received, and step is performed according to the restarting firmware instructions:Initialization is related soft Hardware resource, and registration Script and preset programming language interface layer.
Preferably, after the step of script file to default script subregion of the corresponding script firmware in the download high in the clouds also Including:
New version information is set according to the script file of download.
In addition, to achieve the above object, the present invention also provides a kind of microcontroller device for upgrading firmware, the microcontroller firmware Update device includes:Memory, processor and it is stored in the microcontroller that can be run on the memory and on the processor Firmware upgrade procedure, the microcontroller firmware upgrade procedure realize microcontroller firmware liter as described above when being performed by the processor The step of level method.
In addition, to achieve the above object, it is described computer-readable the present invention also provides a kind of computer-readable recording medium Microcontroller firmware upgrade procedure is stored with storage medium, is realized such as when the microcontroller firmware upgrade procedure is executed by processor Above the step of microcontroller firmware upgrade method.
The present invention provides a kind of microcontroller firmware upgrade method, device and computer-readable recording medium, the microcontroller Firmware upgrade method includes:Obtain the first version information of high in the clouds script firmware and the second edition letter of current Run Script firmware Breath;The first version information and second edition information are contrasted, judges whether the version of high in the clouds script firmware is higher than and works as The version of preceding Run Script firmware;When the version of high in the clouds script firmware is higher than the version of current Run Script firmware, cloud is downloaded The script file of corresponding script firmware is held to default script subregion.By the above-mentioned means, script technology is introduced, by firmware updating Realized by way of upgrading data script file, the mode for avoiding passing through exploitation bootloader carrys out firmware updating, simplifies Firmware upgrade process.
Brief description of the drawings
Fig. 1 is the terminal structure schematic diagram for the hardware running environment that the embodiment of the present invention is related to;
Fig. 2 is the flow diagram of microcontroller firmware upgrade method first embodiment of the present invention;
Fig. 3 is the flow diagram of microcontroller firmware upgrade method second embodiment of the present invention;
Fig. 4 is the flow diagram of microcontroller firmware upgrade method 3rd embodiment of the present invention;
Fig. 5 is the flow diagram of microcontroller firmware upgrade method fourth embodiment of the present invention;
Fig. 6 is the flow diagram of the 5th embodiment of microcontroller firmware upgrade method of the present invention;
Fig. 7 is the flow diagram of microcontroller firmware upgrade method sixth embodiment of the present invention;
Fig. 8 is the flow diagram of the 7th embodiment of microcontroller firmware upgrade method of the present invention.
Embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
During the microcontroller upgrading of the prior art, producer is at least needed to provide the interface of flash subarea and the side of subregion switching The technical supports such as the scheme of method and bootloader programs, upgrading difficulty are big.
In order to solve the above technical problem, the present invention provides a kind of microcontroller firmware upgrade method, in the method, first obtain Take the first version information of high in the clouds script firmware and the second edition information of current Run Script firmware, then by the first version Information and second edition information are contrasted, and judge whether the version of high in the clouds script firmware is higher than the version of current Run Script firmware This, when the version of high in the clouds script firmware is higher than the version of current Run Script firmware, downloads the corresponding script firmware in high in the clouds Script file is to default script subregion.
As shown in Figure 1, microcontroller device for upgrading firmware in the hardware running environment that Fig. 1, which is the embodiment of the present invention, to be related to The structure diagram of affiliated terminal.
Terminal of the embodiment of the present invention can be PC or smart mobile phone, tablet computer, E-book reader, MP3 (Moving Picture Experts Group Audio Layer III, dynamic image expert's compression standard audio aspect 3) Player, MP4 (Moving Picture Experts Group Audio Layer IV, dynamic image expert's compression standard sound Frequency aspect 4) player, pocket computer etc. have the packaged type terminal device of display function.
As shown in Figure 1, the terminal can include:Processor 1001, such as CPU, network interface 1004, user interface 1003, memory 1005, communication bus 1002.Wherein, communication bus 1002 is used for realization the connection communication between these components. User interface 1003 can include display screen (Display), input unit such as keyboard (Keyboard), optional user interface 1003 can also include standard wireline interface and wireless interface.Network interface 1004 can optionally connect including the wired of standard Mouth, wave point (such as WI-FI interfaces).Memory 1005 can be high-speed RAM memory or the memory of stabilization (non-volatile memory), such as magnetic disk storage.Memory 1005 optionally can also be independently of aforementioned processor 1001 storage device.
Alternatively, terminal can also include camera, RF (Radio Frequency, radio frequency) circuit, sensor, audio Circuit, WiFi module etc..Wherein, sensor ratio such as optical sensor, motion sensor and other sensors.Specifically, light Sensor may include ambient light sensor and proximity sensor, wherein, ambient light sensor can according to the light and shade of ambient light come The brightness of display screen is adjusted, proximity sensor can close display screen and/or backlight when mobile terminal is moved in one's ear.As One kind of motion sensor, gravity accelerometer can detect in all directions the size of (generally three axis) acceleration, quiet It can detect that size and the direction of gravity when only, the application available for identification mobile terminal posture is (such as horizontal/vertical screen switching, related Game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, tap) etc.;Certainly, mobile terminal can also match somebody with somebody The other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared ray sensor are put, details are not described herein.
It will be understood by those skilled in the art that the restriction of the terminal structure shown in Fig. 1 not structure paired terminal, can wrap Include than illustrating more or fewer components, either combine some components or different components arrangement.
As shown in Figure 1, it can lead to as in a kind of memory 1005 of computer-readable storage medium including operating system, network Believe module, Subscriber Interface Module SIM and microcontroller firmware upgrade procedure.
In the terminal shown in Fig. 1, network interface 1004 is mainly used for connecting background server, is carried out with background server Data communication;User interface 1003 is mainly used for connecting client (user terminal), with client into row data communication;And processor 1001 can be used for calling the microcontroller firmware upgrade procedure stored in memory 1005, and perform following operation:
Obtain the first version information of high in the clouds script firmware and the second edition information of current Run Script firmware;
The first version information and second edition information are contrasted, judge whether the version of high in the clouds script firmware is high In the version of current Run Script firmware;
When the version of high in the clouds script firmware is higher than the version of current Run Script firmware, downloads the corresponding script in high in the clouds and consolidate The script file of part is to default script subregion.
Further, processor 1001 can call the microcontroller firmware upgrade procedure stored in memory 1005, also hold The following operation of row:
When the version of high in the clouds script firmware is not higher than the version of current Run Script firmware, from the last item first edition The contrast of this information proceeds by timing when completing;
Judge whether timing time value is equal to preset time value;
When timing time value is when the preset time value, step is performed:Obtain the first version letter of high in the clouds script firmware The second edition information of breath and current Run Script firmware.
Further, processor 1001 can call the microcontroller firmware upgrade procedure stored in memory 1005, also hold The following operation of row:
Obtain the version information of the script firmware of each default script subregion;
The version information of acquisition is contrasted, determines the highest script firmware of version;
The corresponding script file of the highest script firmware of version is imported into script engine, so that the script engine is to institute State script file and carry out parsing execution.
Further, processor 1001 can call the microcontroller firmware upgrade procedure stored in memory 1005, also hold The following operation of row:
When the version of high in the clouds script firmware is higher than the version of current Run Script firmware, current Run Script firmware is determined Script file where the first default script subregion;
Script file to the default script subregion for downloading the corresponding script firmware in high in the clouds includes:
The script file of the corresponding script firmware in download high in the clouds is into the default script subregion except the first default script The second default script subregion outside subregion.
Further, processor 1001 can call the microcontroller firmware upgrade procedure stored in memory 1005, also hold The following operation of row:
The related software and hardware resources of initialization, and registration Script and preset programming language interface layer.
Further, processor 1001 can call the microcontroller firmware upgrade procedure stored in memory 1005, also hold The following operation of row:
Restarting firmware instructions are received, and step is performed according to the restarting firmware instructions:Initialization is related soft Hardware resource, and registration Script and preset programming language interface layer.
Further, processor 1001 can call the microcontroller firmware upgrade procedure stored in memory 1005, also hold The following operation of row:
New version information is set according to the script file of download.
Based on above-mentioned hardware configuration, the embodiment of proposition microcontroller firmware upgrade method of the present invention.
With reference to Fig. 2, first embodiment of the invention provides a kind of microcontroller firmware upgrade method, the microcontroller firmware upgrade Method includes:
Step S10, obtains the first version information of high in the clouds script firmware and the second edition letter of current Run Script firmware Breath;
The present embodiment is applied to field of intelligent control technology.It is basic to use " home wiring control plate currently in intelligent appliance field The scheme of+IOT Internet of Things chip ", so-called online upgrading are also concentrated mainly on IOT Internet of Things chip firmware itself.It is former to study carefully it Cause, mainly IOT Internet of Things chips producer is all provided with more mature online upgrading scheme substantially, but appliance plate MCU, long All without the demand of online upgrading firmware since phase.Cause, very more MCU consolidates without the online upgrading for improving maturation at present The scheme of part.Upon power-up, MCU can perform one section since the bootloader subregions in flash subarea first Bootloader programs, bootloader are exactly that the firmware file for the version specified according to certain logic strategy loading comes substantially Operation, wherein different firmwares are stored in different flash subareas in the form of image.Therefore to the microcontroller liter of the prior art During level, MCU chip producer is at least needed to provide:The method of interface and the subregion switching of flash subarea;Bootloader journeys are provided The scheme of sequence.If the bootloader schemes of acquiescence can not meet demand, then user must be customized exploitation.Due to Bootloader is in close relations with hardware, also still difficult even if there is the technical support of chip producer, and the time cycle puts into very It is long.Moreover when MCU chip scheme changes, and it must re-start and targetedly develop, there is no reusability to say substantially. To sum up, in the prior art, need supplier to provide technical support when being updated upgrading to microcontroller firmware, upgrade difficulty Greatly.Present invention introduces script technology, firmware updating is changed to upgrading data script file, so as to avoid passing through exploitation The mode of bootloader carrys out firmware updating, simplifies firmware upgrade process.
In the present embodiment, after system electrification, operation bootloader has loaded user's firmware program, first initializes MCU Hardware resource, loads image, mobile PC pointer operation firmware program from flash.After user's firmware behaves, perform User's firmware flow.During user's firmware flow is performed, first initialize related software and hardware resources and registration Script with it is pre- Put programming language interface layer.Wherein related software and hardware resources include at least embedded OS, hardware driving layer, firmware version Maintenance support module and script engine.Embedded OS and hardware driving layer are used to provide operating and controlling interfaces of the MCU to hardware With multiple task real-time operation system function;Firmware version maintenance support module be used for realization consumer products feature release management and Switching, realizes user's firmware flow and gpio line upgrading flow.Script engine takes charge of the explanation the foot for performing consumer products function This program.In the present embodiment, the service logic of consumer products function is developed by script.Script and preset programming language connect Mouth layer can be script and C language interface layer, be the C language function library that standard abstraction encapsulation is called according to script, encapsulate foot The interface of this operation hardware driving layer.The flash subarea of the present embodiment keeps bootloader subregions and acquiescence Bootloader programs are constant, and MCU user's firmware Image subregions are reduced to one;Remaining flash is all as user data Space uses.This user data space is divided into one or more script subregions as needed, for preserving different users Product function script firmware.The script firmware of highest version is determined after initialization from script subregion and is imported in script engine to hold OK.Then online upgrading thread is created, online upgrading flow is entered according to the online upgrading thread of establishment.In formerly upgrading flow In, first obtain the first version information of high in the clouds script firmware and the second edition information of current Run Script firmware.Wherein The script firmware in high in the clouds is uploaded by script firmware development person, and sets version information according to unified edit methods, such as can be with Version information is set according to the form of character code, for some script firmware X, the version information of script firmware can be set The form of X.k.y is set to, wherein k, y is the digital coding that the priority issued according to firmware version is set.Such as the script firmware Initial version information could be provided as X.1.0, the version information of the script firmware of subsequent issued be respectively set to X.1.1, X.1.2 ... in the present embodiment, second edition information is the version information of currently running script firmware, its version information Edit methods are consistent with the edit methods of the version information of high in the clouds script firmware.In the present embodiment, high in the clouds can preserve script Firmware all script firmware file and version information, can also only preserve the script firmware text for meeting preset condition as needed The script firmware file and version information of part and version information, such as the script firmware of newest issue.
Step S20, the first version information and second edition information are contrasted, judge the version of high in the clouds script firmware Whether this is higher than the version of current Run Script firmware;
Based on above-mentioned steps, in the first version information for obtaining high in the clouds script firmware and the second of current Run Script firmware After version information, first version information and second edition information are contrasted, judge whether the version of high in the clouds script firmware is high In the version of current Run Script firmware.In the present embodiment, the issuing time of a script firmware B is in another script firmware When after the issuing time of A, judge that the version of script firmware B is higher than the version of script firmware A.Version is judged in the present embodiment Judge during height with reference to editor's rule of version information.Based on above-described embodiment, when first version information for X.1.1 when, if When second edition information is X.1.0, judge that high in the clouds script firmware version is higher than current Run Script firmware version;If the second edition When information is X.1.2, judge that high in the clouds firmware version is less than current Run Script firmware version.Based on above-mentioned steps, high in the clouds may There are multiple script firmwares and corresponding multiple version information, when high in the clouds is there are during multiple version informations, obtain one by one in high in the clouds Version information and with currently running script firmware version information contrast, judge whether that version is higher than current Run Script The version of firmware.When script firmware of the high in the clouds there are multiple versions, can also first determine in the version information that obtains beyond the clouds Determine the highest version information of version, then obtain the highest version information of version and contrasted with second edition information.
Step S30, when the version of high in the clouds script firmware is higher than the version of current Run Script firmware, downloads high in the clouds and corresponds to Script firmware script file to default script subregion.
Based on above-mentioned steps, first version information and second edition information are carried out to contrast the version for judging high in the clouds script firmware When this is higher than the version of current Run Script firmware, the script file of the corresponding script firmware in high in the clouds is downloaded and is stored in default Script subregion.Specifically, based on above-mentioned steps, when the first version information of high in the clouds script firmware is X.1.1 current Run Script When the second edition information of firmware is X.1.0, by high in the clouds, X.1.1 corresponding script firmware is downloaded and is stored in default script point Area.The default script subregion of the present embodiment for the file data of storage script firmware preset subregion, from pre- after system electrification If obtaining the version information of script firmware in script subregion, and determine the firmware version performed.In the present embodiment, right When flash working regions divide, keep the bootloader programs of bootloader subregions and acquiescence constant, MCU user is consolidated Part Image subregions are reduced to one;Remaining flash is all used as user data space.This user data space according to Some script subregions are required division into, for preserving the script firmware of different consumer products functions.Specifically, script subregion is At two, the subregion of the file storage of current Run Script firmware, then the foot by X.1.1 corresponding script firmware can be first determined This document is downloaded to another script subregion.
In the present embodiment, the first version information of high in the clouds script firmware and the second edition of current Run Script firmware are obtained This information;The first version information and second edition information are contrasted, judge whether the version of high in the clouds script firmware is high In the version of current Run Script firmware;When the version of high in the clouds script firmware is higher than the version of current Run Script firmware, under The script file of the corresponding script firmware in high in the clouds is carried to default script subregion.By the above-mentioned means, introducing script technology, will upgrade Firmware realizes that the mode for avoiding passing through exploitation bootloader carrys out firmware updating, letter by way of upgrading data script file Firmware upgrade process is changed.
Further, with reference to Fig. 3, Fig. 3 is the flow diagram of microcontroller firmware upgrade method second embodiment of the present invention.
Based on above-described embodiment, in the present embodiment, step 20 includes:
Step S40, when the version of high in the clouds script firmware is not higher than the version of current Run Script firmware, from last The contrast of bar first version information proceeds by timing when completing;
Step S50, judges whether timing time value is equal to preset time value;
When timing time value is when the preset time value, step S10 is performed.
Based on above-described embodiment, step S20 is performed afterwards it is also possible that the version of high in the clouds script firmware is not higher than current The situation of the version of Run Script firmware.Based on above-described embodiment, when a script firmware is only stored in high in the clouds, high in the clouds is being judged When the version of firmware is not higher than the version of current Run Script firmware, starts timing, be equal to preset time value in timing time value When, the version information of high in the clouds script firmware and current Run Script firmware is reacquired, is re-started since step S10 online Upgrade flow.When high in the clouds is there are during multiple script firmwares, the first version information of drink will be carried out with second edition information one by one Contrast, after all first version information contrasts, judges the version of all script firmwares in high in the clouds not higher than current operation Script firmware version when, from the last item first version information contrast complete when proceed by timing, in timing time value During equal to preset time value, online upgrading flow is re-started since step S10.The preset time value of the present embodiment can root According to needing to set, such as it could be provided as 20s.
In the present embodiment, when the version of high in the clouds script firmware is not higher than the version of current Run Script firmware, from The contrast of the last item first version information proceeds by timing when completing;Judge whether timing time value is equal to preset time value; When timing time value is when the preset time value, step is performed:Obtain the first version information of high in the clouds script firmware and current The second edition information of Run Script firmware.By the above-mentioned means, can the script firmware information to high in the clouds of timing supervise in time Control, script firmware upgrade is timely carried out when being published to high in the clouds so as to new script firmware.
Further, with reference to Fig. 4, Fig. 4 is the flow diagram of microcontroller firmware upgrade method 3rd embodiment of the present invention.
Based on above-described embodiment, in the present embodiment, the default script subregion at least two, step S10 is wrapped before Include:
Step S60, obtains the version information of the script firmware of each default script subregion;
Step S70, the version information of acquisition is contrasted, and determines the highest script firmware of version;
Step S80, imports script engine, so that the script by the corresponding script file of the highest script firmware of version Engine carries out parsing execution to the script file.
Based on above-described embodiment, in the present embodiment, presetting script subregion can be including at least there are two.In this implementation In the flash subarea of example, keep the bootloader programs of bootloader subregions and acquiescence constant, by MCU user's firmware Image subregions are reduced to one;Remaining flash is all used as user data space.This user data space is according to need At least two script subregions are divided into, for preserving the consumer products function script firmware of different editions.In the present embodiment, The highest script firmware of version in default script subregion is first determined before step S10, and performs the highest script firmware of version.Tool Body, when default script subregion for script subregion A and script subregion B two when, based on above-described embodiment, when script subregion A is deposited The version information for the script firmware put for X.1.5, the version information of the script firmware of script subregion B storages for X.1.6 when, first from X.1.5 and X.1.6 the version information of script firmware is obtained in script subregion A and script subregion B, and will X.1.5 and X.1.6 carried out Contrast determines that the script firmware of highest version is that script information is script firmware X.1.6 in script subregion B, by script subregion B In corresponding script file import in script engine and perform.In the present embodiment, script engine takes charge of the explanation execution consumer products The shell script of function.Script engine can also pass through script and preset programming language during perform script program is explained Interface calls the function library of programming language.
In the present embodiment, the version information of the script firmware of each default script subregion is obtained;The version of acquisition is believed Breath is contrasted, and determines the highest script firmware of version;The corresponding script file of the highest script firmware of version is imported into script Engine, so that the script engine carries out parsing execution to the script file.By the above-mentioned means, determine currently performed Script firmware is the highest script firmware of version in default script subregion, so that high in the clouds first version information and version are preset foot The highest script subregion contrast of version in this subregion, the script firmware version for ensureing to download is than all script firmwares in microcontroller Version is high.
Further, with reference to Fig. 5, Fig. 5 is the flow diagram of microcontroller firmware upgrade method fourth embodiment of the present invention.
Based on above-described embodiment, in the present embodiment, the script file for downloading the corresponding script firmware in high in the clouds is to pre- If further included before being further included before the step of script subregion:
Step S90, when the version of high in the clouds script firmware is higher than the version of current Run Script firmware, determines current operation The first default script subregion where the script file of script firmware;
Script file to the default script subregion for downloading the corresponding script firmware in high in the clouds includes:
Step S100, downloads the script file of the corresponding script firmware in high in the clouds into the default script subregion except first The second default script subregion outside default script subregion.
Based on above-described embodiment, script subregion at least two is preset.Two default script partitioned storages different scripts The script file of firmware, the script firmware downloaded from high in the clouds need to store in one of which script subregion.In the present embodiment In, when the version of high in the clouds script firmware is higher than the version of current Run Script firmware, first determine currently running script firmware Script file storage the first script subregion, then by version high script firmware of the high in the clouds version than currently performed script firmware Crus secunda this subregion being downloaded to outside the first script subregion.The first script subregion of the present embodiment refers to that current Run Script is consolidated Default script subregion where the script file of part, the second default script subregion are referred in addition to the first default script subregion Default script subregion.The fourth embodiment of above-mentioned microcontroller firmware upgrade method is based specifically on, in the present embodiment, if high in the clouds When the version information for preserving script firmware is X.1.7, X.1.7 the version of corresponding script firmware is X.1.6 more right than currently running Answer the version of script firmware high, the storage script subregion for determining X.1.6 corresponding script file is script subregion B, i.e. the first foot This subregion is script subregion B, this subregion of crus secunda is script subregion A, therefore, X.1.7 will be downloaded to foot by corresponding script file In this subregion A.In the present embodiment, will be before X.1.7 corresponding script file be downloaded in script subregion A, first by script subregion A In X.1.5 corresponding script file remove, then will X.1.7 corresponding script file be downloaded in script subregion A.
In the present embodiment, when the version of high in the clouds script firmware is higher than the version of current Run Script firmware, determine to work as The first default script subregion where the script file of preceding Run Script firmware;The foot for downloading the corresponding script firmware in high in the clouds This document to default script subregion includes:The script file of the corresponding script firmware in high in the clouds is downloaded into the default script subregion The second default script subregion in addition to the first default script subregion.By the above-mentioned means, can be by the highest version foot in high in the clouds This firmware is downloaded to the default script subregion outside the default script subregion of the script file storage of currently running script firmware, Avoid having an impact currently running firmware.
Further, with reference to Fig. 6, Fig. 6 is the flow diagram of the 5th embodiment of microcontroller firmware upgrade method of the present invention.
Based on above-described embodiment, in the present embodiment, further included before step S60:
Step S110, initializes related software and hardware resources, and registration Script and preset programming language interface layer.The correlation Software and hardware resources include at least embedded OS, hardware driving layer, firmware version maintenance support module and script engine.Base In upper embodiment, in the present embodiment, after bootloader has loaded user's firmware program, related software and hardware money is first initialized Source, and registration Script and preset programming language interface layer.The present invention realizes the operation and upgrading of firmware by script technology, related Software and hardware resources include at least embedded OS, hardware driving layer, firmware version maintenance support module and script engine.It is embedding Enter formula operating system and hardware driving layer is used to provide operating and controlling interfaces and multiple task real-time operation system function of the MCU to hardware; Firmware version maintenance support module is used for realization the management and switching of consumer products feature release, realizes user's firmware flow and leads to With online upgrading flow.Script engine takes charge of the explanation the shell script for performing consumer products function.In the present embodiment, user produces The service logic of product function is developed by script.Script and preset programming language interface layer can be script and C language interface Layer, is the C language function library that standard abstraction encapsulation is called according to script, encapsulates the interface of script operation hardware driving layer.
In the present embodiment, related software and hardware resources, and registration Script and preset programming language interface layer are initialized, it is described Related software and hardware resources draw including at least embedded OS, hardware driving layer, firmware version maintenance support module and script Hold up.By the above-mentioned means, related software and hardware resources are initialized, to do standard for user's firmware flow and online upgrading flow It is standby.
Further, with reference to Fig. 7, Fig. 7 is the flow diagram of microcontroller firmware upgrade method sixth embodiment of the present invention.
Based on above-described embodiment, in the present embodiment, further included after step S30:
Step S120, receives restarting firmware instructions, receives restarting firmware instructions, and according to the restarting Firmware instructions perform step S110.
Based on above-described embodiment, in the present embodiment, after the script file in high in the clouds is downloaded to default script subregion, automatically Triggering restarting firmware instructions, and user's firmware flow is re-executed since step S110 according to restarting firmware instructions With the correlation step of online upgrading flow.Specifically, based on above-described embodiment, after being X.1.7 downloaded to script subregion A, triggering Firmware instructions are restarted, relevant software and hardware resources and registration Script and C language are initialized according to restarting firmware instructions X.1.7 and X.1.6 interface, then read the version information in script subregion A and script subregion B, obtains, carries out contrast and determine respectively X.1.7 corresponding script firmware version, will than X.1.6 the version of corresponding script firmware is high in script subregion B in script subregion A X.1.7 corresponding script file, which is imported in script engine, performs and creates online upgrading thread, and obtaining high in the clouds script from step consolidates The first version information of part and the second edition information of current Run Script firmware started from lower the step of performing online upgrading.
In the present embodiment, restarting firmware instructions are received, and step is performed according to the restarting firmware instructions:Just Beginningization correlation software and hardware resources, and registration Script and preset programming language interface layer.It is by the above-mentioned means, new when being downloaded from high in the clouds Script file to after default script subregion, from the related software and hardware resources of initialization, and registration Script connects with preset programming language The step of mouth layer, starts to restart firmware, to complete the switching of the version of script firmware in time, performs the script of highest version Firmware.
Further, with reference to Fig. 8, Fig. 8 is the flow diagram of the 7th embodiment of microcontroller firmware upgrade method of the present invention.
Based on above-described embodiment, in the present embodiment, further included after step S30:
Step S130, new version information is set according to the script file of download.
Based on above-described embodiment, in the present embodiment, by the script file in high in the clouds be downloaded to corresponding default script subregion it Afterwards, the version information for the script file downloaded according to the file of download according to above-mentioned unified method editor is simultaneously stored in corresponding pre- If script subregion in, in the present embodiment, can also be according to the version information of the script file in high in the clouds directly corresponding pre- If script subregion sets identical version information.Specifically, will be after X.1.7 corresponding script file be downloaded to script subregion A, will " X.1.7 " version information is stored in script subregion A.
In the present embodiment, new version information is set according to the script file of download.By the above-mentioned means, to downloading to The script file of default script subregion sets version information, to determine version most according to the version information when subsequently starting firmware High script firmware.
Further, the present invention also provides a kind of microcontroller device for upgrading firmware, the microcontroller device for upgrading firmware bag Include memory, processor and the microcontroller firmware upgrade journey that is stored on the memory and can run on the processor Sequence, the microcontroller firmware upgrade procedure are performed realized method when being performed by the processor and can refer to the present invention Each embodiment of microcontroller firmware upgrade method, details are not described herein again.
Further, in addition, the embodiment of the present invention also proposes a kind of computer-readable recording medium.
Microcontroller firmware upgrade procedure, the microcontroller firmware upgrade are stored with computer-readable recording medium of the present invention The step of program realizes identity identifying method as described above when performing.
Wherein, the microcontroller firmware upgrade procedure run on the processor is performed realized method and can refer to The each embodiment of microcontroller firmware upgrade method of the present invention, details are not described herein again.
It should be noted that herein, term " comprising ", "comprising" or its any other variant are intended to non-row His property includes, so that process, method, article or system including a series of elements not only include those key elements, and And other elements that are not explicitly listed are further included, or further include as this process, method, article or system institute inherently Key element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that including this Also there are other identical element in the process of key element, method, article or system.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on such understanding, technical scheme substantially in other words does the prior art Going out the part of contribution can be embodied in the form of software product, which is stored in one as described above In storage medium (such as ROM/RAM, magnetic disc, CD), including some instructions use so that a station terminal equipment (can be mobile phone, Computer, server, air conditioner, or network equipment etc.) perform method described in each embodiment of the present invention.
It these are only the preferred embodiment of the present invention, be not intended to limit the scope of the invention, it is every to utilize this hair The equivalent structure or equivalent flow shift that bright specification and accompanying drawing content are made, is directly or indirectly used in other relevant skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of microcontroller firmware upgrade method, it is characterised in that the microcontroller firmware upgrade method includes:
Obtain the first version information of high in the clouds script firmware and the second edition information of current Run Script firmware;
The first version information and second edition information are contrasted, judges whether the version of high in the clouds script firmware is higher than and works as The version of preceding Run Script firmware;
When the version of high in the clouds script firmware is higher than the version of current Run Script firmware, the corresponding script firmware in high in the clouds is downloaded Script file is to default script subregion.
2. microcontroller firmware upgrade method as claimed in claim 1, it is characterised in that it is described by the first version information and Second edition information is contrasted, and judges whether the version of high in the clouds script firmware is higher than the step of the version of current Run Script firmware Further included after rapid:
When the version of high in the clouds script firmware is not higher than the version of current Run Script firmware, believe from the last item first version Breath contrast proceeds by timing when completing;
Judge whether timing time value is equal to preset time value;
When timing time value is when the preset time value, step is performed:Obtain high in the clouds script firmware first version information and The second edition information of current Run Script firmware.
3. microcontroller firmware upgrade method as claimed in claim 1, it is characterised in that the default script subregion is at least two It is a, it is described obtain high in the clouds script firmware first version information and current Run Script firmware the second edition information the step of it Before include:
Obtain the version information of the script firmware of each default script subregion;
The version information of acquisition is contrasted, determines the highest script firmware of version;
The corresponding script file of the highest script firmware of version is imported into script engine, so that the script engine is to the foot This document carries out parsing execution.
4. microcontroller firmware upgrade method as claimed in claim 3, it is characterised in that the corresponding script in high in the clouds of downloading is consolidated Further included before the step of script file of part to default script subregion:
When the version of high in the clouds script firmware is higher than the version of current Run Script firmware, the foot of current Run Script firmware is determined The first default script subregion where this document;
Script file to the default script subregion for downloading the corresponding script firmware in high in the clouds includes:
The script file of the corresponding script firmware in download high in the clouds is into the default script subregion except the first default script subregion Outside the second default script subregion.
5. the microcontroller firmware upgrade method as described in claim 3 or 4, it is characterised in that described to obtain each default script Include before the step of version information of the script firmware of subregion:
The related software and hardware resources of initialization, and registration Script and preset programming language interface layer.
6. microcontroller firmware upgrade method as claimed in claim 5, it is characterised in that the correlation software and hardware resources at least wrap Include embedded OS, hardware driving layer, firmware version maintenance support module and script engine.
7. microcontroller firmware upgrade method as claimed in claim 5, the script text for downloading the corresponding script firmware in high in the clouds Include after the step of part to default script subregion:
Restarting firmware instructions are received, and step is performed according to the restarting firmware instructions:The related software and hardware of initialization Resource, and registration Script and preset programming language interface layer.
8. microcontroller firmware upgrade method as claimed in claim 1, it is characterised in that the corresponding script in high in the clouds of downloading is consolidated Further included after the step of script file of part to default script subregion:
New version information is set according to the script file of download.
9. a kind of microcontroller device for upgrading firmware, it is characterised in that the microcontroller device for upgrading firmware includes:Memory, place Manage device and be stored in the microcontroller firmware upgrade procedure that can be run on the memory and on the processor, the microcontroller The microcontroller firmware liter as described in any one of claim 1 to 8 is realized when firmware upgrade procedure is performed by the processor The step of level method.
10. a kind of computer-readable recording medium, it is characterised in that be stored with microcontroller on the computer-readable recording medium Firmware upgrade procedure, is realized such as any one of claim 1 to 8 institute when the microcontroller firmware upgrade procedure is executed by processor The step of microcontroller firmware upgrade method stated.
CN201711499175.1A 2017-12-28 2017-12-28 Microcontroller firmware upgrade method, device and computer-readable recording medium Pending CN107908416A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711499175.1A CN107908416A (en) 2017-12-28 2017-12-28 Microcontroller firmware upgrade method, device and computer-readable recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711499175.1A CN107908416A (en) 2017-12-28 2017-12-28 Microcontroller firmware upgrade method, device and computer-readable recording medium

Publications (1)

Publication Number Publication Date
CN107908416A true CN107908416A (en) 2018-04-13

Family

ID=61871025

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711499175.1A Pending CN107908416A (en) 2017-12-28 2017-12-28 Microcontroller firmware upgrade method, device and computer-readable recording medium

Country Status (1)

Country Link
CN (1) CN107908416A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109508535A (en) * 2018-10-30 2019-03-22 百富计算机技术(深圳)有限公司 Firmware safety certifying method, device and payment terminal
CN109656591A (en) * 2018-12-06 2019-04-19 上海荣泰健康科技股份有限公司 Program down-loading method, electronic equipment and cloud server
CN110858147A (en) * 2018-08-24 2020-03-03 深圳市优必选科技有限公司 MCU information acquisition method and terminal equipment
CN111552491A (en) * 2020-04-22 2020-08-18 北京小马智行科技有限公司 Method, device and storage medium for upgrading firmware of transfer equipment of mobile carrier
CN112214235A (en) * 2020-10-23 2021-01-12 Oppo广东移动通信有限公司 Method and device for upgrading quick-charging firmware, mobile terminal and storage medium
CN114780114A (en) * 2022-04-11 2022-07-22 广州小鹏汽车科技有限公司 Firmware upgrading method, system, vehicle and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102520975A (en) * 2011-11-16 2012-06-27 深圳创维-Rgb电子有限公司 Intelligent updating method of external equipment driver, device and system
US20140123124A1 (en) * 2012-10-31 2014-05-01 Aruba Networks, Inc. Cloud-based firmware distribution service
CN105335195A (en) * 2015-11-02 2016-02-17 北京金山安全软件有限公司 Device driver upgrading method and device and electronic device
CN105446769A (en) * 2015-11-03 2016-03-30 广东欧珀移动通信有限公司 Mirror image file update processing method and apparatus and terminal device
CN105516300A (en) * 2015-12-04 2016-04-20 上海斐讯数据通信技术有限公司 Equipment version upgrading method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102520975A (en) * 2011-11-16 2012-06-27 深圳创维-Rgb电子有限公司 Intelligent updating method of external equipment driver, device and system
US20140123124A1 (en) * 2012-10-31 2014-05-01 Aruba Networks, Inc. Cloud-based firmware distribution service
CN105335195A (en) * 2015-11-02 2016-02-17 北京金山安全软件有限公司 Device driver upgrading method and device and electronic device
CN105446769A (en) * 2015-11-03 2016-03-30 广东欧珀移动通信有限公司 Mirror image file update processing method and apparatus and terminal device
CN105516300A (en) * 2015-12-04 2016-04-20 上海斐讯数据通信技术有限公司 Equipment version upgrading method and system

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110858147A (en) * 2018-08-24 2020-03-03 深圳市优必选科技有限公司 MCU information acquisition method and terminal equipment
CN110858147B (en) * 2018-08-24 2023-12-29 深圳市优必选科技有限公司 MCU information acquisition method and terminal equipment
CN109508535A (en) * 2018-10-30 2019-03-22 百富计算机技术(深圳)有限公司 Firmware safety certifying method, device and payment terminal
CN109656591A (en) * 2018-12-06 2019-04-19 上海荣泰健康科技股份有限公司 Program down-loading method, electronic equipment and cloud server
CN111552491A (en) * 2020-04-22 2020-08-18 北京小马智行科技有限公司 Method, device and storage medium for upgrading firmware of transfer equipment of mobile carrier
CN112214235A (en) * 2020-10-23 2021-01-12 Oppo广东移动通信有限公司 Method and device for upgrading quick-charging firmware, mobile terminal and storage medium
CN114780114A (en) * 2022-04-11 2022-07-22 广州小鹏汽车科技有限公司 Firmware upgrading method, system, vehicle and storage medium

Similar Documents

Publication Publication Date Title
CN107908416A (en) Microcontroller firmware upgrade method, device and computer-readable recording medium
CN107741844B (en) Method and device for generating application installation package
CN109753297A (en) Method for upgrading software, device and readable storage medium storing program for executing when terminal standby
CN107608785A (en) Process management method, mobile terminal and readable storage medium
CN104267981B (en) A kind of method and device of application layout on loading desktop
CN107704356A (en) Exception stack information acquisition method, device and computer-readable recording medium
CN106469071B (en) Application theme changing method and device
CN108833966A (en) Start-up picture control method, smart machine and computer readable storage medium
CN107436786A (en) Using starting guide method, apparatus and computer-readable recording medium
WO2018040914A1 (en) Container generation method, device, terminal, server and system
CN102193806B (en) Upgrade the method and apparatus of animation
CN107977129A (en) Icon display method, device and computer-readable recording medium
CN110035181A (en) It is a kind of to apply card theme setting method and terminal fastly
CN113168332A (en) Data processing method and device and mobile terminal
EP4246312A1 (en) Content display method and terminal device
WO2022052766A1 (en) Theme packet adaptation method and apparatus
CN110502263A (en) Upgrade package production method, system and computer readable storage medium
CN108268261B (en) UI (user interface) customization method of intelligent terminal, storage medium and intelligent terminal
CN114443189A (en) Image processing method and electronic equipment
US20220292141A1 (en) Quick Application Startup Method and Related Apparatus
CN113031996A (en) OTA (over the air) upgrading method and device of electronic equipment, control terminal and medium
CN108717357A (en) Page presentation code conversion method, device, equipment and computer storage media
CN110032390B (en) Method for realizing multi-model co-upgrade package, storage medium and intelligent terminal
CN107621939B (en) Application optimization method and device
CN114092590B (en) Electronic device and evaluation method and medium for image rendering performance of electronic device

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20201228

Address after: 9 / F, building D4, international e city, 1001 Zhongshan Garden Road, Xili street, Nanshan District, Shenzhen City, Guangdong Province

Applicant after: SHENZHEN TCL NEW TECHNOLOGY Co.,Ltd.

Address before: 516001, 6th Floor, TCL Building, No. 6, Eling South Road, Huizhou City, Guangdong Province

Applicant before: HUIZHOU TCL HOME APPLIANCE GROUP Co.,Ltd.

WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20180413