The method for remote updating of FPGA board, system and relevant apparatus in local area network

文档序号:1744545 发布日期:2019-11-26 浏览:11次 中文

阅读说明:本技术 局域网内fpga板卡的远程更新方法、系统及相关装置 (The method for remote updating of FPGA board, system and relevant apparatus in local area network ) 是由 李振辉 王彦伟 樊嘉恒 于 2019-08-30 设计创作,主要内容包括:本申请提供一种局域网内FPGA板卡的远程更新方法,包括:向FPGA板卡发送第一广播包,以确定FPGA板卡的板卡ID;向FPGA板卡发送第二广播包,以便为FPGA板卡分配MAC地址和IP地址;在局域网内发送第三广播包,以使FPGA板卡读写第三广播包并根据rpd更新文件进行板卡更新。本申请使用以太网的广播数据包形式,极大的缩短远程更新的时间,增强了系统的可靠性,且由于只使用现有网卡电路,不需要进行其他的修改,避免了硬件成本的大幅增加。本申请还提供一种局域网内FPGA板卡的远程更新系统、一种计算机可读存储介质和一种FPGA板卡更新服务器,具有上述有益效果。(The application provides a kind of method for remote updating of FPGA board in local area network, comprising: the first broadcast packet is sent to FPGA board, to determine the board ID of FPGA board;The second broadcast packet is sent to FPGA board, to distribute MAC Address and IP address for FPGA board;Third broadcast packet is sent in local area network, so that FPGA board, which reads and writes third broadcast packet and updates file according to rpd, carries out board update.The application uses the broadcast data packet form of Ethernet, greatly shortens the time remotely updated, enhances the reliability of system, and due to only using existing network interface card circuit, does not need to carry out other modifications, avoid being significantly increased for hardware cost.The application also provides the remote update system of FPGA board, a kind of computer readable storage medium and a kind of FPGA board in a kind of local area network and updates server, has above-mentioned beneficial effect.)

1. the method for remote updating of FPGA board in a kind of local area network characterized by comprising

The first broadcast packet is sent to the FPGA board, first broadcast packet includes inquiry request, with the determination FPGA plate The board ID of card;

The second broadcast packet is sent to the FPGA board, to be that the FPGA board distributes MAC Address according to the node ID And IP address;

Third broadcast packet is sent in local area network, so that the FPGA board reads and writes the rpd in the third broadcast packet and updates text Part simultaneously updates file progress board update according to the rpd.

2. method for remote updating according to claim 1, which is characterized in that Xiang Suoshu FPGA board send inquiry request it Before, further includes:

Socket is established with the FPGA board to connect, and sets type of data packet as broadcast packet.

3. method for remote updating according to claim 1, which is characterized in that with distributing MAC for each FPGA board Location and IP address include:

The 4th broadcast packet comprising address configuration request is sent to the FPGA board;

The FPGA board parses the address configuration request, obtains the corresponding MAC Address of board ID and the IP address;

The FPGA board is according to the MAC Address and IP address setting gateway configuration.

4. method for remote updating according to claim 1, which is characterized in that with distributing MAC for each FPGA board After location and IP address, further includes:

The board ID, the MAC Address and the IP address are saved with array form.

5. method for remote updating according to claim 1, which is characterized in that the FPGA board reads and writes the third broadcast Rpd in packet updates file and is updated after file carries out board update according to the rpd, further includes:

Remote loading request is sent to the FPGA board;

If the FPGA board loads successfully, the FPGA board is updated successfully.

6. method for remote updating according to claim 1-5, which is characterized in that further include:

When any of third broadcast packet and subsequent all broadcast packets send failure or send time-out, the FPGA board is utilized Corresponding MAC Address and IP address reassemble into unicast packet and are sent to the FPGA board.

7. the remote update system of FPGA board in a kind of local area network characterized by comprising

Confirmation module, for sending the first broadcast packet to the FPGA board, first broadcast packet includes inquiry request, with true The board ID of the fixed FPGA board;

Address assignment module, for sending the second broadcast packet to the FPGA board, to be described according to the node ID FPGA board distributes MAC Address and IP address;

Long-range update module, for sending third broadcast packet in local area network, so that the FPGA board read-write third is wide The rpd in packet is broadcast to update file and update file progress board update according to the rpd.

8. remote update system according to claim 7, which is characterized in that further include:

Fault-tolerant module is used for when any of third broadcast packet and subsequent all broadcast packets send failure or send time-out, sharp Unicast packet, which is reassembled into, with the corresponding MAC Address of the FPGA board and IP address is sent to the FPGA board.

9. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program quilt The step of processor realizes method for remote updating as claimed in any one of claims 1 to 6 when executing.

10. a kind of FPGA board updates server, which is characterized in that including memory and processor, have in the memory Computer program, the processor are realized when calling the computer program in the memory such as any one of claim 1-6 institute The step of method for remote updating stated.

Technical field

This application involves server field, in particular to the method for remote updating of FPGA board, system in a kind of local area network And relevant apparatus.

Background technique

FPGA board is a kind of crucial programming device of the large-scale application in all kinds of electronic systems at present.Due to its spirit Interface features living and powerful parallel pipeline computing capability, have it in multiple fields such as space flight, medical treatment and widely answer With.And with the development of the technologies such as deep learning, big data, calculation amount is increasing, and single FPGA board is much unable to satisfy The capability requirement of system, and more FPGA board processing schemes are also increasingly by the attention of system developer.

The increase of FPGA board number brings corresponding upgrade problem, and previous FPGA board upgrading mostly uses following two Kind of mode, one, by dedicated emulated device by dedicated JTAG socket, programming is carried out under special-purpose software simulated environment.Using this Kind mode, external restrictive condition is more, usually requires to open device housings in upgrading to connect emulator and JTAG socket, very Hardly possible adapts to the requirement of remote online upgrading, difficult to realize for the upgrading of more FPGA.Two, pass through the fieldbus such as Ethernet for mirror Picture file is passed to FPGA board, and is about to the side for the remote upgrade FPGA program that mirror image programming enters in Flash certainly by FPGA board Formula.This mode can be very good to solve the problems, such as remotely to update, but increases bring upgrading for FPGA board number and ask The problems such as topic, the upgrade failure problem of single FPGA board during upgrading, poor reliability in escalation process, does not all solve well Certainly, therefore the technical issues of FPGA board upgrading efficiency is those skilled in the art's urgent need to resolve how is improved.

Summary of the invention

The purpose of the application is to provide method for remote updating, system, a kind of computer of FPGA board in a kind of local area network Readable storage medium storing program for executing and a kind of FPGA board update server, can be improved FPGA board and update efficiency.

In order to solve the above technical problems, the application provides a kind of method for remote updating of FPGA board in local area network, specifically Technical solution is as follows:

The first broadcast packet is sent to the FPGA board, first broadcast packet includes inquiry request, described in determination The board ID of FPGA board;

The second broadcast packet is sent to the FPGA board, to be that the FPGA board distributes MAC according to the node ID Address and IP address;

Third broadcast packet is sent in local area network, so that the FPGA board reads and writes the rpd in the third broadcast packet more New file simultaneously updates file progress board update according to the rpd.

Wherein, before Xiang Suoshu FPGA board transmission inquiry request, further includes:

Socket is established with the FPGA board to connect, and sets type of data packet as broadcast packet.

Wherein, MAC Address is distributed for each FPGA board and IP address includes:

The 4th broadcast packet comprising address configuration request is sent to the FPGA board;

The FPGA board parses the address configuration request, obtains the corresponding MAC Address of board ID and the IP Address;

The FPGA board is according to the MAC Address and IP address setting gateway configuration.

Wherein, it is distributed after MAC Address and IP address for each FPGA board, further includes:

The board ID, the MAC Address and the IP address are saved with array form.

Wherein, the FPGA board reads and writes the rpd in the third broadcast packet and updates file and update text according to the rpd Part carries out after board update, further includes:

Remote loading request is sent to the FPGA board;

If the FPGA board loads successfully, the FPGA board is updated successfully.

Wherein, further includes:

When any of third broadcast packet and subsequent all broadcast packets send failure or send time-out, the FPGA is utilized The corresponding MAC Address of board and IP address reassemble into unicast packet and are sent to the FPGA board.

The application also provides a kind of remote update system of FPGA board in local area network, comprising:

Confirmation module, for sending the first broadcast packet to the FPGA board, first broadcast packet includes inquiry request, With the board ID of the determination FPGA board;

Address assignment module, for sending the second broadcast packet to the FPGA board, to be institute according to the node ID State FPGA board distribution MAC Address and IP address;

Long-range update module, for sending third broadcast packet in local area network, so that FPGA board read-write described the Rpd in three broadcast packets, which updates file and updates file according to the rpd, carries out board update.

Wherein, further includes:

Fault-tolerant module, for when any of third broadcast packet and subsequent all broadcast packets send failure or send time-out When, unicast packet, which is reassembled into, using the corresponding MAC Address of the FPGA board and IP address is sent to the FPGA board.

The application also provides a kind of computer readable storage medium, is stored thereon with computer program, the computer journey The step of method for remote updating as described above is realized when sequence is executed by processor.

