Bluetooth communication method, electronic device, storage medium, and chip system

By increasing the frequency of interaction and switching interaction modes between Bluetooth devices, the problem of easy Bluetooth connection drops has been solved, improving communication stability and user experience.

WO2026036820A1PCT designated stage Publication Date: 2026-02-19HONOR DEVICE CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/095238
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-08-16
Filing Date
2025-05-15
Publication Date
2026-02-19

AI Technical Summary

Technical Problem

Bluetooth connections are prone to disconnection, affecting user experience, especially in situations with poor signal strength and strong environmental interference.

Method used

Communication can be stabilized by increasing the frequency of interactions between Bluetooth devices, including switching to a higher frequency interaction mode or increasing the number of interaction attempts when signal quality is poor.

Benefits of technology

It improves the success rate of communication between Bluetooth devices, reduces the probability of connection drops, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025095238_19022026_PF_FP_ABST
    Figure CN2025095238_19022026_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present application relate to the technical field of terminals, and provide a Bluetooth communication method, an electronic device, a storage medium, and a chip system. The method comprises: when the signal strength is poor and / or the ambient interference is strong, the possibility of successful Bluetooth interaction can be improved by increasing the number of Bluetooth interaction attempts between Bluetooth devices, i.e., increasing the frequency of interaction between the Bluetooth devices, so that the Bluetooth devices can communicate stably, thereby improving user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Bluetooth communication method, electronic device, storage medium and chip system

[0001] The present application claims priority to the Chinese patent application No. 202411132934.0, filed on August 16, 2024, and entitled "Bluetooth communication method, electronic device, storage medium and chip system", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD

[0002] The present application relates to the technical field of terminals, and in particular to a Bluetooth communication method, an electronic device, a storage medium and a chip system. BACKGROUND

[0003] Some electronic devices can communicate through Bluetooth, and the electronic devices can include mobile phones, watches, bracelets, earphones, etc. For example, a mobile phone can establish a connection with a watch, a bracelet or an earphone through Bluetooth and perform Bluetooth communication.

[0004] However, in some scenarios, the two electronic devices that establish a Bluetooth connection can easily disconnect the Bluetooth connection, thereby affecting Bluetooth communication and reducing user experience. SUMMARY

[0005] The Bluetooth communication method, the electronic device, the storage medium and the chip system provided by the embodiments of the present application can increase the number of attempts for Bluetooth interaction, i.e., increase the interaction frequency between Bluetooth devices, when the signal strength is poor and / or the surrounding environment interference is strong, to improve the possibility of successful Bluetooth interaction, so that the Bluetooth devices can stably communicate, thereby improving user experience.

[0006] In a first aspect, the embodiments of the present application provide a Bluetooth communication method, and the method comprises:

[0007] A first electronic device establishes a Bluetooth connection with a second electronic device; at a first time, the first electronic device sends Bluetooth data to the second electronic device at a first frequency; at a second time, the first electronic device sends Bluetooth data to the second electronic device at a second frequency, which is switched from the first frequency; wherein the second time is later than the first time, the second frequency is higher than the first frequency, and the signal quality between the first electronic device and the second electronic device corresponding to the second time is worse than the signal quality between the first electronic device and the second electronic device corresponding to the first time. When the signal quality is poor, the electronic device can increase the interaction frequency between Bluetooth devices to improve the possibility of successful Bluetooth interaction, so that the Bluetooth devices can stably communicate, thereby improving user experience.

[0008] In a possible implementation, the first frequency is one frequency used when the first electronic device is in a first mode; the second frequency is another frequency used when the first electronic device is in the first mode, or the second frequency is one frequency used when the first electronic device is in a second mode; and the interaction frequency between the first electronic device and the second electronic device in the second mode is greater than the interaction frequency between the first electronic device and the second electronic device in the first mode. In the second mode, because data transmission needs to be performed between the first electronic device and the second electronic device, the interaction frequency is relatively high, which can improve the communication capability between the first electronic device and the second electronic device. When the communication quality between the first electronic device and the second electronic device is poor, increasing the interaction frequency between the electronic devices can improve the possibility of successful Bluetooth interaction, thereby increasing the communication distance between the electronic devices.

[0009] In a possible implementation, the method further includes: at a third time, switching the frequency of the first electronic device sending Bluetooth data to the second electronic device from the second frequency to a third frequency; and the signal quality between the first electronic device and the second electronic device at the third time is better than the signal quality between the first electronic device and the second electronic device at the second time. When the signal quality between the first electronic device and the second electronic device becomes better, the frequency of Bluetooth data interaction between the first electronic device and the second electronic device can also be adjusted. In this way, the frequency of Bluetooth data interaction between the first electronic device and the second electronic device can be flexibly adjusted according to changes in the actual environment, the communication quality between the first electronic device and the second electronic device is improved, and therefore the user experience is improved.

[0010] In a possible implementation, at the third time, the first electronic device is in the second mode, and the third frequency is greater than or equal to the second frequency; or at the third time, the first electronic device is in the first mode, and the third frequency is less than or equal to the second frequency. When the first electronic device is in the second mode, it indicates that there is service data interaction between the first electronic device and the second electronic device, and the third frequency can be set as the frequency corresponding to the Active mode, so that the data interaction between the electronic devices is not affected, and normal service communication can be performed. When the second frequency is the frequency of the first mode, if the performance of the first electronic device is good, the third frequency can be equal to the second frequency, so that the interaction interval between the electronic devices is shortened, the number of attempts of Bluetooth interaction is increased, and the accuracy of the detection result is improved. If the performance of the first electronic device is poor, the third frequency can be less than the second frequency, so that the interaction interval between the electronic devices is prolonged, and the influence on the performance of the electronic device is reduced.

[0011] In a possible implementation, the first mode includes a Sniff mode in Bluetooth communication, and the second mode includes an Active mode in Bluetooth communication. In the Sniff mode, the interaction frequency between the Bluetooth devices can be increased by increasing the number of attempts of Bluetooth interaction between the Bluetooth devices, the Bluetooth connection between the Bluetooth devices can be reduced, and the user experience can be improved. In the Active mode, the electronic devices can interact with business data, so that normal business communication can be performed. Therefore, in different scenarios, selecting appropriate modes and reasonable interaction frequencies can improve the communication quality between the electronic devices.

[0012] In a possible implementation, the signal quality between the first electronic device and the second electronic device includes one or more of the following: a received signal strength indication (RSSI) between the first electronic device and the second electronic device, and a number of available channels between the first electronic device and the second electronic device. The signal quality between the first electronic device and the second electronic device can be determined based on the RSSI and / or the number of available channels, so that the interaction frequency between the first electronic device and the second electronic device can be adjusted flexibly according to the signal quality, thereby improving the communication stability between the first electronic device and the second electronic device.

[0013] In a possible implementation, the signal quality between the first electronic device and the second electronic device at the second time is worse than the signal quality between the first electronic device and the second electronic device at the first time, including: a received signal strength indication (RSSI) value between the first electronic device and the second electronic device at the second time is less than a received signal strength indication (RSSI) value between the first electronic device and the second electronic device at the first time; and / or, a number of available channels between the first electronic device and the second electronic device at the second time is less than a number of available channels between the first electronic device and the second electronic device at the first time. In this way, the strength of the signal can be determined according to the change trend of the signal strength (RSSI) in a period of time, so that the inaccurate judgment caused by the abnormal jump of the received signal strength indication (RSSI) value can be reduced. Similarly, the strength of the environmental interference can be determined according to the change trend of the number of available channels in a period of time, so that the inaccurate judgment caused by the abnormal jump of the number of available channels can be reduced, thereby making the judgment result more stable and more accurate.

