WO2011044821A1 - Method and device for upgrading main routine of line card - Google Patents

Method and device for upgrading main routine of line card Download PDF

Info

Publication number
WO2011044821A1
WO2011044821A1 PCT/CN2010/077452 CN2010077452W WO2011044821A1 WO 2011044821 A1 WO2011044821 A1 WO 2011044821A1 CN 2010077452 W CN2010077452 W CN 2010077452W WO 2011044821 A1 WO2011044821 A1 WO 2011044821A1
Authority
WO
WIPO (PCT)
Prior art keywords
main program
version
downloaded
line card
tftp
Prior art date
Application number
PCT/CN2010/077452
Other languages
French (fr)
Chinese (zh)
Inventor
张红卫
江坤
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2011044821A1 publication Critical patent/WO2011044821A1/en

Links

Classifications

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

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for upgrading a line card main program. Background technique
  • an Optical Network Unit needs to pass through a Passive Optical Network (PON) port and a fiber line terminal (Optical Line Terminal, OLT) connectivity, and the need to provide a variety of user interfaces with flexibility to work with different services.
  • PON Passive Optical Network
  • OLT Fiber Line Terminal
  • the ONU requires each line card to provide different business functions, each of which performs a relatively single business function.
  • FIG. 1 is a schematic diagram showing the position structure of a line card in an ONU in the prior art.
  • Each line card is controlled by a main control board, and the main control board sends each service to a corresponding line card for processing, wherein the first line card is processed.
  • the line card of the TDM E1 service to the Internet Protocol (IP) service
  • the second line card handles the line card of the optical signal and the electric signal conversion service
  • the third, fourth and fifth line cards are the lines for completing the voice service to the IP service processing. card.
  • IP Internet Protocol
  • the function of the line card must be continuously improved, and the improvement of the line card function can be realized by adding a new line card or upgrading the existing line card main program, and by adding The way in which the line card implements the added function, because different functions, or different implementations of the same function are implemented by different line cards, the line card resources are wasted, so the existing line card main program can generally be upgraded. Its functions are constantly improving.
  • the main method of upgrading the line card main program is as follows: First, the main program of the line card is downloaded to the line card local, and then the downloaded main program is verified, and when the verification is passed, the line program itself is updated by using the downloaded main program. Main program, but due to the simple file transfer protocol (Trivial File) Transfer Protocol, TFTP) download, the download speed is slower, which affects the efficiency of the line card main program update. At the same time, when the main program is downloaded to the local, the main program is verified. When the verification fails, the second program is lost. The main program of the download is discarded, so the implementation method downloads the unnecessary main program in a long time, the accuracy is poor, and the resource is wasted again, and the upgrade efficiency of the line card main program is seriously affected. .
  • TFTP Simple File Transfer Protocol
  • the embodiments of the present invention provide a method and an apparatus for upgrading a line card main program, which are used to solve the problem of low efficiency and poor accuracy of the line card main program in the prior art.
  • the line card receives a simple file transfer protocol TFTP packet containing the main program version header information to be downloaded;
  • the main program is updated with the downloaded main program version header and the version body of the main program.
  • the main program for updating the main program version header and the version body of the main program downloaded by the main program is:
  • the main program of the main program version and the version body of the main program are updated to update the main program of the main program.
  • the verification of the version body of the main program includes one or more of the following:
  • the checksum of the kernel image is checked against the file system.
  • the verifying the main program version header information is: verifying the validity of the main program version header information.
  • the verifying the validity of the main program version header information is: verifying whether one or more of the checksum, the version function, and the version type of the version header correspond to its own main program.
  • the receiving the TFTP packet including the main program version header information to be downloaded is:
  • the TFTP server receives the TFTP packet containing the version header information of the main program to be downloaded; and/or,
  • the status of the upgrade running control word in the main program is determined to support the online upgrade, and the TFTP packet containing the header information of the main program to be downloaded is received from the TFTP server.
  • An apparatus for upgrading a line card main program includes: a receiving module, a verification module, a downloading module, and an updating module;
  • the receiving module is configured to receive a simple file transfer protocol TFTP packet including a header version information of a main program to be downloaded;
  • the verification module is configured to check, in the simple file transfer protocol TFTP packet received by the receiving module, the version of the main program version header to be downloaded;
  • the downloading module is configured to: when the verification module determines to pass the verification of the main program version header information, download a TFTP packet including a version body of the main program;
  • the update module is configured to update the main program of the main program version header and the version body of the main program downloaded by the download module.
  • the update module includes: a check unit and an update unit; wherein
  • the verification unit is configured to verify a version body of the main program
  • the updating unit is configured to: when the verification unit determines that the verification passes, update the main program of the main program version header and the version body of the main program by using the downloaded main program version header.
  • the receiving module includes: a first determining unit and a first receiving unit;
  • the first determining unit is configured to determine whether the main program of the user is incomplete.
  • the first receiving unit is configured to: when the first determining unit determines that the main program of the first determining unit is incomplete, receives the content to be received from the TFTP server.
  • the TFTP packet of the downloaded main program version header information is configured to:
  • the receiving module includes: a second determining unit and a second receiving unit;
  • the second determining unit is configured to determine whether the status of the upgrade running control word in the main program of the main program is to support online upgrade
  • the second receiving unit is configured to: when the status of the upgrade operation control word is upgraded in the main program of the second determining unit, to support the online upgrade, receive the version header information of the main program to be downloaded from the TFTP server. TFTP grouping.
  • An embodiment of the present invention provides a method and an apparatus for upgrading a line card main program.
  • the method includes: when a main program version header information passes verification, downloading a TFTP packet including a version body of the main program, and downloading the The main program updates its own main program.
  • the line card performs the main program update
  • only the TFTP packet including the main program version header information is first downloaded, and when the main program version header information is verified to be valid, the version main body of the main program is downloaded. Therefore, the implementation improves the accuracy and security of the line card main program update, and improves the efficiency of the line card main program update.
  • FIG. 1 is a schematic structural view of a line card in an ONU in the prior art
  • FIG. 2 is a schematic structural diagram of components in an ONU according to an embodiment of the present invention.
  • FIG. 3 is an upgrade process of a line card main program according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a VOIP line card according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of an upgrade procedure of a main program in a VOIP line card according to an embodiment of the present invention
  • FIG. 6 is a schematic structural diagram of an apparatus for upgrading a line card main program according to an embodiment of the present invention. detailed description
  • the embodiment of the present invention provides a method for upgrading the line card main program, the method comprising: the line card receiving the main to be downloaded a TFTP packet of program version header information; when the main program version header information passes verification, downloading a TFTP packet containing a version body of the main program; using the downloaded main program version header and the main program The version body updates its own main program.
  • the implementation improves the accuracy and security of the line card main program update, and improves the efficiency of the line card main program update.
  • FIG. 2 is a schematic structural diagram of components in an ONU according to an embodiment of the present invention.
  • 201 is a main control board, and the main control board sends each service to a corresponding line card for processing, and saves each line card.
  • the information of the main program to be downloaded, 202 and 203 are Ethernet Passive Optical Network (EPON) line cards, EPON line cards complete the conversion of optical signals to electrical signals, and 204 is VOIP (Voice over Internet Protocol).
  • EPON Ethernet Passive Optical Network
  • the line card, the VOIP line card completes the processing of the voice service to the IP service
  • 205 is the E1 line card
  • the E1 line card realizes the processing of the TDM E1 service to the IP service
  • 206 is the power board, which is responsible for supplying power to the main control board and each line card.
  • 207 is a fan, responsible for the heat dissipation of the ONU.
  • FIG. 3 is a flowchart of upgrading a line card main program according to an embodiment of the present invention. As shown in FIG. 3, the process includes the following steps:
  • Step S301 The line card determines whether the main program saved by itself is complete. When the judgment is complete, step S307 is performed; otherwise, step S302 is performed.
  • Step S302 The line card is connected to the corresponding TFTP service end according to the address information of the locally saved TFTP server.
  • the TFTP server is the main control board.
  • step S301 the determination of step S301 is not performed.
  • step S302 is directly performed, and the corresponding TFTP server is connected according to the locally stored address information of the TFTP server.
  • Step S303 The line card downloads a TFTP packet containing version header information of the main program.
  • Step S304 The line card verifies the version header information of the received main program. When the verification passes, step S305 is performed. Otherwise, step S307 is performed.
  • the step specifically includes: verifying validity of the version header according to the version header information of the downloaded main program, and when the verification is passed, according to the version header information of the main program and locally saved The main program determines that the locally saved main program needs to be upgraded. When the verification fails, it means that the local main program does not need to be upgraded.
  • Step S305 Download, from the TFTP server, each TFTP packet containing the version body of the main program, wherein each TFTP packet containing the version body of the main program is located after the TFTP packet containing the version header information of the main program.
  • Step S306 Update the locally saved main program information by using the received main program version header and the version body of the main program.
  • the updating the locally saved main program information by using the received main program version header and the version main body of the main program includes: considering the version main body information of the received main program as valid version body information, so the download can be directly used.
  • the version header of the local main program and the version body of the main program update the version header of the locally saved main program and the version body of the main program.
  • the main program saved by using the received main program version header and the version main body information of the main program includes: The version body is verified. When the verification is passed, the locally saved main program is updated with the received main program version header and the version header body of the main program.
  • the verification of the version body of the main program includes: downloading the main body of the main program of Linux One or more of the verification of the kernel image and the verification of the file system.
  • Step S307 The main program upgrade process ends.
  • the version header information of the main program is downloaded first, and when the version header information is verified, that is, the locally saved main program needs to be updated, the main program is downloaded.
  • the version body information of the program so the implementation process increases the accuracy of the main program upgrade.
  • the version header information fails the verification, that is, the main program corresponding to the version header information cannot be updated, the locally saved main program cannot be updated.
  • the version body information of the main program is downloaded, so that the process of updating the main program is more accurate, and the update efficiency of the main program is improved.
  • the main program in the line card when the main program in the line card is destroyed, that is, when the integrity of the main program is destroyed, in the process of upgrading the main program of the line card, the main program of the line card itself The integrity of the judgment is made.
  • the TFTP packet containing the header information of the main program version is received, and the version body information of the subsequent main program is downloaded, according to the downloaded main program version header and The version body of the main program updates the locally stored incomplete main program. Therefore, the implementation can ensure that the damaged main program is automatically restored when the main program is destroyed.
  • the TFTP client program in the line card BOOT is modified, and an interface is added.
  • the TFTP client can send the version request information to the TFTP server, and receive the main program version header returned by the TFTP server.
  • the VOIP line card includes an 8MB version memory FLASH for storing a main program required for current operation of the line card, and an Ethernet interface for performing information interaction with the main control board.
  • the Ethernet port can be located in the CPU, and a memory space is reserved in the CPU.
  • the BOOT program is stored in the BOOT chip, and the BOOT chip can have a capacity of 512 KB, and the CPU, the BOOT chip, and the 8 MB version memory.
  • FLASH is connected via the CPU bus.
  • the line card can be ported to the LINUX operating system, related drivers, and application software.
  • the BOOT program in the line card uses the open source U-boot program, the BOOT program can provide serial port, FLASH driver and simple TFTP protocol, but the BOOT program cannot provide complete TCP/IP, FTP protocol, SOCKET. Interface, etc.
  • Table 1 shows the file format information of the main program provided by the embodiment of the present invention:
  • the version header information of the main program and the version body information are included in the file format of the main program.
  • the version header information occupies 256 bytes, so the online card is on the main control board.
  • the TFTP server may first determine the location of the version header information, and receive a TFTP packet containing 256 bytes according to the location, that is, it may be considered that the TFTP packet including the main program version header information is received.
  • the name of the main program required for the current operation in the VOIP line card is V16B.MVR, the version number is V1.0.0T1, and the version creation date is 20090501.
  • the TFTP server is the latest master of the main program saved by the main control board.
  • the version number of the program is V1.0.0T2, the version creation date is 20090731, the line card is allowed to be upgraded, and the latest main program name is V16B.MVR.
  • Figure 5 shows the upgrade process of the main program in the VOIP line card. The process includes the following steps:
  • Step S501 The VOIP line card is started, the BOOT program is loaded, the BOOT initializes the hardware, and the upgrade detection is started.
  • Step S502 It is judged whether the main program of its own is complete. When the judgment result is YES, step S503 is performed; otherwise, step S504 is performed.
  • Step S503 Determine whether the local main program allows online upgrade according to the status of the upgrade operation control word in the local BOOT program. When the determination result is yes, go to step S504; otherwise, go to step S511.
  • Step S504 The line card is connected to the TFTP server through its local Ethernet port according to the address of the locally saved TFTP server.
  • Step S505 The line card uses the new interface in the local BOOT program to download the TFTP packet containing the version header information of the main program saved by the TFTP server.
  • the TFTP server saves the version header information and the version body information of the main program whose version name is VI 6B.MVR.
  • Step S506 otherwise the process of automatically updating the main program ends.
  • Step S506 The line card verifies the validity of the version header information according to the version header information of the received main program. When the verification passes, step S507 is performed; otherwise, S511 is performed.
  • the process of verifying the validity of the version header information includes: determining whether one or more of a version header checksum, a version function, and a version type correspond to a main program saved by the line card itself, and then Compare the version number and version creation date required by the line card to run the current version, and whether the V16B.MVR version number and version creation date included in the download main program version header information are consistent.
  • Step S507 The line card downloads each TFTP packet containing the main program version body information from the TFTP server, and temporarily stores it in the memory.
  • the temporary memory can be the SDRAM space in the line card.
  • each TFTP packet containing the main program version body information is located after the TFTP packet containing the main program version header information.
  • Step S508 The line card performs validity check on the version body downloaded to the local main program. When the verification passes, step S509 is performed; otherwise, step S510 is performed.
  • Step S509 Update the main program required for the running by using the downloaded main program version header and the version body of the main program.
  • the update process specifically includes: curing the main program with the valid version number V16B.MVR to the 8MB FLASH of the line card, updating the original main program, the size of the Linux kernel image according to the version header, and the Linux kernel image.
  • the offset in the V16B.MVR, the address of the Linux kernel image stored in the FLASH, the Linux kernel image code is solidified into the FLASH, according to the size of the file system of the version header, the offset of the file system in V16B.MVR,
  • the file system image is stored in the address in the FLASH, and the file system image code is solidified into the FLASH.
  • Step S510 The line card main program upgrade process ends, and the upgraded main program is started.
  • Step S511 The prompt is incorrect, and the line card is automatically restarted.
  • step S503 Only the judgment of step S503 is performed, and the subsequent process is performed based on the result of the judgment.
  • the combination of the determining process of step S502 and step S503 can effectively ensure the accuracy of the main program upgrade process, thereby improving the efficiency of the main program upgrade.
  • FIG. 6 is a schematic diagram of an apparatus for upgrading a line card main program according to an embodiment of the present invention. As shown in FIG. 6, the apparatus includes:
  • the receiving module 61 is configured to receive a TFTP packet that includes the main program version header information to be downloaded, and the verification module 62 is configured to: download, to the receiving module, the main program version header information to be downloaded in the TFTP packet of the simple file transfer protocol. Perform verification
  • the downloading module 63 is configured to: when the verification module determines to pass the verification of the main program version header information, download the TFTP packet including the version body of the main program;
  • the update module 64 is configured to update the main program of the main program version header and the version body of the main program downloaded by the download module.
  • the update module 64 includes:
  • a verification unit 641, configured to verify a version body of the main program
  • the updating unit 642 is configured to update the main program of the main program version header and the version body of the main program to be downloaded when the verification unit determines that the verification is passed.
  • the receiving module 61 includes:
  • the first determining unit 611 is configured to determine whether the main program of the user is incomplete
  • the first receiving unit 612 is configured to: when the first determining unit determines that the main program of the user is incomplete, receive a TFTP packet that includes the main program version header information to be downloaded from the server.
  • the receiving module 61 includes:
  • the second determining unit 613 is configured to determine whether the status of the upgrade running control word in the main program of the main program is to support the online upgrade;
  • the second receiving unit 614 is configured to: when the second determining unit determines the status of the running control word in the main program to support the online upgrade, receive a TFTP packet containing the version header information of the main program to be downloaded from the server.
  • An embodiment of the present invention provides a method and an apparatus for upgrading a line card main program, where the method includes: receiving, by a line card, a TFTP packet including a header version information of a main program to be downloaded; when the header information of the main program is verified And downloading the TFTP packet after the TFTP packet, wherein the subsequent TFTP packet includes a version body of the main program; and updating the main program of the main program by using the downloaded main program.
  • the line card performs the main program update
  • only the TFTP packet including the main program version header information is first downloaded, and when the main program version header information is verified to be valid, the version main body of the main program is downloaded. Therefore, the implementation improves the accuracy and security of the line card main program update, and improves the efficiency of the line card main program update.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

