Firmware upgrading method and device, interface expansion equipment, readable storage medium and chip

By expanding the device through interface and using anti-interference serial port technology, the compatibility and security issues of firmware upgrades for electro-hydraulic control equipment have been resolved, enabling stable and convenient firmware upgrades in low-end MCU devices and explosion-proof environments.

CN121349490APending Publication Date: 2026-01-16SANY HEAVY EQUIP CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511496248.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-20
Publication Date
2026-01-16

AI Technical Summary

Technical Problem

Existing technologies have low compatibility with firmware upgrades in electro-hydraulic control equipment, especially in low-end MCU devices and explosion-proof environments, where they have limited applicability, poor hardware compatibility, insufficient safety, poor ease of operation, and reliability issues.

Method used

An interface expansion device is used to bridge the mobile storage device and the electro-hydraulic control device. Firmware file transmission is performed through an anti-interference serial port, including file attribute parsing, data packet verification, and upgrade file verification mechanisms to ensure data integrity and security.

Benefits of technology

It improves the compatibility and security of firmware upgrades for electro-hydraulic control equipment, reduces operational complexity, enhances stability and reliability in harsh environments, and reduces the risk of production interruption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121349490A_ABST
    Figure CN121349490A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a firmware upgrading method and device, interface expansion equipment, a readable storage medium and a chip, the firmware upgrading method is applied to the interface expansion equipment, and the interface expansion equipment is in pluggable connection with a mobile memory. The interface expansion device is configured to read a firmware file from the mobile memory and is in communication connection with the electro-hydraulic control device through an anti-interference serial port. The firmware upgrading method comprises the following steps: acquiring the firmware file with a specified file name in the mobile memory; receiving a start frame sent by the boot loader after cold start of the electro-hydraulic control equipment; determining at least one data packet corresponding to the firmware file; transmitting the data packet to the electro-hydraulic control equipment through an anti-interference serial port, and determining an upgrading file; and verifying the upgrade file, and updating the application firmware in the electro-hydraulic control equipment according to the upgrade file after the verification is passed. According to the scheme, the compatibility of firmware upgrading of the electro-hydraulic control equipment is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of device upgrading, in particular to a firmware upgrading method and device, an interface expansion device, a readable storage medium and a chip. BACKGROUND

[0002] In the field of industrial electro-hydraulic control devices, firmware upgrading is an important technical means to ensure the performance optimization and safe operation of the devices. The current mainstream upgrading methods mainly rely on Universal Serial Bus (USB) interface direct connection or network remote upgrading. These methods face many challenges in complex industrial environments. In particular, for low-end Microcontroller Unit (MCU) devices without USB host function, and for explosion-proof occasions that require strict electrical isolation, the existing upgrading solutions have obvious applicability limitations, and the compatibility of firmware upgrading for electro-hydraulic control devices is not high. SUMMARY

[0003] The embodiments of the present application aim to provide a firmware upgrading method, device, interface expansion device, readable storage medium and chip, which can solve the problem of low compatibility of firmware upgrading for electro-hydraulic control devices.

[0004] Therefore, the embodiments of the first aspect of the present application provide a firmware upgrading method.

[0005] The embodiments of the second aspect of the present application provide a firmware upgrading device.

[0006] The embodiments of the third aspect of the present application provide an interface expansion device.

[0007] The embodiments of the fourth aspect of the present application provide a readable storage medium.

[0008] The embodiments of the fifth aspect of the present application provide a chip.

[0009] In order to achieve the above-mentioned purpose, the embodiments of the first aspect of the present application provide a firmware upgrading method applied to an interface expansion device, the interface expansion device and a mobile storage are pluggable connected, the interface expansion device is configured to read a firmware file from the mobile storage and communicate with an electro-hydraulic control device through an anti-interference serial port, the interface expansion device is independent of the electro-hydraulic control device, the firmware upgrading method comprises: obtaining the firmware file with a specified file name in the mobile storage; receiving a start frame sent by a bootloader after a cold start of the electro-hydraulic control device; determining at least one data packet corresponding to the firmware file; transmitting the data packet to the electro-hydraulic control device through the anti-interference serial port to determine an upgrade file; verifying the upgrade file, and updating an application firmware in the electro-hydraulic control device according to the upgrade file after the verification is passed.

[0010] The firmware upgrading method is applied to the interface expansion device for firmware upgrading, and the interface expansion device bridges the mobile storage and the electro-hydraulic control device to upgrade the application program firmware in the electro-hydraulic control device through the firmware file stored in the mobile storage.

[0011] In some technical solutions, after receiving the starting frame sent by the bootloader after the cold start of the electro-hydraulic control device, the firmware upgrading method further comprises: determining the file attribute corresponding to the firmware file; determining the file header package according to the file attribute; sending the file header package to the electro-hydraulic control device, and receiving the response signal of the electro-hydraulic control device to the file header package.

[0012] In the present solution, when the interface expansion device detects the starting frame, the interface expansion device analyzes the file attribute of the firmware file, and the file attribute comprises the file size of the firmware file and the check code corresponding to the firmware file. The file header package is determined according to the file size and the check code, and the file header package is sent to the electro-hydraulic control device.

[0013] In some technical solutions, the data package is transmitted to the electro-hydraulic control device through the anti-interference serial port, comprising: obtaining the additional check information corresponding to each data package; sending each data package with additional check information through the anti-interference serial port in sequence; receiving the response signal of the electro-hydraulic control device to the data package; obtaining a predetermined timeout time; if the response signal of the electro-hydraulic control device to the data package is not received within the predetermined timeout time, the corresponding data package is automatically retransmitted.

[0014] In the present solution, after the electro-hydraulic control device sends the response signal to the file header package, the interface expansion device starts the fragmentation transmission of the firmware file, that is, each data package with additional check information is sent through the 485 serial port in sequence. After receiving each data package, the electro-hydraulic control device sends an acknowledgement signal (ACK) to the interface expansion device to confirm the data package reception state. If the interface expansion device does not receive the response signal of the electro-hydraulic control device to the data package within the predetermined timeout time, the automatic retransmission mechanism of the interface expansion device is triggered, and the interface expansion device retransmits the data package without the response signal within the predetermined timeout time.

