WO2013053262A1 - 自动批量烧写flash的方法 - Google Patents

自动批量烧写flash的方法 Download PDF

Info

Publication number
WO2013053262A1
WO2013053262A1 PCT/CN2012/079874 CN2012079874W WO2013053262A1 WO 2013053262 A1 WO2013053262 A1 WO 2013053262A1 CN 2012079874 W CN2012079874 W CN 2012079874W WO 2013053262 A1 WO2013053262 A1 WO 2013053262A1
Authority
WO
WIPO (PCT)
Prior art keywords
address
mac address
server
flash
software
Prior art date
Application number
PCT/CN2012/079874
Other languages
English (en)
French (fr)
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 WO2013053262A1 publication Critical patent/WO2013053262A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5038Address allocation for local use, e.g. in LAN or USB networks, or in a controller area network [CAN]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/622Layer-2 addresses, e.g. medium access control [MAC] addresses

Definitions

  • the present invention relates to the field of flash programming, and more particularly to a method for automatically mass-sending Flash. Background technique
  • the object of the present invention is to overcome the deficiencies of the above background art, and to provide a method for automatically mass-sending Flash, which can realize a fast and reliable automatic batch allocation device Mac address and write a single disk without manual intervention.
  • the Flash application software checks the correctness of the software programming, and also locates the error points and the cause of the error, provides a reliable basis for the detection of the plate, facilitates the operator to quickly locate the problem, and improves the efficiency of the production in the workshop.
  • the method for automatically batch burning Flash comprises the following steps: A. The device is powered on and enters a countdown state, and the device triggers an automatic programming mode to check the hardware state of the device; B. The device automatically obtains a Mac address and IP from the server. Address, check The legality of the Mac address and IP address. If it is legal, the Mac address is used as the factory Mac address of the device, and the IP address is used as the temporary downloading private IP address of the device. After use, it is deleted. C. The device automatically downloads the software to the server and checks it. Check the legality of the software. If it is legal, write the software to Flash; otherwise, delete the Flash content and re-download the software; D. Decompress and run the application to determine the correctness of the program. If it runs correctly, clear the temporary configuration. Automatic programming is successful.
  • the checking device hardware state in step A refers to: First, check whether the flash size is correct, and then check whether the serial port works normally.
  • the device ends the automatic programming state, turns off the indicator light, and the device serial port prints an error message.
  • the process of obtaining the Mac address and the IP address in the step B is as follows:
  • the device sends a request packet for requesting the allocation of the Mac address and the IP address to the server, and after receiving the request packet, the server searches the server's Mac address table and The IP address table assigns a Mac address and an IP address to the device in turn, and notifies the device in the form of a return packet.
  • the device extracts the M ac address and the IP address from the returned packet.
  • step B further includes the following steps: checking the validity of the Mac address and the IP address, if legal, saving the Mac address and the IP address, and returning the packet to inform the server that the Mac address and the IP address are already occupied; Otherwise, discard the package where the illegal Mac address and IP address are located, send the request packet to the server again, and the server will assign the Mac address and IP address to the device after checking the table again; if it is more than 10 times, the correct Mac address and IP address cannot be obtained. Then the indicator light is off, indicating that the flash programming is unsuccessful.
  • the legality of the checking software in step C refers to: checking whether the software version number, the cyclic redundancy check, and the file length are correct.
  • the server in step B stores a Mac address.
  • Table and IP address table each address has three states: unallocated state, assigned but unacknowledged state, occupied state, of which only addresses in the unassigned state can be assigned to the device, the other two states The address cannot be assigned again.
  • the step D further includes the following steps: If the operation is correct, the device sends a packet to the server, informing the server that the programming is completed, and the server releases the occupied IP address and converts it into an unallocated state.
  • the method further includes the steps: after the device is powered on, enters a countdown state to determine whether there is a keyboard input, and if yes, enters a manual configuration programming mode; otherwise, the device triggers an automatic programming mode.
  • the device indicator is set to be slow flashing, indicating that the device is in the automatic programming state; after the temporary configuration is cleared in step D, the device indicator is set to be always on. , indicates that the automatic programming is successful.
  • the method for mass-programming Flash provided by the present invention can realize a fast and reliable automatic batch distribution device Mac address without manual intervention, and write a single-disc Flash application software, and check software programming. The correctness.
  • the invention has the problem positioning function.
  • the device automatically prints an error message, informs the operator which step to upgrade, and the cause of the error, so that the operator can quickly locate the problem, solve the problem, and improve the problem. The efficiency of workshop production.
  • the present invention provides a complete and practical Flash programming scheme, and can select a manual programming mode or an automatic programming mode according to requirements.
  • the manual programming mode is suitable for a small number of devices
  • the automatic programming mode is suitable for a large number of Batch programming of devices, multiple devices can be shared by one server, and the devices do not interfere with each other, which improves the programming efficiency of the device.
  • Figure 1 is a flow chart of the method of the present invention
  • FIG. 4 is a flow chart of the allocation of a MAC address and an IP address in the embodiment
  • FIG. 5 is a flowchart of the FTP downloading and burning in the embodiment of the present invention. detailed description
  • the Flash programming method of the embodiment of the present invention provides two types of manual configuration programming mode and automatic programming mode.
  • Manual mode is suitable for the programming and positioning of individual devices.
  • the automatic mode is suitable for batch programming, and each device can be programmed separately without interference.
  • a method for automatically batch burning Flash provided by an embodiment of the present invention includes the following steps:
  • Step 101 The device is powered on.
  • Step 102 Enter the countdown state and wait for the user to select the automatic programming mode.
  • Step 103 Determine whether there is keyboard input, if yes, go to step 104; otherwise, go to step 105.
  • Step 104 When the serial port of the device has a keyboard input, it is determined to manually configure the programming mode. In this mode, the configuration of the device Mac address and the flashing of the Flash are manually completed manually: the operator first needs to know that the device allows the Mac to be allocated. Address and IP address, then manually configure the Mac address and IP address of the device, and then download the software from the server for programming. After the programming is completed, manually check the running status of the software to determine whether the programming is correct.
  • Step 105 When the countdown is over, if there is no keyboard input, the automatic programming mode is triggered, and the device indicator is set to a slow flashing state, indicating that the device is in the automatic programming of the flash. Status, then the program completes the hardware detection, that is, whether the serial port of the device is working properly.
  • the Flash size is correct and can be read and written correctly. If the detection does not pass, the indicator light is turned off, and the device serial port prints an error message. In the automatic programming mode, the Mac address and IP address are assigned, and the software version is detected and programmed automatically by the device.
  • Step 106 The device automatically obtains the Mac address and the IP address from the server, and checks whether the Mac address and the IP address are legal. If it is legal, save the Mac address as the factory Mac address of the device, and use the IP address as the temporary downloading private IP address of the device. Address, delete after use. If the packet is discarded if it is not legal, the device sends the request packet to the server again. After checking the table again, the server assigns the Mac address and IP address to the device. If the correct Mac address and IP address are not obtained after more than 10 times, the indicator light is turned off and the flash programming is unsuccessful.
  • Step 107 The server automatically assigns the device a temporary download-only IP address for the program.
  • each address has three states: unassigned state, assigned but unacknowledged occupied state and occupied state. Of the three states, only addresses that are not assigned can be used to assign to the device, and addresses of the other two states cannot be assigned again. The three states of the address can be converted if the conditions are met.
  • the server ensures that the Mac address and the IP address can be correctly allocated according to the two address tables. The address is initially unassigned. After the server receives the request, it will assign the address in order. At this time, the address is already allocated, but it is not occupied. If the occupation confirmation packet is received within the specified time, the server will put The status of this address is modified to be occupied.
  • the device will consider the assignment unsuccessful and modify the status of the address to be unassigned. This address can be used again.
  • the device will clear its temporary IP address and tell the server to finish releasing the IP address, so that the IP address is divided again. Match.
  • the Mac address will not be released. This Mac address will be reserved as a factory Mac address, which means that a Mac address can only be used once.
  • Step 108 The device automatically downloads the software to the server, and checks the legality of the software, that is, checks whether the software version number, the cyclic redundancy check, and the file length are correct. If the check passes, go to step 111, otherwise, Go to step 109.
  • Step 109 If it is detected that the software is illegal, delete the content of the Flash, and determine whether the number of downloads reaches 3 times. If yes, go to step 110; otherwise, return to step 108 to download the software again.
  • Step 110 Clear the temporary configuration, turn off the indicator light, and the auto-programming program fails.
  • Step 111 If it is checked that the software is legal, the legal software is written into the Flash to save, and the content written in the Flash is compared with the downloaded software. If the comparison result is inconsistent, the writing is performed again, and if the comparison is not passed, the indication is extinguished. Lights, and an error message is printed at the same time.
  • Step 112 Decompress the version written to Flash. If the decompression is not correct, delete the software and write Flash again. If the three decompressions are unsuccessful, the indicator light is turned off, indicating failure. Determine the correctness of the program execution. If the operation is correct, send a packet to the server, inform the server that the programming is completed, delete the IP address temporarily used by the device, set the device indicator to be steady, and inform the operator to automatically write the program successfully. The operator performs the programming of the next device.
  • the following describes the flash programming method proposed by the present invention by taking the production of the EPON (Ethernet Passive Optical Network) 5516-01 device as an example.
  • EPON Ethernet Passive Optical Network
  • the device has a total of 18 slots, 16 of which are for EC4B line cards. Car There is no Flash program in the EC4B single disk produced in the room. In the embodiment of the present invention, only one server is needed, and automatic fast programming of multiple devices can be completed.
  • Step 201 After the EC4B is powered on, enter the 3 second countdown.
  • Step 202 Determine whether there is a keyboard input, and if yes, go to step 203; otherwise, go to step 204.
  • Step 203 Before the end of the countdown, if there is a keyboard input, the manual configuration programming mode is entered. In the manual mode, the operator needs to configure the Mac address and IP address by himself, and then writes.
  • Step 204 Determine whether the countdown is over. If yes, go to step 205; otherwise, return to step 202.
  • Step 205 Countdown After 3 seconds, if there is no keyboard input, the automatic programming mode is triggered.
  • Step 206 After entering the automatic programming mode, first set the indicator to a slow flashing state, and tell the operator that the device has entered the automatic programming mode.
  • Step 207 Check if the size of the Flash is correct. If yes, go to step 208; otherwise, end the automatic programming state, and turn off the indicator light to inform the operator that there is a problem with the hardware of the device.
  • Step 208 Check whether the operation of the serial port is normal. If yes, go to step 209; otherwise, end the automatic programming state, and turn off the indicator light to inform the operator that there is a problem with the hardware of the device.
  • Step 302 The device actively sends a specific broadcast packet (a request packet for which a Mac address and an IP address is required) to the server, and informs the server to request to allocate a Mac address and an IP address.
  • Step 303 After receiving the request packet of the device, the server searches its own Mac address table and IP address table, assigns a Mac address and an IP address to the device in order, and then returns a configuration package to the device, where the packet includes the server distribution.
  • the Mac address and IP address of the device (the server maintains a Mac address table and an IP address table).
  • Step 304 Determine whether the device receives the return packet of the server, and if yes, go to step 307; otherwise, go to step 305.
  • Step 305 No packet count count N plus 1.
  • Step 306 Determine whether the count N is greater than 10, if yes, go to step 314; otherwise, return to step 302.
  • Step 307 No packet statistics count N is cleared, and the device obtains the Mac address and IP address assigned to it from the packet.
  • Step 308 Determine whether the obtained Mac address and IP address are legal. If yes, go to step 311; otherwise, go to step 309.
  • Step 309 Error counter i is incremented by 1.
  • Step 310 Determine whether the error counter i is greater than 10, if yes, go to step 314; otherwise, return to step 302.
  • Step 311 Checking, error counter i is cleared, the legal Mac address is written into Flash as the outgoing Mac address of the device, and the legal IP address is used as the temporary IP address of the device download software.
  • Step 312 The device return packet tells the server that the Mac address is already occupied.
  • Step 313 The server will mark the Mac address as occupied and prevent the same address from being assigned multiple times.
  • Step 314 Turn off the indicator light.
  • the specific process is as follows:
  • Step 401 The program download begins.
  • Step 402 Allocate the download memory.
  • Step 403 Clear the download count to zero.
  • Step 404 Determine whether the number of downloads reaches 5 times. If yes, J goes to step 414; otherwise, goes to step 405. After each upgrade failure, the counter will be ⁇ 1, and if 5 downloads fail, the upgrade will be exited and the upgrade will be considered unsuccessful.
  • Step 405 Fill in the FTP (File Transfer Protocol) parameter and create an FTP session to download the program.
  • FTP File Transfer Protocol
  • Step 406 Determine whether the FTP communication is normal. If yes, go to step 407; otherwise, return to step 404.
  • Step 407 Determine whether the FTP session is completed. If yes, go to step 408; otherwise, return to step 406.
  • Step 408 End the FTP session, and the program download is completed.
  • Step 409 Perform a legality check to determine whether the downloaded program is legal, for example, whether the software version number is correct, whether the CRC (Cyclic Redundancy Check) check is correct, whether the file size is correct, etc., if yes, Then go to step 410; otherwise return to step 404.
  • CRC Cyclic Redundancy Check
  • Step 410 After checking, pass the FTP file to Flash.
  • Step 411 Determine whether the result of the programming is consistent with the FTP file, and if yes, go to step 413; otherwise, go to step 412.
  • Step 412 Delete the burned file, and return to step 404.
  • Step 413 Perform a decompression test to determine whether the operation is correct. If yes, go to step 414; otherwise, go to step 412. If the decompression fails, you also need to delete the burned file. download again.
  • Step 414 Release the original memory, and the FTP download is completed.
  • the device decompresses the software. If it runs correctly, the device sends a packet to the server, telling the server that the programming is completed, the server releases the occupied IP address, converts it to the unassigned state, and the device deletes the temporary dedicated IP address. Keep the Mac address as the factory Mac address of the device, and light the indicator to inform the operator that the programming is complete.
  • the operator can complete the programming of the specified software and the Mac address by continuously replacing the device, and by observing the state of the indicator light, it can be known whether the programming is completed.
  • the serial port also prints an error message to help the operator locate the problem. Therefore, the method of the embodiment of the present invention not only saves material resources and human resources, but also improves production efficiency.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Stored Programmes (AREA)
  • Small-Scale Networks (AREA)