A method and a device for upgrading a main routine of line card, which are used to solve the problems of low efficiency and poor accuracy of the update of main routine of line card in the prior art. The method comprises: when the version header information of the main routine is verified, Trivial File Transfer Protocol (TFTP) packets containing the version main body of the main routine are downloaded, and the downloaded main routine is adopted to update its own main routine. When the update of the main routine is performed in the line card, since only the TFTP packet containing the version header information of the main routine is download firstly, and the version main body of the main routine is downloaded only when the version header information of the main routine is verified to be valid, in this technical solution, the manner improves the accuracy and the security of the update of the main routine of line card, and improves the efficiency of the update of the main routine of the line card.

Description

一种线卡主程序的升级方法及装置 技术领域  Method and device for upgrading line card main program
本发明涉及通信技术领域, 尤其涉及一种线卡主程序的升级方法及装置。 背景技术  The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for upgrading a line card main program. Background technique
随着各种通信业务的不断增长, 为了满足用户对不同通信业务的需求, 光纤网络单元( Optical Network Unit, ONU )需要通过无源光网络( Passive Optical Network, PON ) 口与光纤线路终端 ( Optical Line Terminal, OLT ) 连接, 并且还需要灵活的提供多种用户接口, 从而实现与不同业务的配合 使用。 ONU需要每种线卡提供对应不同的业务功能, 其中每种线卡完成一 种相对单一的业务功能。  As various communication services continue to grow, in order to meet the needs of users for different communication services, an Optical Network Unit (ONU) needs to pass through a Passive Optical Network (PON) port and a fiber line terminal (Optical Line Terminal, OLT) connectivity, and the need to provide a variety of user interfaces with flexibility to work with different services. The ONU requires each line card to provide different business functions, each of which performs a relatively single business function.
图 1为现有技术中线卡在 ONU中的位置结构示意图,每种线卡通过主 控板进行控制, 主控板把每种业务发送到对应的线卡进行处理, 其中第一 线卡为处理 TDM E1业务到网络协议(Internet Protocol, IP )业务的线卡, 第二线卡处理光信号和电信号转换业务的线卡, 第三、 四和五线卡是完成 语音业务到 IP业务处理的线卡。  1 is a schematic diagram showing the position structure of a line card in an ONU in the prior art. Each line card is controlled by a main control board, and the main control board sends each service to a corresponding line card for processing, wherein the first line card is processed. The line card of the TDM E1 service to the Internet Protocol (IP) service, the second line card handles the line card of the optical signal and the electric signal conversion service, and the third, fourth and fifth line cards are the lines for completing the voice service to the IP service processing. card.
随着用户对各种业务需求的不断增加, 线卡的功能也要不断的完善, 而线卡功能的完善可以通过增加新的线卡或者对现有线卡主程序升级的方 式实现, 而通过增加线卡实现增加的功能的方式, 由于不同的功能, 或相 同功能的不同实现方式通过不同线卡实现的方式, 会造成线卡资源的浪费, 所以一般可以对现有线卡主程序进行升级, 使其功能不断的完善。  As the user's demand for various services continues to increase, the function of the line card must be continuously improved, and the improvement of the line card function can be realized by adding a new line card or upgrading the existing line card main program, and by adding The way in which the line card implements the added function, because different functions, or different implementations of the same function are implemented by different line cards, the line card resources are wasted, so the existing line card main program can generally be upgraded. Its functions are constantly improving.
现有技术中对线卡主程序升级的方式主要是: 首先将线卡的主程序下 载到线卡本地, 然后对下载的主程序进行验证, 验证通过时釆用下载的主 程序更新线卡自身的主程序, 但是由于通过简单文件传输协议(Trivial File Transfer Protocol, TFTP )方式下载, 其下载的速度较慢, 从而影响了线卡 主程序更新的效率, 同时当主程序下载到本地后, 对该主程序进行验证, 当验证未通过时, 再丟弃该下载的主程序, 因此该实现方式通过较长的时 间下载了不需要的主程序的方式, 准确性较差, 再次造成资源的浪费, 并 且较严重的影响了线卡主程序的升级效率。 In the prior art, the main method of upgrading the line card main program is as follows: First, the main program of the line card is downloaded to the line card local, and then the downloaded main program is verified, and when the verification is passed, the line program itself is updated by using the downloaded main program. Main program, but due to the simple file transfer protocol (Trivial File) Transfer Protocol, TFTP) download, the download speed is slower, which affects the efficiency of the line card main program update. At the same time, when the main program is downloaded to the local, the main program is verified. When the verification fails, the second program is lost. The main program of the download is discarded, so the implementation method downloads the unnecessary main program in a long time, the accuracy is poor, and the resource is wasted again, and the upgrade efficiency of the line card main program is seriously affected. .
或者在现有技术中也可以在线卡中的 BOOT 程序中移植完整的 TCP/IP、 FTP协议等, 但是需要的工作量较大, 并且增加了 BOOT程度代 码的复杂度, 同时由于每种线卡的 CPU和网络实现不相同, 因此其可移植 性很难保证, 从而影响了线卡主程序的更新准确性。 发明内容  Or in the prior art, the complete TCP/IP, FTP protocol, etc. can be transplanted in the BOOT program in the online card, but the workload required is large, and the complexity of the BOOT degree code is increased, and at the same time, due to each line card The CPU and network implementation are different, so its portability is difficult to guarantee, which affects the update accuracy of the line card main program. Summary of the invention
有鉴于此, 本发明实施例提供一种线卡主程序的升级方法及装置, 用 以解决现有技术中线卡主程序升级效率低、 准确性差的问题。  In view of this, the embodiments of the present invention provide a method and an apparatus for upgrading a line card main program, which are used to solve the problem of low efficiency and poor accuracy of the line card main program in the prior art.
本发明实施例提供的一种线卡主程序的升级方法, 包括:  A method for upgrading a line card main program according to an embodiment of the present invention includes:
线卡接收包含待下载的主程序版本头信息的简单文件传输协议 TFTP 分组;  The line card receives a simple file transfer protocol TFTP packet containing the main program version header information to be downloaded;
当所述主程序版本头信息通过校验时, 下载包含所述主程序的版本主 体的 TFTP分组;  When the main program version header information passes the verification, downloading a TFTP packet including the version body of the main program;
釆用下载的所述主程序版本头和所述主程序的版本主体更新自身的主 程序。  The main program is updated with the downloaded main program version header and the version body of the main program.
所述釆用下载的所述主程序版本头和所述主程序的版本主体更新自身 的主程序为:  The main program for updating the main program version header and the version body of the main program downloaded by the main program is:
对所述主程序的版本主体进行校验;  Verifying the version body of the main program;
校验通过时, 釆用下载的所述主程序版本头和所述主程序的版本主体 更新自身的主程序。  When the verification is passed, the main program of the main program version and the version body of the main program are updated to update the main program of the main program.
对所述主程序的版本主体进行校验包括以下一种或多种: 对所述主程 序的内核镜像的校验和对文件系统的校验。 The verification of the version body of the main program includes one or more of the following: The checksum of the kernel image is checked against the file system.
所述校验所述主程序版本头信息为: 校验所述主程序版本头信息的有 效性。  The verifying the main program version header information is: verifying the validity of the main program version header information.
所述校验所述主程序版本头信息的有效性为: 校验所述版本头的校验 和、 版本功能以及版本类型中的一种或几种是否与自身的主程序对应。  The verifying the validity of the main program version header information is: verifying whether one or more of the checksum, the version function, and the version type of the version header correspond to its own main program.
所述接收包含待下载的主程序版本头信息的 TFTP分组为:  The receiving the TFTP packet including the main program version header information to be downloaded is:
判断自身的主程序不完整时,从 TFTP服务端接收包含待下载的主程序 版本头信息的 TFTP分组; 和 /或,  When it is determined that the main program itself is incomplete, the TFTP server receives the TFTP packet containing the version header information of the main program to be downloaded; and/or,
确定自身的主程序中升级运行控制字的状态为支持在线升级时, 从 TFTP服务端接收包含待下载的主程序版本头信息的 TFTP分组。  The status of the upgrade running control word in the main program is determined to support the online upgrade, and the TFTP packet containing the header information of the main program to be downloaded is received from the TFTP server.
本发明实施例还提供的一种线卡主程序的升级装置, 包括: 接收模块、 校验模块、 下载模块和更新模块; 其中,  An apparatus for upgrading a line card main program according to an embodiment of the present invention includes: a receiving module, a verification module, a downloading module, and an updating module;
所述接收模块, 用于接收包含待下载的主程序版本头信息的简单文件 传输协议 TFTP分组;  The receiving module is configured to receive a simple file transfer protocol TFTP packet including a header version information of a main program to be downloaded;
所述校验模块, 用于对所述接收模块接收的简单文件传输协议 TFTP 分组中的待下载的主程序版本头信息进行校验;  The verification module is configured to check, in the simple file transfer protocol TFTP packet received by the receiving module, the version of the main program version header to be downloaded;
所述下载模块, 用于在校验模块确定对所述主程序版本头信息通过校 验时, 下载包含所述主程序的版本主体的 TFTP分组;  The downloading module is configured to: when the verification module determines to pass the verification of the main program version header information, download a TFTP packet including a version body of the main program;
所述更新模块, 用于釆用所述下载模块下载的所述主程序版本头和所 述主程序的版本主体更新自身的主程序。  The update module is configured to update the main program of the main program version header and the version body of the main program downloaded by the download module.
所述更新模块包括: 校验单元和更新单元; 其中,  The update module includes: a check unit and an update unit; wherein
所述校验单元, 用于对所述主程序的版本主体进行校验;  The verification unit is configured to verify a version body of the main program;
所述更新单元, 用于当所述校验单元确定校验通过时, 釆用下载的所 述主程序版本头和所述主程序的的版本主体更新自身的主程序。  The updating unit is configured to: when the verification unit determines that the verification passes, update the main program of the main program version header and the version body of the main program by using the downloaded main program version header.
所述接收模块包括: 第一判断单元和第一接收单元; 其中, 所述第一判断单元, 用于判断自身的主程序是否不完整; 所述第一接收单元, 用于在所述第一判断单元判定自身的主程序不完 整时, 从 TFTP服务端接收包含待下载的主程序版本头信息的 TFTP分组。 The receiving module includes: a first determining unit and a first receiving unit; The first determining unit is configured to determine whether the main program of the user is incomplete. The first receiving unit is configured to: when the first determining unit determines that the main program of the first determining unit is incomplete, receives the content to be received from the TFTP server. The TFTP packet of the downloaded main program version header information.
所述接收模块包括: 第二判断单元和第二接收单元; 其中,  The receiving module includes: a second determining unit and a second receiving unit;
所述第二判断单元, 用于判断自身的主程序中升级运行控制字的状态 是否为支持在线升级;  The second determining unit is configured to determine whether the status of the upgrade running control word in the main program of the main program is to support online upgrade;
所述第二接收单元, 用于在所述第二判断单元确定自身的主程序中升 级运行控制字的状态为支持在线升级时,从 TFTP服务端接收包含待下载的 主程序的版本头信息的 TFTP分组。  The second receiving unit is configured to: when the status of the upgrade operation control word is upgraded in the main program of the second determining unit, to support the online upgrade, receive the version header information of the main program to be downloaded from the TFTP server. TFTP grouping.
本发明实施例提供了一种线卡主程序的升级方法及装置, 该方法包括: 当主程序版本头信息通过校验时, 下载包含所述主程序的版本主体的 TFTP 分组, 釆用下载的主程序更新自身的主程序。 由于在本发明实施例中线卡 在进行主程序更新时, 首先只下载包含主程序版本头信息的 TFTP分组, 当 验证该主程序版本头信息有效时, 才将该主程序的版本主体下载下来, 因 此该实现方式提高了线卡主程序更新的准确性及安全性, 并且提高了线卡 主程序更新的效率。 附图说明  An embodiment of the present invention provides a method and an apparatus for upgrading a line card main program. The method includes: when a main program version header information passes verification, downloading a TFTP packet including a version body of the main program, and downloading the The main program updates its own main program. In the embodiment of the present invention, when the line card performs the main program update, only the TFTP packet including the main program version header information is first downloaded, and when the main program version header information is verified to be valid, the version main body of the main program is downloaded. Therefore, the implementation improves the accuracy and security of the line card main program update, and improves the efficiency of the line card main program update. DRAWINGS
图 1为现有技术中线卡在 ONU中的位置结构示意图;  1 is a schematic structural view of a line card in an ONU in the prior art;
图 2为本发明实施例提供的 ONU中各部件的结构示意图;  2 is a schematic structural diagram of components in an ONU according to an embodiment of the present invention;
图 3为本发明实施例提供的线卡主程序的升级过程;  3 is an upgrade process of a line card main program according to an embodiment of the present invention;
图 4为本发明实施例提供的 VOIP线卡的结构示意图;  4 is a schematic structural diagram of a VOIP line card according to an embodiment of the present invention;
图 5为本发明实施例提供的 VOIP线卡中的主程序的升级过程; 图 6为本发明实施例提供的一种线卡主程序的升级装置结构示意图。 具体实施方式 FIG. 5 is a schematic diagram of an upgrade procedure of a main program in a VOIP line card according to an embodiment of the present invention; FIG. 6 is a schematic structural diagram of an apparatus for upgrading a line card main program according to an embodiment of the present invention. detailed description
本发明实施例为了有效的提高线卡主程序更新的准确性, 及线卡主程 序更新的效率, 提供了一种线卡主程序的升级方法, 该方法包括: 线卡接 收包含待下载的主程序版本头信息的 TFTP分组;当所述主程序版本头信息 通过校验时, 下载包含所述主程序的版本主体的 TFTP分组; 釆用下载的所 述主程序版本头和所述主程序的版本主体更新自身的主程序。  In order to effectively improve the accuracy of the line card main program update and the efficiency of the line card main program update, the embodiment of the present invention provides a method for upgrading the line card main program, the method comprising: the line card receiving the main to be downloaded a TFTP packet of program version header information; when the main program version header information passes verification, downloading a TFTP packet containing a version body of the main program; using the downloaded main program version header and the main program The version body updates its own main program.
由于在本发明实施例中线卡在进行主程序更新时, 首先只下载包含主 程序版本头信息的 TFTP分组, 当验证该主程序版本头信息有效时, 才将该 主程序的版本主体下载下来, 因此该实现方式提高了线卡主程序更新的准 确性及安全性, 并且提高了线卡主程序更新的效率。  In the embodiment of the present invention, when the line card performs the main program update, only the TFTP packet including the main program version header information is first downloaded, and when the main program version header information is verified to be valid, the version main body of the main program is downloaded. Therefore, the implementation improves the accuracy and security of the line card main program update, and improves the efficiency of the line card main program update.
下面结合说明书附图, 对本发明实施例进行详细说明。  The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
图 2为本发明实施例提供的 ONU中各部件的结构示意图,其中图 2中 201为主控板, 该主控板将每种业务发送到对应的线卡进行处理, 并且保存 每个线卡待下载的主程序的信息 , 202和 203为以太网无源光网络( Ethernet Passive Optical Network, EPON )线卡, EPON线卡完成光信号到电信号的 转换, 204为 VOIP ( Voice over Internet Protocol )线卡, VOIP线卡完成语 音业务到 IP业务的处理, 205为 E1线卡, E1线卡实现 TDM E1业务到 IP 业务的处理, 206为电源板, 负责为主控板和各个线卡供电, 207为风扇, 负责该 ONU的散热。  2 is a schematic structural diagram of components in an ONU according to an embodiment of the present invention. In FIG. 2, 201 is a main control board, and the main control board sends each service to a corresponding line card for processing, and saves each line card. The information of the main program to be downloaded, 202 and 203 are Ethernet Passive Optical Network (EPON) line cards, EPON line cards complete the conversion of optical signals to electrical signals, and 204 is VOIP (Voice over Internet Protocol). The line card, the VOIP line card completes the processing of the voice service to the IP service, 205 is the E1 line card, the E1 line card realizes the processing of the TDM E1 service to the IP service, and 206 is the power board, which is responsible for supplying power to the main control board and each line card. 207 is a fan, responsible for the heat dissipation of the ONU.
图 3为本发明实施例提供的线卡主程序的升级过程, 如图 3所示, 该 过程包括以下步骤:  FIG. 3 is a flowchart of upgrading a line card main program according to an embodiment of the present invention. As shown in FIG. 3, the process includes the following steps:
步骤 S301 : 线卡判断自身保存的主程序是否完整, 当判断完整时, 执 行步骤 S307; 否则, 执行步骤 S302。  Step S301: The line card determines whether the main program saved by itself is complete. When the judgment is complete, step S307 is performed; otherwise, step S302 is performed.
步骤 S302: 线卡根据本地保存的 TFTP服务端的地址信息, 连接到对 应的 TFTP月良务端。 在本发明实施例中 TFTP服务端为主控板。 Step S302: The line card is connected to the corresponding TFTP service end according to the address information of the locally saved TFTP server. In the embodiment of the present invention, the TFTP server is the main control board.
当然在本发明实施例中也可以不进行步骤 S301的判断, 在每次开机后 直接进行步骤 S302 , 根据本地保存的 TFTP服务端的地址信息, 连接到对 应的 TFTP月良务端。  Of course, in the embodiment of the present invention, the determination of step S301 is not performed. After each booting, step S302 is directly performed, and the corresponding TFTP server is connected according to the locally stored address information of the TFTP server.
步骤 S303: 线卡下载包含主程序的版本头信息的 TFTP分组。  Step S303: The line card downloads a TFTP packet containing version header information of the main program.
步骤 S304: 线卡对接收的主程序的版本头信息进行校验, 当校验通过 时, 执行步骤 S305 , 否则, 执行步骤 S307。  Step S304: The line card verifies the version header information of the received main program. When the verification passes, step S305 is performed. Otherwise, step S307 is performed.
在本发明实施例中该步骤具体包括: 根据下载的主程序的版本头信息, 对版本头的有效性进行校验, 当校验通过时, 即根据该主程序的版本头信 息及本地保存的主程序, 判断本地保存的主程序需要升级, 当验证未通过, 即判断本地的主程序不需要升级。  In the embodiment of the present invention, the step specifically includes: verifying validity of the version header according to the version header information of the downloaded main program, and when the verification is passed, according to the version header information of the main program and locally saved The main program determines that the locally saved main program needs to be upgraded. When the verification fails, it means that the local main program does not need to be upgraded.
步骤 S305: 从 TFTP服务端下载包含主程序的版本主体的每个 TFTP 分组,其中包含主程序的版本主体的每个 TFTP分组位于包含主程序的版本 头信息的 TFTP分组之后。  Step S305: Download, from the TFTP server, each TFTP packet containing the version body of the main program, wherein each TFTP packet containing the version body of the main program is located after the TFTP packet containing the version header information of the main program.
步骤 S306: 釆用接收的主程序版本头和主程序的版本主体更新本地保 存的主程序信息。  Step S306: Update the locally saved main program information by using the received main program version header and the version body of the main program.
其中, 釆用接收的主程序版本头和主程序的版本主体更新本地保存的 主程序信息包括: 将接收到的主程序的版本主体信息认为为有效的版本主 体信息, 因此可以直接釆用下载到本地的主程序的版本头和主程序的版本 主体更新本地保存的主程序的版本头和主程序的版本主体。  The updating the locally saved main program information by using the received main program version header and the version main body of the main program includes: considering the version main body information of the received main program as valid version body information, so the download can be directly used. The version header of the local main program and the version body of the main program update the version header of the locally saved main program and the version body of the main program.
或者在本发明实施例中为了进一步增加主程序下载的安全性, 及准确 性, 釆用接收的主程序版本头和主程序的版本主体信息更新本地保存的主 程序包括: 对下载的主程序的版本主体进行校验, 当校验通过时, 釆用接 收的主程序版本头和主程序的版本头主体更新本地保存的主程序。  Or in the embodiment of the present invention, in order to further increase the security and accuracy of the main program download, the main program saved by using the received main program version header and the version main body information of the main program includes: The version body is verified. When the verification is passed, the locally saved main program is updated with the received main program version header and the version header body of the main program.
对主程序的版本主体进行校验包括:对下载主程序的版本主体的 Linux 内核镜像的校验, 以及对文件系统的校验中的一种或几种。 The verification of the version body of the main program includes: downloading the main body of the main program of Linux One or more of the verification of the kernel image and the verification of the file system.
步骤 S307: 该主程序升级过程结束。  Step S307: The main program upgrade process ends.
由于在本发明实施例中在下载主程序版本主体之前, 先下载主程序的 版本头信息, 当对该版本头信息校验通过时, 即确定本地保存的主程序需 要更新时, 才下载该主程序的版本主体信息, 因此该实施过程增加了主程 序升级的准确性, 当版本头信息未通过校验时, 即确定该版本头信息对应 的主程序不能更新本地保存的主程序时, 则不下载该主程序的版本主体信 息, 因此使主程序更新的过程更加准确, 并且提高了主程序的更新效率。  In the embodiment of the present invention, before downloading the main program version body, the version header information of the main program is downloaded first, and when the version header information is verified, that is, the locally saved main program needs to be updated, the main program is downloaded. The version body information of the program, so the implementation process increases the accuracy of the main program upgrade. When the version header information fails the verification, that is, the main program corresponding to the version header information cannot be updated, the locally saved main program cannot be updated. The version body information of the main program is downloaded, so that the process of updating the main program is more accurate, and the update efficiency of the main program is improved.
同时, 在本发明实施例中当线卡中的主程序遭到破坏时, 即主程序的 完整性遭到破坏时, 在对线卡的主程序进行升级的过程中, 对其自身的主 程序的完整性进行判断, 当判断其本身保存的主程序不完整时, 接收包含 主程序版本头信息的 TFTP分组,并进行后续的主程序的版本主体信息的下 载, 根据下载的主程序版本头和主程序的版本主体对本地保存的不完整的 主程序进行更新, 因此, 该实现方式可以保证在主程序遭到破坏时, 自动 恢复遭到破坏的主程序。  Meanwhile, in the embodiment of the present invention, when the main program in the line card is destroyed, that is, when the integrity of the main program is destroyed, in the process of upgrading the main program of the line card, the main program of the line card itself The integrity of the judgment is made. When it is judged that the main program saved by itself is incomplete, the TFTP packet containing the header information of the main program version is received, and the version body information of the subsequent main program is downloaded, according to the downloaded main program version header and The version body of the main program updates the locally stored incomplete main program. Therefore, the implementation can ensure that the damaged main program is automatically restored when the main program is destroyed.
在本发明实施例中修改线卡 BOOT中的 TFTP客户端程序, 增加一个 接口, 釆用该接口 TFTP客户端可以向 TFTP服务端发送版本请求信息, 并 且接收 TFTP服务端返回的包含主程序版本头信息的 TFTP分组,其中该接 口当接收到包含主程序版本头信息的 TFTP分组后,即停止接收包含该主程 序的其他 TFTP分组。  In the embodiment of the present invention, the TFTP client program in the line card BOOT is modified, and an interface is added. The TFTP client can send the version request information to the TFTP server, and receive the main program version header returned by the TFTP server. A TFTP packet of information, wherein the interface stops receiving other TFTP packets containing the main program upon receiving the TFTP packet containing the main program version header information.
图 4为本发明实施例提供的 VOIP线卡的结构示意图,在该 VOIP线卡 中包括存放线卡当前运行所需主程序的 8MB 的版本存储器 FLASH, 与主 控板进行信息交互的以太网口,该以太网口可以位于 CPU内,并且在该 CPU 内还预留有内存空间。 在 BOOT芯片中保存有 BOOT程序, 该 BOOT芯片 的容量可以为 512KB, 并且 CPU、 BOOT 芯片以及 8MB 的版本存储器 FLASH通过 CPU总线连接。 4 is a schematic structural diagram of a VOIP line card according to an embodiment of the present invention. The VOIP line card includes an 8MB version memory FLASH for storing a main program required for current operation of the line card, and an Ethernet interface for performing information interaction with the main control board. The Ethernet port can be located in the CPU, and a memory space is reserved in the CPU. The BOOT program is stored in the BOOT chip, and the BOOT chip can have a capacity of 512 KB, and the CPU, the BOOT chip, and the 8 MB version memory. FLASH is connected via the CPU bus.
结合图 4所示的 VOIP线卡, 该线卡中可以移植 LINUX操作系统、 相 关驱动以及应用软件等。 当线卡中的 BOOT程序为釆用了开源的 U-boot程 序时, 该 BOOT程序可以提供串口、 FLASH驱动以及简单的 TFTP协议, 但该 BOOT程序无法提供完整的 TCP/IP、 FTP协议、 SOCKET接口等。  Combined with the VOIP line card shown in Figure 4, the line card can be ported to the LINUX operating system, related drivers, and application software. When the BOOT program in the line card uses the open source U-boot program, the BOOT program can provide serial port, FLASH driver and simple TFTP protocol, but the BOOT program cannot provide complete TCP/IP, FTP protocol, SOCKET. Interface, etc.
表 1所示为本发明实施例提供的主程序的文件格式信息:  Table 1 shows the file format information of the main program provided by the embodiment of the present invention:
Figure imgf000010_0001
Figure imgf000010_0001
可以看出, 在该主程序的文件格式中包括主程序的版本头信息以及版 本主体信息。 其中版本头信息占用 256个字节, 因此在线卡在与主控板即 TFTP服务端进行信息交互时, 可以首先确定该版本头信息的位置, 根据该 位置接收包含 256个字节的 TFTP分组,即可以认为接收到了包含主程序版 本头信息的 TFTP分组。 It can be seen that the version header information of the main program and the version body information are included in the file format of the main program. The version header information occupies 256 bytes, so the online card is on the main control board. When the TFTP server performs information exchange, it may first determine the location of the version header information, and receive a TFTP packet containing 256 bytes according to the location, that is, it may be considered that the TFTP packet including the main program version header information is received.
下面以 VOIP线卡中当前运行所需的主程序的名称为 V16B.MVR, 版 本号是 V1.0.0T1 , 版本创建日期是 20090501 , TFTP服务端即主控板保存 的对应该主程序的最新主程序的版本号为 V1.0.0T2 , 版本创建日期是 20090731 ,线卡允许升级,最新的主程序名称为 V16B.MVR。图 5为该 VOIP 线卡中的主程序的升级过程, 该过程包括以下步骤:  The name of the main program required for the current operation in the VOIP line card is V16B.MVR, the version number is V1.0.0T1, and the version creation date is 20090501. The TFTP server is the latest master of the main program saved by the main control board. The version number of the program is V1.0.0T2, the version creation date is 20090731, the line card is allowed to be upgraded, and the latest main program name is V16B.MVR. Figure 5 shows the upgrade process of the main program in the VOIP line card. The process includes the following steps:
步骤 S501 : VOIP线卡启动, 加载 BOOT程序, BOOT初始化硬件, 并启动升级检测。  Step S501: The VOIP line card is started, the BOOT program is loaded, the BOOT initializes the hardware, and the upgrade detection is started.
步骤 S502: 判断其本身的主程序是否完整, 当判断结果为是时, 执行 步骤 S503; 否则, 执行步骤 S504。  Step S502: It is judged whether the main program of its own is complete. When the judgment result is YES, step S503 is performed; otherwise, step S504 is performed.
步骤 S503 : 根据其本地 BOOT程序中的升级运行控制字的状态, 判断 其本地的主程序是否允许在线升级, 当判断结果为是时, 执行步骤 S504; 否则, 执行步骤 S511。  Step S503: Determine whether the local main program allows online upgrade according to the status of the upgrade operation control word in the local BOOT program. When the determination result is yes, go to step S504; otherwise, go to step S511.
步骤 S504: 线卡根据本地保存的 TFTP服务端的地址, 通过其本地的 以太网口, 连接到 TFTP服务端。  Step S504: The line card is connected to the TFTP server through its local Ethernet port according to the address of the locally saved TFTP server.
其中, 当线卡通过其本地的以太网口连接到 TFTP服务端时,进行后续 步骤 S505 , 当线卡未通过其本地的以太网口连接到 TFTP服务端时, 则该 自动更新主程序的过程结束。  When the line card is connected to the TFTP server through its local Ethernet port, proceed to step S505. When the line card is not connected to the TFTP server through its local Ethernet port, the process of automatically updating the main program is performed. End.
步骤 S505: 线卡釆用其本地 BOOT程序中的新增接口, 下载 TFTP服 务端保存的包含主程序的版本头信息的 TFTP分组。  Step S505: The line card uses the new interface in the local BOOT program to download the TFTP packet containing the version header information of the main program saved by the TFTP server.
其中, 该 TFTP服务端保存的为该版本名称为 VI 6B.MVR的主程序的 版本头信息及版本主体信息。  The TFTP server saves the version header information and the version body information of the main program whose version name is VI 6B.MVR.
当线卡成功接收到该 TFTP服务端的主程序版本头信息时,则进行后续 步骤 S506, 否则该自动更新主程序的过程结束。 When the line card successfully receives the main program version header information of the TFTP server, the subsequent step is performed. Step S506, otherwise the process of automatically updating the main program ends.
步骤 S506: 线卡根据接收到的主程序的版本头信息, 校验该版本头信 息的有效性, 当校验通过时, 执行步骤 S507; 否则, 执行 S511。  Step S506: The line card verifies the validity of the version header information according to the version header information of the received main program. When the verification passes, step S507 is performed; otherwise, S511 is performed.
其中, 校验该版本头信息的有效性的过程包括: 判断版本头的校验和、 版本功能和版本类型等中的一种或几种是否与本线卡本身保存的主程序相 对应, 然后分别比较线卡当前自身运行所需的版本号和版本创建日期, 与 下载主程序版本头信息中包含的 V16B.MVR的版本号和版本创建日期是否 一致。  The process of verifying the validity of the version header information includes: determining whether one or more of a version header checksum, a version function, and a version type correspond to a main program saved by the line card itself, and then Compare the version number and version creation date required by the line card to run the current version, and whether the V16B.MVR version number and version creation date included in the download main program version header information are consistent.
步骤 S507: 线卡从 TFTP服务端下载包含该主程序版本主体信息的每 个 TFTP分组, 并临时存放在内存中。  Step S507: The line card downloads each TFTP packet containing the main program version body information from the TFTP server, and temporarily stores it in the memory.
其中该临时内存可以为线卡中的 SDRAM空间。  The temporary memory can be the SDRAM space in the line card.
在本发明实施例中,该包含主程序版本主体信息的每个 TFTP分组,位 于包含主程序版本头信息的 TFTP分组之后。  In the embodiment of the present invention, each TFTP packet containing the main program version body information is located after the TFTP packet containing the main program version header information.
当线卡成功下载该包含主程序版本主体信息的 TFTP分组时,进行后续 步骤 S508, 否则该自动更新主程序的过程结束。  When the line card successfully downloads the TFTP packet containing the main program version body information, the subsequent step S508 is performed, otherwise the process of automatically updating the main program ends.
步骤 S508: 线卡对下载到本地的主程序的版本主体进行有效性校验, 当校验通过时, 执行步骤 S509; 否则, 执行步骤 S510。  Step S508: The line card performs validity check on the version body downloaded to the local main program. When the verification passes, step S509 is performed; otherwise, step S510 is performed.
步骤 S509: 釆用下载的主程序版本头和主程序的版本主体更新本身运 行所需的主程序。  Step S509: Update the main program required for the running by using the downloaded main program version header and the version body of the main program.
其中更新的过程具体包括: 将有效的版本号为 V16B.MVR的主程序固 化到线卡的 8MB FLASH中,更新本身原有的主程序,根据版本头部的 Linux 内核镜像的大小、 Linux内核镜像在 V16B.MVR中的偏移、 Linux内核镜像 存放到 FLASH中的地址, 将 Linux内核镜像代码固化到 FLASH中, 根据 版本头部的文件系统的大小、 文件系统在 V16B.MVR中的偏移、 文件系统 镜像存放到 FLASH中的地址、 将文件系统镜像代码固化到 FLASH中。 步骤 S510: 线卡主程序升级过程结束, 启动升级后的主程序。 The update process specifically includes: curing the main program with the valid version number V16B.MVR to the 8MB FLASH of the line card, updating the original main program, the size of the Linux kernel image according to the version header, and the Linux kernel image. The offset in the V16B.MVR, the address of the Linux kernel image stored in the FLASH, the Linux kernel image code is solidified into the FLASH, according to the size of the file system of the version header, the offset of the file system in V16B.MVR, The file system image is stored in the address in the FLASH, and the file system image code is solidified into the FLASH. Step S510: The line card main program upgrade process ends, and the upgraded main program is started.
步骤 S511 : 提示错误, 线卡自动重启。  Step S511: The prompt is incorrect, and the line card is automatically restarted.
在本发明实施例的上述过程中, 当然也可以只根据本地 BOOT程序中 的升级运行控制字的状态, 判断其本地的主程序是否允许在线升级, 即可 以认为其本地保存的主程序都为完整的, 只进行步骤 S503的判断, 根据判 断的结果进行后续过程。 当然步骤 S502和步骤 S503的判断过程相结合, 可以有效的保证主程序升级过程的准确性, 从而可以提高主程序升级的效 率。  In the above process of the embodiment of the present invention, it is of course possible to determine whether the local main program is allowed to be upgraded online according to the status of the upgrade operation control word in the local BOOT program, that is, the main program saved locally can be considered complete. Only the judgment of step S503 is performed, and the subsequent process is performed based on the result of the judgment. Of course, the combination of the determining process of step S502 and step S503 can effectively ensure the accuracy of the main program upgrade process, thereby improving the efficiency of the main program upgrade.
图 6为本发明实施例提供的一种线卡主程序的升级装置, 如图 6所示, 该装置包括:  FIG. 6 is a schematic diagram of an apparatus for upgrading a line card main program according to an embodiment of the present invention. As shown in FIG. 6, the apparatus includes:
接收模块 61 , 用于接收包含待下载的主程序版本头信息的 TFTP分组; 校验模块 62 , 用于对所述接收模块接收的简单文件传输协议 TFTP分 组中的待下载的主程序版本头信息进行校验;  The receiving module 61 is configured to receive a TFTP packet that includes the main program version header information to be downloaded, and the verification module 62 is configured to: download, to the receiving module, the main program version header information to be downloaded in the TFTP packet of the simple file transfer protocol. Perform verification
下载模块 63 , 用于在校验模块确定对所述主程序版本头信息通过校验 时, 下载包含所述主程序的版本主体的 TFTP分组;  The downloading module 63 is configured to: when the verification module determines to pass the verification of the main program version header information, download the TFTP packet including the version body of the main program;
更新模块 64, 用于釆用所述下载模块下载的所述主程序版本头和主程 序的版本主体更新自身的主程序。  The update module 64 is configured to update the main program of the main program version header and the version body of the main program downloaded by the download module.
所述更新模块 64包括:  The update module 64 includes:
校验单元 641 , 用于对所述主程序的版本主体进行校验;  a verification unit 641, configured to verify a version body of the main program;
更新单元 642, 用于当所述校验单元确定校验通过时, 釆用下载的所述 主程序版本头和所述主程序的版本主体更新自身的主程序。  The updating unit 642, is configured to update the main program of the main program version header and the version body of the main program to be downloaded when the verification unit determines that the verification is passed.
所述接收模块 61包括:  The receiving module 61 includes:
第一判断单元 611 , 用于判断自身的主程序是否不完整;  The first determining unit 611 is configured to determine whether the main program of the user is incomplete;
第一接收单元 612 ,用于在所述第一判断单元判定自身的主程序不完整 时, 从服务器接收包含待下载的主程序版本头信息的 TFTP分组。 所述接收模块 61包括: The first receiving unit 612 is configured to: when the first determining unit determines that the main program of the user is incomplete, receive a TFTP packet that includes the main program version header information to be downloaded from the server. The receiving module 61 includes:
第二判断单元 613 ,用于判断自身的主程序中升级运行控制字的状态是 否为支持在线升级;  The second determining unit 613 is configured to determine whether the status of the upgrade running control word in the main program of the main program is to support the online upgrade;
第二接收单元 614,用于在所述第二判断单元确定自身的主程序中升级 运行控制字的状态为支持在线升级时, 从服务器接收包含待下载的主程序 的版本头信息的 TFTP分组。  The second receiving unit 614 is configured to: when the second determining unit determines the status of the running control word in the main program to support the online upgrade, receive a TFTP packet containing the version header information of the main program to be downloaded from the server.
本发明实施例提供了一种线卡主程序的升级方法及装置, 该方法包括: 线卡接收包含待下载的主程序版本头信息的 TFTP分组;当所述主程序版本 头信息通过校验时, 下载所述 TFTP分组之后的 TFTP分组, 其中所述之后 的 TFTP分组包含所述主程序的版本主体;釆用下载的所述主程序更新自身 的主程序。 由于在本发明实施例中线卡在进行主程序更新时, 首先只下载 包含主程序版本头信息的 TFTP分组, 当验证该主程序版本头信息有效时, 才将该主程序的版本主体下载下来, 因此该实现方式提高了线卡主程序更 新的准确性及安全性, 并且提高了线卡主程序更新的效率。 本发明的精神和范围。 这样, 倘若本发明的这些修改和变型属于本发明权 利要求及其等同技术的范围之内, 则本发明也意图包含这些改动和变型在 内。  An embodiment of the present invention provides a method and an apparatus for upgrading a line card main program, where the method includes: receiving, by a line card, a TFTP packet including a header version information of a main program to be downloaded; when the header information of the main program is verified And downloading the TFTP packet after the TFTP packet, wherein the subsequent TFTP packet includes a version body of the main program; and updating the main program of the main program by using the downloaded main program. In the embodiment of the present invention, when the line card performs the main program update, only the TFTP packet including the main program version header information is first downloaded, and when the main program version header information is verified to be valid, the version main body of the main program is downloaded. Therefore, the implementation improves the accuracy and security of the line card main program update, and improves the efficiency of the line card main program update. The spirit and scope of the invention. Thus, it is intended that the present invention cover the modifications and modifications of the invention