[0015] In some embodiments, the upgrade file is optionally checked, and after the check passes, the application firmware in the electro-hydraulic control device is updated according to the upgrade file, including: controlling the electro-hydraulic control device to assemble all received data packets to obtain the upgrade file; obtaining a global check value of the upgrade file; obtaining a preset expected value corresponding to the firmware file; comparing the global check value and the preset expected value to determine whether the check passes; after the check passes, controlling the electro-hydraulic control device to perform an erasing operation to clear the original application firmware, and writing the upgrade file to the application area; wherein the electro-hydraulic control device checks the additional check information corresponding to the data packet after receiving each data packet; if the check fails, a negative acknowledgement frame is sent to the interface expansion device to request retransmission of the data packet.

[0016] In this scheme, when the electro-hydraulic control device completes all data packet reception, the entire upgrade file is checked, and after the check passes, the application (APP) area flash memory of the electro-hydraulic control device is erased, and the new firmware is written page by page. After writing is completed, the electro-hydraulic control device jumps from the Bootloader area to the APP area for execution, and returns a success code (for example, 0xAA) through the 485 serial port. If the check fails, the Bootloader sends a negative acknowledgement (NAK) frame to the interface expansion device to request retransmission of the corresponding abnormal data packet.

[0017] In some embodiments, the upgrade file is optionally checked, and after the check passes, the application firmware in the electro-hydraulic control device is updated according to the upgrade file, further including: determining the number of repeated requests corresponding to the negative acknowledgement frame; obtaining a predetermined threshold and a backup firmware; if the number of repeated requests exceeds the predetermined threshold, aborting the firmware upgrade and rolling back to the backup firmware.

[0018] In this scheme, after the Bootloader sends a negative acknowledgement frame to request retransmission, if the number of consecutive repeated requests exceeds the predetermined threshold, the firmware upgrade is aborted and rolled back to the backup firmware.

[0019] In some embodiments, the firmware upgrade method further includes: obtaining a predetermined waiting time; if the interface expansion device does not detect a start frame within the predetermined waiting time, entering a low-power sleep mode and waking up periodically for detection.

[0020] In this scheme, the predetermined waiting time is a pre-set time parameter, and the predetermined waiting time defines the maximum duration of the interface expansion device continuously running and listening to the anti-interference serial port after the first power-on or each wake-up. The predetermined waiting time should ensure that the entire process from cold start to the Bootloader issuing a start frame is covered.

[0021] The embodiment of the second aspect of the application provides a firmware upgrading device, the firmware upgrading device comprises: a file acquisition module configured to acquire a firmware file with a specified file name in a mobile storage; a start confirmation module configured to receive a start frame sent by a boot loader after a cold start of an electro-hydraulic control device; a data segmentation module configured to determine at least one data packet corresponding to the firmware file; a data transmission module configured to transmit the data packet to the electro-hydraulic control device through an anti-interference serial port to determine an upgrade file; and a verification upgrading module configured to verify the upgrade file and update an application firmware in the electro-hydraulic control device according to the upgrade file after the verification is passed.

[0022] The embodiment of the third aspect of the application provides an interface expansion device, the interface expansion device and the mobile storage are plug-in connected, the interface expansion device is configured to read a firmware file from the mobile storage and is in communication connection with the electro-hydraulic control device through an anti-interference serial port, and the interface expansion device is independent of the electro-hydraulic control device; the interface expansion device comprises the firmware upgrading device of the second aspect.

[0023] The embodiment of the fourth aspect of the application provides a readable storage medium, the readable storage medium stores a program or instructions, and the program or instructions are executed by a processor to realize the steps of the firmware upgrading method in the first aspect.

[0024] The embodiment of the fifth aspect of the application provides a chip, the chip comprises a processor and a communication interface, the communication interface is coupled with the processor, the processor is configured to run a program or instructions to realize the steps of the firmware upgrading method in the first aspect.

[0025] Additional aspects and advantages of the technical solution of the application will become apparent from the following description part or be understood through the practice of the application. BRIEF DESCRIPTION OF DRAWINGS

[0026] Figure 1 One of flowcharts of the firmware upgrading method according to the application is shown; Figure 2 Two of flowcharts of the firmware upgrading method according to the application are shown; Figure 3 Three of flowcharts of the firmware upgrading method according to the application are shown; Figure 4 Four of flowcharts of the firmware upgrading method according to the application are shown; Figure 5 Five of flowcharts of the firmware upgrading method according to the application are shown; Figure 6 A structural schematic block diagram of the firmware upgrading device according to the application is shown; Figure 7 A connection schematic diagram of the interface expansion device according to the application is shown; Figure 8 Fig. 1 shows a connection diagram of an upgrade stick according to an embodiment of the present application; Figure 9 Fig. 2 shows a protocol interaction timing flow diagram according to the present application.

[0027] wherein, Figure 6 and Figure 7 The correspondence between the reference signs and the component names in the drawings is as follows: 900: firmware upgrade device; 902: file acquisition module; 904: start confirmation module; 906: data segmentation module; 908: data transmission module; 910: check upgrade module; 100: interface expansion device; 102: mobile storage; 104: electro-hydraulic control device. DETAILED DESCRIPTION

[0028] In order to more clearly understand the above-mentioned purposes, features and advantages of the embodiments of the present application, the embodiments of the present application are further described in detail below in combination with the drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0029] In the following description, many specific details are set forth in order to provide a thorough understanding of the present application, however, embodiments of the present application can also be implemented in other ways different from those described herein, therefore, the scope of protection of the present application is not limited to the specific embodiments disclosed below.

[0030] The mainstream upgrade mode mainly relies on USB interface direct connection or network remote upgrade. In the USB direct connection upgrade scheme, the device needs to have USB host function, read the firmware through the USB interface directly connected to the flash mobile storage (U disk), and uses the standard file system access method; in the network remote upgrade scheme, the firmware needs to be transmitted through Ethernet or wireless local area network (WIreless Fidelity, WiFi), and the network remote upgrade scheme relies on the device network module and needs to use the Transmission Control Protocol / Internet Protocol (TCP / IP) protocol to ensure the transmission reliability.

