Bluetooth system and updating method of Bluetooth system

By using the Bluetooth communication interface to switch between peripheral mode and central mode in the Bluetooth system, scanning and transmitting firmware updates, the problems of low update efficiency and protocol complexity of existing Bluetooth systems are solved, and efficient Bluetooth device updates are achieved, saving Resources and hardware capacity.

CN118900404APending Publication Date: 2024-11-05NUVOTON
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311718110.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-05-05
Filing Date
2023-12-13
Publication Date
2024-11-05

AI Technical Summary

Technical Problem

When updating a large number of Bluetooth devices, existing Bluetooth systems require manual operation and use complex protocol control, resulting in high time and cost, high hardware requirements, and lack of efficient update methods.

Method used

The first Bluetooth device and the second Bluetooth device are used to switch between peripheral mode and central mode through the Bluetooth communication interface, scan and transmit firmware updates, and use the flag control mode switching and update process to realize the method of updating all Bluetooth devices at once.

Benefits of technology

It realizes efficient updates of all devices in the Bluetooth system, saves product development resources, reduces the need for complex protocol control, and is suitable for the update of a large number of Bluetooth devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118900404A_ABST
    Figure CN118900404A_ABST
Patent Text Reader

Abstract

The invention discloses a Bluetooth system and an updating method of the Bluetooth system. The Bluetooth system comprises a first Bluetooth device and at least one second Bluetooth device. The first Bluetooth device and the second Bluetooth device comprise memories and processors. The memory stores a first version of firmware. The first Bluetooth device operating in the peripheral mode receives a second version of the firmware from the electronic device, and the first Bluetooth device is switched to the central mode. The first Bluetooth device operating in the central mode scans the second Bluetooth devices operating in the peripheral mode, determines the second Bluetooth devices without the second version of the firmware, and transmits the second version of the firmware to one of the determined second Bluetooth devices in a one-to-one manner. When the first Bluetooth device operating in the central mode determines that the second Bluetooth device operating in the peripheral mode has a second version of firmware, the first Bluetooth device switches to the peripheral mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a Bluetooth system, and in particular to a firmware updating method of the Bluetooth system. Background Art

[0002] When a Bluetooth device in a Bluetooth system needs to be updated, over-the-air programming (OTA) can be used to transmit new software / firmware from a mobile phone or computer to the Bluetooth device to be updated. However, this method can only update one Bluetooth device at a time, and each Bluetooth device needs to be updated manually. Therefore, when there are a large number of Bluetooth devices in the Bluetooth system, this method takes a lot of time to operate. Another update method is to use Bluetooth mesh for update. However, the flood network transmission method in the Bluetooth mesh network requires complex protocol control, which requires a lot of time and cost to develop and implement. In addition, because the Bluetooth mesh network uses a more complex protocol for control, the Bluetooth mesh network architecture also has higher hardware requirements, such as the Bluetooth mesh network requires a larger capacity memory.

[0003] Therefore, a new updating method is needed, which can efficiently update all Bluetooth devices in the Bluetooth system without requiring complex protocols for control. Summary of the invention

[0004] In order to solve the above problems, an embodiment of the present invention proposes a Bluetooth system, including a first Bluetooth device and at least one second Bluetooth device. The first Bluetooth device and the second Bluetooth device include a memory and a processor. The memory is used to store a first version of firmware. The processor is used to control the first Bluetooth device and the second Bluetooth device to operate in a peripheral mode or a central mode. The first Bluetooth device operating in the peripheral mode receives a second version of firmware from an electronic device outside the Bluetooth system through a Bluetooth communication interface, and the processor of the first Bluetooth device controls the first Bluetooth device to switch to the central mode. The processor of the first Bluetooth device operating in the central mode scans the second Bluetooth device operating in the peripheral mode through the Bluetooth communication interface, determines the second Bluetooth device that does not have the second version of firmware, and transmits the second version of firmware to one of the determined second Bluetooth devices through the Bluetooth communication interface one at a time. When the first Bluetooth device operating in the central mode determines that the second Bluetooth device operating in the peripheral mode has the second version of firmware, the processor of the first Bluetooth device controls the first Bluetooth device to switch to the peripheral mode.

