A firmware upgrading method, a firmware upgrading system, an electronic device, and a storage medium

CN115993984BActive Publication Date: 2026-10-09SHENZHEN CHENBEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310153079.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-16
Publication Date
2026-10-09
Estimated Expiration
2043-02-16

AI Technical Summary

Technical Problem

但是这种升级方法,主设备在转发升级数据给从设备时丢数据概率高,且升级数据多一层主设备中转,路径更长,固件升级的耗时较长

Benefits of technology

[0039]The firmware upgrade method and system provided in this application embodiment involve a smart terminal detecting a Bluetooth connection with a master device and a Bluetooth connection between the master device and a slave device. The smart terminal queries the first firmware version number of the master device and the second firmware version number of the slave device. If the first firmware version number is inconsistent with the first cloud version number and the second firmware version number is inconsistent with the second cloud version number, the Bluetooth device is considered to require a firmware upgrade. In response to a firmware upgrade command, the smart terminal disconnects from the master device and establishes a Bluetooth connection with the slave device. A first upgrade data packet is sent to the slave device so that the slave device can use the first upgrade data packet for upgrade. Thus, when both master and slave Bluetooth devices require firmware upgrades, the slave device's firmware is upgraded first, the smart terminal disconnects from the master device, and the smart terminal connects to the slave device to send data for firmware upgrade. This not only reduces firmware upgrade time but also reduces the risk of losing upgrade data packets, resulting in a more stable upgrade and saving upgrade time for the slave device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115993984B_ABST
    Figure CN115993984B_ABST
Patent Text Reader

Abstract

The application provides a firmware upgrading method, a firmware upgrading system, an electronic device and a storage medium. The firmware upgrading method comprises the following steps: when detecting that a smart terminal is in a Bluetooth connection state with a master device and the master device is in a Bluetooth connection state with a slave device, querying a first firmware version number of the master device and a second firmware version number of the slave device; when the first firmware version number is inconsistent with a first cloud version number and the second firmware version number is inconsistent with a second cloud version number, considering that the Bluetooth device needs to be upgraded; in response to a firmware upgrading instruction, disconnecting the Bluetooth connection between the smart terminal and the master device and establishing a Bluetooth connection between the smart terminal and the slave device; and sending a first upgrading data packet to the slave device, so that the slave device is upgraded by using the first upgrading data packet. According to the method and the system, the firmware upgrading time can be reduced, the upgrading data packet is not easy to be lost, the upgrading is more stable, and the firmware upgrading time of the slave device can be saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of communication and computer technology, and more specifically, to a firmware upgrade method, a firmware upgrade system, an electronic device, and a storage medium. Background Technology

[0002] Bluetooth is a wireless communication technology standard that enables short-range data exchange between fixed devices, mobile devices, and personal area networks. In practical applications, upgrading the Bluetooth device's system is often necessary to improve its performance.

[0003] Currently, when upgrading the firmware of a slave device in a Bluetooth master-slave setup, the master device forwards the upgrade data. The smart terminal sends the upgrade data to the master device, which then sends it to the slave device. However, this upgrade method has a high probability of data loss when the master device forwards the upgrade data to the slave device, and the upgrade data has an extra layer of relay through the master device, resulting in a longer path and a longer firmware upgrade time. Summary of the Invention

[0004] In view of this, the purpose of this application is to provide a firmware upgrade method, firmware upgrade system, electronic device and storage medium. When the master and slave Bluetooth devices need to be upgraded, the slave device is upgraded first, the smart terminal disconnects from the master device, and the smart terminal connects to the slave device to send data for firmware upgrade. This not only reduces firmware upgrade time, but also makes it less likely to lose upgrade data packets, and the upgrade is more stable, thus saving the firmware upgrade time of the slave device.

[0005] In a first aspect, embodiments of this application provide a firmware upgrade method, which is applied to a smart terminal, and the firmware upgrade method includes:

[0006] Before starting the firmware upgrade, the connection relationship with the master device in the Bluetooth device, and the connection relationship between the master device and the slave device in the Bluetooth device are detected;

[0007] When a Bluetooth connection is detected between the master device and the slave device, and the master device is also connected to the slave device via Bluetooth, the first firmware version number of the master device and the second firmware version number of the slave device are queried.

[0008] When the first firmware version number is inconsistent with the first cloud version number and the second firmware version number is inconsistent with the second cloud version number, the Bluetooth device is considered to need a firmware upgrade.

[0009] In response to a firmware upgrade command, the Bluetooth connection with the master device is disconnected, and a Bluetooth connection is established with the slave device.

[0010] A first upgrade data packet is sent to the slave device so that the slave device can perform an upgrade using the first upgrade data packet.

[0011] Furthermore, sending the first upgrade data packet to the slave device includes:

[0012] Send a first firmware upgrade notification to the slave device;

[0013] When the first confirmation upgrade message returned from the device is received, the length of the first single packet data is determined from the first confirmation upgrade message;

[0014] The first upgrade data packet is split into multiple first upgrade sub-data packets according to the first single packet data length; wherein the size of the first upgrade sub-data packet is less than or equal to the first single packet data length;

[0015] When a firmware upgrade request is received from the slave device, the plurality of first upgrade sub-data packets are sequentially sent to the slave device.

[0016] Furthermore, the step of sequentially sending the plurality of first upgrade sub-data packets to the slave device includes:

[0017] The first first upgrade sub-data packet among the plurality of first upgrade sub-data packets is determined as the target first upgrade sub-data packet, and the target first upgrade sub-data packet is sent to the slave device, and the system listens for whether it receives the reception information fed back by the slave device;

[0018] If so, the next first upgrade sub-data packet following the target first upgrade sub-data packet in the plurality of first upgrade sub-data packets is determined as the target first upgrade sub-data packet, and the process returns to the step of sending the target first upgrade sub-data packet to the slave device, until there is no next first upgrade sub-data packet following the target first upgrade sub-data packet in the plurality of first upgrade sub-data packets;

[0019] If not, the target first upgrade sub-data packet is resent until the reception information fed back by the slave device is received.

[0020] Furthermore, the firmware upgrade method also includes:

[0021] After the upgrade of the slave device is completed, the Bluetooth connection with the slave device is disconnected, and a Bluetooth connection is established with the master device.

[0022] The master device sends a second upgrade data packet to the master device according to the second single packet data length supported by the master device, so that the master device can use the second upgrade data packet to perform the upgrade.

[0023] Furthermore, the firmware upgrade method also includes:

[0024] When a Bluetooth connection is detected with the slave device, query the second firmware version number of the slave device;

[0025] When the second firmware version number is inconsistent with the second cloud version number, it is considered that the slave device needs to be upgraded with firmware.

[0026] In response to the firmware upgrade command, the first upgrade data packet is sent to the slave device according to the first single packet data length supported by the slave device, so that the slave device can upgrade using the first upgrade data packet.

[0027] Secondly, embodiments of this application also provide a firmware upgrade method, which is applied to a slave device in a Bluetooth device, and the firmware upgrade method includes:

[0028] When a request to establish a connection is received from a smart terminal, a Bluetooth connection is established with the smart terminal.

[0029] The system receives a first upgrade data packet sent by the smart terminal and performs an upgrade using the first upgrade data packet.

[0030] Thirdly, this application also provides a firmware upgrade method, which is applied to a master device in a Bluetooth device, and includes:

[0031] When a request to establish a connection is received from a smart terminal, a Bluetooth connection is established with the smart terminal.

[0032] The system receives a second upgrade data packet sent by the smart terminal and performs an upgrade using the second upgrade data packet.

[0033] Fourthly, embodiments of this application also provide a firmware upgrade system, which includes a smart terminal, a master device and a slave device in a Bluetooth device;

[0034] The smart terminal is configured to detect the connection relationship with the master device in the Bluetooth device and the connection relationship between the master device and the slave device in the Bluetooth device before starting the firmware upgrade. When it detects that there is a Bluetooth connection with the master device and a Bluetooth connection between the master device and the slave device, it queries the first firmware version number of the master device and the second firmware version number of the slave device. If the first firmware version number is inconsistent with the first cloud version number and the second firmware version number is inconsistent with the second cloud version number, it is considered that the Bluetooth device needs to be upgraded. In response to the firmware upgrade command, it disconnects the Bluetooth connection with the master device and establishes a Bluetooth connection with the slave device, and sends a first upgrade data packet to the slave device so that the slave device can upgrade using the first upgrade data packet.

[0035] The slave device is configured to establish a Bluetooth connection with the smart terminal when it receives an establishment request sent by the smart terminal, receive a first upgrade data packet sent by the smart terminal, and perform an upgrade using the first upgrade data packet;

[0036] The master device is configured to establish a Bluetooth connection with the smart terminal when it receives an establishment request from the smart terminal, receive a second upgrade data packet sent by the smart terminal, and perform an upgrade using the second upgrade data packet.

[0037] Fifthly, embodiments of this application also provide an electronic device, including: a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and when the machine-readable instructions are executed by the processor, the steps of the firmware upgrade method described above are performed.

[0038] Sixthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the firmware upgrade method described above.

[0039] The firmware upgrade method and system provided in this application embodiment involve a smart terminal detecting a Bluetooth connection with a master device and a Bluetooth connection between the master device and a slave device. The smart terminal queries the first firmware version number of the master device and the second firmware version number of the slave device. If the first firmware version number is inconsistent with the first cloud version number and the second firmware version number is inconsistent with the second cloud version number, the Bluetooth device is considered to require a firmware upgrade. In response to a firmware upgrade command, the smart terminal disconnects from the master device and establishes a Bluetooth connection with the slave device. A first upgrade data packet is sent to the slave device so that the slave device can use the first upgrade data packet for upgrade. Thus, when both master and slave Bluetooth devices require firmware upgrades, the slave device's firmware is upgraded first, the smart terminal disconnects from the master device, and the smart terminal connects to the slave device to send data for firmware upgrade. This not only reduces firmware upgrade time but also reduces the risk of losing upgrade data packets, resulting in a more stable upgrade and saving upgrade time for the slave device.

[0040] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0041] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0042] Figure 1 This is one of the flowcharts for a firmware upgrade method provided in an embodiment of this application;

[0043] Figure 2 A second flowchart illustrating a firmware upgrade method provided in this application embodiment;

[0044] Figure 3 A third flowchart illustrating a firmware upgrade method provided in this application embodiment;

[0045] Figure 4 This is a schematic diagram of the structure of a firmware upgrade system provided in an embodiment of this application;

[0046] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0047] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. Based on the embodiments of this application, every other embodiment obtained by those skilled in the art without inventive effort falls within the scope of protection of this application.

[0048] First, the applicable scenarios for this application will be introduced. This application can be applied to the fields of communication and computer technology.