[0031] These solutions have been widely used in conventional industrial equipment, but there are obvious deficiencies in the special scenarios of electro-hydraulic control equipment: poor hardware compatibility: low-end MCUs generally lack USB host functions and cannot directly read U disks; network upgrade solutions require additional network modules, increasing hardware costs. Poor electrical safety: USB interfaces are susceptible to electromagnetic interference in industrial sites; direct electrical connections pose a short circuit risk and do not meet explosion-proof requirements; network interfaces pose a security risk of illegal intrusion. Poor operational convenience: requires professional equipment (such as industrial computers) for upgrade; network upgrades rely on stable network environments; on-site operation processes are complex and require highly skilled personnel. Reliability issues: USB interfaces in industrial sites are prone to poor contact due to dust and moisture; network upgrades are unstable in complex electromagnetic environments; and there is a lack of dedicated upgrade fault-tolerant mechanisms.

[0032] These problems severely limit the application effect of existing technologies in the upgrade scenarios of electro-hydraulic control equipment, and there is an urgent need to develop a new upgrade solution that combines compatibility, safety, and convenience.

[0033] The firmware upgrade method, device, interface expansion equipment, readable storage medium, and chip provided by the embodiments of the present application will be described in detail below through specific embodiments and their application scenarios.

[0034] The embodiments provide a firmware upgrade method applied to an interface expansion equipment, the interface expansion equipment and a mobile storage device being pluggable connected, the interface expansion equipment being configured to read a firmware file from the mobile storage device and communicate with an electro-hydraulic control equipment through an anti-interference serial port, the interface expansion equipment being independent of the electro-hydraulic control equipment, as shown in Figure 1 The firmware upgrade method includes the following steps: Step S100: Obtain a firmware file with a specified file name in the mobile storage device; Step S102: Receive a start frame sent by a boot loader after a cold start of the electro-hydraulic control equipment; Step S104: Determine at least one data packet corresponding to the firmware file; Step S106: Transmit the data packet to the electro-hydraulic control equipment through the anti-interference serial port to determine an upgrade file; Step S108: Verify the upgrade file, and update an application firmware in the electro-hydraulic control equipment according to the upgrade file after the verification is passed.

[0035] According to the firmware upgrade method provided by the present application, the interface expansion equipment for firmware upgrade bridges the mobile storage device and the electro-hydraulic control equipment to upgrade the application firmware in the electro-hydraulic control equipment through the firmware file stored in the mobile storage device.

[0036] Specifically, the firmware file for upgrading is copied to the root directory of the mobile storage. When the mobile storage and the interface expansion device are connected and the interface expansion device is powered on, the mobile storage is read automatically. The interface expansion device searches for and acquires the firmware file with the specified file name in the file system of the mobile storage. The standardization and automation of the operation are realized by means of the specified file name, and the on-site operator does not need complex training, thereby reducing the complexity of the firmware upgrading of the electro-hydraulic control device.

[0037] When the electro-hydraulic control device is cold started (reset), the built-in Bootloader is run first instead of the main application program, that is, the Bootloader is run independently. When the Bootloader is run, the application program (APP) in the electro-hydraulic control device is not started. When the electro-hydraulic control device is restarted and cold started, the Bootloader periodically sends a specific start frame to the outside through an anti-interference serial port (for example, RS-485), and the start frame is used to indicate that the electro-hydraulic control device actively requests firmware upgrading.

[0038] The cold starting mode of the electro-hydraulic control device includes a reset key trigger, power cycle power-on, or receiving a remote reset instruction to restart.

[0039] When the electro-hydraulic control device actively requests to start, the interface expansion device is in a listening-response state. After receiving the start frame sent by the Bootloader, the interface expansion device starts to process the firmware file. The interface expansion device reads the firmware file from the mobile storage, and packages and encapsulates the firmware file according to the rules of the predetermined communication protocol. The firmware file is divided into data blocks of a preset file size, and a check code is attached to each data block.

[0040] The interface expansion device sends the divided data blocks to the electro-hydraulic control device in sequence through the anti-interference serial port. The Bootloader in the electro-hydraulic control device receives these data blocks and reassembles them into a complete binary image file in the memory, that is, determines the upgrading file. The corresponding response retransmission mechanism is set in the determined upgrading file, and the check is performed after each data packet transmission to ensure that each data packet is accurate.

[0041] After the data transmission of the interface expansion device is completed, the Bootloader performs a final check on the assembled entire upgrading file, and compares the 32-bit redundancy code (CRC32) corresponding to the upgrading file with the expected value corresponding to the firmware file. If the check passes, it proves that the upgrading file corresponding to the multiple data packets is complete and correct relative to the firmware file, and the Bootloader erases the firmware in the application program area of the electro-hydraulic control device and writes the upgrading file into the APP area. After completion, the APP area is jumped to run, and the firmware upgrading is completed.

[0042] It can be understood that low-end MCUs generally lack USB host functions and cannot directly read U disks. The method of bridging the U disk and the electro-hydraulic control device through the interface expansion device improves the compatibility of the firmware upgrade of the electro-hydraulic control device. In actual operation, the field operator only needs to insert the mobile storage into the interface expansion device and trigger the interface expansion device, without the need for professional equipment or network support, thereby improving the convenience of firmware upgrade.

[0043] Moreover, the interface expansion device is connected in communication with the electro-hydraulic control device through an anti-interference serial port. The 485 serial port has higher industrial anti-interference capability than the universal serial bus, thereby avoiding the risk of burning caused by poor electrical contact or short circuit and improving the safety of the firmware upgrade of the electro-hydraulic control device.

[0044] It should be emphasized that the Bootloader of the electro-hydraulic control device is preset with a file transfer protocol (Ymodem). After restarting, the electro-hydraulic control device sends a start frame to the interface expansion device according to the Ymodem protocol, thereby triggering the firmware upgrade process. After receiving the start frame, the interface expansion device transmits the firmware file in blocks according to the Ymodem protocol and performs data block checking during the transmission process, thereby ensuring data integrity.

[0045] The electro-hydraulic control device adopts a dual-zone storage design of Bootloader and APP zone. The Bootloader is independently run to ensure that the firmware can be rolled back in the event of a firmware upgrade failure, thereby improving data security during the firmware upgrade process. After the firmware file transmitted by the interface expansion device is completely received, the Bootloader automatically performs Flash erasing and replaces the original firmware in the APP zone, thereby completing seamless upgrade. No other device is needed to intervene during the firmware upgrade process, which is suitable for complex environments such as underground and explosion-proof, thereby ensuring the stability of the firmware upgrade process in harsh industrial environments and reducing the risk of production interruption and equipment failure rate.

[0046] Exemplarily, the interface expansion device includes but is not limited to an upgrade stick or an upgrade box.

