Remote updating method and system of drilling machine edge sensing and operation module

Through the FPGA module in the edge sensing and computing module of the drilling rig, 4G communication is used for remote updating, which solves the problem of high labor and time costs of traditional updating methods, achieves fast, stable and extensive neural network model updating, and reduces data loss. risk.

CN118733094APending Publication Date: 2024-10-01SOUTHWEST PETROLEUM UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410835461.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-26
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

In the existing technology, the neural network model update of the drilling rig's edge sensing and computing module relies on the traditional download line method, which results in high manpower and time costs, and it is easy to miss updates, making it impossible to achieve rapid iteration and wide coverage.

Method used

Use the FPGA module to perform remote updates through 4G communication, use Python scripts to convert MCU and FPGA upgrade files into files issued by the server, and use DDR3 cache and RFIFO packaging to achieve simultaneous upgrades of multiple devices, and are compatible with different communication protocols to ensure data transmission. Stability and security.

Benefits of technology

Through the wide coverage of 4G communication, the neural network model can be quickly transmitted, reducing labor costs and time, enabling real-time observation of the upgrade process, reducing the risk of data loss, and improving the stability and compatibility of updates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733094A_ABST
    Figure CN118733094A_ABST
Patent Text Reader

Abstract

The invention provides a remote updating method and system for a drilling machine edge sensing and operation module, and the method comprises the steps: converting a newest neural network model firmware into a bin file, transmitting the bin file to an FPGA through 4G through a server terminal, caching the bin file to a DDR, transmitting the cached data to a drilling machine MCU through compatible communication, and updating a neural network model. According to the invention, the FPGA program is remotely updated by issuing the FPGA firmware, so that different communication protocols are output to update the MCU. The method is used for remotely updating the drilling machine edge perception neural network model, and the model is updated for the drilling machine to be suitable for various environments, so that an application program is closer to data sources such as Internet of Things equipment, local terminal equipment or an edge server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of 4G communication, remote updating and flash operation, and in particular to a remote updating method and system for a drilling rig edge sensing and computing module. Background Art

[0002] The edge sensing and computing module mainly uses the neural network model to perform edge computing to obtain some data, which can be used to protect equipment from damage due to overheating, monitor the performance of factories or production lines, optimize local or factory supply chains every two days, predict equipment failures and actively report schedules, etc. Before edge computing, the collected data was sent to the data center through the network for cloud processing, which took a long time. Edge computing can greatly reduce this computing time, so the calculated neural network model is solidified in the MCU's flash and calculated through the chip.

[0003] However, since the composition of the neural network will continue to change with the environment and time, the neural network model will be solidified at regular intervals. However, using traditional updates to upgrade the firmware through a download line will greatly increase labor costs and time costs, and there may even be situations where people forget to update the firmware regularly. Remote updates can not only update multiple devices, but only require one terminal operation, which greatly reduces labor costs and time costs, and allows professionals to have control.

[0004] 4G communication not only has a fast transmission rate, but also has a wide communication coverage, so all devices can be upgraded anywhere. FPGA can communicate with the upgrade communication protocols required by different devices and transmit the firmware data required for the upgrade. Summary of the invention

[0005] The purpose of the present invention is to solve the defects of the above-mentioned prior art and provide a remote update method and system for the edge perception and computing module of the drilling rig. By utilizing the high speed and reliability of FPGA, a neural network model can be remotely upgraded for the device bound to the server, and it can also be applied to various communication protocols that accept upgraded firmware.

[0006] The present invention adopts the following technical solution:

[0007] A remote update method for a drilling rig edge sensing and computing module, comprising:

[0008] S1. Use the Python script to convert the MCU upgrade bin file into a server-distributed bin file.

[0009] S2. Upload the bin file generated by S1 to the remote server and download the data to FPGA;

[0010] S3.FPGA receives the sent data and stores it in DDR3 for cache;

[0011] S4.FPGA reads the data from RFIFO and packages it;