[0014] In a possible implementation manner, the signal quality between the first electronic device and the second electronic device at the second time point is worse than the signal quality between the first electronic device and the second electronic device at the first time point, including: a received signal strength indication (RSSI) value between the first electronic device and the second electronic device at the second time point is less than a first threshold value, and a received signal strength indication (RSSI) value between the first electronic device and the second electronic device at the first time point is greater than or equal to the first threshold value; and / or, the number of available channels between the first electronic device and the second electronic device at the second time point is less than a second threshold value, and the number of available channels between the first electronic device and the second electronic device at the first time point is greater than or equal to the second threshold value. Using the first threshold value can more intuitively and conveniently determine the strength of the signal strength, and using the second threshold value can also more conveniently and intuitively determine the strength of the environmental interference. Moreover, using the threshold value can make the code easier to implement, and the electronic device can flexibly adjust the value of the threshold value according to specific actual conditions, thereby adapting to different application scenarios.

[0015] In a second aspect, an embodiment of the present application provides a device for Bluetooth communication. The device can be an electronic device, or a chip or chip system in the electronic device. The device can include a processing unit. The processing unit is configured to implement any method related to processing performed by the electronic device in the first aspect or any possible implementation manner of the first aspect. When the device is an electronic device, the processing unit can be a processor. The device can further include a storage unit, which can be a memory. The storage unit is configured to store instructions. The processing unit executes the instructions stored in the storage unit, so that the electronic device implements the method described in the first aspect or any possible implementation manner of the first aspect. When the device is a chip or chip system in the electronic device, the processing unit can be a processor. The processing unit executes the instructions stored in the storage unit, so that the electronic device implements the method described in the first aspect or any possible implementation manner of the first aspect. The storage unit can be a storage unit (for example, a register, a cache, etc.) in the chip, or a storage unit (for example, a read-only memory, a random access memory, etc.) outside the chip in the electronic device.

[0016] In a third aspect, an embodiment of the present application provides an electronic device. The electronic device includes one or more processors and a memory. The memory is coupled to the one or more processors. The memory is configured to store computer program codes. The computer program codes include computer instructions. The one or more processors are configured to invoke the computer instructions to execute the method described in the first aspect or any possible implementation manner of the first aspect.

[0017] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program or instructions, and when the computer program or instructions are run on a computer, the computer is caused to execute the method described in the first aspect or any possible implementation manner of the first aspect.

[0018] In a fifth aspect, an embodiment of the present application provides a computer program product including a computer program, and when the computer program is run on a computer, the computer is caused to execute the method described in the first aspect or any possible implementation manner of the first aspect.

[0019] In a sixth aspect, the present application provides a chip or chip system, which includes at least one processor and a communication interface, the communication interface and the at least one processor are interconnected through a line, and the at least one processor is configured to run a computer program or instructions to execute the method described in the first aspect or any possible implementation manner of the first aspect. The communication interface in the chip can be an input / output interface, a pin or a circuit, etc.

[0020] In a possible implementation, the chip or chip system described in the present application further includes at least one memory, and the at least one memory stores instructions. The memory can be a storage unit inside the chip, such as a register, a cache, etc., or a storage unit of the chip (such as a read-only memory, a random access memory, etc.).

[0021] It should be understood that the second aspect to the sixth aspect of the present application correspond to the technical solutions of the first aspect or the second aspect of the present application, and the beneficial effects obtained by each aspect and the corresponding possible implementation manner are similar, which will not be described again. BRIEF DESCRIPTION OF DRAWINGS

[0022] FIG. 1 is a structural schematic diagram of an electronic device provided by an embodiment of the present application;

[0023] FIG. 2 is a schematic diagram of a Bluetooth protocol architecture provided by an embodiment of the present application;

[0024] FIG. 3 is a flow schematic diagram of a Bluetooth communication method provided by an embodiment of the present application;

[0025] FIG. 4 is a schematic diagram of a Bluetooth communication method provided by an embodiment of the present application;

[0026] FIG. 5 is a structural schematic diagram of a chip provided by an embodiment of the present application. DETAILED DESCRIPTION

[0027] In order to clearly describe the technical solutions of the embodiments of the present application, the following briefly introduces some terms and technologies involved in the embodiments of the present application:

[0028] 1. POLL packet and NULL packet in Bluetooth communication are common packet types in Bluetooth communication, which are generally used to manage and coordinate the transmission of Bluetooth data.

[0029] For example, the first electronic device can send a query request to the second electronic device to determine whether the second electronic device has data to send or state to update.

[0030] After the second electronic device receives the query request from the first electronic device, if the second electronic device has no data to send or no state to update, the second electronic device can return an empty response to the first electronic device, which can also be understood as a NULL packet. If the second electronic device has data to send or has state to update, the second electronic device can return data information or state information to the first electronic device.

[0031] After the first electronic device receives the response from the second electronic device, it can process the response according to the content of the response. For example, if the response includes data information or state information, the first electronic device can process the information; if the response is an empty response, the first electronic device can periodically send a query request to the second electronic device.

[0032] 2. Communication mode in Bluetooth communication:

[0033] Active mode: refers to the mode in which the Bluetooth device is in working state. In Active mode, Bluetooth devices can maintain active state and be ready for data transmission or reception at any time. In some scenarios, Active mode can also be referred to as high-frequency interaction mode. Bluetooth device can be understood as an electronic device capable of Bluetooth communication.

[0034] Sniff mode: refers to the mode in which the Bluetooth device is in low power consumption. In Sniff mode, Bluetooth devices can periodically interact to determine whether there is data to be transmitted or received. In some scenarios, Sniff mode can also be referred to as low-frequency interaction mode.

[0035] It can be understood that the interaction frequency between Bluetooth devices in Active mode is greater than the interaction frequency between Bluetooth devices in Sniff mode.

[0036] 3. Terminology

[0037] In the embodiments of the present application, the same items or similar items with basically the same functions and effects are distinguished by using "first", "second", and the like. For example, the first chip and the second chip are only used to distinguish different chips, and do not limit the sequence. Those skilled in the art can understand that "first", "second", and the like do not limit the quantity and execution sequence, and "first", "second", and the like do not necessarily mean different.

[0038] It should be noted that in the embodiments of the present application, the words "exemplary" or "for example" are used to mean serving as an example, instance, or illustration. Any embodiment or design scheme described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or advantageous than other embodiments or design schemes. Rather, the use of the words "exemplary" or "for example" is intended to present the relevant concept in a specific manner.

[0039] In the embodiments of the present application, "at least one" means one or more, and "multiple" means two or more. The "and / or" describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent the following three cases: A exists alone, A and B exist together, and B exists alone, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after it. "At least one of the following" or the like means any combination of these items, including any combination of single item or multiple items. For example, at least one of a, b, or c can represent a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, and c can be single or multiple.

[0040] The Bluetooth device can communicate through Bluetooth. The Bluetooth device can include a mobile phone, a watch, a bracelet, earphones, and the like. For example, the mobile phone and the watch, bracelet, earphones, and the like can establish a connection through Bluetooth and communicate through Bluetooth.

[0041] However, in some scenarios, when the two Bluetooth devices establishing a Bluetooth connection are separated by more than a certain distance, the Bluetooth connection between the two Bluetooth devices can be disconnected, and data communication cannot be performed, thereby affecting the user experience.

[0042] Taking the Bluetooth communication between a mobile phone and a watch as an example, in the embodiments of the present application, the communication distances of the mobile phone and the watch in different use scenarios are compared, wherein the different use scenarios include a scenario in which the mobile phone and the watch have service data interaction, and a scenario in which the mobile phone and the watch are only connected but have no service data interaction, wherein the service can include a voice call service, a music playing service, etc. It is found through comparison that, in the same environment, the communication distance between the mobile phone and the watch with service data interaction is greater than the communication distance between the mobile phone and the watch only connected but having no service data interaction.

[0043] It is found through analysis of logs in the two use scenarios that, when there is service data interaction, the mobile phone and the watch are in an Active mode, and the interaction between the mobile phone and the watch is relatively frequent, for example, the interaction interval is about 25 milliseconds (ms). When there is no service data interaction, the mobile phone and the watch are in a Sniff mode, and the interaction between the mobile phone and the watch is not frequent enough, for example, the interaction interval is about 500 ms.