[0005] In some embodiments, when the first Bluetooth device and the second Bluetooth device operate in the peripheral mode, the processor controls the Bluetooth communication interface to broadcast information. When the first Bluetooth device and the second Bluetooth device operate in the central mode, the processor controls the Bluetooth communication interface not to broadcast information.

[0006] In some embodiments, the operation of scanning the second Bluetooth device operating in the peripheral mode in the Bluetooth system through the Bluetooth communication interface further includes: the processor receiving information from the second Bluetooth device through the Bluetooth communication interface.

[0007] In some embodiments, the information includes version information of the firmware, and the processor of the first Bluetooth device determines, based on the version information, that the second Bluetooth device does not have the second version of the firmware.

[0008] In some embodiments, when the processor of the first Bluetooth device operating in the central mode does not scan a second Bluetooth device without the second version of firmware for more than a predetermined time, it is determined that the second Bluetooth device operating in the peripheral mode has the second version of firmware.

[0009] In some embodiments, the processor of the first Bluetooth device operating in the central mode further records the number of times the second version of the firmware is transmitted, and when the number exceeds a predetermined number, it is determined that the second Bluetooth device operating in the peripheral mode has the second version of the firmware.

[0010] In some embodiments, the Bluetooth system further includes a third Bluetooth device, and the third Bluetooth device has the same configuration as the first Bluetooth device and the second Bluetooth device. After the second Bluetooth device receives the second version of the firmware from the first Bluetooth device, it stores the second version of the firmware in the memory, and uses the second version of the firmware to update the firmware, and the processor of the second Bluetooth device controls the second Bluetooth device to switch to the central mode. The processor of the second Bluetooth device operating in the central mode scans the third Bluetooth device operating in the peripheral mode through the Bluetooth communication interface, determines that the third Bluetooth device does not have the second version of the firmware, and transmits the second version of the firmware to the third Bluetooth device through the Bluetooth communication interface. When the second Bluetooth device operating in the central mode determines that the third Bluetooth device operating in the peripheral mode has the second version of the firmware, the processor of the second Bluetooth device controls the second Bluetooth device to switch to the peripheral mode.

[0011] In some embodiments, the memory includes a first memory area and a second memory area, and the first version of the firmware is stored in the first memory area. After the first Bluetooth device receives the second version of the firmware, the processor of the first Bluetooth device determines that the second version of the firmware passes the verification, and the processor stores the second version of the firmware in the second memory area and restarts the first Bluetooth device. After the processor restarts, the second version of the firmware in the second memory area overwrites the first version of the firmware in the first memory area.

[0012] In some embodiments, the processor determines to control the first Bluetooth device and the second Bluetooth device to operate in peripheral mode or central mode and determines whether to perform firmware update according to the flag in the memory; wherein the flag will not be reset after the first Bluetooth device and the second Bluetooth device are restarted.

[0013] In some embodiments, when the flag is a first value, the processor controls the first Bluetooth device to operate in peripheral mode. After the second version of the firmware is stored in the memory, the processor sets the flag to the second value and restarts the first Bluetooth device. After the first Bluetooth device is restarted and the flag is the second value, the processor performs a firmware update, sets the flag to a third value, and restarts the first Bluetooth device. After the first Bluetooth device is restarted and the flag is the third value, the processor controls the first Bluetooth device to operate in central mode. When it is determined that the second Bluetooth device operating in peripheral mode has the second version of the firmware, the processor of the first Bluetooth device sets the flag to the first value and then restarts the first Bluetooth device.

[0014] In some embodiments, the first Bluetooth device and the second Bluetooth device use the low-power Bluetooth standard to perform low-power Bluetooth communication. The electronic device is a mobile phone or a computer capable of Bluetooth communication.

[0015] The embodiment of the present invention proposes an update method for a Bluetooth system, wherein the Bluetooth system includes a first Bluetooth device and a second Bluetooth device. The method includes: storing a first version of firmware in the memory of the first Bluetooth device and the second Bluetooth device; using the processors of the first Bluetooth device and the second Bluetooth device to control the first Bluetooth device and the second Bluetooth device to operate in peripheral mode; receiving a second version of firmware from an electronic device outside the Bluetooth system through a Bluetooth communication interface of the first Bluetooth device, and controlling the first Bluetooth device to switch to a central mode; when the first Bluetooth device operates in the central mode, using the processor to scan a second Bluetooth device operating in the peripheral mode of the Bluetooth system through the Bluetooth communication interface; when determining that the second Bluetooth device in the Bluetooth system does not have the second version of firmware, transmitting the second version of firmware to one of the determined second Bluetooth devices through the Bluetooth communication interface one at a time; and when determining that the second Bluetooth device operating in the peripheral mode of the Bluetooth system has the second version of the firmware, controlling the first Bluetooth device to switch to the peripheral mode.