[0049] Bluetooth is a wireless communication technology standard that enables short-range data exchange between fixed devices, mobile devices, and personal area networks. In practical applications, upgrading the Bluetooth device's system is often necessary to improve its performance.

[0050] Research has revealed that currently, when upgrading the firmware of a slave device in a Bluetooth master-slave setup, the master device forwards the upgrade data. The smart terminal sends the upgrade data to the master device, which then sends it to the slave device. However, this upgrade method has a high probability of data loss when the master device forwards the upgrade data to the slave device, and the upgrade data has an extra layer of relay through the master device, resulting in a longer path and a longer firmware upgrade time.

[0051] Based on this, the embodiments of this application provide a firmware upgrade method that can not only reduce firmware upgrade time, but also reduce the risk of losing upgrade data packets, and make the upgrade more stable, thus saving upgrade time for the device firmware.

[0052] Please see Figure 1 , Figure 1 This is one of the flowcharts for a firmware upgrade method provided in an embodiment of this application. Figure 1 As shown in the embodiments of this application, the firmware upgrade method provided is applied to a smart terminal and includes:

[0053] S101, before starting the firmware upgrade, detect the connection relationship with the master device in the Bluetooth device, and the connection relationship between the master device and the slave device in the Bluetooth device.

[0054] Regarding step S101 above, in specific implementation, before starting the firmware upgrade, the smart terminal first detects its connection relationship with the master device in the Bluetooth device, as well as the connection relationship between the master device in the Bluetooth device and the slave device in the Bluetooth device.

[0055] According to the embodiments provided in this application, the smart terminal can be a mobile phone or tablet computer, and the Bluetooth device is a food probe device. The probe device consists of two Bluetooth devices: a box and a probe. The box is the master device, which can be connected to the smart terminal or actively connect to the probe as the master device; the probe is the slave device, which can only be connected to the smart terminal or the box. In the food probe device, the master device box acts as a signal amplifier for the slave device probe, allowing the probe's Bluetooth signal to be transmitted further. Therefore, only the probe actually performs the device functions in the food probe device. The smart terminal also interacts with the probe. The smart terminal can connect to three types of probe devices: one is a probe kit where the smart terminal connects to the box and the box connects to the probe; another is a direct connection between the smart terminal and the probe; and the last is a direct connection between the smart terminal and the box without connecting the probe, referred to as a single box. Although the smart terminal can connect to a single box, there is no functional interaction between the smart terminal and the single box, and the smart terminal does not pay attention to the single box. Therefore, firmware upgrades for the food probe device only consider the first type of kit and the second type of single probe. Steps S101-S105 mainly take firmware upgrades for the kit type as an example.

[0056] S102, when it is detected that there is a Bluetooth connection between the master device and the slave device, and the master device is in a Bluetooth connection with the slave device, query the first firmware version number of the master device and the second firmware version number of the slave device.

[0057] It should be noted that the first firmware version number refers to the current firmware version number of the master device in the Bluetooth device, and the second firmware version number refers to the current firmware version number of the slave device in the Bluetooth device.

[0058] Regarding step S102 above, in specific implementation, when the smart terminal detects that it is in a Bluetooth connection state with the master device and the master device is in a Bluetooth connection state with the slave device, it queries the first firmware version number of the master device and the second firmware version number of the slave device. According to the embodiment provided in this application, when the Bluetooth device is a food probe device, when the smart terminal detects that it is in a Bluetooth connection state with the box and the box is in a Bluetooth connection state with the probe, it queries the first firmware version number of the box and the second firmware version number of the probe.

[0059] S103, when the first firmware version number is inconsistent with the first cloud version number and the second firmware version number is inconsistent with the second cloud version number, it is considered that the Bluetooth device needs to be upgraded.

[0060] It should be noted that the first cloud version number refers to the latest firmware version number of the master device in the cloud, and the second cloud version number refers to the latest firmware version number of the slave device in the cloud.

[0061] Regarding step S103 above, in specific implementation, if the first firmware version number of the master device is inconsistent with the latest firmware version number of the master device in the cloud, and the second firmware version number of the slave device is inconsistent with the latest firmware version number of the slave device in the cloud, then the Bluetooth device is considered to need a firmware upgrade.

[0062] S104, in response to the firmware upgrade command, disconnect the Bluetooth connection from the master device and establish a Bluetooth connection with the slave device.

[0063] It should be noted that the firmware upgrade command refers to the instruction received by the smart terminal, which is used to instruct the firmware to be upgraded.

[0064] Regarding step S104 above, in specific implementation, when the smart terminal detects that the firmware version number of the Bluetooth device is inconsistent with the firmware version number in the cloud, it prompts the user of the smart terminal to perform a firmware upgrade. Firmware upgrades have two levels: normal upgrade level and forced upgrade level. A normal upgrade only prompts the user; the user upgrades the firmware as needed. When the user selects to upgrade the firmware in the smart terminal, the smart terminal responds to the user's firmware upgrade command. A forced upgrade forces the user to upgrade; otherwise, the device's related functions cannot be used, and the smart terminal automatically generates a firmware upgrade command. When the smart terminal responds to the firmware upgrade command, the Bluetooth connection between the smart terminal and the master device is disconnected, and a Bluetooth connection is established with the slave device. Here, according to the embodiment provided in this application, the slave device firmware upgrade of the Bluetooth device adopts a fast firmware upgrade by disconnecting the master device and directly connecting to the slave device. This reduces firmware upgrade time, reduces the risk of losing upgrade data packets, makes the upgrade more stable, and saves upgrade time for the slave device firmware.