[0044] According to the judgment condition for disconnecting the Bluetooth connection specified in the Bluetooth protocol, when the effective interaction interval time between the mobile phone and the watch exceeds a supervision timeout T supervision , the Bluetooth connection between the mobile phone and the watch is disconnected. It can also be understood that, if there is no successful interaction within a T supervision period of time after the last successful interaction between the mobile phone and the watch, it indicates that the Bluetooth connection between the mobile phone and the watch is disconnected.

[0045] Taking the supervision timeout T supervision as 5 seconds (s) as an example, when there is service data interaction, that is, when the mobile phone and the watch are in the Active mode, the mobile phone and the watch need to fail 200 times of interaction continuously for about 5 s / 25 ms, and then it is considered that the Bluetooth connection between the mobile phone and the watch is disconnected. When there is no service data interaction, that is, when the mobile phone and the watch are in the Sniff mode, the mobile phone and the watch need to fail 10 times of interaction continuously for about 5 s / 500 ms, and then it is considered that the Bluetooth connection between the mobile phone and the watch is disconnected.

[0046] It can be known from probability analysis that, between Bluetooth devices, the number of successful Bluetooth interactions = the number of attempts of Bluetooth interactions × the probability of successful Bluetooth interactions. The probability of successful Bluetooth interactions depends on factors such as signal strength and environment, which are not easy to control in actual transmission. Therefore, if it is desired to improve the number of successful Bluetooth interactions, the number of attempts of Bluetooth interactions can be increased.

[0047] For example, in the sniff mode between the mobile phone and the watch, according to the analysis data, if the interaction interval between the mobile phone and the watch is about 500 ms, 10 consecutive interaction failures will be considered as that the Bluetooth connection between the mobile phone and the watch is disconnected. If the number of attempts of Bluetooth interaction is increased, for example, the interaction interval between the mobile phone and the watch is about 25 ms, 200 consecutive interaction failures are required to consider that the Bluetooth connection between the mobile phone and the watch is disconnected. That is, the probability of 200 consecutive interaction failures is less than the probability of 10 consecutive interaction failures.

[0048] Therefore, the Bluetooth communication method provided by the embodiments of the present application can increase the number of attempts of Bluetooth interaction, that is, increase the interaction frequency between Bluetooth devices, when the signal strength is poor and / or the surrounding environment interference is strong, to improve the possibility of successful Bluetooth interaction, so that the Bluetooth devices can communicate stably, thereby improving the user experience.

[0049] It can be understood that the electronic device of the embodiments of the present application can also be any form of terminal device, for example, the electronic device can include the following devices with Bluetooth communication function: mobile phone, tablet computer, palm computer, notebook computer, mobile internet device (MID), wearable device, virtual reality (VR) device, augmented reality (AR) device, wireless terminal in industrial control, wireless terminal in self driving, wireless terminal in remote medical surgery, wireless terminal in smart grid, wireless terminal in transportation safety, wireless terminal in smart city, wireless terminal in smart home, cellular phone, cordless phone, session initiation protocol (SIP) phone, wireless local loop (WLL) station, personal digital assistant (PDA), handheld device with wireless communication function, computing device or other processing device connected to a wireless modem, vehicle-mounted device, wearable device, electronic device in 5G network, or electronic device in future evolved public land mobile network (PLMN), etc., and the embodiments of the present application are not limited thereto.

[0050] By way of example and not limitation, in embodiments of the present application, the electronic device can also be a wearable device. The wearable device can also be referred to as a wearable smart device, which is a general term for devices that are designed and developed by applying wearable technology to daily wear, such as glasses, gloves, watches, clothing, and shoes. The wearable device is a portable device that is directly worn on the body or integrated into the clothes or accessories of the user. The wearable device is not only a hardware device, but also has powerful functions through software support, data interaction, and cloud interaction. The general wearable smart device includes a full function, a large size, and can realize complete or partial functions without relying on a smart phone, such as a smart watch or smart glasses, and focuses on a certain application function and needs to cooperate with other devices such as a smart phone, such as various smart wristbands and smart jewelry for monitoring vital signs.

[0051] In addition, in embodiments of the present application, the electronic device can also be an electronic device in an Internet of Things (IoT) system. The IoT is an important part of the future development of information technology, and its main technical feature is to connect objects through communication technology and network, so as to realize the intelligent network of man-machine interconnection and object-object interconnection.

[0052] The electronic device in embodiments of the present application can also be referred to as a user equipment (UE), a mobile station (MS), a mobile terminal (MT), an access terminal, a subscriber unit, a subscriber station, a mobile station, a mobile terminal, a remote station, a remote terminal, a mobile device, a user terminal, a terminal, a wireless communication device, a user agent, or a user device, etc.

[0053] In embodiments of the present application, the electronic device or each network device includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. The hardware layer includes a central processing unit (CPU), a memory management unit (MMU), and a memory (also referred to as main memory), etc. The operating system can be any one or more computer operating systems that implement business processing through processes, such as a Linux operating system, a Unix operating system, an Android operating system, an iOS operating system, or a windows operating system, etc. The application layer includes a browser, an address book, word processing software, instant messaging software, etc.

[0054] For example, FIG. 1 shows a structural schematic diagram of an electronic device.

[0055] The electronic device can include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, a wireless communication module 150, and a display screen 160, etc.

[0056] It can be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device can include more or fewer components than illustrated, or combine certain components, or split certain components, or different arrangement of components. The illustrated components can be implemented by hardware, software or a combination of software and hardware.

[0057] The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units can be independent devices, or can be integrated in one or more processors. The controller can generate operation control signals according to instruction operation codes and timing signals to complete the control of fetching instructions and executing instructions.

[0058] The memory in the processor 110 can also be provided for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can save instructions or data that the processor 110 has just used or repeatedly uses. If the processor 110 needs to use the instructions or data again, it can directly call from the above-mentioned memory. Avoiding repeated access, reducing the waiting time of the processor 110, thus improving the efficiency of the system. For example, in the embodiments of the present application, the processor 110 can be used for processing Bluetooth data, switching interaction mode, and detecting signal strength, etc.

[0059] It can be understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is only illustrative and does not constitute a structural limitation on the electronic device. In other embodiments of the present application, the electronic device can also use different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0060] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 can include a program storage area and a data storage area. The program storage area can store an operating system, application programs required by at least one function, and the like. The data storage area can store data created during use of the electronic device, and the like. In addition, the internal memory 121 can include a high-speed random access memory, and can further include a non-volatile memory such as at least one of a magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like. The processor 110 executes various function applications and data processing of the electronic device by running instructions stored in the internal memory 121 and / or instructions stored in a memory disposed in the processor. For example, in the embodiments of the present application, the internal memory 121 can be used to store related codes for Bluetooth communication, store related codes for detecting signal strength and detecting environmental interference strength, and the like.

[0061] The wireless communication module 150 can provide a wireless communication solution applied to the electronic device, including wireless local area networks (WLAN) (such as a wireless fidelity (Wi-Fi) network), Bluetooth (BT), a global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, and the like. For example, in the embodiments of the present application, the Bluetooth devices can establish a communication connection based on the wireless communication module 150 and perform data transmission.

[0062] The wireless communication module 150 can be one or more devices integrated with at least one communication processing module. The wireless communication module 150 receives electromagnetic waves via an antenna, performs frequency modulation and filtering processing on the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 150 can also receive signals to be transmitted from the processor 110, perform frequency modulation and amplification, and radiate the signals as electromagnetic waves via the antenna.

[0063] FIG. 2 is a Bluetooth protocol architecture corresponding to Bluetooth communication of the Bluetooth device in the embodiments of the present application. In some embodiments, the Bluetooth protocol architecture can include a Bluetooth protocol layer and a Bluetooth controller (BTC) layer.

