A printer firmware upgrade method and system
By using a method of parallel scanning of multiple interfaces and automatic identification of printer interface types by the system adaptation layer, unattended automated and manual upgrades of printer firmware have been achieved. This solves the problems of disassembly risk and low efficiency in traditional printer firmware upgrades, and improves the success rate and efficiency of upgrades.
Patent Information
- Application Number
- CN202610485517.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-14
- Publication Date
- 2026-11-20
AI Technical Summary
The current printer firmware upgrade process has the risks of firmware burning errors during the production line stage, requiring disassembly and re-flashing, and component damage. In the after-sales stage, firmware bug repair or function iteration relies on wired connection on-site operation, which is costly and inefficient.
Employing multi-interface parallel scanning technology, it is compatible with the hardware calling specifications of different operating systems through a multi-system adaptation layer. It automatically identifies the printer interface type and uses the adapted transmission method for unattended automated upgrades, while also supporting manual mode and automatically retrying the upgrade process until successful.
It enables 24-hour unattended automated upgrades without disassembly and manual upgrades, improving the upgrade success rate and reducing labor costs and time consumption.
Smart Images

Figure CN123137683A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of printer technology, and in particular to a printer firmware upgrade method and a printer firmware upgrade system. Background Technology
[0002] Currently, printers are increasingly used in office, industrial, and mobile scenarios, such as wireless office printers, Bluetooth portable printers, and NFC label printers. However, firmware upgrades still face many pain points: if the firmware is burned incorrectly during the production line stage, it needs to be disassembled and reflashed, which not only increases working hours but also poses a risk of component damage. During the after-sales stage, when fixing firmware bugs or iterating functions, the traditional method relies on wired connection for on-site operation or batch recall, which is not only costly but also inefficient due to the constraints of the site and wired connection. Summary of the Invention
[0003] In view of the above problems, the present invention is proposed to provide a printer firmware upgrade method and a corresponding printer firmware upgrade system that overcome or at least partially solve the above problems.
[0004] This invention discloses a printer firmware upgrade method, the method comprising: Receive the target firmware version number, upgrade mode command, and target firmware file from the control terminal; The target firmware file is subjected to integrity verification, and the target firmware file is stored locally after the verification is successful. The upgrade mode is determined according to the upgrade mode instruction. If it is an unattended automated upgrade mode, then a multi-interface parallel scan of the printer is started. The interface type of the connected printer is identified by the hardware call specification adaptation logic of different operating systems compatible with the multi-system adaptation layer. The printer's current firmware version number is obtained using the method for retrieval based on the identified interface type. If the current firmware version number does not match the target firmware version number, the target firmware file will be transmitted using the transmission method adapted to the identified interface type for upgrade. If the upgrade fails, the upgrade process will be automatically retried until the upgrade is successful.
[0005] Optionally, the target firmware file is subjected to integrity verification, and the target firmware file is stored locally after the verification passes, including: Perform MD5 integrity verification on the received target firmware file; If the verification fails, the firmware file corruption information is reported to the control terminal, and the process is terminated.
[0006] Optionally, determining the upgrade mode according to the upgrade mode instruction includes: If the upgrade mode instruction indicates an unattended automated upgrade mode, then multi-interface parallel scanning is immediately started. Through the hardware call specification adaptation logic of different operating systems compatible with the multi-system adaptation layer, the interface type of the connected printer is identified. If the upgrade mode instruction indicates a manual upgrade mode, then upon receiving a manually triggered upgrade instruction, the system will respond to the manually triggered upgrade instruction and perform the upgrade.
[0007] Optionally, the operating system includes at least HarmonyOS and Android. Through hardware call specification adaptation logic for different operating systems compatible with the multi-system adaptation layer, the interface type of the connected printer is identified, including: The operating system identifier of the control terminal is read by the multi-system adaptation layer to determine the type of operating system that needs to be adapted. Based on the determined operating system type, the corresponding underlying hardware driver interface is dynamically loaded, and based on the underlying hardware driver interface, the identification operation for printers with different interface types is performed. If it is the HarmonyOS system, then the distributed soft bus protocol, Wi-Fi scanning framework, BLE Bluetooth service and network communication interface will be loaded. If it is an Android system, then the Wi-Fi Manager API, BluetoothGatt API, NFC NDEF protocol and Socket communication module are loaded.
[0008] Optionally, based on the underlying hardware driver interface, the identification operation for printers with different interface types is performed, including: The IP address and port information of online devices in the local area network are obtained through the Wi-Fi scanning interface in the underlying hardware driver interface. Probe packets based on IPP or AirPrint protocol are sent to each device. If the printer identity identifier is received, it is determined to be a Wi-Fi interface printer. Scan Bluetooth devices through the Bluetooth scanning interface in the underlying hardware driver interface, filter out devices that support SPP or BLE protocols, traverse the filtered Bluetooth devices, match the service UUID of each Bluetooth device with the preset printer service UUID, and match the device name of each Bluetooth device with the preset printer name prefix. If the match is successful, it is determined to be a Bluetooth interface printer. The NFC tag in the NFC sensing area of the printer is read through the NFC read / write interface in the underlying hardware driver interface. If the device type field parsed from the tag identifies it as a printer, it is determined to be an NFC interface printer. A TCP connection is established with a preset port through the network communication interface in the underlying hardware driver interface. A firmware query command is sent to the printer. If the connection is successful and a valid version response data is received, it is determined to be a network interface printer.
[0009] Optionally, the printer's current firmware version number can be obtained using the identified interface type adaptation method, including: If the printer is identified as having a Wi-Fi interface, the Wi-Fi version query interface provided by the multi-system adaptation layer is called to read the current firmware version number from the printer via HTTP, HTTPS, or SNMP protocols. If the printer is identified as having a Bluetooth interface, the Bluetooth version query interface provided by the multi-system adaptation layer is called to read the current firmware version number from the printer via the GATT protocol or AT commands. If the printer is identified as having an NFC interface, the NFC version query interface provided by the multi-system adaptation layer is called to read the current firmware version number from the printer by sending a wake-up and version acquisition command. If the printer is identified as having a network interface, the current firmware version number of the printer can be obtained by parsing the valid version response data.
[0010] Optionally, the target firmware file is transmitted for upgrade using a transmission method adapted to the identified interface type, including: If the printer is identified as having a Wi-Fi interface, the Wi-Fi upgrade interface provided by the multi-system adaptation layer is called, and the target firmware file is uploaded to the printer firmware update server in chunks using HTTP or HTTPS protocol. The Wi-Fi upgrade trigger command is then used to perform an overwrite installation. If the printer is identified as having a Bluetooth interface, the Bluetooth upgrade interface provided by the multi-system adaptation layer is invoked. The target firmware file is then transmitted to the printer firmware storage area in packets of a preset size via the GATT protocol or SPP serial port, and a Bluetooth upgrade trigger command is sent to perform an overwrite installation. If the printer is identified as having an NFC interface, the NFC upgrade interface provided by the multi-system adaptation layer is called to split the target firmware file into data blocks that do not exceed the preset NDEF data block size threshold, write them sequentially to the printer's NFC upgrade storage area, and send an NFC upgrade trigger command to perform an overwrite installation. If the printer is identified as having a network interface, the network upgrade interface provided by the multi-system adaptation layer is invoked. The target firmware file is uploaded to the printer's specified directory via FTP protocol, or a firmware binary stream is sent to the printer via TCP port, and a network upgrade trigger command is sent to perform an overwrite installation.
[0011] Optionally, if the upgrade fails, the upgrade process will be automatically retried until the upgrade is successful, including: If a transmission failure, verification error, or connection interruption is detected during the firmware upgrade process, a retry mechanism will be automatically triggered to re-execute the firmware upgrade operation until the upgrade is successful.
[0012] Optionally, the target firmware version number, upgrade mode command, and target firmware file sent by the control terminal are received, including: The target firmware version number, upgrade mode command, and target firmware file are received via the HarmonyOS distributed soft bus or Android LAN communication link.
[0013] The present invention also discloses a printer firmware upgrade system, the system comprising: The firmware upgrade information receiving module is used to receive the target firmware version number, upgrade mode command and target firmware file sent by the control terminal; The integrity verification module is used to perform integrity verification on the target firmware file, and after the verification is successful, the target firmware file is stored locally. The printer interface type identification module is used to determine the upgrade mode according to the upgrade mode instruction. If it is an unattended automated upgrade mode, it starts a multi-interface parallel scan of the printer and identifies the interface type of the connected printer through the hardware call specification adaptation logic of different operating systems compatible with the multi-system adaptation layer. The firmware version number acquisition module is used to obtain the printer's current firmware version number using the acquisition method adapted to the identified interface type. The firmware upgrade module is used to upgrade the target firmware file by transmitting the target firmware file using a transmission method adapted to the identified interface type if the current firmware version number does not match the target firmware version number. The upgrade retry module is used to automatically retry the upgrade process if the upgrade fails, until the upgrade is successful.
[0014] This invention has the following advantages: The printer firmware upgrade method and system of this invention can support both manual upgrade without disassembly and 24-hour unattended automated upgrade without disassembly. It prioritizes determining whether the upgrade is in manual or 24-hour unattended automated mode. Through a dual-system adaptation layer compatible with the communication protocols and hardware drivers of HarmonyOS and Android systems, it can automatically identify whether the printer is a Wi-Fi, Bluetooth, NFC, or Ethernet interface printer. By accurately detecting the current firmware version and comparing it with the target version, it achieves targeted upgrade correction for mismatched firmware. If transmission interruption, verification failure, or connection interruption occurs during the upgrade process, the system automatically triggers a seamless retry mechanism until the upgrade is successful, ensuring a high perceived upgrade success rate for the user. Attached Figure Description
[0015] Figure 1 This is a diagram showing the device architecture and connection of the present invention; Figure 2 This is a flowchart of the printer firmware upgrade method of the present invention. Detailed Implementation
[0016] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0017] Reference Figure 1 The device architecture and connections of this invention are as follows: Control terminal: Supports deployment on both HarmonyOS and Android systems, supports encrypted transmission and verification of firmware files, and distributes the target firmware version number, upgrade mode (manual or unattended automated) and target printer firmware file via LAN and cloud platform.
[0018] Dedicated printer peripherals: Equipped with Wi-Fi, Bluetooth, NFC, and Ethernet communication modules, featuring a dual-system unified adaptation layer to accommodate differences in the underlying systems of both systems and standardized interface output. It is used to connect to printers with various interfaces, receive control terminal parameters and firmware files, store upgrade applications, and perform printer identification, version detection, and upgrade operations.
[0019] Reference Figure 2 The processing flow of the printer firmware upgrade method of the present invention is as follows: 1. The dedicated printer device establishes a communication link with the control terminal and receives the target firmware version number, upgrade mode, and target printer firmware file from the control terminal via HarmonyOS distributed soft bus or Android LAN.
[0020] 2. Perform MD5 verification on the received target firmware file to verify file integrity: If the verification fails, report "firmware file is corrupted" to the control terminal and terminate the process; if the verification passes, store all parameters in the specified directory on the printer.
[0021] 3. Determine whether the upgrade mode is a manual upgrade mode without disassembly or a 24-hour unattended automated upgrade mode without disassembly. If it is a manual upgrade mode without disassembly, the program will loop indefinitely waiting for the manual start command and will not proceed to the next step. If it is a 24-hour unattended automated upgrade mode without disassembly, it will proceed directly to the next step.
[0022] 4. Initiate multi-interface parallel scanning. The peripheral device's adaptation layer automatically adapts to HarmonyOS and Android systems, and begins automatically identifying the printer type (Adaptation layer: By reading the control terminal system identifier, the "harmony_os" field of HarmonyOS and the "android_os" field of Android, it automatically determines the type of the currently connected control terminal system. Differentiated adaptation logic encapsulates corresponding adaptation logic for the hardware calling specifications of different systems. On the HarmonyOS side, it adapts to its distributed soft bus protocol, Wi-Fi scanning framework, BLE Bluetooth service, and network communication interface. On the Android side, it adapts to Wi-Fi Manager API, BluetoothGatt API, NFC NDEF protocol, and Socket communication module, realizing differentiated underlying calls for the same function under both systems): ① Initiate Wi-Fi scanning to obtain the IP addresses and port information of all online printers on the local area network. Call the sendDetectionPacket() method of the IPPDiscoveryInterface / AirPrintDiscoveryInterface interface provided by the adapter layer to send printer detection packets (based on the IPP / AirPrint protocol) to each printer. If the printer identification (device model / manufacturer code) is returned, it is determined to be a Wi-Fi interface printer. Then, call the getVersionByHttp() / getVersionBySNMP() method of the FirmwareVersionQueryInterface interface provided by the adapter layer (http: / / [printer IP] / api / firmware / version) to obtain the current firmware version number. Check if the current version number is equal to the target version. If not, proceed to the firmware upgrade program. Upload the firmware in chunks to the printer firmware update server using the HTTP / HTTPS protocol. Call the sendStartUpgradeCommand() method of the Wi-FiFirmwareUpgradeInterface interface provided by the adapter layer to perform an overwrite installation. Return the result. Check if the result is equal to true. If not, upgrade the firmware again.
[0023] ② Initiate Bluetooth scanning, filter out devices that support SPP (Serial Profile Protocol) / BLE (Bluetooth Low Energy), and match them with the printer manufacturer's preset Bluetooth device name prefix (e.g., "Printer-BLE-XXX") and service UUID (e.g., 00001101-0000-1000-8000-00805F9B34FB). If a match is successful, it is determined to be a Bluetooth interface printer, and attempts to call the BluetoothVersionQueryInterface interface getVersionByGATT() / getVersionByATCom provided by the adaptation layer. The `mand()` method retrieves the current firmware version number and checks if it equals the target version. If not, it proceeds to the firmware upgrade process. BLE printers transmit firmware to the printer firmware storage feature value via the GATT protocol at 20 bytes / packet. Classic Bluetooth printers send firmware data via the SPP serial port at 512 bytes / packet. The `sendStartUpgradeCommand()` method of the BluetoothFirmwareUpgradeInterface interface provided by the adapter layer is called to perform an overwrite installation. The result is returned, and it is checked whether the result equals true. If not, the firmware is upgraded again.
[0024] ③ Enable NFC read / write function, bring the device close to the printer's NFC sensing area, read the device type field in the NFC tag. If the field is identified as "Printer", it is determined to be an NFC interface printer. Then, the NFCVersionQueryInterface interface sendWakeupAndGetVersionCommand() method provided by the adapter layer is called to obtain the current firmware version number. It is then checked whether the current version number is equal to the target version. If not, the firmware upgrade program is entered. The firmware file is split into NDEF data blocks of no more than 4KB and written to the printer's NFC upgrade storage area in sequence. The NFCFirmwareUpgradeInterface interface sendTriggerUpgradeCommand() method provided by the adapter layer is called to perform an overwrite installation. The result is returned. If the result is true, the firmware is upgraded again.
[0025] ④ Establish a TCP connection via Socket (default port 9100, 515 or manufacturer-specified port), call the EthernetVersionQueryInterface interface sendESC_POSVersionQueryCommand() method provided by the adaptation layer to send a firmware query command to the printer device. If the connection is successful and a valid version response data is received, it is determined to be a network interface printer. The version field in the response data is parsed to obtain the current firmware version number. It is determined whether the current version number is equal to the target version. If not, the firmware upgrade program is entered. The firmware file is uploaded to the printer's specified directory via FTP protocol or the firmware binary stream is sent directly via TCP port. The EthernetFirmwareUpgradeInterface interface sendStartUpgradeCommand() method provided by the adaptation layer is called to perform an overwrite installation. The result is returned. If the result is true, the firmware is upgraded again.
[0026] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0027] The printer firmware upgrade system provided in this embodiment of the invention may specifically include: The firmware upgrade information receiving module is used to receive the target firmware version number, upgrade mode command and target firmware file sent by the control terminal; The integrity verification module is used to perform integrity verification on the target firmware file, and after the verification is successful, the target firmware file is stored locally. The printer interface type identification module is used to determine the upgrade mode according to the upgrade mode instruction. If it is an unattended automated upgrade mode, it starts a multi-interface parallel scan of the printer and identifies the interface type of the connected printer through the hardware call specification adaptation logic of different operating systems compatible with the multi-system adaptation layer. The firmware version number acquisition module is used to obtain the printer's current firmware version number using the acquisition method adapted to the identified interface type. The firmware upgrade module is used to upgrade the target firmware file by transmitting the target firmware file using a transmission method adapted to the identified interface type if the current firmware version number does not match the target firmware version number. The upgrade retry module is used to automatically retry the upgrade process if the upgrade fails, until the upgrade is successful.
[0028] In an optional embodiment of the present invention, the integrity verification module is further configured to: Perform MD5 integrity verification on the received target firmware file; If the verification fails, the firmware file corruption information is reported to the control terminal, and the process is terminated.
[0029] In an optional embodiment of the present invention, the printer interface type identification module is further configured to: If the upgrade mode instruction indicates an unattended automated upgrade mode, then multi-interface parallel scanning is immediately started. Through the hardware call specification adaptation logic of different operating systems compatible with the multi-system adaptation layer, the interface type of the connected printer is identified. If the upgrade mode instruction indicates a manual upgrade mode, then upon receiving a manually triggered upgrade instruction, the system will respond to the manually triggered upgrade instruction and perform the upgrade.
[0030] In an optional embodiment of the present invention, the operating system includes at least HarmonyOS and Android, and the printer interface type identification module is further used for: The operating system identifier of the control terminal is read by the multi-system adaptation layer to determine the type of operating system that needs to be adapted. Based on the determined operating system type, the corresponding underlying hardware driver interface is dynamically loaded, and based on the underlying hardware driver interface, the identification operation for printers with different interface types is performed. If it is the HarmonyOS system, then the distributed soft bus protocol, Wi-Fi scanning framework, BLE Bluetooth service and network communication interface will be loaded. If it is an Android system, then the Wi-Fi Manager API, BluetoothGatt API, NFC NDEF protocol and Socket communication module are loaded.
[0031] In an optional embodiment of the present invention, the printer interface type identification module is further configured to: The IP address and port information of online devices in the local area network are obtained through the Wi-Fi scanning interface in the underlying hardware driver interface. Probe packets based on IPP or AirPrint protocol are sent to each device. If the printer identity identifier is received, it is determined to be a Wi-Fi interface printer. Scan Bluetooth devices through the Bluetooth scanning interface in the underlying hardware driver interface, filter out devices that support SPP or BLE protocols, traverse the filtered Bluetooth devices, match the service UUID of each Bluetooth device with the preset printer service UUID, and match the device name of each Bluetooth device with the preset printer name prefix. If the match is successful, it is determined to be a Bluetooth interface printer. The NFC tag in the NFC sensing area of the printer is read through the NFC read / write interface in the underlying hardware driver interface. If the device type field parsed from the tag identifies it as a printer, it is determined to be an NFC interface printer. A TCP connection is established with a preset port through the network communication interface in the underlying hardware driver interface. A firmware query command is sent to the printer. If the connection is successful and a valid version response data is received, it is determined to be a network interface printer.
[0032] In an optional embodiment of the present invention, the firmware version number acquisition module is further configured to: If the printer is identified as having a Wi-Fi interface, the Wi-Fi version query interface provided by the multi-system adaptation layer is called to read the current firmware version number from the printer via HTTP, HTTPS, or SNMP protocols. If the printer is identified as having a Bluetooth interface, the Bluetooth version query interface provided by the multi-system adaptation layer is called to read the current firmware version number from the printer via the GATT protocol or AT commands. If the printer is identified as having an NFC interface, the NFC version query interface provided by the multi-system adaptation layer is called to read the current firmware version number from the printer by sending a wake-up and version acquisition command. If the printer is identified as having a network interface, the current firmware version number of the printer can be obtained by parsing the valid version response data.
[0033] In an optional embodiment of the present invention, the firmware upgrade module is further configured to: If the printer is identified as having a Wi-Fi interface, the Wi-Fi upgrade interface provided by the multi-system adaptation layer is called, and the target firmware file is uploaded to the printer firmware update server in chunks using HTTP or HTTPS protocol. The Wi-Fi upgrade trigger command is then used to perform an overwrite installation. If the printer is identified as having a Bluetooth interface, the Bluetooth upgrade interface provided by the multi-system adaptation layer is invoked. The target firmware file is then transmitted to the printer firmware storage area in packets of a preset size via the GATT protocol or SPP serial port, and a Bluetooth upgrade trigger command is sent to perform an overwrite installation. If the printer is identified as having an NFC interface, the NFC upgrade interface provided by the multi-system adaptation layer is called to split the target firmware file into data blocks that do not exceed the preset NDEF data block size threshold, write them sequentially to the printer's NFC upgrade storage area, and send an NFC upgrade trigger command to perform an overwrite installation. If the printer is identified as having a network interface, the network upgrade interface provided by the multi-system adaptation layer is invoked. The target firmware file is uploaded to the printer's specified directory via FTP protocol, or a firmware binary stream is sent to the printer via TCP port, and a network upgrade trigger command is sent to perform an overwrite installation.
[0034] In an optional embodiment of the present invention, the upgrade retry module is further configured to: If a transmission failure, verification error, or connection interruption is detected during the firmware upgrade process, a retry mechanism will be automatically triggered to re-execute the firmware upgrade operation until the upgrade is successful.
[0035] In an optional embodiment of the present invention, the firmware upgrade information receiving module is further configured to: The target firmware version number, upgrade mode command, and target firmware file are received via the HarmonyOS distributed soft bus or Android LAN communication link.
[0036] As the system implementation is basically similar to the method implementation, it is described in a relatively simple way. For relevant details, please refer to the description of the method implementation.
[0037] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0038] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0039] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A printer firmware upgrade method, characterized in that, The method includes: Receive the target firmware version number, upgrade mode command, and target firmware file from the control terminal; The target firmware file is subjected to integrity verification, and the target firmware file is stored locally after the verification is successful. The upgrade mode is determined according to the upgrade mode instruction. If it is an unattended automated upgrade mode, then a multi-interface parallel scan of the printer is started. The interface type of the connected printer is identified by the hardware call specification adaptation logic of different operating systems compatible with the multi-system adaptation layer. The printer's current firmware version number is obtained using the method for retrieval based on the identified interface type. If the current firmware version number does not match the target firmware version number, the target firmware file will be transmitted using the transmission method adapted to the identified interface type for upgrade. If the upgrade fails, the upgrade process will be automatically retried until the upgrade is successful.
2. The method according to claim 1, characterized in that, The target firmware file is subjected to integrity verification. If the verification passes, the target firmware file is stored locally, including: Perform MD5 integrity verification on the received target firmware file; If the verification fails, the firmware file corruption information is reported to the control terminal, and the process is terminated.
3. The method according to claim 1, characterized in that, Determining the upgrade mode according to the upgrade mode instruction includes: If the upgrade mode instruction indicates an unattended automated upgrade mode, then multi-interface parallel scanning is immediately started. Through the hardware call specification adaptation logic of different operating systems compatible with the multi-system adaptation layer, the interface type of the connected printer is identified. If the upgrade mode instruction indicates a manual upgrade mode, then upon receiving a manually triggered upgrade instruction, the system will respond to the manually triggered upgrade instruction and perform the upgrade.
4. The method according to claim 1, characterized in that, The operating system includes at least HarmonyOS and Android. Through hardware call specification adaptation logic for different operating systems compatible with a multi-system adaptation layer, the interface type of the connected printer is identified, including: The operating system identifier of the control terminal is read by the multi-system adaptation layer to determine the type of operating system that needs to be adapted. Based on the determined operating system type, the corresponding underlying hardware driver interface is dynamically loaded, and based on the underlying hardware driver interface, the identification operation for printers with different interface types is performed. If it is the HarmonyOS system, then the distributed soft bus protocol, Wi-Fi scanning framework, BLE Bluetooth service and network communication interface will be loaded. If it is an Android system, then the Wi-Fi Manager API, BluetoothGatt API, NFC NDEF protocol and Socket communication module are loaded.
5. The method according to claim 4, characterized in that, Based on the underlying hardware driver interface, it performs identification operations for printers with different interface types, including: The IP address and port information of online devices in the local area network are obtained through the Wi-Fi scanning interface in the underlying hardware driver interface. Probe packets based on IPP or AirPrint protocol are sent to each device. If the printer identity identifier is received, it is determined to be a Wi-Fi interface printer. Scan Bluetooth devices through the Bluetooth scanning interface in the underlying hardware driver interface, filter out devices that support SPP or BLE protocols, traverse the filtered Bluetooth devices, match the service UUID of each Bluetooth device with the preset printer service UUID, and match the device name of each Bluetooth device with the preset printer name prefix. If the match is successful, it is determined to be a Bluetooth interface printer. The NFC tag in the NFC sensing area of the printer is read through the NFC read / write interface in the underlying hardware driver interface. If the device type field parsed from the tag identifies it as a printer, it is determined to be an NFC interface printer. A TCP connection is established with a preset port through the network communication interface in the underlying hardware driver interface. A firmware query command is sent to the printer. If the connection is successful and a valid version response data is received, it is determined to be a network interface printer.
6. The method according to claim 5, characterized in that, The printer's current firmware version number is obtained using the identified interface type adaptation method, including: If the printer is identified as having a Wi-Fi interface, the Wi-Fi version query interface provided by the multi-system adaptation layer is called to read the current firmware version number from the printer via HTTP, HTTPS, or SNMP protocols. If the printer is identified as having a Bluetooth interface, the Bluetooth version query interface provided by the multi-system adaptation layer is called to read the current firmware version number from the printer via the GATT protocol or AT commands. If the printer is identified as having an NFC interface, the NFC version query interface provided by the multi-system adaptation layer is called to read the current firmware version number from the printer by sending a wake-up and version acquisition command. If the printer is identified as having a network interface, the current firmware version number of the printer can be obtained by parsing the valid version response data.
7. The method according to claim 5, characterized in that, The target firmware file is transmitted for upgrade using a transmission method adapted to the identified interface type, including: If the printer is identified as having a Wi-Fi interface, the Wi-Fi upgrade interface provided by the multi-system adaptation layer is called, and the target firmware file is uploaded to the printer firmware update server in chunks using HTTP or HTTPS protocol. The Wi-Fi upgrade trigger command is then used to perform an overwrite installation. If the printer is identified as having a Bluetooth interface, the Bluetooth upgrade interface provided by the multi-system adaptation layer is invoked. The target firmware file is then transmitted to the printer firmware storage area in packets of a preset size via the GATT protocol or SPP serial port, and a Bluetooth upgrade trigger command is sent to perform an overwrite installation. If the printer is identified as having an NFC interface, the NFC upgrade interface provided by the multi-system adaptation layer is called to split the target firmware file into data blocks that do not exceed the preset NDEF data block size threshold, write them sequentially to the printer's NFC upgrade storage area, and send an NFC upgrade trigger command to perform an overwrite installation. If the printer is identified as having a network interface, the network upgrade interface provided by the multi-system adaptation layer is invoked. The target firmware file is uploaded to the printer's specified directory via FTP protocol, or a firmware binary stream is sent to the printer via TCP port, and a network upgrade trigger command is sent to perform an overwrite installation.
8. The method according to claim 1, characterized in that, If the upgrade fails, the upgrade process will be automatically retried until it succeeds, including: If a transmission failure, verification error, or connection interruption is detected during the firmware upgrade process, a retry mechanism will be automatically triggered to re-execute the firmware upgrade operation until the upgrade is successful.
9. The method according to claim 1, characterized in that, Receive the target firmware version number, upgrade mode command, and target firmware file from the control terminal, including: The target firmware version number, upgrade mode command, and target firmware file are received via the HarmonyOS distributed soft bus or Android LAN communication link.
10. A printer firmware upgrade system, characterized in that, The system includes: The firmware upgrade information receiving module is used to receive the target firmware version number, upgrade mode command and target firmware file sent by the control terminal; The integrity verification module is used to perform integrity verification on the target firmware file, and after the verification is successful, the target firmware file is stored locally. The printer interface type identification module is used to determine the upgrade mode according to the upgrade mode instruction. If it is an unattended automated upgrade mode, it starts a multi-interface parallel scan of the printer and identifies the interface type of the connected printer through the hardware call specification adaptation logic of different operating systems compatible with the multi-system adaptation layer. The firmware version number acquisition module is used to obtain the printer's current firmware version number using the acquisition method adapted to the identified interface type. The firmware upgrade module is used to upgrade the target firmware file by transmitting the target firmware file using a transmission method adapted to the identified interface type if the current firmware version number does not match the target firmware version number. The upgrade retry module is used to automatically retry the upgrade process if the upgrade fails, until the upgrade is successful.