[0047] Exemplarily, the mobile storage includes but is not limited to a flash drive (U disk), a mobile solid state disk, and a secure digital card (SD card), and the like data storage device.

[0048] In some embodiments, optionally, the specified file name in the mobile storage is a preset name, for example, ROM.bin.

[0049] In some embodiments, optionally, the interface expansion device has a Bluetooth or wireless communication function, and the interface expansion device receives the firmware file through the Bluetooth or wireless communication function.

[0050] In some embodiments, the mobile memory may optionally be triggered by a Near Field Communication (NFC) / Radio Frequency Identification (RFID) tag.

[0051] In some embodiments, the connection methods between the interface expansion device and the electro-hydraulic control device may include, but are not limited to, a 485 serial port and a CAN bus. Among these, the CAN bus isolation scheme requires a more complex protocol stack (e.g., CANopen), and offers stronger anti-interference capabilities (suitable for automotive scenarios).

[0052] In some embodiments, the bootloader of the electro-hydraulic control device may optionally include a Trivial File Transfer Protocol (TFTP).

[0053] In some embodiments, the interface expansion device may be a standalone handheld programmer, a module integrated into a debugging fixture, or a dedicated terminal fixedly installed in the workshop / underground.

[0054] In some embodiments, the anti-interference serial communication line between the interface expansion device and the electro-hydraulic control device may optionally include an electrical isolation circuit, which may include optocoupler isolation, magnetic coupling isolation, or capacitive isolation.

[0055] In some embodiments, optionally, such as Figure 2 As shown, after receiving the start frame sent by the bootloader after the electro-hydraulic control device has undergone a cold start, the firmware upgrade method further includes: Step S1030: Determine the file attributes corresponding to the firmware file; Step S1032: Determine the file header packet based on file attributes; Step S1034: Send the file header packet to the electro-hydraulic control device and receive the response signal from the electro-hydraulic control device for the file header packet.

[0056] In this embodiment, after the interface expansion device detects the start frame, it parses the file attributes of the firmware file, including the file size and the corresponding checksum. Based on the file size and checksum, it determines the file header packet and sends it to the electro-hydraulic control device.

[0057] The header packet includes the filename and file size of the corresponding firmware file.

[0058] It is emphasized that the interface expansion device performs handshake with the electro-hydraulic control device by sending the file header package in advance, so that the electro-hydraulic control device can know the size of the firmware file before receiving a large amount of data. That is, the Bootloader can check whether the Flash storage space is sufficient to accommodate the firmware file for application program upgrade according to the file header package. If the storage space corresponding to the Bootloader is insufficient to accommodate the firmware file, the electro-hydraulic control device can reply a negative acknowledgement (NAK) in the first step and terminate the firmware upgrade, instead of failing the upgrade due to insufficient remaining space in the data transmission process, thereby saving a large amount of time and power and improving the stability of the firmware upgrade.

[0059] In addition, the Bootloader can obtain the file name after parsing the file header package sent by the interface expansion device, and the Bootloader is preset to accept only the file with the specified file name, and refuse the upgrade if the file name does not match. By presetting the file name, it can prevent the operator from flashing the wrong firmware file into the electro-hydraulic control device, thereby playing a security check role and improving the security of the firmware upgrade of the electro-hydraulic control device.

[0060] Specifically, after the interface expansion device receives the starting frame sent by the Bootloader of the electro-hydraulic control device, it does not immediately start transmitting the firmware data, but first extracts the file properties from the read firmware file (for example, ROM.bin). The file name is ROM.bin, and the file size is the number of bytes occupied by the firmware file. The interface expansion device encapsulates the obtained file properties into a data package conforming to the Ymodem protocol format according to the specification of the Ymodem protocol, and determines the file header package. The file header package includes the file name and the file size (represented in ASCII string form), and identifies the file header package with specific control characters. The file header package does not contain any actual firmware program upgrade data, but only includes description information about the firmware file.

[0061] After the interface expansion device sends the file header package to the electro-hydraulic control device through the 485 serial port, the corresponding Bootloader of the electro-hydraulic control device parses the file header package and replies an acknowledgement signal to the interface expansion device according to the size of the storage space of the Bootloader, so as to start the data transmission of the firmware upgrade.

[0062] The successful reply of the file header package indicates that the interface expansion device and the electro-hydraulic control device reach an agreement on the file name and the file size, and the receiving side is ready. After receiving the reply, the interface expansion device starts to send multiple data packages in a time sequence, ensuring the orderliness of the data transmission.

[0063] In some embodiments, optionally, the file attributes include one or more of a file name, a file size, a file last modified timestamp, a firmware version number, or digital signature information.

[0064] In some embodiments, optionally, the steps of determining file attributes and sending file header packets can be performed sequentially for at least one firmware file, i.e., sending a file header packet for a first file, transmitting file data for the first file, and then sending a file header packet for a second file, to implement batch upgrading of at least one firmware file.

[0065] In some embodiments, optionally, as shown in FIG. 6, the data packets are transmitted to the electro-hydraulic control device through an anti-interference serial port, including: Figure 3 Step S1060: Obtain additional check information corresponding to each data packet. Step S1062: Send each data packet with additional check information through the anti-interference serial port in sequence. Step S1064: Receive a response signal of the data packet from the electro-hydraulic control device. Step S1066: Obtain a predetermined timeout period. Step S1068: If the response signal of the data packet from the electro-hydraulic control device is not received within the predetermined timeout period, automatically retransmit the corresponding data packet.

[0066] In this embodiment, after the electro-hydraulic control device sends a response signal for the file header packet, the interface expansion device starts the fragmentation transmission of the firmware file, i.e., sends each data packet with additional check information through the 485 serial port in sequence. After receiving each data packet, the electro-hydraulic control device sends an acknowledgement (ACK) to the interface expansion device to confirm the data packet reception status. If the interface expansion device does not receive the response signal of the data packet from the electro-hydraulic control device within the predetermined timeout period, the automatic retransmission mechanism of the interface expansion device is triggered, and the interface expansion device retransmits the data packet for which no response signal is received within the predetermined timeout period.

[0067] In the interface expansion device, a maximum number of retries (e.g., 3 times) is preset, i.e., the maximum number of retries for one data packet is 3 times, and when the number of retransmissions reaches the maximum number of retries, the firmware upgrade is stopped.