[0016] In some embodiments, when the processor of the first Bluetooth device operating in the central mode does not scan the second Bluetooth device without the second version of firmware in the Bluetooth system for more than a predetermined time, it is determined that the second Bluetooth device operating in the peripheral mode of the Bluetooth system has the second version of firmware.

[0017] In some embodiments, the above further includes using a processor of the first Bluetooth device operating in the central mode to record the number of times the second version of the firmware is transmitted, and when the number exceeds a predetermined number, determining that the second Bluetooth device operating in the peripheral mode of the Bluetooth system has the second version of the firmware.

[0018] In some embodiments, the Bluetooth system further includes a third Bluetooth device. The third Bluetooth device has the same configuration as the first Bluetooth device and the second Bluetooth device. The above method further includes, after the second Bluetooth device receives the second version of the firmware from the first Bluetooth device, the processor of the second Bluetooth device stores the second version of the firmware in the memory, and uses the second version of the firmware to update the firmware, and then uses the processor to control the second Bluetooth device to switch to the central mode. Use the processor of the second Bluetooth device operating in the central mode to scan the third Bluetooth device operating in the peripheral mode through the Bluetooth communication interface, determine that the third Bluetooth device does not have the second version of the firmware, and transmit the second version of the firmware to the third Bluetooth device through the Bluetooth communication interface. When the second Bluetooth device operating in the central mode determines that the third Bluetooth device operating in the peripheral mode has the second version of the firmware, use the processor of the second Bluetooth device to control the second Bluetooth device to switch to the peripheral mode.

[0019] In some embodiments, the memory includes a first memory area and a second memory area, and the first version of the firmware is stored in the first memory area. The above method further includes: after the first Bluetooth device receives the second version of the firmware, using the processor of the first Bluetooth device to determine whether the second version of the firmware has passed the verification, then using the processor to store the second version of the firmware to the second memory area, and restarting the first Bluetooth device. After the processor restarts, the second version of the firmware in the second memory area overwrites the first version of the firmware in the first memory area. The Bluetooth device update method of the embodiment of the present invention does not require complex protocols or control methods, and can save resources for product development. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1A FIG. 4 is a schematic diagram of a Bluetooth system according to an embodiment of the present invention.

[0021] Figure 1B FIG. 4 is a block diagram of a Bluetooth device according to an embodiment of the present invention.

[0022] Figure 1C FIG. 4 is a schematic diagram of a Bluetooth system according to an embodiment of the present invention.

[0023] Figure 2 FIG. 4 is a schematic diagram of a memory according to an embodiment of the present invention.

[0024] Figure 3 The figure is a flow chart of a method according to an embodiment of the present invention.

[0025] Figure 4 The figure is a flow chart of a method according to an embodiment of the present invention.

[0026] Figure 5 The figure is a flow chart of a method according to an embodiment of the present invention.

[0027] Figure Number:

[0028] 100: Bluetooth system

[0029] 110: Bluetooth device

[0030] 110A: The first Bluetooth device

[0031] 110B: Second Bluetooth device

[0032] 111,111A,111B,210: Processor

[0033] 112,112A,112B,220: Memory

[0034] 113,113A,113B,230: Bluetooth communication interface

[0035] 200: Electronic devices

[0036] 300,400,500: Method

[0037] 301,302,303,304,401,402,403,501,502,503,504,505: Operation

[0038] 1121: First memory area

[0039] 1122: Second memory area

[0040] 1123: Third memory area

[0041] FL: Flag DETAILED DESCRIPTION

[0042] In order to make the purpose, features and advantages of the present invention more clearly understood, specific embodiments of the present invention are given below and described in detail with reference to the accompanying drawings.