[0064] The Bluetooth protocol layer can provide an application programming interface (API) for the upper layer application program to transmit data, and can maintain some software level protocols and encryption processes. In some scenarios, the Bluetooth protocol layer can also be referred to as a BT Host layer. For example, in the embodiments of the present application, the Bluetooth protocol layer can perform step S301 in the embodiment corresponding to FIG. 3 to detect whether the Bluetooth device is currently in an Active mode or a Sniff mode; the Bluetooth protocol layer can also perform step S302 and step S304 in the embodiment corresponding to FIG. 3 to detect the current signal strength and detect the current environmental interference strength; the Bluetooth protocol layer can also perform step S303 and step S305 in the embodiment corresponding to FIG. 3 to switch the interaction mode between the Bluetooth devices, and the like.

[0065] The Bluetooth protocol layer can include a generic access profile (GAP), a security manager protocol (SMP), an attribute protocol (ATT), a generic attribute profile (GATT), a service discovery protocol (SDP), a logical link control and adaptation protocol (L2CAP), and the like.

[0066] The generic access profile can be used to manage and control the communication process between the Bluetooth devices, and provides a general access function of the Bluetooth device, including device discovery, connection, authentication, service discovery, and the like. Through the generic access profile, the Bluetooth device can implement basic communication functions, such as device discovery and connection establishment. For example, in the embodiments of the present application, the Bluetooth device can perform step S401 in the embodiment corresponding to FIG. 4 to establish a Bluetooth connection through the generic access profile.

[0067] The security manager protocol can be used to generate an encryption key and an identity key.

[0068] The attribute protocol can be used for data transmission between the Bluetooth devices, so that the Bluetooth devices can effectively process services and transmit data. For example, in the embodiments of the present application, the Bluetooth device can perform step S402 and step S403 in the embodiment corresponding to FIG. 4 to perform Bluetooth data transmission with the device that establishes the Bluetooth connection.

[0069] A generic attribute profile defines how data exchange is done through Bluetooth Low Energy (BLE), so that different Bluetooth devices can communicate with each other through Bluetooth.

[0070] A service discovery protocol provides mutual inquiry and access to the services of the other party between Bluetooth devices.

[0071] A logical link control and adaptation protocol can group data and provide protocol multiplexing and quality of service exchange functions. The logical link control and adaptation protocol can include a channel manager and an L2CAP resource manager. The channel manager can be used to create, manage or close an L2CAP channel for the transmission of service protocols and application data. The L2CAP resource manager can be used to manage the correct submission of fragmented protocol data units (PDUs).

[0072] A Bluetooth chip control layer can be used to handle the underlying operations and hardware interactions in Bluetooth communication. For example, in the embodiments of the present application, the transmission of service data between Bluetooth devices can be based on the Bluetooth chip control layer, and the Sniff mode or Active mode can be delivered. The Bluetooth chip control layer can include a device manager, a link manager, a baseband resource manager, a link controller and a physical layer (PHY), etc.

[0073] The device manager can be used to control the general behavior of the Bluetooth device, such as querying the device, connecting the device, etc.

[0074] The link manager can be used to create, modify and release logical links, etc.

[0075] The baseband resource manager can be responsible for all access to the radio medium.

[0076] The link controller can be used to manage the baseband resources of Bluetooth, including channel selection, time slot allocation and synchronization, to ensure that data can be correctly transmitted on different logical links, and can also be used to encode and decode Bluetooth data packets, etc.

[0077] The physical layer can be used to send and receive information packets of the physical channel.

[0078] The method of the embodiments of the present application is described in detail below through specific examples. The following examples can be combined with each other or implemented independently, and the same or similar concepts or processes can not be described again in some examples.

[0079] It can be understood that in the case where the first Bluetooth device and the second Bluetooth device establish a Bluetooth communication connection, the Bluetooth communication method of the embodiments of the present application can be implemented in any one of the Bluetooth devices, that is, the first Bluetooth device can execute the Bluetooth communication method of the embodiments of the present application, or the second Bluetooth device can execute the Bluetooth communication method of the embodiments of the present application, which is not limited by the embodiments of the present application. For ease of description, the first Bluetooth device executing the Bluetooth communication method of the embodiments of the present application is taken as an example for description below.

[0080] FIG. 3 shows a flowchart of the first Bluetooth device executing the Bluetooth communication method of the embodiments of the present application.

[0081] S301, detecting that the current is in a low-frequency interaction mode.

[0082] In a possible implementation, the Bluetooth chip control layer of the first Bluetooth device can report to the Bluetooth protocol layer the interaction mode in which the current Bluetooth devices are located. If the Bluetooth protocol layer detects that the current Bluetooth devices are in a low-frequency interaction mode, that is, a Sniff mode, the Bluetooth protocol layer can execute step S302.

[0083] S302, detecting whether the current signal and / or environment is poor.

[0084] On one hand, the Bluetooth protocol layer can detect whether the communication signal between the current Bluetooth devices is poor. The detected signal can include a received signal strength indicator (RSSI). In some scenarios, the received signal strength indicator can also be referred to as a signal strength RSSI, which can be used to reflect the strength of the signal. It can be understood that the greater the value of the signal strength RSSI, the stronger the signal; the smaller the value of the signal strength RSSI, the weaker the signal.

[0085] On the other hand, the Bluetooth protocol layer can also detect whether the communication environment between the current Bluetooth devices is poor, which can also be understood as whether the Bluetooth devices are subjected to strong environmental interference. If the Bluetooth devices are subjected to strong environmental interference, it means that the current communication environment is poor; if the Bluetooth devices are subjected to small environmental interference, it means that the current communication environment is good. The environmental interference can be judged according to the number of available channels. The number of available channels can be understood as the number of radio frequency channels that can be used by the Bluetooth devices when performing Bluetooth data interaction. It can be understood that the greater the number of available channels, the weaker the environmental interference; the smaller the number of available channels, the stronger the environmental interference.

[0086] In a possible implementation, when the value of the signal strength RSSI is less than the signal strength threshold value, and / or the number of available channels is less than the number of available channel threshold value, it can be determined that the current signal and / or environment is poor. It can be understood that the value of the signal strength RSSI being less than the signal strength threshold value indicates that the signal strength is weak when the Bluetooth devices are communicating. The number of available channels being less than the number of available channel threshold value indicates that the environmental interference is strong and the communication environment is poor when the Bluetooth devices are communicating.

[0087] The signal strength threshold value and the number of available channel threshold value can be set according to the actual situation of the Bluetooth device. For example, according to laboratory test experience, in a possible value, the signal strength threshold value can be set to about -80 dBm, and the number of available channel threshold value can be set to about 25. The specific values of the signal strength threshold value and the number of available channel threshold value are not limited in the embodiments of the present application.

[0088] In another possible implementation, the Bluetooth protocol layer can also detect the change trend of the signal strength RSSI in a period of time, and / or detect the change trend of the number of available channels in a period of time.

[0089] For the signal strength RSSI, in a case where the signal strength RSSI gradually weakens in a period of time, when the value of the weakened signal strength RSSI is less than the signal strength threshold value, it can be determined that the signal strength between the Bluetooth devices is weak.

[0090] For the number of available channels, in a case where the number of available channels gradually decreases in a period of time, when the decreased number of available channels is less than the number of available channel threshold value, it can be determined that the environmental interference between the Bluetooth devices is strong and the communication environment is poor.

[0091] The period of detecting the signal strength RSSI and the period of detecting the number of available channels can be the same or different. The period of detecting the signal strength RSSI and the period of detecting the number of available channels can be set according to the actual situation of the Bluetooth device, and the embodiments of the present application are not limited. For example, the period of detecting the signal strength RSSI and the period of detecting the number of available channels can be set to about 500 ms to 1 s respectively.

[0092] In this way, determining the strength of the signal according to the change trend of the signal strength RSSI in a period of time can reduce the inaccurate judgment caused by abnormal jumping of the value of the signal strength RSSI. Similarly, determining the strength of the environmental interference according to the change trend of the number of available channels in a period of time can also reduce the inaccurate judgment caused by abnormal jumping of the number of available channels, so that the judgment result is more stable and more accurate.