[0068] ​It can be understood that the additional check information can accurately identify errors caused by interference in the transmission process, and the response and retransmission mechanism ensures that any lost data packet will be retransmitted until it is correctly received. Moreover, through the way of timeout retransmission, the situation of complete loss of data packet or response signal is solved. If there is no timeout mechanism, the whole upgrade process will be suspended forever once the signal is lost in the traditional software protocol. The present scheme can automatically complete error correction, improve the stability of the firmware upgrade process, and reduce the risk of production interruption and equipment failure rate.

[0069] Exemplarily, each data packet includes 1024 bytes of data and 2 bytes of additional check information (CRC).

[0070] In some embodiments, optionally, the data packet includes a packet sequence number, a packet start identifier, a data area, and a check area.

[0071] In some embodiments, optionally, the preset timeout time is a fixed value or an adaptive value dynamically adjusted according to historical round trip time. The dynamic timeout setting can better adapt to different baud rates and different interference levels of network environment, further improving the transmission efficiency of the firmware file.

[0072] In some embodiments, optionally, after continuously successfully transmitting a predetermined number of data packets, the transmission is paused and a link layer determination signal is waited for, and then the transmission is continued. In order to prevent the buffer of the Bootloader of the electro-hydraulic control device from overflowing due to too fast transmission speed. Especially suitable for low-end MCU devices with small memory at the Bootloader end, to further improve the compatibility of firmware upgrade.

[0073] In some embodiments, optionally, if the number of retransmissions exceeds the maximum number of retries, the transmission of the current data packet is interrupted, and the packet sequence number at the interruption is recorded, and the next time the upgrade is started, the transmission is requested from the packet sequence number at the interruption. To realize breakpoint resume, cope with extremely severe environment (such as temporary power failure), avoid transmission from the beginning every time, save time and energy.

[0074] In some embodiments, optionally, the interface expansion device displays the packet sequence number, the number of retransmissions, or the transmission progress percentage during the data transmission process through the indicator light (LED) or the display screen of the interface expansion device. Provide intuitive state feedback for on-site operators, facilitate quick positioning of problems in communication link, device or firmware file itself, and further improve the maintainability of firmware upgrade.

[0075] In some embodiments, optionally, as shown in Figure 4 checking the upgrade file, and updating the application firmware in the electro-hydraulic control device according to the upgrade file after the check is passed, including: Step S1080: The electro-hydraulic control device assembles all the received data packets to obtain an upgrade file; Step S1082: Obtain a global check value of the upgrade file; Step S1084: Obtain a preset expected value corresponding to the firmware file; Step S1086: Compare the global check value and the preset expected value to determine whether the check passes; Step S1088: After the check passes, control the electro-hydraulic control device to perform an erasing operation to clear the original application firmware and write the upgrade file to the application area; Among them, the electro-hydraulic control device checks the additional check information corresponding to the data packet after receiving each data packet; If the check fails, a negative acknowledgement frame is sent to the interface expansion device to request retransmission of the data packet.

[0076] In this embodiment, when the electro-hydraulic control device completes the reception of all data packets, the entire upgrade file is checked, and after the check passes, the APP area Flash (block1 of STM32) in the electro-hydraulic control device is erased, and the new firmware is written page by page. After the writing is completed, the electro-hydraulic control device jumps from the Bootloader area to the APP area for execution, and returns a success code (for example, 0xAA) through the 485 serial port. If the check fails, the Bootloader sends a negative acknowledgement (NAK) frame to the interface expansion device to request retransmission of the corresponding abnormal data packet.

[0077] It can be understood that through the packet-by-packet check and the overall check, the data completeness in the firmware upgrade process and the reliability of data transmission are improved. The process is strictly designed in the order of acceptance, check, erasing and writing. As long as the final check fails, the erasing operation will not be triggered, and the electro-hydraulic control device still retains the original old firmware, ensuring the safety of the firmware upgrade.

[0078] Specifically, at the electro-hydraulic control device end, the Bootloader receives all data packets in time according to the Ymodem protocol, and each data packet passes the separate CRC check. A complete upgrade file is generated through multiple data packets. The global check value of the upgrade file is a check value calculated by using the CRC32 algorithm on the entire upgrade file data. In the Ymodem protocol, the interface expansion device carries the check value of the entire firmware file in the file header packet or the file tail packet. The Bootloader compares the calculated global check value of the upgrade file with the preset expected value corresponding to the firmware file to determine whether the multiple data packets are complete.

[0079] In the data packet transmission process, a 16-bit redundancy code (CRC16) is used for checking a single data packet, aiming to ensure transmission reliability, correct errors in time, and improve data transmission efficiency in the firmware upgrade process.

[0080] In some embodiments, optionally, the preset expected value is provided by the interface expansion device in a file header packet or a file tail packet, or is pre-burned in a non-volatile memory of the electro-hydraulic control device.

[0081] In some embodiments, optionally, after the global check value is compared with the preset expected value, the electro-hydraulic control device further performs a memory image check, that is, the global check value is calculated again from the upgrade file data in the memory before the erasing operation is performed.

[0082] In some embodiments, optionally, the condition of passing the check further includes: analyzing the version number or the hardware identifier in the upgrade file, and confirming that the version number or the hardware identifier is compatible with the current model or the current firmware version of the electro-hydraulic control device, so as to prevent the mis-brushing of incompatible firmware.

[0083] In some embodiments, optionally, before the erasing operation is performed, the electro-hydraulic control device first backs up the original application firmware to a specific area, and if the new firmware fails to start after the update, the old firmware is automatically restored from the backup area.

[0084] In some embodiments, optionally, as shown in Figure 5 checking the upgrade file and updating the application firmware in the electro-hydraulic control device according to the upgrade file after the check passes, further includes: Step S1090: determining the number of repeated requests corresponding to the negative acknowledgement frame; Step S1092: obtaining a predetermined threshold and a backup firmware; Step S1094: if the number of repeated requests exceeds the predetermined threshold, aborting the firmware upgrade and rolling back to the backup firmware.

[0085] In this embodiment, after the Bootloader sends a negative acknowledgement frame to request retransmission, if the number of consecutive repeated requests exceeds the predetermined threshold, the firmware upgrade is aborted and the backup firmware is rolled back.

