Bluetooth connection method and device, equipment and storage medium
By using the NFC module to receive wireless signals from mobile devices in Bluetooth devices, triggering the Bluetooth module to shorten the broadcast cycle, quickly establish a Bluetooth connection, and restore to low-power mode after the operation is completed, solving the problem of long connection time of existing Bluetooth devices, improving user experience and reducing power consumption.
Patent Information
- Application Number
- CN202510268077.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-07
- Publication Date
- 2025-05-30
AI Technical Summary
In the case of battery power, existing Bluetooth devices set a longer broadcast cycle in order to extend the battery life, resulting in a longer connection time between device discovery and Bluetooth, reducing the user experience.
Receive wireless signals sent by mobile devices through the NFC module, send a trigger signal to the Bluetooth module of the Bluetooth device, shorten the broadcast cycle of the Bluetooth signal to quickly establish a Bluetooth connection; after the operation command is completed, restore the Bluetooth module to the default mode (off mode or low power mode).
On the basis of ensuring user experience, the power consumption of the device is reduced, the speed of Bluetooth connection is increased, and the power consumption is reduced in standby state.
Smart Images

Figure CN120076071A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet of Things device control, and particularly to a Bluetooth connection method, device, equipment and storage medium. Background Art
[0002] The power consumption and connection speed of Bluetooth devices are key points in development. Especially for battery-powered Bluetooth devices, how to extend the battery usage time is a widely concerned issue. In the prior art, to reduce power consumption, a longer broadcast period is set for Bluetooth devices to reduce the broadcast packet sending frequency, thereby extending the battery service life. However, this will result in a longer device discovery and Bluetooth connection time, and users may need to wait for several seconds to complete the Bluetooth connection, reducing the user experience. Summary of the Invention
[0003] In view of this, the purpose of the present invention is to provide a Bluetooth connection method, device, equipment and storage medium, which can reduce the device power consumption on the basis of ensuring the user experience. The specific scheme is as follows:
[0004] In a first aspect, the present application discloses a Bluetooth connection method applied to a battery-powered Bluetooth device, including:
[0005] Receiving a wireless signal sent by a mobile device through an NFC module, and sending a trigger signal to the Bluetooth module of the Bluetooth device according to the wireless signal;
[0006] The Bluetooth module shortens the broadcast period of the Bluetooth signal according to the trigger signal, so that the mobile device can establish a Bluetooth connection with the Bluetooth device through the Bluetooth signal;
[0007] Obtaining an operation instruction sent by the mobile device through the Bluetooth connection, and restoring the Bluetooth module to the default mode after the operation instruction is executed; the default mode is the off mode or the low power consumption mode.
[0008] Optionally, the sending a trigger signal to the Bluetooth module of the Bluetooth device according to the wireless signal includes:
[0009] The NFC module sends Bluetooth trigger information to the control unit of the Bluetooth device according to the wireless signal;
[0010] The control unit sends a trigger signal to the Bluetooth module according to the Bluetooth trigger information.
[0011] Optionally, the control unit sending a trigger signal to the Bluetooth module according to the Bluetooth trigger information includes:
[0012] The control unit determines the current mode of the Bluetooth module;
[0013] If the current mode is the off mode, start the Bluetooth module, and send a trigger signal to the Bluetooth module according to the Bluetooth trigger information after the Bluetooth module is started;
[0014] If the current mode is the low power consumption mode, directly send a trigger signal to the Bluetooth module according to the Bluetooth trigger information.
[0015] Optionally, the control unit is connected to the Bluetooth module through input / output pins; the control unit sending a trigger signal to the Bluetooth module according to the Bluetooth trigger information includes:
[0016] The control unit sends a trigger signal to the Bluetooth module by adjusting the level of the pin corresponding to the Bluetooth module.
[0017] Optionally, the Bluetooth device is a smart door lock; the operation instruction is an unlocking instruction;
[0018] Correspondingly, obtaining the operation instruction sent by the mobile device through the Bluetooth connection includes:
[0019] Obtain the unlocking instruction sent by the mobile device through the Bluetooth connection, and authenticate the unlocking instruction;
[0020] If the mobile device passes the authentication, control the door lock to unlock according to the unlocking instruction.
[0021] Optionally, the Bluetooth connection method further includes:
[0022] Establish a Bluetooth connection with a Bluetooth gateway through the Bluetooth module;
[0023] After the operation instruction is executed, send the corresponding operation event to the Bluetooth gateway, and use the Bluetooth gateway to report the operation event to the server, so that the client can obtain the operation event through the server.
[0024] Optionally, the Bluetooth module shortens the broadcast period of the Bluetooth signal according to the trigger signal, so that the mobile device can establish a Bluetooth connection with the Bluetooth device through the Bluetooth signal, including:
[0025] The Bluetooth module adjusts the broadcast period of the Bluetooth signal to below the target duration according to the trigger signal, so that the mobile device can quickly establish a Bluetooth connection with the Bluetooth device through the Bluetooth signal;
[0026] The broadcast period duration of the Bluetooth module in the low power consumption mode is greater than the target duration.
[0027] Second aspect, the present application discloses a Bluetooth connection device, which is applied to a battery-powered Bluetooth device and includes:
[0028] A wireless signal receiving module, configured to receive a wireless signal sent by a mobile device through an NFC module, and send a trigger signal to a Bluetooth module of the Bluetooth device according to the wireless signal;
[0029] A broadcast period adjustment module, configured to cause the Bluetooth module to shorten the broadcast period of Bluetooth signals according to the trigger signal, so that the mobile device can establish a Bluetooth connection with the Bluetooth device through the Bluetooth signals;
[0030] A Bluetooth mode recovery module, configured to obtain an operation instruction sent by the mobile device through the Bluetooth connection, and restore the Bluetooth module to a default mode after executing the operation instruction; the default mode is a shutdown mode or a low-power mode.
[0031] Third aspect, the present application discloses an electronic device, including:
[0032] A memory, configured to store a computer program;
[0033] A processor, configured to execute the computer program to implement the foregoing Bluetooth connection method.
[0034] Fourth aspect, the present application discloses a computer-readable storage medium, configured to store a computer program; wherein the computer program, when executed by a processor, implements the foregoing Bluetooth connection method.
[0035] In the present application, a wireless signal sent by a mobile device is received through an NFC module, and a trigger signal is sent to a Bluetooth module of the Bluetooth device according to the wireless signal; the Bluetooth module shortens the broadcast period of Bluetooth signals according to the trigger signal, so that the mobile device can establish a Bluetooth connection with the Bluetooth device through the Bluetooth signals; an operation instruction sent by the mobile device is obtained through the Bluetooth connection, and the Bluetooth module is restored to a default mode after executing the operation instruction; the default mode is a shutdown mode or a low-power mode. It can be seen that when it is necessary to establish a Bluetooth connection with a Bluetooth device, the Bluetooth device is notified to shorten the broadcast period of Bluetooth signals, that is, to increase the broadcast packet sending frequency, which facilitates the mobile device to quickly discover the device, thereby quickly establishing a connection with the Bluetooth device. After the instruction is executed, the Bluetooth module is restored to the default mode. In the default mode, Bluetooth does not consume power or consumes low power to reduce standby power consumption; moreover, the NFC trigger mechanism is used to dynamically adjust the Bluetooth broadcast frequency, so that the Bluetooth device enters the fast broadcast mode when needed, and then is restored to the default mode after the instruction is executed. The NFC module in the Bluetooth device does not need to be powered as a passive party, further reducing the overall power consumption. Description of the Drawings
[0036] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can also be obtained according to the provided drawings.
[0037] Figure 1 It is a flowchart of a Bluetooth connection method provided by this application;
[0038] Figure 2 It is a flowchart of a specific Bluetooth connection method provided by this application;
[0039] Figure 3 It is a schematic structural diagram of a Bluetooth connection device provided by this application;
[0040] Figure 4 It is a structural diagram of an electronic device provided by this application. Specific Embodiments
[0041] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some of the embodiments of the present invention, rather than all of them. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.
[0042] In the prior art, to reduce power consumption, a longer broadcast period is set for Bluetooth devices to reduce the broadcast packet sending frequency, thereby extending the battery life. However, this will result in a longer device discovery and Bluetooth connection time. Users may need to wait for several seconds to complete the Bluetooth connection, reducing the user experience. To overcome the above technical problems, this application proposes a Bluetooth connection method.
[0043] An embodiment of this application discloses a Bluetooth connection method. Refer to Figure 1 As shown, the method may include the following steps:
[0044] Step S11: Receive a wireless signal sent by a mobile device through the NFC module, and send a trigger signal to the Bluetooth module of the Bluetooth device according to the wireless signal.
[0045] In this embodiment, the Bluetooth module in the Bluetooth device is in the off mode by default; or in the low-power mode to reduce power consumption. At this time, the Bluetooth broadcast period is long (such as 1.28 seconds), and it takes a long time to establish a Bluetooth connection. To improve the Bluetooth connection speed between the user's mobile device and the Bluetooth device in this embodiment, the Bluetooth device is first notified to increase the broadcast frequency through NFC (Near Field Communication). Specifically, after the NFC module of the Bluetooth device receives the wireless signal sent by the NFC module of the mobile device, the NFC module of the Bluetooth device sends a trigger signal to the Bluetooth module of the Bluetooth device according to the wireless signal to notify the Bluetooth module that the broadcast period needs to be adjusted. The NFC module of the Bluetooth device is the passive party and does not require power supply from the Bluetooth device.
[0046] In some embodiments, sending the trigger signal to the Bluetooth module of the Bluetooth device according to the wireless signal may include: the NFC module sending Bluetooth trigger information to the control unit of the Bluetooth device according to the wireless signal; the control unit sending a trigger signal to the Bluetooth module according to the Bluetooth trigger information. That is, the trigger of the Bluetooth module is specifically implemented through the control unit. The NFC module first sends Bluetooth trigger information to the control unit of the Bluetooth device to notify the control unit to execute the control of the Bluetooth module, and the control unit sends a trigger signal to the Bluetooth module according to the Bluetooth trigger information.
[0047] The control unit sending the trigger signal to the Bluetooth module according to the Bluetooth trigger information may include: the control unit determining the current mode of the Bluetooth module; if the current mode is the off mode, starting the Bluetooth module, and after the Bluetooth module is started, sending the trigger signal to the Bluetooth module according to the Bluetooth trigger information; that is, the Bluetooth module needs to be started first, and then the Bluetooth module is controlled to adjust the broadcast period. If the current mode is the low-power mode, directly sending the trigger signal to the Bluetooth module according to the Bluetooth trigger information.
[0048] In some embodiments, the control unit is connected to the Bluetooth module through input / output pins; the control unit sending the trigger signal to the Bluetooth module according to the Bluetooth trigger information includes: the control unit sending the trigger signal to the Bluetooth module by adjusting the level of the pin corresponding to the Bluetooth module. The pin of the control unit is connected to the pin of the Bluetooth module, and the trigger is achieved by changing the level of the pin, such as raising the level from low to high.
[0049] Step S12: The Bluetooth module shortens the broadcast period of the Bluetooth signal according to the trigger signal, so that the mobile device can establish a Bluetooth connection with the Bluetooth device through the Bluetooth signal.
[0050] After the Bluetooth module receives the trigger signal, it shortens its own advertising cycle, that is, increases the advertising frequency, so that the user can discover and connect more quickly. For example, after the Bluetooth module receives the trigger signal, it switches to the fast advertising mode, and the advertising cycle is adjusted to a shorter value (such as 20 milliseconds) to facilitate the mobile phone to quickly discover the device.
[0051] In some embodiments, the Bluetooth module shortens the advertising cycle of the Bluetooth signal according to the trigger signal, so that the mobile device establishes a Bluetooth connection with the Bluetooth device through the Bluetooth signal, including: the Bluetooth module adjusts the advertising cycle of the Bluetooth signal to be below the target duration according to the trigger signal, so that the mobile device quickly establishes a Bluetooth connection with the Bluetooth device through the Bluetooth signal; the advertising cycle duration of the Bluetooth module in the low power consumption mode is greater than the target duration. That is, the target duration (such as 30 milliseconds) can be set in advance. After the Bluetooth module receives the trigger signal, it adjusts the Bluetooth advertising cycle to at least the target duration and below. By defining the target duration, it is ensured that when the mobile device needs to connect, the Bluetooth device broadcasts at a high frequency so as to be discovered by the mobile device in time.
[0052] Specifically, the above-mentioned Bluetooth module shortening the advertising cycle of the Bluetooth signal according to the trigger signal may include: obtaining the current remaining power of the Bluetooth device; querying the pre-created power partition table to determine the target power range corresponding to the current remaining power; querying the mapping relationship between the power partition and the advertising cycle duration pre-created to determine the advertising cycle duration corresponding to the target power range as the target duration; the more the remaining power, the shorter the advertising cycle duration. Of course, the function relationship between the remaining power and the advertising cycle duration can also be directly constructed in advance, and in the function relationship, the more the remaining power, the shorter the advertising cycle duration. That is, when the remaining power is sufficient, a higher frequency can be used for Bluetooth advertising so as to be discovered by the mobile device more quickly. When the remaining power is not sufficient, a slightly higher frequency can be used for Bluetooth advertising to improve the connection speed as much as possible on the basis of avoiding excessive power consumption.
[0053] Step S13: Obtain the operation instruction sent by the mobile device through the Bluetooth connection, and restore the Bluetooth module to the default mode after completing the execution of the operation instruction; the default mode is the off mode or the low power consumption mode.
[0054] After Bluetooth is established, receive the operation instructions sent by the mobile device via Bluetooth connection, so that the device can perform corresponding operations according to the operations; after the operations are completed, restore the Bluetooth mode of the device to the default mode to avoid power consumption in the high-frequency broadcast mode for a long time. Specifically, restoring the Bluetooth module to the default mode includes: obtaining the current remaining power of the Bluetooth device; if the current remaining power is greater than or equal to the preset power threshold, adjust the Bluetooth module to the low-power mode; if the current remaining power is less than the preset power threshold, adjust the Bluetooth module to the off mode. This can avoid potential security risks caused by the Bluetooth being in the broadcast mode for a long time and being maliciously scanned or attempted to be connected.
[0055] The above mobile device can be a mobile device using the IOS system. It can be understood that in many scenarios, the IOS system only supports reading NFC data exchange format tags, rather than direct data transmission between devices. For example, IOS devices can read the information in NFC tags, but do not support file transfer or data sharing between devices via NFC like Android devices. This results in the IOS system being unable to interact with other devices using NFC. For example, an IOS device cannot use NFC to unlock a smart door lock because it cannot transmit the door lock unlocking data. Instead, in this embodiment, NFC is first used to trigger Bluetooth only, and then the device is unlocked via Bluetooth after the Bluetooth connection is established.
[0056] Among them, the above Bluetooth connection method further includes: establishing a Bluetooth connection with a Bluetooth gateway through the Bluetooth module; after the operation instructions are executed, sending the corresponding operation event to the Bluetooth gateway, and using the Bluetooth gateway to report the operation event to the server, so that the client can obtain the operation event through the server. The Bluetooth gateway can be installed on other devices that are not Bluetooth devices but can be connected to Bluetooth devices via Bluetooth. By reporting the occurred operation events to the server through the Bluetooth gateway, the server can notify the user in a timely manner through the client application, and it is also convenient for the user to view the occurred operation events in real time through the client application at any time. In addition, the connection between the Bluetooth module and the Bluetooth gateway can be established in the low-power mode or after the Bluetooth module is started. The Bluetooth module continuously sends broadcast packets to enable the Bluetooth gateway to discover and establish a connection.
[0057] In a specific embodiment, the above Bluetooth device is a smart door lock; the operation instruction is an unlocking instruction. The Bluetooth connection system includes: a smart door lock main body and a client application (App). The smart door lock main body includes a lock body mechanical part, a control unit, a Bluetooth module, an NFC module, and a power supply. The Bluetooth module is a chip that supports Bluetooth Low Energy (BLE) communication and is used for broadcasting, connection, and unlocking command processing; the NFC module is used to receive the approaching signal from the mobile phone and notify the Bluetooth module; the power supply module is powered by a battery to ensure low-power operation; the mobile phone application (App) is used to discover Bluetooth devices, initiate connections, and send unlocking instructions. When the user's mobile phone approaches the door lock, the NFC module built into the mobile phone communicates with the NFC module on the door lock. After the NFC module of the Bluetooth device senses the mobile phone signal passively, it sends a trigger signal to the Bluetooth module. The NFC module does not require external power supply for the door lock, reducing the overall power consumption. Correspondingly, obtaining the operation instruction sent by the mobile device through the Bluetooth connection includes: obtaining the unlocking instruction sent by the mobile device through the Bluetooth connection and authenticating the unlocking instruction; if the mobile device passes the authentication, the door lock is controlled to unlock according to the unlocking instruction. That is, after the mobile phone scans the Bluetooth broadcast signal of the door lock through the App, it initiates a connection request. The Bluetooth module of the door lock completes the pairing connection with the mobile phone through the handshake protocol. The mobile phone sends an unlocking instruction through Bluetooth, and the door lock verifies the identity of the mobile phone. After the verification is passed, the door lock executes the unlocking action and sends a feedback signal to the Bluetooth module. After the unlocking operation is completed, the Bluetooth module returns to the low-power broadcast mode to reduce the standby power consumption.
[0058] For example Figure 2 The figure shows a flowchart of a specific battery-powered smart door lock Bluetooth connection method. The low-power Bluetooth module establishes a connection with the Bluetooth gateway in the low-power mode. When the mobile device approaches, the NFC of the Bluetooth device responds and sends trigger information to the control unit (such as an MCU (Microcontroller Unit)), and the control unit notifies the Bluetooth module. The Bluetooth module shortens the broadcast period, establishes a Bluetooth connection with the mobile device, receives the unlocking request sent by the mobile device through the Bluetooth connection, forwards the unlocking request to the control unit. After the control unit passes the verification, it executes the unlocking operation and sends the unlocking success message to the Bluetooth module. The Bluetooth module feeds back the unlocking success message to the client application of the mobile device so that the user can disconnect the Bluetooth. Finally, the Bluetooth module reports the unlocking event to the server through the Bluetooth gateway.
[0059] The intelligent control method triggered by combining Bluetooth Low Energy communication and Near Field Communication (NFC) is used to optimize the connection speed and power consumption performance of Bluetooth devices. It is applicable to the application scenarios of smart door locks and other Bluetooth devices that require low-power operation and fast connection response, such as battery-powered sensors.
[0060] As can be seen from the above, in this embodiment, the NFC module receives the wireless signal sent by the mobile device, and sends a trigger signal to the Bluetooth module of the Bluetooth device according to the wireless signal; the Bluetooth module shortens the broadcast period of the Bluetooth signal according to the trigger signal, so that the mobile device can establish a Bluetooth connection with the Bluetooth device through the Bluetooth signal; the operation instruction sent by the mobile device is obtained through the Bluetooth connection, and the Bluetooth module is restored to the default mode after the operation instruction is executed; the default mode is the off mode or the low-power mode. It can be seen that when it is necessary to establish a Bluetooth connection with the Bluetooth device, the Bluetooth device is notified to shorten the broadcast period of the Bluetooth signal, that is, to increase the broadcast packet sending frequency, which is convenient for the mobile device to quickly discover the device, so that the connection with the Bluetooth device can be quickly established. After the instruction is executed, the Bluetooth module is restored to the default mode. In the default mode, the Bluetooth does not consume power or consumes low power, so as to reduce the standby power consumption; moreover, the NFC trigger mechanism is used to dynamically adjust the Bluetooth broadcast frequency, so that the Bluetooth device enters the fast broadcast mode when needed, and is restored to the default mode after the instruction is executed. The NFC module in the Bluetooth device does not need to be powered as a passive party, further reducing the overall power consumption.
[0061] Correspondingly, an embodiment of the present application also discloses a Bluetooth connection device, which is applied to a battery-powered Bluetooth device. See Figure 3 As shown, the device includes:
[0062] A wireless signal receiving module 11, configured to receive the wireless signal sent by the mobile device through the NFC module, and send a trigger signal to the Bluetooth module of the Bluetooth device according to the wireless signal;
[0063] A broadcast period adjustment module 12, configured to shorten the broadcast period of the Bluetooth signal by the Bluetooth module according to the trigger signal, so that the mobile device can establish a Bluetooth connection with the Bluetooth device through the Bluetooth signal;
[0064] A Bluetooth mode restoration module 13, configured to obtain the operation instruction sent by the mobile device through the Bluetooth connection, and restore the Bluetooth module to the default mode after the operation instruction is executed; the default mode is the off mode or the low-power mode.
[0065] As can be seen from the above, in this embodiment, the NFC module receives a wireless signal sent by a mobile device, and sends a trigger signal to the Bluetooth module of the Bluetooth device according to the wireless signal; the Bluetooth module shortens the broadcast period of the Bluetooth signal according to the trigger signal, so that the mobile device can establish a Bluetooth connection with the Bluetooth device through the Bluetooth signal; obtain the operation instruction sent by the mobile device through the Bluetooth connection, and restore the Bluetooth module to the default mode after the operation instruction is executed; the default mode is the off mode or the low-power mode. It can be seen that when it is necessary to establish a Bluetooth connection with a Bluetooth device, the Bluetooth device is notified to shorten the broadcast period of the Bluetooth signal, that is, to increase the broadcast packet sending frequency, which is convenient for the mobile device to quickly discover the device, so that the connection with the Bluetooth device can be quickly established. After the instruction is executed, the Bluetooth module is restored to the default mode. In the default mode, Bluetooth does not consume power or consumes low power to reduce standby power consumption; moreover, the NFC trigger mechanism is used to dynamically adjust the Bluetooth broadcast frequency, so that the Bluetooth device enters the fast broadcast mode when needed, and then returns to the default mode after the instruction is executed. The NFC module in the Bluetooth device does not need to be powered as a passive party, further reducing the overall power consumption.
[0066] In some specific embodiments, the wireless signal receiving module 11 may specifically include:
[0067] A Bluetooth trigger information sending unit, configured to send Bluetooth trigger information from the NFC module to the control unit of the Bluetooth device according to the wireless signal;
[0068] A trigger signal sending unit, configured to send a trigger signal from the control unit to the Bluetooth module according to the Bluetooth trigger information.
[0069] In some specific embodiments, the trigger signal sending unit may specifically include:
[0070] A mode determination unit, configured to determine the current mode of the Bluetooth module by the control unit;
[0071] A first trigger signal sending unit, configured to start the Bluetooth module if the current mode is the off mode, and send a trigger signal to the Bluetooth module according to the Bluetooth trigger information after the Bluetooth module is started;
[0072] A second trigger signal sending unit, configured to directly send a trigger signal to the Bluetooth module according to the Bluetooth trigger information if the current mode is the low-power mode.
[0073] In some specific embodiments, the control unit is connected to the Bluetooth module through input / output pins; the wireless signal receiving module 11 may specifically include:
[0074] A level adjustment unit is used for the control unit to send a trigger signal to the Bluetooth module by adjusting the level of the pin corresponding to the Bluetooth module.
[0075] In some specific embodiments, the Bluetooth device is an intelligent door lock; the operation instruction is an unlocking instruction; the Bluetooth mode recovery module 13 may specifically include:
[0076] An authentication unit is used to obtain the unlocking instruction sent by the mobile device through the Bluetooth connection and authenticate the unlocking instruction.
[0077] An unlocking unit is used to control the door lock to unlock according to the unlocking instruction if the mobile device passes the authentication.
[0078] In some specific embodiments, the Bluetooth connection device may specifically include:
[0079] A gateway connection unit is used to establish a Bluetooth connection with a Bluetooth gateway through the Bluetooth module.
[0080] An event reporting unit is used to send the corresponding operation event to the Bluetooth gateway after the operation instruction is executed, and use the Bluetooth gateway to report the operation event to the server, so that the client can obtain the operation event through the server.
[0081] In some specific embodiments, the broadcast period adjustment module 12 may specifically include:
[0082] A broadcast period adjustment unit is used for the Bluetooth module to adjust the broadcast period of the Bluetooth signal to be below the target duration according to the trigger signal, so that the mobile device can quickly establish a Bluetooth connection with the Bluetooth device through the Bluetooth signal; the broadcast period duration of the Bluetooth module in the low power consumption mode is greater than the target duration.
[0083] Furthermore, the embodiments of the present application also disclose an electronic device. Refer to Figure 4 As shown, the content in the figure cannot be considered as any limitation to the scope of use of the present application.
[0084] Figure 4 It is a schematic structural diagram of an electronic device 20 provided by the embodiments of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the Bluetooth connection method disclosed in any of the foregoing embodiments.
[0085] In this embodiment, the power supply 23 is used to provide operating voltages for the various hardware devices on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and specific limitations thereof are not provided herein; the input / output interface 25 is used to obtain external input data or output data to the outside, and its specific interface type can be selected according to specific application requirements, and specific limitations thereof are not provided herein.
[0086] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, a random access memory, a magnetic disk, an optical disk, etc. The resources stored thereon include an operating system 221, a computer program 222, and data 223 including trigger signals, etc., and the storage method can be temporary storage or permanent storage.
[0087] Among them, the operating system 221 is used to manage and control the various hardware devices and the computer program 222 on the electronic device 20 to enable the processor 21 to perform operations and processing on the massive data 223 in the memory 22. It can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the Bluetooth connection method executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 can further include computer programs that can be used to complete other specific tasks.
[0088] Furthermore, an embodiment of this application also discloses a computer storage medium. Computer-executable instructions are stored in the computer storage medium. When the computer-executable instructions are loaded and executed by a processor, the steps of the Bluetooth connection method disclosed in any of the foregoing embodiments are implemented.
[0089] In this specification, the various embodiments are described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. The same or similar parts among the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method part.
[0090] The steps of the method or algorithm described in combination with the embodiments disclosed in this article can be directly implemented by hardware, software modules executed by a processor, or a combination of both. The software module can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, or any other form of storage medium well-known in the technical field.
[0091] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.
[0092] The above has introduced in detail a Bluetooth connection method, device, equipment and storage medium provided by the present invention. Specific examples are used in this text to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. A Bluetooth connection method, characterized in that: Applications: Battery-powered Bluetooth devices, including: Receiving a wireless signal sent by a mobile device through the NFC module, and sending a trigger signal to a Bluetooth module of the Bluetooth device according to the wireless signal; The Bluetooth module shortens the broadcast period of the Bluetooth signal according to the trigger signal, so that the mobile device establishes a Bluetooth connection with the Bluetooth device through the Bluetooth signal; The operation instruction sent by the mobile device is obtained through the Bluetooth connection, and the Bluetooth module is restored to a default mode after the operation instruction is executed; the default mode is a closed mode or a low power consumption mode.
2. The Bluetooth connection method according to claim 1, characterized in that: The sending a trigger signal to a Bluetooth module of the Bluetooth device according to the wireless signal comprises: The NFC module sends Bluetooth trigger information to the control unit of the Bluetooth device according to the wireless signal; The control unit sends a trigger signal to the Bluetooth module according to the Bluetooth trigger information.
3. The Bluetooth connection method according to claim 2, characterized in that: The control unit sends a trigger signal to the Bluetooth module according to the Bluetooth trigger information, including: The control unit determines a current mode of the Bluetooth module; If the current mode is the off mode, starting the Bluetooth module, and sending a trigger signal to the Bluetooth module according to the Bluetooth trigger information after the Bluetooth module is started; If the current mode is the low power consumption mode, a trigger signal is directly sent to the Bluetooth module according to the Bluetooth trigger information.
4. The Bluetooth connection method according to claim 2, characterized in that: The control unit is connected to the Bluetooth module via input and output pins; the control unit sends a trigger signal to the Bluetooth module according to the Bluetooth trigger information, including: The control unit sends a trigger signal to the Bluetooth module by adjusting the level of the pin corresponding to the Bluetooth module.
5. The Bluetooth connection method according to claim 1, characterized in that: The Bluetooth device is a smart door lock; the operation instruction is an unlocking instruction; Correspondingly, obtaining the operation instruction sent by the mobile device through the Bluetooth connection includes: Acquire an unlock instruction sent by the mobile device through the Bluetooth connection, and authenticate the unlock instruction; If the mobile device passes the identity authentication, the door lock is controlled to unlock according to the unlock instruction.
6. The Bluetooth connection method according to claim 1, characterized in that: Also includes: Establishing a Bluetooth connection with a Bluetooth gateway through the Bluetooth module; After the operation instruction is executed, the corresponding operation event is sent to the Bluetooth gateway, and the Bluetooth gateway is used to report the operation event to the server, so that the client can obtain the operation event through the server.
7. The Bluetooth connection method according to claim 1, characterized in that: The Bluetooth module shortens the broadcast period of the Bluetooth signal according to the trigger signal so that the mobile device establishes a Bluetooth connection with the Bluetooth device through the Bluetooth signal, including: The Bluetooth module adjusts the broadcast period of the Bluetooth signal to less than the target duration according to the trigger signal, so that the mobile device quickly establishes a Bluetooth connection with the Bluetooth device through the Bluetooth signal; The broadcast cycle duration of the Bluetooth module in the low power consumption mode is greater than the target duration.
8. A Bluetooth connection device, characterized in that: Applications: Battery-powered Bluetooth devices, including: A wireless signal receiving module, used to receive a wireless signal sent by a mobile device through the NFC module, and send a trigger signal to a Bluetooth module of the Bluetooth device according to the wireless signal; a broadcast cycle adjustment module, used for the Bluetooth module to shorten the broadcast cycle of the Bluetooth signal according to the trigger signal, so that the mobile device can establish a Bluetooth connection with the Bluetooth device through the Bluetooth signal; The Bluetooth mode recovery module is used to obtain the operation instruction sent by the mobile device through the Bluetooth connection, and restore the Bluetooth module to the default mode after executing the operation instruction; the default mode is the off mode or the low power consumption mode.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the Bluetooth connection method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein when the computer programs are executed by a processor, the Bluetooth connection method according to any one of claims 1 to 7 is implemented.