[0012] S5.MCU receives the communication protocol from CAN.

[0013] Furthermore, when S1 is converted into a bin file sent by the server, its frame format is as follows:

[0014] The frame header is two bytes of data, 0xAA and 0x55, and data transmission will begin;

[0015] The 4 bytes of the frame header 0x80, 0x22, 0x01, and 0x01 indicate the selection of mode and firmware. 0x80 indicates the start frame of a group of data, 0x22 indicates the function code, the third byte 0x01 indicates the MCU upgrade data, and the fourth byte 0x01 indicates the upgrade using the CAN protocol between the FPGA and the MCU.

[0016] The frame header consists of 4 bytes: 0x80, 0x23, 0x00, and 0x14, which represent the data packet and the length of the data packet. The following bytes represent the data.

[0017] The frame header is 0x80, 0x2a, 0x2f, 0x0a, 0x07. These 4 bytes indicate the end of a group of data packets and the CRC they contain.

[0018] The firmware ends the frame header with two bytes 0x55 and 0xAA, indicating the end of data transmission.

[0019] Furthermore, S2 specifically includes:

[0020] The IP of the device to be upgraded is selected through the server. The data sent is in units of a group of data. Each group of data sent must be responded to by the FPGA. If the FPGA responds with 0xAA data, it means that the FPGA has received the group of data. Otherwise, it responds with 0x55 data, which means that the group of data received is wrong. Then the server will make a judgment and resend the group of data until the response is successful.

[0021] Furthermore, in S2, when the data frame currently sent is 0x55 and 0xAA, it indicates that the firmware has been sent successfully.

[0022] Further, S3 includes: the data received by the FPGA receiving module is cached to 256 bits, then written into the WFIFO, and continuously received and written, because its DDR3 can use the burst length mode, and can use the rising and falling edges to work at the same time, so the bit width in the WFIFO is 256 bits. When the data depth in the WFIFO is greater than 64, then the data in the WFIFO is read and written into the DDR3 in conjunction with the storage address. When the FPGA receives the end frame, it waits for the data in the WFIFO to be written into the DDR3 until the writing into the DDR3 is completed.

[0023] Furthermore, S3 is always satisfied during the entire writing process. When the RFIFO data is less than 64, the data is read from DDR3 and written into RFIFO.

[0024] Further, S4 specifically includes: when RFIFO is receiving data, if RFIFO data is not empty, the data can be taken out for packet assembly. When RFIFO is not empty, it starts to send upgrade data to MCU. The first data sent is the start frame format: BB55

[0025] Secondly, send the length of the data to be sent, which takes up two bytes.

[0026] Then, read the data stream from the RFIFO and send the data out.

[0027] Finally, a group of 55BB is sent as the end frame of this data packet.

[0028] Furthermore, S5 specifically includes: when the MCU receives the start frame of the firmware, it immediately jumps into the Bootloader, then unpacks the sent data, and then writes the unpacked data into the FLASH area block storing the program, and backs up the previous program to another flash block before writing the data into the FLASH area. If the MCU is powered off or the communication is interrupted when writing the flash, if there is no correct program flag when it is powered on again, then the FLASH data is read and written into the FLASH block storing the program.

[0029] A method for remotely upgrading an FPGA, comprising:

[0030] S1. Use a Python script to convert the FPGA upgrade Coe (Vivado solidification file) file into a bin file sent by the server;

[0031] S2. Upload the bin file generated above to the remote server and download the data to FPGA.

[0032] S3.FPGA receives the sent data and stores it in DDR3 for cache.

[0033] S4.FPGA reads the data in RFIFO and writes it to FLASH via QSPI to complete the upgrade of FPGA firmware.

[0034] A remote update system for a drilling rig edge sensing and computing module, comprising:

[0035] The server receives and converts the MCU upgrade bin file into a bin file sent by the server;