[0086] The negative acknowledgement frame comes from two aspects, including: data packet transmission failure and overall file check failure. When the data packet transmission fails, the electro-hydraulic control device finds an error during packet-by-packet checking and replies to the interface expansion device with a negative acknowledgement frame to request retransmission of a specific data packet. When the overall file check fails, after all data packets are received, the overall upgrade file check fails, and the electro-hydraulic control device replies to the interface expansion device with a negative acknowledgement frame to request retransmission of the entire transmission process.

[0087] The predetermined threshold is a predefined maximum retry limit, which is set according to the field environment reliability and performance requirements of the electro-hydraulic control device. The backup firmware is a normally functioning old version firmware stored in a separate area of the non-volatile memory of the device.

[0088] By way of example, the backup firmware includes the last successfully running version firmware or the factory version firmware of the electro-hydraulic control device.

[0089] When the number of repeated requests corresponding to the negative acknowledgement frame exceeds the predetermined threshold, it is determined that the current firmware upgrade failure rate is high (for example, the firmware file itself is damaged, the hardware interface has a permanent fault, or the environmental interference is severe), at which time the interface expansion device immediately suspends the current firmware upgrade process.

[0090] After suspending the firmware upgrade, the Bootloader automatically performs a rollback operation of the backup firmware to restore the electro-hydraulic control device to the version corresponding to the backup firmware.

[0091] It can be understood that by using the threshold to actively abandon unreliable firmware upgrades and by using the rollback mechanism to provide a safe backup, the reliability and safety of firmware upgrades for industrial devices deployed in downhole, explosion-proof areas, or remote areas can be improved, thereby avoiding huge economic losses.

[0092] In some embodiments, optionally, the backup firmware also includes any historical stable version firmware specified by a user, i.e., the backup firmware includes the last successfully running version firmware, the factory version firmware of the electro-hydraulic control device, or any historical stable version firmware, to provide different levels of safe retreat. Rolling back to the last version can quickly restore the function and improve data transmission efficiency, and rolling back to the factory version can solve serious problems at the software level and improve the stability of device operation.

[0093] In some embodiments, optionally, after rolling back to the backup firmware, the method further includes automatically attempting firmware upgrade again when the electro-hydraulic control device is next cold started.

[0094] In some embodiments, optionally, the predetermined threshold is dynamically adjusted according to historical upgrade success rates, current signal quality, or device operating environment to improve the firmware upgrade success probability.

[0095] In some embodiments, optionally, the firmware upgrade method further includes: obtaining a predetermined waiting time; if the interface expansion device does not detect a start frame within the predetermined waiting time, entering a low-power sleep mode and waking up periodically for detection.

[0096] In this embodiment, the predetermined waiting time is a pre-set time parameter, which defines the maximum duration for which the interface expansion device continues to run and monitor the anti-interference serial port after first power-on or each wake-up. The predetermined waiting time should ensure that the entire process from cold start to the issuance of the starting frame by the Bootloader of the electro-hydraulic control device is covered.

[0097] If the interface expansion device receives the starting frame sent by the electro-hydraulic control device within the predetermined waiting time, it immediately exits the waiting state and enters the data transmission process. If no starting frame is detected within the predetermined waiting time, it is determined that the current electro-hydraulic control device has no firmware upgrade request, and then enters the low-power sleep mode.

[0098] In the low-power sleep mode, the main control MCU of the interface expansion device will shut down unnecessary functional modules, such as turning off the display backlight, reducing the clock frequency, etc., and only a low-power timer is kept running. After a pre-set time interval in the sleep mode, the low-power timer will briefly wake up the MCU. After waking up, the interface expansion device will re-enable the anti-interference serial port and detect whether there is a starting frame on the line corresponding to the 485 serial port. If not, it enters the sleep mode again; if so, it returns to the normal working process.

[0099] It can be understood that, by means of automatic sleep, the overall power consumption of the interface expansion device is greatly reduced, the device endurance or applicability is prolonged, heat accumulation is reduced, and the aging and failure of components due to long-term high-temperature work are avoided.

[0100] In one specific embodiment, optionally, the application provides an upgrade stick (i.e. interface expansion device), which includes: a main control chip: a low-cost MCU (STM32F103); a storage interface: an SD card controller (reading U disk) supporting a 32-bit file allocation table (FAT32) file system; a communication module: an isolated 485 serial port (anti-surge); a status indicator light: a blue LED indicating the upgrade status.

