CN1297891C - Staggered form firmware upgrading method - Google Patents

Staggered form firmware upgrading method Download PDF

Info

Publication number
CN1297891C
CN1297891C CNB031494528A CN03149452A CN1297891C CN 1297891 C CN1297891 C CN 1297891C CN B031494528 A CNB031494528 A CN B031494528A CN 03149452 A CN03149452 A CN 03149452A CN 1297891 C CN1297891 C CN 1297891C
Authority
CN
China
Prior art keywords
data
log
application data
storage area
software
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.)
Expired - Fee Related
Application number
CNB031494528A
Other languages
Chinese (zh)
Other versions
CN1567199A (en
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.)
Wistron Corp
Original Assignee
Wistron Corp
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 Wistron Corp filed Critical Wistron Corp
Priority to CNB031494528A priority Critical patent/CN1297891C/en
Publication of CN1567199A publication Critical patent/CN1567199A/en
Application granted granted Critical
Publication of CN1297891C publication Critical patent/CN1297891C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Abstract

The present invention relates to a staggered type firmware upgrading method. In the method, software is defined which is composed of a startup loading device, startup data and application data, wherein the startup data is startup codes and relevant agreements, which comprises restarting and starting software update processes, and the occupied space of procedure codes is less than that of the application data; when the software is started, the startup loading device determines, selects and executes the startup data, and subsequently, the startup data loads and executes the application data; during the upgrade, the application data is first emptied to vacate first storage space, new edition startup data is downloaded to be stored in the first storage space, subsequently, old edition startup data is removed to vacate second storage space, and finally new edition application data is downloaded to be stored in the second storage space so as to finish the update and upgrade. With the storage space staggered and exchanged software update technique, the update process stability and the storage space reduction can be both considered.

Description