Abstract

本发明公开了一种自动批量烧写Flash的方法,包括步骤:设备上电进入倒计时状态,触发自动烧写模式后,检查设备硬件状态;设备自动从服务器获取Mac地址和IP地址并检查合法性,合法则将Mac地址作为出厂Mac地址,IP地址作为设备临时下载专用IP地址,使用后删除;设备自动到服务器下载软件并检查合法性,合法则将其写入;否则删除,再重新下载;解压并运行应用程序,确定程序运行的正确性,正确则清除临时配置,自动烧写成功。本发明能快速、可靠的自动批量分配设备的Mac地址,完成烧写,还能定位出错点及出错原因,便于迅速定位解决问题,提高车间生产的效率。

Description

自动批量烧写 Flash的方法 技术领域
本发明涉及 Flash 的烧写领域, 特别是涉及一种自动批量烧写 Flash的方法。 背景技术
由于车间生产线生产出来的单盘 Flash里面没有应用程序, 每个 单盘都需要调测人员通过连接串口和网口进行软件下载后,再烧写程 序,这就需要反复插拔串口线、网线和电源开关。由于盘子的产量大, 如果采用人工手动烧写的方法, 则需要大量的员工及多台服务器, 不 仅耗费大量的人力和物力, 而且配置繁琐, 烧写效率极低, 此外, 在 遇到问题时难以立即定位解决, 严重影响到车间生产的进度。 发明内容
本发明的目的是为了克服上述背景技术的不足, 提供一种自动 批量烧写 Flash的方法, 在无需人工干预的情况下, 能够实现快速、 可靠的自动批量分配设备的 Mac地址, 烧写单盘的 Flash应用软件, 检査软件烧写的正确性, 还能够定位出错点及出错原因, 给盘子的检 测提供可靠依据, 便于操作人员迅速定位解决问题, 提高了车间生产 的效率。
本发明提供的自动批量烧写 Flash的方法, 包括以下步骤: A、 设备上电进入倒计时状态, 待设备触发自动烧写模式, 检査设备 硬件状态; B、 设备自动从服务器获取 Mac地址和 IP地址, 检査 Mac地址和 IP地址的合法性, 如果合法, 则将 Mac地址作为设备 的出厂 Mac地址, 将 IP地址作为设备的临时下载专用 IP地址, 使用后删除; C、 设备自动到服务器下载软件, 并检査软件的合法 性, 如果合法, 则将该软件写入 Flash; 否则删除 Flash内容, 重 新下载软件; D、 解压并运行应用程序, 确定程序运行的正确性, 如果运行正确, 则清除临时配置, 自动烧写成功。
在上述技术方案中, 步骤 A中所述检査设备硬件状态是指: 首先检査 Flash大小是否正确, 接着检査串口的工作是否正常。
在上述技术方案中, 如果检査不通过, 则设备结束自动烧写 状态, 熄灭指示灯, 设备串口打印出错信息。
在上述技术方案中,步骤 B中所述获取 Mac地址和 IP地址的 过程如下: 设备向服务器发送要求分配 Mac地址和 IP地址的请求 包,服务器收到请求包后,査找服务器的 Mac地址表和 IP地址表, 依次给设备分配 Mac地址和 IP地址, 并以回包的形式告知设备, 设备收到回包后, 从回包中提取 M a c地址和 I P地址。
在上述技术方案中, 步骤 B还包括以下步骤: 检査 Mac地址 和 IP地址的合法性, 如果合法, 则保存 Mac地址和 IP地址, 并 回包告知服务器该 Mac地址和 IP地址已经被占用; 否则, 丢弃不 合法的 Mac地址和 IP地址所在的包, 再次给服务器发送请求包, 服务器再次査表后给设备分配 Mac地址和 IP地址; 如果超过 10 次还不能获取正确的 Mac地址和 IP地址, 则熄灭指示灯, 表示 Flash烧写不成功。
在上述技术方案中, 步骤 C 中所述检査软件的合法性是指: 检査软件的版本号、 循环冗余校验和文件长度是否正确。
在上述技术方案中, 步骤 B中所述服务器中保存有 Mac地址 表和 IP地址表, 每个地址都有三种状态: 未被分配状态、 已被分 配但未确认占用状态、 已经占用状态, 其中只有处于未被分配状 态的地址可分配给设备, 其余两种状态的地址不能再次被分配。
在上述技术方案中, 步骤 D还包括以下步骤: 如果运行正确, 则设备发包给服务器, 告知服务器烧写完成, 服务器释放被占用 的 IP地址, 将其转换为未被分配状态。
在上述技术方案中, 步骤 A之前还包括步骤: 设备上电后, 进入倒计时状态, 判断是否有键盘输入, 如果是, 则进入手动配 置烧写模式; 否则, 设备触发自动烧写模式。
在上述技术方案中, 步骤 A中设备触发自动烧写模式后, 将 设备指示灯设为慢闪, 表示设备处于自动烧写状态; 步骤 D中清 除临时配置后, 将设备指示灯设为常亮, 表示自动烧写成功。
与现有技术相比, 本发明的优点如下:
( 1 ) 本发明提供的批量烧写 Flash 的方法, 在无需人工干预的 情况下, 能够实现快速、 可靠的自动批量分配设备的 Mac地址, 烧 写单盘的 Flash应用软件, 检査软件烧写的正确性。
(2)本发明具有问题定位功能, 一旦升级失败或者出现错误时, 设备自动打印错误信息, 告知操作人员升级进行到哪一步, 以及出错 的原因, 便于操作人员迅速定位问题, 解决问题, 提高了车间生产的 效率。
(3 ) 本发明提供了一套完整、 实用的 Flash烧写方案, 可根据 需要选择手动烧写模式或者自动烧写模式,手动烧写模式适用于设备 较少情况, 自动烧写模式适用于大量设备的批量烧写, 多个设备可以 共用一个服务器分别烧写, 设备之间烧写互不干扰, 提高了设备的烧 写效率。 附图说明
图 1为本发明: ;施例中方法的流程图;
图 2为本发明: ;施例中地址的状态转换示意图;
图 3为本发明: ;施例中设备上电自检的流程图;
图 4为本发明: ;施例中 MAC地址和 IP地址的分配流程图; 图 5为本发明: ;施例中 FTP下载烧写的流程图。 具体实施方式
下面结合附图及实施例对本发明作进一步的详细描述。
为满足用户不同的需求, 本发明实施例的 Flash烧写方法提供了 手动配置烧写模式和自动烧写模式两种。手动模式适用于单个设备的 烧写以及定位问题所用。 自动模式适用于批量烧写, 且各个设备烧写 可以分别进行, 互不干扰。
参见图 1所示,本发明实施例提供的自动批量烧写 Flash的方法, 包括以下步骤:
步骤 101 : 设备上电运行。
步骤 102: 进入倒计时状态, 等待用户选择自动烧写模式。
步骤 103 : 判断是否有键盘输入, 如果是, 则转到步骤 104; 否 则转到步骤 105。
步骤 104: 当设备串口有键盘输入时,就判定为手动配置烧写模 式,该模式下设备 Mac地址的配置及 Flash的烧写都有人工手动完成: 操作人员首先要知道该设备允许分配的 Mac地址及 IP地址, 然后手 动配置设备的 Mac地址及 IP地址, 再从服务器下载软件进行烧写, 烧写完成后, 通过人工观察软件的运行情况来判断是否烧写正确。
步骤 105 : 当倒计时结束后, 没有键盘输入, 就触发自动烧写模 式, 将设备指示灯置为慢闪状态, 表示设备正处于 Flash的自动烧写 状态, 接着程序完成硬件的检测, 即检测设备的串口工作是否正常,
Flash 大小是否正确, 是否能够正确读写。 如果检测不通过, 就熄灭 指示灯, 设备串口打印出错信息。 自动烧写模式下设备 Mac地址和 IP地址的分配, 软件版本的检测及烧写全部由设备自动完成。
步骤 106: 设备自动从服务器获取 Mac地址和 IP地址, 并且检 査 Mac地址和 IP地址是否合法, 如果合法, 则将 Mac地址保存为设 备的出厂 Mac地址,将 IP地址作为设备的临时下载专用 IP地址, 使 用后删除。如果不合法就丢弃这个包,设备再次给服务器发送请求包, 服务器再次査表后给设备分配 Mac地址和 IP地址。 如果超过 10次 还不能获取到正确的 Mac地址和 IP地址,就熄灭指示灯, Flash烧写 不成功。
步骤 107 : 服务器自动给设备分配烧写程序的临时下载专用 IP 地址。
服务器里保存有两张地址表: Mac地址表和 IP地址表, 参见图 2所示, 每个地址都有三种状态: 未被分配状态、 已被分配但未确认 占用状态和已经占用状态,这三种状态中只有未被分配状态的地址可 以用来分配给设备, 其他两种状态的地址不能再次被分配。地址的三 种状态在满足条件的情况下可以发生转换,服务器根据这两张地址表 保证 Mac地址和 IP地址能被正确分配。地址最初处于未被分配状态, 服务器收到请求后, 就会按照顺序分配地址, 这时地址就处于已经分 配, 但未被占用状态, 在规定时间内如果收到占用确认包, 服务器就 会把这个地址的状态修改为已经占用。如果在规定时间内没有收到确 认包, 设备就会认为分配不成功, 把地址的状态修改为未被分配, 这 个地址可以再次被利用。 当烧写完成后, 设备会清除自己的临时 IP 地址, 并且告知服务器烧写完成释放 IP地址, 以便 IP地址再次被分 配。 但是 Mac地址不会被释放, 这个 Mac地址要作为出厂 Mac地址 被保留, 也就是说一个 Mac地址只能被占用一次。
步骤 108:设备自动到服务器下载软件,并检査软件的合法性, 即检査软件的版本号、循环冗余校验和文件长度是否正确, 如果检 査通过, 则转到步骤 111, 否则转到步骤 109。
步骤 109: 若检査到软件不合法, 则删除 Flash的内容, 并判断 下载次数是否达到 3次,如果是,则转到步骤 110;否则返回步骤 108, 重新下载软件。
步骤 110: 清除临时配置, 熄灭指示灯, 自动烧写程序失败。 步骤 111 :若检査到软件合法,则将合法的软件写入 Flash保存, 把写入 Flash的内容与下载的软件进行比较, 如果比较结果不一致就 再次写入, 超过三次比较不通过就熄灭指示灯, 同时打印出错信息。
步骤 112: 解压写入 Flash的版本, 如果解压不正确, 就删除软 件, 再次写 Flash。 如果三次解压不成功就熄灭指示灯, 表示失败。 确定程序执行的正确性, 如果运行正确, 则给服务器发包, 告知服务 器烧写完成, 并删除设备临时用过的 IP地址, 将设备指示灯设为常 亮, 告知操作人员自动烧写成功, 以便操作人员进行下一个设备的烧 写。
如果上述步骤中的某一个步骤中出现错误, 通不过, 将不再执行 下面的步骤, 并且把指示灯熄灭, 已告知操作人员出现问题, 同时把 出错的原因打印在设备串口上。
下面就以烽火 EPON (Ethernet Passive Optical Network, 以太网 无源光网络) 5516-01设备的生产为例, 对本发明提出的 Flash烧写 方法进行详细的说明。
该设备一共有 18个槽位, 其中的 16个槽位用于 EC4B线卡。车 间里生产的 EC4B单盘里没有 Flash程序, 本发明实施例中只需要一 台服务器, 就可以完成对多台设备的自动快速烧写。
首先进行设备上电自检流程, 参见图 2所示, 具体步骤如下: 步骤 201 : 设备 EC4B上电后, 进入 3秒倒计时。
步骤 202: 判断是否有键盘输入, 如果是, 则转到步骤 203; 否 则转到步骤 204。
步骤 203 : 倒计时结束前, 如果有键盘输入, 就进入手动配置烧 写模式, 手动模式需要操作人员自己配置 Mac地址和 IP地址, 然后 烧写。
步骤 204: 判断倒计时是否结束, 如果是, 则转到步骤 205; 否 则返回步骤 202。
步骤 205: 倒计时 3秒结束后, 如果没有键盘输入, 就触发自动 烧写模式。
步骤 206:进入自动烧写模式后,首先要把指示灯置为慢闪状态, 告诉操作人员设备已经进入自动烧写模式。
步骤 207: 检査 Flash大小是否正确, 如果是, 则转到步骤 208; 否则结束自动烧写状态, 并且把指示灯熄灭, 告知操作人员设备硬件 有问题。
步骤 208: 检査串口的工作是否正常, 如果是, 则转到步骤 209; 否则结束自动烧写状态, 并且把指示灯熄灭, 告知操作人员设备硬件 有问题。 步骤 302: 设备主动发送特定广播包 (要求分配 Mac地址和 IP 地址的请求包)给服务器,告知服务器请求分配 Mac地址和 IP地址。
步骤 303:服务器收到设备的请求包后, 査找自己的 Mac地址表 和 IP地址表,按照顺序给设备分配 Mac地址和 IP地址,然后给设备 回一个配置包, 这个包里包含了服务器分给设备的 Mac地址和 IP地 址 (服务器维护了一张 Mac地址表和一张 IP地址表)。
步骤 304: 判断设备是否收到服务器的回包, 如果是, 则转到步 骤 307; 否则转到步骤 305。
步骤 305: 无回包统计计数 N加 1。
步骤 306: 判断计数 N是否大于 10, 如果是, 则转到步骤 314; 否则返回步骤 302。
步骤 307: 无回包统计计数 N清零, 设备从回包中获取分配给自 己的 Mac地址和 IP地址。
步骤 308: 判断获取的 Mac地址和 IP地址是否合法, 如果是, 则转到步骤 311 ; 否则转到步骤 309。
步骤 309: 错误计数器 i加 1。
步骤 310: 判断错误计数器 i是否大于 10, 如果是, 则转到步骤 314; 否则返回步骤 302。
步骤 311 : 检査通过, 错误计数器 i清零, 将合法的 Mac地址写 进 Flash作为设备的出场 Mac地址, 将合法的 IP地址作为设备下载 软件的临时 IP地址。
步骤 312: 设备回包告诉服务器这个 Mac地址已经被占用。
步骤 313: 服务器会把这个 Mac地址标记为已被占用,避免相同 的地址多次被分配。
步骤 314: 熄灭指示灯。 当设备分配到了 Mac地址和 IP地址之后, 开始下载软件, 参见 图 5所示, 具体流程如下:
步骤 401 : 程序下载开始。
步骤 402: 分配下载内存。
步骤 403: 将下载计数清零。
步骤 404:判断下载次数是否达到 5次,如果是, J转到步骤 414; 否则转到步骤 405。 每次升级失败后, 计数器就会 ί 1, 如果 5次下 载都失败, 就退出升级, 认为升级失败。
步骤 405: 填写 FTP (File Transfer Protocol, 文件传输协议) 参 数, 并创建 FTP会话, 进行程序的下载。
步骤 406: 判断 FTP通信是否正常, 如果是, 则转到步骤 407; 否则返回步骤 404。
步骤 407: 判断 FTP会话是否完成, 如果是, 则转到步骤 408; 否则返回步骤 406。
步骤 408: 结束 FTP会话, 程序下载完成。
步骤 409: 进行合法性检査, 判断下载的程序是否合法, 例如, 软件版本号是否正确, CRC (Cyclic Redundancy Check, 循环冗余校 验)校验是否正确, 文件大小是否正确等, 如果是, 则转到步骤 410; 否则返回步骤 404。
步骤 410: 检査通过后, 烧写 FTP文件到 Flash。
步骤 411 : 判断烧写的结果和 FTP文件是否一致, 如果是, 则转 到步骤 413; 否则转到步骤 412。
步骤 412: 删除烧写的文件, 返回步骤 404。
步骤 413 : 进行解压测试, 判断运行是否正确, 如果是, 则转到 步骤 414; 否则转到步骤 412。 如果解压失败, 也需删除烧写的文件, 重新下载。
步骤 414: 释放原来开辟的内存, FTP下载烧写完成。
烧写结束后, 设备解压软件, 如果运行正确, 设备就发包给服务 器, 告知服务器烧写完成, 服务器释放已被占用的 IP地址, 转换为 未被分配状态, 同时设备删除临时专用的 IP地址, 保留 Mac地址做 为设备的出厂 Mac地址, 点亮指示灯以告知操作人员烧写完成。
本发明实施例中, 如果操作人员选择自动烧写模式, 操作人员只 用不断的更换设备, 就可以完成指定软件及 Mac地址的烧写, 通过 观察指示灯的状态, 就能知道烧写是否完成, 对于烧写出错的板子, 串口还打印出了错误信息, 帮助操作人员定位问题, 因此, 本发明实 施例的方法不但节省了物力和人力资源, 而且提高了生产效率。
显然,本领域的技术人员可以对本发明进行各种改动和变型而不 脱离本发明的精神和范围。这样, 倘若本发明的这些修改和变型属于 本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些 改动和变型在内。
本说明书中未作详细描述的内容属于本领域专业技术人员公知 的现有技术。

