A kind of method for upgrading software and embedded system of embedded system
Technical field
The present invention relates to the method for upgrading software and embedded system of electronic technology field more particularly to a kind of embedded system
System.
Background technique
The embedded systems such as single-chip microcontroller are typically used on middle-size and small-size product, inside be generally integrated non-volatile memories
Device (such as flash memory Flash) and memory (such as random access memory ram).Due to cost considerations, non-easy in embedded system
The storage resource of the property lost memory and memory is very limited.
In embedded system, application layer program is commonly stored in the nonvolatile memory, is adopted with nonvolatile memory
For Flash, upgraded to the application layer program of embedded system usually has following several ways in the prior art:
Mode 1:Active and standby two pieces of Flash are equipped with for embedded system, first upgrade the application layer program in standby Flash, then
Switch active and standby Flash, original standby Flash is switched as main Flash, original main Flash is switched to standby Flash;
Mode 2:The application layer program stored in Flash is first loaded into memory operation, then directly downloads new version
Application layer program is written in Flash;
Mode 3:First downloading new version application layer program is run into memory, then replicates the new version application layer in memory
Program is into Flash.
However, by actual use discovery, above-mentioned mode 1 increases embedded system due to needing optional equipment Flash
The cost of system in above-mentioned mode 2,3, due to needing to load application layer program with memory, thus needs larger using amount of storage
Memory, higher cost, also, in above-mentioned mode 2,3, if powering off in escalation process, the data in memory can lose
It loses, causes software that can not start or upgrade file failed download.
As it can be seen that the mode that existing embedded system carries out software upgrading causes to rise there are at high cost, easy because of power-off
The technical issues of grade failure.
Summary of the invention
The embodiment of the present invention mentions a kind of method for upgrading software of embedded system and embedded system supplies, existing to solve
Embedded system carry out software upgrading mode there is technical issues that it is at high cost, be easy because power-off cause upgrading.
In a first aspect, providing a kind of method for upgrading software of embedded system, the embedded system includes non-volatile
Memory, the non-volatile memory configuration have boot section, Operational Zone and download area, and the boot section is held for storing upgrading
Line program, the Operational Zone is for storing application layer program, and the download area is for storing upgrading compressed package, the method packet
It includes:
Determining that the upgrading by running the boot section storage executes process control when needing to be implemented updating operation
Execute the updating operation, wherein described to execute the updating operation and include:Upgrading compression to download area storage
Packet is unziped it to obtain new version application layer program, and is covered the Operational Zone using the new version application layer program and deposited
The application layer program of storage.
In one possible implementation, the embedded system further includes memory, the memory configurations have for
The global buffer that global buffering is realized in the embedded system carries out the upgrading compressed package of download area storage
Decompression covers answering for the Operational Zone storage using the new version application layer program to obtain new version application layer program
With layer program, including:
With preset decompression data volume, the upgrading compressed package of download area storage is unziped it by several times, wherein
The data that each decompression obtains are stored in the global buffer in turn;
After the completion of each decompression, the data cover formula that the global buffer stores is stored to the Operational Zone,
To form the new version application layer program in the Operational Zone.
In one possible implementation, the nonvolatile memory is also configured with upgrade information area, the upgrading
The information area is used to store the check information of the upgrading compressed package, and the check information of the upgrade information area storage is described in downloading
It is determined when upgrading compressed package to the download area by the embedded system, the execution updating operation further includes:
The upgrading compressed package that the download area stores is unziped it with obtain new version application layer program it
Before, determine whether the check information recorded in the upgrading compressed package is consistent with the check information of upgrade information area storage;
If it is not, then stopping executing the updating operation.
In one possible implementation, the upgrade information area is also used to store upgrading instruction information, the upgrading
Instruction information is used to indicate whether to need to be implemented the updating operation, in the liter by running the boot section storage
Before grade executes the program execution updating operation, the method also includes:
Upgrade request is received, and the upgrading compressed package is downloaded to the download area according to the upgrade request;
After the upgrading compressed package is completed in downloading, adjusting the upgrading instruction information is that instruction needs to be implemented the upgrading
Operation, to indicate that information determination needs to be implemented the updating operation according to the upgrading in embedded system starting.
Second aspect, provides a kind of embedded system, and the embedded system includes nonvolatile memory and processor,
The non-volatile memory configuration has boot section, Operational Zone and download area, and the boot section executes program for storing upgrading,
The Operational Zone is for storing application layer program, and the download area is for storing upgrading compressed package;
Wherein, the processor is when determination needs to be implemented updating operation, by running described in the boot section storage
Upgrading executes process control and executes the updating operation, and the processor executes the updating operation and includes:To the download area
The upgrading compressed package of storage is unziped it to obtain new version application layer program, and uses the new version application layer journey
Sequence covers the application layer program of the Operational Zone storage.
In one possible implementation, the embedded system further includes memory, the memory configurations have for
The global buffer of global buffering is realized in the embedded system, the processor passes through the institute for running the boot section storage
It states upgrading and executes the process control execution updating operation, including:
With preset decompression data volume, the upgrading compressed package of download area storage is unziped it by several times, wherein
The data that each decompression obtains are stored in the global buffer in turn;
After the completion of each decompression, the data cover formula that the global buffer stores is stored to the Operational Zone,
To form the new version application layer program in the Operational Zone.
In one possible implementation, the nonvolatile memory is also configured with upgrade information area, the upgrading
The information area is used to store the check information of the upgrading compressed package, and the check information of the upgrade information area storage is described in downloading
It is determined when upgrading compressed package to the download area by the embedded system, the processor is deposited by running the boot section
The upgrading of storage executes process control and executes the updating operation, further includes:
The upgrading compressed package that the download area stores is unziped it with obtain new version application layer program it
Before, determine whether the check information recorded in the upgrading compressed package is consistent with the check information of upgrade information area storage;
If it is not, then stopping executing the updating operation.
In one possible implementation, the upgrade information area is also used to store upgrading instruction information, the upgrading
Indicate that information is used to indicate whether to need to be implemented the updating operation, the processor is also used to by running the boot section
Before the upgrading of storage executes the process control execution updating operation, answered described in the Operational Zone storage by running
It is executed with layer process control:
Upgrade request is received, and the upgrading compressed package is downloaded to the download area according to the upgrade request;
After the upgrading compressed package is completed in downloading, adjusting the upgrading instruction information is that instruction needs to be implemented the upgrading
Operation indicates that information determines according to the upgrading when executing program designation starting with the upgrading described in the operation for embedded system
Need to be implemented the updating operation.
The third aspect provides a kind of embedded system, and the embedded system includes nonvolatile memory, described non-easy
The property lost memory is configured with boot section, Operational Zone and download area, wherein the boot section is configured with upgrade execution module, described
Operational Zone is configured with application layer module, and the download area is used for for storing upgrading compressed package, the upgrade execution module:
When determination needs to be implemented updating operation, the updating operation is executed, wherein executing the updating operation includes:
The upgrading compressed package of download area storage is unziped it to obtain new version application layer module, and using described new
Version application layer module updates the application layer module of the Operational Zone configuration.
In one possible implementation, the embedded system further includes memory, the memory configurations have for
The global buffer of global buffering is realized in the embedded system, the upgrade execution module is specifically used for:
With preset decompression data volume, the upgrading compressed package of download area storage is unziped it by several times, wherein
The data that each decompression obtains are stored in the global buffer in turn;
After the completion of each decompression, the data cover formula that the global buffer stores is stored to the Operational Zone,
To form the new version application layer module in the Operational Zone.
In one possible implementation, the nonvolatile memory is also configured with upgrade information area, the upgrading
The information area is used to store the check information of the upgrading compressed package, and the check information of the upgrade information area storage is described in downloading
It is determined when upgrading compressed package to the download area by the embedded system, the upgrade execution module is also used to:
The upgrading compressed package that the download area stores is unziped it with obtain new version application layer module it
Before, determine whether the check information recorded in the upgrading compressed package is consistent with the check information of upgrade information area storage;
If it is not, then stopping executing the updating operation.
In one possible implementation, the upgrade information area is also used to store upgrading instruction information, the upgrading
Indicate that information is used to indicate whether to need to be implemented the updating operation, the application layer module of the Operational Zone configuration is used for:
Before the upgrade execution module executes the updating operation, upgrade request is received, and ask according to the upgrading
Ask the downloading upgrading compressed package to the download area;
After the upgrading compressed package is completed in downloading, adjusting the upgrading instruction information is that instruction needs to be implemented the upgrading
Operation, to indicate that information determination needs to be implemented the updating operation according to the upgrading in embedded system starting.
Fourth aspect provides a kind of nonvolatile memory, wherein:
The non-volatile memory configuration has boot section, Operational Zone and download area, and the boot section is for storing upgrading
Execution program, the Operational Zone is for storing application layer program, and the download area is for storing upgrading compressed package, when described non-easy
The program of the property lost memory storage in embedded system when running, so that embedded system executes side described in first aspect
Method.
In the embodiment of the present invention, the non-volatile memory configuration of embedded system has boot section, Operational Zone and download area,
Boot section executes program for storing to upgrade, and Operational Zone upgrades compressed package for storing for storing application layer program, download area,
Determining that the upgrading execution process control stored by operation boot section executes updating operation, i.e., when needing to be implemented updating operation
It is executed by the process control of operation boot section storage:The upgrading compressed package of download area storage is unziped it to obtain new edition
This application layer program, and use the application layer program of new version application layer program covering Operational Zone storage.
Due to having carried out partition to nonvolatile memory, the data of the memory block not upgraded in escalation process will not be by
It to influence, still is able to operate normally, for example, the operation that the upgrading of boot section executes program is unaffected.In this way, being just not required to
Upgrading is executed program in upgrading to be loaded into memory, reduce the demand to memory storage amount in embedded system, save
About cost.
Further, due to upgrading compressed package and the original application layer program in Operational Zone be all stored in always it is non-volatile
In memory, thus even if powering off, the loss of vital data in embedded system will not be led to, after a loss of power, only
Upgrading can be smoothly completed by needing to restart execution updating operation.Also, due to not needing to add entire application layer program
It is downloaded in memory or additional nonvolatile memory, reduces the demand in escalation process to amount of storage in embedded system,
Cost is saved.
Further, the upgrading compressed package of downloading is smaller compared to unpressed new version application layer program occupied space,
Reduce the demand in escalation process to amount of storage in embedded system, saves cost.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Inventive embodiments for those of ordinary skill in the art without creative efforts, can also be according to mentioning
The attached drawing of confession obtains other attached drawings.
Fig. 1 is a kind of flow diagram of the method for upgrading software of embedded system in the embodiment of the present invention.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is
A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art
Every other embodiment obtained without creative efforts, shall fall within the protection scope of the present invention.
In addition, the terms "and/or", only a kind of incidence relation for describing affiliated partner, indicates may exist
Three kinds of relationships, for example, A and/or B, can indicate:Individualism A exists simultaneously A and B, these three situations of individualism B.Separately
Outside, character "/" herein typicallys represent the relationship that forward-backward correlation object is a kind of "or" in the case where not illustrating.
In addition, it is necessary to understand, in the description of the embodiment of the present invention, the vocabulary such as " first ", " second " are only used for distinguishing description
Purpose is not understood to indicate or imply relative importance, can not be interpreted as indication or suggestion sequence.
Embodiment one
The embodiment of the present invention provides a kind of method for upgrading software of embedded system.Wherein, embedded system for example can be with
Refer to single-chip microcontroller, may also mean that other types of embedded system in the prior art.
In the embodiment of the present invention, embedded system, which includes at least, nonvolatile memory, which can
To integrate in embedded systems.Specifically, which can be flash memory (Flash), may be programmed read-only deposit
Reservoir (Programmable read-only memory, PROM), electrically-alterable ROM (EAROM) (Electrically
Alterable read only memory, EAROM), erasable programmable read-only memory (Erasable programmable
Read only memory, EPROM), Electrically Erasable Programmable Read-Only Memory (Electrically erasable
Programmable read only memory, EEPROM) etc..
In the embodiment of the present invention, the non-volatile memory configuration in embedded system has multiple memory blocks, such as can
To be configured with boot section, Operational Zone and download area.In a kind of possible embodiment, which can also match
It is equipped with upgrade information area.In the specific implementation process, can by each memory block store different data make it is embedded
System is based on each memory block and realizes specific function.
For example:
1, boot section for store upgrading execute program, the upgrading execute program can guide embedded system start and
Indicate that embedded system executes updating operation, all codes that the upgrading of boot section storage executes program only call guidance section
Interior code can not call the code in other sections, run the program stored in boot section when embedded system starts first;
2, for storing application layer program, application layer program can indicate Implementation of Embedded System business function for Operational Zone;
After the program of storage executes in boot section, the program for running Operational Zone storage is jumped;
3, download area for storing upgrading compressed package, the upgrading compressed package is obtained to after the compression of new version application layer program
, compared to unpressed new version application layer program, it is smaller to upgrade compressed package the space occupied;In a kind of possible embodiment party
In formula, upgrade in compressed package other than including new version application layer program, head can also record the upgrading compressed package
Data volume size and check value;
4, upgrade information area is for storing instruction information relevant to upgrading and/or check information.
By embedded system include memory space for the Flash of 256KB for, the inner space of the Flash can use
Division mode as shown in Table 1:
Table 1
Memory block title |
Memory block explanation |
Memory block size |
Boot section |
Storage upgrading executes program |
8KB |
Operational Zone |
Store application layer program |
160KB |
Download area |
Storage upgrading compressed package |
80K |
Upgrade information area |
Store instruction information relevant to upgrading and/or check information |
2KB |
In table 1, the size that the upgrading of boot section storage executes program is typically not greater than 8KB, and upgrade information area usually accounts for
With minimum erasing space (such as 2KB) of Flash.Also, the inner space of the Flash is in addition to being allocated to shown in table 1
Each memory block outside, there may also be remaining spaces.
In the embodiment of the present invention, when in operating status after embedded system unlatching, i.e. operation for embedded system application
When layer program, embedded system can receive the upgrade request for being used to indicate and being upgraded, which for example can be
The host remote of management embedded system is sent to embedded system.
After receiving upgrade request, embedded system can download upgrading compressed package to non-volatile according to upgrade request
Download area in memory.
During downloading upgrades compressed package, embedded system can determine the verification of downloaded upgrading compressed package
Information, these check informations are stored in the upgrade information area of nonvolatile memory.Wherein, check information may include upgrading
The data volume size of compressed package and/or the check value (such as cryptographic Hash) for upgrading compressed package.For example, embedded system upgrades in downloading
It will record the data volume size of upgrading compressed package after compressed package, and calculating the check value of upgrading compressed package and recording this
Check value.
After upgrading compressed package is completed in downloading, the upgrading of the adjustable upgrade information area storage of embedded system indicates information
Updating operation is needed to be implemented for instruction, in turn, embedded system is allowed to determine needs according to upgrading instruction information when starting
Execute updating operation.
In a kind of possible embodiment, embedded system is that instruction needs to be implemented updating operation in adjustment instruction information
Before, first the upgrading compressed package of downloading can also be verified, determine in upgrading compressed package the check information that records whether with
The check information of upgrade information area storage is consistent, no if consistent just adjustment instruction information is that instruction needs to be implemented updating operation
It does not adjust then.
It is after instruction needs to be implemented updating operation in adjustment instruction information, embedded system can be in the embodiment of the present invention
It is resetted, or is resetted after preset time immediately, or resetted in the time that upgrade request is specified, or according to independent
The reset instruction received is resetted.
And when being started after embedded system reset, the upgrading of operation boot section first executes program.
Operation upgrading executes in program process, and embedded system first can indicate letter according to the upgrading of upgrade information area storage
Breath determines the need for executing updating operation, if upgrading instruction information instruction needs to be implemented updating operation, embedded system
Updating operation is executed, otherwise embedded system upgrading out of service executes program, then operation is stored in the application layer of Operational Zone
Program.
Determining that embedded system executes program control by the upgrading of operation boot section storage when needing to be implemented updating operation
System executes updating operation, specifically, executes updating operation and includes at least:
The upgrading compressed package of download area storage is unziped it to obtain new version application layer program, and uses new version
Application layer program covers the application layer program of Operational Zone storage.That is, covering Operational Zone using new version application layer program
Originally the application layer program of storage, realizes the software upgrading of embedded system.
In a kind of possible embodiment, during embedded system executes updating operation, stored to download area
Upgrading compressed package unzip it to obtain new version application layer program before, can also include to upgrading compressed package test
The operation of card, i.e. embedded system can determine what whether the check information recorded in upgrading compressed package stored with upgrade information area
Check information is consistent, if unanimously just unziping it operation, otherwise embedded system stops executing updating operation, then runs
It is stored in the application layer program of Operational Zone.
In the embodiment of the present invention, embedded system further includes memory, which has for real in embedded system
The global buffer of existing global buffering, that is, the global buffer is the buffer area of a multiplexing, is run each in embedded system
The global buffer can be used when program, for example, in addition to the global buffer can be used when operation upgrades and executes program
Outside, it can also use the global buffer when running application layer program.By configuring global buffer, memory source is realized
Efficient utilization.
In a kind of possible embodiment, the upgrading compressed package of download area storage is decompressed when executing updating operation
Contracting is to obtain new version application layer program, and the tool of the application layer program using new version application layer program covering Operational Zone storage
Body embodiment can be:
With preset decompression data volume, the upgrading compressed package of download area storage is unziped it by several times, wherein each time
The data that decompression obtains are stored in the global buffer in turn, also, after the completion of each decompression, by global buffer
The data cover formula of storage is stored to Operational Zone, to form new version application layer program in Operational Zone.
For example, during gradation decompresses upgrading compressed package, the data of 1KB are only decompressed every time, by more
The decompression to entire upgrading compressed package is completed in secondary decompression.It is the compression of 3KB with compressed new version application layer program
Data instance, embedded system decompress the first KB data in 3KB first, decompress first part of ephemeral data storage of acquisition
In global buffer, then first part of ephemeral data cover type is stored into Operational Zone, then, embedded system erasing is complete
First part of ephemeral data in office buffer area, and start to decompress the 2nd KB data in 3KB, second part for decompressing acquisition faces
When data be stored in global buffer, then second part of ephemeral data cover type is stored into Operational Zone, it is then, embedded
System wipes second part of ephemeral data in global buffer, and starts to decompress the 3rd KB data in 3KB, and decompression obtains
Third part ephemeral data be stored in global buffer, then third part ephemeral data cover type is stored into Operational Zone,
This three parts of ephemeral datas form new version application layer program in Operational Zone.
Referring to Figure 1, Fig. 1 show the method for upgrading software of embedded system in the embodiment of the present invention one kind it is possible
The flow diagram of embodiment.It should be noted that the flow chart is only used for understanding the method for the embodiment of the present invention, and not
For limiting the method in the embodiment of the present invention.In the specific implementation process, each step shown in FIG. 1 can be according to practical need
It is deleted, or increases new step.
Step 101, step 102, step 103, step 104 and step in a kind of possible embodiment, in Fig. 1
110 can be by embedded system by operation be stored in Operational Zone process control execute, step 105, step 106, step
Rapid 107, step 108, step 109, which can be, passes through what the process control that operation boot section stores executed by embedded system.
Embodiment two
Based on the same inventive concept, the embodiment of the present invention provides a kind of embedded system, which includes non-easy
The property lost memory and processor, the non-volatile memory configuration have boot section, Operational Zone and download area, and the boot section is for depositing
Storage upgrading executes program, and the Operational Zone is for storing application layer program, and the download area is for storing upgrading compressed package.
Wherein, which is determining that the upgrading by running boot section storage is held when needing to be implemented updating operation
Line program control executes the updating operation, which executes the updating operation and include:To the upgrading pressure of download area storage
Contracting packet is unziped it to obtain new version application layer program, and is covered the Operational Zone using the new version application layer program and stored
Application layer program.
In a kind of possible embodiment, which further includes memory, which has for embedding at this
The global buffer of global buffering is realized in embedded system, which executes journey by running the upgrading of boot section storage
Sequence control executes the updating operation, including:
With preset decompression data volume, the upgrading compressed package of download area storage is unziped it by several times, wherein each
The data that secondary decompression obtains are stored in the global buffer in turn;
After the completion of each decompression, the data cover formula which stores is stored to the Operational Zone, with
The new version application layer program is formed in the Operational Zone.
In a kind of possible embodiment, which is also configured with upgrade information area, the upgrade information
Area is used to store the check information of the upgrading compressed package, and the check information of upgrade information area storage is to download the upgrading compressed package
It is determined when to the download area by the embedded system, which executes program by running the upgrading of boot section storage
Control executes the updating operation, further includes:
Before the upgrading compressed package stored to the download area is unziped it to obtain new version application layer program, really
Whether the check information recorded in the fixed upgrading compressed package is consistent with the check information of upgrade information area storage;If it is not, then stopping
Only execute the updating operation.
In a kind of possible embodiment, which is also used to store upgrading instruction information, upgrading instruction
Information is used to indicate whether to need to be implemented the updating operation, which is also used in the liter by running boot section storage
Before grade execution process control executes the updating operation, the application layer program control by running Operational Zone storage is executed:
Upgrade request is received, and the upgrading compressed package is downloaded to the download area according to the upgrade request;Completing in downloading should
After upgrading compressed package, upgrading instruction information is adjusted as instruction and needs to be implemented the updating operation, in the operation for embedded system
Indicate that information determination needs to be implemented the updating operation according to the upgrading when upgrading executes program designation starting.
In a kind of possible embodiment, receives upgrade request, downloading upgrading compressed package, determines check information and adjustment
These operations of upgrading instruction information can be embedded system and pass through the application of Operational Zone storage in operation nonvolatile memory
Layer process control executes.
Embodiment three
Based on the same inventive concept, the embodiment of the present invention provides a kind of embedded system, which includes non-easy
The property lost memory, the non-volatile memory configuration have boot section, Operational Zone and download area, wherein the boot section is configured with liter
Grade execution module, the Operational Zone are configured with application layer module, and the download area is for storing upgrading compressed package.
The upgrade execution module of boot section configuration is used for:When determination needs to be implemented updating operation, upgrading behaviour is executed
Make, wherein executing the updating operation includes:The upgrading compressed package of download area storage is unziped it to obtain new version
Application layer module, and the application layer module that the Operational Zone configures is updated using the new version application layer module.
In a kind of possible embodiment, which further includes memory, which has for embedding at this
The global buffer of global buffering is realized in embedded system, which is specifically used for:
With preset decompression data volume, the upgrading compressed package of download area storage is unziped it by several times, wherein each
The data that secondary decompression obtains are stored in the global buffer in turn;Also, after the completion of each decompression, which is buffered
The data cover formula of area's storage is stored to the Operational Zone, to form the new version application layer module in the Operational Zone.
In a kind of possible embodiment, which is also configured with upgrade information area, the upgrade information
Area is used to store the check information of the upgrading compressed package, and the check information of upgrade information area storage is to download the upgrading compressed package
It is determined when to the download area by the embedded system, which is also used to:
Before the upgrading compressed package stored to the download area is unziped it to obtain new version application layer module, really
Whether the check information recorded in the fixed upgrading compressed package is consistent with the check information of upgrade information area storage;If it is not, then stopping
Only execute the updating operation.
In a kind of possible embodiment, which is also used to store upgrading instruction information, upgrading instruction
Information is used to indicate whether to need to be implemented the updating operation, and the application layer module of Operational Zone configuration is used for:
Before the upgrade execution module executes the updating operation, upgrade request is received, and download according to the upgrade request
The upgrading compressed package is to the download area;After the upgrading compressed package is completed in downloading, upgrading instruction information is adjusted as instruction needs
The updating operation is executed, needs to be implemented upgrading behaviour to indicate that information determines according to the upgrading in embedded system starting
Make.
Example IV
Based on the same inventive concept, the embodiment of the present invention provides a kind of nonvolatile memory, wherein this is non-volatile to deposit
Reservoir is configured with boot section, Operational Zone and download area, which executes program for storing upgrading, and the Operational Zone is for storing
Application layer program, the download area is for storing upgrading compressed package, when the program of nonvolatile memory storage is in embedded system
When being run on system, so that embedded system executes the method for upgrading software of embedded system described in embodiment one kind.
In the specific implementation process, the nonvolatile memory can be Flash, PROM, EAROM, EPROM,
EEPROM etc., also, the nonvolatile memory can integrate in embedded systems.
In the embodiment of the present invention, the non-volatile memory configuration of embedded system has boot section, Operational Zone and download area,
Boot section executes program for storing to upgrade, and Operational Zone upgrades compressed package for storing for storing application layer program, download area,
Determining that the upgrading execution process control stored by operation boot section executes updating operation, i.e., when needing to be implemented updating operation
It is executed by the process control of operation boot section storage:The upgrading compressed package of download area storage is unziped it to obtain new edition
This application layer program, and use the application layer program of new version application layer program covering Operational Zone storage.
Due to having carried out partition to nonvolatile memory, the data of the memory block not upgraded in escalation process will not be by
It to influence, still is able to operate normally, for example, the operation that the upgrading of boot section executes program is unaffected.In this way, being just not required to
Upgrading is executed program in upgrading to be loaded into memory, reduce the demand to memory storage amount in embedded system, save
About cost.
Further, due to upgrading compressed package and the original application layer program in Operational Zone be all stored in always it is non-volatile
In memory, thus even if powering off, the loss of vital data in embedded system will not be led to, after a loss of power, only
Upgrading can be smoothly completed by needing to restart execution updating operation.Also, due to not needing to add entire application layer program
It is downloaded in memory or additional nonvolatile memory, reduces the demand in escalation process to amount of storage in embedded system,
Cost is saved.
Further, the upgrading compressed package of downloading is smaller compared to unpressed new version application layer program occupied space,
Reduce the demand in escalation process to amount of storage in embedded system, saves cost.
Further, upgrading compressed package is decompressed by several times with preset decompression data volume in the embodiment of the present invention
Contracting, the global buffer that the ephemeral data that each decompression obtains is stored in memory in turn.Due to decompressing acquisition every time
Ephemeral data it is smaller, thus when original memory just can satisfy upgrading in embedded system, stores the demand of temporary file,
It does not need additionally to expand memory.
Also, in the embodiment of the present invention, configuration global buffer executes journey for storing ephemeral data, in addition to operation upgrades
It can be used when sequence outside the global buffer, can also use the global buffer when running other programs.By configuring energy
The global buffer being enough multiplexed realizes the efficient utilization of memory source, reduces the demand to amount of storage in embedded system,
Cost is saved.
It further, further include verifying upgrading compressed package before decompression upgrades compressed package in the embodiment of the present invention
Operation, by the verifying to upgrading compressed package, the upgrading compressed package that can be avoided service failure, which carries out upgrading, leads to embedded system
The risk of operation troubles occurs for system.
The apparatus embodiments described above are merely exemplary, wherein units/modules as illustrated by the separation member
It may or may not be physically separated, the component shown as units/modules may or may not be
Physical unit/module, it can it is in one place, or may be distributed in multiple network unit/modules.It can basis
It is actual to need that some or all of the modules therein is selected to achieve the purpose of the solution of this embodiment.Ordinary skill people
Member is without paying creative labor, it can understands and implements.
Through the above description of the embodiments, those skilled in the art can be understood that each embodiment can
It realizes by means of software and necessary general hardware platform, naturally it is also possible to pass through hardware.Based on this understanding, on
Stating technical solution, substantially the part that contributes to existing technology can be embodied in the form of software products in other words, should
Computer software product may be stored in a computer readable storage medium, such as ROM/RAM, magnetic disk, CD, including several fingers
It enables and using so that a computer equipment (can be personal computer, server or the network equipment etc.) executes each implementation
Method described in certain parts of example or embodiment.
Finally it should be noted that:The above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although
Present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that:It still may be used
To modify the technical solutions described in the foregoing embodiments or equivalent replacement of some of the technical features;
And these are modified or replaceed, technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution spirit and
Range.