The application also provides a kind of FPGA board update server, including memory and processor, deposits in the memory There is computer program, the processor realizes long-range update side as described above when calling the computer program in the memory The step of method.

The application provides a kind of method for remote updating of FPGA board in local area network, comprising: Xiang Suoshu FPGA board is sent First broadcast packet, first broadcast packet includes inquiry request, with the board ID of the determination FPGA board;To the FPGA plate Card sends the second broadcast packet, to be that the FPGA board distributes MAC Address and IP address according to the node ID;In local area network Interior transmission third broadcast packet, so that the FPGA board reads and writes the rpd in the third broadcast packet and updates file and according to described Rpd updates file and carries out board update.

The application confirms the quantity of FPGA board in current local area network by the board ID of broadcast packet confirmation FPGA board, And the MAC Address and IP address fixed to the configuration of FPGA board, the long-range file that updates is sent out all by way of broadcast packet later All FPGA boards are given remotely to be updated.Using the broadcast data packet form of Ethernet, greatly shortening remotely updates Time enhances the reliability of system, and due to only using existing network interface card circuit, does not need to carry out other modifications, avoid Hardware cost is significantly increased.The application also provides remote update system, a kind of computer of FPGA board in a kind of local area network Readable storage medium storing program for executing and a kind of FPGA board update server, have above-mentioned beneficial effect, details are not described herein again.

Detailed description of the invention

In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this The embodiment of application for those of ordinary skill in the art without creative efforts, can also basis The attached drawing of offer obtains other attached drawings.

Fig. 1 is the flow chart of the method for remote updating of FPGA board in a kind of local area network provided by the embodiment of the present application;

Fig. 2 is the long-range update flow diagram of FPGA board in a kind of local area network provided by the embodiment of the present application;

Fig. 3 is the remote update system structural representation of FPGA board in a kind of local area network provided by the embodiment of the present application Figure.

Specific embodiment

To keep the purposes, technical schemes and advantages of the embodiment of the present application clearer, below in conjunction with the embodiment of the present application In attached drawing, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described embodiment is Some embodiments of the present application, instead of all the embodiments.Based on the embodiment in the application, those of ordinary skill in the art Every other embodiment obtained without making creative work, shall fall in the protection scope of this application.

Referring to FIG. 1, method for remote updating of the Fig. 1 for FPGA board in a kind of local area network provided by the embodiment of the present application Flow chart, which includes:

S101: Xiang Suoshu FPGA board sends the first broadcast packet, and first broadcast packet includes inquiry request, to determine State the board ID of FPGA board;

First broadcast packet is practically used for the quantity of inquiry FPGA board and the board ID of each FPGA board, specifically, this Step may include following three step:

Step 1, server end startup program establish socket connection, using report formula (SOCK_DGRAM) socket type, It is broadcast data packet (SO_BROADCAST) that setting, which sends type of data packet,.

Step 2, broadcast transmission data packet send the quantity of FPGA board according to the protocol contents defined with FPGA board Inquiry request waits the response of FPGA board.

Step 3, the characteristic due to broadcast packet, the FPGA board in all local area networks can all receive data packet, and root According to the protocol analysis packet content of definition, it is the discovery that the board inquiry request of FPGA, FPGA board can send according to agreement and answer It answers inquiry data packet and inserts the ID of FPGA board in reply data packet and be sent to server.

Particularly, server can also establish finger daemon for receiving the order of FPGA board transmission, receive FPGA After the response that board is sent is inquired data packet and parsed, the corresponding structural body number of FPGA board is established according to the quantity of different ID numbers Group, which is used to store the information of each FPGA board, by board ID, MAC Address and IP address with array form It saves.

S102: Xiang Suoshu FPGA board sends the second broadcast packet, to be the FPGA board point according to the node ID With MAC Address and IP address;

This step may include following three step:

The first step after determining FPGA board quantity by ID identification process, is divided according to each unique ID number of FPGA board With unique MAC and IP address information.And it is stored to the Array for structural body for the storage FPGA board information established in S101 In.

Second step, server send address configuration request according to the protocol requirement of definition, and according to the address ID+MAC+IP The form of address information, length are 12 bytes, fill broadcast packet, since Ethernet payload capacity is 1500 bytes, are subtracted It is 1472 bytes after IP radical and UDP radical, so a broadcast packet can at most configure 120 FPGA boards, if FPGA Board quantity is more than 120 multiple broadcast packets can be used to send, and the response of FPGA board is waited after being sent completely.

