CN103488501A - Optical network terminal equipment and system software upgrade method thereof - Google Patents

Optical network terminal equipment and system software upgrade method thereof Download PDF

Info

Publication number
CN103488501A
CN103488501A CN201310408050.9A CN201310408050A CN103488501A CN 103488501 A CN103488501 A CN 103488501A CN 201310408050 A CN201310408050 A CN 201310408050A CN 103488501 A CN103488501 A CN 103488501A
Authority
CN
China
Prior art keywords
upgrade
data block
software
crc value
image file
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
CN201310408050.9A
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.)
Hisense Broadband Multimedia Technology Co Ltd
Original Assignee
Hisense Broadband Multimedia Technology 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 Hisense Broadband Multimedia Technology Co Ltd filed Critical Hisense Broadband Multimedia Technology Co Ltd
Priority to CN201310408050.9A priority Critical patent/CN103488501A/en
Publication of CN103488501A publication Critical patent/CN103488501A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention discloses an optical network terminal equipment and a system software upgrade method thereof. The method includes allowing a system program of the optical network terminal equipment to calculate a CRC (cyclic redundancy check) value of a received data block, among data blocks, of an upgrading software image file and send starting information during timing to a watchdog; writing the data block into the FLASH, and sending resetting information to the watchdog during timing; writing the last data block in, after determining the CRC value of the data block being equal to a CRC value carried by the file, modifying upgrade state parameters into a upgrading state, and restarting the equipment; if the watchdog times out during timing, resetting and restarting the equipment; starting a bootstrap program after the equipment is restarted; allowing the bootstrap program to determine the upgrade state parameters, if the upgrade state parameters are in the upgrading state, loading the file to the memory, removing the CRC value, and obtaining upgrade software and operating; if the upgrade state parameters are upgraded, loading the system software to the memory and operating. Thus, system software can be upgraded in the small memory.

Description