[0065] S105, a first upgrade data packet is sent to the slave device so that the slave device can perform an upgrade using the first upgrade data packet.

[0066] It should be noted that the first upgrade data package refers to the data package stored in the cloud used to upgrade the slave device.

[0067] Regarding step S105 above, in a specific implementation, after the smart terminal establishes a Bluetooth connection with the slave device, the smart terminal downloads the first upgrade data packet for upgrading the slave device from the cloud and sends the first upgrade data packet to the slave device so that the slave device can use the first upgrade data packet to perform the upgrade.

[0068] Specifically, regarding step S105 above, sending the first upgrade data packet to the slave device includes:

[0069] Step 1051: Send a first firmware upgrade notification to the slave device.

[0070] Step 1052: When the first confirmation upgrade message returned from the device is received, the length of the first single packet data is determined from the first confirmation upgrade message.

[0071] Step 1053: The first upgrade data packet is split into multiple first upgrade sub-data packets according to the length of the first single packet data.

[0072] Step 1054: When a firmware upgrade request is received from the slave device, the plurality of first upgrade sub-data packets are sequentially sent to the slave device.

[0073] It should be noted that the first firmware upgrade notification refers to the notification used to instruct the slave device to perform a firmware upgrade. The first confirmation upgrade message refers to the confirmation message returned by the slave device to the smart terminal after receiving the first firmware upgrade notification. The first confirmation upgrade message returned by the slave device carries the maximum length of a single data packet supported by the slave device. The first single data packet length refers to the maximum length of a single data packet supported by the slave device. The first upgrade sub-data packet can be obtained by splitting the first upgrade data packet based on the first single data packet length, wherein the size of the first upgrade sub-data packet is less than or equal to the first single data packet length.

[0074] Regarding steps 1051-1054 above, in specific implementation, after the smart terminal confirms the firmware upgrade, it sends a first firmware upgrade notification to the slave device. When it receives a first confirmation upgrade message from the slave device based on the first firmware upgrade notification, it determines the first single-packet data length supported by the slave device from the first confirmation upgrade message. Then, according to the first single-packet data length, the first upgrade data packet is split into multiple first upgrade sub-data packets. After receiving the firmware upgrade request sent by the slave device, the multiple first upgrade sub-data packets are sent to the slave device sequentially, so that the slave device can upgrade according to the multiple first upgrade sub-data packets. Here, according to the embodiment provided in this application, when performing a Bluetooth device firmware upgrade, the slave device actively sends an upgrade request to the smart terminal according to the optimal byte length it can handle. The smart terminal sends an upgrade data packet to the slave device after receiving the upgrade request sent by the slave device, which can adapt to chips with different performance.

[0075] Specifically, regarding step 1054 above, the step of sequentially sending the plurality of first upgrade sub-data packets to the slave device includes:

[0076] Step 10541: Determine the first first upgrade sub-data packet among the plurality of first upgrade sub-data packets as the target first upgrade sub-data packet, send the target first upgrade sub-data packet to the slave device, and listen for whether the slave device has received the reception information.

[0077] Step 10542: If yes, then determine the next first upgrade sub-data packet following the target first upgrade sub-data packet in the plurality of first upgrade sub-data packets as the target first upgrade sub-data packet, and return to the step of sending the target first upgrade sub-data packet to the slave device, until there is no next first upgrade sub-data packet following the target first upgrade sub-data packet in the plurality of first upgrade sub-data packets.

[0078] Step 10543: If not, resend the target first upgrade sub-data packet until the reception information fed back by the slave device is received.

[0079] Regarding steps 10541-10543 above, in specific implementation, the smart terminal determines the first first upgrade sub-data packet among multiple first upgrade sub-data packets as the target first upgrade sub-data packet, sends the target first upgrade sub-data packet to the slave device, and listens for whether it receives reception information from the slave device. If reception information is received from the slave device, step 10542 is executed, determining the next first upgrade sub-data packet following the target first upgrade sub-data packet among the multiple first upgrade sub-data packets as the target first upgrade sub-data packet, and returning to the step of sending the target first upgrade sub-data packet to the slave device in step 10541, until there is no next first upgrade sub-data packet following the target first upgrade sub-data packet among the multiple first upgrade sub-data packets, at which point all first upgrade sub-data packets have been sent to the slave device. If no reception information is received from the slave device, the target first upgrade sub-data packet is resent until reception information is received from the slave device.

[0080] According to the firmware upgrade method provided in the embodiments of this application, the firmware upgrade method further includes:

[0081] A. After the upgrade of the slave device is completed, the Bluetooth connection between the slave device and the master device is disconnected, and a Bluetooth connection is established between the master device and the master device.

[0082] B. Send a second upgrade data packet to the master device according to the second single packet data length supported by the master device, so that the master device can use the second upgrade data packet to perform the upgrade.

[0083] It should be noted that the second single-packet data length refers to the maximum length of a single packet of data supported by the master device. The second upgrade data packet refers to the data packet stored in the cloud used to upgrade the master device.

[0084] Regarding steps A-B above, in specific implementation, after the slave device firmware upgrade is successful, the smart terminal disconnects the Bluetooth connection from the slave device and establishes a Bluetooth connection with the master device. Then, the smart terminal sends a second upgrade data packet to the master device according to the second single-packet data length supported by the master device, so that the master device can use the second upgrade data packet for upgrade.