Third step, the characteristic due to broadcast packet, the FPGA board in all local area networks can all receive data packet, and root According to the protocol analysis packet content of definition, it is the discovery that address configuration request, and confirming by judging ID is that this is arranged MAC and IP address still directly abandon this broadcast packet, and after MAC and IP address success is arranged, FPGA board can be sent out according to agreement It send response address to be arranged successfully and the ID of FPGA board filling response bag is sent to server.

Preferably, server is using the finger daemon established in previous step, with receiving the response of FPGA board transmission After location is arranged successfully data packet and parses, the structural body of storage FPGA corresponding ID board information is found according to ID number, and address is set Store Success Flag.

S103: third broadcast packet is sent in local area network, so that the FPGA board is read and write in the third broadcast packet Rpd, which updates file and updates file according to the rpd, carries out board update.

After determining FPGA board quantity by ID identification process, distributed according to the unique ID number of each FPGA board unique MAC and IP address information.And it is stored in the structural body of storage FPGA board information of step 4 foundation.

Server sends address configuration request according to the protocol requirement of definition, and is believed according to the address ID+MAC+IP address The form of breath, length are 12 bytes, fill broadcast packet, since Ethernet payload capacity is 1500 bytes, subtract IP radical With after UDP radical be 1472 bytes, so a broadcast packet can at most configure 120 FPGA boards, if FPGA board number Multiple broadcast packets can be used more than 120 and send for amount, and the response of FPGA board is waited after being sent completely.

Due to the characteristic of broadcast packet, the FPGA board in all local area networks can all receive data packet, and according to definition Protocol analysis packet content, be the discovery that address configuration request, and confirm by judging board ID it is that this MAC is set This broadcast packet is still directly abandoned with IP address, after MAC Address and IP address success is arranged, FPGA board can be sent out according to agreement It send response address to be arranged successfully and the board ID of FPGA board filling response bag is sent to server.

Server uses finger daemon, and the response address for receiving the transmission of FPGA board is arranged successfully data packet and parses Afterwards, the structural body of storage FPGA corresponding ID board information is found according to ID number, setting address stores Success Flag.

Server reads the rpd file for remotely updating into memory.Since the Flash characteristic of FPAG board limits, The data of 64bytes can only be once written in the write operation of Flash, and a read operation can only at most read the 256bytes of Flash Data send the Flash write operation requests of FPGA according to protocol requirement based on above-mentioned theory, and data are filled into data Bao Zhong, each broadcast data are 64bytes, and broadcast data packet is sent 4 times, in total 256bytes, and in each data packet Increase the sequence that serial number is used to determine every bag data, the response of FPGA board is waited after being sent completely.

Due to the characteristic of broadcast packet, the FPGA board in all local area networks can all receive data packet, and according to definition Protocol analysis packet content, the Flash write operation requests of FPGA are the discovery that, and parse data sequence number, by received 4 groups of numbers According to being written in Flash after sequence, the 256bytes data in Flash are read again after the completion of write-in, FPGA board can root Response Flash write operation requests are sent according to agreement and the ID of the data read out and FPGA filling response bag are sent to service Device.

Server uses finger daemon, receives the response Flash write operation requests data packet of FPGA board transmission and solves It after analysis, is compared by the 256bytes with transmission, confirms whether the write request of Flash succeeds, storage is found according to ID number The structural body of FPGA corresponding ID board information, if Success Flag is successfully arranged and carries out success count, if unsuccessfully executed out Wrong treatment mechanism.

It is performed repeatedly until that all rpd, which are updated file, all to be updated into the Flash of FPGA board, and long-range update is completed Process.

After FPGA board is completed to update, in order to determine that all FPGA boards remotely update completion, sent out according to protocol requirement It send FPGA board remote loading to request, waits the response of FPGA board.

It specifically may include: to send remote loading request to FPGA board;If FPGA board loads successfully, FPGA plate Card is updated successfully.

Due to the characteristic of broadcast packet, the FPGA board in all local area networks can all receive data packet, and according to definition Protocol analysis packet content, be the discovery that FPGA remote loading request, FPGA execute remote loading success after, FPGA board The request of response Flash remote loading can be sent according to agreement and the ID of FPGA filling response bag is sent to server.

Server uses finger daemon, receives the response Flash remote loading request data package of FPGA board transmission simultaneously After parsing, the structural body of storage FPGA corresponding ID board information is found according to ID number, and remote loading Success Flag is set, this is arrived The long-range update and load of FPGA is fully completed.

Error handling processing mechanism is described below:

When any of third broadcast packet and subsequent all broadcast packets send failure or send time-out, the FPGA is utilized The corresponding MAC Address of board and IP address reassemble into unicast packet and are sent to the FPGA board.

