CN107645404B - Method and device for sending and receiving repair packet and fault repair system - Google Patents
Method and device for sending and receiving repair packet and fault repair system Download PDFInfo
- Publication number
- CN107645404B CN107645404B CN201610588640.8A CN201610588640A CN107645404B CN 107645404 B CN107645404 B CN 107645404B CN 201610588640 A CN201610588640 A CN 201610588640A CN 107645404 B CN107645404 B CN 107645404B
- Authority
- CN
- China
- Prior art keywords
- address
- embedded device
- faulty embedded
- faulty
- new
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Small-Scale Networks (AREA)
Abstract
本发明实施例公开了一种修复包发送、接收方法及装置和故障修复系统,发送方法包括:服务器接收至少一个故障嵌入式设备发送的包括故障嵌入式设备的原IP地址的设备信息;获得为每个故障嵌入式设备分配的新IP地址;发送修改指令至每个故障嵌入式设备,以使每个故障嵌入式设备从修改指令中获得针对自身的新IP地址后,用新IP地址与服务器直连;接收所有故障嵌入式设备发送的修复请求;发送与修复请求对应的修复包至所有故障嵌入式设备,以使所有故障嵌入式设备完成故障修复。应用本发明实施例以实现故障嵌入式设备与服务器的快速直连,进一步实现故障嵌入式设备的故障的快速修复。
The embodiment of the present invention discloses a method and device for sending and receiving a repair package, and a fault repair system. The sending method includes: the server receives the device information including the original IP address of the faulty embedded device sent by at least one faulty embedded device; The new IP address assigned by each faulty embedded device; send a modification instruction to each faulty embedded device, so that each faulty embedded device obtains a new IP address for itself from the modification instruction, and uses the new IP address to communicate with the server. Direct connection; receive repair requests sent by all faulty embedded devices; send repair packages corresponding to the repair requests to all faulty embedded devices, so that all faulty embedded devices complete fault repair. The embodiments of the present invention are applied to realize the fast direct connection between the faulty embedded device and the server, and further realize the rapid repair of the fault of the faulty embedded device.
Description
技术领域technical field
本发明涉及设备故障处理技术领域,特别涉及一种修复包发送、接收方法及装置和故障修复系统。The invention relates to the technical field of equipment fault handling, in particular to a method and device for sending and receiving repair packets and a fault repair system.
背景技术Background technique
嵌入式设备在发生故障后,如故障为主程序损坏,需要对故障的嵌入式设备进行修复。目前常见的修复方式是:故障嵌入式设备通过U-Boot(Universal Boot Loader)向服务器申请下载修复包以完成修复,其中,该U-Boot为嵌入式设备的引导程序,该服务器可以为TFTP(Trivial File Transfer Protocol,简单文件传输协议)。After the embedded device fails, if the main program is damaged, the faulty embedded device needs to be repaired. The current common repair method is: the faulty embedded device applies to the server to download the repair package through U-Boot (Universal Boot Loader) to complete the repair, wherein the U-Boot is the boot program of the embedded device, and the server can be TFTP ( Trivial File Transfer Protocol).
在这种情况下,要求故障嵌入式设备必须能够直连服务器,也就是要求故障嵌入式设备与服务器处于同一网段中。目前,是由管理人员通过每条故障嵌入式设备的串口,逐一将每台故障嵌入式设备的IP地址修改为与服务器处于同一网段的IP地址,以实现故障嵌入式设备与服务器直连,进而完成故障嵌入式设备的故障修复。In this case, it is required that the faulty embedded device must be able to directly connect to the server, that is, the faulty embedded device and the server are required to be in the same network segment. At present, through the serial port of each faulty embedded device, the administrator changes the IP address of each faulty embedded device one by one to the IP address in the same network segment as the server, so as to realize the direct connection between the faulty embedded device and the server. Then the fault repair of the faulty embedded device is completed.
由于现有技术中,是通过人工方式逐一来修改故障嵌入式设备的IP地址。因此,当出现大量的嵌入式设备出现故障时,对所有故障的嵌入式设备修改IP地址就会占用很长的时间,导致不能及时实现故障嵌入式设备与服务器的直连,进而导致故障嵌入式设备的故障不能及时修复。Because in the prior art, the IP addresses of the faulty embedded devices are modified one by one manually. Therefore, when a large number of embedded devices fail, it will take a long time to modify the IP addresses of all the failed embedded devices, resulting in the failure to realize the direct connection between the failed embedded devices and the server in time, which in turn leads to the failure of embedded devices. Equipment failures cannot be repaired in time.
发明内容SUMMARY OF THE INVENTION
本发明实施例公开了一种修复包发送、接收方法及装置和故障修复系统,以实现故障嵌入式设备与服务器的快速直连,进一步实现故障嵌入式设备的故障的快速修复。具体方案如下:The embodiment of the invention discloses a method and device for sending and receiving a repair package and a fault repair system, so as to realize the fast direct connection between the faulty embedded device and the server, and further realize the rapid repair of the fault of the faulty embedded device. The specific plans are as follows:
一方面,本发明实施例提供了一种修复包发送方法,所述方法包括:On the one hand, an embodiment of the present invention provides a method for sending a repair packet, the method comprising:
接收至少一个故障嵌入式设备发送的设备信息,所述设备信息中包括故障嵌入式设备的原IP地址;Receive device information sent by at least one faulty embedded device, where the device information includes the original IP address of the faulty embedded device;
获得为每个故障嵌入式设备分配的新IP地址;Obtain a new IP address assigned to each faulty embedded device;
发送修改指令至每个故障嵌入式设备,以使每个故障嵌入式设备从所述修改指令中获得针对自身的新IP地址后,用新IP地址与服务器直连,其中,所述修改指令携带所分配的新IP地址;Send a modification instruction to each faulty embedded device, so that after each faulty embedded device obtains a new IP address for itself from the modification instruction, use the new IP address to directly connect with the server, wherein the modification instruction carries the new IP address assigned;
接收所有故障嵌入式设备发送的修复请求;Receive repair requests sent by all faulty embedded devices;
发送与所述修复请求对应的修复包至所有故障嵌入式设备,以使所有故障嵌入式设备完成故障修复。Send a repair package corresponding to the repair request to all faulty embedded devices, so that all faulty embedded devices complete fault repair.
可选的,在所述接收至少一个故障嵌入式设备发送的设备信息之后,所述方法还包括:Optionally, after receiving the device information sent by the at least one faulty embedded device, the method further includes:
依据所述设备信息,从所述至少一个故障嵌入式设备中,确定所有第一故障嵌入式设备,其中,所述第一故障嵌入式设备为原IP地址与所述服务器不在同一网段的故障嵌入式设备;According to the device information, from the at least one faulty embedded device, determine all first faulty embedded devices, wherein the first faulty embedded device is a fault whose original IP address is not in the same network segment as the server embedded device;
所述获得为每个故障嵌入式设备分配的新IP地址,包括:Said obtaining a new IP address assigned to each faulty embedded device, including:
获得为每个第一故障嵌入式设备分配的新IP地址。Obtain a new IP address assigned to each first failed embedded device.
可选的,在所述发送修改指令至每个故障嵌入式设备之前,所述方法还包括:Optionally, before the sending the modification instruction to each faulty embedded device, the method further includes:
根据所述设备信息,判断所对应故障嵌入式设备是否支持多播;According to the device information, determine whether the corresponding faulty embedded device supports multicast;
当所对应故障嵌入式设备支持多播时,所述发送修改指令至每个故障嵌入式设备为:多播所对应故障嵌入式设备的修改指令;When the corresponding faulty embedded device supports multicast, the sending the modification instruction to each faulty embedded device is: multicasting the modification instruction of the corresponding faulty embedded device;
当所对应故障嵌入式设备不支持多播时,所述发送修改指令至每个故障嵌入式设备为:广播所对应故障嵌入式设备的修改指令。When the corresponding faulty embedded device does not support multicast, the sending the modification instruction to each faulty embedded device is: broadcasting the modification instruction of the corresponding faulty embedded device.
可选的,所述设备信息还包括故障嵌入式设备的MAC地址;Optionally, the device information further includes the MAC address of the faulty embedded device;
所述发送修改指令至每个故障嵌入式设备,包括:The sending of modification instructions to each faulty embedded device includes:
分别发送携带每个故障嵌入式设备的MAC地址及对应分配的新IP地址的修改指令,至每个故障嵌入式设备;Send a modification instruction carrying the MAC address of each faulty embedded device and the corresponding new IP address assigned to each faulty embedded device;
所述针对自身的新IP地址为:针对自身的MAC地址的新IP地址。The new IP address for the self is: a new IP address for the MAC address of the self.
可选的,所述设备信息还包括故障嵌入式设备的MAC地址;Optionally, the device information further includes the MAC address of the faulty embedded device;
在所述接收所有故障嵌入式设备发送的修复请求之前,所述方法还包括:Before receiving the repair requests sent by all faulty embedded devices, the method further includes:
接收所述至少一个故障嵌入式设备广播的ARP信息;receiving ARP information broadcast by the at least one faulty embedded device;
存储所述ARP信息中所携带的所对应故障嵌入式设备的MAC地址与所述新IP地址的对应关系。The corresponding relationship between the MAC address of the corresponding faulty embedded device and the new IP address carried in the ARP information is stored.
一方面,本发明实施例提供了一种修复包接收方法,所述方法包括:On the one hand, an embodiment of the present invention provides a method for receiving repair packets, the method comprising:
发送设备信息至服务器,所述设备信息中包括故障嵌入式设备的原IP地址;Send device information to the server, where the device information includes the original IP address of the faulty embedded device;
接收所述服务器发送的修改指令,其中,所述修改指令中携带所分配的新IP地址,所述新IP地址为所述服务器分配的地址;Receive the modification instruction sent by the server, wherein the modification instruction carries the assigned new IP address, and the new IP address is the address assigned by the server;
修改所述故障嵌入式设备的原IP地址为所对应的新IP地址,以用所述新IP地址与所述服务器直连;Modify the original IP address of the faulty embedded device to the corresponding new IP address, so as to use the new IP address to directly connect with the server;
发送修复请求至所述服务器;sending a repair request to the server;
接收所述服务器发送的与所述修复请求对应的修复包,完成故障修复。The repair package corresponding to the repair request sent by the server is received, and the fault repair is completed.
可选的,所述修改指令中还携带所述故障嵌入式设备的MAC地址;Optionally, the modification instruction also carries the MAC address of the faulty embedded device;
所述修改所述故障嵌入式设备的原IP地址为所对应的新IP地址,包括:The modification of the original IP address of the faulty embedded device to the corresponding new IP address includes:
修改所述故障嵌入式设备的原IP地址为自身的MAC地址所对应的新IP地址。Modify the original IP address of the faulty embedded device to a new IP address corresponding to its own MAC address.
可选的,所述修改指令中还携带所述故障嵌入式设备的MAC地址;Optionally, the modification instruction also carries the MAC address of the faulty embedded device;
在所述发送修复请求至所述服务器之前,所述方法还包括:Before the sending the repair request to the server, the method further includes:
广播携带所述故障嵌入式设备的MAC地址与所述新IP地址的对应关系的地址解析协议ARP信息,以使所述服务器接收所述ARP信息后,存储所述故障嵌入式设备的MAC地址与所述新IP地址的对应关系。Broadcast the address resolution protocol ARP information that carries the correspondence between the MAC address of the faulty embedded device and the new IP address, so that after receiving the ARP information, the server stores the MAC address of the faulty embedded device and the new IP address. The corresponding relationship of the new IP address.
一方面,本发明实施例提供了一种修复包发送装置,所述装置包括:第一接收模块、获得模块、第一发送模块、第二接收模块和第二发送模块;In one aspect, an embodiment of the present invention provides an apparatus for sending repair packets, the apparatus includes: a first receiving module, an obtaining module, a first sending module, a second receiving module, and a second sending module;
所述第一接收模块,用于接收至少一个故障嵌入式设备发送的设备信息,所述设备信息中包括故障嵌入式设备的原IP地址;The first receiving module is configured to receive device information sent by at least one faulty embedded device, where the device information includes the original IP address of the faulty embedded device;
所述获得模块,用于获得为每个故障嵌入式设备分配的新IP地址;The obtaining module is used to obtain a new IP address allocated for each faulty embedded device;
所述第一发送模块,用于发送修改指令至每个故障嵌入式设备,以使每个故障嵌入式设备从所述修改指令中获得针对自身的新IP地址后,用新IP地址与服务器直连,其中,所述修改指令携带所分配的新IP地址;The first sending module is configured to send a modification instruction to each faulty embedded device, so that after each faulty embedded device obtains a new IP address for itself from the modification instruction, use the new IP address to communicate directly with the server. connected, wherein the modification instruction carries the assigned new IP address;
所述第二接收模块,用于接收所有故障嵌入式设备发送的修复请求;The second receiving module is configured to receive repair requests sent by all faulty embedded devices;
所述第二发送模块,用于发送与所述修复请求对应的修复包至所有故障嵌入式设备,以使所有故障嵌入式设备完成故障修复。The second sending module is configured to send a repair package corresponding to the repair request to all the faulty embedded devices, so that all the faulty embedded devices complete the fault repair.
可选的,所述装置还包括确定模块;Optionally, the device further includes a determining module;
所述确定模块,用于在所述接收至少一个故障嵌入式设备发送的设备信息之后,依据所述设备信息,从所述至少一个故障嵌入式设备中,确定所有第一故障嵌入式设备,其中,所述第一故障嵌入式设备为原IP地址与所述服务器不在同一网段的故障嵌入式设备;The determining module is configured to, after receiving the device information sent by the at least one faulty embedded device, determine all the first faulty embedded devices from the at least one faulty embedded device according to the device information, wherein , the first faulty embedded device is a faulty embedded device whose original IP address is not in the same network segment as the server;
所述获得模块,具体用于获得为每个第一故障嵌入式设备分配的新IP地址。The obtaining module is specifically configured to obtain a new IP address allocated for each first faulty embedded device.
可选的,所述装置还包括判断模块;Optionally, the device further includes a judgment module;
所述判断模块,用于在所述发送修改指令至每个故障嵌入式设备之前,根据所述设备信息,判断所对应故障嵌入式设备是否支持多播;The judging module is used to judge whether the corresponding faulty embedded device supports multicast according to the device information before the modification instruction is sent to each faulty embedded device;
所述第一发送模块,具体用于当所对应故障嵌入式设备支持多播时,多播所对应故障嵌入式设备的修改指令;当所对应故障嵌入式设备不支持多播时,广播所对应故障嵌入式设备的修改指令。The first sending module is specifically used for multicasting the modification instruction of the corresponding faulty embedded device when the corresponding faulty embedded device supports multicasting; when the corresponding faulty embedded device does not support multicasting, broadcasting the corresponding faulty embedded device Modification instructions for type equipment.
可选的,所述设备信息还包括故障嵌入式设备的MAC地址;Optionally, the device information further includes the MAC address of the faulty embedded device;
所述第一发送模块,具体用于分别发送携带每个故障嵌入式设备的MAC地址及对应分配的新IP地址的修改指令,至每个故障嵌入式设备;The first sending module is specifically configured to send a modification instruction carrying the MAC address of each faulty embedded device and the correspondingly allocated new IP address to each faulty embedded device;
所述针对自身的新IP地址为:针对自身的MAC地址的新IP地址。The new IP address for the self is: a new IP address for the MAC address of the self.
可选的,所述设备信息还包括故障嵌入式设备的MAC地址;Optionally, the device information further includes the MAC address of the faulty embedded device;
所述装置还包括第三接收模块和存储模块;The device also includes a third receiving module and a storage module;
所述第三接收模块,用于接收所述至少一个故障嵌入式设备广播的ARP信息;the third receiving module, configured to receive the ARP information broadcast by the at least one faulty embedded device;
所述存储模块,用于存储所述ARP信息中所携带的所对应故障嵌入式设备的MAC地址与所述新IP地址的对应关系。The storage module is configured to store the correspondence between the MAC address of the corresponding faulty embedded device carried in the ARP information and the new IP address.
一方面,本发明实施例提供了一种修复包接收装置,所述装置包括:第三发送模块、第四接收模块、修改模块、第四发送模块和第五接收模块;In one aspect, an embodiment of the present invention provides an apparatus for receiving repair packets, the apparatus including: a third sending module, a fourth receiving module, a modifying module, a fourth sending module, and a fifth receiving module;
所述第三发送模块,用于发送设备信息至服务器,所述设备信息中包括故障嵌入式设备的原IP地址;The third sending module is configured to send device information to the server, where the device information includes the original IP address of the faulty embedded device;
所述第四接收模块,用于接收所述服务器发送的修改指令,其中,所述修改指令中携带所分配的新IP地址,所述新IP地址为所述服务器分配的地址;The fourth receiving module is configured to receive a modification instruction sent by the server, wherein the modification instruction carries the assigned new IP address, and the new IP address is the address assigned by the server;
所述修改模块,用于修改所述故障嵌入式设备的原IP地址为所对应的新IP地址,以用所述新IP地址与所述服务器直连;The modification module is used to modify the original IP address of the faulty embedded device to be the corresponding new IP address, so as to use the new IP address to directly connect with the server;
所述第四发送模块,用于发送修复请求至所述服务器;the fourth sending module, configured to send a repair request to the server;
所述第五接收模块,用于接收所述服务器发送的与所述修复请求对应的修复包,完成故障修复。The fifth receiving module is configured to receive a repair package corresponding to the repair request sent by the server, and complete fault repair.
可选的,所述修改指令中还携带所述故障嵌入式设备的MAC地址;Optionally, the modification instruction also carries the MAC address of the faulty embedded device;
所述修改模块,具体用于修改所述故障嵌入式设备的原IP地址为自身的MAC地址所对应的新IP地址。The modification module is specifically configured to modify the original IP address of the faulty embedded device to be a new IP address corresponding to its own MAC address.
可选的,所述修改指令中还携带所述故障嵌入式设备的MAC地址;Optionally, the modification instruction also carries the MAC address of the faulty embedded device;
所述装置还包括广播模块;The device also includes a broadcast module;
所述广播模块,用于在所述发送修复请求至所述服务器之前,广播携带所述故障嵌入式设备的MAC地址与所述新IP地址的对应关系的地址解析协议ARP信息,以使所述服务器接收所述ARP信息后,存储所述故障嵌入式设备的MAC地址与所述新IP地址的对应关系。The broadcast module is configured to broadcast the address resolution protocol ARP information carrying the correspondence between the MAC address of the faulty embedded device and the new IP address before the repair request is sent to the server, so that the After receiving the ARP information, the server stores the correspondence between the MAC address of the faulty embedded device and the new IP address.
另一方面,本发明实施例提供了一种故障修复系统,所述系统包括:On the other hand, an embodiment of the present invention provides a fault repair system, the system includes:
故障嵌入式设备,用于发送设备信息至服务器,所述设备信息中包括故障嵌入式设备的原IP地址;The faulty embedded device is used to send device information to the server, where the device information includes the original IP address of the faulty embedded device;
服务器,用于接收故障嵌入式设备发送的设备信息,并获得为每个故障嵌入式设备分配的新IP地址;发送修改指令至每个故障嵌入式设备,其中,所述修改指令携带所分配的新IP地址;The server is configured to receive the device information sent by the faulty embedded device, and obtain a new IP address assigned to each faulty embedded device; send a modification instruction to each faulty embedded device, wherein the modification instruction carries the allocated new IP address;
所述故障嵌入式设备还用于接收所述服务器发送的修改指令;修改所述故障嵌入式设备的原IP地址为所对应的新IP地址,以用所述新IP地址与所述服务器直连;并发送修复请求至所述服务器;The faulty embedded device is further configured to receive a modification instruction sent by the server; modify the original IP address of the faulty embedded device to a corresponding new IP address, so as to use the new IP address to directly connect with the server ; and send a repair request to the server;
所述服务器还用于接收所有故障嵌入式设备发送的修复请求;并发送与所述修复请求对应的修复包至所有故障嵌入式设备;The server is further configured to receive repair requests sent by all faulty embedded devices; and send repair packages corresponding to the repair requests to all faulty embedded devices;
所述故障嵌入式设备还用于接收所述服务器发送的与所述修复请求对应的修复包,完成故障修复。The faulty embedded device is further configured to receive a repair package corresponding to the repair request sent by the server to complete the fault repair.
在本方案中,服务器接收至少一个故障嵌入式设备发送的包括故障嵌入式设备的原IP地址的设备信息;获得为每个故障嵌入式设备分配的新IP地址;发送修改指令至每个故障嵌入式设备,以使每个故障嵌入式设备从修改指令中获得针对自身的新IP地址后,用新IP地址与服务器直连;接收所有故障嵌入式设备发送的修复请求;发送与修复请求对应的修复包至所有故障嵌入式设备,以使所有故障嵌入式设备完成故障修复。可见,服务器可以为处于同网段和不同网段的故障嵌入式设备分配新的IP地址,以使每个故障嵌入式设备从修改指令中获得针对自身的新IP地址后,用新IP地址与服务器直连,无需通过人工方式逐一来修改故障嵌入式设备的IP地址,实现了故障嵌入式设备与服务器的快速直连,并进一步的实现了故障嵌入式设备的故障的快速修复。当然,实施本发明的任一产品或方法必不一定需要同时达到以上所述的所有优点。In this solution, the server receives device information including the original IP address of the faulty embedded device sent by at least one faulty embedded device; obtains a new IP address assigned to each faulty embedded device; sends a modification instruction to each faulty embedded device After each faulty embedded device obtains a new IP address for itself from the modification instruction, it directly connects to the server with the new IP address; receives repair requests sent by all faulty embedded devices; sends the corresponding repair request Repair package to all faulty embedded devices to make all faulty embedded devices complete fault repair. It can be seen that the server can assign new IP addresses to the faulty embedded devices in the same network segment and different network segments, so that each faulty embedded device obtains a new IP address for itself from the modification instruction, and uses the new IP address to match with the new IP address. The server is directly connected, and there is no need to manually modify the IP address of the faulty embedded device one by one, which realizes the rapid direct connection between the faulty embedded device and the server, and further realizes the rapid repair of the fault of the faulty embedded device. Of course, it is not necessary for any product or method to implement the present invention to simultaneously achieve all of the advantages described above.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that are used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative efforts.
图1为本发明实施例提供的一种修复包发送方法的流程示意图;1 is a schematic flowchart of a method for sending a repair packet according to an embodiment of the present invention;
图2为本发明实施例提供的修复包接收方法的流程示意图;2 is a schematic flowchart of a method for receiving a repair package according to an embodiment of the present invention;
图3为应用本发明实施例提供的修复包发送、接收方法进行故障修复的交互流程示意图;FIG. 3 is a schematic diagram of an interaction flow for fault repair by applying the method for sending and receiving repair packets according to an embodiment of the present invention;
图4为本发明实施例提供的一种修复包发送装置的结构示意图;FIG. 4 is a schematic structural diagram of an apparatus for sending a repair packet according to an embodiment of the present invention;
图5为本发明实施例提供的一种修复包接收装置的结构示意图;FIG. 5 is a schematic structural diagram of an apparatus for receiving a repair packet according to an embodiment of the present invention;
图6为本发明实施例提供的一种故障修复系统的结构示意图。FIG. 6 is a schematic structural diagram of a fault repair system according to an embodiment of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
本发明实施例提供了一种修复包发送、接收方法及装置和故障修复系统,以实现故障嵌入式设备与服务器的快速直连,进一步实现故障嵌入式设备的故障的快速修复。Embodiments of the present invention provide a method and device for sending and receiving repair packets, and a fault repair system, so as to realize fast direct connection between a faulty embedded device and a server, and further realize fast repair of the fault of the faulty embedded device.
下面首先对本发明实施例所提供的一种修复包发送方法进行介绍,其中,该修复包发送方法基于故障修复系统。The following first introduces a method for sending a repair package provided by an embodiment of the present invention, where the method for sending a repair package is based on a fault repair system.
如图1所示,该方法可以包括步骤:As shown in Figure 1, the method may include the steps:
S101:接收至少一个故障嵌入式设备发送的设备信息,该设备信息中包括故障嵌入式设备的原IP地址;S101: Receive device information sent by at least one faulty embedded device, where the device information includes the original IP address of the faulty embedded device;
可以理解的是,嵌入式设备通电后,通过U-boot(Universal Boot Loader)检测到自身出现故障,如主程序损坏,会通过U-boot定时或不定时的广播自身的设备信息。服务器可以接收到至少一个故障嵌入式设备广播的设备信息。进一步的,服务器可以将所接收的设备信息展示在显示界面中。其中,U-boot为一个单线程的循环程序,其可以作为嵌入式设备的引导程序。该服务器可以为TFTP服务器,可以为故障嵌入式设备提供修复包。It can be understood that, after the embedded device is powered on, it detects its own failure through U-boot (Universal Boot Loader). If the main program is damaged, it will broadcast its own device information through U-boot regularly or irregularly. The server may receive device information broadcast by at least one faulty embedded device. Further, the server may display the received device information on the display interface. Among them, U-boot is a single-threaded loop program, which can be used as a boot program for embedded devices. The server can be a TFTP server and can provide repair packages for faulty embedded devices.
S102:获得为每个故障嵌入式设备分配的新IP地址;S102: Obtain a new IP address assigned to each faulty embedded device;
需要说明的是,服务器获得为每个故障嵌入式设备分配的新IP地址,其中,该新IP地址可以是用户针对每个故障嵌入式设备,为其重新分配的。也可以是服务器针对每个故障嵌入式设备,为其重新分配的。It should be noted that the server obtains a new IP address assigned to each faulty embedded device, wherein the new IP address may be reassigned by the user for each faulty embedded device. It can also be reassigned by the server for each faulty embedded device.
S103:发送修改指令至每个故障嵌入式设备,以使每个故障嵌入式设备从该修改指令中获得针对自身的新IP地址后,用新IP地址与服务器直连,其中,该修改指令携带所分配的新IP地址;S103: Send a modification instruction to each faulty embedded device, so that each faulty embedded device obtains a new IP address for itself from the modification instruction, and uses the new IP address to directly connect with the server, wherein the modification instruction carries the new IP address assigned;
服务器可以通过现有技术发送修改指令至每个故障嵌入式设备,以使每个故障嵌入式设备通过U-boot从一个或多个修改指令获得针对自身的新IP地址,并通过U-boot修改自身的原IP地址为所获得针对自身的新IP地址,并通过新IP地址与服务器进行直连。The server can send a modification instruction to each faulty embedded device through the existing technology, so that each faulty embedded device obtains a new IP address for itself from one or more modification instructions through U-boot, and modifies it through U-boot The original IP address of itself is the new IP address obtained for itself, and it is directly connected to the server through the new IP address.
S104:接收所有故障嵌入式设备发送的修复请求;S104: Receive repair requests sent by all faulty embedded devices;
S105:发送与该修复请求对应的修复包至所有故障嵌入式设备,以使所有故障嵌入式设备完成故障修复。S105: Send a repair package corresponding to the repair request to all the faulty embedded devices, so that all the faulty embedded devices complete the fault repair.
其中,该修复请求中可以携带所对应故障嵌入式设备的设备型号等信息,以使服务器可以针对故障嵌入式设备的设备型号,发送对应的修复包至故障嵌入式设备。The repair request may carry information such as the device model of the corresponding faulty embedded device, so that the server can send a corresponding repair package to the faulty embedded device according to the device model of the faulty embedded device.
应用本发明实施例,服务器接收至少一个故障嵌入式设备发送的包括故障嵌入式设备的原IP地址的设备信息;获得为每个故障嵌入式设备分配的新IP地址;发送修改指令至每个故障嵌入式设备,以使每个故障嵌入式设备从修改指令中获得针对自身的新IP地址后,用新IP地址与服务器直连;接收所有故障嵌入式设备发送的修复请求;发送与修复请求对应的修复包至所有故障嵌入式设备,以使所有故障嵌入式设备完成故障修复。可见,服务器可以为处于同网段和不同网段的故障嵌入式设备分配新的IP地址,以使每个故障嵌入式设备从修改指令中获得针对自身的新IP地址后,用新IP地址与服务器直连,无需通过人工方式逐一来修改故障嵌入式设备的IP地址,实现了故障嵌入式设备与服务器的快速直连,并进一步的实现了故障嵌入式设备的故障的快速修复。Applying the embodiment of the present invention, the server receives device information including the original IP address of the faulty embedded device sent by at least one faulty embedded device; obtains a new IP address allocated for each faulty embedded device; sends a modification instruction to each faulty embedded device Embedded devices, so that after each faulty embedded device obtains a new IP address for itself from the modification instruction, use the new IP address to directly connect with the server; receive repair requests sent by all faulty embedded devices; send and repair requests corresponding to The repair package is sent to all faulty embedded devices, so that all faulty embedded devices can complete the fault repair. It can be seen that the server can assign new IP addresses to the faulty embedded devices in the same network segment and different network segments, so that each faulty embedded device obtains a new IP address for itself from the modification instruction, and uses the new IP address to match with the new IP address. The server is directly connected, and there is no need to manually modify the IP address of the faulty embedded device one by one, which realizes the rapid direct connection between the faulty embedded device and the server, and further realizes the rapid repair of the fault of the faulty embedded device.
并且,本发明实施例可以针对存在于同一个网段中的故障嵌入式设备,也可以针对存在于不同网段中的故障嵌入式设备。应用本发明实施例使在不同网段中,仅存在一台服务器即可,以用于为故障嵌入式设备提供修复包,无需每个网段中均部署服务器。Moreover, the embodiment of the present invention can be directed to a faulty embedded device that exists in the same network segment, or can be directed to a faulty embedded device that exists in different network segments. By applying the embodiments of the present invention, there is only one server in different network segments, which is used to provide a repair package for the faulty embedded device, and it is not necessary to deploy a server in each network segment.
在一种具体实现方式中,某些故障嵌入式设备与服务器处于同网段,可以直接与服务器实现直连,则可以无需进行IP地址的修改。为了节省服务器的资源,可以仅为与服务器处于不同网段的故障嵌入式设备分配IP地址。在所述接收至少一个故障嵌入式设备发送的设备信息之后,本发明实施例所提供的修复包发送方法还可以包括:In a specific implementation manner, some faulty embedded devices are located in the same network segment as the server, and can be directly connected to the server without modifying the IP address. To save server resources, you can assign IP addresses only to faulty embedded devices that are on different network segments from the server. After the device information sent by the at least one faulty embedded device is received, the method for sending a repair package provided by the embodiment of the present invention may further include:
依据设备信息,从该至少一个故障嵌入式设备中,确定所有第一故障嵌入式设备,其中,该第一故障嵌入式设备为原IP地址与服务器不在同一网段的故障嵌入式设备;According to the device information, from the at least one faulty embedded device, determine all first faulty embedded devices, wherein the first faulty embedded device is a faulty embedded device whose original IP address is not in the same network segment as the server;
所述获得为每个故障嵌入式设备分配的新IP地址,包括:Said obtaining a new IP address assigned to each faulty embedded device, including:
获得为每个第一故障嵌入式设备分配的新IP地址。Obtain a new IP address assigned to each first failed embedded device.
其中,服务器可以根据设备信息中所携带的故障嵌入式设备的原IP地址,以及自身的IP地址,从该至少一个故障嵌入式设备中,确定出原IP地址与自身不在同一网段的所有第一故障嵌入式设备,并进行后续的流程。另外的,用户在服务器的显示界面上可以查看到至少一个故障嵌入式设备发送的设备信息,可以理解的,确定与服务器不在同一网段的所有第一故障嵌入式设备的步骤,也可以通过用户在界面上筛选后输入到服务器。The server can, according to the original IP address of the faulty embedded device carried in the device information, and its own IP address, from the at least one faulty embedded device, determine all the first IP addresses that are not in the same network segment as itself. A fault embedded device, and the subsequent process. In addition, the user can view the device information sent by at least one faulty embedded device on the display interface of the server. It is understandable that the step of determining all the first faulty embedded devices that are not in the same network segment as the server can also be performed by the user. Input to the server after filtering on the interface.
另外,当故障嵌入式设备与服务器在同一网段时,服务器可以与该故障嵌入式设备直接进行直连。后续的,服务器可以通过TFTP协议,将相应的修复包发送给该故障嵌入式设备,以使该故障嵌入式设备通过U-boot完成故障修复。其中,该设备信息可以包含故障嵌入式设备的设备型号等信息,以使服务器可以为故障嵌入式设备发送与设备型号匹配的修复包。In addition, when the faulty embedded device and the server are in the same network segment, the server can be directly connected to the faulty embedded device. Subsequently, the server may send a corresponding repair package to the faulty embedded device through the TFTP protocol, so that the faulty embedded device completes fault repair through U-boot. The device information may include information such as the device model of the faulty embedded device, so that the server can send a repair package matching the device model for the faulty embedded device.
在一种具体实现方式中,服务器未知发送至每个故障嵌入式设备的路径信息,此时会以广播的形式发送修改指令。由于网络中不乏存在其他主机(包括但不限于未故障的嵌入式设备),为了减少该类主机的处理负担,可以通过多播的形式发送修改指令。以有效减轻网络上“多播”组之外的其他主机的负担,因为发送给“多播”组的数据不会被传送到它们的驱动程序中去处理,避免了资源的无谓浪费。设备信息中还可以携带所对应故障嵌入式设备是否支持多播的信息,在所述发送修改指令至每个故障嵌入式设备之前,本发明实施例所提供的一种修复包发送方法还可以包括:In a specific implementation manner, the server does not know the path information sent to each faulty embedded device, and at this time, the modification instruction is sent in the form of broadcast. Since there are many other hosts in the network (including but not limited to non-faulty embedded devices), in order to reduce the processing burden of such hosts, the modification instruction can be sent in the form of multicast. In order to effectively reduce the burden of other hosts outside the "multicast" group on the network, because the data sent to the "multicast" group will not be transmitted to their drivers for processing, which avoids unnecessary waste of resources. The device information may also carry information on whether the corresponding faulty embedded device supports multicasting. Before the modification instruction is sent to each faulty embedded device, the method for sending a repair package provided by the embodiment of the present invention may further include: :
根据设备信息,判断所对应故障嵌入式设备是否支持多播;According to the device information, determine whether the corresponding faulty embedded device supports multicast;
当所对应故障嵌入式设备支持多播时,所述发送修改指令至每个故障嵌入式设备为:多播所对应故障嵌入式设备的修改指令;When the corresponding faulty embedded device supports multicast, the sending the modification instruction to each faulty embedded device is: multicasting the modification instruction of the corresponding faulty embedded device;
当所对应故障嵌入式设备不支持多播时,所述发送修改指令至每个故障嵌入式设备为:广播所对应故障嵌入式设备的修改指令。When the corresponding faulty embedded device does not support multicast, the sending the modification instruction to each faulty embedded device is: broadcasting the modification instruction of the corresponding faulty embedded device.
举例而言,当故障嵌入式设备包括A、B、C、D和E五个设备时,其中,根据设备信息,可以知晓A、B和C支持多播,D和E不支持多播。则分别多播针对A的修改指令、针对B的修改指令和针对C的修改指令;分别广播针对D的修改指令和针对E的修改指令。针对A、B和C来说,其会接收到针对A的修改指令、针对B的修改指令、针对C的修改指令、针对D的修改指令和针对E的修改指令,从中分别选出携带针对自身的新IP地址的修改指令即可。针对D和E来说,其只会接收到针对D的修改指令和针对E的修改指令,从中分别选出携带针对自身的新IP地址的修改指令即可。For example, when the faulty embedded device includes five devices, A, B, C, D, and E, according to the device information, it can be known that A, B, and C support multicast, while D and E do not. Then, the modification instruction for A, the modification instruction for B, and the modification instruction for C are multicast respectively; the modification instruction for D and the modification instruction for E are broadcast respectively. For A, B, and C, they will receive the modification instruction for A, the modification instruction for B, the modification instruction for C, the modification instruction for D, and the modification instruction for E, and respectively select and carry the modification instruction for themselves. The new IP address modification command can be used. For D and E, they can only receive the modification instruction for D and the modification instruction for E, and respectively select the modification instruction carrying the new IP address for themselves.
在一种具体实现方式中,所述设备信息还可以包括故障嵌入式设备的MAC地址;In a specific implementation manner, the device information may further include the MAC address of the faulty embedded device;
所述发送修改指令至每个故障嵌入式设备,包括:The sending of modification instructions to each faulty embedded device includes:
分别发送携带每个故障嵌入式设备的MAC地址及对应分配的新IP地址的修改指令,至每个故障嵌入式设备;Send a modification instruction carrying the MAC address of each faulty embedded device and the corresponding new IP address assigned to each faulty embedded device;
该针对自身的新IP地址为:针对自身的MAC地址的新IP地址。The new IP address for the self is: a new IP address for the MAC address of the self.
为了更好的保证服务器针对每个故障嵌入式设备分配新的IP地址,保证每个故障嵌入式设备确定针对自身的新IP地址,避免占用其他嵌入式设备的IP地址,该设备信息还可以包括故障嵌入式设备的MAC地址。并且所发送的修改指令中携带每个故障嵌入式设备的MAC地址及对应分配的新IP地址,以使每个故障嵌入式设备可以通过U-boot筛选出针对自身的MAC地址的新IP地址。In order to better ensure that the server assigns a new IP address to each faulty embedded device, to ensure that each faulty embedded device determines a new IP address for itself, and avoids occupying the IP addresses of other embedded devices, the device information may also include The MAC address of the faulty embedded device. And the sent modification instruction carries the MAC address of each faulty embedded device and the correspondingly assigned new IP address, so that each faulty embedded device can filter out a new IP address for its own MAC address through U-boot.
当然,可以理解的是,该设备信息中还可以携带其他的可以唯一标识故障嵌入式设备的信息,本发明实施例并不对该类信息进行限定。Of course, it can be understood that the device information may also carry other information that can uniquely identify the faulty embedded device, and this type of information is not limited in this embodiment of the present invention.
在一种具体实现方式中,所述设备信息还可以包括故障嵌入式设备的MAC地址;In a specific implementation manner, the device information may further include the MAC address of the faulty embedded device;
在所述接收所有故障嵌入式设备发送的修复请求之前,本发明实施例所提供的一种修复包发送方法还可以包括:Before receiving the repair requests sent by all faulty embedded devices, the method for sending a repair package provided by the embodiment of the present invention may further include:
接收该至少一个故障嵌入式设备广播的ARP信息;receiving ARP information broadcast by the at least one faulty embedded device;
存储该ARP信息中所携带的所对应故障嵌入式设备的MAC地址与该新IP地址的对应关系。The corresponding relationship between the MAC address of the corresponding faulty embedded device carried in the ARP information and the new IP address is stored.
可以理解的是,在故障嵌入式设备修改IP地址后,网络中的其他主机(包括但不限于服务器和各交换机设备)中未存储有故障嵌入式设备的新IP地址与MAC地址的对应关系,如ARP(Address Resolution Protocol,地址解析协议)表中未存储有故障嵌入式设备的新IP地址与MAC地址的对应关系,并且U-boot不能对其他主机的ARP请求进行应答。为了避免后续的故障嵌入式设备无法与其他主机进行信息交互,故障嵌入式设备在修改自身的IP地址后,可以通过U-boot主动广播ARP信息,以使其他主机可以增加存储故障嵌入式设备的新IP地址与MAC地址的对应关系。其中,服务器存储该对应关系后,可以向故障嵌入式设备发送所对应的修复包,以使故障嵌入式设备能够完成故障修复。It can be understood that after the faulty embedded device modifies the IP address, other hosts in the network (including but not limited to the server and each switch device) do not store the corresponding relationship between the new IP address and the MAC address of the faulty embedded device. For example, the correspondence between the new IP address and the MAC address of the faulty embedded device is not stored in the ARP (Address Resolution Protocol, Address Resolution Protocol) table, and U-boot cannot respond to ARP requests of other hosts. In order to prevent the subsequent faulty embedded device from being unable to exchange information with other hosts, after the faulty embedded device modifies its own IP address, it can actively broadcast ARP information through U-boot, so that other hosts can increase the storage capacity of the faulty embedded device. The correspondence between the new IP address and the MAC address. Wherein, after storing the corresponding relationship, the server can send the corresponding repair package to the faulty embedded device, so that the faulty embedded device can complete the fault repair.
另一方面,本发明实施例提供了一种修复包接收方法,其中,该修复包接收方法基于故障修复系统,如图2所示,可以包括步骤:On the other hand, an embodiment of the present invention provides a method for receiving a repair package, wherein the method for receiving a repair package is based on a fault repair system. As shown in FIG. 2 , the method may include steps:
S201:发送设备信息至服务器,所述设备信息中包括故障嵌入式设备的原IP地址;S201: Send device information to a server, where the device information includes the original IP address of the faulty embedded device;
嵌入式设备通电后,通过U-boot检测到自身出现故障后,如主程序损坏,通过U-boot定时或不定时广播自身的设备信息。After the embedded device is powered on, after detecting its own failure through U-boot, if the main program is damaged, it broadcasts its own device information through U-boot regularly or irregularly.
S202:接收该服务器发送的修改指令,其中,该修改指令中携带所分配的新IP地址,该新IP地址为该服务器分配的地址;S202: Receive the modification instruction sent by the server, wherein the modification instruction carries the assigned new IP address, and the new IP address is the address assigned by the server;
该修改指令为服务器针对每个故障嵌入式设备发送的。当故障嵌入式设备为多个时,该故障嵌入式设备通过U-boot接收修改指令后,再通过U-boot从其中筛选出针对自身的修改指令,该针对自身的修改指令中携带服务器所分配的针对故障嵌入式设备自身的新IP地址。The modification instruction is sent by the server for each faulty embedded device. When there are multiple faulty embedded devices, the faulty embedded device receives the modification instruction through U-boot, and then filters out the modification instruction for itself through U-boot, and the modification instruction for itself carries the modification instruction assigned by the server. The new IP address for the faulty embedded device itself.
S203:修改故障嵌入式设备的原IP地址为所对应的新IP地址,以用该新IP地址与该服务器直连;S203: Modify the original IP address of the faulty embedded device to the corresponding new IP address, so as to use the new IP address to directly connect with the server;
故障嵌入式设备通过U-boot将原IP地址修改为所对应的新IP地址,并通过该新IP地址与服务器直连。The faulty embedded device modifies the original IP address to the corresponding new IP address through U-boot, and directly connects to the server through the new IP address.
S204:发送修复请求至该服务器;S204: send a repair request to the server;
S205:接收该服务器发送的与该修复请求对应的修复包,完成故障修复。S205: Receive a repair package corresponding to the repair request sent by the server, and complete fault repair.
故障嵌入式设备通过U-boot发送修复请求至服务器,并通过U-boot接收服务器发送的与该修复请求对应的修复包,完成故障修复。The faulty embedded device sends a repair request to the server through U-boot, and receives a repair package corresponding to the repair request sent by the server through U-boot to complete the fault repair.
应用上述发明实施例,嵌入式设备故障后,修改IP地址,并在利用所修改成的新IP地址与服务器直连后,向服务器发送修复请求,接收服务器发送的与该修复请求对应的修复包,完成故障修复。实现故障嵌入式设备与服务器的快速直连,进一步实现故障嵌入式设备的故障的快速修复。Applying the above-mentioned embodiments of the invention, after the embedded device fails, the IP address is modified, and after using the modified new IP address to be directly connected to the server, a repair request is sent to the server, and a repair package corresponding to the repair request sent by the server is received. , complete the fault repair. Realize the fast direct connection between the faulty embedded device and the server, and further realize the rapid repair of the fault of the faulty embedded device.
在一种具体实现方式中,为了更好的保证服务器针对每个故障嵌入式设备分配新的IP地址,保证每个故障嵌入式设备确定针对自身的新IP地址,避免占用其他嵌入式设备的IP地址。所述修改指令中还携带该故障嵌入式设备的MAC地址;In a specific implementation manner, in order to better ensure that the server assigns a new IP address to each faulty embedded device, ensure that each faulty embedded device determines a new IP address for itself, and avoid occupying the IP of other embedded devices address. The modification instruction also carries the MAC address of the faulty embedded device;
所述修改该故障嵌入式设备的原IP地址为所对应的新IP地址,包括:The modified original IP address of the faulty embedded device is the corresponding new IP address, including:
修改该故障嵌入式设备的原IP地址为自身的MAC地址所对应的新IP地址。Modify the original IP address of the faulty embedded device to the new IP address corresponding to its own MAC address.
在一种具体实现方式中,所述修改指令中还携带该故障嵌入式设备的MAC地址;In a specific implementation manner, the modification instruction also carries the MAC address of the faulty embedded device;
在所述发送修复请求至该服务器之前,本发明实施例所提供的一种修复包接收方法还可以包括:Before the sending of the repair request to the server, the method for receiving a repair package provided by the embodiment of the present invention may further include:
广播携带该故障嵌入式设备的MAC地址与该新IP地址的对应关系的地址解析协议ARP信息,以使该服务器接收该ARP信息后,存储该故障嵌入式设备的MAC地址与该新IP地址的对应关系。Broadcast the address resolution protocol ARP information carrying the corresponding relationship between the MAC address of the faulty embedded device and the new IP address, so that after receiving the ARP information, the server stores the MAC address of the faulty embedded device and the new IP address. Correspondence.
可以理解的是,故障嵌入式设备通过U-boot从修改指令中确定出针对自身的MAC地址的新IP地址后,通过U-boot修改原IP地址为该新IP地址,并主动广播ARP信息,以使包括服务器在内的其他主机,接收到该ARP信息后,存储该故障嵌入式设备的MAC地址与该新IP地址的对应关系,以使故障嵌入式设备能够与其他主机进行后续的信息交互。其中,服务器可以依据该对应关系,将故障嵌入式设备对应的修复包,发送给该故障嵌入式设备,以使该故障嵌入式设备完成故障修复。其中,故障嵌入式设备广播的设备信息中还可以携带设备型号等信息,以使服务器根据设备型号,向故障嵌入式设备发送相应的修复包。It can be understood that after the faulty embedded device determines the new IP address for its own MAC address from the modification instruction through U-boot, it modifies the original IP address to the new IP address through U-boot, and actively broadcasts ARP information. So that other hosts including the server, after receiving the ARP information, store the corresponding relationship between the MAC address of the faulty embedded device and the new IP address, so that the faulty embedded device can conduct subsequent information exchanges with other hosts. . The server can send a repair package corresponding to the faulty embedded device to the faulty embedded device according to the corresponding relationship, so that the faulty embedded device can complete the fault repair. The device information broadcast by the faulty embedded device may also carry information such as the device model, so that the server sends a corresponding repair package to the faulty embedded device according to the device model.
具体的,如图3所示,为服务器与故障嵌入式设备的交互示意图:Specifically, as shown in Figure 3, it is a schematic diagram of the interaction between the server and the faulty embedded device:
故障嵌入式设备出现故障,如主程序损坏,广播自身的设备信息;The faulty embedded device fails, such as the main program is damaged, broadcast its own device information;
TFTP服务器接收故障嵌入式设备广播的设备信息;The TFTP server receives the device information broadcast by the faulty embedded device;
TFTP服务器可以显示所接收的每个显示信息,并获得为每个故障嵌入式设备分配的新IP地址;The TFTP server can display each display received and obtain a new IP address assigned to each faulty embedded device;
TFTP服务器广播或多播携带所获得的新IP地址的修改指令;The TFTP server broadcasts or multicasts a modification instruction carrying the obtained new IP address;
每个故障嵌入式设备接收修改指令,通过U-boot从修改指令中筛选出针对自身的新IP地址,并修改IP地址;Each faulty embedded device receives the modification instruction, filters out the new IP address for itself from the modification instruction through U-boot, and modifies the IP address;
每个故障嵌入式设备广播ARP信息,ARP信息中携带自身的MAC地址与新IP地址的对应关系;Each faulty embedded device broadcasts ARP information, and the ARP information carries the correspondence between its own MAC address and the new IP address;
TFTP服务器接收每个故障嵌入式设备广播的ARP信息,存储ARP信息信息中所携带的每个故障嵌入式设备的MAC地址与新IP地址的对应关系,并且与每个故障嵌入式设备进行直连;The TFTP server receives the ARP information broadcast by each faulty embedded device, stores the correspondence between the MAC address of each faulty embedded device and the new IP address carried in the ARP information, and directly connects with each faulty embedded device ;
每个故障嵌入式设备与TFTP服务器直连后,向TFTP服务器发送修复请求;After each faulty embedded device is directly connected to the TFTP server, it sends a repair request to the TFTP server;
TFTP服务器接收所有故障嵌入式设备发送的修复请求;该修复请求中可以携带所对应故障嵌入式设备的设备型号等信息;The TFTP server receives repair requests sent by all faulty embedded devices; the repair request can carry information such as the device model of the corresponding faulty embedded device;
TFTP服务器针对每个故障嵌入式设备发送对应的修复包,以使每个故障嵌入式设备完成故障修复。The TFTP server sends a corresponding repair package for each faulty embedded device, so that each faulty embedded device completes the fault repair.
其中,每个故障嵌入式设备故障修复完毕后,均可以向TFTP服务器反馈故障修复成功的信息。Among them, after each faulty embedded device has been repaired, it can feed back information that the fault has been successfully repaired to the TFTP server.
相应于上述方法实施例,本发明实施例提供了一种修复包发送装置,如图4所示,所述装置可以包括:第一接收模块401、获得模块402、第一发送模块403、第二接收模块404和第二发送模块405;Corresponding to the foregoing method embodiments, an embodiment of the present invention provides an apparatus for sending repair packets. As shown in FIG. 4 , the apparatus may include: a
所述第一接收模块401,用于接收至少一个故障嵌入式设备发送的设备信息,所述设备信息中包括故障嵌入式设备的原IP地址;The
所述获得模块402,用于获得为每个故障嵌入式设备分配的新IP地址;The obtaining
所述第一发送模块403,用于发送修改指令至每个故障嵌入式设备,以使每个故障嵌入式设备从所述修改指令中获得针对自身的新IP地址后,用新IP地址与服务器直连,其中,所述修改指令携带所分配的新IP地址;The
所述第二接收模块404,用于接收所有故障嵌入式设备发送的修复请求;The
所述第二发送模块405,用于发送与所述修复请求对应的修复包至所有故障嵌入式设备,以使所有故障嵌入式设备完成故障修复。The
应用本发明实施例,服务器接收至少一个故障嵌入式设备发送的包括故障嵌入式设备的原IP地址的设备信息;获得为每个故障嵌入式设备分配的新IP地址;发送修改指令至每个故障嵌入式设备,以使每个故障嵌入式设备从修改指令中获得针对自身的新IP地址后,用新IP地址与服务器直连;接收所有故障嵌入式设备发送的修复请求;发送与修复请求对应的修复包至所有故障嵌入式设备,以使所有故障嵌入式设备完成故障修复。可见,服务器可以为处于同网段和不同网段的故障嵌入式设备分配新的IP地址,以使每个故障嵌入式设备从修改指令中获得针对自身的新IP地址后,用新IP地址与服务器直连,无需通过人工方式逐一来修改故障嵌入式设备的IP地址,实现了故障嵌入式设备与服务器的快速直连,并进一步的实现了故障嵌入式设备的故障的快速修复。Applying the embodiment of the present invention, the server receives device information including the original IP address of the faulty embedded device sent by at least one faulty embedded device; obtains a new IP address allocated for each faulty embedded device; sends a modification instruction to each faulty embedded device Embedded devices, so that after each faulty embedded device obtains a new IP address for itself from the modification instruction, use the new IP address to directly connect with the server; receive repair requests sent by all faulty embedded devices; send and repair requests corresponding to The repair package is sent to all faulty embedded devices, so that all faulty embedded devices can complete the fault repair. It can be seen that the server can assign new IP addresses to the faulty embedded devices in the same network segment and different network segments, so that each faulty embedded device obtains a new IP address for itself from the modification instruction, and uses the new IP address to match with the new IP address. The server is directly connected, and there is no need to manually modify the IP address of the faulty embedded device one by one, which realizes the rapid direct connection between the faulty embedded device and the server, and further realizes the rapid repair of the fault of the faulty embedded device.
在一种具体实现方式中,所述装置还包括确定模块;In a specific implementation manner, the apparatus further includes a determining module;
所述确定模块,用于在所述接收至少一个故障嵌入式设备发送的设备信息之后,依据所述设备信息,从所述至少一个故障嵌入式设备中,确定所有第一故障嵌入式设备,其中,所述第一故障嵌入式设备为原IP地址与所述服务器不在同一网段的故障嵌入式设备;The determining module is configured to, after receiving the device information sent by the at least one faulty embedded device, determine all the first faulty embedded devices from the at least one faulty embedded device according to the device information, wherein , the first faulty embedded device is a faulty embedded device whose original IP address is not in the same network segment as the server;
所述获得模块402,具体用于获得为每个第一故障嵌入式设备分配的新IP地址。The obtaining
在一种具体实现方式中,所述装置还包括判断模块;In a specific implementation, the device further includes a judgment module;
所述判断模块,用于在所述发送修改指令至每个故障嵌入式设备之前,根据所述设备信息,判断所对应故障嵌入式设备是否支持多播;The judging module is used to judge whether the corresponding faulty embedded device supports multicast according to the device information before the modification instruction is sent to each faulty embedded device;
所述第一发送模块403,具体用于当所对应故障嵌入式设备支持多播时,多播所对应故障嵌入式设备的修改指令;当所对应故障嵌入式设备不支持多播时,广播所对应故障嵌入式设备的修改指令。The
在一种具体实现方式中,所述设备信息还包括故障嵌入式设备的MAC地址;In a specific implementation manner, the device information further includes the MAC address of the faulty embedded device;
所述第一发送模块403,具体用于分别发送携带每个故障嵌入式设备的MAC地址及对应分配的新IP地址的修改指令,至每个故障嵌入式设备;The
所述针对自身的新IP地址为:针对自身的MAC地址的新IP地址。The new IP address for the self is: a new IP address for the MAC address of the self.
在一种具体实现方式中,所述设备信息还包括故障嵌入式设备的MAC地址;In a specific implementation manner, the device information further includes the MAC address of the faulty embedded device;
所述装置还包括第三接收模块和存储模块;The device also includes a third receiving module and a storage module;
所述第三接收模块,用于接收所述至少一个故障嵌入式设备广播的ARP信息;the third receiving module, configured to receive the ARP information broadcast by the at least one faulty embedded device;
所述存储模块,用于存储所述ARP信息中所携带的所对应故障嵌入式设备的MAC地址与所述新IP地址的对应关系。The storage module is configured to store the correspondence between the MAC address of the corresponding faulty embedded device carried in the ARP information and the new IP address.
另一方面,基于上述方法实施例,本发明实施例提供了一种修复包接收装置,如图5所示,所述装置可以包括:第三发送模块501、第四接收模块502、修改模块503、第四发送模块504和第五接收模块505;On the other hand, based on the foregoing method embodiments, an embodiment of the present invention provides an apparatus for receiving repair packets. As shown in FIG. 5 , the apparatus may include: a
所述第三发送模块501,用于发送设备信息至服务器,所述设备信息中包括故障嵌入式设备的原IP地址;The
所述第四接收模块502,用于接收所述服务器发送的修改指令,其中,所述修改指令中携带所分配的新IP地址,所述新IP地址为所述服务器分配的地址;The
所述修改模块503,用于修改所述故障嵌入式设备的原IP地址为所对应的新IP地址,以用所述新IP地址与所述服务器直连;The
所述第四发送模块504,用于发送修复请求至所述服务器;The
所述第五接收模块505,用于接收所述服务器发送的与所述修复请求对应的修复包,完成故障修复。The
应用本发明实施例,嵌入式设备故障后,修改IP地址,并在利用所修改成的新IP地址与服务器直连后,向服务器发送修复请求,接收服务器发送的与该修复请求对应的修复包,完成故障修复。实现故障嵌入式设备与服务器的快速直连,进一步实现故障嵌入式设备的故障的快速修复。Applying the embodiment of the present invention, after the embedded device fails, the IP address is modified, and after using the modified new IP address to be directly connected to the server, a repair request is sent to the server, and a repair package corresponding to the repair request sent by the server is received. , complete the fault repair. Realize the fast direct connection between the faulty embedded device and the server, and further realize the rapid repair of the fault of the faulty embedded device.
在一种具体实现方式中,所述修改指令中还携带所述故障嵌入式设备的MAC地址;In a specific implementation manner, the modification instruction further carries the MAC address of the faulty embedded device;
所述修改模块503,具体用于修改所述故障嵌入式设备的原IP地址为自身的MAC地址所对应的新IP地址。The
在一种具体实现方式中,所述修改指令中还携带所述故障嵌入式设备的MAC地址;In a specific implementation manner, the modification instruction further carries the MAC address of the faulty embedded device;
所述装置还包括广播模块;The device also includes a broadcast module;
所述广播模块,用于在所述发送修复请求至所述服务器之前,广播携带所述故障嵌入式设备的MAC地址与所述新IP地址的对应关系的地址解析协议ARP信息,以使所述服务器接收所述ARP信息后,存储所述故障嵌入式设备的MAC地址与所述新IP地址的对应关系。The broadcast module is configured to broadcast the address resolution protocol ARP information carrying the correspondence between the MAC address of the faulty embedded device and the new IP address before the repair request is sent to the server, so that the After receiving the ARP information, the server stores the correspondence between the MAC address of the faulty embedded device and the new IP address.
本发明实施例提供一种故障修复系统,如图6所示,所述系统包括:An embodiment of the present invention provides a fault repair system, as shown in FIG. 6 , the system includes:
故障嵌入式设备601,用于发送设备信息至服务器,所述设备信息中包括故障嵌入式设备的原IP地址;The faulty embedded
服务器602,用于接收故障嵌入式设备发送的设备信息,并获得为每个故障嵌入式设备分配的新IP地址;发送修改指令至每个故障嵌入式设备,其中,所述修改指令携带所分配的新IP地址;The
所述故障嵌入式设备601还用于接收所述服务器发送的修改指令;修改所述故障嵌入式设备的原IP地址为所对应的新IP地址,以用所述新IP地址与所述服务器直连;并发送修复请求至所述服务器;The faulty embedded
所述服务器602还用于接收所有故障嵌入式设备发送的修复请求;并发送与所述修复请求对应的修复包至所有故障嵌入式设备;The
所述故障嵌入式设备601还用于接收所述服务器发送的与所述修复请求对应的修复包,完成故障修复。The faulty embedded
对于系统/装置实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。For the system/apparatus embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for related parts, please refer to the partial description of the method embodiment.
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that, in this document, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any relationship between these entities or operations. any such actual relationship or sequence exists. Moreover, the terms "comprising", "comprising" or any other variation thereof are intended to encompass a non-exclusive inclusion such that a process, method, article or device that includes a list of elements includes not only those elements, but also includes not explicitly listed or other elements inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.
本领域普通技术人员可以理解实现上述方法实施方式中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,所述的程序可以存储于计算机可读取存储介质中,这里所称得的存储介质,如:ROM/RAM、磁碟、光盘等。Those of ordinary skill in the art can understand that all or part of the steps in the implementation of the above method can be completed by instructing the relevant hardware through a program, and the program can be stored in a computer-readable storage medium. Storage medium, such as: ROM/RAM, magnetic disk, optical disk, etc.
以上所述仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本发明的保护范围内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims (11)
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610588640.8A CN107645404B (en) | 2016-07-21 | 2016-07-21 | Method and device for sending and receiving repair packet and fault repair system |
| PCT/CN2017/089366 WO2018014695A1 (en) | 2016-07-21 | 2017-06-21 | Method and device for sending and receiving a repair packet, and fault repair system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610588640.8A CN107645404B (en) | 2016-07-21 | 2016-07-21 | Method and device for sending and receiving repair packet and fault repair system |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN107645404A CN107645404A (en) | 2018-01-30 |
| CN107645404B true CN107645404B (en) | 2020-10-02 |
Family
ID=60991906
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201610588640.8A Active CN107645404B (en) | 2016-07-21 | 2016-07-21 | Method and device for sending and receiving repair packet and fault repair system |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN107645404B (en) |
| WO (1) | WO2018014695A1 (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111833799B (en) * | 2019-04-15 | 2022-04-05 | 杭州海康威视数字技术股份有限公司 | LED receiving assembly and receiving card switching method |
| CN116684380A (en) * | 2023-05-08 | 2023-09-01 | 珠海格力电器股份有限公司 | Embedded device, communication method and medium |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101873726A (en) * | 2010-07-01 | 2010-10-27 | 华为终端有限公司 | Upgrading method of wireless repeater and wireless access equipment |
| CN103442041A (en) * | 2013-08-14 | 2013-12-11 | 深圳市同洲电子股份有限公司 | Method, device and system for upgrading firmware of embedded device |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7478147B2 (en) * | 2005-07-21 | 2009-01-13 | International Business Machines Corporation | Method and apparatus for a secure network install |
| CN101820387B (en) * | 2010-02-08 | 2012-12-12 | 北京航空航天大学 | Method for rapidly deploying extensible cluster |
| CN103200271B (en) * | 2013-04-17 | 2016-03-16 | 北京百度网讯科技有限公司 | The method of ARM server and automation installation system thereof |
-
2016
- 2016-07-21 CN CN201610588640.8A patent/CN107645404B/en active Active
-
2017
- 2017-06-21 WO PCT/CN2017/089366 patent/WO2018014695A1/en not_active Ceased
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101873726A (en) * | 2010-07-01 | 2010-10-27 | 华为终端有限公司 | Upgrading method of wireless repeater and wireless access equipment |
| CN103442041A (en) * | 2013-08-14 | 2013-12-11 | 深圳市同洲电子股份有限公司 | Method, device and system for upgrading firmware of embedded device |
Also Published As
| Publication number | Publication date |
|---|---|
| WO2018014695A1 (en) | 2018-01-25 |
| CN107645404A (en) | 2018-01-30 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US9525648B2 (en) | Method for acquiring physical address of virtual machine | |
| US8862865B2 (en) | Rebooting infiniband clusters | |
| CN103618621B (en) | A kind of software defined network SDN method of automatic configuration, equipment and system | |
| US8892689B1 (en) | Method and apparatus for a storage server to automatically discover and join a network storage cluster | |
| US20150341189A1 (en) | Base Station Deployment Configuration Method for Base Station, Base Station, and Server | |
| US20140369183A1 (en) | Performing Failover in a Redundancy Group | |
| US20150215189A1 (en) | Method and apparatus for managing segments connected via network | |
| CN105978781A (en) | Method and system for establishing network connection of Docker container, and client side | |
| CN105657081A (en) | DHCP (dynamic host configuration protocol) service providing method, device and system | |
| CN103546315B (en) | The standby system of a kind of Dynamic Host Configuration Protocol server, method and apparatus | |
| WO2020104992A1 (en) | N+1 redundancy for virtualized services with low latency fail-over | |
| CN107852344B (en) | Storage network element discovery method and device | |
| EP3474501B1 (en) | Network device stacking | |
| CN107645404B (en) | Method and device for sending and receiving repair packet and fault repair system | |
| CN104243304B (en) | The data processing method of non-full-mesh topological structure, equipment and system | |
| CN110391961A (en) | A tunnel binding method, device and system | |
| CN104935614B (en) | Data transmission method and device | |
| CN101107810A (en) | Desktop computer blade fault identification system and method | |
| US8909816B2 (en) | Implementing a logical unit reset command in a distributed storage system | |
| CN105763368A (en) | Stacking method and device | |
| CN105610619B (en) | A kind of network element managing method and apparatus | |
| WO2020048177A1 (en) | Set top box management method and apparatus, and device and storage medium | |
| WO2019015268A1 (en) | Network system and network configuration method thereof | |
| CN105471598A (en) | Dynamic allocating method and dynamic allocating system for single boards affiliated to virtual Ethernet ports | |
| CN103532687A (en) | Method and system for realizing redundant backup of dynamic host configuration protocol server |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| TR01 | Transfer of patent right | ||
| TR01 | Transfer of patent right |
Effective date of registration: 20250904 Address after: Rooms 602 and 605, No. 85 Xiangxue Avenue Middle, Huangpu District, Guangzhou City, Guangdong Province 510000 Patentee after: Guangzhou Gaohang Technology Transfer Co.,Ltd. Country or region after: China Address before: No. 555 Kang Hangzhou Science Park of Zhejiang province Binjiang District Qianmo road 310052 Patentee before: Hangzhou Hikvision Digital Technology Co.,Ltd. Country or region before: China |
|
| TR01 | Transfer of patent right |
Effective date of registration: 20250919 Address after: 100000 Room A-T3137, Building 3, No. 20 Yong'an Road, Shilong Economic Development Zone, Mentougou District, Beijing Patentee after: Beijing Kangya Mingni Health Technology Co.,Ltd. Country or region after: China Address before: Rooms 602 and 605, No. 85 Xiangxue Avenue Middle, Huangpu District, Guangzhou City, Guangdong Province 510000 Patentee before: Guangzhou Gaohang Technology Transfer Co.,Ltd. Country or region before: China |