Firmware upgrading method, gateway device, electronic device and readable storage medium
By using gateway devices in Bluetooth Mesh network for management and transmission of firmware upgrade packages, combined with OTA fission method, the problem of low efficiency in upgrade package transmission and device upgrade in Bluetooth Mesh network is solved, and an efficient firmware upgrade process is achieved.
Patent Information
- Application Number
- CN202510210539.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-25
- Publication Date
- 2025-06-13
AI Technical Summary
The existing firmware upgrade method of Bluetooth Mesh network has problems with the transmission efficiency of upgrade packages and the low efficiency of equipment upgrades, especially when there are many devices, the manual upgrade efficiency is low and the user experience is poor.
Obtain the firmware upgrade package through the gateway device and send an upgrade signal to at least two Bluetooth devices in the Bluetooth Mesh smart lighting system to achieve upgrade control of all Bluetooth devices. After receiving the upgrade package, the target Bluetooth device completes the firmware upgrade; if the upgrade package does not belong to the target device, switch to the service mode and transmit the upgrade package to other Bluetooth devices in the upgrade mode to realize the upgrade of the OTA fission method.
It improves the upgrade packet transmission efficiency and equipment upgrade efficiency of Bluetooth Mesh network, reduces the time and energy of manual upgrades, and improves the user experience.
Smart Images