Optical network terminal and system software upgrading method thereof
Technical field
The present invention relates to the communications field, relate in particular to a kind of optical network terminal and system software upgrading method thereof.
Background technology
At present, fiber entering household is universal gradually, and fiber entering household has become the prevailing model that each operator builds Access Network.Like this, the optical network terminal in optical access network, such as the quantity of optical network unit (ONU, Optical Network Unit) increases substantially.In actual applications, system software upgrading is one of common function of optical network terminal.By optical network terminal is carried out to system software upgrading, can meet the demand of different operators or the different demands of same operator, and, can also constantly improve the function of the system software of optical network terminal, with the business that adapts to operator and the development of application.
At present, the system software upgrading of optical network terminal, normally the user is after the system program transmitting system software upgrade instruction of optical network terminal, pass through procotol, such as OAM, Xmodem and FRTP etc., transmit the upgrade software image file, and complete upgrade software image file is deposited in the internal memory of optical network terminal; Afterwards, system program calculates the CRC(Cyclic Redundancy Check of the upgrade software image file received, cyclic redundancy check (CRC) code), carry out verification; If verification succeeds, by the complete upgrade software image file one-time write in internal memory to the FLASH(flash memory) designated address space, complete the system software upgrading of this equipment.
Yet in actual applications, the internal memory of the optical network terminal as ONU is less, the memory source pretty nervous; Like this, system program operation at optical network terminal, and while carrying out system software upgrading, the free memory space is less, complete upgrade software image file may not be deposited in the internal memory of optical network terminal, thereby, cause optical network terminal to carry out the difficulty of system software upgrading larger, and easily cause upgrading unsuccessfully.
Therefore, be necessary to provide a kind of optical network terminal that makes can in less, leave the method for completion system software upgrading.
Summary of the invention
The defect existed for above-mentioned prior art, the invention provides a kind of optical network terminal and system software upgrading method thereof, in order to realize optical network terminal, leaves the completion system software upgrading in less.
According to an aspect of the present invention, provide a kind of system software upgrading method of optical network terminal, having comprised:
After system program in described optical network terminal receives the system software upgrading instruction, each data block for the upgrade software image file received by network, after calculating the crc value of this data block, send a timing to built-in house dog and start message; Afterwards, after this data block is written to the upgrade software storage area in FLASH, to described house dog, send a timing reset message;
Described system program is written to FLASH, and confirms the crc value of last data block calculate in last data block by described upgrade software image file, after the crc value carried in described upgrade software image file equates, the upgrade status parameter in this equipment is revised as and just upgrade status, restarts this equipment from upgrade status;
Surpass setting-up time if described house dog carries out the timing time of timing after receiving timing to start message, send systematic reset signal, described optical network terminal is resetted and restarts;
After described optical network terminal is restarted, Bootloader; If described boot judge described upgrade status parameter for just in upgrade status, the upgrade software image file of storing in loading upgrading software storage area is after internal memory, crc value that will be wherein obtains upgrade software after rejecting, and moves described upgrade software; If judge, described upgrade status parameter is for upgrade status, and the system software in loading system software storage area moves to internal memory.
Further, the upgrade software image file of storing in described loading upgrading software storage area, after internal memory, also comprises:
Described boot is calculated crc value again for the data that load, and judges whether this crc value calculated equates with the crc value carried in described upgrade software image file; If judge unequal, by described upgrade status parameter modification for after upgrade status, restarting this equipment; And
Described crc value that will be wherein obtain upgrade software after rejecting, and move described upgrade software and be specially:
Equate with the crc value carried in described upgrade software image file if described boot is judged this crc value calculated, will after crc value rejecting wherein, obtain upgrade software, and move described upgrade software.
Wherein, be indicated as the first software partition marked off in described FLASH in the software partition information of described upgrade software storage area in described optical network terminal, the second software partition that described system software storage area marks off be indicated as described FLASH in described software partition information in; And
To after crc value rejecting wherein, obtain upgrade software described, and, after moving described upgrade software, also comprise:
Described boot is designated as the second software partition by the upgrade software storage area in described software partition information, and described system software storage area is designated as to the first software partition.
Preferably, each data block of the described upgrade software image file for receiving by network, calculate the crc value of this data block, specifically comprises:
Calculate the proof test value of j byte of i data block according to following formula 1
Figure BDA0000379535750000031
CRC i j = T _ Byte i j ⊕ ( CRC i j - 1 > > 8 ) (formula 1)
Wherein,
Figure BDA0000379535750000033
it is basis search the value obtained after the CRC check table;
Figure BDA0000379535750000035
it is the proof test value of j-1 byte of i data block;
Figure BDA0000379535750000036
to calculate according to following formula 2:
C _ Byte i j = CRC i j - 1 ⊕ Byte i j (formula 2)
Wherein,
Figure BDA0000379535750000038
it is the value of j byte of i data block; The natural number that i is 1~m, the sum of the data block that m is the upgrade software image file; The natural number that j is 1~n, the total amount of byte that n is i data block; And
Figure BDA0000379535750000039
equal 0; Be greater than 1 situation for i,
Figure BDA00003795357500000310
equal the proof test value of last byte of i-1 data block;
Crc value using the proof test value of last byte of i data block as i data block.
Preferably, the data that the crc value carried in described upgrade software image file is four bytes, and be carried on head or the afterbody in described upgrade software image file.
According to another aspect of the present invention, also provide a kind of optical network terminal, having comprised:
The system program module, after receiving the system software upgrading instruction, for each data block of the upgrade software image file received by network, after calculating the crc value of this data block, send a timing and start message; Afterwards, after this data block is written to the upgrade software storage area in FLASH, send a timing reset message; And be written to FLASH, and confirm the crc value of last data block calculate in last data block by described upgrade software image file, after the crc value carried in described upgrade software image file equates, the upgrade status parameter in this equipment is revised as and just upgrade status, restarts this equipment from upgrade status;
Watchdog module, after starting message for the timing that receives described system program module transmission, start timing; If timing time surpasses setting-up time, send systematic reset signal described optical network terminal is resetted and restarts; And after described watchdog module receives the timing reset message that described system program module sends, to the zero clearing that resetted of the timer for timing;
Bootstrap program module, for after described optical network terminal is restarted, if judge, described upgrade status parameter is for just in upgrade status, the upgrade software image file of storing in loading upgrading software storage area is after internal memory, obtain upgrade software after crc value is wherein rejected, and move described upgrade software; If judge, described upgrade status parameter is for upgrade status, and the described system program module in loading system software storage area is to the internal memory operation.
Further, described bootstrap program module also for the upgrade software image file stored at described loading upgrading software storage area after internal memory, again calculate crc value for the data that load, and judge whether this crc value calculated equates with the crc value carried in described upgrade software image file; If judge unequal, by described upgrade status parameter modification for after upgrade status, restarting this equipment.
Wherein, be indicated as the first software partition marked off in described FLASH in the software partition information of described upgrade software storage area in described optical network terminal, the second software partition that described system software storage area marks off be indicated as described FLASH in described software partition information in; And
Described bootstrap program module obtains upgrade software after also rejecting for the crc value by the upgrade software image file, and after moving described upgrade software, upgrade software storage area in described software partition information is designated as to the second software partition, described system software storage area is designated as to the first software partition.
Preferably, described system program module specifically comprises: for the functions of the equipments program submodule of the various functions that realize this equipment, and for the upgrading boot submodule of the system software upgrading of realizing this equipment; Wherein, described upgrading boot submodule comprises:
Control module, while for each data block receive the upgrade software image file by network, arriving internal memory, send crc value and calculate notice;
The crc value computing unit, after calculating notice for the crc value that receives described control module transmission, calculate the crc value of the data block of current storage in described internal memory:
For i the data block of storing in described internal memory, calculate the proof test value of j byte of i data block according to following formula 1
CRC i j = T _ Byte i j ⊕ ( CRC i j - 1 > > 8 ) (formula 1)
Wherein, it is basis
Figure BDA0000379535750000044
search the value obtained after the CRC check table;
Figure BDA0000379535750000045
it is the proof test value of j-1 byte of i data block;
Figure BDA0000379535750000046
to calculate according to following formula 2:
C _ Byte i j = CRC i j - 1 ⊕ Byte i j (formula 2)
Wherein,
Figure BDA0000379535750000048
it is the value of j byte of i data block; The natural number that i is 1~m, the sum of the data block that m is the upgrade software image file; The natural number that j is 1~n, the total amount of byte that n is i data block; And equal 0; Be greater than 1 situation for i,
Figure BDA00003795357500000410
equal the proof test value of last byte of i-1 data block;
Crc value using the proof test value of last byte of i data block calculating as i data block;
Described crc value computing unit is also after the crc value for the data block calculating the current storage of described internal memory, send data and write notice, and return to the crc value that calculates, send a timing to described watchdog module and start message to described control module;
The data block writing unit, for after receiving described data block and writing notice, be written to the upgrade software storage area in FLASH by the data block of current storage in described internal memory; Afterwards, return to one to described control module and write end notification, and send a timing reset message to described watchdog module;
Described control module also for last data block receiving described upgrade software image file write end notification after, the crc value of last data block calculated if confirm, equate with the crc value carried in described upgrade software image file, the upgrade status parameter in this equipment is revised as and just upgrade status, restarts this equipment from upgrade status.
Preferably, the data that the crc value carried in described upgrade software image file is four bytes, and be carried on head or the afterbody in described upgrade software image file.
In technical scheme of the present invention, after when carrying out the system software upgrading compiling, the crc value of upgrade software image file being inserted into to the head or afterbody of upgrade software image file, the upgrade software image file is divided into to a plurality of data blocks, sends to optical network terminal by network; The system program of optical network terminal receives each data block of upgrade software image file, after depositing in internal memory by this data block, calculates the crc value of this data block, and is written in the FLASH of this equipment; After last data block is write to FLASH, the crc value of last data block of calculating and the crc value that the upgrade software image file carries are compared, carry out verification; Thereby realize the verification to whole upgrade software image file; Carry out CRC check with regard to will not whole upgrade software image file downloading in internal memory, thereby be achieved the optical network terminal that internal memory is less, carry out the upgrading of larger system software;
And, in technical scheme of the present invention, also adopted house dog and system reset to restart mechanism, prevented from the escalation process going wrong and causing the problem of systemic breakdown because database being write to FLASH; Under this insurance mechanism, apply the verification respectively of many data blocks, write the scheme of FLASH, both realized that the optical network terminal that internal memory is less carries out the upgrading of larger system software, had guaranteed again the safety and reliability of system in the escalation process;
Further, at optical network terminal, carry out in the process of system software upgrading, optical network terminal is restarted, after Bootloader, if the upgrade status parameter is for just in upgrade status, boot program loads writes upgrade software image file in FLASH in internal memory, and can calculate crc value to the complete upgrade software image file be loaded in internal memory, again carry out verification, further guaranteed the safety and reliability of system in the escalation process, and the process that can prevent boot program loads upgrade software image file is made mistakes and the problem that causes system program normally to move.
The accompanying drawing explanation
The process flow diagram of the system software upgrading method of the optical network terminal that Fig. 1 a, 1b are the embodiment of the present invention;
The schematic diagram of EMS memory occupation under the different situations that Fig. 2 a, 2b are the embodiment of the present invention;
Fig. 3 be the embodiment of the present invention optical network terminal in the schematic diagram of each module;
The inner structure block diagram of the upgrading boot submodule that Fig. 4 is the embodiment of the present invention.
Embodiment
Below with reference to accompanying drawing, technical scheme of the present invention is carried out to clear, complete description, obviously, described embodiment is only a part of embodiment of the present invention, rather than whole embodiment.Embodiment based in the present invention, those of ordinary skills are resulting all other embodiment under the prerequisite of not making creative work, all belong to the scope that the present invention protects.
The terms such as " module " used in this application, " system " are intended to comprise the entity relevant to computing machine, such as but not limited to hardware, firmware, combination thereof, software or executory software.For example, module can be, but be not limited in: the thread of the process of moving on processor, processor, object, executable program, execution, program and/or computing machine.For instance, the application program of moving on computing equipment and this computing equipment can be modules.One or more modules can be positioned at an executory process and/or thread, and module also can and/or be distributed on a computing machine between two or more computing machines.
The present inventor considers, can after the crc value that calculates the upgrade software image file, crc value be inserted into to head or the afterbody of upgrade software image file, generates the upgrade software image file that carries crc value; Afterwards, the upgrade software image file is divided into to a plurality of data blocks, sends to optical network terminal by network; Like this, after the system program of optical network terminal receives each data block of upgrade software image file and deposits in internal memory by network, calculate the crc value of this data block, then this data block is written in the FLASH of this equipment; After last data block is write to FLASH, the crc value of last data block of calculating and the crc value that the upgrade software image file carries are compared to (carrying out verification), thereby realize the verification to whole upgrade software image file; Carry out CRC check with regard to will not whole upgrade software image file downloading in internal memory, thereby be achieved the optical network terminal that internal memory is less, carry out the upgrading of larger system software;
And the present inventor also considers, because being is upgraded to system software, so the having relatively high expectations of safety, reliability in escalation process; Otherwise system may cause because of the problem in escalation process paralysis; And apply repeatedly in the technical scheme to the FLASH writing data blocks, in the hardware operation process to FLASH, also often easily go wrong, for guaranteeing security of system, if also adopt house dog and system reset to restart that mechanism prevents from escalation process going wrong and the problem that causes systemic breakdown in technical scheme of the present invention; Under this insurance mechanism, apply the verification respectively of many data blocks, write the scheme of FLASH, both realized that the optical network terminal that internal memory is less carries out the upgrading of larger system software, had guaranteed again the safety and reliability of system in the escalation process.
Describe technical scheme of the present invention in detail below in conjunction with accompanying drawing.In technical scheme of the present invention, before to optical network terminal, sending the upgrade software image file, the crc value that first utilizes original upgrade software image file to calculate, obtain the upgrade software image file that will transmit after crc value is inserted to the head of original upgrade software image file or afterbody; Wherein, the crc value carried in the upgrade software image file can be specifically the data of four bytes, the i.e. heuristicimal code of four bytes.
Afterwards, while by network, to the optical network terminal transmission, carrying the upgrade software image file of crc value, it is divided into to a plurality of data blocks and is sent successively; Wherein, the large I of each data block is determined according to the size of the internal memory of optical network device; If data block is too large, may cause the situation as prior art, Out of Memory, cause upgrading unsuccessfully; If data block is too little, cause and frequently write FLASH, and that the time ratio of writing FLASH is write the internal memory time to be long, this may cause the Internet Transmission overtime interrupt; Therefore, the size of each data block is suitable, makes and gets final product safeguards system software upgrading speed, does not affect again Internet Transmission; Such as, the size of each data block is specifically as follows 10k.
The system program of the optical network terminal that the embodiment of the present invention provides, after the system software upgrading instruction that receives user's transmission, the data block that receives the upgrade software image file by network is carried out system software upgrading, and the flow process of its method, as shown in Fig. 1 a, 1b, specifically comprises the steps:
S101: the system program of optical network terminal receives the system software upgrading instruction, makes i=1.
Particularly, the user can pass through the OLT(optical line terminal, Optical Line Terminal) remote upgrade optical network terminal (as ONU), Web webpage mode that also can be by the optical network terminal side or TFTP (Trivial File Transfer Protocol, TFTP) the mode optical network terminal of upgrading;
Optical network terminal comprises MCU(Micro Control Unit, micro-control unit), the system program moved in MCU specifically can comprise two submodules, is respectively functions of the equipments program submodule and upgrading boot submodule; Functions of the equipments program submodule is for realizing the function of this equipment; Upgrading boot submodule is for realizing the upgrading of system software.After system program receives the system software instruction of user's transmission, start upgrading boot submodule, upgrading boot submodule makes i=1, prepares to start to receive i=1 data block.
S102: system program is receiving i data block by network, and after calculating the crc value of this data block, a house dog transmission timing built-in to optical network terminal starts message.
Particularly, the upgrading boot submodule in system program is for i the data block received by network, and the process of crc value that calculates this data block is as follows;
Calculate the proof test value of j byte of i data block according to following formula 1
Figure BDA0000379535750000071
CRC i j = T _ Byte i j ⊕ ( CRC i j - 1 > > 8 ) (formula 1)
Wherein,
Figure BDA0000379535750000073
it is basis search the value obtained after the CRC check table;
Figure BDA0000379535750000075
it is the proof test value of j-1 byte of i data block;
Figure BDA0000379535750000081
meaning will
Figure BDA0000379535750000082
move to right 8;
Figure BDA0000379535750000083
it is right to mean
Figure BDA0000379535750000084
with
Figure BDA0000379535750000085
carry out XOR;
Figure BDA0000379535750000086
to calculate according to following formula 2:
C _ Byte i j = CRC i j - 1 ⊕ Byte i j (formula 2)
Wherein,
Figure BDA0000379535750000088
it is the value of j byte of i data block; The natural number that i is 1~m, the sum of the data block that m is the upgrade software image file; The natural number that j is 1~n, the total amount of byte that n is i data block; And
Figure BDA0000379535750000089
equal 0; Be greater than 1 situation for i,
Figure BDA00003795357500000810
equal the proof test value of last byte of i-1 data block;
Crc value using the proof test value of last byte of i data block as i data block.
And optical network terminal is built-in with a house dog (watchdog), for carrying out timing, and, when timing is overtime, enable system resets and restarts mechanism, prevents from going wrong in escalation process and causes systemic breakdown; In this step, calculate the crc value of i data block at system program after, send a timing to house dog and start message, house dog starts timing.
S103: after system program is written to the upgrade software storage area in FLASH by this data block, to house dog, send a timing reset message.
Particularly, divide two software partitions in the FLASH of optical network terminal, be respectively the first software partition and the second software partition; The upgrade software storage area is used for storing the upgrade software image file, and is indicated as the first software partition marked off in FLASH in the software partition information in optical network terminal; The system software storage area is for the system software of storing optical network terminal (such as, the system software of storage while once upgrading before), and the second software partition marked off be indicated as FLASH in software partition information in.
In this step, after system program is written to the upgrade software storage area in FLASH by this data block, to house dog, send a timing reset message, house dog is resetted timing.
S104: system program judges whether i equals m; If not, make i=i+1, and jump to step S102; If perform step S105.
In this step, whether system program, by judging whether i equals m, is judged and last data block of upgrade software image file is written in FLASH; (being i ≠ m) if not, another i=i+1, jump to step S102, namely, receives next data block, and next data block is processed; If (being i=m), show that system program is written to last data block of upgrade software image file in FLASH, afterwards, is processed according to following step S105.
Like this, system program, by the circulation step of above-mentioned S102~S104, is written to the upgrade software storage area in FLASH by 1st~m data block.
S105: whether the crc value of last data block that the system program judgement calculates equates with the crc value carried in the upgrade software image file; If perform step S110; Otherwise, execution step S111.
Particularly, if i=m system program the upgrade software image file is carried out to verification, whether the crc value of last data block (i.e. m data block) of calculating of judgement, equate with the crc value carried in the upgrade software image file; If show that the upgrade software image file receives successfully, carries out following step S110; Otherwise, show that the upgrade software image file receives wrong, execution step S111.
S110: system program is revised as the upgrade status parameter in this equipment just upgrade status, to restart this equipment from upgrade status.
Particularly, store the upgrade status parameter in optical network terminal, this parameter usually is set to upgrade status when optical network terminal normally moves; If the crc value of last data block that system program judgement calculates, equate with the crc value carried in the upgrade software image file, the upgrade status parameter in this equipment is revised as and just upgrade status, restarts this equipment from upgrade status.
S111: system program sends systematic reset signal, and optical network terminal is resetted and restarts.
Particularly, if the crc value of last data block that the system program judgement calculates, unequal with the crc value carried in the upgrade software image file, system program sends systematic reset signal, and optical network terminal is resetted and restarts.Now, in optical network terminal the upgrade status parameter be still upgrade status.
After optical network terminal is restarted, Bootloader; Boot is carried out the operation of upgrade software or system software according to the upgrade status parameter in this equipment, idiographic flow as shown in Figure 1 b, comprises the steps:
S120: boot judges that upgrade status parameter in this equipment is whether for just in upgrade status; If just in upgrade status, perform step S121; Otherwise, execution step S123.
Particularly, at optical network terminal, by step S110, restarted, or resetted and restart by step S111, after Bootloader, in this step, boot judges that upgrade status parameter in this equipment is whether for just in upgrade status.
S121: the upgrade software image file of storing in boot program loads upgrade software storage area is to internal memory.
Particularly, if boot judge upgrade status parameter in this equipment for just in upgrade status, the upgrade software image file of storing in loading upgrading software storage area is to internal memory.
More preferably, the upgrade software image file of storing in boot program loads upgrade software storage area is after internal memory, also can again calculate crc value for the data that load, and judge whether this crc value calculated equates with the crc value carried in the upgrade software image file; If judgement equates, carries out following step S131; If judge unequal, by the upgrade status parameter modification for after upgrade status, restart this equipment.
Size (being generally several KB) due to the boot of optical network terminal, be far smaller than the size (being generally several MB or tens MB) of system program, like this, after optical network terminal is restarted, internal memory empties, the internal memory that the boot started afterwards takies is very little, thereby, enough large remaining space is just arranged for the complete upgrade software image file of boot program loads in internal memory; And, boot can be calculated the crc value of the upgrade software image file loaded in internal memory again, again carry out verification, further guaranteed the safety and reliability of system in the escalation process, and the process that can prevent boot program loads upgrade software image file is made mistakes and the problem that causes system program normally to move.
Fig. 2 a, 2b show the schematic diagram of EMS memory occupation under different situations; As shown in Figure 2 a, optical network terminal carries out in the process of system software upgrading, and because system program moves, EMS memory occupation is larger, and the free memory space is less, so can not be by complete upgrade software image file write memory; And after optical network terminal is restarted, as shown in Figure 2 b, the boot committed memory started is less, remaining memory headroom is larger, the upgrade software image file of storing in the upgrade software storage area can be loaded in internal memory, and can carry out verification to the complete upgrade software image file be loaded in internal memory.
S122: boot obtains upgrade software after the crc value in the upgrade software image file in internal memory is rejected, and moves this upgrade software.
Particularly, boot obtains upgrade software after the crc value in the upgrade software image file in internal memory is rejected, and move this upgrade software, after being the system software upgrading success, also the upgrade software storage area in software partition information is designated as to the second software partition, the system software storage area is designated as to the first software partition;
Like this, when optical network terminal carries out system software upgrading in next time, the data block store received is arrived to the upgrade software storage area, it is the second software partition in FLASH, to guarantee that next optical network terminal is when carrying out the system software upgrading failure, still can loading system software storage area, i.e. the system software of the first software partition in FLASH, thereby the safety and reliability of the system of assurance;
Equally, optical network terminal is after carrying out the system software upgrading success next time, and boot also can be designated as the first software partition by the upgrade software storage area in software partition information again, and the system software storage area is designated as to the second software partition; Like this, can guarantee the safety and reliability of optical network terminal system when carrying out system software upgrading lower next time.
More preferably, in above-mentioned step S121, boot also can, after judging this crc value calculated and the crc value carried in the upgrade software image file equates, obtain upgrade software after crc value is wherein rejected, and move this upgrade software.
S123: the system software in boot program loads system software storage area moves to internal memory.
Particularly, if boot judges that upgrade status parameter in this equipment is for upgrade status, the system software in loading system software storage area moves to internal memory.
In fact, above-mentioned house dog is in being written to the process of FLASH by each data block, carry out timing, if carrying out the timing time of timing after receiving timing to start message, house dog surpasses setting-up time, show that data block writes abnormal " deadlock " (the writing overtime) of appearance, the automatic enable system of house dog resets and restarts mechanism, sends systematic reset signal, and optical network terminal is resetted and restarts; Wherein, setting-up time can be set according to actual conditions by those skilled in the art.Like this, having avoided data block to write FLASH unsuccessfully causes system software upgrading unsuccessfully to cause the problem of systemic breakdown; Thereby, guaranteed better the safety and reliability that in the system software upgrading process, system is moved.
The system software upgrading method of the optical network terminal based on above-mentioned, the software that the MCU of the optical network terminal of the embodiment of the present invention moves specifically can as shown in Figure 3, comprise as lower module: system program module 301, watchdog module 302 and bootstrap program module 303.
System program module 301, for after receiving the system software upgrading instruction, for each data block of the upgrade software image file received by network, after calculating the crc value of this data block, sends a timing and starts message; Afterwards, after this data block is written to the upgrade software storage area in FLASH, send a timing reset message; And be written to FLASH, and confirm the crc value of last data block calculate in last data block by the upgrade software image file, after the crc value carried in the upgrade software image file equates, the upgrade status parameter in this equipment is revised as and just upgrade status, restarts this equipment from upgrade status; Wherein, the data that the crc value carried in the upgrade software image file is four bytes, and be carried on head or the afterbody in the upgrade software image file.
Watchdog module 302 starts timing after starting message for the timing that receives 301 transmissions of system program module; If timing time surpasses setting-up time, send systematic reset signal optical network terminal is resetted and restarts; And after watchdog module 302 receives the timing reset message that system program module 301 sends, to the zero clearing that resetted of the timer for timing.
Bootstrap program module 303 is for after restarting at optical network terminal, if judgement upgrade status parameter is for just in upgrade status, the upgrade software image file of storing in loading upgrading software storage area is after internal memory, obtain upgrade software after crc value is wherein rejected, and move this upgrade software; If judgement upgrade status parameter is upgrade status, the system program module in loading system software storage area 301 is moved to internal memory.
Particularly, bootstrap program module 303 is after optical network terminal is restarted, if judgement upgrade status parameter is for just in upgrade status, the upgrade software image file of storing in loading upgrading software storage area is after internal memory, again calculate crc value for the data that load, and judge whether this crc value calculated equates with the crc value carried in the upgrade software image file; If judge unequal, by the upgrade status parameter modification for after upgrade status, restart this equipment; Equate with the crc value carried in the upgrade software image file if judge this crc value calculated, will after crc value rejecting wherein, obtain upgrade software, and move described upgrade software.
Wherein, be indicated as the first software partition marked off in FLASH in the software partition information of upgrade software storage area in optical network terminal, the second software partition that the system software storage area marks off be indicated as FLASH in software partition information in;
Correspondingly, bootstrap program module 303 obtains upgrade software after also rejecting for the crc value by the upgrade software image file, and after moving described upgrade software, upgrade software storage area in software partition information is designated as to the second software partition, the system software storage area is designated as to the first software partition.
Above-mentioned system program module 301 comprises the functions of the equipments program submodule of the various functions for realizing this equipment, and for the upgrading boot submodule of the system software upgrading of realizing this equipment; Wherein, the inner structure block diagram of upgrading boot submodule as shown in Figure 4, specifically comprises: control module 401, crc value computing unit 402 and data block writing unit 403.
When control module 401 arrives internal memory for each data block receive the upgrade software image file by network, send crc value and calculate notice;
After crc value computing unit 402 calculates notice for the crc value that receives control module 401 transmissions, calculate the crc value of the data block of current storage in internal memory:
For i the data block of storing in described internal memory, calculate the proof test value of j byte of i data block according to following formula 1
Figure BDA0000379535750000121
CRC i j = T _ Byte i j ⊕ ( CRC i j - 1 > > 8 ) (formula 1)
Wherein,
Figure BDA0000379535750000123
it is basis
Figure BDA0000379535750000124
search the value obtained after the CRC check table;
Figure BDA0000379535750000125
it is the proof test value of j-1 byte of i data block;
Figure BDA0000379535750000126
to calculate according to following formula 2:
C _ Byte i j = CRC i j - 1 ⊕ Byte i j (formula 2)
Wherein,
Figure BDA0000379535750000128
it is the value of j byte of i data block; The natural number that i is 1~m, the sum of the data block that m is the upgrade software image file; The natural number that j is 1~n, the total amount of byte that n is i data block; And
Figure BDA0000379535750000129
equal 0; Be greater than 1 situation for i,
Figure BDA00003795357500001210
equal the proof test value of last byte of i-1 data block.
Crc value using the proof test value of last byte of i data block calculating as i data block;
Crc value computing unit 402 also after the crc value for the data block calculating the current storage of internal memory, sends data and writes notice, and returns to the crc value that calculates, sends a timing to watchdog module 202 and start message to control module 401.
Data block writing unit 403 is written to the upgrade software storage area in FLASH by the data block of current storage in internal memory after writing notice for the data receiving 402 transmissions of crc value computing unit; Afterwards, return to one to control module 401 and write end notification, and send a timing reset message to watchdog module 202.
Control module 401 also for last data block receiving the upgrade software image file write end notification after, the crc value of last data block calculated if confirm, equate with the crc value carried in the upgrade software image file, the upgrade status parameter in this equipment is revised as and just upgrade status, restarts this equipment from upgrade status.
In technical scheme of the present invention, after when carrying out the system software upgrading compiling, the crc value of upgrade software image file being inserted into to the head or afterbody of upgrade software image file, the upgrade software image file is divided into to a plurality of data blocks, sends to optical network terminal by network; The system program of optical network terminal receives each data block of upgrade software image file, after depositing in internal memory by this data block, calculates the crc value of this data block, and is written in the FLASH of this equipment; After last data block is write to FLASH, the crc value of last data block of calculating and the crc value that the upgrade software image file carries are compared, carry out verification; Thereby realize the verification to whole upgrade software image file; Carry out CRC check with regard to will not whole upgrade software image file downloading in internal memory, thereby be achieved the optical network terminal that internal memory is less, carry out the upgrading of larger system software;
And, in technical scheme of the present invention, also adopted house dog and system reset to restart mechanism, prevented from the escalation process going wrong and causing the problem of systemic breakdown because database being write to FLASH; Under this insurance mechanism, apply the verification respectively of many data blocks, write the scheme of FLASH, both realized that the optical network terminal that internal memory is less carries out the upgrading of larger system software, had guaranteed again the safety and reliability of system in the escalation process;
Further, at optical network terminal, carry out in the process of system software upgrading, optical network terminal is restarted, after Bootloader, if the upgrade status parameter is for just in upgrade status, boot program loads writes upgrade software image file in FLASH in internal memory, and can calculate crc value to the complete upgrade software image file be loaded in internal memory, again carry out verification, further guaranteed the safety and reliability of system in the escalation process, and the process that can prevent boot program loads upgrade software image file is made mistakes and the problem that causes system program normally to move.
The above is only the preferred embodiment of the present invention; it should be pointed out that for those skilled in the art, under the premise without departing from the principles of the invention; can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.