[0101] A safety isolation circuit: a TVS diode and a self-recovery fuse are provided at the 485 bus end to prevent overvoltage / overcurrent; signal isolation uses a magnetic coupling isolator (such as ADI's ADuM1201).

[0102] As shown in Figure 8 , the upgrade stick is connected to a U disk (i.e. mobile storage) through a USB-A female port; the upgrade stick is connected to the anti-interference serial port terminal of the electro-hydraulic control device through a 485 interface (A / B line); the Bootloader firmware of the electro-hydraulic control device is pre-programmed with Ymodem protocol analysis code.

[0103] After the upgrade stick is powered on, it automatically scans the root directory of the U disk and detects the ROM.bin file. When the electro-hydraulic control device is restarted, the Bootloader actively sends a Ymodem start frame (ASCII character 'C'). After the upgrade stick receives the start frame, it transmits firmware data in 1 KB / packet fragments (CRC16 check). After receiving each packet of data, the electro-hydraulic control device returns an acknowledge character (ACK), and requests retransmission if it fails.

[0104] Exemplarily, taking the upgrading of the electro-hydraulic control system of a coal mine hydraulic support as an example, the operation process includes: ①Insert the U disk containing the ROM.bin into the upgrade stick; ②Use the mine-used intrinsically safe connection line (MA authentication) to connect the 485 port of the device or directly connect it to the 485 peripheral interface of the electro-hydraulic control device; ③Press the reset key of the electro-hydraulic control device to trigger the Bootloader; ④The blue light flashes to indicate that the upgrade is successful.

[0105] In one specific embodiment, the specific steps of the firmware upgrade method can include: First step: upgrade preparation: generate firmware (ROM.bin) on a personal computer (PC); copy the firmware to the root directory of the U disk (the file name is forced to be ROM.bin).

[0106] Second step: device triggering: cold start the electro-hydraulic control device, and after the Bootloader runs: initialize the 485 serial port (baud rate 115200 bps); continuously send the Ymodem start frame (interval 500 ms).

[0107] Third step: data transmission: after the upgrade stick detects the start frame: analyze the ROM.bin file attributes (size / check code); send the file header packet (including the file name and size).

[0108] After the electro-hydraulic control device responds with ACK, the upgrade stick starts fragment transmission: each packet contains 1024 bytes of data + 2 bytes of CRC timeout 3 seconds without response, and then automatically retransmits (maximum retry 3 times).

[0109] Fourth step: firmware update: after the electro-hydraulic control device completes the reception: check the entire file 32-bit redundancy code (CRC32); erase the APP area Flash (Block1 of STM32); write the new firmware page by page.

[0110] After writing is completed: jump to the application (APP) area for execution; return the success code (0xAA) through 485.

[0111] Step 5: Abnormality handling: If verification fails: Bootloader sends Negative AcKnowledgment (NAK) request for retransmission; If fails for 5 times in a row: Rollback to backup firmware (if any).

[0112] Exemplarily, an example of upgrading the electro-hydraulic control equipment of a fully mechanized and automated working face: The inspection personnel carry the upgrade stick to the shaft field; without disassembling the equipment, the 485 debugging port is directly connected; the equipment automatically identifies the upgrade mode, and no manual intervention is required throughout the process.

[0113] Understandably, the hardware architecture of the independent upgrade stick, U disk, and 485 serial port improves the wide compatibility of firmware upgrade, and the U disk is independently analyzed by the upgrade stick, without the need for the electro-hydraulic control equipment to have USB Host function, which is suitable for low-end MCUs (such as STM32F0 series). The 485 serial port adopts an isolation design (such as ADM2587E chip), and has better anti-electromagnetic interference capability than USB direct connection, which is suitable for harsh environments such as coal mines and oil fields.

[0114] The cooperative upgrade mechanism of Ymodem protocol and dual-zone Bootloader realizes high robustness transmission, and Ymodem protocol supports Cyclic Redundancy Check (CRC) and breakpoint resume, which improves the data transmission integrity by more than 90% compared with traditional serial port upgrade (such as Xmodem).

[0115] Exemplarily, in a poor network signal environment underground, 10MB firmware can still be upgraded successfully at one time.

[0116] Bootloader runs independently, and can automatically rollback to the old version in case of upgrade failure, reducing the device brick rate to below 0.1% (about 5% for traditional solutions).

[0117] Firmware file standardization (ROM.bin+FAT32) and automatic process, mandatory naming rules (ROM.bin) and file system (FAT32), field personnel can operate without training.

[0118] Tamper-proofing: Upgrade stick verifies file signature (AES encryption optional), eliminates malicious firmware injection, and meets industrial control safety standards (such as IEC 62443).

[0119] The Ymodem protocol interaction timing flow chart is as follows: Figure 9As shown, the sender / host is an upgrade stick, and the receiver / slave is an electro-hydraulic control device. In the initialization phase, the electro-hydraulic control device sends a start frame to the upgrade stick, and the upgrade stick sends an ACK to confirm the connection establishment after receiving the start frame, and performs data transmission of the firmware file. The transmission file information includes a control character (Start of Header, SOH) indicating the start of the data packet and the corresponding data packet. After receiving the data packet sent by the upgrade stick, the electro-hydraulic control device returns an ACK. The upgrade stick starts to transmit the ROM.bin file in packets, sends multiple data packets, including data packet 1, data packet 2, and data packet N. Each data packet includes corresponding SOH and data. The electro-hydraulic control device sends an ACK confirmation after receiving each data packet. When the verification fails during data packet transmission, the electro-hydraulic control device sends a NAK rejection signal to the upgrade stick and retransmits the abnormal data packet N+1.

[0120] After the data transmission is completed, the upgrade stick sends an end of transmission signal (End of Transmission, EOT) to the electro-hydraulic control device, indicating the end of data transmission.

[0121] As shown in Figure 6 The embodiment of the application also provides a firmware upgrade device 900, which comprises: a file acquisition module 902, configured to acquire a firmware file with a specified file name in a mobile storage; a start confirmation module 904, configured to receive a start frame sent by a boot loader after a cold start of an electro-hydraulic control device; a data segmentation module 906, configured to determine at least one data packet corresponding to the firmware file; a data transmission module 908, configured to transmit the data packet to the electro-hydraulic control device through an anti-interference serial port to determine an upgrade file; and a verification and upgrade module 910, configured to verify the upgrade file and update an application firmware in the electro-hydraulic control device according to the upgrade file after the verification is passed.

[0122] The firmware upgrade device 900 implements the firmware upgrade method and is applied to an interface expansion device for firmware upgrade. The interface expansion device bridges the mobile storage and the electro-hydraulic control device to upgrade the application firmware in the electro-hydraulic control device through the firmware file stored in the mobile storage. Field operation personnel only need to insert the mobile storage into the interface expansion device and trigger the interface expansion device, without the need of professional equipment or network support, thereby improving the convenience of firmware upgrade.

[0123] As shown in Figure 7 The embodiment of the application also provides an interface expansion device 100, which is pluggably connected with a mobile storage 102. The interface expansion device 100 is configured to read a firmware file from the mobile storage 102 and is in communication connection with an electro-hydraulic control device 104 through a serial port. The interface expansion device 100 is independent of the electro-hydraulic control device 104. The interface expansion device 100 further comprises a firmware upgrade device.

[0124] The interface expansion device 100 includes a master control chip, a storage interface, a communication module, and a status indicator. The interface expansion device 100 is controlled by the master control chip, reads file data in the mobile storage 102 through the storage interface. Moreover, the communication module is an isolated 485 serial port, and the interface expansion device 100 is connected with the electro-hydraulic control device 104 through the 485 serial port, and indicates the upgrade state through the status indicator during the firmware upgrade process. The interface expansion device 100 implements each process of the above-mentioned firmware upgrade method embodiment when executed, and can achieve the same technical effects. To avoid repetition, details are not described herein.

[0125] The application also provides a readable storage medium, which stores programs or instructions. When the programs or instructions are executed by a processor, each process of the above-mentioned firmware upgrade method embodiment is implemented, and the same technical effects can be achieved. To avoid repetition, details are not described herein. In addition, the readable storage medium improves the data storage capacity and data processing speed of the firmware upgrade method in the application.

[0126] The readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium can be an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any appropriate combination of the above devices, but is not limited to this. A non-exhaustive list of more specific examples of computer readable storage media includes a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory card, a floppy disk, an encoded mechanical device (such as a punch card or a groove with a raised structure recording instructions), and any appropriate combination of the above devices. The computer readable storage medium used herein should not be understood as a transmission signal itself, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium, or electrical signals transmitted through a wire, etc.

[0127] The processor is a processor in the electronic device in the above-mentioned embodiments. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0128] The chip provided by the embodiment of the application comprises a processor and a communication interface, the communication interface is coupled with the processor, the processor is used for running programs or instructions, and each process of the firmware upgrading method embodiment is realized, and the same technical effects can be achieved. To avoid repetition, details are not described herein. In addition, the data processing speed of the method in the application is improved by the chip.