It is not played a role in ID identification process and MAC and IP address configuration process, reason is if the two processes Error, can be determined that hardware problem, Ethernet cannot recognize FPGA board equipment substantially.

It updates long-range in loading procedure, due to the characteristic of Ethernet, having small probability, there are some data packet packet losses The problem of, in the finger daemon that a upper embodiment is established, the corresponding FPGA plate of all ID can be detected after sending data packet every time The execution state of card, and there are timeout mechanisms, if it find that certain reception state is failure and timeout case occurs, if two Kind of situation exists simultaneously, and represents data-bag lost, or operation is unsuccessful, and server will use the FPGA board of error ID at this time MAC and IP address recombinate a unicast packet be transmitted directly to corresponding FPGA board, with reach quick response error machine The purpose of system.

Due to the default ID number that FPGA board is arranged there are one according to the sequence of factory, guarantee the ID of each FPGA board It independently and does not repeat, server confirms there are how many FPGA boards in current local area network by broadcast packet, and gives board used Fixed MAC Address and IP address are configured, the long-range file that updates all is sent to all FPGA by way of broadcast packet later Board is remotely updated, all FPGA board reply data packets, synchronizing information is completed, if server is sent out in communication process Some existing FPGA board communication mistake individually can send unicast packet to error FPGA board, until being finally reached all The purpose that FPGA board remotely updates.Last server sends remote loading order by way of broadcast again, makes FPGA board Load recent program.Broadcast data packet form of this method due to using Ethernet, greatly shortens the time remotely updated, right All FPGA boards are updated there are Error disposal mechanism, enhance the reliability of system, and due to only using existing network interface card electricity Road does not need to carry out other modifications, avoids being significantly increased for hardware cost.

The remote update system of FPGA board in a kind of local area network provided by the embodiments of the present application is introduced below, under FPGA board in the remote update system and a kind of above-described local area network of FPGA board in a kind of local area network of text description Method for remote updating can correspond to each other reference.

Referring to Fig. 3, Fig. 3 is the remote update system knot of FPGA board in a kind of local area network provided by the embodiment of the present application Structure schematic diagram, the system include:

Confirmation module 100, for sending the first broadcast packet to the FPGA board, first broadcast packet includes that inquiry is asked It asks, with the board ID of the determination FPGA board;

Address assignment module 200, for sending the second broadcast packet to the FPGA board, to be according to the node ID The FPGA board distribution MAC Address and IP address;

Long-range update module 300, for sending third broadcast packet in local area network, so that described in FPGA board read-write Rpd in third broadcast packet, which updates file and updates file according to the rpd, carries out board update.

Based on the above embodiment, as preferred embodiment, further includes:

Fault-tolerant module, for when any of third broadcast packet and subsequent all broadcast packets send failure or send time-out When, unicast packet, which is reassembled into, using the corresponding MAC Address of the FPGA board and IP address is sent to the FPGA board.

Present invention also provides a kind of computer readable storage mediums, have computer program thereon, the computer program It is performed and step provided by above-described embodiment may be implemented.The storage medium may include: USB flash disk, mobile hard disk, read-only deposit Reservoir (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or The various media that can store program code such as CD.

Present invention also provides a kind of FPGA boards to update server, may include memory and processor, the storage There is computer program in device, when the processor calls the computer program in the memory, above-mentioned implementation may be implemented Step provided by example.Certainly it can also include various network interfaces, the components such as power supply that the described FPGA board, which updates server,.

Each embodiment is described in a progressive manner in specification, the highlights of each of the examples are with other realities The difference of example is applied, the same or similar parts in each embodiment may refer to each other.For embodiment provide system and Speech, since it is corresponding with the method that embodiment provides, so being described relatively simple, related place is referring to method part illustration .

Specific examples are used herein to illustrate the principle and implementation manner of the present application, and above embodiments are said It is bright to be merely used to help understand the present processes and its core concept.It should be pointed out that for the ordinary skill of the art For personnel, under the premise of not departing from the application principle, can also to the application, some improvement and modification can also be carried out, these improvement It is also fallen into the protection scope of the claim of this application with modification.

It should also be noted that, in the present specification, relational terms such as first and second and the like be used merely to by One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning Covering non-exclusive inclusion, so that the process, method, article or equipment for including a series of elements not only includes that A little elements, but also including other elements that are not explicitly listed, or further include for this process, method, article or The intrinsic element of equipment.In the absence of more restrictions, the element limited by sentence "including a ...", is not arranged Except there is also other identical elements in the process, method, article or apparatus that includes the element.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:用于备份聊天记录的方法、终端设备和计算机可读介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!