Claims

权利要求书 Claim
1、 一种线卡主程序的升级方法, 其特征在于, 该方法包括:  A method for upgrading a line card main program, the method comprising:
线卡接收包含待下载的主程序版本头信息的简单文件传输协议 TFTP 分组;  The line card receives a simple file transfer protocol TFTP packet containing the main program version header information to be downloaded;
当所述主程序版本头信息通过校验时, 下载包含所述主程序的版本主 体的 TFTP分组;  When the main program version header information passes the verification, downloading a TFTP packet including the version body of the main program;
釆用下载的所述主程序版本头和所述主程序的版本主体更新自身的主 程序。  The main program is updated with the downloaded main program version header and the version body of the main program.
2、 如权利要求 1所述的方法, 其特征在于, 所述釆用下载的所述主程 序版本头和所述主程序的版本主体更新自身的主程序为:  2. The method according to claim 1, wherein the main program for updating the main program version header of the download and the version body of the main program is:
对所述主程序的版本主体进行校验;  Verifying the version body of the main program;
校验通过时, 釆用下载的所述主程序版本头和所述主程序的版本主体 更新自身的主程序。  When the verification is passed, the main program of the main program version and the version body of the main program are updated to update the main program of the main program.
3、 如权利要求 2所述的方法, 其特征在于, 对所述主程序的版本主体 进行校验包括以下一种或多种: 对所述主程序的内核镜像的校验和对文件 系统的校验。  3. The method according to claim 2, wherein the verifying the version body of the main program comprises one or more of the following: verifying a kernel image of the main program against a file system check.
4、 如权利要求 1所述的方法, 其特征在于, 所述校验所述主程序版本 头信息为: 校验所述主程序版本头信息的有效性。  The method according to claim 1, wherein the verifying the main program version header information is: verifying validity of the main program version header information.
5、 如权利要求 4所述的方法, 其特征在于, 所述校验所述主程序版本 头信息的有效性为: 校验所述版本头的校验和、 版本功能以及版本类型中 的一种或几种是否与自身的主程序对应。  The method according to claim 4, wherein the verifying the validity of the main program version header information is: verifying one of a checksum, a version function, and a version type of the version header Whether or not it corresponds to its own main program.
6、 如权利要求 1所述的方法, 其特征在于, 所述接收包含待下载的主 程序版本头信息的 TFTP分组为:  The method according to claim 1, wherein the receiving the TFTP packet including the header version information of the main program to be downloaded is:
判断自身的主程序不完整时,从 TFTP服务端接收包含待下载的主程序 版本头信息的 TFTP分组; 和 /或, 确定自身的主程序中升级运行控制字的状态为支持在线升级时, 从When it is determined that the main program itself is incomplete, the TFTP server receives the TFTP packet containing the header information of the main program to be downloaded; and/or, Determine the status of the upgrade run control word in its own main program to support online upgrade, from
TFTP服务端接收包含待下载的主程序版本头信息的 TFTP分组。 The TFTP server receives the TFTP packet containing the header version information of the main program to be downloaded.
7、 一种线卡主程序的升级装置, 其特征在于, 该装置包括: 接收模块、 校验模块、 下载模块和更新模块; 其中,  A device for upgrading a line card main program, the device comprising: a receiving module, a verifying module, a downloading module, and an updating module;
所述接收模块, 用于接收包含待下载的主程序版本头信息的简单文件 传输协议 TFTP分组;  The receiving module is configured to receive a simple file transfer protocol TFTP packet including a header version information of a main program to be downloaded;
所述校验模块, 用于对所述接收模块接收的简单文件传输协议 TFTP 分组中的待下载的主程序版本头信息进行校验;  The verification module is configured to check, in the simple file transfer protocol TFTP packet received by the receiving module, the version of the main program version header to be downloaded;
所述下载模块, 用于在校验模块确定对所述主程序版本头信息通过校 验时, 下载包含所述主程序的版本主体的 TFTP分组;  The downloading module is configured to: when the verification module determines to pass the verification of the main program version header information, download a TFTP packet including a version body of the main program;
所述更新模块, 用于釆用所述下载模块下载的所述主程序版本头和所 述主程序的版本主体更新自身的主程序。  The update module is configured to update the main program of the main program version header and the version body of the main program downloaded by the download module.
8、 如权利要求 7所述的装置, 其特征在于, 所述更新模块包括: 校验 单元和更新单元; 其中,  The device of claim 7, wherein the update module comprises: a check unit and an update unit;
所述校验单元, 用于对所述主程序的版本主体进行校验;  The verification unit is configured to verify a version body of the main program;
所述更新单元, 用于当所述校验单元确定校验通过时, 釆用下载的所 述主程序版本头和所述主程序的的版本主体更新自身的主程序。  The updating unit is configured to: when the verification unit determines that the verification passes, update the main program of the main program version header and the version body of the main program by using the downloaded main program version header.
9、 如权利要求 7所述的装置, 其特征在于, 所述接收模块包括: 第一 判断单元和第一接收单元; 其中,  The device of claim 7, wherein the receiving module comprises: a first determining unit and a first receiving unit;
所述第一判断单元, 用于判断自身的主程序是否不完整;  The first determining unit is configured to determine whether the main program of the user is incomplete;
所述第一接收单元, 用于在所述第一判断单元判定自身的主程序不完 整时, 从 TFTP服务端接收包含待下载的主程序版本头信息的 TFTP分组。  The first receiving unit is configured to: when the first determining unit determines that the main program of the first program is incomplete, receive a TFTP packet that includes the main program version header information to be downloaded from the TFTP server.
10、 如权利要求 7所述的装置, 其特征在于, 所述接收模块包括: 第 二判断单元和第二接收单元; 其中,  The device of claim 7, wherein the receiving module comprises: a second determining unit and a second receiving unit;
所述第二判断单元, 用于判断自身的主程序中升级运行控制字的状态 是否为支持在线升级; The second determining unit is configured to determine the status of the upgrade running control word in the main program of the user Whether to support online upgrades;
所述第二接收单元, 用于在所述第二判断单元确定自身的主程序中升 级运行控制字的状态为支持在线升级时,从 TFTP服务端接收包含待下载的 主程序的版本头信息的 TFTP分组。  The second receiving unit is configured to: when the status of the upgrade operation control word is upgraded in the main program of the second determining unit, to support the online upgrade, receive the version header information of the main program to be downloaded from the TFTP server. TFTP grouping.
PCT/CN2010/077452 2009-10-12 2010-09-29 Method and device for upgrading main routine of line card WO2011044821A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200910204315.7 2009-10-12
CN200910204315.7A CN102043644B (en) 2009-10-12 2009-10-12 Upgrading method and device for line card main program