[0085] Furthermore, regarding step B above, sending the second upgrade data packet to the master device according to the second single-packet data length supported by the master device includes:

[0086] A second firmware upgrade notification is sent to the master device; when a second confirmation upgrade message is received from the master device, the second single packet data length is determined from the second confirmation upgrade message; the second upgrade data packet is split into multiple second upgrade sub-data packets according to the second single packet data length; wherein the size of the second upgrade sub-data packet is less than or equal to the second single packet data length; when a firmware upgrade request is received from the master device, the multiple second upgrade sub-data packets are sent to the master device sequentially.

[0087] Regarding the above steps, in specific implementation, after the smart terminal confirms the firmware upgrade, it sends a second firmware upgrade notification to the master device. When it receives a second confirmation upgrade message from the master device based on the second firmware upgrade notification, it determines the second single-packet data length supported by the master device from the second confirmation upgrade message. Then, according to the second single-packet data length, the second upgrade data packet is split into multiple second upgrade sub-data packets. Upon receiving the firmware upgrade request from the master device, the multiple second upgrade sub-data packets are sent to the master device sequentially, so that the master device can perform the upgrade based on the multiple second upgrade sub-data packets.

[0088] Furthermore, in specific implementation, the step of sequentially sending the plurality of second upgrade sub-data packets to the master device includes:

[0089] The first second upgrade sub-data packet among the plurality of second upgrade sub-data packets is identified as the target second upgrade sub-data packet, and the target second upgrade sub-data packet is sent to the master device. The system listens for whether the master device has received a reception message. If so, the next second upgrade sub-data packet following the target second upgrade sub-data packet among the plurality of second upgrade sub-data packets is identified as the target second upgrade sub-data packet, and the system returns to the step of sending the target second upgrade sub-data packet to the master device until there is no next second upgrade sub-data packet following the target second upgrade sub-data packet among the plurality of second upgrade sub-data packets. If not, the target second upgrade sub-data packet is resent until the master device has received a reception message.

[0090] In the specific implementation of the above steps, the smart terminal identifies the first second upgrade sub-data packet among multiple second upgrade sub-data packets as the target second upgrade sub-data packet and sends it to the master device, while listening for reception information from the master device. If reception information is received from the master device, the next second upgrade sub-data packet following the target second upgrade sub-data packet is identified as the target second upgrade sub-data packet, and the process of sending the target second upgrade sub-data packet to the master device is repeated until no next second upgrade sub-data packet following the target second upgrade sub-data packet exists, indicating that all second upgrade sub-data packets have been sent to the master device. If no reception information is received from the master device, the target second upgrade sub-data packet is resent until reception information is received from the master device.

[0091] As an optional implementation, the firmware upgrade method provided in this application embodiment further includes:

[0092] When a Bluetooth connection is detected with the slave device, the second firmware version number of the slave device is queried; if the second firmware version number is inconsistent with the second cloud version number, it is considered that the slave device needs to be upgraded; in response to the firmware upgrade instruction, the first upgrade data packet is sent to the slave device according to the first single packet data length supported by the slave device, so that the slave device can use the first upgrade data packet to upgrade.

[0093] Regarding the above steps, in specific implementation, when the smart terminal detects that it is only in a Bluetooth connection state with the slave device, it queries the second firmware version number of the slave device; when the second firmware version number is inconsistent with the second cloud version number in the cloud, it is considered that the slave device needs to be upgraded; in response to the firmware upgrade command, a first upgrade data packet is sent to the slave device according to the first single packet data length supported by the slave device, so that the slave device can upgrade using the first upgrade data packet. Here, the method for upgrading the firmware of the slave device alone is the same as the method for upgrading the slave device in step S105 above, and can achieve the same technical effect, so it will not be described again here. Here, according to the embodiment provided in this application, the above steps are for the case where the smart terminal is directly connected to the probe in the food probe device, and the firmware upgrade of the single device is performed directly through the direct connection between the terminal device and the single device.

[0094] The firmware upgrade method provided in this application is applied to a smart terminal. Before starting a firmware upgrade, the smart terminal detects the connection relationship with the master device in the Bluetooth device and the connection relationship between the master device and the slave device in the Bluetooth device. When a Bluetooth connection is detected with the master device and a Bluetooth connection is detected between the master device and the slave device, the smart terminal queries the first firmware version number of the master device and the second firmware version number of the slave device. If the first firmware version number is inconsistent with the first cloud version number and the second firmware version number is inconsistent with the second cloud version number, then the Bluetooth device is considered to need a firmware upgrade. In response to a firmware upgrade command, the smart terminal disconnects from the master device and establishes a Bluetooth connection with the slave device. A first upgrade data packet is sent to the slave device so that the slave device can use the first upgrade data packet for upgrade. In this way, when the master and slave Bluetooth devices need to upgrade their firmware, the slave device's firmware upgrade is performed first, the smart terminal disconnects from the master device, and the smart terminal connects to the slave device to send data for firmware upgrade. This not only reduces firmware upgrade time but also makes it less likely to lose upgrade data packets and makes the upgrade more stable, saving upgrade time for the slave device's firmware.

[0095] Please see Figure 2 , Figure 2 This is a second flowchart illustrating a firmware upgrade method provided in an embodiment of this application. Figure 2 As shown in the embodiments of this application, the firmware upgrade method provided is applied to a slave device in a Bluetooth device, and the firmware upgrade method includes:

[0096] S201, when a connection request is received from a smart terminal, a Bluetooth connection is established with the smart terminal.

[0097] S202, receive the first upgrade data packet sent by the smart terminal, and perform the upgrade using the first upgrade data packet.

[0098] Regarding steps S201-S202 above, in specific implementation, when the slave device in the Bluetooth device receives an establishment request sent by the smart terminal, it establishes a Bluetooth connection with the smart terminal. Then, it receives the first upgrade data packet sent by the smart terminal and performs an upgrade using the first upgrade data packet.

[0099] Specifically, regarding step S202 above, receiving the first upgrade data packet sent by the smart terminal includes:

[0100] Step 2021: When the first firmware upgrade notification is received from the smart terminal, a first confirmation upgrade message is sent to the smart terminal.

[0101] The first confirmation upgrade message carries the length of the first single packet data that is supported.

[0102] Step 2022: Send a firmware upgrade request to the smart terminal, and sequentially receive multiple first upgrade sub-data packets sent by the smart terminal.

[0103] Wherein, the size of the first upgrade sub-data packet is less than or equal to the length of the first single packet data.

[0104] Regarding steps 2021-2022 above, in specific implementation, when the slave device receives the first firmware upgrade notification sent by the smart terminal, it sends a first confirmation upgrade message to the smart terminal. The first confirmation upgrade message carries the first single packet data length supported by the slave device. It then sends a firmware upgrade request to the smart terminal, sequentially receives multiple first upgrade sub-data packets sent by the smart terminal, and performs the upgrade using these multiple first upgrade sub-data packets.

[0105] Furthermore, in specific implementation, after receiving the first upgrade sub-data packet, the slave device also needs to send back the reception information of each first upgrade sub-data packet to the smart terminal, so that the smart terminal can send the next first upgrade sub-data packet to the slave device after receiving the reception information.

[0106] The firmware upgrade method provided in this application embodiment is applied to a slave device in a Bluetooth device. When it receives a connection request sent by a smart terminal, it establishes a Bluetooth connection with the smart terminal. Then, it receives a first upgrade data packet sent by the smart terminal and performs an upgrade using the first upgrade data packet. In this way, when both the master and slave Bluetooth devices need to perform firmware upgrades, the slave device's firmware upgrade is performed first, the smart terminal disconnects from the master device, and the smart terminal connects to the slave device to send data for firmware upgrade. This not only reduces firmware upgrade time but also reduces the risk of losing upgrade data packets and makes the upgrade more stable, thus saving upgrade time for the slave device.

[0107] Please see Figure 3 , Figure 3 This is a third flowchart illustrating a firmware upgrade method provided in an embodiment of this application. Figure 3 As shown in the embodiments of this application, the firmware upgrade method provided is applied to the master device in a Bluetooth device, and the firmware upgrade method includes:

[0108] S301, when a connection request is received from a smart terminal, a Bluetooth connection is established with the smart terminal.

[0109] S302, receive the second upgrade data packet sent by the smart terminal, and perform the upgrade using the second upgrade data packet.

[0110] Regarding steps S301-S302 above, in specific implementation, when the master device in the Bluetooth device receives the establishment request sent by the smart terminal, it establishes a Bluetooth connection with the smart terminal. Then, it receives the second upgrade data packet sent by the smart terminal and performs the upgrade using the second upgrade data packet.

[0111] Furthermore, in specific implementation, when the master device receives the second firmware upgrade notification sent by the smart terminal, it sends a second confirmation upgrade message to the smart terminal. The second confirmation upgrade message carries the second single packet data length supported by the master device. It then sends a firmware upgrade request to the smart terminal, sequentially receives multiple second upgrade sub-data packets sent by the smart terminal, and performs the upgrade using these multiple second upgrade sub-data packets.

[0112] Furthermore, in specific implementation, after receiving the second upgrade sub-data packet, the master device also needs to send back the reception information of each second upgrade sub-data packet to the smart terminal, so that the smart terminal can send the next second upgrade sub-data packet to the master device after receiving the reception information.

[0113] The firmware upgrade method provided in this application embodiment is applied to a master device in a Bluetooth device. When it receives a connection request from a smart terminal, it establishes a Bluetooth connection with the smart terminal. Then, it receives a second upgrade data packet sent by the smart terminal and uses the second upgrade data packet to perform an upgrade. In this way, when the master and slave Bluetooth devices need to perform firmware upgrades, the slave device's firmware upgrade is performed first, the smart terminal disconnects from the master device, and the smart terminal connects to the slave device to send data for firmware upgrade. This not only reduces firmware upgrade time but also reduces the risk of losing upgrade data packets, resulting in a more stable upgrade and saving upgrade time for the slave device.

[0114] Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of a firmware upgrade system provided in an embodiment of this application. Figure 4As shown, the firmware upgrade system 400 includes a smart terminal 401, a master device 402 and a slave device 403 in a Bluetooth device;

[0115] The smart terminal 401 is used to detect the connection relationship with the master device 402 in the Bluetooth device and the connection relationship between the master device 402 and the slave device 403 in the Bluetooth device before starting the firmware upgrade. When it detects that there is a Bluetooth connection with the master device 402 and the slave device 403, it queries the first firmware version number of the master device 402 and the second firmware version number of the slave device 403. When the first firmware version number is inconsistent with the first cloud version number and the second firmware version number is inconsistent with the second cloud version number, it is considered that the Bluetooth device needs to be upgraded. In response to the firmware upgrade command, it disconnects the Bluetooth connection with the master device 402 and establishes a Bluetooth connection with the slave device 403, and sends a first upgrade data packet to the slave device 403 so that the slave device 403 can use the first upgrade data packet to upgrade.