[0093] Optionally, the period of detecting the signal strength RSSI and the period of detecting the number of available channels can be flexibly set according to the running performance of the electronic device.

[0094] For example, the period of detecting the signal strength RSSI can be set to be relatively large at first, and if it is detected that the current signal strength is getting worse, the period can be shortened; if it is detected that the current signal strength is getting stronger, the period can be lengthened. Alternatively, if the running performance of the current electronic device is good, for example, the power consumption is low, the temperature is low, and / or the memory space is large, etc., the period of detecting the signal strength RSSI can be set to be relatively small, so as to increase the number of detections and improve the accuracy of the detection results; if the running performance of the current electronic device is poor, for example, the power consumption is high, the temperature is high, and / or the memory space is small, etc., the period of detecting the signal strength RSSI can be set to be relatively large, so as to reduce the number of detections and reduce the impact on the running performance of the electronic device.

[0095] Similarly, for the period of detecting the number of available channels, it can also be set to be relatively large at first, and if it is detected that the current environmental interference is strong, the period can be shortened; if it is detected that the current environmental interference is weak, the period can be lengthened. Alternatively, if the running performance of the current electronic device is good, for example, the power consumption is low, the temperature is low, and / or the memory space is large, etc., the period of detecting the number of available channels can be set to be relatively small, so as to increase the number of detections and improve the accuracy of the detection results; if the running performance of the current electronic device is poor, for example, the power consumption is high, the temperature is high, and / or the memory space is small, etc., the period of detecting the number of available channels can be set to be relatively large, so as to reduce the impact on the running performance of the electronic device.

[0096] In possible scenarios, if the signal strength RSSI becomes stronger, but the number of available channels decreases, or the signal strength RSSI becomes weaker, but the number of available channels increases, in this case, it can still be judged that the current signal and / or environment of the Bluetooth communication is getting worse. In this way, the interaction mode can be switched based on the worse situation, so as to timely improve the communication capability between the Bluetooth devices.

[0097] If the Bluetooth protocol layer detects that the current signal and / or environment is getting worse, step S303 can be performed.

[0098] If the Bluetooth protocol layer detects that the current signal and / or environment is not getting worse, step S306 can be performed, based on the Bluetooth device establishing a Bluetooth communication connection, the next detection is continued to be performed in a polling manner.

[0099] S303, switching from the low-frequency interaction mode to the high-frequency interaction mode.

[0100] Switching from the low-frequency interaction mode to the high-frequency interaction mode can include switching from the Sniff mode to the Active mode, or increasing the interaction frequency between the Bluetooth devices in the Sniff mode. The increase in the interaction frequency between the Bluetooth devices can also be understood as a reduction in the interaction interval between the Bluetooth devices.

[0101] It can be understood that, compared with the Sniff mode, the interaction between the Bluetooth devices is more frequent in the Active mode. For example, the interaction interval between the Bluetooth devices is about 500 ms in the Sniff mode, and the interaction interval between the Bluetooth devices is about 25 ms in the Active mode. Therefore, switching from the Sniff mode to the Active mode can shorten the interaction interval between the Bluetooth devices, thereby increasing the interaction frequency between the Bluetooth devices.

[0102] In addition, in the Sniff mode, the interaction frequency between the Bluetooth devices can also be increased by increasing the number of attempts of Bluetooth interaction between the Bluetooth devices. For example, the initial interaction interval between the Bluetooth devices is about 500 ms in the Sniff mode, and when it is necessary to increase the interaction frequency between the Bluetooth devices, the interaction interval between the Bluetooth devices can be set to be less than the initial interaction interval, i.e., less than 500 ms. In this way, the number of attempts of Bluetooth interaction between the Bluetooth devices can be increased, thereby increasing the number of successful Bluetooth interactions between the Bluetooth devices, reducing the situation of disconnection of the Bluetooth connection between the Bluetooth devices, and improving the user experience.

[0103] After switching to the high-frequency interaction mode, the Bluetooth protocol layer can perform step S304.

[0104] S304, detecting whether the current signal and / or environment returns to normal.

[0105] The Bluetooth protocol layer can detect whether the current signal and / or environment returns to normal.

[0106] In one possible implementation, when the signal strength RSSI is greater than or equal to the signal strength threshold, and the number of available channels is greater than or equal to the number of available channel threshold, it can be determined that the current signal and / or environment returns to normal. It can be understood that, when the signal strength RSSI is greater than or equal to the signal strength threshold, it indicates that the signal strength is strong when the Bluetooth devices are communicating. When the number of available channels is greater than or equal to the number of available channel threshold, it indicates that the environmental interference is weak and the communication environment is good when the Bluetooth devices are communicating.

[0107] In another possible implementation, the Bluetooth protocol layer can also detect the change trend of the signal strength RSSI in a period of time, and / or detect the change trend of the number of available channels in a period of time.

[0108] For the signal strength RSSI, in a case that the signal strength RSSI gradually increases in a period of time, when the value of the increased signal strength RSSI is greater than or equal to the signal strength threshold, it can be determined that the signal strength between the Bluetooth devices is strong.

[0109] For the number of available channels, in a case that the number of available channels gradually increases in a period of time, when the increased number of available channels is greater than or equal to the number of available channel threshold, it can be determined that the environmental interference between the Bluetooth devices is weak, and the communication environment becomes better.

[0110] In a case that both the signal strength RSSI and the number of available channels satisfy the respective judgment conditions, i.e., both the signal strength RSSI and the number of available channels become better, it can be determined that the current signal and / or environment returns to normal. For the related description of the period of detecting the signal strength RSSI and the period of detecting the number of available channels, reference can be made to the related description in step S302, which will not be described herein again.

[0111] In this way, the strength of the signal strength RSSI is determined according to the variation trend of the signal strength RSSI in a period of time, which can reduce the case of inaccurate judgment caused by abnormal jumping of the value of the signal strength RSSI. Similarly, the strength of the environmental interference is determined according to the variation trend of the number of available channels in a period of time, which can reduce the case of inaccurate judgment caused by abnormal jumping of the number of available channels, so that the judgment result is more stable and more accurate.

[0112] In a possible implementation, step S302 can be executed in parallel with step S301 or step S303, and step S304 can also be executed in parallel with step S301 or step S303. That is, the first thread for detecting the current signal and / or environment, and the second thread for detecting and switching the mode can be different threads. In this way, the first thread and the second thread can be executed in parallel, so as to improve the detection speed, improve the execution efficiency of the code, and make the code more maintainable.

[0113] In a possible implementation, when the Bluetooth connection is established between the Bluetooth devices, the first thread can start the process of detecting the current signal and / or environment. When it is detected that the signal and / or environment becomes poor, the first thread can send a message to the second thread, which can be used to indicate that the current signal and / or environment becomes poor, and then the second thread can determine whether to switch to the Active mode or the Sniff mode based on the message and the current communication mode and the like.

[0114] If the Bluetooth protocol layer detects that the current signal and / or environment returns to normal, step S305 can be executed.

[0115] If the Bluetooth protocol layer detects that the current signal and / or environment has not returned to normal, step S306 can be performed, in which the next detection is continued to be polled based on the Bluetooth device establishing a Bluetooth communication connection.

[0116] S305, return to the previous interaction mode.

[0117] It can be understood that if there is data interaction between the current Bluetooth devices, returning to the previous interaction mode can be understood as returning to the Active mode, so that the data interaction between the Bluetooth devices can not be affected, and normal service communication can be performed. In a possible implementation, when the data interaction between the Bluetooth devices starts, a timer can be enabled, and within a time range corresponding to the timer, if there is no data interaction between the Bluetooth devices, the Sniff mode can be entered.