[0043] refer to Figure 1A , Figure 1A 1 is a schematic diagram of a Bluetooth system 100 according to an embodiment of the present invention. The Bluetooth system 100 includes a plurality of Bluetooth devices 110, for example, Figure 1C. In some embodiments, the Bluetooth system 100 may include 10, 50, hundreds, or thousands of Bluetooth devices 110. Each Bluetooth device 110 has the same configuration and function. In the Bluetooth system 100, there is at least one other Bluetooth device 110 within the transmission range of each Bluetooth device 110, that is, there is no Bluetooth device 110 that cannot connect to any other Bluetooth device 110. Each Bluetooth device 110 can also establish a connection with an electronic device 200 outside the Bluetooth system 100. In some embodiments, only a portion of the Bluetooth devices 110 establish a connection with the electronic device 200.

[0044] refer to Figure 1B , Figure 1B 1 is a block diagram of a Bluetooth device 110 according to an embodiment of the present invention. The Bluetooth device 110 includes a processor 111, a memory 112, and a Bluetooth communication interface 113. The processor 111, the memory 112, and the Bluetooth communication interface 113 may be connected using a bus (not shown). The Bluetooth device 110 may be, for example, a Bluetooth beacon.

[0045] The processor 111 controls the operation of the Bluetooth device 110. The processor 111 can control the Bluetooth device 110 to operate in a peripheral mode or a central mode. The processor 111 provides the processing power required to execute the operating system, programming, software, modules, application programming and functions of the Bluetooth device 110. In some embodiments, the Bluetooth device 110 may also include multiple processors 111 to jointly perform the required operations. For example, the processor 111 may include a general-purpose microprocessor, a central processing unit, a combination of a general-purpose microprocessor and a special-purpose processor, and / or a related chipset.

[0046] The memory 112 stores data required by the processor 111 when operating and other data required by the Bluetooth device 110. The memory 112 may include a non-volatile memory, such as a read-only memory (ROM), a flash memory, etc. In some embodiments, the non-volatile memory (such as a flash memory) in the memory 112 stores firmware required for the operation of the Bluetooth device 110, which can be executed by the processor 111. The memory 112 may also include a volatile memory, such as a dynamic random access memory and a static random access memory.

[0047] The Bluetooth communication interface 113 enables the processor 111 to establish a wireless connection with other Bluetooth devices 110 or electronic devices 200 supporting the BLE communication protocol via the Bluetooth Low Energy (BLE) communication protocol to transmit / receive data.

[0048] refer to Figure 1C , Figure 1C FIG. 1 is a schematic diagram of a Bluetooth system 100 according to an embodiment of the present invention. Figure 1C In the embodiment, the Bluetooth system 100 includes a first Bluetooth device 110A and a second Bluetooth device 110B. However, it should be understood that the Bluetooth system 100 may include other Bluetooth devices 110. The first Bluetooth device 110A includes a processor 111A, a memory 112A, and a Bluetooth communication interface 113A, and the second Bluetooth device 110B includes a processor 111B, a memory 112B, and a Bluetooth communication interface 113B. As described above, all Bluetooth devices 110 have the same configuration and function, so the processor 111A, the processor 111B, and the processor 111 have the same function, and the other components of the first Bluetooth device 110A and the second Bluetooth device 110B are the same.

[0049] The electronic device 200 may include a processor 210, a memory 220, and a Bluetooth communication interface 230. In some embodiments, the processor 210 is similar to the processor 111, the memory 220 is similar to the memory 112, and the Bluetooth communication interface 230 is similar to the Bluetooth communication interface 113. The electronic device 200 is, for example, a mobile phone or a computer capable of Bluetooth communication.

[0050] Therefore, the electronic device 200 , the first Bluetooth device 110A, and the second Bluetooth device 110B can respectively establish wireless connections via the Bluetooth communication interface 230 , the Bluetooth communication interface 113A, and the Bluetooth communication interface 113B to transmit or receive data.

[0051] refer to Figure 2 , Figure 2 1 is a schematic diagram of a memory 112 (e.g., a flash memory) according to an embodiment of the present invention. The memory 112 may include a first memory area 1121, a second memory area 1122, and a third memory area 1123. These memory areas may be memory addresses of different segments in the same memory, or different physically separated memories.