[0116] The slave device 403 is configured to establish a Bluetooth connection with the smart terminal 401 when it receives an establishment request sent by the smart terminal 401, receive a first upgrade data packet sent by the smart terminal 401, and perform an upgrade using the first upgrade data packet.

[0117] The master device 402 is used to establish a Bluetooth connection with the smart terminal 401 when it receives an establishment request sent by the smart terminal 401, receive a second upgrade data packet sent by the smart terminal 401, and perform an upgrade using the second upgrade data packet.

[0118] Furthermore, when the smart terminal 401 sends a first upgrade data packet to the slave device 403 according to the first single-packet data length supported by the slave device, the smart terminal 401 is also used to:

[0119] Send a first firmware upgrade notification to the slave device 403;

[0120] When the first confirmation upgrade message returned from device 403 is received, the length of the first single packet data is determined from the first confirmation upgrade message;

[0121] The first upgrade data packet is split into multiple first upgrade sub-data packets according to the first single packet data length; wherein the size of the first upgrade sub-data packet is less than or equal to the first single packet data length;

[0122] When a firmware upgrade request is received from the slave device 403, the plurality of first upgrade sub-data packets are sequentially sent to the slave device 403.

[0123] Furthermore, when the smart terminal 401 sequentially sends the plurality of first upgrade sub-data packets to the slave device 403, the smart terminal 401 is also used to:

[0124] The first first upgrade sub-data packet among the plurality of first upgrade sub-data packets is determined as the target first upgrade sub-data packet, and the target first upgrade sub-data packet is sent to the slave device 403, and the system listens for whether it receives the reception information fed back by the slave device 403;

[0125] If so, the next first upgrade sub-data packet following the target first upgrade sub-data packet in the plurality of first upgrade sub-data packets is determined as the target first upgrade sub-data packet, and the process returns to the step of sending the target first upgrade sub-data packet to the slave device 403 until there is no next first upgrade sub-data packet following the target first upgrade sub-data packet in the plurality of first upgrade sub-data packets;

[0126] If not, the target first upgrade sub-data packet is resent until the reception information fed back by the slave device 403 is received.

[0127] Furthermore, the smart terminal 401 is also used for:

[0128] After the upgrade of the slave device 403 is completed, the Bluetooth connection with the slave device 403 is disconnected, and a Bluetooth connection is established with the master device 402.

[0129] The master device 402 sends a second upgrade data packet to the master device 402 according to the second single packet data length supported by the master device 402, so that the master device 402 can use the second upgrade data packet to perform the upgrade.

[0130] Furthermore, the smart terminal 401 is also used for:

[0131] When a Bluetooth connection is detected with the slave device 403, the second firmware version number of the slave device 403 is queried.

[0132] When the second firmware version number is inconsistent with the second cloud version number, it is considered that the slave device 403 needs to be upgraded with firmware.

[0133] In response to the firmware upgrade command, the first upgrade data packet is sent to the slave device 403 according to the first single packet data length supported by the slave device 403, so that the slave device 403 can use the first upgrade data packet to perform the upgrade.

[0134] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 5 As shown, the electronic device 500 includes a processor 510, a memory 520, and a bus 530.

[0135] The memory 520 stores machine-readable instructions executable by the processor 510. When the electronic device 500 is running, the processor 510 and the memory 520 communicate via the bus 530. When the machine-readable instructions are executed by the processor 510, they can perform the operations described above. Figure 1 as well as Figure 3 The steps of the firmware upgrade method in the illustrated method embodiment can be found in the method embodiment for specific implementation, and will not be repeated here.

[0136] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can perform the above-described actions. Figure 1 as well as Figure 3 The steps of the firmware upgrade method in the illustrated method embodiment can be found in the method embodiment for specific implementation, and will not be repeated here.

[0137] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0138] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0139] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0140] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0141] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0142] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0143] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The scope of protection of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A firmware upgrade method, characterized in that, The firmware upgrade method is applied to a smart terminal, and the firmware upgrade method includes: Before starting the firmware upgrade, the connection relationship with the master device in the Bluetooth device, and the connection relationship between the master device and the slave device in the Bluetooth device are detected; wherein, the smart terminal is connected to the master device, the master device is connected to the slave device, or the smart terminal is directly connected to the slave device; When a Bluetooth connection is detected between the master device and the slave device, and the master device is also connected to the slave device via Bluetooth, the first firmware version number of the master device and the second firmware version number of the slave device are queried. When the first firmware version number is inconsistent with the first cloud version number and the second firmware version number is inconsistent with the second cloud version number, the Bluetooth device is considered to need a firmware upgrade. In response to a firmware upgrade command, the Bluetooth connection with the master device is disconnected, and a Bluetooth connection is established with the slave device. Send a first upgrade data packet to the slave device so that the slave device performs an upgrade using the first upgrade data packet; Sending the first upgrade data packet to the slave device includes: Send a first firmware upgrade notification to the slave device; When the first confirmation upgrade message returned from the device is received, the length of the first single packet data is determined from the first confirmation upgrade message; The first upgrade data packet is split into multiple first upgrade sub-data packets according to the first single packet data length; wherein the size of the first upgrade sub-data packet is less than or equal to the first single packet data length; When a firmware upgrade request is received from the slave device, the plurality of first upgrade sub-data packets are sequentially sent to the slave device; The firmware upgrade method further includes: When a Bluetooth connection is detected with the slave device, query the second firmware version number of the slave device; When the second firmware version number is inconsistent with the second cloud version number, it is considered that the slave device needs to be upgraded with firmware. In response to the firmware upgrade command, the first upgrade data packet is sent to the slave device according to the first single packet data length supported by the slave device, so that the slave device can upgrade using the first upgrade data packet.