Claims

权 利 要 求 书
1、 一种自动批量烧写 Flash的方法, 其特征在于包括以下步骤:
A、 设备上电进入倒计时状态, 待设备触发自动烧写模式, 检査 设备硬件状态;
B、 设备自动从服务器获取 Mac地址和 IP地址, 检査 Mac地址 和 IP地址的合法性, 如果合法, 则将 Mac地址作为设备的出厂 Mac 地址, 将 IP地址作为设备的临时下载专用 IP地址, 使用后删除;
C、 设备自动到服务器下载软件, 并检査软件的合法性, 如果合 法, 则将该软件写入 Flash; 否则删除 Flash内容, 重新下载软件;
D、 解压并运行应用程序, 确定程序运行的正确性, 如果运行正 确, 则清除临时配置, 自动烧写成功。
2、 如权利要求 1所述的自动批量烧写 Flash的方法, 其特征在 于, 步骤 A中所述检査设备硬件状态是指: 首先检査 Flash大小是否 正确, 接着检査串口的工作是否正常。
3、 如权利要求 2所述的自动批量烧写 Flash的方法, 其特征在 于: 如果检査不通过, 则设备结束自动烧写状态, 熄灭指示灯, 设备 串口打印出错信息。
4、 如权利要求 1所述的自动批量烧写 Flash的方法, 其特征在 于, 步骤 B中所述获取 Mac地址和 IP地址的过程如下: 设备向服务 器发送要求分配 Mac地址和 IP地址的请求包,服务器收到请求包后, 査找服务器的 Mac地址表和 IP地址表,依次给设备分配 Mac地址和 IP地址, 并以回包的形式告知设备, 设备收到回包后, 从回包中提取 Mac地址和 IP地址。
5、 如权利要求 4所述的自动批量烧写 Flash的方法, 其特征在 于, 步骤 B还包括以下步骤: 检査 Mac地址和 IP地址的合法性, 如 果合法, 则保存 Mac地址和 IP地址, 并回包告知服务器该 Mac地址 和 IP地址已经被占用; 否则,丢弃不合法的 Mac地址和 IP地址所在 的包, 再次给服务器发送请求包, 服务器再次査表后给设备分配 Mac 地址和 IP地址; 如果超过 10次还不能获取正确的 Mac地址和 IP地 址, 则熄灭指示灯, 表示 Flash烧写不成功。
6、 如权利要求 1所述的自动批量烧写 Flash的方法, 其特征在 于, 步骤 C 中所述检査软件的合法性是指: 检査软件的版本号、 循 环冗余校验和文件长度是否正确。
7、 如权利要求 1所述的自动批量烧写 Flash的方法, 其特征在 于: 步骤 B中所述服务器中保存有 Mac地址表和 IP地址表, 每个地 址都有三种状态: 未被分配状态、 已被分配但未确认占用状态、 已经 占用状态, 其中只有处于未被分配状态的地址可分配给设备, 其余两 种状态的地址不能再次被分配。
8、 如权利要求 7所述的自动批量烧写 Flash的方法, 其特征在 于, 步骤 D还包括以下步骤: 如果运行正确, 则设备发包给服务器, 告知服务器烧写完成, 服务器释放被占用的 IP地址, 将其转换为未 被分配状态。
9、 如权利要求 1所述的自动批量烧写 Flash的方法, 其特征在 于, 步骤 A之前还包括步骤: 设备上电后, 进入倒计时状态, 判断 是否有键盘输入, 如果是, 则进入手动配置烧写模式; 否则, 设备触 发自动烧写模式。
10、如权利要求 1至 9任一项所述的自动批量烧写 Flash的方法, 其特征在于, 步骤 A 中设备触发自动烧写模式后, 将设备指示灯设 为慢闪, 表示设备处于自动烧写状态; 步骤 D 中清除临时配置后, 将设备指示灯设为常亮, 表示自动烧写成功。
PCT/CN2012/079874 2011-10-14 2012-08-09 自动批量烧写flash的方法 WO2013053262A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2011103104579A CN102368218A (zh) 2011-10-14 2011-10-14 自动批量烧写Flash的方法
CN201110310457.9 2011-10-14