Claims (10)

1. the system software upgrading method of an optical network terminal, is characterized in that, comprising:
After system program in described optical network terminal receives the system software upgrading instruction, each data block for the upgrade software image file received by network, after calculating the crc value of this data block, send a timing to built-in house dog and start message; Afterwards, after this data block is written to the upgrade software storage area in FLASH, to described house dog, send a timing reset message;
Described system program is written to FLASH, and confirms the crc value of last data block calculate in last data block by described upgrade software image file, after the crc value carried in described upgrade software image file equates, the upgrade status parameter in this equipment is revised as and just upgrade status, restarts this equipment from upgrade status;
Surpass setting-up time if described house dog carries out the timing time of timing after receiving timing to start message, send systematic reset signal, described optical network terminal is resetted and restarts;
After described optical network terminal is restarted, Bootloader; If described boot judge described upgrade status parameter for just in upgrade status, the upgrade software image file of storing in loading upgrading software storage area is after internal memory, crc value that will be wherein obtains upgrade software after rejecting, and moves described upgrade software; If judge, described upgrade status parameter is for upgrade status, and the system software in loading system software storage area moves to internal memory.
2. the method for claim 1, is characterized in that, the upgrade software image file of storing in described loading upgrading software storage area, after internal memory, also comprises:
Described boot is calculated crc value again for the data that load, and judges whether this crc value calculated equates with the crc value carried in described upgrade software image file; If judge unequal, by described upgrade status parameter modification for after upgrade status, restarting this equipment; And
Described crc value that will be wherein obtain upgrade software after rejecting, and move described upgrade software and be specially:
Equate with the crc value carried in described upgrade software image file if described boot is judged this crc value calculated, will after crc value rejecting wherein, obtain upgrade software, and move described upgrade software.
3. the method for claim 1, it is characterized in that, be indicated as the first software partition marked off in described FLASH in the software partition information of described upgrade software storage area in described optical network terminal, the second software partition that described system software storage area marks off be indicated as described FLASH in described software partition information in; And
To after crc value rejecting wherein, obtain upgrade software described, and, after moving described upgrade software, also comprise:
Described boot is designated as the second software partition by the upgrade software storage area in described software partition information, and described system software storage area is designated as to the first software partition.
4. the method for claim 1, is characterized in that, each data block of the described upgrade software image file for receiving by network calculates the crc value of this data block, specifically comprises:
Calculate the proof test value of j byte of i data block according to following formula 1
CRC i j = T _ Byte i j ⊕ ( CRC i j - 1 > > 8 ) (formula 1)
Wherein, it is basis
Figure FDA0000379535740000024
search the value obtained after the CRC check table;
Figure FDA0000379535740000025
it is the proof test value of j-1 byte of i data block;
Figure FDA0000379535740000026
to calculate according to following formula 2:
C _ Byte i j = CRC i j - 1 ⊕ Byte i j (formula 2)
Wherein,
Figure FDA0000379535740000028
it is the value of j byte of i data block; The natural number that i is 1~m, the sum of the data block that m is the upgrade software image file; The natural number that j is 1~n, the total amount of byte that n is i data block; And
Figure FDA0000379535740000029
equal 0; Be greater than 1 situation for i,
Figure FDA00003795357400000210
equal the proof test value of last byte of i-1 data block;
Crc value using the proof test value of last byte of i data block as i data block.
5. the method for claim 1, is characterized in that, the data that the crc value carried in described upgrade software image file is four bytes, and be carried on head or the afterbody in described upgrade software image file.
6. an optical network terminal, is characterized in that, comprising:
The system program module, after receiving the system software upgrading instruction, for each data block of the upgrade software image file received by network, after calculating the crc value of this data block, send a timing and start message; Afterwards, after this data block is written to the upgrade software storage area in FLASH, send a timing reset message; And be written to FLASH, and confirm the crc value of last data block calculate in last data block by described upgrade software image file, after the crc value carried in described upgrade software image file equates, the upgrade status parameter in this equipment is revised as and just upgrade status, restarts this equipment from upgrade status;
Watchdog module, after starting message for the timing that receives described system program module transmission, start timing; If timing time surpasses setting-up time, send systematic reset signal described optical network terminal is resetted and restarts; And after described watchdog module receives the timing reset message that described system program module sends, to the zero clearing that resetted of the timer for timing;
Bootstrap program module, for after described optical network terminal is restarted, if judge, described upgrade status parameter is for just in upgrade status, the upgrade software image file of storing in loading upgrading software storage area is after internal memory, obtain upgrade software after crc value is wherein rejected, and move described upgrade software; If judge, described upgrade status parameter is for upgrade status, and the described system program module in loading system software storage area is to the internal memory operation.
7. equipment as claimed in claim 6, is characterized in that,
Described bootstrap program module also for the upgrade software image file stored at described loading upgrading software storage area after internal memory, again calculate crc value for the data that load, and judge whether this crc value calculated equates with the crc value carried in described upgrade software image file; If judge unequal, by described upgrade status parameter modification for after upgrade status, restarting this equipment.
8. equipment as claimed in claim 6, it is characterized in that, be indicated as the first software partition marked off in described FLASH in the software partition information of described upgrade software storage area in described optical network terminal, the second software partition that described system software storage area marks off be indicated as described FLASH in described software partition information in; And
Described bootstrap program module obtains upgrade software after also rejecting for the crc value by the upgrade software image file, and after moving described upgrade software, upgrade software storage area in described software partition information is designated as to the second software partition, described system software storage area is designated as to the first software partition.
9. equipment as claimed in claim 6, it is characterized in that, described system program module specifically comprises: for the functions of the equipments program submodule of the various functions that realize this equipment, and for the upgrading boot submodule of the system software upgrading of realizing this equipment; Wherein, described upgrading boot submodule comprises:
Control module, while for each data block receive the upgrade software image file by network, arriving internal memory, send crc value and calculate notice;
The crc value computing unit, after calculating notice for the crc value that receives described control module transmission, calculate the crc value of the data block of current storage in described internal memory:
For i the data block of storing in described internal memory, calculate the proof test value of j byte of i data block according to following formula 1
Figure FDA0000379535740000031
CRC i j = T _ Byte i j ⊕ ( CRC i j - 1 > > 8 ) (formula 1)
Wherein,
Figure FDA0000379535740000033
it is basis search the value obtained after the CRC check table;
Figure FDA0000379535740000035
it is the proof test value of j-1 byte of i data block; to calculate according to following formula 2:
C _ Byte i j = CRC i j - 1 ⊕ Byte i j (formula 2)
Wherein,
Figure FDA0000379535740000043
it is the value of j byte of i data block; The natural number that i is 1~m, the sum of the data block that m is the upgrade software image file; The natural number that j is 1~n, the total amount of byte that n is i data block; And
Figure FDA0000379535740000044
equal 0; Be greater than 1 situation for i,
Figure FDA0000379535740000045
equal the proof test value of last byte of i-1 data block;
Crc value using the proof test value of last byte of i data block calculating as i data block;
Described crc value computing unit is also after the crc value for the data block calculating the current storage of described internal memory, send data and write notice, and return to the crc value that calculates, send a timing to described watchdog module and start message to described control module;
The data block writing unit, for after receiving described data block and writing notice, be written to the upgrade software storage area in FLASH by the data block of current storage in described internal memory; Afterwards, return to one to described control module and write end notification, and send a timing reset message to described watchdog module;
Described control module also for last data block receiving described upgrade software image file write end notification after, the crc value of last data block calculated if confirm, equate with the crc value carried in described upgrade software image file, the upgrade status parameter in this equipment is revised as and just upgrade status, restarts this equipment from upgrade status.
10. equipment as claimed in claim 6, is characterized in that, the data that the crc value carried in described upgrade software image file is four bytes, and be carried on head or the afterbody in described upgrade software image file.
CN201310408050.9A 2013-09-09 2013-09-09 Optical network terminal equipment and system software upgrade method thereof Pending CN103488501A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310408050.9A CN103488501A (en) 2013-09-09 2013-09-09 Optical network terminal equipment and system software upgrade method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310408050.9A CN103488501A (en) 2013-09-09 2013-09-09 Optical network terminal equipment and system software upgrade method thereof