[0052] In some embodiments, the first memory area 1121 is used to store the firmware currently used by the Bluetooth device 110 (e.g., the first version of the firmware), and the second memory area 1122 is used to store another version of the firmware of the Bluetooth device 110 (e.g., the second version of the firmware). In some embodiments, the second memory area 1122 stores an updated version of the firmware. In some embodiments, the first memory area 1121 further stores information required for the Bluetooth device 110 to perform a handshake when establishing a wireless connection, and information about devices that have established a connection. In some embodiments, the data stored in the third memory area 1123 will not be reset after the Bluetooth device 110 is restarted, that is, the data stored in the third memory area 1123 will be the same before and after the Bluetooth device 110 is restarted. In some embodiments, the third memory area 1123 stores a flag FL. In addition, the memory 112 may further include other memory areas, such as an area for storing a boot loader.

[0053] The following references Figure 3 to Figure 5 The method 300, method 400, and method 500 of the embodiment of the present invention are described. The method 300, method 400, and method 500 can be executed by the processor 111 in the Bluetooth device 110. In addition, the method 300, method 400, and method 500 are described below by taking the first Bluetooth device 110A and the second Bluetooth device 110B as examples. However, it should be understood that these methods can be executed by any Bluetooth device 110 in the Bluetooth system 100.

[0054] refer to Figure 3 , Figure 3 3 is a flow chart of a method 300 according to an embodiment of the present invention. In operation 301, the processor 111A of the first Bluetooth device 110A determines whether the value of the flag FL stored in the third memory area 1123 of the memory 112A is 0. In some embodiments, operation 301 occurs after the first Bluetooth device 110A is restarted. As described above, the flag FL is stored in the third memory area 1123 of the memory 112A, so the flag FL will not be reset after the first Bluetooth device 110A is restarted. The flag FL is, for example, data in a specific memory location.

[0055] If the value of the flag FL is 0, the method 300 enters operation 302. In operation 302, the processor 111A controls the first Bluetooth device 110A to operate in the surrounding mode and prepare to receive the firmware. In some embodiments, in the case of not receiving the firmware, the first Bluetooth device 110A continues to operate in the surrounding mode and waits to receive the firmware. When operating in the surrounding mode, the Bluetooth device 110 will send broadcast information via the Bluetooth communication interface 113. These broadcast information can be received by a customer mobile phone that supports Bluetooth, or other Bluetooth devices 110. The broadcast information is, for example, advertising information or discount information to be sent to the customer mobile phone. In some embodiments, the Bluetooth device 110 adds information about the currently used firmware to the broadcast information. For example, the processor 111 of the Bluetooth device 110 can add the version number of the firmware stored in the first memory area 1121 to the packet of the broadcast information. In some embodiments, the Bluetooth device 110 adds an identification code representing itself to the broadcast information so that the device receiving the broadcast information can know which Bluetooth device 110 the broadcast information comes from. Therefore, other Bluetooth devices 110 that receive the broadcast information can know the firmware version used by the Bluetooth device 110 that sends the broadcast information, and which Bluetooth device 110 the broadcast information comes from.

[0056] The following description is made by taking the first Bluetooth device 110A receiving firmware as an example. The processor 111A receives firmware from the electronic device 200 via the Bluetooth communication interface 113A. The firmware is different from the firmware currently used by the first Bluetooth device 110A (e.g., the firmware stored in the first memory area 1121). In some embodiments, the firmware received by the processor 111A is an updated version (second version) of the firmware currently used by the first Bluetooth device 110A (first version). In some embodiments, the processor 111A stores the received firmware in the second memory area 1122 of the memory 112A.

[0057] In operation 303, the processor 111A determines whether the received firmware is verified. In other words, the processor 111A determines whether the received firmware is valid. The processor 111A can use a known method to determine whether the received firmware is valid. In some embodiments, the processor 111A determines whether the received firmware is valid using a cyclic redundancy check (CRC). In some embodiments, the processor 111A determines whether the received firmware is valid using a key and a signature.

[0058] If the processor 111A determines that the received firmware is invalid, the method 300 returns to operation 302. If the processor 111A determines that the received firmware is valid, the method 300 proceeds to operation 304. In operation 304, the processor 111A sets the value of the flag FL to 1 and causes the first Bluetooth device 110A to reboot.

[0059] refer to Figure 4 , Figure 4 4 is a flow chart of a method 400 according to an embodiment of the present invention. In operation 401, the processor 111A of the first Bluetooth device 110A determines whether the value of the flag FL stored in the third memory area 1123 of the memory 112A is 1. In some embodiments, operation 401 occurs after the first Bluetooth device 110A is restarted. When the value of the flag FL is 1, it means that the first Bluetooth device 110A has received new firmware, and the method 400 enters operation 402.