[0036] The FPGA module receives the bin file sent by the server and stores it in DDR3 for cache, reads the data from RFIFO and packages it;

[0037] MCU receives data sent by the FPGA module to perform firmware upgrade.

[0038] Beneficial effects of the present invention:

[0039] The present invention utilizes FPGA devices to drive 4G modules, and manually uploads firmware data to the server, thereby achieving upgrades and updates in every location covered by the 4G network. The upgrade is responsive, which can not only observe the upgrade process in real time but also prevent data loss, thereby ensuring the stability and security of the upgrade process. Since the neural network model of the drilling rig edge perception and computing module has the disadvantages of fast iteration and fast update, remote upgrade can greatly reduce labor and time waste. The present invention also has the function of remotely upgrading the FPGA program. If there is no corresponding upgraded communication protocol, it can be remotely developed and downloaded, greatly reducing the time to the site. Through the advantages of 4G's wide coverage and fast transmission speed, remote upgrade of the neural network model is more convenient, and multiple communication protocols are upgraded and have strong compatibility. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 This is a block diagram of FPGA remote update according to an embodiment of the present invention;

[0041] Figure 2 A data graph for transmitting and receiving the neural network firmware according to an embodiment of the present invention;

[0042] Figure 3 This is a data diagram for transferring and sending FPGA firmware according to an embodiment of the present invention;

[0043] Figure 4 The data flow chart of the server sending data according to the embodiment of the present invention;

[0044] Figure 5 This is a flow chart of FPGA receiving and sending data according to an embodiment of the present invention;

[0045] Figure 6 This is a DDR control model diagram of an embodiment of the present invention;

[0046] Figure 7 Flow chart of sending MCU protocol packet grouping according to an embodiment of the present invention;

[0047] Figure 8 This is a flowchart of QSPI writing Flash in an embodiment of the present invention;

[0048] Fig. 9 It is a flow chart of the steps of the present invention. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention is described clearly and completely below. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0050] like Figure 1 , Fig. 9 As shown, a first aspect of an embodiment of the present invention provides a remote update method of a drilling rig edge sensing and computing module, comprising the following steps:

[0051] S1. Use the Python script to convert the MCU upgrade bin file into the server-issued bin file;

[0052] Since the upgrade firmware stored in the MCU does not have any flag, it is impossible to notify the FPGA when the reception is completed, and the correctness of the received data is unknown. Figure 2 As shown, the bin file is converted into a regular bin file through a script to facilitate notifying the FPGA when to start receiving, what data is received, and what data type is sent to the FPGA.

[0053] When converted into a regular bin file, its frame format is explained as follows:

[0054] The frame header consists of two bytes of data: 0xAA and 0x55. Its purpose is to tell the FPGA that data transmission is about to begin.

[0055] The four bytes of the frame header 0x80, 0x22, 0x01, and 0x01 indicate the mode and firmware selection. 0x80 indicates the start frame of a group of data, 0x22 indicates the function code (data type mode), the third byte 0x01 indicates the MCU upgrade data, and the fourth byte 0x01 indicates the upgrade using the CAN protocol between the FPGA and the MCU.

[0056] The frame header consists of 4 bytes: 0x80, 0x23, 0x00, and 0x14, which represent the data packet and the length of the data packet. The following bytes represent the data. The 8th byte 0x01 after 0x80 represents the first row of data in the extended column. Similarly, the 0x02 after 0x80 represents the second row of data in the extended column.

[0057] The frame header consists of 4 bytes: 0x80, 0x2a, 0x2f, 0x0a, and 0x07, which indicate the end of a group of data packets and the CRC they contain. 0x80 is the end mark, and 0x0a and 0x07 are the CRC16 check values ​​of this group of data packets.

[0058] The firmware ends the frame header with two bytes 0x55 and 0xAA, indicating the end of data transmission.

[0059] S2. Upload the bin file generated by S1 to the remote server and download the data to FPGA. Figure 4 As shown, including:

[0060] The IP of the device to be upgraded is selected through the server. The data sent is in units of a group of data. Each group of data sent must be responded to by the FPGA. If the FPGA responds with 0xAA data, it means that the FPGA has received the group of data. Otherwise, it responds with 0x55 data, which means that the group of data received is wrong. Then the server will make a judgment and resend the group of data until the response is successful.

[0061] The data frame sent at the moment is 0x55, 0xAA, indicating that the firmware has been sent successfully.

[0062] S3.FPGA receives the sent data and stores it in DDR3 for cache, such as Figure 5 As shown, the data sent by the server is sent through the 4G network, and the data received by the FPGA module needs to be cached. Because the firmware data volume is large, the 4G transmission rate is fast and the CAN transmission rate is slow, the data received by the FPGA must be cached.

[0063] When the data size of an upgraded firmware is large, it can reach 500kb, so if RAM or registers are used, a lot of resources will be wasted and there is not enough space. Therefore, a larger memory DDR3 should be used for storage. Not only is its storage speed fast, but the memory can reach 128M.

[0064] The data received by the FPGA receiving module is cached to 256 bits and written into the WFIFO. It is continuously received and written because its DDR3 can use the burst length mode and can work with the rising and falling edges at the same time. Therefore, the bit width in the WFIFO is 256 bits. When the data depth in the WFIFO is greater than 64, the data in the WFIFO is read and written into the DDR3 in conjunction with the storage address.

[0065] When the FPGA receives the end frame, it waits for the data in the WFIFO to be written into the DDR3 until the writing into the DDR3 is completed.

[0066] During the entire writing process, when the RFIFO data is less than 64, the data is read from DDR3 and written into RFIFO.

[0067] S4.FPGA reads the data from RFIFO and packages it, such as Figure 6 As shown, including:

[0068] When RFIFO is receiving data, if the RFIFO data is not empty, the data can be taken out for packet assembly.

[0069] When RFIFO is not empty, it starts sending upgrade data to MCU. The first data sent is the start frame format: BB55

[0070] Secondly, send the length of the data to be sent, which takes up two bytes.

[0071] Then, read the data stream from the RFIFO and send the data out.

[0072] Finally, a group of 55BB is sent as the end frame of this data packet.

[0073] S5.MCU receives the communication protocol from CAN, such as Figure 7 As shown, including:

[0074] When the MCU receives the start frame of the firmware, it immediately jumps into the Bootloader, then unpacks the data sent, and then writes the unpacked data into the FLASH area block that stores the program. Before writing data to the FLASH area, the previous program will be backed up to another FLASH block.

[0075] If the MCU is powered off or communication is interrupted when writing FLASH, if there is no correct program flag when the MCU is powered on again, the FLASH data will be read and written into the FLASH block that stores the program.

[0076] Based on the same inventive concept, a second aspect of an embodiment of the present invention provides a method for remotely upgrading an FPGA, comprising:

[0077] S1. Use a Python script to convert the FPGA upgrade Coe (Vivado solidification file) file into a bin file sent by the server;

[0078] Since the FPGA upgrade firmware does not have any flags, it is impossible to notify the FPGA when to start receiving data or when to complete data reception, and the correctness of the received data is still unknown. Figure 3 As shown, the bin file is converted into a regular bin file through a script to facilitate notifying the FPGA when to start receiving, what data is received, and what data type is sent to the FPGA.

[0079] When converted into a regular bin file, its frame format is explained as follows:

[0080] The frame header consists of two bytes of data: 0xAA and 0x55. Its purpose is to tell the FPGA that data transmission is about to begin.

[0081] The frame header consists of 4 bytes: 0x80, 0x22, 0x00, and 0x01. These 4 bytes represent the mode and firmware selection. 0x80 represents the start frame of a group of data, 0x22 represents the function code (data type mode), the third byte 0x00 represents the FPGA firmware upgrade data, and the fourth byte 0x01 is meaningless.

