Method, device, equipment and storage medium for establishing connection of Bluetooth device
By setting the default and alternative Bluetooth gateways for Bluetooth devices and applying for a key when the default gateway is abnormal, the problem of failure of a single Bluetooth gateway caused the device to fail communication, and a stable connection between the device and the cloud server is achieved.
Patent Information
- Application Number
- CN202210421375.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-21
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2042-04-21
AI Technical Summary
When a single Bluetooth gateway fails, communication between the Bluetooth device connecting the Bluetooth gateway and the cloud server fails.
By setting the default Bluetooth gateway and an alternative Bluetooth gateway for the Bluetooth device, if the default Bluetooth gateway is abnormal, the alternative Bluetooth gateway applies for the first key to the cloud server to establish a connection with the Bluetooth device.
It realizes normal communication between the Bluetooth device and the cloud server when a single Bluetooth gateway fails, avoiding device connection interruption.
Smart Images

Figure CN114760615B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application belong to the field of smart home appliances, and specifically relate to a method, apparatus, device and storage medium for establishing a connection with a Bluetooth device. Background Art
[0002] With the development of computer technology, people have more and more demands for smart home appliances, especially whole-house smart home. In the current whole-house smart home, the types and number of Bluetooth devices are increasing, and some Bluetooth devices themselves do not have the ability to connect to the Internet, and need to use Bluetooth gateways to connect to cloud servers. Therefore, how to quickly and conveniently establish a connection between Bluetooth devices and cloud servers through Bluetooth gateways is the key to completing the whole-house smart home.
[0003] At present, in order to improve the connection capacity of Bluetooth gateways, the method of increasing the number of Bluetooth gateways or establishing parent-child gateways is usually adopted. However, there is a problem that a single Bluetooth gateway fails, resulting in communication failure between the Bluetooth device connected to the Bluetooth gateway and the cloud server. Summary of the invention
[0004] In order to solve the above-mentioned problems in the prior art, that is, to solve the problem that a single Bluetooth gateway fails resulting in communication failure between a Bluetooth device connected to the Bluetooth gateway and a cloud server, the present application provides a connection establishment method, apparatus, device and storage medium for a Bluetooth device.
[0005] In a first aspect, the present application provides a method for establishing a connection of a Bluetooth device, which is applied to an alternative Bluetooth gateway. The method for establishing a connection includes: receiving a heartbeat packet sent by a default Bluetooth gateway, and determining whether the default Bluetooth gateway is abnormal based on the heartbeat packet; in response to the abnormality of the default Bluetooth gateway, sending application information to a cloud server, the application information is used to apply for a first key from the cloud server, and the first key is the key for the default Bluetooth gateway to connect to the Bluetooth device; receiving the first key sent by the cloud server; in response to the connection request sent by the Bluetooth device, establishing a connection with the Bluetooth device based on the first key.
[0006] In the preferred technical solution of the connection establishment method of the above-mentioned Bluetooth device, the application information includes a second key, which is the key for the alternative Bluetooth gateway to connect to the Bluetooth device. After sending the application information to the cloud server, it also includes: receiving key verification failure information sent by the cloud server, and the key verification failure information is used to indicate that the second key does not exist in the cloud server.
[0007] In a second aspect, the present application provides a method for establishing a connection of a Bluetooth device, which is applied to a cloud server. The method for establishing a connection includes: receiving application information sent by an alternative Bluetooth gateway, verifying whether a second key in the application information exists on the cloud server, the application information is used to apply for a first key from the cloud server, the first key is the key for the default Bluetooth gateway to connect to the Bluetooth device, and the second key is the key for the alternative Bluetooth gateway to connect to the Bluetooth device; if the second key exists in the cloud server, the first key is sent to the alternative Bluetooth gateway; if the second key does not exist in the cloud server, a key verification failure message is sent to the alternative Bluetooth gateway, and the key verification failure message is used to indicate that the second key does not exist in the cloud server.
[0008] In the preferred technical solution of the connection establishment method of the above-mentioned Bluetooth device, sending the first key to the alternative Bluetooth gateway includes: if it is detected that the default Bluetooth gateway is offline, sending the first key to the alternative Bluetooth gateway; and / or, if it is detected that the default Bluetooth gateway is online, sending a channel occupancy query instruction to the default Bluetooth gateway, the channel occupancy query instruction is used to query the occupancy of the connection channel of the default Bluetooth gateway; receiving channel occupancy feedback information sent by the default Bluetooth gateway, the channel occupancy feedback information is used to indicate the occupancy of the connection channel of the default Bluetooth gateway; if the channel occupancy feedback information is used to indicate that the connection channel of the default Bluetooth gateway is occupied, sending the first key to the alternative Bluetooth gateway.
[0009] In the preferred technical solution of the connection establishment method of the above-mentioned Bluetooth device, it also includes: receiving online information sent by the default Bluetooth gateway; updating the first key and the second key; sending the updated first key to the default Bluetooth gateway, and sending the updated second key to the alternative Bluetooth gateway, so that the Bluetooth device can access the cloud server through the updated first key or the updated second key.
[0010] In the preferred technical solution of the method for establishing a connection of the above-mentioned Bluetooth device, it also includes: after the alternative Bluetooth gateway and the Bluetooth device are connected for a preset time, a default Bluetooth gateway and an alternative Bluetooth gateway are reassigned to the Bluetooth device.
[0011] In the preferred technical solution of the connection establishment method of the above-mentioned Bluetooth device, a default Bluetooth gateway and an alternative Bluetooth gateway are assigned to the Bluetooth device, including: assigning a default Bluetooth gateway and an alternative Bluetooth gateway to the Bluetooth device according to the location of the Bluetooth device; or assigning a default Bluetooth gateway and an alternative Bluetooth gateway to the Bluetooth device according to the signal strength value of the Bluetooth signal sent by the Bluetooth device received by the Bluetooth gateway; or assigning a default Bluetooth gateway and an alternative Bluetooth gateway to the Bluetooth device according to the number of devices connected to the Bluetooth gateway.
[0012] In a third aspect, the present application provides a connection establishment method for a Bluetooth device, which is applied to a default Bluetooth gateway. The connection establishment method includes: receiving a channel occupancy query instruction sent by a cloud server, the channel occupancy query instruction is used to query the occupancy of a connection channel of the default Bluetooth gateway; generating channel occupancy feedback information according to the channel occupancy query instruction, the channel occupancy feedback information is used to indicate the occupancy of a connection channel of the default Bluetooth gateway; and sending the channel occupancy feedback information to the cloud server.
[0013] In the preferred technical solution of the connection establishment method of the above-mentioned Bluetooth device, it also includes: sending online information to the cloud server; receiving the updated first key sent by the cloud server, the first key is the key for the default Bluetooth gateway to connect to the Bluetooth device; sending the updated first key to the Bluetooth device; and establishing a connection with the Bluetooth device according to the updated first key.
[0014] In a fourth aspect, the present application provides a connection establishment method for a Bluetooth device, which is applied to a Bluetooth device. The connection establishment method includes: receiving an updated first key sent by a default Bluetooth gateway, where the first key is a key for the default Bluetooth gateway to connect to the Bluetooth device; and establishing a connection with the default Bluetooth gateway based on the updated first key.
[0015] In the preferred technical solution of the connection establishment method of the above-mentioned Bluetooth device, it also includes: when no connection response from the default Bluetooth gateway is received, establishing a connection with the alternative Bluetooth gateway according to a second key, the second key being the key for the alternative Bluetooth gateway to connect to the Bluetooth device.
[0016] In a fifth aspect, the present application provides a connection establishment system for a Bluetooth device, comprising: an alternative Bluetooth gateway, a cloud server, a default Bluetooth gateway and a Bluetooth device; wherein the alternative Bluetooth gateway is used to execute the connection establishment method for the Bluetooth device of the first aspect; the cloud server is used to execute the connection establishment method for the Bluetooth device of the second aspect; the default Bluetooth gateway is used to execute the connection establishment method for the Bluetooth device of the third aspect; and the Bluetooth device is used to execute the connection establishment method for the Bluetooth device of the fourth aspect.
[0017] In a sixth aspect, the present application provides a connection establishment device for a Bluetooth device, which is applied to an alternative Bluetooth gateway, and the connection establishment device includes: a determination module, which is used to receive a heartbeat packet sent by a default Bluetooth gateway, and determine whether the default Bluetooth gateway is abnormal based on the heartbeat packet; a first sending module, which is used to send application information to a cloud server in response to the abnormality of the default Bluetooth gateway, and the application information is used to apply for a first key from the cloud server, and the first key is the key for the default Bluetooth gateway to connect to the Bluetooth device; a first receiving module, which is used to receive the first key sent by the cloud server; a first connection module, which is used to respond to the connection request sent by the Bluetooth device and establish a connection with the Bluetooth device according to the first key.
[0018] In the seventh aspect, the present application provides a connection establishment device for a Bluetooth device, which is applied to a cloud server, and the connection establishment device includes: a verification module, which is used to receive application information sent by an alternative Bluetooth gateway, and verify whether the second key in the application information exists on the cloud server, and the application information is used to apply for a first key from the cloud server, the first key is the key for the default Bluetooth gateway to connect to the Bluetooth device, and the second key is the key for the alternative Bluetooth gateway to connect to the Bluetooth device; a second sending module, which is used to send the first key to the alternative Bluetooth gateway if the second key exists in the cloud server; a third sending module, which is used to send key verification failure information to the alternative Bluetooth gateway if the second key does not exist in the cloud server, and the key verification failure information is used to indicate that the second key does not exist in the cloud server.
[0019] In an eighth aspect, the present application provides a connection establishment device for a Bluetooth device, which is applied to a default Bluetooth gateway, and the connection establishment device includes: a second receiving module, used to receive a channel occupancy query instruction sent by a cloud server, and the channel occupancy query instruction is used to query the connection channel occupancy of the default Bluetooth gateway; a generating module, used to generate channel occupancy feedback information according to the channel occupancy query instruction, and the channel occupancy feedback information is used to indicate the connection channel occupancy of the default Bluetooth gateway; a fourth sending module, used to send the channel occupancy feedback information to the cloud server.
[0020] In a ninth aspect, the present application provides a connection establishment device for a Bluetooth device, which is applied to a Bluetooth device, and the connection establishment device includes: a third receiving module, used to receive an updated first key sent by a default Bluetooth gateway, the first key being the key for the default Bluetooth gateway to connect to the Bluetooth device; a second connection module, used to establish a connection with the default Bluetooth gateway based on the updated first key.
[0021] In the tenth aspect, the present application provides an electronic device comprising: a processor, a memory and an interactive interface; the memory is used to store programs and data, and the processor calls the program stored in the memory to execute the connection establishment method of the Bluetooth device of the first aspect, the third aspect or the fourth aspect.
[0022] In the eleventh aspect, the present application provides a server, comprising: a processor, a memory and an interactive interface; the memory is used to store programs and data, and the processor calls the program stored in the memory to execute the connection establishment method of the Bluetooth device of the second aspect.
[0023] In a twelfth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for establishing a connection of a Bluetooth device of any one of the first to fourth aspects.
[0024] In a thirteenth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, is used to implement the connection establishment method of a Bluetooth device of any one of the first to fourth aspects.
[0025] The present application provides a method, apparatus, device and storage medium for establishing a connection of a Bluetooth device. The alternative Bluetooth gateway determines whether the default Bluetooth gateway is abnormal by detecting the heartbeat packet sent by the default Bluetooth gateway; in response to the abnormality of the default Bluetooth gateway, the alternative Bluetooth gateway sends an application message to the cloud server to apply for a first key from the cloud server, and the first key is the key for the default Bluetooth gateway to connect to the Bluetooth device; the alternative Bluetooth gateway receives the first key sent by the cloud server; in response to the connection request sent by the Bluetooth device, the alternative Bluetooth gateway establishes a connection with the Bluetooth device according to the first key. In other words, the present application sets a default Bluetooth gateway and an alternative Bluetooth gateway for the Bluetooth device, so that when the alternative Bluetooth gateway determines that the default Bluetooth gateway is abnormal, the alternative Bluetooth gateway can apply for the key of the default Bluetooth gateway from the cloud server, so that the Bluetooth device can establish a connection with the alternative Bluetooth gateway through the key of the default Bluetooth gateway, thereby enabling the Bluetooth device to communicate normally with the cloud server, thereby achieving the purpose of enabling the Bluetooth device connected to the Bluetooth gateway to communicate normally with the cloud server when a single Bluetooth gateway fails. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The following describes the preferred implementation of the method, apparatus, device and storage medium for establishing a connection of a Bluetooth device of the present application with reference to the accompanying drawings.
[0027] Figure 1 A schematic diagram of an application scenario of the method for establishing a connection between a Bluetooth device and an embodiment of the present application;
[0028] Figure 2 A flowchart of a first embodiment of a method for establishing a connection between a Bluetooth device and an embodiment of the present application;
[0029] Figure 3 A flowchart of a second embodiment of a method for establishing a connection between a Bluetooth device and an embodiment of the present application;
[0030] Figure 4 A flowchart of a third embodiment of a method for establishing a connection between a Bluetooth device and an embodiment of the present application;
[0031] Figure 5 A flowchart of a fourth embodiment of a method for establishing a connection between a Bluetooth device and an embodiment of the present application;
[0032] Figure 6 A schematic diagram of connecting a Bluetooth device and a Bluetooth gateway provided in an embodiment of the present application;
[0033] Figure 7 A schematic diagram of positioning a Bluetooth device provided in an embodiment of the present application;
[0034] Figure 8 A schematic diagram of the structure of a system for establishing a connection between Bluetooth devices provided in an embodiment of the present application;
[0035] Fig. 9 A schematic diagram of the structure of a first embodiment of a device for establishing a connection between a Bluetooth device and an embodiment of the present application;
[0036] Fig.10 A schematic diagram of the structure of a second embodiment of an apparatus for establishing a connection between a Bluetooth device and an embodiment of the present application;
[0037] Fig.11 A schematic diagram of the structure of a third embodiment of the apparatus for establishing a connection between a Bluetooth device and an embodiment of the present application;
[0038] Fig.12 A schematic diagram of the structure of a fourth embodiment of an apparatus for establishing a connection between a Bluetooth device and an embodiment of the present application;
[0039] Fig.13 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0040] Fig.14 A schematic diagram of the structure of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0041] First, those skilled in the art should understand that these implementations are only used to explain the technical principles of the present application and are not intended to limit the scope of protection of the present application. Those skilled in the art can make adjustments to them as needed to adapt to specific application scenarios.
[0042] Secondly, it should be noted that in the description of the embodiments of the present application, the terms "first", "second", "third", "fourth", etc. (if any) are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein.
[0043] In addition, it should be noted that in the description of the embodiments of the present application, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0044] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0045] The following first explains the terms involved in this application.
[0046] Heartbeat packet: A self-defined command word that periodically notifies the client and server of their status, and is sent at certain time intervals.
[0047] The technical solutions mentioned in the background technology have at least the following technical problems:
[0048] With the development of computer technology, people have more and more demands for smart home appliances, especially whole-house smart home. In the current whole-house smart home, the types and number of Bluetooth devices are increasing, and some Bluetooth devices themselves do not have the ability to connect to the Internet. They need to use Bluetooth gateways to connect to cloud servers (such as IOT cloud). Therefore, how to quickly and conveniently establish a connection between Bluetooth devices and cloud servers through Bluetooth gateways is the key to completing the whole-house smart home.
[0049] The main problems encountered at present are: when the Bluetooth gateway fails, the Bluetooth devices connected to the Bluetooth gateway will not be able to maintain normal communication with the cloud server; the newly added Bluetooth devices cannot quickly select the appropriate Bluetooth gateway for associated access; when the communication channel of the Bluetooth gateway is congested, some signals will not be able to be transmitted normally; the newly added Bluetooth devices need to manually select the spatial location, which increases the user's operating costs.
[0050] In the prior art, in order to solve the above problems, the connection capability of the Bluetooth gateway is usually improved by increasing the number of Bluetooth gateways or establishing alphabetic gateways. However, there is a problem that a single Bluetooth gateway fails, resulting in communication failure between the Bluetooth device connected to the Bluetooth gateway and the cloud server.
[0051] In response to the above problems, this application proposes a method for establishing a connection for a Bluetooth device, the core idea of which is to set a default Bluetooth gateway and an alternative Bluetooth gateway for the Bluetooth device. Under normal circumstances, the Bluetooth device establishes a connection with the default Bluetooth gateway to achieve communication between the Bluetooth device and the cloud server. If an abnormality occurs in the default Bluetooth device, at this time, the Bluetooth device can establish a connection with the alternative Bluetooth gateway to open the Bluetooth device's backup connection channel, so that the Bluetooth device can communicate with the cloud server through the alternative Bluetooth gateway, thus avoiding the problem that the Bluetooth device cannot communicate with the cloud server when an abnormality occurs in a Bluetooth gateway, thereby achieving the purpose of normal communication between the Bluetooth device connected to the Bluetooth gateway and the cloud server when a single Bluetooth gateway fails.
[0052] In a possible implementation manner, the method for establishing a connection of a Bluetooth device provided in this embodiment may be applied in an application scenario. Figure 1 A schematic diagram of an application scenario of the method for establishing a connection between a Bluetooth device and an embodiment of the present application is provided, such as Figure 1 As shown, in this scenario, all home appliances in the whole family can be in the same Bluetooth gateway network, and the capabilities of the Bluetooth gateway can be integrated into the home appliances, and all home appliances in the family are Bluetooth devices. For example, the kitchen in the family includes multiple Bluetooth devices, among which the capabilities of the Bluetooth gateway can be integrated into the range hood, recorded as Gateway 1; the living room includes multiple Bluetooth devices, among which the capabilities of the Bluetooth gateway can be integrated into the smart screen and the smart air conditioner, recorded as Gateway 2 and Gateway 3 respectively; the bedroom includes multiple Bluetooth devices, among which the capabilities of the Bluetooth gateway can be integrated into the voice speaker and the bedside lamp, recorded as Gateway 4 and Gateway 5 respectively, so that the structure of a distributed Bluetooth gateway can be realized.
[0053] In the above scenario, for the Bluetooth devices in the kitchen, gateway 1 can be set as the default Bluetooth gateway and gateway 2 can be set as the alternative Bluetooth gateway; for the Bluetooth devices in the living room, gateway 2 can be set as the default Bluetooth gateway and gateway 3 can be set as the alternative Bluetooth gateway according to the spatial location, and some Bluetooth devices can even have multiple alternative Bluetooth gateways set; for the Bluetooth devices in the bedroom, gateway 4 can be set as the default Bluetooth gateway and gateway 5 can be set as the alternative Bluetooth gateway according to the spatial location, and some Bluetooth devices can even have multiple alternative Bluetooth gateways set.
[0054] According to the home Bluetooth gateway network provided in the above scenario, each Bluetooth device is set with a default Bluetooth gateway and at least one alternative Bluetooth gateway. In this way, when an abnormality occurs in the default Bluetooth gateway, the Bluetooth device can communicate with the cloud server through the alternative Bluetooth gateway, thereby maintaining normal communication between the Bluetooth device and the alternative Bluetooth gateway.
[0055] In combination with the above scenarios, the technical solution of the method for establishing a connection between Bluetooth devices provided by the present application is described in detail through several specific embodiments below.
[0056] Figure 2 This is a flowchart of a first embodiment of a method for establishing a connection of a Bluetooth device provided in an embodiment of the present application, such as Figure 2 As shown, the connection establishment method of the Bluetooth device is applied to the alternative Bluetooth gateway, and the connection establishment method of the Bluetooth device includes the following steps:
[0057] S201: Receive a heartbeat packet sent by a default Bluetooth gateway, and determine whether the default Bluetooth gateway is abnormal according to the heartbeat packet.
[0058] In this step, the cloud server configures a default Bluetooth gateway and an alternative Bluetooth gateway for the Bluetooth device to access the cloud server. By default, the Bluetooth device accesses the cloud server through the default Bluetooth gateway, and the cloud server may be an IOT cloud.
[0059] In the above scheme, the default Bluetooth gateway of the Bluetooth device can send a heartbeat packet to the alternative Bluetooth gateway of the Bluetooth device through a wireless local area network (WiFi) to inform the alternative Bluetooth gateway of its own online status and connection channel occupancy status. After receiving the heartbeat packet sent by the default Bluetooth gateway, the alternative Bluetooth gateway can determine whether the default Bluetooth gateway is abnormal based on the heartbeat packet. If the alternative Bluetooth gateway can detect the heartbeat packet sent by the default Bluetooth gateway, the alternative Bluetooth gateway can determine that the default Bluetooth gateway is not abnormal; if the alternative Bluetooth gateway cannot detect the heartbeat packet sent by the default Bluetooth gateway, the alternative Bluetooth gateway can determine that the default Bluetooth gateway is abnormal.
[0060] In the above scheme, the alternative Bluetooth gateway cannot detect the heartbeat packet sent by the default Bluetooth gateway. This may be because the alternative Bluetooth gateway has not received the heartbeat packet sent by the default Bluetooth gateway within a period of time, or because the occupancy of the connection channel of the default Bluetooth gateway has reached the maximum number of Bluetooth device connections, the default Bluetooth gateway no longer sends heartbeat packets to the alternative Bluetooth gateway. At this time, the alternative Bluetooth gateway may consider that the default Bluetooth gateway has an abnormality.
[0061] S202: In response to the default Bluetooth gateway being abnormal, sending application information to the cloud server.
[0062] In this step, the application information is used to apply for a first key from the cloud server, where the first key is the key for the default Bluetooth gateway to connect to the Bluetooth device.
[0063] In the above scheme, the first key is the primary connection key, which is maintained by the default Bluetooth gateway, and the default Bluetooth gateway only maintains the first key. By default, the default Bluetooth gateway can establish a secure connection with the Bluetooth device through the first key, and at the same time, the default Bluetooth gateway can verify the first key through the cloud server to obtain the Bluetooth device whitelist of the default Bluetooth gateway from the cloud server.
[0064] In the above scheme, if the alternative Bluetooth gateway considers the default Bluetooth gateway to be abnormal, in order to ensure that the Bluetooth device connected to the default Bluetooth gateway can communicate normally with the cloud server, the alternative Bluetooth device can apply for a first key from the cloud server to establish a connection between the Bluetooth device and the alternative Bluetooth gateway.
[0065] S203: Receive the first key sent by the cloud server.
[0066] In this step, after receiving the application information sent by the candidate Bluetooth gateway, the cloud server may send the first key to the candidate Bluetooth gateway according to the application information.
[0067] S204: In response to the connection request sent by the Bluetooth device, establish a connection with the Bluetooth device according to the first key.
[0068] In this step, after the alternative Bluetooth gateway determines that an abnormality occurs in the default Bluetooth gateway and applies to the server for the first key, if it responds to the connection request sent by the Bluetooth device, it can establish a connection with the Bluetooth device according to the first key to enable the Bluetooth device to communicate with the cloud server through the alternative Bluetooth gateway, thereby achieving the purpose of quickly switching the connected Bluetooth gateway for the Bluetooth device when an abnormality occurs in the default Bluetooth gateway, improving the stability of the channel for the Bluetooth device to upload data to the IOT cloud platform or the remote control channel of the IOT cloud, that is, improving the stability of the communication between the Bluetooth device and the cloud server.
[0069] The technical solution of the method for establishing a connection of the above-mentioned Bluetooth device is described in detail below.
[0070] In one possible implementation, the application information includes a second key, which is the key for the alternative Bluetooth gateway to connect to the Bluetooth device. After sending the application information to the cloud server, it also includes: receiving key verification failure information sent by the cloud server, and the key verification failure information is used to indicate that the second key does not exist in the cloud server.
[0071] In this solution, if the cloud server fails to verify the second key, the cloud server will not send the first key to the alternative Bluetooth gateway. At this time, the cloud server will send key verification failure information to the alternative Bluetooth gateway to inform the alternative Bluetooth gateway that the second key verification failed.
[0072] Figure 3 This is a flowchart of Embodiment 2 of the method for establishing a connection of a Bluetooth device provided in an embodiment of the present application, such as Figure 3 As shown, the method for establishing a connection of a Bluetooth device is applied to a cloud server, and the method for establishing a connection of a Bluetooth device includes the following steps:
[0073] S301: Receive application information sent by the candidate Bluetooth gateway, and verify whether the second key in the application information exists in the cloud server.
[0074] In this step, the application information is used to apply for a first key from the cloud server. The first key is the key for the default Bluetooth gateway to connect to the Bluetooth device, and the second key is the key for the alternative Bluetooth gateway to connect to the Bluetooth device.
[0075] In the above scheme, the cloud server pre-stores the keys corresponding to all Bluetooth gateways. The application information sent by the alternative Bluetooth gateway to the cloud server also includes the second key of the alternative Bluetooth gateway. After the alternative Bluetooth gateway determines that the default Bluetooth gateway is abnormal, when applying for the first key from the cloud server, the cloud server needs to verify its second key first. In this way, after receiving the application information sent by the alternative Bluetooth gateway, the cloud server can compare and verify the second key included in the application information with the key corresponding to the alternative Bluetooth gateway stored in the cloud server, avoiding the situation where the cloud server mistakenly sends the first key due to the illegality of the alternative Bluetooth gateway, thereby improving the security of the Bluetooth device connection.
[0076] S302: If the second key exists in the cloud server, the first key is sent to the alternative Bluetooth gateway.
[0077] In this step, after receiving the application information sent by the alternative Bluetooth gateway, if the second key is verified successfully, that is, the second key exists in the cloud server, the cloud server may send the first key to the alternative Bluetooth gateway.
[0078] In the above solution, the second key is an auxiliary connection key, which is maintained by the alternative Bluetooth gateway. Since the second key acts as a temporary connection key, the alternative Bluetooth gateway cannot directly obtain the Bluetooth device whitelist of the default Bluetooth gateway through the second key.
[0079] In the above scheme, all Bluetooth gateways can establish a connection with the current Bluetooth device after obtaining the first key. In order to prevent the privacy information of the Bluetooth device from being cracked and leaked, all alternative Bluetooth gateways, except the default Bluetooth gateway, need to verify the corresponding second key when applying for the first key from the cloud server. Only after the cloud server verifies the second key, the alternative Bluetooth gateway can obtain the first key and then obtain the Bluetooth device whitelist of the default Bluetooth gateway.
[0080] S303: If the second key does not exist in the cloud server, a key verification failure message is sent to the alternative Bluetooth gateway.
[0081] In this step, the key verification failure information is used to indicate that the second key does not exist in the cloud server.
[0082] In the above scheme, if the cloud server fails to verify the second key, that is, the second key does not exist in the cloud server, the cloud server will not send the first key to the alternative Bluetooth gateway. At this time, the cloud server will send a key verification failure message to the alternative Bluetooth gateway to inform the alternative Bluetooth gateway that the second key verification failed.
[0083] In a possible implementation, sending a first key to an alternative Bluetooth gateway includes: if it is detected that the default Bluetooth gateway is offline, sending the first key to the alternative Bluetooth gateway; and / or, if it is detected that the default Bluetooth gateway is online, sending a channel occupancy query instruction to the default Bluetooth gateway, the channel occupancy query instruction is used to query the occupancy of a connection channel of the default Bluetooth gateway; receiving channel occupancy feedback information sent by the default Bluetooth gateway, the channel occupancy feedback information is used to indicate the occupancy of a connection channel of the default Bluetooth gateway; if the channel occupancy feedback information is used to indicate that the connection channel of the default Bluetooth gateway is occupied, sending the first key to the alternative Bluetooth gateway.
[0084] In this solution, when the cloud server sends the first key to the alternative Bluetooth gateway, it not only needs to verify the second key of the alternative Bluetooth gateway, but also needs to detect whether the default Bluetooth gateway is online and the connection channel occupancy of the default Bluetooth gateway when the second key verification is successful. If the alternative Bluetooth gateway has an abnormality and cannot receive the heartbeat packet sent by the default Bluetooth gateway, the alternative Bluetooth gateway will mistakenly believe that the default Bluetooth gateway has an abnormality and apply for the first key from the cloud server. Therefore, when the cloud server successfully verifies the second key, it also needs to determine the online status of the default Bluetooth gateway and the connection channel occupancy, so as to avoid the problem of the alternative Bluetooth gateway mistakenly applying for the first key.
[0085] In a possible implementation, it also includes: receiving online information sent by the default Bluetooth gateway; updating the first key and the second key; sending the updated first key to the default Bluetooth gateway, and sending the updated second key to the alternative Bluetooth gateway, so that the Bluetooth device can access the cloud server through the updated first key or the updated second key.
[0086] In this solution, if the default Bluetooth gateway is back online, the default Bluetooth gateway will send an online message to the cloud server to inform the cloud server that the default Bluetooth gateway has returned to normal. In order to prevent the privacy information of the Bluetooth device from being cracked and leaked, the cloud server can update the first key and the second key after the default Bluetooth gateway is back online, so that when the Bluetooth device and the cloud server communicate subsequently, the updated first key can be used to establish a connection between the Bluetooth device and the default Bluetooth gateway, or the updated second key can be used to establish a connection between the Bluetooth device and the alternative Bluetooth gateway.
[0087] In a possible implementation, the method further includes: after the candidate Bluetooth gateway establishes a connection with the Bluetooth device for a preset time period, reassigning a default Bluetooth gateway and a candidate Bluetooth gateway to the Bluetooth device.
[0088] In this solution, the connection relationship between the alternative Bluetooth gateway and the Bluetooth device has reached a preset duration, which means that during this period, the default Bluetooth gateway has not been online, or the connection channel of the default Bluetooth gateway has been occupied. Therefore, in order to enable the Bluetooth device to communicate normally with the cloud server, the cloud server can reassign the default Bluetooth gateway and the alternative Bluetooth gateway to the Bluetooth device.
[0089] In the above solution, when the cloud server assigns a default Bluetooth gateway and an alternative Bluetooth gateway to a Bluetooth device, it can assign a default Bluetooth gateway and multiple alternative Bluetooth gateways to the Bluetooth device. The connection relationship between the Bluetooth device and multiple Bluetooth gateways can be as follows: Figure 6 As shown, Figure 6 A schematic diagram of connecting a Bluetooth device and a Bluetooth gateway provided in an embodiment of the present application, in Figure 6 , the connection between Bluetooth device 1 and Bluetooth gateway 1 is the default channel, and the connection between Bluetooth device 1 and Bluetooth gateway 2 is the backup channel, that is, the default Bluetooth gateway of Bluetooth device 1 is Bluetooth gateway 1, and the backup Bluetooth gateway is Bluetooth gateway 2; the connection between Bluetooth device 2 and Bluetooth gateway 1 is the backup channel, and the connection between Bluetooth device 2 and Bluetooth gateway 2 is the default channel, that is, the default Bluetooth gateway of Bluetooth device 2 is Bluetooth gateway 2, and the backup Bluetooth gateway is Bluetooth gateway 1; the connection between Bluetooth device 3 and Bluetooth gateway 1 is the backup channel, and the connection between Bluetooth device 3 and Bluetooth gateway 2 is the default channel, that is, the default Bluetooth gateway of Bluetooth device 3 is Bluetooth gateway 2, and the backup Bluetooth gateway is Bluetooth gateway 1.
[0090] In the above scheme, when a new Bluetooth device joins the Bluetooth gateway network, the cloud server will also assign a default Bluetooth gateway and an alternative Bluetooth gateway to the Bluetooth device, and send the key of the default Bluetooth gateway and the key of the alternative Bluetooth gateway to the Bluetooth device through the default Bluetooth gateway, where the key of the default Bluetooth gateway is used as the primary connection key and the key of the alternative Bluetooth gateway is used as the auxiliary connection key.
[0091] In a possible implementation, assigning a default Bluetooth gateway and an alternative Bluetooth gateway to a Bluetooth device includes: assigning a default Bluetooth gateway and an alternative Bluetooth gateway to a Bluetooth device according to the location of the Bluetooth device; or assigning a default Bluetooth gateway and an alternative Bluetooth gateway to a Bluetooth device according to a signal strength value of a Bluetooth signal sent by the Bluetooth device received by the Bluetooth gateway; or assigning a default Bluetooth gateway and an alternative Bluetooth gateway to a Bluetooth device according to the number of devices connected to the Bluetooth gateway.
[0092] In this solution, the cloud server can assign a default Bluetooth gateway and an alternative Bluetooth gateway to the Bluetooth device through the above three methods, among which the first method (assigning a default Bluetooth gateway and an alternative Bluetooth gateway to the Bluetooth device according to the location of the Bluetooth device) has a higher priority than the second method (assigning a default Bluetooth gateway and an alternative Bluetooth gateway to the Bluetooth device according to the signal strength value of the Bluetooth signal sent by the Bluetooth device received by the Bluetooth gateway), and the second method has a higher priority than the third method (assigning a default Bluetooth gateway and an alternative Bluetooth gateway to the Bluetooth device according to the number of connected devices to the Bluetooth gateway).
[0093] In the above scheme, when a default Bluetooth gateway and an alternative Bluetooth gateway are assigned to a Bluetooth device according to the location of the Bluetooth device, the location of the Bluetooth device can be determined by multiple Bluetooth gateways. For example, the Bluetooth gateway can locate the Bluetooth device according to the angle of arrival (AOA) of the Bluetooth signal sent by the Bluetooth device. Figure 7 shown. Figure 7 A schematic diagram of positioning a Bluetooth device provided in an embodiment of the present application, in Figure 7 In the figure, the distance between Bluetooth gateway 1 and Bluetooth gateway 2 is determined, and the distance can be represented by d; when positioning Bluetooth device 1, after receiving the Bluetooth signal sent by Bluetooth device 1, Bluetooth gateway 1 can determine the arrival angle θ1 of the Bluetooth signal sent by Bluetooth device 1 through the integrated antenna, and after receiving the Bluetooth signal sent by Bluetooth device 1, Bluetooth gateway 2 can determine the arrival angle θ2 of the Bluetooth signal sent by Bluetooth device 1 through the integrated antenna, and the position of Bluetooth device 1 can be determined through θ1, θ2 and d; similarly, when positioning Bluetooth device 2, after receiving the Bluetooth signal sent by Bluetooth device 2, Bluetooth gateway 1 can determine the arrival angle θ4 of the Bluetooth signal sent by Bluetooth device 2 through the integrated antenna, and after receiving the Bluetooth signal sent by Bluetooth device 2, Bluetooth gateway 2 can determine the arrival angle θ3 of the Bluetooth signal sent by Bluetooth device 2 through the integrated antenna, and the position of Bluetooth device 2 can be determined through θ3, θ3 and d. The Bluetooth gateway closest to the Bluetooth device can be used as the default Bluetooth gateway of the Bluetooth device, and other Bluetooth gateways can be used as alternative Bluetooth gateways.
[0094] In the above scheme, when the Bluetooth device is assigned a default Bluetooth gateway and an alternative Bluetooth gateway, the Bluetooth gateway that receives the strongest Bluetooth signal sent by the Bluetooth device can be used as the default Bluetooth gateway of the Bluetooth device, and other Bluetooth gateways can be used as alternative Bluetooth gateways. If a Bluetooth gateway cannot receive the Bluetooth signal sent by the Bluetooth device, the Bluetooth gateway cannot be used as the Bluetooth gateway of the Bluetooth device. The signal strength value of the Bluetooth signal sent by the Bluetooth device received by the Bluetooth gateway can be represented by the received signal strength indication (RSSI).
[0095] In the above scheme, when the default Bluetooth gateway and the alternative Bluetooth gateway are allocated to the Bluetooth device according to the number of connected devices of the Bluetooth gateway, the Bluetooth gateway with the least number of connected devices can be used as the default Bluetooth gateway of the Bluetooth device, and the other Bluetooth gateways are used as alternative Bluetooth gateways.
[0096] In the above solution, the default Bluetooth gateway and the alternative Bluetooth gateway are assigned to the Bluetooth device by combining the above three methods, so that the assignment result can be more reasonable, thereby achieving the purpose of quickly assigning the default Bluetooth gateway and the alternative Bluetooth gateway to the Bluetooth device.
[0097] Figure 4 This is a flowchart of Embodiment 3 of the method for establishing a connection of a Bluetooth device provided in an embodiment of the present application, such as Figure 4 As shown, the connection establishment method of the Bluetooth device is applied to the default Bluetooth gateway, and the connection establishment method of the Bluetooth device includes the following steps:
[0098] S401: Receive a channel occupancy query instruction sent by a cloud server.
[0099] In this step, the channel occupancy query instruction is used to query the connection channel occupancy of the default Bluetooth gateway.
[0100] In the above solution, when the default Bluetooth gateway is online, the cloud server needs to determine the channel occupancy of the default Bluetooth gateway, so as to determine whether the first key can be sent to the alternative Bluetooth gateway.
[0101] S402: Generate channel occupancy feedback information according to the channel occupancy query instruction.
[0102] In this step, the channel occupancy feedback information is used to indicate the connection channel occupancy status of the default Bluetooth gateway.
[0103] In the above scheme, after receiving the channel occupancy query instruction sent by the cloud server, the default Bluetooth gateway needs to feedback its own channel occupancy to the cloud server. Therefore, the channel occupancy feedback information can be generated according to the channel occupancy query instruction.
[0104] S403: Send channel occupancy feedback information to the cloud server.
[0105] In this step, after generating the channel occupancy feedback information, the default Bluetooth gateway may send the channel occupancy feedback information to the cloud server to inform the server of its own channel occupancy status, so that the server can determine whether to send the first key to the alternative Bluetooth gateway according to the channel occupancy feedback information.
[0106] In a possible implementation, it also includes: sending online information to a cloud server; receiving an updated first key sent by the cloud server, the first key being the key for connecting a default Bluetooth gateway to a Bluetooth device; sending the updated first key to the Bluetooth device; and establishing a connection with the Bluetooth device based on the updated first key.
[0107] In this solution, if the default Bluetooth gateway is back online, the default Bluetooth gateway will send an online message to the cloud server to inform the cloud server that the default Bluetooth gateway has returned to normal. In order to prevent the privacy information of the Bluetooth device from being cracked and leaked, the cloud server can update the first key and the second key after the default Bluetooth gateway is back online, so that when the Bluetooth device and the cloud server communicate subsequently, the updated first key can be used to establish a connection between the Bluetooth device and the default Bluetooth gateway, or the updated second key can be used to establish a connection between the Bluetooth device and the alternative Bluetooth gateway.
[0108] Figure 5 This is a flowchart of Embodiment 3 of the method for establishing a connection of a Bluetooth device provided in an embodiment of the present application, such as Figure 5 As shown, the connection establishment method of the Bluetooth device is applied to the Bluetooth device, and the connection establishment method of the Bluetooth device includes the following steps:
[0109] S501: Receive an updated first key sent by a default Bluetooth gateway.
[0110] In this step, the first key is a key for connecting the default Bluetooth gateway to the Bluetooth device.
[0111] In the above solution, since the default Bluetooth gateway has been back online, in order to reestablish the connection between the Bluetooth device and the default Bluetooth gateway, the cloud server needs to send the updated first key to the default Bluetooth gateway, and then the default Bluetooth gateway will forward the updated first key to the Bluetooth device.
[0112] S502: Establish a connection with a default Bluetooth gateway according to the updated first key.
[0113] In this step, since the original first key is no longer usable, the connection between the alternative Bluetooth gateway and the Bluetooth device is automatically disconnected. In this way, after receiving the updated first key sent by the default Bluetooth gateway, the Bluetooth device can re-establish a connection with the default Bluetooth gateway through the updated first key.
[0114] In the above scheme, the Bluetooth device can actively establish a connection with the default Bluetooth device through the key of the default Bluetooth device, and can also actively establish a connection with the alternative Bluetooth gateway through the key of the alternative Bluetooth gateway. Therefore, after the cloud server updates the first key and the second key, it will send the updated first key and the second key to the default Bluetooth gateway at the same time, so that the default Bluetooth gateway can send the updated first key and the updated second key to the Bluetooth device. So that when there is a need later, the Bluetooth device can actively connect to the default Bluetooth device through the updated first key, or actively connect to the alternative Bluetooth gateway through the updated second key.
[0115] In a possible implementation, the further step includes: when no connection response from the default Bluetooth gateway is received, establishing a connection with the alternative Bluetooth gateway according to a second key, where the second key is a key for the alternative Bluetooth gateway to connect to the Bluetooth device.
[0116] In this solution, by default, the Bluetooth device can actively send a connection request to the default Bluetooth gateway to establish a connection with the default Bluetooth gateway. If the default Bluetooth gateway has not responded to the connection request sent by the Bluetooth device, the Bluetooth device can actively establish a connection with the alternative Bluetooth gateway through the second key. At this time, the Bluetooth device can be switched to the master device (Master device) in the area, and the home appliance device integrated with the alternative Bluetooth device can be switched to the slave device (Slave device).
[0117] In the above scheme, the Bluetooth device can actively establish a connection with the alternative Bluetooth gateway through the second key after the number of times it actively connects to the default Bluetooth gateway reaches a preset threshold, for example, twice. At this time, the alternative Bluetooth gateway can temporarily replace the default Bluetooth gateway to complete the Bluetooth gateway work until the default Bluetooth gateway returns to normal.
[0118] In a possible implementation, when the cloud server needs to send a control instruction to a Bluetooth device, by default, the cloud server sends the control instruction to the default Bluetooth gateway, which forwards the control instruction to the Bluetooth device. However, if the default Bluetooth gateway fails to forward the control instruction, the cloud server can actively send the first key to the alternative Bluetooth gateway and open the alternative connection channel, so that the alternative Bluetooth gateway forwards the control instruction to the Bluetooth device. After receiving the control instruction, the Bluetooth device sends the feedback result to the alternative Bluetooth gateway through the alternative connection channel, and the alternative Bluetooth gateway forwards the feedback result to the cloud server. After the default Bluetooth gateway returns to normal, the cloud server updates the first key and the second key, and then reconnects the default Bluetooth gateway and the Bluetooth device.
[0119] In the above solution, the connection status between the Bluetooth device and the Bluetooth gateway and the key information used for the connection may be as shown in Table 1 below:
[0120] Table 1 Connection status between Bluetooth device and Bluetooth gateway and key information table used for connection
[0121]
[0122]
[0123] In the above Table 1, when the Bluetooth gateway is offline, it means that the Bluetooth gateway cannot use WiFi, but can send Bluetooth signals; when the Bluetooth gateway is powered off, it means that the power of the Bluetooth gateway is disconnected, WiFi cannot be used, and Bluetooth signals cannot be sent.
[0124] In one possible implementation, if an abnormality occurs in the connection path between the cloud server and the Bluetooth gateway, that is, the Bluetooth gateway cannot connect to the cloud server, then after the alternative Bluetooth gateway detects that the default Bluetooth gateway has an abnormality, the alternative Bluetooth gateway cannot apply for the first key in the cloud server, and therefore, the alternative Bluetooth gateway cannot upload data to the cloud server. However, since the alternative Bluetooth gateway can communicate with the Bluetooth device through the second key, a temporary connection relationship can be maintained between the alternative Bluetooth gateway and the Bluetooth device to achieve local functions.
[0125] In the method for establishing a connection of a Bluetooth device provided in an embodiment of the present application, the alternative Bluetooth gateway determines whether the default Bluetooth gateway is abnormal by detecting the heartbeat packet sent by the default Bluetooth gateway, and when the alternative Bluetooth gateway determines that the default Bluetooth gateway is abnormal, it applies for the key of the default Bluetooth gateway from the cloud server, so that the Bluetooth device can establish a connection with the alternative Bluetooth gateway using the key of the default Bluetooth gateway, thereby enabling the Bluetooth device and the cloud server to communicate normally, thereby achieving the purpose of enabling the Bluetooth device connected to the Bluetooth gateway to communicate normally with the cloud server when a single Bluetooth gateway fails.
[0126] Generally speaking, this application integrates Bluetooth gateway capabilities into home appliances. The cloud server can automatically assign default Bluetooth gateways and alternative Bluetooth gateways to Bluetooth devices quickly and accurately, and realize the connection between Bluetooth devices and Bluetooth gateways through dual keys. It can not only ensure that all Bluetooth gateways in the Bluetooth gateway network can quickly and conveniently establish a connection relationship with the Bluetooth device using the same key (first key), but also avoid the leakage of privacy information of Bluetooth devices. Therefore, the technical solution provided by this application is a technical implementation solution that can realize normal communication between Bluetooth devices and cloud servers, and ensure that the privacy information of Bluetooth devices is not leaked.
[0127] The embodiment of the present application also provides a connection establishment system for a Bluetooth device. Figure 8 A schematic diagram of the structure of the connection establishment system of the Bluetooth device provided in the embodiment of the present application, such as Figure 8 As shown, the connection establishment system 800 of the Bluetooth device includes: an alternative Bluetooth gateway 801, a cloud server 802, a default Bluetooth gateway 803 and a Bluetooth device 804; wherein the alternative Bluetooth gateway is used to perform the following Figure 2 The method for establishing a connection with a Bluetooth device shown in FIG. 1 ; the cloud server is used to execute the following Figure 3 The connection establishment method of the Bluetooth device shown in the figure; the default Bluetooth gateway is used to perform the following Figure 4 The Bluetooth device is used to perform the following steps: Figure 5 The method for establishing a connection with a Bluetooth device shown.
[0128] The connection establishment system of the Bluetooth device is used to execute the technical solution provided by the aforementioned connection establishment method embodiment of the Bluetooth device. Its implementation principle and technical effect are similar to those in the aforementioned method embodiment and will not be repeated here.
[0129] An embodiment of the present application also provides a connection establishment device for a Bluetooth device, which can be integrated in an alternative Bluetooth gateway and includes various functional modules for implementing the connection establishment method for the Bluetooth device corresponding to the aforementioned alternative Bluetooth gateway. Any functional module can be implemented by software / or hardware.
[0130] Fig. 9 A schematic diagram of the structure of the first embodiment of the apparatus for establishing a connection of a Bluetooth device provided in the embodiment of the present application, as shown in FIG. Fig. 9 As shown, the connection establishment device 900 of the Bluetooth device includes:
[0131] The determination module 901 is used to receive a heartbeat packet sent by a default Bluetooth gateway, and determine whether the default Bluetooth gateway is abnormal according to the heartbeat packet;
[0132] A first sending module 902 is used to send application information to the cloud server in response to the default Bluetooth gateway being abnormal, where the application information is used to apply for a first key from the cloud server, where the first key is a key for the default Bluetooth gateway to connect to the Bluetooth device;
[0133] A first receiving module 903, used to receive a first key sent by a cloud server;
[0134] The first connection module 904 is configured to establish a connection with the Bluetooth device according to a first key in response to a connection request sent by the Bluetooth device.
[0135] Optionally, the application information includes a second key, which is the key for the alternative Bluetooth gateway to connect to the Bluetooth device. The connection establishment device 900 of the Bluetooth device may also include a first processing module (not shown), which is used to: after sending the application information to the cloud server, receive the key verification failure information sent by the cloud server, and the key verification failure information is used to indicate that the second key does not exist in the cloud server.
[0136] The connection establishment device of the Bluetooth device is used to execute the technical solution provided by the connection establishment method embodiment of the Bluetooth device corresponding to the aforementioned alternative Bluetooth gateway. Its implementation principle and technical effect are similar to those in the aforementioned method embodiment and will not be repeated here.
[0137] An embodiment of the present application also provides a connection establishment device for a Bluetooth device, which can be integrated in a cloud server and includes various functional modules for implementing the connection establishment method for the Bluetooth device corresponding to the aforementioned cloud server. Any functional module can be implemented by software / or hardware.
[0138] Fig.10 A schematic diagram of the structure of Embodiment 2 of the apparatus for establishing a connection of a Bluetooth device provided in an embodiment of the present application, as shown in FIG. Fig.10 As shown, the connection establishment device 1000 of the Bluetooth device includes:
[0139] Verification module 1001, used to receive application information sent by the alternative Bluetooth gateway, verify whether the second key in the application information exists in the cloud server, the application information is used to apply for the first key from the cloud server, the first key is the key for the default Bluetooth gateway to connect to the Bluetooth device, and the second key is the key for the alternative Bluetooth gateway to connect to the Bluetooth device;
[0140] A second sending module 1002, configured to send the first key to the alternative Bluetooth gateway if the second key exists in the cloud server;
[0141] The third sending module 1003 is used to send key verification failure information to the alternative Bluetooth gateway if the second key does not exist in the cloud server, where the key verification failure information is used to indicate that the second key does not exist in the cloud server.
[0142] Optionally, the second sending module 1002 can also be specifically used for: if it is detected that the default Bluetooth gateway is offline, sending the first key to the alternative Bluetooth gateway; and / or, if it is detected that the default Bluetooth gateway is online, sending a channel occupancy query instruction to the default Bluetooth gateway, the channel occupancy query instruction is used to query the occupancy of the connection channel of the default Bluetooth gateway; receiving channel occupancy feedback information sent by the default Bluetooth gateway, the channel occupancy feedback information is used to indicate the occupancy of the connection channel of the default Bluetooth gateway; if the channel occupancy feedback information is used to indicate that the connection channel of the default Bluetooth gateway is occupied, sending the first key to the alternative Bluetooth gateway.
[0143] Optionally, the connection establishment device 1000 of the Bluetooth device may also include a second processing module (not shown), which may be specifically used to: receive online information sent by the default Bluetooth gateway; update the first key and the second key; send the updated first key to the default Bluetooth gateway, and send the updated second key to the alternative Bluetooth gateway, so that the Bluetooth device can access the cloud server through the updated first key or the updated second key.
[0144] Optionally, the connection establishment apparatus 1000 of the Bluetooth device may further include a third processing module (not shown), which may be specifically used to: reassign a default Bluetooth gateway and an alternative Bluetooth gateway to the Bluetooth device after the alternative Bluetooth gateway establishes a connection with the Bluetooth device for a preset time period.
[0145] Optionally, the third processing module can also be specifically used to: assign a default Bluetooth gateway and an alternative Bluetooth gateway to a Bluetooth device according to the location of the Bluetooth device; or assign a default Bluetooth gateway and an alternative Bluetooth gateway to a Bluetooth device according to the signal strength value of the Bluetooth signal sent by the Bluetooth device received by the Bluetooth gateway; or assign a default Bluetooth gateway and an alternative Bluetooth gateway to a Bluetooth device according to the number of connected devices of the Bluetooth gateway.
[0146] The connection establishment device of the Bluetooth device is used to execute the technical solution provided by the connection establishment method embodiment of the Bluetooth device corresponding to the aforementioned cloud server. Its implementation principle and technical effect are similar to those in the aforementioned method embodiment and will not be repeated here.
[0147] An embodiment of the present application also provides a connection establishment device for a Bluetooth device, which can be integrated in a default Bluetooth gateway and includes various functional modules for implementing the connection establishment method for the Bluetooth device corresponding to the aforementioned default Bluetooth gateway. Any functional module can be implemented by software / or hardware.
[0148] Fig.11 This is a schematic diagram of the structure of Embodiment 3 of the apparatus for establishing a connection of a Bluetooth device provided in the embodiment of the present application, as shown in FIG. Fig.11 As shown, the connection establishment device 1100 of the Bluetooth device includes:
[0149] The second receiving module 1101 is used to receive a channel occupancy query instruction sent by the cloud server, where the channel occupancy query instruction is used to query the occupancy of the connection channel of the default Bluetooth gateway;
[0150] A generating module 1102, configured to generate channel occupancy feedback information according to the channel occupancy query instruction, wherein the channel occupancy feedback information is used to indicate the occupancy of the connection channel of the default Bluetooth gateway;
[0151] The fourth sending module 1103 is used to send the channel occupancy feedback information to the cloud server.
[0152] Optionally, the connection establishment device 1100 of the Bluetooth device may further include a fourth processing module (not shown), which may be specifically used for: sending online information to the cloud server; receiving an updated first key sent by the cloud server, where the first key is the key for the default Bluetooth gateway to connect to the Bluetooth device; sending the updated first key to the Bluetooth device; and establishing a connection with the Bluetooth device based on the updated first key.
[0153] The connection establishment device of the Bluetooth device is used to execute the technical solution provided by the connection establishment method embodiment of the Bluetooth device corresponding to the aforementioned default Bluetooth gateway. Its implementation principle and technical effect are similar to those in the aforementioned method embodiment and will not be repeated here.
[0154] An embodiment of the present application also provides a connection establishment device for a Bluetooth device, which can be integrated in a Bluetooth device and includes various functional modules for implementing a connection establishment method for a Bluetooth device corresponding to the aforementioned Bluetooth device. Any functional module can be implemented by software / or hardware.
[0155] Fig.12A schematic diagram of a fourth embodiment of a device for establishing a connection for a Bluetooth device provided in an embodiment of the present application is shown in FIG. Fig.12 As shown, the connection establishment device 1200 of the Bluetooth device includes:
[0156] The third receiving module 1201 is used to receive the updated first key sent by the default Bluetooth gateway, where the first key is the key for the default Bluetooth gateway to connect to the Bluetooth device;
[0157] The second connection module 1202 is configured to establish a connection with a default Bluetooth gateway according to the updated first key.
[0158] Optionally, the connection establishment device 1200 of the Bluetooth device may also include a fifth processing module (not shown), which may be specifically used to: when no connection response from the default Bluetooth gateway is received, establish a connection with an alternative Bluetooth gateway according to a second key, where the second key is a key for the alternative Bluetooth gateway to connect to the Bluetooth device.
[0159] The connection establishment device of the Bluetooth device is used to execute the technical solution provided by the connection establishment method embodiment of the Bluetooth device corresponding to the aforementioned Bluetooth device. Its implementation principle and technical effect are similar to those in the aforementioned method embodiment and will not be repeated here.
[0160] Fig.13 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Fig.13 As shown, the electronic device 1300 includes:
[0161] Processor 1311, memory 1312, and interactive interface 1313;
[0162] The memory 1312 is used to store programs and data. The processor 1311 calls the program stored in the memory 1312 to execute the technical solution of the connection establishment method of the aforementioned alternative Bluetooth gateway, the default Bluetooth gateway or the Bluetooth device corresponding to the Bluetooth device.
[0163] In the above-mentioned electronic device, the memory 1312, the processor 1311 and the interactive interface 1313 are electrically connected directly or indirectly to realize data transmission or interaction. For example, these elements can be electrically connected to each other through one or more communication buses or signal lines, such as through a bus connection. The memory 1312 stores computer-executable instructions for implementing the connection establishment method of the aforementioned alternative Bluetooth gateway, the default Bluetooth gateway or the Bluetooth device corresponding to the Bluetooth device, including at least one software function module that can be stored in the memory in the form of software or firmware. The processor 1311 executes various functional applications and data processing by running the software programs and modules stored in the memory 1312.
[0164] Fig.14 A schematic diagram of the structure of a server provided in an embodiment of the present application, such as Fig.14 As shown, the server 1400 includes:
[0165] Processor 1411, memory 1412, and interactive interface 1413;
[0166] The memory 1412 is used to store programs and data, and the processor 1411 calls the program stored in the memory 1412 to execute the technical solution of the connection establishment method of the Bluetooth device corresponding to the aforementioned cloud server.
[0167] In the above-mentioned server, the memory 1412, the processor 1411 and the interactive interface 1413 are electrically connected directly or indirectly to realize data transmission or interaction. For example, these elements can be electrically connected to each other through one or more communication buses or signal lines, such as through a bus connection. The memory 1412 stores computer-executable instructions for implementing the connection establishment method of the Bluetooth device corresponding to the aforementioned cloud server, including at least one software function module that can be stored in the memory in the form of software or firmware. The processor 1411 executes various functional applications and data processing by running the software programs and modules stored in the memory 1412.
[0168] Optionally, the memory may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The memory is used to store programs, and the processor executes the programs after receiving the execution instructions. Furthermore, the software programs and modules in the above-mentioned memory may also include an operating system, which may include various software components and / or drivers for managing system tasks (such as memory management, storage device control, power management, etc.), and may communicate with various hardware or software components to provide an operating environment for other software components.
[0169] The processor may be an integrated circuit chip having the ability to process signals. The above-mentioned processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc. The methods, steps, and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. The general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0170] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer program is executed by a processor, the solution of the aforementioned method for establishing a connection of a Bluetooth device is implemented.
[0171] The present application also provides a computer program product, including a computer program, which is used to implement the solution of the aforementioned connection establishment method of the Bluetooth device when executed by a processor.
[0172] The computer-readable storage medium may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The computer-readable storage medium may be any available medium that can be accessed by a general or special purpose computer.
[0173] An exemplary readable storage medium is coupled to the processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist as discrete components in the connection establishment device of the Bluetooth device.
[0174] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0175] So far, the technical solutions of the present application have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present application is obviously not limited to these specific embodiments. Without departing from the principles of the present application, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present application.
Claims
1. A method for establishing a connection of a Bluetooth device, characterized in that: Applied to the alternative Bluetooth gateway, the connection establishment method includes: Receive a heartbeat packet sent by a default Bluetooth gateway, and determine whether the default Bluetooth gateway is abnormal according to the heartbeat packet; In response to the default Bluetooth gateway being abnormal, sending application information to a cloud server, wherein the application information is used to apply for a first key from the cloud server, where the first key is a key for the default Bluetooth gateway to connect to the Bluetooth device; Receiving the first key sent by the cloud server after determining that the second key exists in the cloud server; the second key is the key for the alternative Bluetooth gateway to connect to the Bluetooth device; In response to a connection request sent by a Bluetooth device, a connection is established with the Bluetooth device according to the first key.
2. The connection establishment method according to claim 1, characterized in that: After sending the application information to the cloud server, the method further includes: Receive key verification failure information sent by the cloud server, where the key verification failure information is used to indicate that the second key does not exist in the cloud server.
3. A method for establishing a connection of a Bluetooth device, characterized in that: Applied to a cloud server, the connection establishment method includes: Receive application information sent by the alternative Bluetooth gateway, and verify whether the second key in the application information exists in the cloud server, wherein the application information is used to apply for a first key from the cloud server, wherein the first key is a key for the default Bluetooth gateway to connect to the Bluetooth device, and the second key is a key for the alternative Bluetooth gateway to connect to the Bluetooth device; If the second key exists in the cloud server, sending the first key to the alternative Bluetooth gateway; If the second key does not exist in the cloud server, key verification failure information is sent to the alternative Bluetooth gateway, where the key verification failure information is used to indicate that the second key does not exist in the cloud server.
4. The connection establishment method according to claim 3, characterized in that: The sending the first key to the candidate Bluetooth gateway includes: If it is detected that the default Bluetooth gateway is offline, sending the first key to the alternative Bluetooth gateway; And / or, if it is detected that the default Bluetooth gateway is online, a channel occupancy query instruction is sent to the default Bluetooth gateway, and the channel occupancy query instruction is used to query the occupancy of the connection channel of the default Bluetooth gateway; channel occupancy feedback information sent by the default Bluetooth gateway is received, and the channel occupancy feedback information is used to indicate the occupancy of the connection channel of the default Bluetooth gateway; if the channel occupancy feedback information is used to indicate that the connection channel of the default Bluetooth gateway is occupied, the first key is sent to the alternative Bluetooth gateway.
5. The connection establishment method according to claim 3 or 4, characterized in that: Also includes: Receiving online information sent by the default Bluetooth gateway; updating the first key and the second key; The updated first key is sent to the default Bluetooth gateway, and the updated second key is sent to the alternative Bluetooth gateway, so that the Bluetooth device can access the cloud server through the updated first key or the updated second key.
6. The connection establishment method according to claim 3 or 4, characterized in that: Also includes: After the candidate Bluetooth gateway is connected to the Bluetooth device for a preset time, a default Bluetooth gateway and a candidate Bluetooth gateway are reassigned to the Bluetooth device.
7. The connection establishment method according to claim 6, characterized in that: Allocating a default Bluetooth gateway and an alternative Bluetooth gateway for the Bluetooth device includes: Allocate a default Bluetooth gateway and an alternative Bluetooth gateway to the Bluetooth device according to the location of the Bluetooth device; or The signal strength value of the Bluetooth signal sent by the Bluetooth device is received by the Bluetooth gateway, and a default Bluetooth gateway and an alternative Bluetooth gateway are allocated to the Bluetooth device; or A default Bluetooth gateway and an alternative Bluetooth gateway are allocated to the Bluetooth device according to the number of devices connected to the Bluetooth gateway.
8. A method for establishing a connection of a Bluetooth device, characterized in that: Applied to the default Bluetooth gateway, the connection establishment method includes: Send heartbeat packets to alternative Bluetooth gateways; Receive a channel occupancy query instruction sent by the cloud server, the channel occupancy query instruction is used to query the occupancy of the connection channel of the default Bluetooth gateway; the channel occupancy query instruction is sent by the cloud server in response to the application information sent by the alternative Bluetooth gateway, after determining that the second key exists in the cloud server, the application information is sent by the alternative Bluetooth gateway after determining that the default Bluetooth gateway is abnormal based on the heartbeat packet; the second key is the key for the alternative Bluetooth gateway to connect to the Bluetooth device; Generate channel occupancy feedback information according to the channel occupancy query instruction, wherein the channel occupancy feedback information is used to indicate the occupancy of the connection channel of the default Bluetooth gateway; The channel occupancy feedback information is sent to the cloud server so that the cloud server sends a first key to the alternative Bluetooth gateway, where the first key is a key for the default Bluetooth gateway to connect to the Bluetooth device.
9. The connection establishment method according to claim 8, characterized in that: Also includes: Sending online information to the cloud server; Receiving an updated first key sent by the cloud server, where the first key is a key for the default Bluetooth gateway to connect to the Bluetooth device; Sending the updated first key to the Bluetooth device; Establish a connection with the Bluetooth device according to the updated first key.
10. A connection establishment system for a Bluetooth device, characterized in that: include: Alternative Bluetooth gateways, cloud servers, default Bluetooth gateways and Bluetooth devices; Wherein, the alternative Bluetooth gateway is used to execute the connection establishment method of the Bluetooth device according to claim 1 or 2; The cloud server is used to execute the connection establishment method of the Bluetooth device according to any one of claims 3 to 7; The default Bluetooth gateway is used to execute the connection establishment method for the Bluetooth device according to claim 8 or 9.
11. A device for establishing a connection of a Bluetooth device, characterized in that: Applied to an alternative Bluetooth gateway, the connection establishment device includes: A determination module, used to receive a heartbeat packet sent by a default Bluetooth gateway, and determine whether the default Bluetooth gateway is abnormal according to the heartbeat packet; A first sending module, configured to send application information to a cloud server in response to the default Bluetooth gateway being abnormal, wherein the application information is used to apply for a first key from the cloud server, wherein the first key is a key for the default Bluetooth gateway to connect to the Bluetooth device; A first receiving module is used to receive the first key sent by the cloud server after determining that the second key exists in the cloud server; the second key is the key for the alternative Bluetooth gateway to connect to the Bluetooth device; The first connection module is used to establish a connection with the Bluetooth device according to the first key in response to a connection request sent by the Bluetooth device.
12. A device for establishing a connection of a Bluetooth device, characterized in that: Applied to a cloud server, the connection establishment device comprises: A verification module, used to receive application information sent by an alternative Bluetooth gateway, and verify whether a second key in the application information exists in the cloud server, wherein the application information is used to apply for a first key from the cloud server, wherein the first key is a key for the default Bluetooth gateway to connect to a Bluetooth device, and the second key is a key for the alternative Bluetooth gateway to connect to the Bluetooth device; a second sending module, configured to send the first key to the alternative Bluetooth gateway if the second key exists in the cloud server; The third sending module is used to send key verification failure information to the alternative Bluetooth gateway if the second key does not exist in the cloud server, and the key verification failure information is used to indicate that the second key does not exist in the cloud server.
13. A connection establishment device for a Bluetooth device, characterized in that: Applied to the default Bluetooth gateway, the connection establishment device includes: A second receiving module is used to receive a channel occupancy query instruction sent by the cloud server, wherein the channel occupancy query instruction is used to query the occupancy of the connection channel of the default Bluetooth gateway; the channel occupancy query instruction is sent by the cloud server in response to the application information sent by the alternative Bluetooth gateway, after determining that the second key exists in the cloud server, and the application information is sent by the alternative Bluetooth gateway after determining that the default Bluetooth gateway is abnormal based on the heartbeat packet; the second key is the key for the alternative Bluetooth gateway to connect to the Bluetooth device; A generating module, used for generating channel occupancy feedback information according to the channel occupancy query instruction, wherein the channel occupancy feedback information is used for indicating the connection channel occupancy of the default Bluetooth gateway; A fourth sending module, configured to send the channel occupancy feedback information to the cloud server so that the cloud server sends a first key to the alternative Bluetooth gateway, where the first key is a key for the default Bluetooth gateway to connect to a Bluetooth device; The fourth sending module is further used to send a heartbeat packet to the candidate Bluetooth gateway.
14. An electronic device, characterized in that: include: Processor, memory, and interactive interface; The memory is used to store programs and data, and the processor calls the program stored in the memory to execute the connection establishment method of the Bluetooth device according to any one of claims 1, 2, 8 to 9.
15. A server, characterized in that: include: Processor, memory, and interactive interface; The memory is used to store programs and data, and the processor calls the program stored in the memory to execute the connection establishment method of the Bluetooth device according to any one of claims 3 to 7.
16. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for establishing a connection of a Bluetooth device according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Gateway switching and binding method and device for Internet of Things terminal
CN112543457A
Gateway recovery method and device for smart home system
CN113014459A