Publications (1)

Publication Number Publication Date
WO2013053262A1 true WO2013053262A1 (zh) 2013-04-18

Family

ID=45760783

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/079874 WO2013053262A1 (zh) 2011-10-14 2012-08-09 自动批量烧写flash的方法

Country Status (2)

Country Link
CN (1) CN102368218A (zh)
WO (1) WO2013053262A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105630495A (zh) * 2015-12-23 2016-06-01 深圳市科陆电子科技股份有限公司 烧录芯片方法及系统
CN112558996A (zh) * 2020-12-24 2021-03-26 中国航空工业集团公司西安航空计算技术研究所 一种自动化固化控制方法
CN113190259A (zh) * 2021-05-18 2021-07-30 宁波奥克斯电气股份有限公司 数据烧写方法、装置、互联网模组及存储介质

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102368218A (zh) * 2011-10-14 2012-03-07 烽火通信科技股份有限公司 自动批量烧写Flash的方法
CN103677885B (zh) * 2012-09-21 2019-03-05 厦门雅迅网络股份有限公司 一种arm flash简易程序烧写的方法
CN103914324B (zh) * 2013-01-08 2017-06-16 海尔集团公司 一种自动烧写嵌入式设备固件的方法及其系统
CN103699452A (zh) * 2013-11-29 2014-04-02 四川长虹电器股份有限公司 一种实现自动烧写eeprom的方法
CN104954502A (zh) * 2014-03-31 2015-09-30 研祥智能科技股份有限公司 生产线中的mac地址更新方法和系统
CN105068829A (zh) * 2015-07-28 2015-11-18 深圳Tcl数字技术有限公司 特征数据烧录方法、装置及系统
CN105354106A (zh) * 2015-10-29 2016-02-24 惠州市蓝微电子有限公司 一种无刷电机控制管理ic的烧录防错方法
CN109120422B (zh) * 2017-06-23 2021-12-24 佛山市顺德区顺达电脑厂有限公司 可取得硬件信息的远程服务器系统及其管理方法
CN111158710B (zh) * 2019-12-30 2023-08-25 杭州迪普科技股份有限公司 程序烧写方法、装置及网络设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20030053280A (ko) * 2001-12-22 2003-06-28 주식회사 케이티 공중 무선랜 서비스를 위한 망접속 및 서비스 등록 방법
CN1635480A (zh) * 2003-12-30 2005-07-06 鸿富锦精密工业(深圳)有限公司 媒体接入控制地址烧录方法
CN101674303A (zh) * 2009-07-31 2010-03-17 厦门敏讯信息技术股份有限公司 嵌入式网络产品烧写设备及方法
CN101788945A (zh) * 2010-02-04 2010-07-28 电子科技大学 一种多电路板或多模块电子系统的诊断测试系统及方法
CN102368218A (zh) * 2011-10-14 2012-03-07 烽火通信科技股份有限公司 自动批量烧写Flash的方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20030053280A (ko) * 2001-12-22 2003-06-28 주식회사 케이티 공중 무선랜 서비스를 위한 망접속 및 서비스 등록 방법
CN1635480A (zh) * 2003-12-30 2005-07-06 鸿富锦精密工业(深圳)有限公司 媒体接入控制地址烧录方法
CN101674303A (zh) * 2009-07-31 2010-03-17 厦门敏讯信息技术股份有限公司 嵌入式网络产品烧写设备及方法
CN101788945A (zh) * 2010-02-04 2010-07-28 电子科技大学 一种多电路板或多模块电子系统的诊断测试系统及方法
CN102368218A (zh) * 2011-10-14 2012-03-07 烽火通信科技股份有限公司 自动批量烧写Flash的方法

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105630495A (zh) * 2015-12-23 2016-06-01 深圳市科陆电子科技股份有限公司 烧录芯片方法及系统
CN112558996A (zh) * 2020-12-24 2021-03-26 中国航空工业集团公司西安航空计算技术研究所 一种自动化固化控制方法
CN112558996B (zh) * 2020-12-24 2023-08-04 中国航空工业集团公司西安航空计算技术研究所 一种自动化固化控制方法
CN113190259A (zh) * 2021-05-18 2021-07-30 宁波奥克斯电气股份有限公司 数据烧写方法、装置、互联网模组及存储介质
CN113190259B (zh) * 2021-05-18 2024-04-16 宁波奥克斯电气股份有限公司 数据烧写方法、装置、互联网模组及存储介质