Publications (1)

Publication Number Publication Date
CN103488501A true CN103488501A (en) 2014-01-01

Family

ID=49828758

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310408050.9A Pending CN103488501A (en) 2013-09-09 2013-09-09 Optical network terminal equipment and system software upgrade method thereof

Country Status (1)

Country Link
CN (1) CN103488501A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105045640A (en) * 2015-08-27 2015-11-11 北京金山安全软件有限公司 Software upgrading method and device and intelligent equipment
CN105260215A (en) * 2015-11-04 2016-01-20 福建星海通信科技有限公司 Method of updating vehicle-mounted automobile data recorder terminal by USB flash disk
CN107391174A (en) * 2017-06-15 2017-11-24 广州视源电子科技股份有限公司 A kind of control method and control device of system online upgrading
CN107450945A (en) * 2017-07-13 2017-12-08 北京小鸟看看科技有限公司 A kind of firmware update of virtual reality device
CN108833526A (en) * 2018-06-08 2018-11-16 太仓市同维电子有限公司 A kind of intelligent gateway upgrade method
CN109002312A (en) * 2018-09-10 2018-12-14 京信通信系统(中国)有限公司 Method for upgrading software, device and upgrade server and equipment
CN109375940A (en) * 2018-08-15 2019-02-22 广州南方卫星导航仪器有限公司 A kind of upgrade method of data radio station, system and storage medium
CN109495798A (en) * 2018-12-14 2019-03-19 深圳创维数字技术有限公司 ONU method for upgrading system, device, equipment and computer readable storage medium
CN113741943A (en) * 2021-11-08 2021-12-03 湘投云储科技有限公司 Embedded equipment program upgrading system and method
WO2024066536A1 (en) * 2022-09-28 2024-04-04 华为技术有限公司 Software upgrading method, related device, and network

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030095648A1 (en) * 1999-10-05 2003-05-22 Lifecor, Inc. Fault-tolerant remote reprogramming for a patient-worn medical device
CN101076168A (en) * 2007-06-20 2007-11-21 华为技术有限公司 Method for managing intelligent interminal system and intelligent terminal
CN101557583A (en) * 2009-03-19 2009-10-14 珠海银邮光电技术发展股份有限公司 Remote-updating and version-switching method of repeater equipment embedded software
CN101924958A (en) * 2009-06-09 2010-12-22 上海贝尔股份有限公司 Updating method of optical networking unit of Ethernet passive optical network and device thereof
CN102163155A (en) * 2011-03-09 2011-08-24 深圳创维数字技术股份有限公司 Upgrade controlling device and method for upgrading memory device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030095648A1 (en) * 1999-10-05 2003-05-22 Lifecor, Inc. Fault-tolerant remote reprogramming for a patient-worn medical device
CN101076168A (en) * 2007-06-20 2007-11-21 华为技术有限公司 Method for managing intelligent interminal system and intelligent terminal
CN101557583A (en) * 2009-03-19 2009-10-14 珠海银邮光电技术发展股份有限公司 Remote-updating and version-switching method of repeater equipment embedded software
CN101924958A (en) * 2009-06-09 2010-12-22 上海贝尔股份有限公司 Updating method of optical networking unit of Ethernet passive optical network and device thereof
CN102163155A (en) * 2011-03-09 2011-08-24 深圳创维数字技术股份有限公司 Upgrade controlling device and method for upgrading memory device

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105045640A (en) * 2015-08-27 2015-11-11 北京金山安全软件有限公司 Software upgrading method and device and intelligent equipment
CN105260215A (en) * 2015-11-04 2016-01-20 福建星海通信科技有限公司 Method of updating vehicle-mounted automobile data recorder terminal by USB flash disk
CN107391174A (en) * 2017-06-15 2017-11-24 广州视源电子科技股份有限公司 A kind of control method and control device of system online upgrading
CN107450945A (en) * 2017-07-13 2017-12-08 北京小鸟看看科技有限公司 A kind of firmware update of virtual reality device
CN108833526A (en) * 2018-06-08 2018-11-16 太仓市同维电子有限公司 A kind of intelligent gateway upgrade method
CN109375940A (en) * 2018-08-15 2019-02-22 广州南方卫星导航仪器有限公司 A kind of upgrade method of data radio station, system and storage medium
CN109002312A (en) * 2018-09-10 2018-12-14 京信通信系统(中国)有限公司 Method for upgrading software, device and upgrade server and equipment
CN109495798A (en) * 2018-12-14 2019-03-19 深圳创维数字技术有限公司 ONU method for upgrading system, device, equipment and computer readable storage medium
CN109495798B (en) * 2018-12-14 2021-10-22 深圳创维数字技术有限公司 ONU system upgrading method, device, equipment and computer readable storage medium
CN113741943A (en) * 2021-11-08 2021-12-03 湘投云储科技有限公司 Embedded equipment program upgrading system and method
CN113741943B (en) * 2021-11-08 2022-03-18 湘投云储科技有限公司 Embedded equipment program upgrading system and method
WO2024066536A1 (en) * 2022-09-28 2024-04-04 华为技术有限公司 Software upgrading method, related device, and network