Staggered form firmware upgrade method and system
(1) technical field
The present invention relevant a kind of the have stability of two copy upgradings and the firmware upgrade method that single copy only takies less storage area advantage.
(2) background technology
For the indirect address or instruction address (IA) or embedded system product category that still might need to do software upgrading after one dispatches from the factory, there are many kinds of reasons may cause the abnormal end of renewal process in the renewal process, comprise cut off the electricity supply, network connectivity interrupts (or can't line), servomechanism decommission (or address setting is incorrect) ... the situation of these abnormal ends may cause product must send factory's burn recording software again, causes user's inconvenience.For solving foregoing problems, existing so-called believable at present with part upgrade method (Reliable Firmware Upgrade Algorithm), and modal be two copy firmware upgrade methods (Two Copy Firmware Upgrade Algorithm), but such practice must take the software program storage area of twice and form waste, and its particular problem is careful to be described in detail as the back:
The software side of depositing commonly used now mainly contains two kinds, and the one, single copy (one copy) mode of not doing fully to protect, the 2nd, have two copy (two copy) modes of software upgrading defencive function:
At first, single copy firmware upgrade method (One Copy Firmware Upgrade Algorithm) is original software upgrading mode, spatially only preserve a software program, but contingent mistake when giving no thought to software upgrading, so have only the software program of single copy when upgrading failure, must send repair in shop multiple, can't depend merely on the mistake that product itself is repaired in house software.
Two copy firmware upgrade methods (Two Copy Firmware Upgrade Algorithm) are the higher relatively software upgrading mode of security (as No. the 5878256th, 6357021, U.S.'s patent of invention), mainly be at the inner copy of preserving two parts of software programs of product, the a copy of it of when software upgrading, can upgrading, if renewal process failure, can also utilize another copy start, the newly downloaded new version software of laying equal stress on.Preceding method has various deformation, comprise that two parts of copies can be the copies that same position is all only upgraded in different version, each upgrading, another part copy then upgrades (as No. the 6009500th, 6253281,6357021,6536038, U.S.'s patent of invention etc.) never.The advantage of aforementioned manner is to ensure the reliability of software, shortcoming is the waste that two parts of software program copies cause the storage area, under the unpressed situation of program, need great storage area, and software program no doubt can reduce by compression and takies the storage area, in case but the service routine compression then will have influence on starting up speed.
From the above, all have its shortcoming respectively no matter existing firmware upgrade method is single copy or two copy mode: the former reliability is low, must send factory's burn recording software again when making a mistake, and causes and uses inconvenience; Latter's relative reliability height, but must take a large amount of storage areas; So existing upgrade technique faces a difficult selection because of aforementioned factor.
Yet, when paying a visit to the root of foregoing problems, can find the question essence of so-called believable firmware upgrade method, promptly be to think deeply how to be interrupted the ability that the answer shape is all arranged in any stage of upgrading; It reflects the purpose that why must deposit two parts of copies; it promptly is the ability of starting shooting again and restarting the software upgrading flow process in order to keep; in other words; it means having only start and downloading the part of agreement of needing protection in the whole part of procedure code; therefore only need do special processing with this part is independent; just can take into account stability, reliability simultaneously, and solve the problem of storage area waste.
(3) summary of the invention
Therefore, fundamental purpose of the present invention is to save the space and promoting under the stable consideration, and a firmware upgrade method with stability and the less storage area of list copy advantage of two copy upgradings is provided.
One aspect of the present invention provides a kind of staggered form firmware upgrade method, be earlier definition one software by one be stored in the startup loading bin of a storer, the application data that a log-on data and is stored in one first storage area is formed, wherein this log-on data only comprises the startup sign indicating number and relevant agreement of starting shooting again and starting the software upgrading flow process, and its procedure code takes up room less than application data; When aforementioned software is upgraded, be to empty this application data earlier to vacate one first storage area, download a new edition log-on data again and deposit in this first storage area, remove in log-on data old edition, remaining storage area constitutes one second storage area after adding storage new edition log-on data, then download the application data of new edition, and the new edition application data of downloading is left in this second storage area, upgrade upgrading to finish.
And during this software startup, then judge and select to carry out log-on data by starting loading bin, be written into application data by log-on data subsequently and carry out.
The present invention provides a kind of system of staggered form firmware upgrade on the other hand, and this system comprises: a main frame; One is arranged on the storer in this main frame; One is stored in the software in this storer; Wherein this software also includes: a startup loading bin of carrying out in this storer, a log-on data and one are stored in application data in this storer by this log-on data; When wherein this software is upgraded, empty this application data earlier to vacate one first storage area, download a new edition log-on data and deposit in this first storage area, remove in log-on data old edition, remaining storage area constitutes one second storage area after adding storage new edition log-on data, then down in the application data of new edition, and will descend the new edition application data deposit in this second storage area, upgrade upgrading to finish.
In aforesaid upgrade method, because of being the log-on data and the application data of download/new old edition of removing alternately, when interrupting appears in any time in the renewal process, still all there is a complete log-on data and to start the more usefulness of new technological process function, effectively guaranteed the degree of stability and the reliability of renewal process for start; In addition, preceding method also cooperates the exchange of storage area simultaneously, so only need to use the storage area of single copy; From the above, the Reliability when the present invention has not only guaranteed software upgrading has more been got rid of the problem that two copy update methods cause the storage area waste.
(4) description of drawings
Fig. 1 is that software of the present invention is formed synoptic diagram.
Storage area exchange situation synoptic diagram when Fig. 2 A~E is a update software of the present invention.
Another storage area exchange situation synoptic diagram when Fig. 3 A~E is a update software of the present invention.
Fig. 4 is a software startup process flow diagram of the present invention.
Fig. 5 is a software upgrading process flow diagram of the present invention.
(5) embodiment
At first as shown in Figure 1, the present invention is that a definition software is made up of three following parts earlier: it is respectively one and starts loading bin (boot loader) 10, one log-on data (boot image) 20 and one application data (application image) 30; Wherein:
This startup loading bin 10 is programs of carrying out when starting, and has simple judgment mechanism, uses the log-on data of selecting on the particular address 20 and is copied in the storer (RAM) and gives execution, promptly is updated never after dispatching from the factory and start loading bin 10;
This log-on data 20 is to include: start sign indicating number (boot code) and microcontroller sign indicating number (Micro-Controller Code); Wherein, this microcontroller sign indicating number can be complete hardware drive program and hardware support application programming interfaces (API), or just comprises start and relevant necessary hardware support, the network of network and reach an agreement on substantially (TCP/IP, DHCP etc.) and downloads reach an agreement on (FTP, TFTP etc.).This log-on data 20 and be responsible for hardware carried out initialization after, application data 30 copied to from particular address continues the storer to carry out;
This application data 30 comprises remaining microcontroller sign indicating number (Micro-Controller Code), the agreement of whole network function, state machine (state machine) etc.
Distinguish according to the practice that software is cut apart, this log-on data 20 can be utilized following dual mode with cutting apart of application data 30:
First kind of mode be allow log-on data 20 and application data 30 the two a real time operating system (RTOS) is arranged respectively, under this situation, expression log-on data 20 and the application data 30 complete executable data (image) of respectively doing for oneself, this log-on data 20 is loaded in the storer application data 30 to replace log-on data 20 continuation execution after itself is complete.
The second way that the present invention adopts then only keeps a RTOS in log-on data 20; Also be about to have the part of starting shooting again and starting software upgrading flow process function and be planned for log-on data 20, all the other partly are planned for application data 30; Because 20 of log-on datas possess basic start and start more new technological process function, elemental network agreement, and do not contain state machine and most agreement layer (protocol stack), so the stored space of its procedure code will be less than application data 30, can utilize the storage area that is discharged by removing application data 30 in the renewal process by this, deposit by servomechanism data downloaded (image).
See also shown in Figure 2 again, storage area exchange synoptic diagram when being update software of the present invention shown in Fig. 2 A, is the virgin state of storage area at first, the block position that wherein starts loading bin 10 is constant forever, and log-on data 20 is respectively b1, a1 with the block starting point of application data 30.When carrying out software upgrading, be earlier application data 30 to be emptied, to vacate one first storage area 31 (shown in Fig. 2 B), then download the log-on data 20 ' of new edition, and leave in and empty (the block starting point is updated to b2) (shown in Fig. 2 C) in first storage areas 31 that application data 30 back discharged, log-on data 20 with old edition removes to vacate the storage area again, add that storing remaining storage area, new edition log-on data 20 ' back constitutes one second storage area 21 (shown in Fig. 2 D), then download the application data 30 ' of new edition, and the new edition application data of downloading 30 ' is deposited (the block starting point is updated to a2) (shown in Fig. 2 E) in aforesaid second storage area 21; Therefore, when software download finishes, the starting point of log-on data 20 and application data 30 will be displaced to new position b2, and a2 duplicates log-on data 20 to storer and start loading bin 10 during the next time start from new position.
And aforementioned software is as after upgrading through another time again, and this log-on data 20 and application data 30 will be got back to original position b1, a1 (shown in Fig. 3 A~E).
Can obviously find out two characteristics of the present invention by above-mentioned explanation:
1. only use the storage area of single copy: can find out obviously that by aforementioned the present invention is the storage area of the use one existing capacity of intersection in the process of update software, in other words, only use the storage area of single copy, get final product the stable software upgrading of finishing.
2. the degree of stability and the reliability that have two copy method for upgrading software: its most important breakthrough is to allow to appear at the mistake in any stage in the renewal process, no matter being renewal process, main cause interrupts failure in that stage, all still kept a complete log-on data in the software, can be provided as starts shooting again and start the software upgrading flow process uses, even so the software upgrading failure also can re-execute software upgrading after the start again.
The detailed process that the present invention starts software is as shown in Figure 4, during startup, these startup loading bin 10 programs will be performed earlier, and select to start yard (a boot code) and copy to storer by that block, its selection mode is to check the system variables BootVar (this parameter can be stored among NVRAM or the Flash) that deposits, should start that log-on data 20 blocks when mainly acting on the record start, when its value is 1 to represent first block b1, its value is 2 to represent the second block b2, if other numerical value then still use first block b1;
After the reference position of decision log-on data 20, start total value inspection (check sum) that loading bin 10 can judge log-on data 20 whether correctly (301), as incorrect, start loading bin 10 and will check whether another log-on data 20 exists (303) (if upgrade failure once, and occur in and download after the new edition log-on data, then promptly may there be two parts of log-on datas in the software), if exist, then judge its total value inspection (check sum) whether correctly (303), when correct, start loading bin 10 and will carry out second part of log-on data 20 instead, and system variables (BootVar) is set at by 20 starts (304) of this part log-on data; After the startup sign indicating number is finished, will determines the block (305) at application data 30 places and judge its total value inspection (check sum) (306) according to system variables (BootVar); If these application data 30 zones do not exist or the total value inspection is incorrect, this starts sign indicating number then with executive software refresh routine (307), downloads a log-on data 20 and application data 30 again.
Otherwise, if these application data 30 blocks exist and by total value inspection (check sum), then the startup sign indicating number can copy to application data 30 in the storer and be carried out (308).
If aforesaid second part of log-on data 20 do not exist, represent that promptly log-on data 20 is not to damage in renewal process, thereby can't restore automatically, so the time can in addition show error message (309) with hardware (for example pilot lamp), send repair in shop multiple product to notify the user.
Detailed process during as for update software of the present invention is as shown in Figure 5; Cause the reason of software upgrading to comprise: when application data 30 does not exist or be imperfect, and it's the old times is past version, and (being impelled the action of carry out downloading new version software by user or servo driver end) all can start the flow process of software upgrading.
When software upgrades, at first can check system parameter (BootVar) (400), if the 1st, the application data 30 storage area starting points that expression needs to discharge are in a1 position (401), if the 2nd, the application data 30 storage area starting points that expression needs to discharge are in a2 position (402), then program can be removed and belong to application data 30 block (block) partly in the flash memory (Flash), the log-on data 20 that to download redaction subsequently leaves the storage area (404 that discharges in, 404), that is system variables is 1, promptly leave the position of b2 in, if system variables is 2 positions of leaving b1 in;
After download finishes, program can be judged the total value inspection (checksum) (405 of log-on data 20,406), if by checking, be about to log-on data 20 positions that system variables (BootVar) is located at new edition, and log-on data 20 originally removed, then must download log-on data 20 if fail again by checking; Then download the application data 30 of new edition from servomechanism, and be stored in remaining space (407,408), and carry out total value inspection (checksum) (409,410), if fail by checking then application data-downloading 30 (407 again, 408),, promptly change system variables (411 if represent then that by checking software upgrading finishes, 412), and again start shooting (413) to start the software of redaction.
From the above, Main Function of the present invention is that any stage of software upgrading process all has one at least Part log-on data is complete and can be performed, so, the software upgrading process whenever as take place Interrupt the situation of renewal, such as pulling out power supply or grid line etc., all can utilize this log-on data start to lay equal stress on Newly downloaded software. And preceding method has only used the storage area of single copy approximately, has solved simultaneously two copying The shortcoming in shellfish firmware upgrade method waste mass storage space copies solid so the present invention has two copy/lists concurrently The advantage of part upgrade method, and overcome simultaneously the two defective.

Claims (12)

1. staggered form firmware upgrade method, be earlier definition one software by one be stored in the startup loading bin of a storer, the application data that a log-on data and is stored in one first storage area is formed, wherein this log-on data only comprises the startup sign indicating number and relevant agreement of starting shooting again and starting the software upgrading flow process, and its procedure code takes up room less than application data;
When aforementioned software is upgraded, be to empty this application data earlier to vacate one first storage area, download a new edition log-on data again and deposit in this first storage area, remove in log-on data old edition, remaining storage area constitutes one second storage area after adding storage new edition log-on data, then download the application data of new edition, and the new edition application data of downloading is left in this second storage area, upgrade upgrading to finish.
2. staggered form firmware upgrade method as claimed in claim 1 is characterized in that, this startup loading bin is the program of carrying out when starting, and the simple judgment mechanism of tool is to select log-on data on the particular address to be copied in the storer and to give execution.
3. staggered form firmware upgrade method as claimed in claim 1 or 2 is characterized in that the content of this startup loading bin is never upgraded.
4. staggered form firmware upgrade method as claimed in claim 1 is characterized in that, this log-on data includes one and starts a sign indicating number and a microcontroller sign indicating number, and is responsible for hardware is carried out after the initialization, application data is copied to from particular address continue the storer to carry out.
5. staggered form firmware upgrade method as claimed in claim 4 is characterized in that, this microcontroller sign indicating number only comprises relevant essential hardware support, the network of start and networking reach an agreement on substantially TCP/IP, DHCP and download agreement FTP, TFTP.
6. staggered form firmware upgrade method as claimed in claim 5 is characterized in that, the microcontroller sign indicating number this application data comprises in log-on data, the agreement of whole network function, state machine.
7. the system of a staggered form firmware upgrade, this system comprises:
One main frame;
One is arranged on the storer in this main frame;
One is stored in the software in this storer;
Wherein this software also includes:
The one startup loading bin of carrying out in this storer, a log-on data and one are stored in application data in this storer by this log-on data;
When wherein this software is upgraded, empty this application data earlier to vacate one first storage area, download a new edition log-on data and deposit in this first storage area, remove in log-on data old edition, remaining storage area constitutes one second storage area after adding storage new edition log-on data, then down in the application data of new edition, and will descend the new edition application data deposit in this second storage area, upgrade upgrading to finish.
8. system as claimed in claim 7 is characterized in that this startup loading bin is the program of carrying out when starting, and has simple judgment mechanism, to select log-on data on the particular address to be copied in the storer and to give execution.
9. as claim 7 or 8 described systems, it is characterized in that the content of this startup loading bin is never upgraded.
10. system as claimed in claim 7 is characterized in that this log-on data includes one and starts a sign indicating number and a microcontroller sign indicating number, and after being responsible for hardware carried out initialization, application data is copied to from particular address continue the storer to carry out.
11. system as claimed in claim 10 is characterized in that this microcontroller sign indicating number only comprises relevant necessary hardware support, the networking of start and networking reach an agreement on substantially TCP/IP, DHCP and download agreement FTP, TFTP.
12. system as claimed in claim 11 is characterized in that the microcontroller sign indicating number of this application data comprising in log-on data, complete networking function agreement, state machine.
CNB031494528A 2003-06-16 2003-06-16 Staggered form firmware upgrading method Expired - Fee Related CN1297891C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB031494528A CN1297891C (en) 2003-06-16 2003-06-16 Staggered form firmware upgrading method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB031494528A CN1297891C (en) 2003-06-16 2003-06-16 Staggered form firmware upgrading method

Publications (2)

Publication Number Publication Date
CN1567199A CN1567199A (en) 2005-01-19
CN1297891C true CN1297891C (en) 2007-01-31

Family

ID=34472542

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB031494528A Expired - Fee Related CN1297891C (en) 2003-06-16 2003-06-16 Staggered form firmware upgrading method

Country Status (1)

Country Link
CN (1) CN1297891C (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100419683C (en) * 2005-11-17 2008-09-17 英业达股份有限公司 System and method for burning BIOS program
CN100399271C (en) * 2006-09-26 2008-07-02 北京飞天诚信科技有限公司 Online updating method for electronic appliances
CN100456246C (en) * 2007-01-23 2009-01-28 北京映翰通网络技术有限公司 Method and device for updating firmware program
DK2327015T3 (en) 2008-09-26 2018-12-03 Sonova Ag WIRELESS UPDATE OF HEARING DEVICES
CN104063238A (en) * 2013-03-21 2014-09-24 苏州方位通讯科技有限公司 System upgrading backup mechanism under finite storage space
CN106843958A (en) * 2017-01-18 2017-06-13 成都黑盒子电子技术有限公司 A kind of embedded firmware upgrading method
TWI676933B (en) * 2018-07-05 2019-11-11 慧榮科技股份有限公司 Firmware updating method
CN109814908A (en) * 2019-01-17 2019-05-28 深圳忆联信息系统有限公司 Firmware stablizes method, apparatus, computer equipment and the storage medium of upgrading
TWI804703B (en) * 2019-12-31 2023-06-11 新唐科技股份有限公司 Computer apparatus and authority management method based on trust chain

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0981396A (en) * 1995-09-11 1997-03-28 Fuji Xerox Co Ltd Digital controller
US6341373B1 (en) * 1996-12-20 2002-01-22 Liberate Technologies Secure data downloading, recovery and upgrading
US6430685B1 (en) * 1993-02-19 2002-08-06 Apple Computer, Inc. Method and apparatus for enabling a computer system
CN1374589A (en) * 2001-03-14 2002-10-16 开碁数位科技股份有限公司 Modular system and method of updating application software in execution

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6430685B1 (en) * 1993-02-19 2002-08-06 Apple Computer, Inc. Method and apparatus for enabling a computer system
JPH0981396A (en) * 1995-09-11 1997-03-28 Fuji Xerox Co Ltd Digital controller
US6341373B1 (en) * 1996-12-20 2002-01-22 Liberate Technologies Secure data downloading, recovery and upgrading
CN1374589A (en) * 2001-03-14 2002-10-16 开碁数位科技股份有限公司 Modular system and method of updating application software in execution

Also Published As

Publication number Publication date
CN1567199A (en) 2005-01-19

Similar Documents

Publication Publication Date Title
CN1304946C (en) Booting and boot code update method and system thereof
CN1282078C (en) Method and device for firmware renewal
US6629259B2 (en) Method for automatically duplicating a BIOS
CN103299276B (en) The software upgrading process of embedded equipment
CN1191526C (en) Method and device for mounting restorable software of computer system
US6330715B1 (en) Method and apparatus for managing software in a network system
CN1297891C (en) Staggered form firmware upgrading method
US6128734A (en) Installing operating systems changes on a computer system
US20030005037A1 (en) Crash recovery system
KR100348007B1 (en) Method and apparatus for restoration of a computer system hard drive
CN1277214C (en) Embedded system upgrading method
US20020091919A1 (en) Method, system, and program for selecting one of multiple code images to execute following a reboot operation
US20070226685A1 (en) Apparatus and method for live loading of version upgrades in a process control environment
CN1991761A (en) Firmware program on-line upgrading method and hardware equipment
CN101030140A (en) Device and method for on-line updating fastener programm
CN101799763A (en) Method, device and system for patching kernel on line
US6948059B1 (en) Component loader for industrial control device providing resource search capabilities
CN107566169B (en) Firmware upgrading method based on openwrt and router
US5968170A (en) Primary swap size increase on a UNIX based computer system
CN104915226A (en) Network device software starting method, device and network device
WO2006003564A1 (en) Safe flashing
US6772364B1 (en) Fault tolerant field updating with alternation of memory areas
US5964874A (en) Swap size decrease on a UNIX based computer system
CN1855049A (en) Memory disposition methods and systems
CN1115630C (en) Micro computer

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20070131

Termination date: 20160616