Publications (1)

Publication Number Publication Date
WO2011044821A1 true WO2011044821A1 (en) 2011-04-21

Family

ID=43875836

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2010/077452 WO2011044821A1 (en) 2009-10-12 2010-09-29 Method and device for upgrading main routine of line card

Country Status (2)

Country Link
CN (1) CN102043644B (en)
WO (1) WO2011044821A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103888464A (en) * 2014-03-28 2014-06-25 上海斐讯数据通信技术有限公司 File transmission method based on TFTP

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106933612A (en) * 2015-12-29 2017-07-07 珠海优特电力科技股份有限公司 Program file method for down loading and system
CN107332692B (en) * 2017-06-13 2019-11-08 烽火通信科技股份有限公司 Line card automatic adaptation and the PTN device and method for downloading software
CN111294324A (en) * 2018-12-10 2020-06-16 中兴通讯股份有限公司 Call implementation method, system, device, main control board, line card and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6289510B1 (en) * 1998-03-12 2001-09-11 Fujitsu Limited Online program-updating system and computer-readable recording medium storing a program-updating program
WO2004042538A2 (en) * 2002-11-05 2004-05-21 Bitfone Corporation Firmware update system for facilitating firmware update in mobile handset related applications
CN101043680A (en) * 2007-03-13 2007-09-26 中兴通讯股份有限公司 Method of application program for prevention illegal update mobile terminal
CN101483576A (en) * 2008-01-11 2009-07-15 上海博达数据通信有限公司 Version management implementing method in distributed system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1280737C (en) * 2002-12-31 2006-10-18 台均科技(深圳)有限公司 Safety authentication method for movable storage device and read and write identification device
CN1242599C (en) * 2003-08-29 2006-02-15 港湾网络有限公司 File-packaged down-load processing method
KR20060134395A (en) * 2005-06-22 2006-12-28 엘지전자 주식회사 Cable broadcasting receiver and firmware upgrading method
CN100488123C (en) * 2006-09-01 2009-05-13 中兴通讯股份有限公司 Software and hardware version management method and system of communication equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6289510B1 (en) * 1998-03-12 2001-09-11 Fujitsu Limited Online program-updating system and computer-readable recording medium storing a program-updating program
WO2004042538A2 (en) * 2002-11-05 2004-05-21 Bitfone Corporation Firmware update system for facilitating firmware update in mobile handset related applications
CN101043680A (en) * 2007-03-13 2007-09-26 中兴通讯股份有限公司 Method of application program for prevention illegal update mobile terminal
CN101483576A (en) * 2008-01-11 2009-07-15 上海博达数据通信有限公司 Version management implementing method in distributed system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103888464A (en) * 2014-03-28 2014-06-25 上海斐讯数据通信技术有限公司 File transmission method based on TFTP