2. The firmware upgrade method according to claim 1, characterized in that, The step of sequentially sending the plurality of first upgrade sub-data packets to the slave device includes: The first first upgrade sub-data packet among the plurality of first upgrade sub-data packets is determined as the target first upgrade sub-data packet, and the target first upgrade sub-data packet is sent to the slave device, and the system listens for whether it receives the reception information fed back by the slave device; If so, the next first upgrade sub-data packet following the target first upgrade sub-data packet in the plurality of first upgrade sub-data packets is determined as the target first upgrade sub-data packet, and the process returns to the step of sending the target first upgrade sub-data packet to the slave device, until there is no next first upgrade sub-data packet following the target first upgrade sub-data packet in the plurality of first upgrade sub-data packets; If not, the target first upgrade sub-data packet is resent until the reception information fed back by the slave device is received.

3. The firmware upgrade method according to claim 1, characterized in that, The firmware upgrade method further includes: After the upgrade of the slave device is completed, the Bluetooth connection with the slave device is disconnected, and a Bluetooth connection is established with the master device. The master device sends a second upgrade data packet to the master device according to the second single packet data length supported by the master device, so that the master device can use the second upgrade data packet to perform the upgrade.

4. A firmware upgrade method, characterized in that, The firmware upgrade method is applied to a slave device in a Bluetooth device, the slave device being connected to a smart terminal, the smart terminal being used to execute the steps of the firmware upgrade method as described in any one of claims 1 to 3, the firmware upgrade method comprising: When a request to establish a connection is received from a smart terminal, a Bluetooth connection is established with the smart terminal. The system receives a first upgrade data packet sent by the smart terminal and performs an upgrade using the first upgrade data packet.

5. A firmware upgrade method, characterized in that, The firmware upgrade method is applied to a master device in a Bluetooth device, the master device being connected to a smart terminal, the smart terminal being used to execute the steps of the firmware upgrade method as described in any one of claims 1 to 3, the firmware upgrade method comprising: When a request to establish a connection is received from a smart terminal, a Bluetooth connection is established with the smart terminal. The system receives a second upgrade data packet sent by the smart terminal and performs an upgrade using the second upgrade data packet.

6. A firmware upgrade system, characterized in that, The firmware upgrade system includes a smart terminal, a master device in a Bluetooth device, and a slave device; wherein, the smart terminal is connected to the master device, the master device is connected to the slave device, or the smart terminal is directly connected to the slave device; The smart terminal is configured to detect the connection relationship with the master device in the Bluetooth device and the connection relationship between the master device and the slave device in the Bluetooth device before starting the firmware upgrade. When it detects that there is a Bluetooth connection with the master device and a Bluetooth connection between the master device and the slave device, it queries the first firmware version number of the master device and the second firmware version number of the slave device. If the first firmware version number is inconsistent with the first cloud version number and the second firmware version number is inconsistent with the second cloud version number, it is considered that the Bluetooth device needs to be upgraded. In response to the firmware upgrade command, it disconnects the Bluetooth connection with the master device and establishes a Bluetooth connection with the slave device, and sends a first upgrade data packet to the slave device so that the slave device can upgrade using the first upgrade data packet. The slave device is configured to establish a Bluetooth connection with the smart terminal when it receives an establishment request sent by the smart terminal, receive a first upgrade data packet sent by the smart terminal, and perform an upgrade using the first upgrade data packet; The master device is configured to establish a Bluetooth connection with the smart terminal when it receives an establishment request sent by the smart terminal, receive a second upgrade data packet sent by the smart terminal, and perform an upgrade using the second upgrade data packet; Furthermore, when the smart terminal sends a first upgrade data packet to the slave device according to the first single-packet data length supported by the slave device, the smart terminal is also used to: Send a first firmware upgrade notification to the slave device; When the first confirmation upgrade message returned from the device is received, the length of the first single packet data is determined from the first confirmation upgrade message; The first upgrade data packet is split into multiple first upgrade sub-data packets according to the first single packet data length; wherein the size of the first upgrade sub-data packet is less than or equal to the first single packet data length; When a firmware upgrade request is received from the slave device, the plurality of first upgrade sub-data packets are sequentially sent to the slave device; The smart terminal is also used for: When a Bluetooth connection is detected with the slave device, query the second firmware version number of the slave device; When the second firmware version number is inconsistent with the second cloud version number, it is considered that the slave device needs to be upgraded with firmware. In response to the firmware upgrade command, the first upgrade data packet is sent to the slave device according to the first single packet data length supported by the slave device, so that the slave device can upgrade using the first upgrade data packet.

7. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. The machine-readable instructions are executed by the processor to perform the steps of the firmware upgrade method as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the firmware upgrade method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • A firmware upgrading method and device f based on a Bluetooth BLE device end

    CN109542485A

  • Remote online firmware upgrading method and system for embedded device in one-master multi-slave mode

    CN114866525A