[0082] The frame header consists of 4 bytes: 0x80, 0x23, 0x00, and 0x14, which represent the data packet and the length of the data packet. The following bytes represent the data. The 8th byte 0x01 after 0x80 represents the first row of data in the extended column. Similarly, the 0x02 after 0x80 represents the second row of data in the extended column.

[0083] The frame header consists of 4 bytes: 0x80, 0x2a, 0x2f, 0x0a, and 0x07, which indicate the end of a group of data packets and the CRC they contain. 0x80 is the end mark, and 0x0a and 0x07 are the CRC16 check values ​​of this group of data packets.

[0084] The firmware ends the frame header with two bytes 0x55 and 0xAA, indicating the end of data transmission.

[0085] S2. Upload the bin file generated above to the remote server and download the data to FPGA. Figure 4 As shown, including:

[0086] The IP of the device to be upgraded is selected through the server. The data sent is in units of a group of data. Each group of data sent requires a response from the FPGA. If the FPGA responds with data oxAA, it means that the FPGA has received the group of data. Otherwise, it responds with data 0x55, indicating that an error has occurred in receiving the group of data. The server will then make a judgment and resend the group of data until the response is successful.

[0087] When the data frame sent is 0x55, 0xAA, it means that the firmware has been sent successfully.

[0088] S3.FPGA receives the sent data and stores it in DDR3 for cache, such as Figure 5 As shown, the steps are as follows: the data sent by the server is sent through the 4G network, and the data received by the FPGA module needs to be cached. Because the firmware data volume is large, the 4G transmission rate is fast and the CAN transmission rate is slow, the data received by the FPGA must be cached.

[0089] When the data size of an upgraded firmware is large, it can reach 500kb, so if RAM or registers are used, a lot of resources will be wasted and there is not enough space. Therefore, larger content DDR3 should be used for storage, which not only has a fast storage speed, but also has a memory of up to 128M.

[0090] The data received by the FPGA receiving module is cached in 256 bits and written into the WFIFO. It is continuously received and written because its DDR3 can use the burst length mode and can work with the rising and falling edges at the same time. Therefore, the bit width in the WFIFO is 256 bits. When the data depth in the WFIFO is greater than 64, the data in the WFIFO is read and written into the DDR3 in accordance with the storage address.

[0091] When the FPGA receives the end frame, it waits for the data in the WFIFO to be written into DDR3 until the data is written into DDR.

[0092] During the entire writing process, it is always satisfied that when the RFIFO data is less than 64, the winning data is read from DDR3 and written into RFIFO.

[0093] S4.FPGA reads the data in RFIFO and writes it to FLASH via QSPI. Figure 8 As shown, including:

[0094] Operate FLASH through QSPI, erase FLASH before reading data in RFIFO, and then write to FLASH while reading register status. Because the data in LUT is read into RAM when FPGA is powered on, operating FLASH will not affect the currently running program during operation.

[0095] The remote update method and system of the drilling rig edge perception and computing module in the embodiment of the present invention also include some BOOTLOADER writing methods and methods, which are not elaborated in the embodiment of the present invention.

[0096] Based on the same concept, the third aspect of the embodiment also provides a remote update system for a drilling rig edge sensing and computing module, including: a server, receiving and converting an upgrade bin file of an MCU into a bin file issued by the server;

[0097] The FPGA module receives the bin file sent by the server and stores it in DDR3 for cache, reads the data from RFIFO and packages it;

[0098] MCU receives data sent by the FPGA module to perform firmware upgrade.

[0099] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A remote update method for a drilling rig edge sensing and computing module, characterized in that ,include: S1. Convert the MCU upgrade bin file to the server-issued bin file; S2. Upload the bin file generated by S1 to the remote server and download the data to FPGA; S3.FPGA receives the sent data and stores it in DDR3 for cache; S4.FPGA reads the data from RFIFO and packages it; S5.MCU receives the communication protocol from CAN.