Figure CN120151891A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of firmware upgrade, and particularly to a firmware upgrade method, a gateway device, an electronic device, and a readable storage medium. Background Art
[0002] Bluetooth Mesh technology has a networking function and can perform centralized control and management of a large number of Bluetooth Mesh devices. However, due to the small amount of data transmitted in a single Bluetooth Mesh network transmission, it takes a long time to use mesh to transmit the upgrade package to upgrade the device. During the upgrade process, it occupies network transmission, seriously affecting common operations such as normal device control and intelligent configuration, and the user experience is poor. Therefore, the feasibility of this solution is low. Other Bluetooth device upgrade solutions rely on manual point-to-point upgrades of individual Bluetooth devices. This method is feasible when the number of devices is small, but in a Bluetooth Mesh network, the number of devices is often large, dozens or even hundreds of devices. In this case, the efficiency of manual upgrade is greatly reduced. It also takes a lot of time to find the device to be upgraded, connect the device for upgrade. Compared with the Mesh transmission upgrade package method, this solution has a greater improvement in data transmission efficiency, but it is also unable to cope when faced with a large-scale Mesh network device. Summary of the Invention
[0003] The purpose of this application is to provide a firmware upgrade method, a gateway device, an electronic device, and a readable storage medium to solve the above technical problems existing in the prior art and improve the upgrade package transmission efficiency and device upgrade efficiency of the Bluetooth Mesh network.
[0004] The first aspect of this application provides a firmware upgrade method, which is applied to a Bluetooth Mesh intelligent lighting system. The Bluetooth Mesh intelligent lighting system includes a gateway device and at least two Bluetooth devices. The firmware upgrade method includes:
[0005] Obtain a firmware upgrade package, and send an upgrade signal to at least two Bluetooth devices through the gateway device to enable the two Bluetooth devices to switch to the upgrade mode;
[0006] Obtain a target Bluetooth device among at least two Bluetooth devices, control the target Bluetooth device to establish a signal connection with the gateway device, and obtain a firmware upgrade package through the gateway device;
[0007] In response to the firmware upgrade package belonging to the target Bluetooth device, control the target Bluetooth device to complete the firmware upgrade by using the firmware upgrade package;
[0008] In response to the firmware upgrade package not belonging to the target Bluetooth device, control the target Bluetooth device to switch from the upgrade mode to the service mode, where the target Bluetooth device sends the firmware upgrade package to other Bluetooth devices in the upgrade mode in the service mode, so that other Bluetooth devices complete the firmware upgrade in an OTA fission manner.
[0009] Further, the steps of obtaining a target Bluetooth device among at least two Bluetooth devices, controlling the target Bluetooth device to perform a signal connection with a gateway device, and obtaining a firmware upgrade package through the gateway device include:
[0010] Using the gateway device to perform a scanning operation on at least two Bluetooth devices to obtain the Bluetooth signal strengths of the at least two Bluetooth devices;
[0011] Obtaining a Bluetooth device with the strongest Bluetooth signal strength among the at least two Bluetooth devices, and taking the Bluetooth device as the target Bluetooth device;
[0012] Controlling the gateway device to perform a signal connection with the target Bluetooth device to transmit the firmware upgrade package to the target Bluetooth device through Bluetooth.
[0013] Further, the method further includes:
[0014] In response to determining that the target Bluetooth device and the gateway device have completed a signal connection, obtaining the authentication information of the target Bluetooth device;
[0015] Based on the authentication information, confirming that the Bluetooth device is an authorized device, and controlling the gateway device to transmit the firmware upgrade package to the target Bluetooth device;
[0016] Alternatively, based on the authentication information, confirming that the Bluetooth device is an unauthorized device, and controlling the gateway device to disconnect from the target Bluetooth device.
[0017] Further, the steps of, in response to the firmware upgrade package belonging to the target Bluetooth device, controlling the target Bluetooth device to complete firmware upgrade using the firmware upgrade package include:
[0018] In response to the target Bluetooth device receiving the firmware upgrade package, performing data parsing on the firmware upgrade package to obtain the header data of the firmware upgrade package;
[0019] Using the header data to determine the target module of the target Bluetooth device to complete the firmware upgrade of the target module.
[0020] Further, the steps of, in response to the firmware upgrade package not belonging to the target Bluetooth device, controlling the target Bluetooth device to switch from the upgrade mode to the service mode, where the target Bluetooth device sends the firmware upgrade package to other Bluetooth devices in the upgrade mode in the service mode so that the other Bluetooth devices complete firmware upgrade in an OTA fission manner include:
[0021] In response to the firmware upgrade package not belonging to the target Bluetooth device, controlling the target Bluetooth device to switch from the upgrade mode to the service mode, and using the target Bluetooth device to perform a scanning operation on other Bluetooth devices in the upgrade mode to obtain the Bluetooth signal strengths of the other Bluetooth devices;
[0022] Obtain a Bluetooth device with the strongest Bluetooth signal strength among other Bluetooth devices, and use the Bluetooth device as the second target Bluetooth device;
[0023] Control the target Bluetooth device to establish a signal connection with the second target Bluetooth device, so as to transmit the firmware upgrade package received by the target Bluetooth device to the second target Bluetooth device via Bluetooth, enabling the second target Bluetooth device to complete firmware upgrade using the firmware upgrade package.
[0024] Furthermore, the method further includes:
[0025] In response to the target Bluetooth device receiving the firmware upgrade package, perform integrity verification on the firmware upgrade package;
[0026] In response to determining that the firmware upgrade package is correct and complete, perform attribution judgment on the firmware upgrade package.
[0027] Furthermore, the method further includes:
[0028] In response to the target Bluetooth device completing firmware upgrade, control the gateway device to disconnect from the target Bluetooth device, and control the target Bluetooth device to switch from the upgrade mode to the service mode.
[0029] The second aspect of the present application provides a gateway device, which forms a Bluetooth Mesh intelligent lighting system with at least two Bluetooth devices, including:
[0030] An acquisition module, configured to acquire a firmware upgrade package;
[0031] A sending module, configured to send an upgrade signal to at least two Bluetooth devices, so that the two Bluetooth devices switch to the upgrade mode;
[0032] The acquisition module is further configured to acquire a target Bluetooth device among at least two Bluetooth devices, so as to establish a signal connection between the gateway device and the target Bluetooth device;
[0033] The sending module is further configured to send the firmware upgrade package to the target Bluetooth device; in response to the firmware upgrade package belonging to the target Bluetooth device, the target Bluetooth device completes firmware upgrade using the firmware upgrade package; in response to the firmware upgrade package not belonging to the target Bluetooth device, the target Bluetooth device switches from the upgrade mode to the service mode, where the target Bluetooth device sends the firmware upgrade package to other Bluetooth devices in the upgrade mode in the service mode, enabling other Bluetooth devices to complete firmware upgrade in an OTA fission manner.
[0034] The third aspect of the present application provides an electronic device, which includes a memory and a processor coupled to each other, and the processor is configured to execute program instructions stored in the memory to implement the firmware upgrade method as described above.
[0035] A fourth aspect of the present application provides a computer-readable storage medium storing a computer program, which when executed by a processor can implement the firmware upgrade method as described above.
[0036] Different from the prior art, the present application uses a gateway device to obtain a firmware upgrade package and sends an upgrade signal to at least two Bluetooth devices in the same Bluetooth Mesh intelligent lighting system while obtaining the firmware upgrade package, that is, sends an upgrade signal to at least two Bluetooth devices in the same Mesh network, so as to implement upgrade control for all Bluetooth devices in the same Mesh network. At the same time, the gateway device sends the firmware upgrade package to the target Bluetooth device connected to it by signal. When it is determined that the firmware upgrade package belongs to the target Bluetooth device, the gateway device controls the target Bluetooth device to complete the firmware upgrade, or when it is determined that the firmware upgrade package does not belong to the target Bluetooth device, the OTA fission of the Bluetooth device is used to complete the firmware upgrade of other Bluetooth devices. At the same time, the gateway device and the Bluetooth device that has received the firmware upgrade package are used to perform firmware upgrade on the Bluetooth device to be upgraded, which can improve the upgrade package transmission efficiency and device upgrade efficiency.
[0037] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and do not limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0039] Figure 1 is a schematic flowchart of an embodiment of the firmware upgrade method of the present application;
[0040] Figure 2 is Figure 1 a specific flowchart of step S12 in
[0041] Figure 3 is Figure 1 a specific flowchart of step S13 in
[0042] Figure 4 is Figure 1 a specific flowchart of step S14 in
[0043] Figure 5 is a schematic structural diagram of an embodiment of the gateway device of the present application;
[0044] Figure 6 is a schematic framework diagram of an embodiment of the electronic device of the present application
[0045] Figure 7 It is a schematic framework diagram of an embodiment of the computer-readable storage medium of the present application. Detailed implementation manners
[0046] To enable those skilled in the art to better understand the technical solutions of the present application, the firmware upgrade method, gateway device, electronic device, and readable storage medium provided by the present application will be further described in detail below in conjunction with the accompanying drawings and specific implementation manners. It can be understood that the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts shall fall within the protection scope of the present application.
[0047] The terms "first", "second", etc. in the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products, or devices.
[0048] Since the amount of data transmitted in a single time in the existing Bluetooth Mesh network is small, it takes a long time to upgrade the device by using mesh to transmit the upgrade package, and the network transmission is occupied during the upgrade process, seriously affecting common operations such as normal device control and intelligent configuration, resulting in poor user experience. At the same time, other Bluetooth device upgrade solutions rely on manual single-connection point-to-point upgrade of Bluetooth devices, which can only support a small number of device networks and cannot meet the upgrade requirements of large-scale Bluetooth Mesh network devices.
[0049] Therefore, the present application provides a firmware upgrade method to improve the transmission efficiency of the upgrade package and the device upgrade efficiency in the Bluetooth Mesh network. Please refer to Figure 1 , Figure 1 It is a schematic flowchart of an embodiment of the firmware upgrade method of the present application.
[0050] Among them, the execution subject of the firmware upgrade method of the present application can be a Bluetooth Mesh intelligent lighting system, and the Bluetooth Mesh intelligent lighting system includes a gateway device and at least two Bluetooth devices. The gateway device is used to control the upgrade management of the Bluetooth devices. In some possible implementation manners, the firmware upgrade method can also be implemented by a processor calling computer-readable instructions stored in a memory.
[0051] Optionally, the gateway device of the present application can be as Figure 5 shown, Figure 5It is a schematic structural diagram of an embodiment of the gateway device of the present application. The gateway device 50 in this embodiment includes an acquisition module 51 and a sending module 52, and the acquisition module 51 is signal-connected to the sending module 52.
[0052] Specifically, the acquisition module 51 is used to acquire a firmware upgrade package, and the firmware upgrade package is used to upgrade the Bluetooth devices in the Bluetooth Mesh intelligent lighting system.
[0053] The sending module 52 is used to send an upgrade signal to at least two Bluetooth devices, so that the two Bluetooth devices switch to the upgrade mode.
[0054] The acquisition module 51 is further used to acquire a target Bluetooth device among at least two Bluetooth devices, so as to realize a signal connection between the gateway device and the target Bluetooth device.
[0055] The sending module 52 is further used to send the firmware upgrade package to the target Bluetooth device; in response to the firmware upgrade package belonging to the target Bluetooth device, the target Bluetooth device uses the firmware upgrade package to complete the firmware upgrade; in response to the firmware upgrade package not belonging to the target Bluetooth device, the target Bluetooth device switches from the upgrade mode to the service mode, where the target Bluetooth device sends the firmware upgrade package to other Bluetooth devices in the upgrade mode in the service mode, so that other Bluetooth devices complete the firmware upgrade in the way of OTA (Over The Air) fission.
[0056] Specifically, the firmware upgrade method of the embodiment of the present disclosure may include the following steps:
[0057] Step S11: Acquire a firmware upgrade package, and send an upgrade signal to at least two Bluetooth devices through the gateway device, so that the two Bluetooth devices switch to the upgrade mode.
[0058] Wherein, when the Bluetooth device is in the upgrade mode, it turns on Bluetooth broadcasting, so that the gateway device or other Bluetooth devices can receive the broadcast packet sent by the Bluetooth device, and further enables it to be discovered by other devices in the same Bluetooth Mesh network. Further, the upgrade signal in this embodiment may specifically be an operation instruction sent by the gateway device.
[0059] Optionally, the firmware upgrade package in this embodiment may be the lighting system firmware upgrade package and firmware upgrade service obtained by the gateway device through the APP. After the firmware upgrade package is acquired, the gateway device is no longer associated with the lighting system service system.
[0060] Step S12: Acquire a target Bluetooth device among at least two Bluetooth devices, control the target Bluetooth device to establish a signal connection with the gateway device, and acquire the firmware upgrade package through the gateway device.
[0061] Among them, since there are at least two Bluetooth devices in the same Bluetooth Mesh network, the gateway device needs to perform multiple scans to obtain the device information of all Bluetooth devices, and then obtain the target Bluetooth device among at least two Bluetooth devices based on the device information.
[0062] After the gateway device determines the target Bluetooth device, it establishes a signal connection with the target Bluetooth device via Bluetooth, which facilitates the gateway device to send data to the target Bluetooth device, that is, it facilitates the gateway device to send a firmware upgrade package to the target Bluetooth device.
[0063] Optionally, the present application also provides another embodiment for implementing step S12 to determine the target Bluetooth device connected to the gateway device, and then send the firmware upgrade package received by the gateway device to the target Bluetooth device. Please continue to refer to Figure 2 , Figure 2 is Figure 1 the specific flowchart of step S12 in
[0064] Step S121: Use the gateway device to perform a scan operation on at least two Bluetooth devices to obtain the Bluetooth signal strength of at least two Bluetooth devices.
[0065] Among them, the scan operation in this embodiment is performed multiple times until the gateway device obtains the device information of all Bluetooth devices in the Bluetooth Mesh network, and the Bluetooth signal strength corresponding to each Bluetooth device can be determined based on the device information of each Bluetooth device.
[0066] Step S122: Obtain the Bluetooth device with the strongest Bluetooth signal strength among at least two Bluetooth devices, and use the Bluetooth device as the target Bluetooth device.
[0067] Among them, after determining the Bluetooth signal strength of all Bluetooth devices based on step S121, the Bluetooth device with the strongest Bluetooth signal strength is used as the target Bluetooth device. Optionally, the strongest Bluetooth signal strength can be determined by sorting all Bluetooth signal strengths; or, any two Bluetooth signal strengths are compared, and the one with stronger Bluetooth signal strength is compared with other Bluetooth signal strengths until the strongest Bluetooth signal strength is determined.
[0068] Step S123: Control the gateway device to establish a signal connection with the target Bluetooth device to transmit the firmware upgrade package to the target Bluetooth device via Bluetooth.
[0069] Among them, after determining the target Bluetooth device based on step S122, the gateway device establishes a signal connection with the target Bluetooth device via Bluetooth, and then transmits the firmware upgrade package to the target Bluetooth device via Bluetooth.
[0070] Optionally, after determining the target Bluetooth device, it is necessary to further perform an authorization judgment on the target Bluetooth device. The specific judgment steps are as shown in steps S21 - S23 below: Step S21: In response to determining that the target Bluetooth device has completed a signal connection with the gateway device, obtain the authentication information of the target Bluetooth device; Step S22: Based on the authentication information, confirm that the Bluetooth device is an authorized device, and control the gateway device to transmit the firmware upgrade package to the target Bluetooth device; Step S23: Alternatively, based on the authentication information, confirm that the Bluetooth device is an unauthorized device, and control the gateway device to disconnect from the target Bluetooth device.
[0071] Among them, step S22 or step S23 is executed based on the authorization judgment result. By performing an authorization judgment on the target Bluetooth device, it is possible to determine that the Bluetooth device to be upgraded is the target Bluetooth device in the Bluetooth Mesh network, realizing targeted upgrading.
[0072] Optionally, after the target Bluetooth device of this embodiment receives the firmware upgrade package, it is necessary to perform an integrity check on the firmware upgrade package, and after determining that the firmware upgrade package is correct and complete, make a further attribution judgment on the firmware upgrade package.
[0073] After the target Bluetooth device of this embodiment receives the firmware upgrade package, it is necessary to perform data analysis on the firmware upgrade package to determine whether it belongs to itself and to determine which functional module of itself is to be upgraded with the firmware. Specifically, when it is determined that the firmware upgrade package belongs to the target Bluetooth device, step S13 is executed; when it is determined that the firmware upgrade package does not belong to the target Bluetooth device, step S14 is executed.
[0074] Step S13: In response to the firmware upgrade package belonging to the target Bluetooth device, control the target Bluetooth device to complete the firmware upgrade using the firmware upgrade package.
[0075] Among them, when it is determined that the firmware upgrade package belongs to the target Bluetooth device, control the target Bluetooth device to perform firmware upgrade on the target functional module using the firmware upgrade package.
[0076] Optionally, the present application also provides another embodiment for implementing step S13 to control the target Bluetooth device to complete the firmware upgrade using the firmware upgrade package. Please continue to refer to Figure 3 , Figure 3 Yes Figure 1 is the specific process schematic diagram of step S13 in
[0077] Step S131: In response to the target Bluetooth device receiving the firmware upgrade package, perform data parsing on the firmware upgrade package to obtain the header data of the firmware upgrade package.
[0078] Among them, when the target Bluetooth device receives the firmware upgrade package, it is necessary to perform data analysis on the firmware upgrade package. Specifically, the target Bluetooth device parses the data of the firmware upgrade package to obtain the header data of the firmware upgrade package.
[0079] Step S132: Use the header data to determine the target module of the target Bluetooth device to complete the firmware upgrade of the target module.
[0080] Among them, the target Bluetooth device further analyzes the header data obtained in step S131. Specifically, it parses the header data according to the protocol specification, extracts specific upgrade instructions or data blocks, and then determines the target module of the target Bluetooth device to complete the firmware upgrade of the target module.
[0081] Step S14: In response to the firmware upgrade package not belonging to the target Bluetooth device, control the target Bluetooth device to switch from the upgrade mode to the service mode.
[0082] Among them, the target Bluetooth device in the service mode of this embodiment sends the firmware upgrade package to other Bluetooth devices in the upgrade mode, so that other Bluetooth devices can complete the firmware upgrade in the way of OTA fission.
[0083] Specifically, for the fission of Bluetooth devices, a gateway device needs to send a control command to enable the fission function. After receiving the fission instruction, the target Bluetooth device starts a broadcast packet containing OTA specific information. Among them, the OTA (Over The Air) fission broadcast packet broadcasts the unique identification code under this gateway device, such as netkey, etc. To ensure that all Bluetooth devices receive it, the target Bluetooth device can send it multiple times repeatedly.
[0084] When the target Bluetooth device receives OTA data, it must first process the OTA packet header information, and the packet header needs to be stored in the flash. After receiving all the OTA data, the target Bluetooth device itself restarts first. After restarting, it reads the fission flag in the flash. If the flag is true, it starts to fission. First, it sends the OTA packet header, and then sends the OTA data.
[0085] When the target Bluetooth device finishes receiving the OTA packet header, it judges the field value. If the value is true, it scans other Bluetooth devices in any broadcast network belonging to the gateway around it, that is, other Bluetooth devices in the Bluetooth Mesh network, establishes a connection with them, and sends the OTA data packet. After the Bluetooth device receiving the OTA data establishes a gatt connection, it stops the OTA broadcast packet. After receiving the firmware package, it starts to scan the surrounding OTA broadcasts as the master device. For example, when upgrading the firmware of device A currently, but the distance between A and the adjacent A is too far, device B between them can be used to upgrade. That is, A first sends the firmware to B, and after B receives the firmware of A and stores it, it forwards it to another A device.
[0086] During the OTA fission process, the Bluetooth devices that broadcast OTA data gradually decrease. After the fission is completed, the sub-devices of this gateway will all stop OTA broadcasting, that is, when all Bluetooth devices in the Bluetooth Mesh network have received the firmware upgrade package and completed the firmware upgrade, the OTA fission stops.
[0087] Optionally, the present application also provides another embodiment for implementing step S14 to enable the target Bluetooth device to control other Bluetooth devices to perform firmware upgrades. Please continue to refer to Figure 4 , Figure 4 is Figure 1 the specific process schematic diagram of step S14 in
[0088] Step S141: In response to the firmware upgrade package not belonging to the target Bluetooth device, control the target Bluetooth device to switch from the upgrade mode to the service mode, and use the target Bluetooth device to scan other Bluetooth devices in the upgrade mode to obtain the Bluetooth signal strength of other Bluetooth devices.
[0089] Among them, when it is determined that the firmware upgrade package does not belong to the target Bluetooth device, it means that the target Bluetooth device does not need to perform firmware upgrade. Therefore, control the target Bluetooth device to switch from the upgrade mode to the service mode, and the target Bluetooth device in the service mode will no longer request firmware upgrade.
[0090] At the same time, as a sub-gateway device, the target Bluetooth device scans other Bluetooth devices in the upgrade mode to obtain the Bluetooth signal strength of other Bluetooth devices. Among them, the specific operation steps are similar to those of step S121 and will not be elaborated here.
[0091] Step S142: Obtain the Bluetooth device with the strongest Bluetooth signal strength among other Bluetooth devices, and use the Bluetooth device as the second target Bluetooth device.
[0092] Among them, in this embodiment, the Bluetooth device with the strongest Bluetooth signal strength obtained in step S141 is used as the second target Bluetooth device. The specific operation steps are similar to those of step S122 and will not be elaborated here.
[0093] Step S143: Control the target Bluetooth device to establish a signal connection with the second target Bluetooth device, and transmit the firmware upgrade package received by the target Bluetooth device to the second target Bluetooth device through Bluetooth, so that the second target Bluetooth device can complete the firmware upgrade using the firmware upgrade package.
[0094] After determining the second target Bluetooth device based on step S142, the target Bluetooth device establishes a signal connection with the second target Bluetooth device via Bluetooth, and then transmits the firmware upgrade package received by the target Bluetooth device to the second target Bluetooth device via Bluetooth, so that the second target Bluetooth device completes the firmware upgrade by using the firmware upgrade package. Among them, the specific steps for the second target Bluetooth device to complete the firmware upgrade using the firmware upgrade package are similar to those in step S13, and will not be elaborated here.
[0095] Optionally, in another embodiment, after executing step S13, that is, when the target Bluetooth device completes the firmware upgrade, the control gateway device disconnects from the target Bluetooth device, and controls the target Bluetooth device to switch from the upgrade mode to the service mode. Therefore, the target Bluetooth device that has completed the firmware upgrade operation can be used as a new sub-gateway device to perform firmware upgrades on other Bluetooth devices in the Bluetooth Mesh network.
[0096] In addition to using the gateway device to perform firmware upgrades on the target Bluetooth device, this application can also use the OTA fission method to perform firmware upgrades on the target Bluetooth device through any Bluetooth device until the firmware upgrades of all Bluetooth devices in the Bluetooth Mesh network are completed, effectively improving the transmission efficiency of the firmware upgrade package and the upgrade efficiency of Bluetooth devices.
[0097] This application also provides an electronic device. Please refer to Figure 6 , Figure 6 which is a framework schematic diagram of an embodiment of the electronic device of this application. The electronic device 60 includes a memory 61 and a processor 62 that are coupled to each other. The processor 62 is configured to execute program instructions stored in the memory 61 to implement the steps in any of the above firmware upgrade method embodiments. In a specific implementation scenario, the electronic device 60 may include, but is not limited to: a microcomputer, a server. In addition, the electronic device 60 may also include mobile devices such as a laptop computer, a tablet computer, etc., which are not limited here.
[0098] Specifically, the processor 62 is used to control itself and the memory 61 to implement the steps in any of the above firmware upgrade method embodiments. The processor 62 may also be referred to as a CPU (Central Processing Unit). The processor 62 may be an integrated circuit chip with signal processing capabilities. The processor 62 may also be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. Additionally, the processor 62 may be implemented jointly by integrated circuit chips.
[0099] The present application also provides a computer-readable storage medium. Please refer to Figure 7 , Figure 7 which is a schematic framework diagram of an embodiment of the computer-readable storage medium of the present application. The computer-readable storage medium 80 stores a computer program 71 that can be run by a processor. The computer program 71 is used to implement the steps in any of the above firmware upgrade method embodiments.
[0100] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the methods described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments. For the sake of brevity, it will not be repeated here.
[0101] The descriptions of the above embodiments tend to emphasize the differences between the embodiments. Their similarities or likenesses can be referred to each other. For the sake of brevity, they will not be repeated in this article.
[0102] In several embodiments provided by the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical, or other forms.
[0103] In addition, in each embodiment of the present application, each functional unit can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0104] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods in various embodiments of the present application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.
[0105] The above are only the embodiments of the present application, and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present application.
Claims
1. A firmware upgrade method, applied to a Bluetooth Mesh intelligent lighting system, wherein the Bluetooth Mesh intelligent lighting system includes a gateway device and at least two Bluetooth devices, characterized in that: include: Obtain a firmware upgrade package, and send an upgrade signal to the at least two Bluetooth devices through the gateway device, so that the two Bluetooth devices switch to an upgrade mode; Acquire a target Bluetooth device among the at least two Bluetooth devices, control the target Bluetooth device to establish a signal connection with the gateway device, and acquire the firmware upgrade package through the gateway device; In response to the firmware upgrade package belonging to the target Bluetooth device, controlling the target Bluetooth device to complete the firmware upgrade using the firmware upgrade package; In response to the firmware upgrade package not belonging to the target Bluetooth device, the target Bluetooth device is controlled to switch from upgrade mode to service mode, wherein the target Bluetooth device sends the firmware upgrade package to other Bluetooth devices in upgrade mode in service mode, so that the other Bluetooth devices complete the firmware upgrade in an OTA fission manner.
2. The firmware upgrade method according to claim 1, characterized in that: The step of obtaining a target Bluetooth device from the at least two Bluetooth devices, controlling the target Bluetooth device to establish a signal connection with the gateway device, and obtaining the firmware upgrade package through the gateway device includes: Using the gateway device to perform a scanning operation on the at least two Bluetooth devices to obtain Bluetooth signal strengths of the at least two Bluetooth devices; Obtain a Bluetooth device with the strongest Bluetooth signal strength among the at least two Bluetooth devices, and use the Bluetooth device as the target Bluetooth device; The gateway device is controlled to establish a signal connection with the target Bluetooth device so as to transmit the firmware upgrade package to the target Bluetooth device via Bluetooth.
3. The firmware upgrade method according to claim 2, characterized in that: The method further comprises: In response to determining that the target Bluetooth device completes signal connection with the gateway device, acquiring authentication information of the target Bluetooth device; Confirming that the Bluetooth device is an authorized device based on the authentication information, and controlling the gateway device to transmit the firmware upgrade package to the target Bluetooth device; Alternatively, based on the authentication information, it is confirmed that the Bluetooth device is an unauthorized device, and the gateway device is controlled to disconnect from the target Bluetooth device.
4. The firmware upgrade method according to claim 1, characterized in that: In response to the firmware upgrade package belonging to the target Bluetooth device, the step of controlling the target Bluetooth device to complete the firmware upgrade using the firmware upgrade package includes: In response to the target Bluetooth device receiving the firmware upgrade package, parsing the firmware upgrade package to obtain header data of the firmware upgrade package; The target module of the target Bluetooth device is determined by using the header data to complete the firmware upgrade of the target module.
5. The firmware upgrade method according to claim 1, characterized in that: In response to the firmware upgrade package not belonging to the target Bluetooth device, controlling the target Bluetooth device to switch from an upgrade mode to a service mode, wherein the target Bluetooth device sends the firmware upgrade package to other Bluetooth devices in the upgrade mode in the service mode, so that the other Bluetooth devices complete the firmware upgrade in an OTA fission manner, including: In response to the firmware upgrade package not belonging to the target Bluetooth device, controlling the target Bluetooth device to switch from an upgrade mode to a service mode, and using the target Bluetooth device to perform a scanning operation on other Bluetooth devices in the upgrade mode to obtain Bluetooth signal strengths of other Bluetooth devices; Obtain a Bluetooth device with the strongest Bluetooth signal strength among the other Bluetooth devices, and use the Bluetooth device as the second target Bluetooth device; The target Bluetooth device is controlled to establish a signal connection with the second target Bluetooth device, so as to transmit the firmware upgrade package received by the target Bluetooth device to the second target Bluetooth device via Bluetooth, so that the second target Bluetooth device completes the firmware upgrade using the firmware upgrade package.
6. The firmware upgrade method according to claim 4 or 5, characterized in that: The method further comprises: In response to the target Bluetooth device receiving the firmware upgrade package, performing integrity check on the firmware upgrade package; In response to determining that the firmware upgrade package is correct and complete, an attribution determination is performed on the firmware upgrade package.
7. The firmware upgrade method according to claim 1, characterized in that: The method further comprises: In response to the target Bluetooth device completing the firmware upgrade, the gateway device is controlled to disconnect from the target Bluetooth device, and the target Bluetooth device is controlled to switch from the upgrade mode to the service mode.
8. A gateway device, which forms a Bluetooth Mesh intelligent lighting system with at least two Bluetooth devices, characterized in that: include: An acquisition module is used to obtain a firmware upgrade package; A sending module, used for sending an upgrade signal to the at least two Bluetooth devices, so that the two Bluetooth devices switch to an upgrade mode; The acquisition module is further used to acquire a target Bluetooth device among the at least two Bluetooth devices, so as to realize a signal connection between the gateway device and the target Bluetooth device; The sending module is also used to send the firmware upgrade package to the target Bluetooth device; in response to the firmware upgrade package belonging to the target Bluetooth device, the target Bluetooth device uses the firmware upgrade package to complete the firmware upgrade; in response to the firmware upgrade package not belonging to the target Bluetooth device, the target Bluetooth device switches from the upgrade mode to the service mode, wherein the target Bluetooth device sends the firmware upgrade package to other Bluetooth devices in the upgrade mode in the service mode, so that the other Bluetooth devices complete the firmware upgrade in an OTA fission manner.
9. An electronic device, characterized in that: It comprises a memory and a processor coupled to each other, wherein the processor is used to execute program instructions stored in the memory to implement the firmware upgrade method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program can implement the firmware upgrade method according to any one of claims 1 to 7 when executed by a processor.