Also Published As

Publication number Publication date
CN102043644B (en) 2015-07-22
CN102043644A (en) 2011-05-04

Similar Documents

Publication Publication Date Title
JP5767750B2 (en) Component update using management engine
EP2973147B1 (en) Policy-based secure web boot
EP3200072A1 (en) Method for updating terminal system, terminal and system
US20060230165A1 (en) Method and apparatus for provisioning network infrastructure
US20070169076A1 (en) Methods and systems for updating a BIOS image
WO2014032519A1 (en) Method, system and device for managing virtual machine software in cloud environment
WO2011153751A1 (en) Software upgrading method and apparatus
WO2009117921A1 (en) Distributed network management system, network management server and method
JP5129770B2 (en) Network equipment
WO2011044821A1 (en) Method and device for upgrading main routine of line card
JP5549038B2 (en) Method for booting network computing device, server and computer system for implementing the method
CN104615455A (en) Remote upgrading method and device for IPMC program of ATCA structure
WO2010081323A1 (en) Method for realizing single board application version and system thereof
TW201430561A (en) System and method of starting baseboard management controller
WO2017054549A1 (en) Device batch upgrading method and system
CN107547274A (en) Multi-netmouth polymerization and device
CN111679837A (en) System installation control method, control system and computing equipment
WO2016146032A1 (en) Cable modem security method and system
WO2015154578A1 (en) Remote upgrade method, device and system of boot program of single board
WO2010130130A1 (en) Method and terminal device for controlling data transmission function of universal serial bus port
JP2013513874A (en) Data card upgrade method and device
CN103442041A (en) Method, device and system for upgrading firmware of embedded device
WO2004086223A1 (en) A method for configurating a singleboard automatically
CN106919423B (en) Firmware upgrading method and device
CN114168210A (en) Embedded equipment deployment method and system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 10823051

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 10823051

Country of ref document: EP

Kind code of ref document: A1