[0118] If there is no data interaction between the current Bluetooth devices, and since the current signal and / or environment has returned to normal, returning to the previous interaction mode can be understood as returning to the Sniff mode. In the Sniff mode, the interaction interval between the Bluetooth devices can be set according to actual conditions, which is not limited by the embodiments of the application. For example, the interaction interval between the Bluetooth devices can be set to about 500 ms. Alternatively, if the performance of the Bluetooth devices is good, the interaction interval between the Bluetooth devices can be shortened, so as to increase the number of attempts of Bluetooth interaction, thereby improving the accuracy of the detection result; if the performance of the Bluetooth devices is poor, the interaction interval between the Bluetooth devices can be lengthened, so as to reduce the influence on the running performance of the electronic device.

[0119] S306, continue to poll the next detection.

[0120] It can be understood that in step S302, when the Bluetooth protocol layer detects that the current signal and / or environment has not become worse, the next detection is continued to be polled, which is used to detect whether the current signal and / or environment has become worse, and the specific execution process can be referred to the related description of step S302, which will not be repeated.

[0121] In step S304, when the Bluetooth protocol layer detects that the current signal and / or environment has not returned to normal, the next detection is continued to be polled, which is used to detect whether the current signal and / or environment has returned to normal, and the specific execution process can be referred to the related description of step S304, which will not be repeated.

[0122] The related description of the period of polling the signal strength RSSI and the period of polling the number of available channels can be referred to the related description in step S302, which will not be repeated.

[0123] FIG. 4 shows a Bluetooth communication method according to an embodiment of the application. The method includes:

[0124] S401, the first electronic device establishes a Bluetooth connection with the second electronic device.

[0125] In the embodiments of the present application, the first electronic device and the second electronic device can be any electronic device capable of establishing a Bluetooth communication connection. For example, the first electronic device and the second electronic device can respectively include a mobile phone, a watch, a bracelet, a headset, etc. The first electronic device and the second electronic device can be the same type of electronic device or different types of electronic device, which is not limited in the embodiments of the present application. For example, the first electronic device can be understood as the first Bluetooth device in the above embodiments, and the second electronic device can be understood as the second Bluetooth device in the above embodiments.

[0126] S402, at a first time, the first electronic device sends Bluetooth data to the second electronic device at a first frequency.

[0127] In the embodiments of the present application, the first time can be understood as the time when the first electronic device sends Bluetooth data to the second electronic device at a first frequency.

[0128] At the first time, the Bluetooth data sent by the first electronic device to the second electronic device can include data sent in the low-frequency interaction mode, such as the POLL packet. The specific content of the Bluetooth data is not limited in the embodiments of the present application.

[0129] S403, at a second time, the first electronic device sends Bluetooth data to the second electronic device at a second frequency, which is switched from the first frequency; wherein the second time is later than the first time, the second frequency is higher than the first frequency, and the signal quality between the first electronic device and the second electronic device corresponding to the second time is worse than the signal quality between the first electronic device and the second electronic device corresponding to the first time.

[0130] In the embodiments of the present application, the second time can be understood as the time when the first electronic device sends Bluetooth data to the second electronic device at a second frequency, which is switched from the first frequency.

[0131] At the second time, the Bluetooth data sent by the first electronic device to the second electronic device can be any Bluetooth data, for example, the Bluetooth data sent by the first electronic device to the second electronic device can include the POLL packet, or can include data related to business interaction. The specific content of the Bluetooth data is not limited in the embodiments of the present application.

[0132] The signal quality between the first electronic device and the second electronic device can include the signal strength RSSI and / or the number of available channels. It can be understood that the greater the value of the signal strength RSSI, the stronger the signal; the smaller the value of the signal strength RSSI, the weaker the signal. The more the number of available channels, the weaker the environmental interference; the fewer the number of available channels, the stronger the environmental interference.

[0133] Switching from the first frequency to the second frequency can be understood as switching from a lower frequency to a higher frequency, and can also be understood as switching from a low-frequency interaction mode to a high-frequency interaction mode in the corresponding embodiment of FIG. 3. The process of switching from the low-frequency interaction mode to the high-frequency interaction mode can be referred to the related description of step S303 in the corresponding embodiment of FIG. 3, and will not be repeated here.

[0134] When the signal quality is poor, the electronic device can increase the interaction frequency between the Bluetooth devices to improve the possibility of successful Bluetooth interaction, so that the Bluetooth devices can stably communicate, thereby improving the user experience.

[0135] Optionally, based on the corresponding embodiment of FIG. 4, the first frequency is a frequency used when the first electronic device is in a first mode; the second frequency is another frequency used when the first electronic device is in the first mode, or the second frequency is a frequency used when the first electronic device is in a second mode; wherein the interaction frequency between the first electronic device and the second electronic device in the second mode is higher than the interaction frequency between the first electronic device and the second electronic device in the first mode.

[0136] The first mode can be understood as a mode in which the interaction frequency between the first electronic device and the second electronic device is low, for example, the first mode can include a Sniff mode in Bluetooth communication, or other low-frequency interaction modes, which are not limited by the embodiments of the present application.

[0137] The second mode can be understood as a mode in which the interaction frequency between the first electronic device and the second electronic device is high, for example, the second mode can include an Active mode in Bluetooth communication, or other high-frequency interaction modes, which are not limited by the embodiments of the present application.

[0138] The second frequency, which is another frequency used when the first electronic device is in the first mode, can be understood as increasing the interaction frequency between the first electronic device and the second electronic device in a low-frequency interaction mode, such as a Sniff mode, and the second frequency is higher than the first frequency.

[0139] The second frequency, which is a frequency used when the first electronic device is in the second mode, can be understood as the interaction frequency between the first electronic device and the second electronic device in a high-frequency interaction mode, such as an Active mode. The process of switching to the second frequency can be referred to the related description of step S303 in the corresponding embodiment of FIG. 3, and will not be repeated here.

[0140] It can be understood that, in the first mode, the interaction frequency is low due to less data interaction between the first electronic device and the second electronic device, which helps to reduce the impact on the performance of the electronic device and improve the endurance of the electronic device. In the second mode, the interaction frequency is high because data transmission is required between the first electronic device and the second electronic device, which can improve the communication capability between the first electronic device and the second electronic device. When the communication quality between the first electronic device and the second electronic device is poor, increasing the interaction frequency between the electronic devices can improve the possibility of successful Bluetooth interaction, thereby increasing the communication distance between the electronic devices.

[0141] Optionally, based on the embodiment corresponding to FIG. 4, the method further includes: at a third time, the first electronic device switches the frequency of sending Bluetooth data to the second electronic device from the second frequency to a third frequency; wherein the third time is later than the second time, and the signal quality between the first electronic device and the second electronic device corresponding to the third time is better than the signal quality between the first electronic device and the second electronic device corresponding to the second time.

[0142] In the embodiment of the present application, the third time can be understood as the time when the first electronic device switches the frequency of sending Bluetooth data to the second electronic device from the second frequency to the third frequency.

[0143] Switching to the third frequency can be understood as returning to the previous interaction mode. The process of switching from the second frequency to the third frequency can be referred to the related description in step S305 of the embodiment corresponding to FIG. 3, and will not be repeated here.

[0144] When the signal quality between the first electronic device and the second electronic device becomes better, the frequency of Bluetooth data interaction between the first electronic device and the second electronic device can also be adjusted. In this way, the frequency of Bluetooth data interaction between the first electronic device and the second electronic device can be flexibly adjusted according to the actual changes in the environment, the communication quality between the first electronic device and the second electronic device is improved, and thus the user experience is improved.

[0145] Optionally, based on the embodiment corresponding to FIG. 4, at the third time, the first electronic device is in the second mode, and the third frequency is greater than or equal to the second frequency; or, at the third time, the first electronic device is in the first mode, and the third frequency is less than or equal to the second frequency.

[0146] In the embodiment of the present application, the first mode is taken as the Sniff mode, and the second mode is taken as the Active mode.

[0147] In the case that the first electronic device is in the second mode, the first electronic device is in the Active mode, which means that there is data interaction between the first electronic device and the second electronic device, and the third frequency can include the frequency corresponding to the Active mode. In this way, the third frequency is set as the frequency corresponding to the Active mode, which can not affect the data interaction between the electronic devices, so that normal service communication can be performed.