2. The method according to claim 1, characterized in that ,When S1 is converted to a bin file sent by the server, its frame format is as follows: The frame header is two bytes of data, 0xAA and 0x55, and data transmission will begin; The 4 bytes of the frame header 0x80, 0x22, 0x01, and 0x01 indicate the selection of mode and firmware. 0x80 indicates the start frame of a group of data, 0x22 indicates the function code, the third byte 0x01 indicates the MCU upgrade data, and the fourth byte 0x01 indicates the upgrade using the CAN protocol between the FPGA and the MCU. The frame header consists of 4 bytes: 0x80, 0x23, 0x00, and 0x14, which represent the data packet and the length of the data packet. The following bytes represent the data. The 8th byte 0x01 after 0x80 represents the first row of data in the extended column. Similarly, the 0x02 after 0x80 represents the second row of data in the extended column. The frame header consists of 4 bytes: 0x80, 0x2a, 0x2f, 0x0a, and 0x07, which indicate the end of a group of data packets and the CRC they contain. 0x80 is the end mark, and 0x0a and 0x07 are the CRC16 check values ​​of this group of data packets. The firmware ends the frame header with two bytes 0x55 and 0xAA, indicating the end of data transmission.

3. The method according to claim 1, characterized in that: S2 specifically includes: The IP of the device to be upgraded is selected through the server. The data sent is in units of a group of data. Each group of data sent must be responded to by the FPGA. If the FPGA responds with 0xAA data, it means that the FPGA has received the group of data. Otherwise, it responds with 0x55 data, which means that the group of data received is wrong. Then the server will make a judgment and resend the group of data until the response is successful.

4. The method according to claim 1, characterized in that In S2, the data frame sent currently is 0x55 and 0xAA, indicating that the firmware has been sent successfully.

5. The method according to claim 1, characterized in that S3 Including: the data received by the FPGA receiving module is cached to 256 bits, then written into the WFIFO, and continuously received and written. Because its DDR3 uses the burst length mode and uses the rising and falling edges to work simultaneously, the bit width in the WFIFO is 256 bits. When the data depth in the WFIFO is greater than 64, the data in the WFIFO is read and written into the DDR3 in conjunction with the storage address. When the FPGA receives the end frame, it waits for the data in the WFIFO to be written into the DDR3 until the writing into the DDR3 is completed.

6. The method according to claim 1, characterized in that S3 is always satisfied during the entire writing process. When the RFIFO data is less than 64, the data is read from DDR3 and written into RFIFO.

7. The method according to claim 1, characterized in that S4 specifically includes: when RFIFO is receiving data, if RFIFO data is not empty, the data is taken out for packet assembly, and when RFIFO is not empty, the upgrade data is sent to the MCU; First, the data sent is the start frame format: BB55; Secondly, send the length of the data to be sent, which takes up two bytes; Then, read the data stream from RFIFO and send the data out; Finally, a group of 55BB is sent as the end frame of the data packet.

8. The method according to claim 1, characterized in that S5 specifically includes: when the MCU receives the start frame of the firmware, it immediately jumps into the Bootloader, then unpacks the sent data, and then writes the unpacked data into the FLASH area block that stores the program. Before writing data into the FLASH area, the previous program will be backed up to another FLASH area block.

9. The method according to claim 1, characterized in that: If the MCU in S5 is powered off or communication is interrupted while writing FLASH, if there is no correct program flag when the MCU is powered on again, the FLASH data will be read and written into the FLASH block storing the program.

10. A remote update system for a drilling rig edge sensing and computing module, characterized in that: The remote update method of the drilling rig edge sensing and computing module according to claim 1 is implemented, comprising: The server receives and converts the MCU upgrade bin file into a bin file sent by the server; The FPGA module receives the bin file sent by the server and stores it in DDR3 for cache, reads the data from RFIFO and packages it; MCU receives data sent by the FPGA module to perform firmware upgrade.