[0060] In operation 402, the processor 111A performs a firmware update. In some embodiments, the processor 111A overwrites the firmware (currently used firmware) stored in the first memory area 1121 of the memory 112A with the firmware (received firmware, such as a new version firmware) stored in the second memory area 1122 of the memory 112A. Afterwards, the processor 111A controls the first Bluetooth device 110A with the updated firmware. In operation 403, the processor 111A sets the value of the flag FL to 2 and causes the first Bluetooth device 110A to restart.

[0061] refer to Figure 5 , Figure 5 5 is a flow chart of a method 500 according to an embodiment of the present invention. In operation 501, the processor 111A determines whether the value of the flag FL stored in the third memory area 1123 of the memory 112A is 2. In some embodiments, operation 501 occurs after the first Bluetooth device 110A is restarted. When the value of the flag FL is 2, it means that the first Bluetooth device 110A is currently operating with a new firmware, and the method 500 enters operation 502.

[0062] In operation 502, the processor 111A controls the first Bluetooth device 110A to operate in the central mode. When the first Bluetooth device 110A operates in the central mode, the first Bluetooth device 110A stops sending broadcast information. In contrast, in operation 502, the first Bluetooth device 110A operating in the central mode scans other Bluetooth devices 110 (e.g., the second Bluetooth device 110B). In some embodiments, the first Bluetooth device 110A receives broadcast information sent by other Bluetooth devices 110 operating in the peripheral mode to scan other Bluetooth devices 110.

[0063] In operation 503, the processor 111A determines whether there is a Bluetooth device 110 using old firmware among the scanned Bluetooth devices 110. In some embodiments, the processor 111A determines whether the Bluetooth device 110 (e.g., the second Bluetooth device 110B) from which the broadcast information is derived uses old firmware by comparing the firmware version number in the received broadcast information with the firmware version number in the first memory area 1121 of the memory 112A. For example, when the firmware version number in the broadcast information is less than the firmware version number in the first memory area 1121, it is determined that the Bluetooth device 110 from which the broadcast information is derived uses old firmware. In some embodiments, when the processor 111A does not receive broadcast information containing an old firmware version number for more than a predetermined period of time, the processor 111A determines that other Bluetooth devices 110 (e.g., the second Bluetooth device 110B) all have new firmware. That is, when the processor 111A does not scan a Bluetooth device 110 using the old firmware for more than a predetermined period of time, the processor 111A determines that the other Bluetooth devices 110 (e.g., the second Bluetooth device 110B) have the new firmware, because this means that the Bluetooth devices 110 within the transmission / reception range of the first Bluetooth device 110A may have the new firmware. For example, the predetermined time may be 1 to 2 seconds (s). In some embodiments, when the processor 111A does not receive the broadcast information, the processor 111A determines that the other Bluetooth devices 110 (e.g., the second Bluetooth device 110B) have the new firmware, because this means that the Bluetooth devices 110 within the transmission / reception range of the first Bluetooth device 110A may all operate in the central mode, that is, they all have the new firmware.

[0064] If the processor 111A determines in operation 503 that there is a Bluetooth device 110 among the scanned Bluetooth devices 110 that uses old firmware, the method 500 enters operation 504. In operation 504, the processor 111A updates the Bluetooth device 110 that uses the old firmware in a one-to-one manner. The processor 111A may determine that none of the multiple Bluetooth devices 110 has the new firmware. In this case, the processor 111A may randomly select a Bluetooth device 110 for updating. In some embodiments, the processor 111A selects the Bluetooth device 110 with the largest (or smallest) identification code among the Bluetooth devices with the old firmware for updating. The following is an explanation of the processor 111A selecting the second Bluetooth device 110B for updating. The processor 111A may use the Bluetooth communication interface 113A to establish a connection with the second Bluetooth device 110B separately, and then transmit the new firmware (the firmware in the first memory area 1121) to the second Bluetooth device 110B. After the firmware transmission is completed, the first Bluetooth device 110A continues to scan other Bluetooth devices 110 in operation 502.