[0148] It can be understood that, in the case that the first electronic device is in the second mode at the third time, if the second frequency is the frequency used when the first electronic device is in the Active mode, the third frequency can be equal to the second frequency for the interaction of service data. If the second frequency is the frequency used when the first electronic device is in the Sniff mode, since the interaction frequency in the Active mode is greater than the interaction frequency in the Sniff mode, the third frequency can be greater than the second frequency.

[0149] In the case that the first electronic device is in the first mode, the first electronic device is in the Sniff mode, which means that the first electronic device is in the low-frequency interaction mode with the second electronic device, and the third frequency can be the frequency corresponding to the Sniff mode.

[0150] It can be understood that, in the case that the first electronic device is in the first mode at the third time, if the second frequency is the frequency used when the first electronic device is in the Active mode, since the third frequency is the frequency corresponding to the Sniff mode, the third frequency can be less than the second frequency. If the second frequency is the frequency used when the first electronic device is in the Sniff mode, since the third frequency is the frequency corresponding to the Sniff mode, the third frequency can be equal to or less than the second frequency.

[0151] Optionally, in the case that the second frequency is the frequency of the Sniff mode, if the performance of the first electronic device is good, the third frequency can be equal to the second frequency, so that the interaction interval between the electronic devices can be shortened, thereby increasing the number of attempts for Bluetooth interaction to improve the accuracy of the detection result. If the performance of the first electronic device is poor, the third frequency can be less than the second frequency, so that the interaction interval between the electronic devices can be extended, thereby reducing the influence on the running performance of the electronic device.

[0152] The process of switching from the second frequency to the third frequency can be specifically referred to the related description in step S305 of the embodiment corresponding to FIG. 3, which will not be repeated here.

[0153] Optionally, on the basis of the embodiment corresponding to FIG. 4, the first mode includes the Sniff mode in Bluetooth communication, and the second mode includes the Active mode in Bluetooth communication.

[0154] In the embodiments of the present application, the Sniff mode refers to a mode in which the electronic devices are in a low-power consumption mode, and the electronic devices can periodically interact to determine whether there is data to be transmitted or received. The Active mode refers to a mode in which the electronic devices are in a working state, and the electronic devices can maintain an active state and be ready for data transmission at any time.

[0155] It can be understood that the interaction frequency between the Bluetooth devices in the Active mode is greater than the interaction frequency between the Bluetooth devices in the Sniff mode.

[0156] In the Sniff mode, the interaction frequency between the Bluetooth devices can be increased by increasing the number of attempts of Bluetooth interaction between the Bluetooth devices, so as to reduce the situation of disconnection of the Bluetooth connection between the Bluetooth devices and improve the user experience. In the Active mode, the electronic devices can interact with business data, so that normal business communication can be performed. Therefore, in different scenarios, selecting a suitable mode and using a reasonable interaction frequency can improve the communication quality between the electronic devices.

[0157] Optionally, on the basis of the embodiments corresponding to FIG. 4, the signal quality between the first electronic device and the second electronic device includes one or more of the following: a received signal strength indication (RSSI) between the first electronic device and the second electronic device, and a number of available channels between the first electronic device and the second electronic device.

[0158] In the embodiments of the present application, the received signal strength indication (RSSI) can be used to reflect the strength of the signal. It can be understood that the greater the value of the received signal strength indication (RSSI), the stronger the signal; the smaller the value of the received signal strength indication (RSSI), the weaker the signal.

[0159] The number of available channels can be used to reflect the strength of the environmental interference when the first electronic device and the second electronic device communicate. It can be understood that the greater the number of available channels, the weaker the environmental interference; the smaller the number of available channels, the stronger the environmental interference.

[0160] The signal quality between the first electronic device and the second electronic device can be determined by the received signal strength indication (RSSI) and / or the number of available channels, so that the interaction frequency between the first electronic device and the second electronic device can be flexibly adjusted in a timely manner according to the quality of the signal, thereby improving the communication stability between the first electronic device and the second electronic device.

[0161] Optionally, in the embodiment corresponding to FIG. 4, the signal quality between the first electronic device and the second electronic device at the second time is worse than the signal quality between the first electronic device and the second electronic device at the first time can include that a received signal strength indication (RSSI) value between the first electronic device and the second electronic device at the second time is less than an RSSI value between the first electronic device and the second electronic device at the first time; and / or, the number of available channels between the first electronic device and the second electronic device at the second time is less than the number of available channels between the first electronic device and the second electronic device at the first time.

[0162] In the embodiments of the present application, whether the signal quality between the first electronic device and the second electronic device is deteriorated can refer to the related description in step S302 of the embodiment corresponding to FIG. 3, and will not be repeated here.

[0163] In a possible implementation, the signal quality between the first electronic device and the second electronic device at the first time can be the signal quality detected at the first time; and the signal quality between the first electronic device and the second electronic device at the second time can be the signal quality detected at the second time. It can be understood that using the signal quality at the current time for judgment is relatively simple in code implementation, and the calculation amount of the electronic device is also relatively small.

[0164] In another possible implementation, the signal quality between the first electronic device and the second electronic device at the first time can be the signal quality detected in a period of time before the first time; and the signal quality between the first electronic device and the second electronic device at the second time can be the signal quality detected in a period of time before the second time. The signal quality can be an average value, a maximum value, a minimum value, or a change trend prediction value of the signal quality detected in a period of time, which is not limited in the embodiments of the present application. The period of detecting the received signal strength indication (RSSI) and the period of detecting the number of available channels can refer to the related description in step S302 of the embodiment corresponding to FIG. 3, and will not be repeated here.

[0165] In this way, determining the strength of the signal strength according to the change trend of the signal strength RSSI in a period of time can reduce the inaccurate judgment caused by the abnormal jump of the received signal strength indication (RSSI) value. Similarly, determining the strength of the environmental interference according to the change trend of the number of available channels in a period of time can also reduce the inaccurate judgment caused by the abnormal jump of the number of available channels, so that the judgment result is more stable and more accurate.

[0166] Optionally, based on the corresponding embodiment of FIG. 4, the signal quality between the first electronic device and the second electronic device at the second time is worse than the signal quality between the first electronic device and the second electronic device at the first time can include that the received signal strength indication (RSSI) value between the first electronic device and the second electronic device at the second time is less than a first threshold value, and the received signal strength indication (RSSI) value between the first electronic device and the second electronic device at the first time is greater than or equal to the first threshold value; and / or, the number of available channels between the first electronic device and the second electronic device at the second time is less than a second threshold value, and the number of available channels between the first electronic device and the second electronic device at the first time is greater than or equal to the second threshold value.

[0167] In the embodiments of the present application, the first threshold value can be understood as the signal strength threshold value in the corresponding embodiment of FIG. 3, and the specific first threshold value can refer to the related description of the signal strength threshold value in step S302 of the corresponding embodiment of FIG. 3, which will not be repeated. The second threshold value can be understood as the available channel number threshold value in the corresponding embodiment of FIG. 3, and the specific second threshold value can refer to the related description of the available channel number threshold value in step S302 of the corresponding embodiment of FIG. 3, which will not be repeated.

[0168] The specific judgment method of whether the signal quality between the first electronic device and the second electronic device is deteriorated can refer to the related description in step S302 of the corresponding embodiment of FIG. 3, which will not be repeated.

[0169] It can be understood that using the first threshold value can more intuitively and conveniently judge the strength of the signal strength, and using the second threshold value can also more conveniently and intuitively judge the strength of the environmental interference. And using the threshold value can make the code easier to implement, and the electronic device can also flexibly adjust the value of the threshold value according to the specific actual situation, so as to adapt to different application scenarios.

[0170] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation portal for user to choose authorization or refusal.