Also Published As

Publication number Publication date
CN102368218A (zh) 2012-03-07

Similar Documents

Publication Publication Date Title
WO2013053262A1 (zh) 自动批量烧写flash的方法
CN106453678B (zh) Ip地址配置方法和系统
WO2019184164A1 (zh) 自动部署Kubernetes从节点的方法、装置、终端设备及可读存储介质
CN109951325B (zh) 一种网络线缆连接检查方法和装置
CN109039788B (zh) 网络设备的端口配置方法、装置和存储介质
WO2015180292A1 (zh) 检测虚拟专用网络的用户网络侧接口连通性的方法及装置
CN108206847A (zh) Cdn管理系统、方法及装置
CN103249075B (zh) 接入点故障的检测恢复方法及装置
CN109067599B (zh) 一种部署集群的方法及装置
CN109474481B (zh) 设备部署方法和系统、网管服务器、移动终端、存储介质
CN104767649A (zh) 部署裸金属服务器的方法及装置
CN107707687A (zh) 一种虚拟机ip地址配置的方法和装置
WO2005067265A1 (en) Zero-configuring ip addresses for peer-to-peer networks
CN110716787A (zh) 容器地址设置方法、设备和计算机可读存储介质
CN102981949A (zh) 一种在线自动测试服务器的方法
BR112020015926A2 (pt) Método e aparelho de estabelecimento de múltiplos percursos
TW201426553A (zh) 虛擬機管理系統及方法
JP5686204B2 (ja) サーバ装置、情報処理システム、サーバ装置のアドレス管理方法、及びサーバ装置のアドレス管理プログラム
EP3474501B1 (en) Network device stacking
WO2015184622A1 (zh) 可靠性资源的分配方法和装置
WO2011076018A1 (zh) 实现多用户测试的方法和装置
JP5876149B2 (ja) サーバー・コンピュータを開始させるためのコンピュータ・システム、方法、サーバー・コンピュータ、管理ステーションおよび使用
WO2015021834A1 (zh) 静态路由的下发方法及靠近用户侧的提供商的边缘设备
CN105553752A (zh) 针对家庭网关在线测速的方法、测速平台及网关设备
CN100473049C (zh) 接入设备远程验证拨号用户服务代理认证的实现方法

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: 12840573

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: 12840573

Country of ref document: EP

Kind code of ref document: A1