[0065] If the processor 111A determines in operation 503 that none of the scanned Bluetooth devices 110 uses the old firmware, the method 500 proceeds to operation 505. In operation 505, the processor 111A sets the value of the flag FL to 0 and causes the first Bluetooth device 110A to restart. That is, after the restart, the processor 111A causes the first Bluetooth device 110A to switch back to the surrounding mode (operations 301, 302).

[0066] In some optional embodiments, the processor 111A may also record the number of firmware that has been transmitted, that is, how many Bluetooth devices 110 have been updated. In operation 503, the processor 111A may also determine whether there is a Bluetooth device 110 using old firmware based on the number of records. If the number exceeds a predetermined threshold, the processor 111A determines that other Bluetooth devices 110 (such as the second Bluetooth device 110B) have new firmware. The predetermined threshold is, for example, 5, 10, 50, 100, etc. This judgment method can enable the first Bluetooth device 110A to complete the update task earlier and switch back to the surrounding mode so as to carry out normal work as soon as possible, such as pushing advertisements.

[0067] It should be understood that the second Bluetooth device 110B will also execute method 300, method 400, and method 500. Therefore, after receiving the new firmware, the second Bluetooth device 110B will also switch to the central mode, and when it is determined that other Bluetooth devices 110 (such as the third Bluetooth device) do not have the new firmware, the second Bluetooth device 110B can update the Bluetooth device 110 (such as the third Bluetooth device) that does not have the new firmware. In this way, all Bluetooth devices 110 in the Bluetooth system 100 will eventually have the new firmware, and all will switch back to the peripheral mode to perform normal work.

[0068] Therefore, the embodiment of the present invention provides a resource-saving Bluetooth device update method. This method only needs to use the electronic device 200 to update one Bluetooth device 110 in the Bluetooth system 100 once, and the new firmware can be transmitted to all Bluetooth devices 110. At the same time, the Bluetooth device update method of the embodiment of the present invention does not require complex protocols or control methods, which can save resources for product development. Because the control method is simpler and does not require the storage of complex programming codes, the embodiment of the present invention can be implemented using a memory with a smaller capacity.

[0069] Although the above embodiment of the present invention is described by taking Bluetooth as an example, the present invention can also be applied to other communication interfaces, such as WiFi. In addition, the present invention can also be used to transmit specific information to all devices in the system.

[0070] In the above embodiments, a series of operations or events are used to describe or illustrate, but it should be understood that the order of operation or event description should not be used to make restrictions. For example, some operations can occur in different orders within a reasonable range, remove other operations or events described here, or different operations can occur simultaneously. In addition, one or more operations described here can be performed with one or more separated operations and / or stages.

[0071] Although the present invention is disclosed as above with preferred embodiments, it is not intended to limit the scope of the present invention. Any person skilled in the art may make some changes and modifications without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention shall be based on the scope defined by the claims.

Claims

1. A Bluetooth system, characterized in that: The invention comprises a first Bluetooth device and at least one second Bluetooth device, wherein the first Bluetooth device and the second Bluetooth device comprise: a memory for storing a first version of a firmware; and a processor, for controlling the first Bluetooth device and the second Bluetooth device to operate in a peripheral mode or a central mode; The first Bluetooth device operating in the peripheral mode receives a second version of the firmware from an electronic device outside the Bluetooth system via a Bluetooth communication interface, and the processor of the first Bluetooth device controls the first Bluetooth device to switch to the central mode. wherein the processor of the first Bluetooth device operating in the central mode scans the second Bluetooth devices operating in the peripheral mode through the Bluetooth communication interface, determines the second Bluetooth devices that do not have the second version of the firmware, and transmits the second version of the firmware to one of the determined second Bluetooth devices one at a time through the Bluetooth communication interface; When the first Bluetooth device operating in the central mode determines that the second Bluetooth device operating in the peripheral mode has the second version of the firmware, the processor of the first Bluetooth device controls the first Bluetooth device to switch to the peripheral mode.

2. The Bluetooth system according to claim 1, characterized in that: When the first Bluetooth device and the second Bluetooth device operate in the peripheral mode, the processor controls the Bluetooth communication interface to broadcast a message, and when the first Bluetooth device and the second Bluetooth device operate in the central mode, the processor controls the Bluetooth communication interface not to broadcast the message.

3. The Bluetooth system as claimed in claim 2, characterized in that: The information includes version information of the firmware, and the processor of the first Bluetooth device determines that the second Bluetooth device does not have the second version of the firmware according to the version information.