[0129] It should be understood that the chip mentioned in the embodiment of the application can also be referred to as a system-on-chip, a system chip, a chip system or a system-on-chip, etc.

[0130] In the present application, the terms "first", "second", "third" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance; the term "multiple" refers to two or more, unless otherwise explicitly limited. The terms "mounting", "connection", "connection", "fixing" and the like should be broadly understood, for example, "connection" can be fixed connection, or detachable connection, or integrally connected; "connection" can be directly connected, or indirectly connected through an intermediate medium. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.

[0131] In the description of the present application, it should be understood that the terms "up", "down", "left", "right", "front", "back" and the like indicate the orientation or positional relationship shown in the drawings, and are only used for the purpose of facilitating the description of the present application and simplifying the description, and do not indicate or imply that the devices or units referred to must have a particular direction, be constructed and operated in a particular orientation, therefore, cannot be understood as a limitation on the present application.

[0132] In the description of the present application, the terms "one embodiment", "some embodiments", "a specific embodiment" and the like mean that the specific features, structures, materials or characteristics described in connection with the embodiments or examples are included in at least one embodiment or example of the present application. In the present specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0133] The above is only the preferred embodiment of the present application, and is not used to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A firmware upgrade method characterized by comprising: The application is applied to an interface expansion device, the interface expansion device and a mobile storage are plug-in connected, the interface expansion device is configured to read a firmware file from the mobile storage and is connected with an electro-hydraulic control device through an anti-interference serial port, the interface expansion device is independent of the electro-hydraulic control device, the firmware upgrade method comprises the following steps: Obtaining the firmware file with a specified file name in the mobile storage; Receiving a start frame sent by a boot loader after the electro-hydraulic control device is cold started; Determining at least one data packet corresponding to the firmware file; Transmitting the data packet to the electro-hydraulic control device through the anti-interference serial port to determine an upgrade file; Verifying the upgrade file, and updating the application firmware in the electro-hydraulic control device according to the upgrade file after the verification is passed.

2. The firmware upgrade method according to claim 1, wherein, After the step of receiving the start frame sent by the boot loader after the electro-hydraulic control device is cold started, the firmware upgrade method further comprises the following steps: Determining a file attribute corresponding to the firmware file; Determining a file header packet according to the file attribute; Sending the file header packet to the electro-hydraulic control device, and receiving a response signal of the electro-hydraulic control device to the file header packet.

3. The firmware upgrade method according to claim 2, wherein, The step of transmitting the data packet to the electro-hydraulic control device through the anti-interference serial port comprises the following steps: Obtaining additional verification information corresponding to each data packet; Sending each data packet with the additional verification information through the anti-interference serial port in sequence; Receiving a response signal of the electro-hydraulic control device to the data packet; Obtaining a predetermined timeout time; If the response signal of the electro-hydraulic control device to the data packet is not received within the predetermined timeout time, automatically retransmitting the corresponding data packet.

4. The firmware upgrade method of claim 2, wherein, The step of verifying the upgrade file, and updating the application firmware in the electro-hydraulic control device according to the upgrade file after the verification is passed comprises the following steps: Controlling the electro-hydraulic control device to assemble all the received data packets to obtain an upgrade file; Obtaining a global verification value of the upgrade file; Obtaining a preset expected value corresponding to the firmware file; Comparing the global verification value and the preset expected value to determine whether the verification is passed; After the verification is passed, controlling the electro-hydraulic control device to perform an erasing operation to clear the original application firmware, and writing the upgrade file into an application program area. The electro-hydraulic control device verifies the additional verification information corresponding to each data packet after receiving the data packet; If the verification fails, a negative response frame is sent to the interface expansion device to request retransmission of the data packet.

5. The firmware upgrade method according to claim 4, wherein, The step of verifying the upgrade file, and updating the application firmware in the electro-hydraulic control device according to the upgrade file after the verification is passed further comprises the following steps: Determining a repeated request number corresponding to the negative response frame; Obtaining a predetermined threshold value and a backup firmware; If the repeated request number exceeds the predetermined threshold value, firmware upgrade is aborted and the backup firmware is rolled back.

6. The firmware upgrade method of any one of claims 1-5, wherein, Further comprising the following steps: Obtaining a predetermined waiting time; If the interface expansion device does not detect the start frame within the predetermined waiting time, entering a low-power sleep mode and waking up for detection at a time.

7. A firmware upgrade apparatus characterized by comprising: Further comprising the following steps: The file acquisition module is configured to acquire a firmware file with a specified file name in the mobile storage device. The start confirmation module is configured to receive a start frame sent by the bootloader after the cold start of the electro-hydraulic control device. The data segmentation module is configured to determine at least one data packet corresponding to the firmware file. The data transmission module is configured to transmit the data packet to the electro-hydraulic control device through the anti-interference serial port to determine an upgrade file. The verification upgrade module is configured to verify the upgrade file and update the application firmware in the electro-hydraulic control device according to the upgrade file after the verification is passed.

8. An interface expansion device, comprising: The interface expansion device and the mobile storage device are pluggable connected, the interface expansion device is configured to read the firmware file from the mobile storage device and is connected with the electro-hydraulic control device through the anti-interference serial port, and the interface expansion device is independent of the electro-hydraulic control device. The interface expansion device comprises the firmware upgrade device of claim 7.

9. A readable storage medium, characterized by, The readable storage medium stores programs or instructions, and the programs or instructions are executed by the processor to realize the steps of the firmware upgrade method in any one of claims 1 to 6.

10. A chip, characterized by The chip comprises a processor and a communication interface, the communication interface is coupled with the processor, the processor is configured to run programs or instructions to realize the steps of the firmware upgrade method in any one of claims 1 to 6.