Similar Documents

Publication Publication Date Title
CN103488501A (en) Optical network terminal equipment and system software upgrade method thereof
CN106569847B (en) Method for vehicle-mounted system to realize IAP remote upgrade based on mobile network
CN104090796B (en) A kind of embedded device method for updating program and system
CN109032632B (en) FOTA upgrading method, wireless communication terminal and storage medium
US9110843B2 (en) Rack and method thereof for simultaneously updating basic input output systems
US20220317997A1 (en) Online Upgrade Method for Household Appliance Multi-MCU System, Electronic Device and Medium
CN110134415A (en) A kind of controller and its method for upgrading software and device
CN110083374B (en) Upgrade rollback method, system and terminal equipment
US20090094450A1 (en) Firmware image update and management
EP3933573B1 (en) Zero differential upgrade method, non-volatile storage medium and electronic device
CN104915226A (en) Network device software starting method, device and network device
CN107357595B (en) Bus-based multi-driver firmware online updating system
CN102571462A (en) Self-protecting method for long-distance upgrading of optical network unit
CN112015447B (en) System updating method and device of electronic equipment, electronic equipment and storage medium
CN103019111A (en) Electronic control unit for vehicle and method of executing program
CN105703945A (en) Optical network unit (ONU) upgrading method
CN110932891A (en) Error-proof OTA (over the air) upgrading method and device, computer equipment and storage medium
CN111104173A (en) Protection design method of bootstrap program
CN114840242A (en) System upgrading method and device of electronic equipment and readable storage medium
WO2015154578A1 (en) Remote upgrade method, device and system of boot program of single board
CN102081526A (en) Basic input/output system architecture
US10691465B2 (en) Method for synchronization of system management data
CN114793196B (en) Firmware upgrading method, device, equipment and storage medium
CN116126379A (en) BIOS firmware upgrading method, device, equipment and storage medium
CN112925546B (en) Multistage verification method and system for preventing vehicle-mounted ECU from refreshing errors

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20140101

RJ01 Rejection of invention patent application after publication