[0171] The above mainly describes the solutions provided by the embodiments of the present application from the perspective of methods. To implement the above functions, hardware structures and / or software modules corresponding to the execution of each function are included. Those skilled in the art should easily realize that, in combination with the method steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is implemented in hardware or computer software driven hardware depends on the specific application and design constraints of the technical solutions. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0172] The embodiments of the present application can divide the functions of the device implementing the method according to the above method examples into function modules, for example, each function module can be divided according to each function, or two or more functions can be integrated into one processing module. The integrated module can be implemented in the form of hardware or software function module. It should be noted that the division of modules in the embodiments of the present application is illustrative, and is only a logical function division. Actual implementation can have another division manner.

[0173] As shown in FIG. 5, it is a structure schematic diagram of a chip provided by the embodiments of the present application. The chip 500 includes one or more (including two) processors 501, a communication line 502, a communication interface 503 and a memory 504.

[0174] In some embodiments, the memory 504 stores the following elements: executable modules or data structures, or a subset thereof, or an extended set thereof.

[0175] The method described in the above embodiments of the present application can be applied to the processor 501 or implemented by the processor 501. The processor 501 can be an integrated circuit chip with a processing capability. In the implementation process, each step of the above method can be completed by the integrated logic circuit of hardware in the processor 501 or the instruction in the form of software. The above processor 501 can be a general processor (for example, a microprocessor or a conventional processor), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, a discrete gate or transistor logic device, or a discrete hardware component, the processor 501 can implement or execute the disclosed processing-related methods, steps and logic block diagrams in the embodiments of the present application.

[0176] The steps of the method disclosed in the embodiments of the present application can be directly embodied as hardware code processing executed by a processor, or a combination of hardware and software modules in the code processing. The software module can be located in a storage medium such as a random access memory (RAM), a read only memory (ROM), a programmable read only memory (PROM), or an electrically erasable programmable read only memory (EEPROM), etc. The storage medium is in the storage 504, and the processor 501 reads information in the storage 504 and combines hardware to complete the steps of the above method.

[0177] The processor 501, the storage 504, and the communication interface 503 can communicate through the communication line 502.

[0178] In the above embodiments, the instructions stored in the storage for the processor to execute can be implemented in the form of a computer program product. The computer program product can be written in the storage in advance, or downloaded and installed in the storage in the form of software.

[0179] The embodiments of the present application also provide a computer program product including one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions according to the embodiments of the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer readable storage medium, or transferred from one computer readable storage medium to another, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through a wired (such as coaxial cable, optical fiber, digital subscriber line (DSL) or wireless (such as infrared, wireless, microwave, etc.)) way. The computer readable storage medium can be any available medium that the computer can store or include one or more available media integrated into a server, data center, etc. For example, the available media can include magnetic media (such as floppy disk, hard disk or magnetic tape), optical media (such as digital versatile disc (DVD)), or semiconductor media (such as solid state disk (SSD)), etc.

[0180] The embodiments of the present application further provide a computer readable storage medium. The methods described in the above embodiments can be realized by software, hardware, firmware or any combination thereof, in whole or in part. The computer readable medium can include computer storage medium and communication medium, and can further include any medium that can transfer computer program from one place to another. The storage medium can be any target medium that can be accessed by computer.

[0181] As a possible design, the computer readable medium can include compact disc read-only memory (CD-ROM), RAM, ROM, EEPROM or other optical disk storage; the computer readable medium can include magnetic disk storage or other magnetic storage device. Moreover, any connection line can also be appropriately referred to as a computer readable medium. For example, if software is transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology (such as infrared, radio and microwave), the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology (such as infrared, radio and microwave) is included in the definition of the medium. As used herein, the disk and the optical disk include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc, wherein the disk is usually reproduced in a magnetic manner, and the optical disk is optically reproduced by laser.

[0182] The embodiments of the present application are described with reference to flowcharts and / or block diagrams according to the methods, devices (systems) and computer program products of the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be realized by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the computer or other programmable data processing device produce a device that implements the functions specified in one or more flows in the flowcharts and / or one or more blocks in the block diagrams.

Claims

1. A Bluetooth communication method, characterized by, The method comprises: The first electronic device establishes a Bluetooth connection with the second electronic device; At a first time, the first electronic device sends Bluetooth data to the second electronic device at a first frequency; At a second time, the first electronic device sends Bluetooth data to the second electronic device at a second frequency, which is switched from the first frequency; Wherein, the second time is later than the first time, the second frequency is higher than the first frequency, and the signal quality between the first electronic device and the second electronic device corresponding to the second time is worse than the signal quality between the first electronic device and the second electronic device corresponding to the first time.

2. The method of claim 1, wherein, The first frequency is one frequency used when the first electronic device is in a first mode; The second frequency is another frequency used when the first electronic device is in the first mode, or the second frequency is one frequency used when the first electronic device is in a second mode; Wherein, the interaction frequency of the first electronic device and the second electronic device in the second mode is greater than the interaction frequency of the first electronic device and the second electronic device in the first mode.

3. The method according to claim 1 or 2, characterized in that, The method further comprises: At a third time, the first electronic device sends Bluetooth data to the second electronic device at a third frequency, which is switched from the second frequency; Wherein, the third time is later than the second time, and the signal quality between the first electronic device and the second electronic device corresponding to the third time is better than the signal quality between the first electronic device and the second electronic device corresponding to the second time.

4. The method of claim 3, wherein, At the third time, the first electronic device is in the second mode, and the third frequency is greater than or equal to the second frequency; or, at the third time, the first electronic device is in the first mode, and the third frequency is less than or equal to the second frequency.

5. The method according to any one of claims 2-4, characterized in that, The first mode includes a Sniff mode in Bluetooth communication, and the second mode includes an Active mode in Bluetooth communication.

6. The method according to any one of claims 1 to 5, characterized in that, The signal quality between the first electronic device and the second electronic device includes one or more of the following: received signal strength indication (RSSI) between the first electronic device and the second electronic device, and the number of available channels between the first electronic device and the second electronic device.

7. The method of claim 6, wherein, The signal quality between the first electronic device and the second electronic device corresponding to the second time is worse than the signal quality between the first electronic device and the second electronic device corresponding to the first time, which includes: The received signal strength indication (RSSI) value between the first electronic device and the second electronic device corresponding to the second time is less than the received signal strength indication (RSSI) value between the first electronic device and the second electronic device corresponding to the first time; And / or, the number of available channels between the first electronic device and the second electronic device corresponding to the second time is less than the number of available channels between the first electronic device and the second electronic device corresponding to the first time.

8. The method according to claim 6 or 7, characterized in that, The signal quality between the first electronic device and the second electronic device corresponding to the second time is worse than the signal quality between the first electronic device and the second electronic device corresponding to the first time, including: The received signal strength indication (RSSI) value between the first electronic device and the second electronic device corresponding to the second time is less than a first threshold value, and the received signal strength indication (RSSI) value between the first electronic device and the second electronic device corresponding to the first time is greater than or equal to the first threshold value; And / or, the number of available channels between the first electronic device and the second electronic device corresponding to the second time is less than a second threshold value, and the number of available channels between the first electronic device and the second electronic device corresponding to the first time is greater than or equal to the second threshold value.

9. An electronic device, comprising: The electronic device includes one or more processors and a memory; The memory is coupled to the one or more processors, and the memory is configured to store computer program codes including computer instructions, and the one or more processors are configured to invoke the computer instructions to cause the electronic device to perform the method according to any one of claims 1-8.

10. A chip system, characterized by The chip system is applied to an electronic device, and the chip system includes one or more processors configured to invoke computer instructions to cause the electronic device to perform the method according to any one of claims 1-8.

Citation Information

Patent Citations

  • Method and theftproof system of mobile terminal based on blue tooth submachine

    CN101227209A

  • Intelligent module and intelligent household electrical appliance control system and method

    CN104394048A

  • Wireless broadcast transmitting and receiving equipment and communication system

    CN110351669A

  • Bluetooth communication method and device, equipment, chip and storage medium

    CN116528267A

  • Method of Bluetooth pairing

    KR1020130073224A