4. The Bluetooth system according to claim 1, wherein: The processor determines to control the first Bluetooth device and the second Bluetooth device to operate in the peripheral mode or the central mode according to a flag in the memory, and determines whether to perform a firmware update; The flag will not be reset after the first Bluetooth device and the second Bluetooth device are restarted.

5. The Bluetooth system as claimed in claim 4, characterized in that: When the flag is a first value, the processor controls the first Bluetooth device to operate in the peripheral mode; After the second version of the firmware is stored in the memory, the processor sets the flag to a second value and restarts the first Bluetooth device; When the first Bluetooth device is restarted and the flag is the second value, the processor performs a firmware update, sets the flag to a third value, and restarts the first Bluetooth device; When the first Bluetooth device is restarted and the flag is the third value, the processor controls the first Bluetooth device to operate in the center mode; When it is determined that the second Bluetooth device operating in the peripheral mode has the second version of the firmware, the processor of the first Bluetooth device sets the flag to the first value and then restarts the first Bluetooth device.

6. A method for updating a Bluetooth system, characterized in that: The Bluetooth system includes a first Bluetooth device and a second Bluetooth device. The method includes: Storing a first version of a firmware in a memory of the first Bluetooth device and the second Bluetooth device; Using a processor of the first Bluetooth device and the second Bluetooth device to control the first Bluetooth device and the second Bluetooth device to operate in a peripheral mode; receiving a second version of the firmware from an electronic device outside the Bluetooth system via a Bluetooth communication interface of the first Bluetooth device, and controlling the first Bluetooth device to switch to a central mode; When the first Bluetooth device operates in the central mode, using the processor to scan the second Bluetooth device in the Bluetooth system operating in the peripheral mode through the Bluetooth communication interface; When it is determined that the Bluetooth system does not have the second Bluetooth device having the second version of the firmware, the second version of the firmware is transmitted to one of the determined second Bluetooth devices through the Bluetooth communication interface one at a time; and When it is determined that the second Bluetooth device operating in the peripheral mode in the Bluetooth system has the second version of the firmware, the first Bluetooth device is controlled to switch to the peripheral mode.

7. The method according to claim 6, characterized in that When the processor of the first Bluetooth device operating in the central mode does not scan the second Bluetooth device in the Bluetooth system that does not have the second version of the firmware for more than a predetermined time, it is determined that the second Bluetooth device in the Bluetooth system that operates in the peripheral mode has the second version of the firmware.

8. The method according to claim 6, characterized in that It further includes using the processor of the first Bluetooth device operating in the central mode to record the number of times the second version of the firmware is transmitted. When the number of times exceeds a predetermined number, it is determined that the second Bluetooth device operating in the peripheral mode in the Bluetooth system has the second version of the firmware.

9. The method according to claim 6, characterized in that The Bluetooth system further includes a third Bluetooth device, the third Bluetooth device having the same configuration as the first Bluetooth device and the second Bluetooth device; The method further includes, after the second Bluetooth device receives the second version of the firmware from the first Bluetooth device, storing the second version of the firmware in the memory by the processor of the second Bluetooth device, and updating the firmware by using the second version of the firmware, and then controlling the second Bluetooth device to switch to the central mode by using the processor; wherein the processor of the second Bluetooth device operating in the central mode scans the third Bluetooth device operating in the peripheral mode through the Bluetooth communication interface, determines that the third Bluetooth device does not have the second version of the firmware, and transmits the second version of the firmware to the third Bluetooth device through the Bluetooth communication interface; and When the second Bluetooth device operating in the central mode determines that the third Bluetooth device operating in the peripheral mode has the second version of the firmware, the processor of the second Bluetooth device is used to control the second Bluetooth device to switch to the peripheral mode.

10. The method according to claim 6, characterized in that The memory includes a first memory area and a second memory area, and the first version of the firmware is stored in the first memory area; The method further comprises: after the first Bluetooth device receives the second version of the firmware, using the processor of the first Bluetooth device to determine whether the second version of the firmware passes verification, then using the processor to store the second version of the firmware in the second memory area, and restarting the first Bluetooth device; After the restart, the processor overwrites the first version of the firmware in the first memory area with the second version of the firmware in the second memory area.