Communication method of Bluetooth device and related device
The communication quality information is obtained through the wireless device and the signal quality is judged. If the threshold is not reached, the relay mode will be entered. The wireless device is used as the relay node to solve the communication problem of Bluetooth devices when the location changes or is blocked, and a wider communication range and a higher user experience are achieved.
Patent Information
- Application Number
- CN202510188442.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-20
- Publication Date
- 2025-04-25
AI Technical Summary
When Bluetooth devices change or are blocked, communication can easily cause lag or disconnection, reducing user experience.
The communication quality information between devices is obtained through the wireless device, and it is determined whether the signal quality reaches the threshold. If it is not reached, it enters the relay mode. The wireless device is used as the relay node to realize indirect communication between devices.
It expands the Bluetooth communication range between devices, reduces the possibility of lag or disconnection, and improves the user experience.
Smart Images

Figure CN119893606A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and specifically designs a communication method and related apparatus of a Bluetooth device. Background Art
[0002] With the development of wireless technology, Bluetooth devices (such as Bluetooth headsets, Bluetooth watches, etc.) are used more frequently in daily life. However, when the position of a Bluetooth device changes as the person carrying it moves, the Bluetooth device may be too far away from the terminal device or blocked by walls, which may cause music, voice calls, connections and other communications to become stuck or disconnected, resulting in a significant decrease in user experience. Summary of the invention
[0003] The embodiments of the present application provide a communication method and related apparatus for Bluetooth devices, which can expand the range of Bluetooth communication between devices, reduce the possibility of Bluetooth communication freezes or disconnections, and improve user experience.
[0004] In the first aspect, an embodiment of the present application provides a communication method for a Bluetooth device, which is applied to a wireless device. The method may include: obtaining communication quality information between a first device and a second device, a first Bluetooth connection is established between the first device and the wireless device, and the second device is a device within the Bluetooth scanning range of the wireless device; if, based on the communication quality information, it is determined that the Bluetooth signal quality between the first device and the second device is worse than the first signal quality threshold, then entering a first communication mode; wherein, in the first communication mode, the first device and the second device communicate through the first Bluetooth connection and the second Bluetooth connection, and the second Bluetooth connection is a Bluetooth connection between the wireless device and the second device. In an embodiment of the present application, the wireless device can obtain the communication quality information between the first device and the second device. Exemplarily, the wireless device can receive the communication quality information sent by the device through the Bluetooth connection or detect and collect the communication quality information through the air interface scanning function. When the wireless device determines based on the communication quality information that the quality of the Bluetooth signal between the current first device (such as a terminal device) and the second device (such as a wearable device) is worse than a certain threshold (i.e., the first signal quality threshold), the relay mode (i.e., the first communication mode) can be used so that the first device and the second device can still communicate with high quality. Specifically, a communication link with the wireless device as a relay node is formed through the Bluetooth connection between the first device and the wireless device (i.e., the first Bluetooth connection) and the Bluetooth connection between the second device and the wireless device (i.e., the second Bluetooth connection) to achieve relay communication. For example, the wireless device can complete the reception and forwarding of messages between the first device and the second device through the first Bluetooth connection and the second Bluetooth connection, so that the second device and the first device complete indirect communication through the wireless device to improve the Bluetooth communication range. Compared with the prior art of forwarding messages for indirect communication through Wireless Fidelity (WiFi), the power consumption of Bluetooth technology is relatively low, which is particularly suitable for battery-powered devices, and can effectively extend the use time of communication devices, thereby providing users with longer use time. Through forwarding by wireless devices, the communication range between the second device and the first device can be effectively expanded, the possibility of Bluetooth communication freeze or disconnection can be reduced, and the user experience can be improved.
[0005] In combination with the first aspect, in a possible implementation, the method may further include: if it is determined based on the communication quality information that the Bluetooth signal quality is better than the second signal quality threshold, then entering the second communication mode; wherein, in the second communication mode, the first device and the second device communicate through the third Bluetooth connection, and the third Bluetooth connection is the Bluetooth connection between the first device and the second device. In the embodiment of the present application, there is a risk of performance deterioration if the direct mode (i.e., the second communication mode) is directly entered without judgment, so the wireless device can judge the Bluetooth signal quality, and when the Bluetooth signal quality of the second device (such as a wearable device) and the first device (such as a terminal device) is greater than the second signal quality threshold, the direct mode communication is adopted. When the second device and the first device are in direct mode communication, they can communicate directly through the Bluetooth connection (i.e., the third Bluetooth connection) without the need for the wireless device to forward messages, which can effectively improve the efficiency of Bluetooth communication. When the signal quality is good, the direct mode communication is adopted because the direct mode can directly transmit data, reducing the transit link of data transmission, thereby improving the efficiency and speed of data transmission, and reducing the complexity and delay of transmission.
[0006] In combination with the first aspect, in a possible implementation, entering the first communication mode includes: instructing the first device and the second device to set the destination address of the Bluetooth communication to the address of the wireless device. In the embodiment of the present application, during Bluetooth communication, each Bluetooth device has a unique address. The destination address of the Bluetooth communication is one of the key elements to ensure that data can be accurately sent to the target Bluetooth device. By identifying each Bluetooth device by the address, Bluetooth communication can achieve reliable connection and data transmission between devices. Since when the Bluetooth signal between the first device (such as a terminal device) and the second device (such as a wearable device) is poor, the first device may be connected to the second device and the wireless device at the same time, so when the wireless device enters the relay mode (i.e., the first communication mode) to communicate, a switching instruction can be sent to the first device and the second device to indicate that the destination address of the Bluetooth communication between the first device and the second device is set to the address of the wireless device, so as to avoid the first device and the second device still directly communicating with Bluetooth, thereby causing Bluetooth communication delays or disconnections.
[0007] In combination with the first aspect, in a possible implementation, entering the second communication mode includes: instructing the first device to set the destination address of the Bluetooth communication to the address of the second device; instructing the second device to set the destination address of the Bluetooth communication to the address of the first device. In an embodiment of the present application, when the wireless device enters the direct mode communication (i.e., the second communication mode), the first device (such as a terminal device) may be connected to the second device (such as a wearable device) and the wireless device at the same time, so the wireless device can send a switching instruction to instruct the first device to set the destination address of the Bluetooth communication to the address of the second device, and to instruct the second device to set the destination address of the Bluetooth communication to the address of the first device. This enables direct data transmission between the first device and the second device, reduces the transit link of data transmission, thereby improving the efficiency and speed of data transmission, and reducing transmission complexity and delay.
[0008] In combination with the first aspect, in a possible implementation, the method may further include: if based on the communication quality information, it is determined that the Bluetooth signal quality is worse than the second signal quality threshold and better than the first signal quality threshold, then the current communication mode is maintained, and the communication mode is the first communication mode or the second communication mode. In an embodiment of the present application, when the wireless device determines that the Bluetooth signal quality between the first device (such as a terminal device) and the second device (such as a wearable device) is between the first signal quality threshold and the second signal quality threshold, that is, the Bluetooth signal quality is worse than the second signal quality threshold and better than the first signal quality threshold, the current communication mode can be maintained. It can be understood that the communication mode maintained at this time is the above-mentioned relay mode (i.e., the first communication mode) or the direct mode (i.e., the second communication mode). Because the Bluetooth signal quality between the first device and the second device will fluctuate at any time within a certain range, illustratively, the influencing factors may include interference from other Bluetooth devices around, changes in the distance between the second device and the first device, and the size of the noise. In the interval area between the first signal quality threshold and the second signal quality threshold, whether the wireless device adopts the direct mode or the relay mode communication, the impact on the Bluetooth signal quality between the first device and the second device is small, so the embodiment of the present application uses this interval as a buffer zone for switching the communication mode, that is, when the Bluetooth signal quality is in the interval between the first signal quality threshold and the second signal quality threshold, the wireless device maintains the current communication mode to reduce the possibility of frequent switching of communication modes due to fluctuations in Bluetooth signal quality, avoid problems such as increased device power consumption, unstable connection, and freezes, delays or disconnections caused by switching, so as to improve the user experience.
[0009] In combination with the first aspect, in a possible implementation, the method may further include: discovering the first device through Bluetooth scanning; and establishing a first Bluetooth connection with the first device. In an embodiment of the present application, a first Bluetooth connection may be established between the wireless device and the first device (such as a wearable device), and the wireless device and the first device may share data through the first Bluetooth connection for obtaining communication quality information and selecting and switching communication modes in subsequent processes.
[0010] In combination with the first aspect, in a possible implementation, the first device includes a display module, and the method may further include: displaying devices within the Bluetooth scanning range of the wireless device through the display module, wherein the devices within the scanning range include a second device; receiving an indication message sent by the first device through a first Bluetooth connection, and establishing a second Bluetooth connection with the second device, wherein the indication message is used to instruct the wireless device to establish a Bluetooth connection with the second device. In an embodiment of the present application, the wireless device may scan surrounding devices with Bluetooth enabled, and display surrounding devices through a display module of the first device (such as a terminal device), and after receiving the indication message, the wireless device establishes a second Bluetooth connection with a second device (such as a wearable device). Exemplarily, after the wireless device scans, it may be sent to the first device through the first Bluetooth connection, and surrounding devices with Bluetooth enabled may be displayed through an application of the first device, and the user may view and select connectable devices through the application, and in response to the user's selection operation, the first device sends an indication message to the wireless device, and the wireless device establishes a second Bluetooth connection with the second device after receiving the indication message. It should be noted that the wireless device only establishes a Bluetooth connection between devices at this time, and does not forward the communication message between the first device and the device. It is necessary to judge the quality of the Bluetooth signal through the above method and select the relay mode (i.e., the first communication mode) or the direct mode (i.e., the second communication mode) for communication. The wireless device displays the devices within the surrounding Bluetooth scanning range through the display module, which allows the user to more intuitively view and select the devices that can be connected, thereby improving the visualization capability and the user experience.
[0011] In combination with the first aspect, in a possible implementation, in the first communication mode, the method may also include: receiving a first message sent by a first device through a first Bluetooth connection, and forwarding the first message to a second device through a second Bluetooth connection; or receiving a second message sent by a second device through a second Bluetooth connection, and forwarding the second message to the first device through the first Bluetooth connection. In an embodiment of the present application, the communication method in the relay mode (i.e., the first communication mode) may include: the wireless device receives a first message sent by a first device (such as a terminal device) through a first Bluetooth connection, and then the wireless device forwards the received first message to a second device (such as a wearable device) through a second Bluetooth connection to complete the indirect communication between the first device and the second device. It is understandable that the second device can also send a second message to the first device through a wireless device to complete the indirect communication between the second device and the first device. Through the forwarding of the wireless device, the communication range between the second device and the first device can be effectively expanded, the possibility of Bluetooth communication jamming or disconnection can be reduced, and the user experience can be improved.
[0012] In combination with the first aspect, in a possible implementation, the first device includes one or more of a smart phone, a tablet computer, or a notebook computer, and the second device includes one or more of a Bluetooth headset, a Bluetooth speaker, or a smart bracelet. In an embodiment of the present application, the first device may include devices such as a smart phone, a tablet computer, or a laptop computer, and the second device may include devices such as a Bluetooth headset, a Bluetooth speaker, or a smart bracelet. The first device can change the communication mode with the second device through a wireless device. The switch from the direct mode to the relay mode in the above embodiment can effectively expand the communication range between the first device and the second device, reduce the possibility of Bluetooth communication freezes or disconnections, and enhance the user experience.
[0013] In combination with the first aspect, in a possible implementation, the communication content between the first device and the second device includes: one or more of: voice call, audio data, video data, file transfer, and device connection. In the embodiment of the present application, the wireless device can forward one or more of voice call, audio data, video data, file transfer, and device connection. Wherein, device connection refers to the ability of the first device to maintain communication with multiple devices through wireless device forwarding.
[0014] In combination with the first aspect, in a possible implementation, the quality information value includes: one or more of the Bluetooth standard, signal reception strength indication RSSI, packet loss rate PER and location information. In the embodiment of the present application, the value of the information used to measure the communication quality between the second device and the first device may include: one or more of the Bluetooth standard, RSSI, PER and location information. Among them, the Bluetooth standard (i.e., the Bluetooth standard or specification) defines the communication protocol and parameters between Bluetooth devices. Different Bluetooth standards have different characteristics such as transmission rate, power consumption, transmission distance and compatibility; RSSI is an important indicator for measuring the strength of the received signal of the second device. The larger the RSSI value, the stronger the received signal strength; PER refers to the probability of an error occurring during data transmission. It is also an important indicator for measuring the quality of Bluetooth communication and reflects the reliability and stability of data transmission. The lower the PER value, the higher the reliability of data transmission; the location information may include the location distance between the second device and the connected device.
[0015] In the second aspect, the embodiment of the present application adopts a communication method of a Bluetooth device, which is applied to a first device. The method may include: sending communication quality information between the first device and the second device to the wireless device, establishing a first Bluetooth connection between the wireless device and the first device, and the second device is a device within the Bluetooth scanning range of the wireless device; if the Bluetooth signal quality is worse than the first signal quality threshold, entering the first communication mode, the Bluetooth signal quality is determined by the wireless device based on the communication quality information; wherein, in the first communication mode, the first device and the second device communicate through the first Bluetooth connection and the second Bluetooth connection, and the second Bluetooth connection is the Bluetooth connection between the wireless device and the second device. In the embodiment of the present application, the first device can share data with the wireless device through the first Bluetooth connection to obtain the Bluetooth signal quality sent by the wireless device. When the Bluetooth quality is worse than the first signal quality threshold, it means that the current Bluetooth signal is poor, so the relay mode (i.e., the first communication mode) is used for communication. Through the forwarding of the wireless device, the communication range between the second device (such as a wearable device) and the first device can be effectively expanded, the possibility of Bluetooth communication jamming or disconnection can be reduced, and the user experience can be improved.
[0016] In combination with the second aspect, in a possible implementation, the method may further include: establishing a first Bluetooth connection with a wireless device; forming a Bluetooth network centered on the wireless device, the Bluetooth network including the first device and the wireless device. In an embodiment of the present application, the first device may establish a first Bluetooth connection with the wireless device to form a Bluetooth network centered on the wireless device. Exemplarily, the Bluetooth network may include one or more of a Bluetooth keyboard, a Bluetooth watch, a Bluetooth speaker, etc. in addition to the first device and the wireless device. The establishment of a Bluetooth network makes the interaction between devices smoother and more natural, and users can achieve connection and data transmission between devices through simple operations, thereby improving the overall user experience.
[0017] In combination with the second aspect, in a possible implementation, the first device further includes a display module, and the method may further include: displaying devices within the Bluetooth scanning range of the wireless device through the display module, wherein the devices within the scanning range include the second device; and sending an instruction message to the wireless device through the first Bluetooth connection, wherein the instruction message is used to instruct the wireless device to establish a Bluetooth connection with the second device. In the embodiment of the present application, the first device may display the surrounding devices with Bluetooth turned on through the display module, control the connection between the first device and the devices in the current Bluetooth network to be turned on and off, and may also send an instruction message to enable the wireless device to establish a Bluetooth connection with a second device (such as a wearable device) outside the current Bluetooth network, so that the second device joins the Bluetooth network. Exemplarily, the user may view all devices with Bluetooth turned on within the current Bluetooth range through an application in the first device, and the user may complete the connection and disconnection of the devices in the Bluetooth network through the application, and may also send an instruction message to the wireless device through the application, so that the wireless device establishes a second Bluetooth connection with the second device, and adds a new device to the current Bluetooth network. The embodiment of the present application displays the devices within the Bluetooth scanning range of the surrounding through the display module, which enables the user to more intuitively view and select the devices that can be connected, thereby improving the visualization capability and the user experience.
[0018] In combination with the second aspect, in a possible implementation, the method may also include: if it is determined that the Bluetooth signal quality is better than a second signal quality threshold, entering a second communication mode; wherein, in the second communication mode, the device in communicates with the second device via a third Bluetooth connection, and the third Bluetooth connection is a Bluetooth connection between the first device and the second device.
[0019] In combination with the second aspect, in a possible implementation, entering the first communication mode includes: receiving a switching indication from a wireless device, the switching indication being used to instruct the first device and the second device to set the destination address of the Bluetooth communication to the address of the wireless device; setting the destination address of the Bluetooth communication to the address of the wireless device.
[0020] In conjunction with the second aspect, in a possible implementation manner, entering the second communication mode includes: setting a destination address of the Bluetooth communication to an address of the second device.
[0021] In combination with the second aspect, in a possible implementation, the method may further include: if it is determined that the Bluetooth signal quality is worse than the second signal quality threshold and better than the first signal quality threshold, then maintaining the current communication mode, which is the first communication mode or the second communication mode.
[0022] In the third aspect, the embodiment of the present application provides a communication method of a Bluetooth device, which is applied to a first device, and the method includes: obtaining communication quality information between the first device and the second device, establishing a first Bluetooth connection between the first device and the wireless device, and the second device is a device within the Bluetooth scanning range of the wireless device; if based on the communication quality information, it is determined that the Bluetooth signal quality between the first device and the second device is worse than the first signal quality threshold, then entering the first communication mode; wherein, in the first communication mode, the first device and the second device communicate through the first Bluetooth connection and the second Bluetooth connection, and the second Bluetooth connection is the Bluetooth connection between the wireless device and the second device. In the embodiment of the present application, the first device (such as a terminal device) can also analyze the communication quality information to determine the current Bluetooth signal quality between the first device and the second device. If the Bluetooth signal quality is worse than the first signal quality threshold, then enter the relay mode (i.e., the first communication mode), through the forwarding of the wireless device. Specifically, a communication link with the wireless device as a relay node is formed through the Bluetooth connection between the first device and the wireless device (i.e., the first Bluetooth connection) and the Bluetooth connection between the second device and the wireless device (i.e., the second Bluetooth connection) to realize relay communication. The method of the embodiment of the present application can effectively expand the communication range between the second device and the first device, reduce the possibility of Bluetooth communication freeze or disconnection, and improve the user experience.
[0023] In combination with the third aspect, in a possible implementation, entering the first communication mode includes: sending a third message to the wireless device, the third message is used to request the wireless device to enter the first communication mode; receiving a switching indication from the wireless device, the switching indication is used to instruct the first device and the second device to set the destination address of the Bluetooth communication to the address of the wireless device; setting the destination address of the Bluetooth communication to the address of the wireless device. In the embodiment of the present application, both the first device and the wireless device can obtain communication quality information and judge the quality of the Bluetooth signal. When the first device finds that the current Bluetooth signal quality is worse than the first signal quality threshold, it can apply to the wireless device to enter the relay mode (i.e., the first communication mode), and then receive the switching indication sent by the wireless device to enter the relay mode. It should be noted that the second device can also judge the quality of Bluetooth communication and apply to enter the relay mode. Both the first device and the wireless device can judge the quality of the Bluetooth signal, which can improve the ability to detect the deterioration of the Bluetooth signal quality and reduce the occurrence of Bluetooth communication delays or disconnections.
[0024] In a fourth aspect, an embodiment of the present application provides a wireless device, which includes: a first signal receiving unit, used to obtain communication quality information between a first device and a second device, a first Bluetooth connection is established between the first device and the wireless device, and the second device is a device within the Bluetooth scanning range of the wireless device; a first mode switching unit, used to if, based on the communication quality information, it is determined that the Bluetooth signal quality between the first device and the second device is worse than a first signal quality threshold, the wireless device enters a first communication mode; wherein, in the first communication mode, the first device and the second device communicate through the first Bluetooth connection and the second Bluetooth connection, and the second Bluetooth connection is a Bluetooth connection between the wireless device and the second device.
[0025] In combination with the fourth aspect, in a possible implementation method, the first mode switching unit is also used to: if it is determined based on the communication quality information that the Bluetooth signal quality is better than the second signal quality threshold, then enter the second communication mode; wherein, in the second communication mode, the first device and the second device communicate through a third Bluetooth connection, and the third Bluetooth connection is a Bluetooth connection between the first device and the second device.
[0026] In combination with the fourth aspect, in a possible implementation manner, the first mode switching unit is specifically used to: when entering the first communication mode, instruct the first device and the second device to set the destination address of the Bluetooth communication to the address of the wireless device.
[0027] In combination with the fourth aspect, in a possible implementation, the first mode switching unit is specifically used to: when entering the second communication mode, instruct the first device to set the destination address of the Bluetooth communication to the address of the second device; instruct the second device to set the destination address of the Bluetooth communication to the address of the first device.
[0028] In combination with the fourth aspect, in a possible implementation, the wireless device also includes a scanning unit; the scanning unit is used to perform Bluetooth scanning to discover the first device; and the first mode switching unit is used to establish a first Bluetooth connection with the first device.
[0029] In combination with the fourth aspect, in a possible implementation, the first signal receiving unit is further used to: receive an indication message sent by the first device through the first Bluetooth connection, where the indication message is used to instruct the wireless device to establish a Bluetooth connection with the second device.
[0030] In combination with the fourth aspect, in a possible implementation, the wireless device also includes a first signal sending unit; a first signal receiving unit, which is also used to receive a first message sent by the first device through a first Bluetooth connection; the first signal sending unit, which is used to forward the first message to the second device through a second Bluetooth connection; the first signal receiving unit, which is also used to receive a second message sent by the second device through the second Bluetooth connection; the first signal sending unit, which is also used to forward the second message to the first device through the first Bluetooth connection.
[0031] In the fifth aspect, an embodiment of the present application provides a terminal device, the terminal device is a first identification, and the first device includes: a second signal sending unit, used to send communication quality information between the first device and the second device to the wireless device, a first Bluetooth connection is established between the wireless device and the first device, and the second device is a device within the Bluetooth scanning range of the wireless device; a second mode switching unit, used to, if the Bluetooth signal quality is worse than the first signal quality threshold, the wireless device enters the first communication mode, and the Bluetooth signal quality is determined by the wireless device based on the communication quality information; wherein, in the first communication mode, the first device and the second device communicate through the first Bluetooth connection and the second Bluetooth connection, and the second Bluetooth connection is the Bluetooth connection between the wireless device and the second device.
[0032] In combination with the fifth aspect, in a possible implementation method, the second mode switching unit is also used to: if it is determined that the Bluetooth signal quality is better than the second signal quality threshold, enter the second communication mode; wherein, in the second communication mode, the first device and the second device communicate through a third Bluetooth connection, and the third Bluetooth connection is a Bluetooth connection between the first device and the second device.
[0033] In combination with the fifth aspect, in a possible implementation method, the second mode switching unit is specifically used to: when entering the first communication mode, receive a switching indication sent by the wireless device, the switching indication is used to instruct the first device and the second device to set the destination address of the Bluetooth communication to the address of the wireless device; set the destination address of the Bluetooth communication to the address of the wireless device.
[0034] In combination with the fifth aspect, in a possible implementation method, the second mode switching unit is specifically used to: when entering the second communication mode, receive a switching indication sent by the wireless device, the switching indication is used to instruct the first device to set the destination address of the Bluetooth communication to the address of the second device; set the destination address of the Bluetooth communication to the address of the second device.
[0035] In combination with the fifth aspect, in a possible implementation method, the second mode switching unit is also used to: if it is determined that the Bluetooth signal quality is worse than the second signal quality threshold and better than the first signal quality threshold, maintain the current communication mode, and the communication mode is the first communication mode or the second communication mode.
[0036] In combination with the fifth aspect, in a possible implementation, the second mode switching unit is further used to establish a first Bluetooth connection with the wireless device; and to establish a Bluetooth network centered on the wireless device, wherein the Bluetooth network includes the first device and the wireless device.
[0037] In combination with the fifth aspect, in a possible implementation, the first device also includes a display module; the display module is used to display devices within the Bluetooth scanning range of the wireless device, and the devices within the scanning range include the second device; the second signal sending unit is also used to send an indication message to the wireless device through the first Bluetooth connection, and the indication message is used to instruct the wireless device to establish a Bluetooth connection with the second device.
[0038] In the sixth aspect, an embodiment of the present application provides an electronic device, comprising one or more processors and one or more memories; the one or more processors are coupled to the one or more memories, the one or more memories are used to store computer program code, the computer program code comprises computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes an application message optimization method described in the first aspect or any possible implementation method of the first aspect.
[0039] In the seventh aspect, an embodiment of the present application provides a computer-readable storage medium, including instructions, which, when executed on an electronic device, enable the electronic device to execute an application message optimization method as described in the first aspect or any possible implementation of the first aspect.
[0040] In an eighth aspect, an embodiment of the present application provides a computer program product, which includes a computer program code. When the computer program is executed, the computer executes an application message optimization method as described in the first aspect or any possible implementation method of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.
[0042] Figure 1 It is a schematic diagram of applicable scenarios of a communication method for a Bluetooth device provided in an embodiment of the present application.
[0043] Figure 2A It is a flow chart of a communication method of a Bluetooth device provided in an embodiment of the present application.
[0044] Figure 2B It is a schematic diagram of applicable scenarios of another communication method for a Bluetooth device provided in an embodiment of the present application.
[0045] Figure 3A It is a flow chart of another communication method of a Bluetooth device provided in an embodiment of the present application.
[0046] Figure 3B It is a schematic diagram of applicable scenarios of another communication method for a Bluetooth device provided in an embodiment of the present application.
[0047] Figure 4A It is a flow chart of another communication method of a Bluetooth device provided in an embodiment of the present application.
[0048] Figure 4B It is a flow chart of another communication method of a Bluetooth device provided in an embodiment of the present application.
[0049] Figure 5 A schematic diagram of the structure of a wireless device provided in an embodiment of the present application.
[0050] Figure 6 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application.
[0051] Figure 7 A schematic diagram of the hardware structure of a terminal device provided in an embodiment of the present application.
[0052] Figure 8 It is a software structure block diagram of a terminal device in an embodiment of the present application. DETAILED DESCRIPTION
[0053] The terms used in the following application embodiments of the present application are only for the purpose of describing specific application embodiments and are not intended to limit the present application.
[0054] First, some terms in this application are explained to facilitate understanding by those skilled in the art.
[0055] 1. Received Signal Strength Indicator (RSSI) RSSI is an indicator to measure the strength of wireless signals. It is used to measure the signal strength received by the receiver. It can reflect the strength of the signal and also indicate the quality of the signal to a certain extent. In the field of wireless communications, RSSI is an important parameter and is often used in scenarios such as positioning, ranging, and signal quality detection.
[0056] 2. Packet Error Rate (PER) In the field of communications, PER is used to evaluate the reliability and stability of data transmission. The lower the PER, the fewer errors there are in the data transmission process and the higher the communication quality.
[0057] 3. Bluetooth standard The Bluetooth standard, or Bluetooth protocol version, determines the basic functions and performance of a Bluetooth device. As technology continues to develop, Bluetooth standards are constantly being updated to meet the needs of different application scenarios. Different Bluetooth standards have different compatibilities. Newer Bluetooth standards are usually backward compatible with older standards, which means that devices using new standards can communicate with devices using older standards. The Bluetooth standard also affects the coverage of the device. Newer Bluetooth standards usually have a longer coverage range, which allows devices to communicate over a longer distance.
[0058] 4. Bluetooth Low Energy (BLE) standard BLE uses a 2.4GHz radio frequency with a frequency range of 2.400~2.4835GHz. It is widely used in the fields of Internet of Things, smart home, wearable devices, etc., providing low-power and high-efficiency wireless communication solutions for these devices.
[0059] 5. Basic Rate (BR) BR is an early version of Bluetooth technology with basic wireless communication capabilities. Its data transmission rate is relatively low, but it is sufficient to meet some basic communication needs.
[0060] 6. Enhanced Data Rate (EDR) EDR is an enhanced version of Bluetooth technology with a higher data transmission rate than BR. It improves the efficiency and stability of data transmission by improving modulation and demodulation technology. EDR is suitable for Bluetooth devices that need to transmit large amounts of data, such as high-definition audio transmission, video streaming transmission, etc. It is also widely used in data transmission and communication between various Bluetooth devices.
[0061] See also Figure 1 , Figure 1 It is a schematic diagram of applicable scenarios of a communication method of a Bluetooth device provided in an embodiment of the present application. The embodiment of the present application provides a communication method of a Bluetooth device, which can be applied to the scenario of mutual communication between a first device and a second device. Among them, the first device may include a mobile phone, a tablet computer (Pad), a laptop computer and other terminal devices that can establish a Bluetooth connection with a wireless device; the second device may include a Bluetooth headset, a Bluetooth bracelet, a Bluetooth watch, a Bluetooth speaker and other devices with Bluetooth function; the wireless device may include a router, a gateway and other devices. In the embodiment of the present application, the wireless device has a Bluetooth function.
[0062] Exemplarily, the first device is a smart phone, and the second device is a head-mounted Bluetooth headset. When the user uses a smart phone to play music through a head-mounted Bluetooth headset in the bedroom, the user walks to the door with the head-mounted Bluetooth headset to pick up the express, and the smart phone is left in the bedroom. With the increase of distance and the obstruction of walls such as the bedroom and the living room, the quality of Bluetooth communication between the smart phone and the headset gradually deteriorates until the Bluetooth communication quality is worse than a certain threshold (i.e., the first signal quality threshold), at which time the wireless device switches to relay mode (i.e., the first communication mode) and instructs the smart phone and the headset to complete the corresponding connection. Among them, the relay mode is to form a communication link with the wireless device as a relay node through the Bluetooth connection between the smart phone and the wireless device (i.e., the first Bluetooth connection) and the Bluetooth connection between the head-mounted Bluetooth headset and the wireless device (i.e., the second Bluetooth connection) to realize relay communication. When the user walks back to the bedroom, the Bluetooth communication quality between the smart phone and the headset gradually improves until the Bluetooth communication quality is better than a certain threshold (i.e., the second signal quality threshold), and the wireless device automatically switches to direct mode (i.e., the second communication mode). Among them, the direct mode is that the smartphone and the head-mounted Bluetooth headset communicate directly through the Bluetooth connection (i.e., the third Bluetooth connection) without the need for wireless devices to forward messages.
[0063] Exemplarily, the first device is a smart phone, and the second device is a Bluetooth speaker. When the user uses a smart phone in the living room to play music through a Bluetooth speaker, the user carries the smart phone into the toilet. As the distance increases and the wall blocks the connection, the Bluetooth communication quality between the smart phone and the Bluetooth speaker gradually deteriorates until the Bluetooth communication quality is worse than a certain threshold (i.e., the first signal quality threshold). At this time, the wireless device switches to the relay mode (i.e., the first communication mode) and instructs the smart phone to complete the corresponding connection with the Bluetooth speaker. Among them, the relay mode is to form a communication link with the wireless device as a relay node through the Bluetooth connection between the smart phone and the wireless device (i.e., the first Bluetooth connection) and the Bluetooth connection between the Bluetooth speaker and the wireless device (i.e., the second Bluetooth connection) to realize relay communication. When the user walks back to the living room, the Bluetooth communication quality between the smart phone and the Bluetooth speaker gradually improves until the Bluetooth communication quality is better than a certain threshold (i.e., the second signal quality threshold), and the wireless device automatically switches to the direct mode (i.e., the second communication mode). Among them, the direct mode is that the smart phone and the Bluetooth speaker communicate directly through the Bluetooth connection (i.e., the third Bluetooth connection) without the need for the wireless device to forward messages.
[0064] In an embodiment of the present application, in one possible case, the first device and the second device can be directly connected to each other via a Bluetooth connection, and the user can directly send a message to the second device via the Bluetooth connection. For example, when the first device has a voice call request, the first device can send a message to the second device to keep the voice call function of the second device. In another possible case, when the quality of the Bluetooth signal between the first device and the second device deteriorates due to factors such as distance, for example, when there is a freeze or disconnection, the first device can complete indirect communication with the second device through a wireless device. For example, the first device can form and display a Bluetooth network built around a wireless device through an application, in which a relay mode communication between any two devices can be established through a wireless device, and a Bluetooth connection is established with the second device and the wireless device respectively through the first device. The first device sends a first message to the wireless device through a Bluetooth connection, and the wireless device forwards the received first message to the second device connected thereto. The embodiment of the present application can effectively expand the Bluetooth communication range between the first device and the second device, reduce the possibility of Bluetooth communication freeze or disconnection, and enhance the user experience.
[0065] See also Figure 2A , Figure 2A The following is a flow chart of a communication method for a Bluetooth device provided in an embodiment of the present application. The specific steps of the communication method for a Bluetooth device provided in an embodiment of the present application are described in detail. The method may include the following steps: S201: Acquire communication quality information between a first device and a second device.
[0066] Specifically, the wireless device obtains the communication quality information between the first device (such as a terminal device) and the second device (such as a wearable device), wherein the terminal device establishes a first Bluetooth connection with the wireless device, and the wearable device is within the Bluetooth scanning range of the wireless device. The wireless device and the terminal device can share data through the first Bluetooth connection to obtain communication quality information, so as to jointly complete the selection and switching of the communication mode. Exemplarily, when the terminal device communicates with the wearable device directly through a Bluetooth connection, the wireless device can receive the communication quality information sent by the wireless device through the first Bluetooth connection for use in the subsequent communication mode switching process, or the wireless device can obtain the Bluetooth signal quality between the first device and the second device through the air interface scanning function. Exemplarily, the communication quality information may include one or more of the Bluetooth standard, the signal reception strength indication RSSI, the packet loss rate PER and the location information. Among them, the Bluetooth format (i.e., Bluetooth standard or specification) defines the communication protocol and parameters between Bluetooth devices. Different Bluetooth formats have different characteristics such as transmission rate, power consumption, transmission distance and compatibility; RSSI is an important indicator to measure the received signal strength of Bluetooth devices. The larger the RSSI value, the stronger the received signal strength. It should be noted that the RSSI value is usually negative at the receiving end. The smaller the value (i.e., the closer to zero), the higher the receiving sensitivity and the stronger the signal; PER refers to the probability of error during data transmission. It is an important indicator to measure the quality of Bluetooth communication and reflects the reliability and stability of data transmission. The lower the PER value, the higher the reliability of data transmission; location information may include the location distance between the Bluetooth device and the connected device.
[0067] S202: If, based on the communication quality information, it is determined that the quality of the Bluetooth signal between the first device and the second device is worse than a first signal quality threshold.
[0068] Specifically, the wireless device can determine the Bluetooth signal quality between the terminal device and the second device (such as a wearable device) by analyzing the communication quality information shared with the first device (such as a terminal device). Exemplarily, when the RSSI value between the terminal device and the wearable device continues to decrease (that is, the value is getting closer to zero) and the PER value also remains at a low level, it indicates that the Bluetooth signal quality is gradually improving. It should be noted that the RSSI value is usually negative at the receiving end. The smaller the value (that is, the closer to zero), the higher the receiving sensitivity and the stronger the signal. The wireless device can evaluate the stability and reliability of Bluetooth communication by obtaining the values of these two parameters and comparing them with the ranges or thresholds corresponding to the parameters. For example, when at least one parameter in the communication quality information is worse than the respective first parameter threshold, it is determined that the current Bluetooth signal quality between the first device and the second device is worse than the first signal quality threshold. Among them, a parameter in the communication quality information may correspond to multiple parameter thresholds, and each parameter threshold is used to indicate the critical point for judging whether the current Bluetooth signal quality is good or bad through the parameter. For example, when the PER parameter value is greater than the first parameter threshold, it means that the current Bluetooth signal quality is poor and too many errors occur during data transmission. When the PER parameter value is less than the second parameter threshold, it means that the current Bluetooth signal quality is good and the data transmission is reliable. Optionally, the first signal quality threshold is a demarcation value for judging whether the Bluetooth signal quality is poor. If the Bluetooth signal quality is judged to be worse than the first signal quality threshold, it means that the current Bluetooth signal quality is poor. If the communication enters or maintains the direct mode (i.e., the second communication mode), the communication may be disconnected or stuck, resulting in a poor user experience. It should be noted that one or more thresholds may exist in the wireless device at the same time for judging the Bluetooth signal quality. Optionally, the wireless device may also include a second signal quality threshold. The second signal quality threshold is a demarcation value for judging whether the Bluetooth signal quality is good. If it is better than the second signal quality threshold, it means that the current Bluetooth signal quality is good. In the interval between the first signal quality threshold and the second signal quality threshold, whether the wireless device uses direct mode or relay mode communication, the quality of the Bluetooth signal between the first device and the second device is less affected, so the embodiment of the present application uses this interval as a buffer for switching the communication mode, that is, when the Bluetooth signal quality is in the interval between the first signal quality threshold and the second signal quality threshold, the wireless device maintains the current communication mode to reduce the possibility of frequent switching of the communication mode due to fluctuations in the Bluetooth signal quality, avoid problems such as increased device power consumption, unstable connection, and freezes, delays or disconnections caused by switching, so as to improve the user experience. Further, when the wireless device determines that the Bluetooth signal is worse than the first signal quality threshold, step S203 is executed.
[0069] S203: Entering the first communication mode.
[0070] Specifically, the wireless device determines through step S202 that the current Bluetooth signal quality is poor. If the wireless device enters the direct mode (i.e., the second communication mode) for communication, communication disconnection or jamming may occur, so the wireless device enters the relay mode (i.e., the first communication mode) for communication to maintain high-quality communication between the terminal device and the wireless device, that is, the terminal device and the wireless device communicate through the first Bluetooth connection, and the wearable device and the wireless device communicate through the second Bluetooth connection. Exemplarily, in the first communication mode, the terminal device sending a first message to the wearable device may include: the terminal device sends the first message to the wireless device through the first Bluetooth connection, the wireless device receives the first message through the first Bluetooth connection, the wireless device sends the first message to the wearable device through the second Bluetooth connection, and the wearable device receives the first message through the second Bluetooth connection. Through the forwarding of the wireless device, the communication range between the wearable device and the terminal device can be effectively expanded, the possibility of Bluetooth communication jamming or disconnection can be reduced, and the user experience can be improved.
[0071] In an embodiment of the present application, when the quality of the Bluetooth signal between the first device (such as a terminal device) and the second device (such as a wearable device) is worse than a certain threshold (i.e., the first signal quality threshold), a relay mode (i.e., a first communication mode) can be used so that high-quality communication can still be performed between the first device and the second device. Specifically, a communication link with a wireless device as a relay node is formed through the Bluetooth connection (i.e., the first Bluetooth connection) between the first device and the wireless device, and the Bluetooth connection (i.e., the second Bluetooth connection) between the second device and the wireless device to achieve relay communication. For example, the wireless device can complete the reception and forwarding of messages between the first device and the second device through the first Bluetooth connection and the second Bluetooth connection, so that the second device and the first device complete indirect communication through the wireless device to improve the Bluetooth communication range. Exemplarily, the Bluetooth standard in the first communication mode may include one or more of BLE, BR, and EDR standards. Compared with the prior art of forwarding messages for indirect communication through wireless fidelity (WiFi), the power consumption of Bluetooth technology is relatively low, which is particularly suitable for battery-powered devices, and can effectively extend the use time of communication devices, thereby providing users with longer use time. Through forwarding by wireless devices, the communication range between the second device and the first device can be effectively expanded, the possibility of Bluetooth communication freeze or disconnection can be reduced, and the user experience can be improved.
[0072] See also Figure 2B , Figure 2B It is a schematic diagram of applicable scenarios of another communication method for a Bluetooth device provided in an embodiment of the present application. Figure 2BIn the example, a mobile phone is used as the first device, a Bluetooth headset is used as the second device, and a router is used as the wireless device. In a possible implementation, entering the first communication mode includes: the wireless device instructs the first device and the second device to set the destination address of the Bluetooth communication to the address of the wireless device.
[0073] In the embodiment of the present application, in Bluetooth communication, each Bluetooth device has a unique address. The destination address of Bluetooth communication is one of the key elements to ensure that data can be accurately sent to the target Bluetooth device. By identifying each Bluetooth device by address, Bluetooth communication can achieve reliable connection and data transmission between devices. Since when the Bluetooth signal between the first device and the second device is poor, the first device (such as a terminal device) may be connected to the second device (such as a wearable device) and the wireless device at the same time, when the wireless device enters the relay mode (i.e., the first communication mode) to communicate, a switching instruction can be sent to the first device and the second device to indicate that the destination address of the Bluetooth communication between the first device and the second device is set to the address of the wireless device, so as to avoid the situation where the first device and the second device still directly communicate with Bluetooth, thereby causing Bluetooth communication delays or disconnections.
[0074] See also Figure 3A , Figure 3A Detailed description of the steps of another method for communicating with a Bluetooth device provided by an embodiment of the present application is as follows. The method may include the following steps: S301: Acquire communication quality information between a first device and a second device.
[0075] Specifically, the wireless device obtains the communication quality information between the first device (such as the terminal device) and the second device (such as the wearable device). Please refer to the description of the embodiment corresponding to the above step S201, which will not be repeated here.
[0076] S302: If, based on the communication quality information, it is determined that the Bluetooth signal quality between the first device and the second device is better than the second signal quality threshold.
[0077] Specifically, the wireless device can determine the Bluetooth signal quality between the terminal device and the wearable device by analyzing and calculating based on the communication quality information shared with the terminal device. Please refer to the description of the embodiment corresponding to the above step S202, which will not be repeated here. Exemplarily, when at least one parameter among the parameters in the communication quality information is better than the second parameter threshold corresponding to itself, it is judged that the current Bluetooth signal quality is better than the second signal quality threshold. Among them, the second signal quality threshold is a demarcation value for judging whether the Bluetooth signal quality is good. If the Bluetooth signal quality is better than the second signal quality threshold, it means that the current Bluetooth signal quality is good and can meet the connection requirements of the direct mode (ie, the second communication mode).
[0078] S303: Enter the second communication mode and communicate via the third Bluetooth connection.
[0079] Specifically, the wireless device determines through step S302 that the current Bluetooth signal quality is good and can meet the connection requirements of the direct mode (i.e., the second communication mode), and communicates with the wearable device through the third Bluetooth connection, and the wireless device enters the direct mode (i.e., the second communication mode) for communication. Exemplarily, in the direct mode communication, the terminal device sending the second message to the wearable device may include: the terminal device sending the second message to the wearable device through the third Bluetooth connection, and the wearable device receiving the second message through the third Bluetooth connection. When the Bluetooth signal quality is good, the direct mode communication can be adopted between the terminal device and the wearable device.
[0080] In the embodiment of the present application, there is a risk of performance deterioration if the direct mode is directly entered without judgment, so the wireless device can judge the quality of the Bluetooth signal. When the Bluetooth signal quality of the second device (such as a wearable device) and the first device (such as a terminal device) is greater than the second signal quality threshold, the direct mode (i.e., the second communication mode) is used for communication. At this time, the second device communicates directly with the first device through a Bluetooth connection (i.e., a third Bluetooth connection) without the need for the wireless device to forward messages, which can effectively improve the efficiency of Bluetooth communication. When the signal quality is good, the direct mode is used for communication because the direct mode can directly transmit data, reducing the transit link of data transmission, thereby improving the efficiency and speed of data transmission and reducing transmission complexity and delay.
[0081] See also Figure 3B , Figure 3B It is a schematic diagram of applicable scenarios of another communication method for a Bluetooth device provided in an embodiment of the present application. Figure 3B In the example, a mobile phone is used as the first device, a Bluetooth headset is used as the second device, and a router is used as a wireless device. In one possible implementation, entering the second communication mode includes: the wireless device instructs the first device to set the destination address of the Bluetooth communication to the address of the second device, and the wireless device instructs the second device to set the destination address of the Bluetooth communication to the address of the first device. In Bluetooth communication, each Bluetooth device has a unique address. The destination address of Bluetooth communication is one of the key elements to ensure that data can be accurately sent to the target Bluetooth device. Each Bluetooth device can be identified by the address, and Bluetooth communication can achieve reliable connection and data transmission between devices. It should be noted that after the first device and the second device join the Bluetooth network, the first Bluetooth connection between the first device and the wireless device and the second Bluetooth connection between the wireless device and the second device can always remain connected. Here, the wireless device sets the destination address of the Bluetooth communication between the first device and the second device.
[0082] In an embodiment of the present application, when the wireless device enters the direct mode communication (i.e., the second communication mode), the first device (such as a terminal device) may be connected to the second device (such as a wearable device) and the wireless device at the same time, so the wireless device can send a switching instruction to instruct the first device to set the destination address of the Bluetooth communication to the address of the second device, and to instruct the second device to set the destination address of the Bluetooth communication to the address of the first device. Exemplarily, the Bluetooth standard in the second communication mode may include one or more of the BLE, BR, and EDR standards. The embodiment of the present application enables direct data transmission between the first device and the second device, reduces the transit link of data transmission, thereby improving the efficiency and speed of data transmission, and reducing transmission complexity and delay.
[0083] In a possible implementation, the method may further include: if the wireless device determines based on the communication quality information that the Bluetooth signal quality is worse than the second signal quality threshold and better than the first signal quality threshold, then the current communication mode is maintained, and the communication mode is the first communication mode or the second communication mode. In an embodiment of the present application, when the wireless device determines that the Bluetooth signal quality between the first device (such as a terminal device) and the second device (such as a wearable device) is between the first signal quality threshold and the second signal quality threshold, that is, the Bluetooth signal quality is worse than the second signal quality threshold and better than the first signal quality threshold, the current communication mode can be maintained. It can be understood that the communication mode maintained at this time is the above-mentioned relay mode (i.e., the first communication mode) or the direct mode (i.e., the second communication mode). Because the Bluetooth signal quality between the first device and the second device will fluctuate at any time within a certain range, illustratively, the influencing factors may include interference from other Bluetooth devices around, changes in the distance between the second device and the first device, and the size of the noise. In the interval area between the first signal quality threshold and the second signal quality threshold, whether the wireless device adopts the direct mode or the relay mode communication, the impact on the Bluetooth signal quality between the first device and the second device is small, so the embodiment of the present application uses this interval as a buffer zone for switching the communication mode, that is, when the Bluetooth signal quality is in the interval between the first signal quality threshold and the second signal quality threshold, the wireless device maintains the current communication mode to reduce the possibility of frequent switching of communication modes due to fluctuations in Bluetooth signal quality, avoid problems such as increased device power consumption, unstable connection, and freezes, delays or disconnections caused by switching, so as to improve the user experience.
[0084] In a possible implementation, the method may further include: the wireless device discovers the first device through Bluetooth scanning; and establishes a first Bluetooth connection with the first device. In the embodiment of the present application, a first Bluetooth connection may be established between the wireless device and the first device (such as a wearable device), and the wireless device and the first device may share data through the first Bluetooth connection, which is used for obtaining communication quality information and selecting and switching communication modes in subsequent processes.
[0085] In a possible implementation, the first device includes a display module, and the method may further include: the wireless device displays the devices within the Bluetooth scanning range of the wireless device through the display module of the first device, and the devices within the scanning range include the second device; the wireless device receives the instruction message sent by the first device through the first Bluetooth connection, and establishes a second Bluetooth connection with the second device, and the instruction message is used to instruct the wireless device to establish a Bluetooth connection with the second device. In the embodiment of the present application, the wireless device can scan the surrounding devices with Bluetooth function turned on, and display the surrounding devices through the display module of the first device (such as the terminal device), and after receiving the instruction message, the wireless device establishes a second Bluetooth connection with the second device (such as a wearable device). Exemplarily, after the wireless device scans, it can be sent to the first device through the first Bluetooth connection, and the surrounding devices with Bluetooth function turned on are displayed through the application of the first device. The user can view the connectable devices and select them through the application. In response to the user's selection operation, the first device sends an instruction message to the wireless device, and the wireless device establishes a second Bluetooth connection with the second device after receiving the instruction message. It should be noted that the wireless device only establishes a Bluetooth connection between the devices at this time, and does not forward the communication message between the first device and the device. The wireless device displays the devices within the surrounding Bluetooth scanning range through the display module, allowing users to more intuitively view and select devices that can be connected, improving visualization capabilities and user experience.
[0086] In a possible implementation, in the first communication mode, the method may also include: the wireless device receives a first message sent by the first device through the first Bluetooth connection, and forwards the first message to the second device through the second Bluetooth connection; or the wireless device receives a second message sent by the second device through the second Bluetooth connection, and forwards the second message to the first device through the first Bluetooth connection. In an embodiment of the present application, the communication method in the relay mode (i.e., the first communication mode) may include: the wireless device receives a first message sent by the first device (such as a terminal device) through the first Bluetooth connection, and then the wireless device forwards the received first message to the second device (such as a wearable device) through the second Bluetooth connection to complete the indirect communication between the first device and the second device. It is understandable that the second device can also send the second message to the first device through the wireless device to complete the indirect communication between the second device and the first device. Through the forwarding of the wireless device, the communication range between the second device and the first device can be effectively expanded, the possibility of Bluetooth communication jamming or disconnection can be reduced, and the user experience can be improved.
[0087] In one possible implementation, the first device includes one or more of a smartphone, a tablet computer, or a notebook computer, and the second device includes one or more of a Bluetooth headset, a Bluetooth speaker, or a smart bracelet. In an embodiment of the present application, the first device may include devices such as a smartphone, a tablet computer, or a notebook computer, and the second device may include devices such as a Bluetooth headset, a Bluetooth speaker, or a smart bracelet. The first device can change the communication mode with the second device through a wireless device. The switch from the direct mode to the relay mode in the above embodiment can effectively expand the communication range between the first device and the second device, reduce the possibility of Bluetooth communication freezes or disconnections, and enhance the user experience.
[0088] In a possible implementation, the communication content between the first device and the second device includes: one or more of: voice call, audio data, video data, file transfer, and device connection. In the embodiment of the present application, the wireless device can forward one or more of: voice call, audio data, video data, file transfer, and device connection. Wherein, device connection refers to the ability of the first device to maintain communication with multiple Bluetooth devices through wireless device forwarding.
[0089] In a possible implementation, the quality information value includes: one or more of the Bluetooth standard, signal reception strength indication RSSI, packet loss rate PER and location information. In the embodiment of the present application, the value of the information used to measure the communication quality between the second device and the first device may include: one or more of the Bluetooth standard, RSSI, PER and location information. Among them, the Bluetooth standard (i.e., the Bluetooth standard or specification) defines the communication protocol and parameters between Bluetooth devices. Different Bluetooth standards have different characteristics such as transmission rate, power consumption, transmission distance and compatibility; RSSI is an important indicator for measuring the strength of the received signal of the second device. The larger the RSSI value, the stronger the received signal strength; PER refers to the probability of an error occurring during data transmission. It is an important indicator for measuring the quality of Bluetooth communication and reflects the reliability and stability of data transmission. The lower the PER value, the higher the reliability of data transmission; the location information may include the location distance between the second device and the connected device.
[0090] See also Figure 4A , Figure 4A The following is a flow chart of another communication method for a Bluetooth device provided in an embodiment of the present application. The specific steps of another communication method for a Bluetooth device provided in an embodiment of the present application are described in detail. The method may include the following steps: S401A: The wireless device establishes a first Bluetooth connection with the first device.
[0091] Specifically, a first Bluetooth connection is established between the wireless device and a first device (such as a terminal device), and the terminal device can share data with the wireless device through the first Bluetooth connection for obtaining communication quality and switching communication modes in subsequent processes.
[0092] S402A: The first device establishes a Bluetooth network centered on the wireless device.
[0093] Specifically, the terminal device can establish a first Bluetooth connection with the wireless device to form a Bluetooth network centered on the wireless device. Exemplarily, in addition to the terminal device and the wireless device, the Bluetooth network can also include one or more devices with Bluetooth enabled, such as a Bluetooth keyboard, a Bluetooth watch, a Bluetooth speaker, etc. Exemplarily, the wireless device can display a list of applications that have successfully paired with the wireless device via Bluetooth on an application of the terminal device through the terminal device, and the user can form a Bluetooth network centered on the wireless device through the application, and manage the devices in the Bluetooth network and add new devices through the application.
[0094] S403A: The wireless device performs Bluetooth scanning to establish a second Bluetooth connection.
[0095] Specifically, the wireless device scans the surrounding devices with Bluetooth enabled, and establishes a second Bluetooth connection with a second device (such as a wearable device) scanned outside the current Bluetooth network, thereby adding the wearable device to the Bluetooth network. For example, the user can view all Bluetooth enabled devices within the current Bluetooth range through an application in the terminal device, and the user can complete the connection and disconnection of devices in the current Bluetooth network through the application. The user can also send an instruction message to the wireless device through the application to establish a second Bluetooth connection between the wireless device and the wearable device, and add a new device to the current Bluetooth network.
[0096] S404A: The wireless device obtains device information, service information and determines the priority.
[0097] Specifically, the wireless device can obtain the device information and communication service information of the current Bluetooth network that is connected. Exemplarily, the wireless device can implement the process through the API provided by the Bluetooth protocol stack. The device information may include one or more of the device name, MAC address (unique identifier), device type, etc., wherein the device type may include devices such as smart phones, smart watches, Bluetooth headsets, Bluetooth speakers, etc. The service information may include the format, sampling rate, bit rate, communication content, data format, transmission protocol, etc. of the audio data, wherein the communication content may include one or more of voice calls, audio data, video data, file transfer, and device connection. After the wireless device obtains the device information and service information, the wireless device can determine the priority of communication with each wearable device based on this information. The priority determination can be based on multiple factors, such as the urgency and importance of the task, the device type, the connection quality, etc. Exemplarily, the wireless device gives priority to the communication transmission of voice calls and audio streams, because these services have the greatest impact on the user experience, and it is necessary to give priority to the services with high user perception. It should be noted that the specific priority determination method can be set according to different usage scenarios.
[0098] S405A: Acquire communication quality information between the first device and the second device.
[0099] Specifically, the wireless device obtains the communication quality information between the first device (such as the terminal device) and the second device (such as the wearable device). Please refer to the description of the embodiment corresponding to the above step S201, which will not be repeated here.
[0100] S406A: Based on the communication quality information, determine whether the quality of the Bluetooth signal between the first device and the second device is worse than a first signal quality threshold.
[0101] Specifically, the wireless device can determine the quality of the Bluetooth signal between the terminal device and the wearable device by analyzing and calculating the communication quality information shared with the terminal device. For details, please refer to the description of the embodiment corresponding to the above step S202, which will not be repeated here. Further, if the wireless device determines that the Bluetooth signal quality is worse than the first signal quality threshold, step S407A is executed, otherwise step S408A is executed.
[0102] S407A: Entering the first communication mode, the wireless device communicates with the second device via the second Bluetooth connection.
[0103] Specifically, because the current Bluetooth signal quality is poor, the wireless device enters the relay mode (i.e., the first communication mode) for communication, that is, the first device (e.g., the terminal device) communicates with the wireless device via the first Bluetooth connection, and the second device (e.g., the wearable device) communicates with the wireless device via the second Bluetooth connection. Please refer to the description of the embodiment corresponding to the above step S203, which will not be repeated here. It should be noted that after entering the first communication mode, the wireless device will still repeatedly obtain communication quality information, and judge the Bluetooth signal quality and switch the corresponding communication mode.
[0104] S408A: Determine whether the Bluetooth signal quality is better than a second signal quality threshold.
[0105] Specifically, after the wireless device determines the Bluetooth signal quality, it determines that the current Bluetooth signal quality is better than the second signal quality threshold. Please refer to the description of the embodiment corresponding to the above step S302, which will not be repeated here. Further, if the wireless device determines that the Bluetooth signal quality is better than the second signal quality threshold, step S409A is executed, otherwise step S410A is executed.
[0106] S409A: Entering the second communication mode, the first device communicates with the second device via a third Bluetooth connection.
[0107] Specifically, the terminal device and the wearable device communicate through the third Bluetooth connection and enter the direct mode (i.e., the second communication mode) for communication. Please refer to the description of the embodiment corresponding to the above step S303, which will not be repeated here. It should be noted that after entering the second communication mode, the wireless device will still repeatedly obtain communication quality information, judge the Bluetooth signal quality and switch the corresponding communication mode.
[0108] S410A: Maintain the current communication mode.
[0109] Specifically, when the wireless device determines that the Bluetooth signal quality between the terminal device and the wearable device is between the first signal quality threshold and the second signal quality threshold, that is, the Bluetooth signal quality is worse than the second signal quality threshold and better than the first signal quality threshold, the current communication mode can be maintained. It can be understood that the communication mode maintained by the wireless device at this time is the above-mentioned relay mode or direct mode. Exemplarily, when the wireless device is in the first communication mode, the Bluetooth signal quality gradually improves, and is better than the first signal quality threshold but not better than the second signal quality threshold, and the wireless device still maintains the first communication mode. In the embodiment of the present application, the Bluetooth signal quality is in the interval area between the first signal quality threshold and the second signal quality threshold. Whether the wireless device adopts direct mode or relay mode communication, the Bluetooth signal quality between the first device and the second device has little effect, so the embodiment of the present application uses this interval as a buffer for switching the communication mode, that is, when the Bluetooth signal quality is in the interval between the first signal quality threshold and the second signal quality threshold, the wireless device maintains the current communication mode to reduce the possibility of frequent switching of the communication mode due to fluctuations in Bluetooth signal quality, and avoid problems such as increased device power consumption, unstable connection, and jamming, delay or disconnection caused by switching, so as to improve the user experience.
[0110] In the embodiment of the present application, steps S401A to S404A describe the process of establishing a first Bluetooth connection and a second Bluetooth connection between a wireless device, a first device (such as a terminal device) and a second device (such as a wearable device). The user can complete the establishment of a Bluetooth network centered on the wireless device through the terminal device, and add a new device to the Bluetooth network in the subsequent process. Steps S405A to S410A describe the process of the wireless device judging and switching the communication mode according to the quality of the Bluetooth signal. It should be noted that after the wireless device enters the first communication mode or the second communication mode, the above steps S405A to S410A can be repeated. For example, when the user's mobile phone and headset are directly connected via Bluetooth, once the user exceeds the Bluetooth coverage range, before the signal drops or attenuates to the extent that the user can notice, it can be seamlessly switched to the second communication mode, that is, indirect communication is completed through the wireless device, and after the user returns to the Bluetooth coverage range, it can automatically switch to the first communication mode. Through the method of the embodiment of the present application, the wireless device can automatically switch the device between communication modes, thereby effectively expanding the communication range between the wearable device and the terminal device, reducing the possibility of Bluetooth communication freezes or disconnections, and improving the user experience.
[0111] See also Figure 4B , Figure 4B It is a flow chart of another communication method of a Bluetooth device provided in an embodiment of the present application.
[0112] The following describes in detail the specific steps of another communication method for a Bluetooth device provided in an embodiment of the present application. The method may include the following steps: S401B: Enable Bluetooth function on terminal devices, wearable devices, wireless devices, etc.
[0113] Specifically, terminal devices, wearable devices, IoT devices, wireless devices, and other devices with Bluetooth functions can all be controlled using the method proposed in this application. Among them, IoT devices can include smart home devices, such as smart bulbs, smart sockets, smart door locks, smart cameras, smart speakers, etc. For example, the terminal device can be used as the above FIG. 2A to FIG. 4A The first device in the method, the wearable device can be used as the above FIG. 2A to FIG. 4A The second device in the method.
[0114] S402B: Scan surrounding devices via Bluetooth of the wireless device.
[0115] Specifically, after the wireless device is started, it can scan the surrounding devices with Bluetooth enabled, and the user can establish a Bluetooth pairing connection between the wireless device and the scanned device. Exemplarily, the wireless device scans the terminal device and a first Bluetooth connection can be established between the wireless device and the terminal device for communication.
[0116] S403B: Establishing a Bluetooth network centered on the wireless device or adding a new device in the terminal device APP with display function.
[0117] Specifically, after the wireless device establishes a Bluetooth connection with surrounding devices through step S402B, a list of applications that have successfully paired with the wireless device through Bluetooth can be displayed on the APP of the terminal device. The user can use the APP to establish a Bluetooth network centered on the wireless device, and manage and add new devices to the Bluetooth network through the APP. For example, the user can control the connection and disconnection of devices in the current Bluetooth network through the APP, and can add new devices scanned by the wireless device to the Bluetooth network. It should be noted that the wireless device can simultaneously control the communication between devices in multiple Bluetooth networks. In the embodiment of the present application, the wireless device controls the communication between the terminal device and the wearable device as an example for description.
[0118] S404B: The wireless device scans again whether there are new devices around.
[0119] Specifically, after the wireless device has established the Bluetooth network, it can also scan whether there are new devices around. If the wireless device scans the existence of a new device, step S403B can be executed, so that the user can add the newly scanned device to the Bluetooth network for management through the APP. If the wireless device does not scan the new device, step S405B is executed.
[0120] S405B: The wireless device obtains paired device information and service type.
[0121] Specifically, the wireless device can obtain device information and communication service information of the terminal device and the wearable device. For details, please refer to the description of the embodiment corresponding to the above step S404A, which will not be repeated here.
[0122] S406B: Obtaining service type (voice call, audio / video data, file transfer, device connection) for service priority determination.
[0123] Specifically, the wireless device can obtain and prioritize the service types of the terminal device and the wearable device to ensure the normal execution of services with high user priority. Service information may include the format, sampling rate, bit rate, communication content, data format, transmission protocol, etc. of audio data. Among them, the communication content may include one or more of voice calls, audio data, video data, file transfer, and device connection. After the wireless device obtains the device information and service information, the wireless device can judge the priority of communication with each wearable device based on this information. The priority judgment can be based on a variety of factors, such as the urgency and importance of the task, the device type, the connection quality, etc. Exemplarily, the wireless device gives priority to the communication transmission of voice calls and audio streams, because they have the greatest impact on the user experience, and it is necessary to give priority to services with high user perception. It should be noted that the specific priority judgment method can be set according to different usage scenarios.
[0124] S407B: Obtain device information (watches, bracelets, mobile phones, headphones, PCs and other Bluetooth devices) for device priority determination.
[0125] Specifically, the wireless device can obtain the device information of the terminal device and the wearable device and make a priority judgment. The device information may include one or more of the device name, MAC address (unique identifier), device type, etc., where the device type may include smart phones, smart watches, Bluetooth headsets, Bluetooth speakers, and other devices. Exemplarily, the wireless device can determine commonly used devices and give them a higher priority based on the user's usage habits and needs; determine the importance and necessity of the device based on user needs and scenario requirements, and the more important the device, the higher the priority.
[0126] S408B: Obtain device Bluetooth standard, RSSI, PER, and location information.
[0127] Specifically, the wireless device obtains the Bluetooth standard, RSSI, PER, and location information between the terminal device and the wearable device to determine the Bluetooth signal quality between the devices. Among them, the Bluetooth standard (i.e., Bluetooth standard or specification) defines the communication protocol and parameters between Bluetooth devices. Different Bluetooth standards have different characteristics such as transmission rate, power consumption, transmission distance and compatibility; RSSI is an important indicator for measuring the strength of the received signal of a Bluetooth device. The larger the RSSI value, the stronger the received signal strength. It should be noted that the RSSI value is usually negative at the receiving end. The smaller the value (i.e., the closer to zero), the higher the receiving sensitivity and the stronger the signal; PER refers to the probability of error during data transmission. It is an important indicator for measuring the quality of Bluetooth communication and reflects the reliability and stability of data transmission. The lower the PER value, the higher the reliability of data transmission; the location information may include the location distance between the Bluetooth device and the connected device.
[0128] S409B: The Bluetooth standard, RSSI, PER, and location information are better than the second signal quality threshold.
[0129] Specifically, the wireless device determines the current Bluetooth signal quality based on the Bluetooth standard, RSSI, PER, and location information. If at least one of the Bluetooth standard, RSSI, PER, and location information is better than the respective second parameter thresholds, the current Bluetooth signal quality is determined to be better than the second signal quality threshold. The second signal quality threshold is a demarcation value for determining whether the Bluetooth signal quality is good. If the Bluetooth signal quality is better than the second signal quality threshold, it means that the current Bluetooth signal quality is good and can meet the connection requirements of the direct mode. If so, the wireless device executes step S410B, and if not, the wireless device executes step S411B.
[0130] S410B: The devices switch to direct communication mode.
[0131] Specifically, if the wireless device determines through step S409B that the quality of the Bluetooth signal between the current devices is good, it switches to the through mode and instructs the terminal device and the wearable device that have established communication to switch the communication mode to the through mode. Exemplarily, in the through mode communication, the terminal device sending the second message to the wearable device may include: the terminal device sends the second message to the wearable device through the third Bluetooth connection, and the wearable device receives the second message through the third Bluetooth connection. When the Bluetooth signal quality is good, the through mode communication can be adopted between the terminal device and the wearable device. After the wireless device switches to the first communication mode, it will return to step S408B and continue to execute the subsequent steps of step S408B, so that the communication mode between the terminal and the wearable device is in dynamic adjustment to ensure that when the Bluetooth signal quality is too poor, the terminal device and the wearable device are still in the through mode, thereby causing communication disconnection, jamming and other problems.
[0132] S411B: Keep the default state.
[0133] Specifically, when the wireless device determines that the Bluetooth signal quality between the terminal device and the wearable device is between the first signal quality threshold and the second signal quality threshold, that is, the Bluetooth signal quality is worse than the second signal quality threshold and better than the first signal quality threshold, the current communication mode can be maintained. It can be understood that the communication mode maintained at this time is the above FIG. 2A to FIG. 4A Relay mode or direct mode as described in .
[0134] S412B: The Bluetooth standard, RSSI, PER, and location information are worse than the first signal quality threshold.
[0135] Specifically, the wireless device determines the quality of the Bluetooth signal between the terminal device and the wearable device based on the Bluetooth standard, RSSI, PER, and location information, that is, if at least one parameter among the Bluetooth standard, RSSI, PER, and location information is worse than the respective first parameter threshold, then the current Bluetooth signal quality is determined to be worse than the first signal quality threshold. Among them, the first signal quality threshold is a demarcation value for determining whether the Bluetooth signal quality is poor. If it is worse than the first signal quality threshold, it means that the current Bluetooth signal quality is poor. If the wireless device enters the direct mode (i.e., the second communication mode) for communication, communication disconnection or jamming may occur, resulting in a poor user experience. It should be noted that one or more thresholds may exist in the wireless device at the same time for determining the quality of the Bluetooth signal. For example, the wireless device may also include a second signal quality threshold, which is a demarcation value for determining whether the Bluetooth signal quality is good. If it is better than the second signal quality threshold, it means that the current Bluetooth signal quality is good. If the wireless device determines that the Bluetooth signal is worse than the first signal quality threshold, step S413B is executed, otherwise it returns to step S408B and continues to execute the subsequent steps of step S408B.
[0136] S413B: The devices switch to relay mode communication.
[0137] Specifically, the wireless device determines through step S412B that the quality of the Bluetooth signal between the current devices is poor, so the wireless device enters the relay mode (i.e., the first communication mode) to communicate, that is, the terminal device communicates with the wireless device through the first Bluetooth connection, and the wearable device communicates with the wireless device through the second Bluetooth connection. Exemplarily, in the first communication mode, the terminal device sending a first message to the wearable device may include: the terminal device sends the first message to the wireless device through the first Bluetooth connection, the wireless device receives the first message through the first Bluetooth connection, the wireless device sends the first message to the wearable device through the second Bluetooth connection, and the wearable device receives the first message through the second Bluetooth connection. Through the forwarding of the wireless device, the communication range between the wearable device and the terminal device can be effectively expanded, the possibility of Bluetooth communication jamming or disconnection can be reduced, and the user experience can be improved.
[0138] In the embodiments of the present application, the specific steps of establishing a Bluetooth network, obtaining mode switching dependency information, and judging and implementing mode switching are described respectively. The wireless device can establish a Bluetooth network with surrounding devices with Bluetooth enabled through a terminal device, and can manage the communication of the device and add new devices through the APP in the wireless device. After confirming each device connected to the Bluetooth network, the wireless device can obtain device information and service information to ensure that devices and services with higher user priority can be executed first, and obtain signal quality information between devices for subsequent communication mode judgment and implementation. The wireless device determines the Bluetooth signal quality based on the obtained signal quality information, and can switch the communication mode according to the current Bluetooth signal quality. Through the forwarding of wireless devices, the communication range between devices can be effectively expanded, the possibility of Bluetooth communication jamming or disconnection can be reduced, and the user experience can be improved.
[0139] See also Figure 5 , Figure 5 A schematic diagram of the structure of a wireless device provided in an embodiment of the present application, the wireless device 500 includes: A first signal receiving unit 501 is used to obtain communication quality information between a first device and a second device, a first Bluetooth connection is established between the first device and the wireless device 500, and the second device is a device within the Bluetooth scanning range of the wireless device 500; The first mode switching unit 502 is used to, if based on the communication quality information, determine that the Bluetooth signal quality between the first device and the second device is worse than the first signal quality threshold, then the wireless device 500 enters the first communication mode; wherein, in the first communication mode, the first device and the second device communicate via the first Bluetooth connection and the second Bluetooth connection, and the second Bluetooth connection is the Bluetooth connection between the wireless device 500 and the second device.
[0140] In one possible implementation, the first mode switching unit 502 is also used to: if it is determined based on the communication quality information that the Bluetooth signal quality is better than the second signal quality threshold, then enter the second communication mode; wherein, in the second communication mode, the first device and the second device communicate via a third Bluetooth connection, and the third Bluetooth connection is a Bluetooth connection between the first device and the second device.
[0141] In a possible implementation, the first mode switching unit 502 is specifically configured to: when entering the first communication mode, instruct the first device and the second device to set the destination address of the Bluetooth communication to the address of the wireless device 500 .
[0142] In a possible implementation, the first mode switching unit 502 is specifically used to: when entering the second communication mode, instruct the first device to set the destination address of Bluetooth communication to the address of the second device; instruct the second device to set the destination address of Bluetooth communication to the address of the first device.
[0143] In a possible implementation, the wireless device 500 further includes a scanning unit 503; the scanning unit 503 is used to perform Bluetooth scanning to discover the first device; and the first mode switching unit 502 is used to establish a first Bluetooth connection with the first device.
[0144] In a possible implementation, the first signal receiving unit 501 is further used to: receive an indication message sent by the first device through the first Bluetooth connection, where the indication message is used to instruct the wireless device 500 to establish a Bluetooth connection with the second device.
[0145] In one possible implementation, the wireless device 500 also includes a first signal sending unit 504; the first signal receiving unit 501 is also used to receive a first message sent by the first device through the first Bluetooth connection; the first signal sending unit 504 is used to forward the first message to the second device through the second Bluetooth connection; the first signal receiving unit 501 is also used to receive a second message sent by the second device through the second Bluetooth connection; the first signal sending unit 504 is also used to forward the second message to the first device through the first Bluetooth connection.
[0146] The present application embodiment provides a wireless device 500, which can be used to implement the above FIG. 2A to FIG. 4A The communication method of the Bluetooth device described above can monitor the RSSI, PER, position distance and other information between the first device (such as a terminal device) and the second device (such as a wearable device) in real time. If the switching requirements are met, the communication mode between the first device and the second device can be dynamically adjusted between the direct mode and the relay mode to provide users with a better communication experience. When switching to the relay mode, the first device and the second device forward messages through the wireless device 500 to achieve indirect communication, which can effectively expand the communication range between the second device and the first device, reduce the possibility of Bluetooth communication freezes or disconnections, and improve the user experience.
[0147] See also Figure 6 , Figure 6 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application, the terminal device 600 includes: The second signal sending unit 601 is used to send the communication quality information between the terminal device 600 and the second device to the wireless device, a first Bluetooth connection is established between the wireless device and the terminal device 600, and the second device is a device within the Bluetooth scanning range of the wireless device; A second signal receiving unit 602, configured to receive a Bluetooth signal quality sent by a wireless device through a first Bluetooth connection, where the Bluetooth signal quality is determined based on the communication quality information; The second mode switching unit 603 is used to determine the quality of the Bluetooth signal. If the Bluetooth signal quality is worse than the first signal quality threshold, the wireless device enters the first communication mode; wherein, in the first communication mode, the terminal device 600 and the second device communicate via the first Bluetooth connection and the second Bluetooth connection, and the second Bluetooth connection is a Bluetooth connection between the wireless device and the second device.
[0148] In one possible implementation, the second mode switching unit 603 is also used to: enter the second communication mode if it is determined that the Bluetooth signal quality is better than the second signal quality threshold; wherein, in the second communication mode, the terminal device 600 communicates with the second device via a third Bluetooth connection, and the third Bluetooth connection is a Bluetooth connection between the terminal device 600 and the second device.
[0149] In one possible implementation, the second mode switching unit 603 is specifically used to: when entering the first communication mode, receive a switching indication sent by the wireless device, the switching indication being used to instruct the first device and the second device to set the destination address of the Bluetooth communication to the address of the wireless device; set the destination address of the Bluetooth communication to the address of the wireless device.
[0150] In one possible implementation, the second mode switching unit 603 is specifically used to: when entering the second communication mode, receive a switching indication sent by the wireless device, the switching indication being used to instruct the first device to set the destination address of the Bluetooth communication to the address of the second device; set the destination address of the Bluetooth communication to the address of the second device.
[0151] In a possible implementation, the second mode switching unit 603 is further configured to: if it is determined that the Bluetooth signal quality is worse than the second signal quality threshold and better than the first signal quality threshold, maintain the current communication mode, which is the first communication mode or the second communication mode.
[0152] In a possible implementation, the second mode switching unit 603 is further configured to establish a first Bluetooth connection with the wireless device; and to build a Bluetooth network centered on the wireless device, wherein the Bluetooth network includes the terminal device 600 and the wireless device.
[0153] In one possible implementation, the terminal device 600 also includes a display module 604; the display module 604 is used to display devices within the Bluetooth scanning range of the wireless device, and the devices within the scanning range include the second device; the second signal sending unit 601 is also used to send an indication message to the wireless device through the first Bluetooth connection, and the indication message is used to instruct the wireless device to establish a Bluetooth connection with the second device.
[0154] The present application embodiment provides a terminal device 600, which can be used to implement the above FIG. 2A to FIG. 4A In the communication method of the Bluetooth device, the terminal device 600 can receive a message sent by the wireless device, and confirm the current Bluetooth signal quality according to the received message to complete the corresponding communication mode switching. When switching to the relay mode, the terminal device 600 and the second device forward the message through the wireless device to achieve indirect communication, which can effectively expand the communication range between the second device and the terminal device 600, reduce the possibility of Bluetooth communication freeze or disconnection, and improve the user experience.
[0155] See also Figure 7 , Figure 7 A schematic diagram of the hardware structure of a terminal device 700 provided in an embodiment of the present application.
[0156] The terminal device 700 may include a processor 701, a memory 702, a wireless communication module 703, a mobile communication module 704, an antenna 703A, an antenna 704A, a power switch 705, a sensor module 706, a focus motor 707, a camera 708, a display screen 709, etc. Among them, the sensor module 706 may include a gyroscope sensor 706A, an acceleration sensor 706B, an ambient light sensor 706C, an image sensor 706D, a distance sensor 706E, etc. Among them, the wireless communication module 703 may include a WLAN communication module, a Bluetooth communication module, etc. The above multiple parts can transmit data through a bus.
[0157] The processor 701 may include one or more processing units, for example, the processor 701 may include an application processor (AP), a modem processor, a graphics processor (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. Different processing units may be independent devices or integrated into one or more processors.
[0158] The memory 702 may be used to store computer executable program codes, and the executable program codes may include instructions. The processor 701 executes various functional applications and data processing of the terminal device 700 by running the instructions stored in the memory 702. The memory 702 may include a program storage area and a data storage area. In a specific implementation, the memory 702 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more disk storage devices, flash memory devices or other non-volatile solid-state storage devices.
[0159] The wireless communication function of the terminal device 700 can be implemented through the antenna 703A, the antenna 704A, the mobile communication module 704, the wireless communication module 703, the modem processor and the baseband processor.
[0160] Antenna 703A and antenna 704A can be used to transmit and receive electromagnetic wave signals. Each antenna in terminal device 700 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
[0161] The mobile communication module 704 can provide wireless communication solutions including 2G / 3G / 4G / 5G etc. applied on the terminal device 700.
[0162] The wireless communication module 703 can provide wireless communication solutions applied to the terminal device 700, including wireless local area networks (WLAN), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc.
[0163] The gyroscope sensor 706A may be used to determine the motion posture of the terminal device 700 .
[0164] The acceleration sensor 706B can detect the magnitude of the acceleration of the terminal device 700 in various directions (generally three axes).
[0165] The terminal device 700 can realize the shooting function through the ISP, the camera 708, the video codec, the GPU, the display screen 709 and the application processor.
[0166] The terminal device 700 can realize the display function through a GPU, a display screen 709, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 709 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 701 may include one or more GPUs, which execute program instructions to generate or change display information.
[0167] The display screen 709 is used to display images, videos, etc. The display screen 709 includes a display panel. In some embodiments, the terminal device 700 may include 1 or N display screens 709, where N is a positive integer greater than 1.
[0168] The structure illustrated in the embodiment of the present application does not constitute a specific limitation on the terminal device 700. In other embodiments of the present application, the terminal device 700 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0169] Any one or more of the wireless communication module 703 , the mobile communication module 704 , the sensor module 706 , the focus motor 707 , the camera 708 , etc. may be used to detect the current environmental characteristics of the terminal device 700 .
[0170] The software system of the terminal device 700 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. The present application embodiment takes a mobile operating system with a layered architecture as an example to exemplify the software structure of the terminal device 700.
[0171] See also Figure 8 , Figure 8 It is a software structure block diagram of the terminal device 700 according to an embodiment of the present application.
[0172] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the mobile operating system is divided into four layers, from top to bottom: application layer, application framework layer / core service layer, system library and runtime, and kernel layer.
[0173] The application layer can include a series of application packages.
[0174] like Figure 8 As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.
[0175] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0176] like Figure 8 As shown, the application framework layer may include window management services, content providers, view systems, phone managers, event managers, notification managers, and the like.
[0177] The window management service is responsible for managing all windows in the system. It is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0178] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0179] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0180] The phone manager is used to provide communication functions for terminal devices, such as the management of call status (including answering, hanging up, etc.).
[0181] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, the terminal device vibrates, the indicator light flashes, etc.
[0182] The runtime can refer to all code libraries, frameworks, etc. required for the program to run. For example, for the C language, the runtime includes a series of function libraries required for the C program to run. For the Java language, in addition to the core library, the runtime also includes the virtual machine required for the Java program to run. The above core library may include the function functions that the Java language needs to call.
[0183] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), graphics synthesizer, etc.
[0184] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0185] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0186] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0187] A 2D graphics engine is a drawing engine for 2D drawings.
[0188] The graphics compositor is responsible for managing and rendering all graphical interface surfaces. The graphics compositor can render, synthesize, and display images of the user interface.
[0189] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
[0190] In the above application embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk), etc.
[0191] A person skilled in the art can understand that to implement all or part of the processes in the above-mentioned application embodiments, the processes can be completed by a computer program to instruct the relevant hardware, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above-mentioned application embodiments. The aforementioned storage medium includes: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
[0192] The embodiments of the present application are described in detail above. The principles and implementations of the present application are described in detail using specific examples herein. The description of the embodiments of the present application is only used to help understand the method and core idea of the present application. At the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation and application scope. In summary, the content of this specification should not be understood as limiting the present application.
Claims
1. A communication method for a Bluetooth device, characterized in that: Applied to a wireless device, the method comprises: Acquire communication quality information between a first device and a second device, wherein a first Bluetooth connection is established between the first device and the wireless device, and the second device is a device within a Bluetooth scanning range of the wireless device; If, based on the communication quality information, it is determined that the Bluetooth signal quality between the first device and the second device is worse than a first signal quality threshold, a first communication mode is entered; wherein, in the first communication mode, the first device and the second device communicate via the first Bluetooth connection and the second Bluetooth connection, and the second Bluetooth connection is a Bluetooth connection between the wireless device and the second device.
2. The method according to claim 1, characterized in that The method further comprises: If, based on the communication quality information, it is determined that the Bluetooth signal quality is better than the second signal quality threshold, the second communication mode is entered; wherein, in the second communication mode, the first device and the second device communicate via a third Bluetooth connection, and the third Bluetooth connection is a Bluetooth connection between the first device and the second device.
3. The method according to claim 2, characterized in that The entering the first communication mode comprises: The first device and the second device are instructed to set a destination address of Bluetooth communication to the address of the wireless device.
4. The method according to claim 2, characterized in that The entering the second communication mode comprises: instructing the first device to set the destination address of Bluetooth communication to the address of the second device; Instruct the second device to set the destination address of Bluetooth communication to the address of the first device.
5. The method according to claim 2, characterized in that The method further comprises: If it is determined based on the communication quality information that the Bluetooth signal quality is worse than the second signal quality threshold and better than the first signal quality threshold, the current communication mode is maintained, and the communication mode is the first communication mode or the second communication mode.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: Discovering the first device through Bluetooth scanning; Establishing the first Bluetooth connection with the first device.
7. The method according to any one of claims 1 to 5, characterized in that: The first device includes a display module, and the method further includes: Displaying, by the display module, devices within a Bluetooth scanning range of the wireless device, wherein the devices within the scanning range include the second device; An indication message sent by the first device is received through the first Bluetooth connection to establish the second Bluetooth connection with the second device, wherein the indication message is used to instruct the wireless device to establish a Bluetooth connection with the second device.
8. The method according to any one of claims 1 to 5, characterized in that: In the first communication mode, the method further includes: receiving a first message sent by the first device through the first Bluetooth connection, and forwarding the first message to the second device through the second Bluetooth connection; or A second message sent by the second device is received through the second Bluetooth connection, and the second message is forwarded to the first device through the first Bluetooth connection.
9. The method according to any one of claims 1 to 5, characterized in that: The first device includes one or more of a smart phone, a tablet computer or a notebook computer, and the second device includes one or more of a Bluetooth headset, a Bluetooth speaker or a smart bracelet.
10. The method according to any one of claims 1 to 5, characterized in that: The communication content between the first device and the second device includes: one or more of: voice call, audio data, video data, file transfer and device connection.
11. The method according to any one of claims 1 to 5, characterized in that: The communication quality information includes: one or more of: Bluetooth standard, received signal strength indication RSSI, packet loss rate PER and location information.
12. A communication method for a Bluetooth device, characterized in that: Applied to a first device, the method includes: Sending communication quality information between the first device and a second device to a wireless device, a first Bluetooth connection is established between the wireless device and the first device, and the second device is a device within a Bluetooth scanning range of the wireless device; If it is determined that the Bluetooth signal quality is worse than a first signal quality threshold, a first communication mode is entered, and the Bluetooth signal quality is determined by the wireless device based on the communication quality information; wherein, in the first communication mode, the first device and the second device communicate through the first Bluetooth connection and the second Bluetooth connection, and the second Bluetooth connection is a Bluetooth connection between the wireless device and the second device.
13. The method according to claim 12, characterized in that The method further comprises: Establishing the first Bluetooth connection with the wireless device; A Bluetooth network centered around the wireless device is established, wherein the Bluetooth network includes the first device and the wireless device.
14. The method according to claim 12 or 13, characterized in that The first device further includes a display module, and the method further includes: Displaying, by the display module, devices within a Bluetooth scanning range of the wireless device, wherein the devices within the scanning range include the second device; An indication message is sent to the wireless device through the first Bluetooth connection, where the indication message is used to instruct the wireless device to establish a Bluetooth connection with the second device.
15. A communication method for a Bluetooth device, characterized in that: Applied to a first device, the method includes: Acquire communication quality information between the first device and a second device, wherein a first Bluetooth connection is established between the first device and a wireless device, and the second device is a device within a Bluetooth scanning range of the wireless device; If, based on the communication quality information, it is determined that the Bluetooth signal quality between the first device and the second device is worse than a first signal quality threshold, a first communication mode is entered; wherein, in the first communication mode, the first device and the second device communicate via the first Bluetooth connection and the second Bluetooth connection, and the second Bluetooth connection is a Bluetooth connection between the wireless device and the second device.
16. The method according to claim 15, characterized in that The entering the first communication mode comprises: sending a third message to the wireless device, wherein the third message is used to request the wireless device to enter the first communication mode; receiving a switching instruction from the wireless device, wherein the switching instruction is used to instruct the first device and the second device to set a destination address of Bluetooth communication to an address of the wireless device; The destination address of the Bluetooth communication is set to the address of the wireless device.
17. A wireless device, characterized in that: include: A first signal receiving unit, configured to obtain communication quality information between a first device and a second device, wherein a first Bluetooth connection is established between the first device and the wireless device, and the second device is a device within a Bluetooth scanning range of the wireless device; A first mode switching unit is configured to, if it is determined based on the communication quality information that the Bluetooth signal quality between the first device and the second device is worse than a first signal quality threshold, then the wireless device enters a first communication mode; wherein, in the first communication mode, the first device and the second device communicate via the first Bluetooth connection and the second Bluetooth connection, and the second Bluetooth connection is a Bluetooth connection between the wireless device and the second device.
18. A terminal device, characterized in that: The terminal device is a first device, and the terminal device includes: A second signal sending unit, configured to send communication quality information between the first device and a second device to a wireless device, a first Bluetooth connection is established between the wireless device and the first device, and the second device is a device within a Bluetooth scanning range of the wireless device; A second mode switching unit is configured to enable the wireless device to enter a first communication mode if the Bluetooth signal quality is worse than a first signal quality threshold, and the Bluetooth signal quality is determined by the wireless device based on the communication quality information; wherein, in the first communication mode, the first device and the second device communicate via the first Bluetooth connection and the second Bluetooth connection, and the second Bluetooth connection is a Bluetooth connection between the wireless device and the second device.
19. An electronic device, characterized in that: The method comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or the instruction, when executed by the processor, implements the steps of the method according to any one of claims 1 to 16.
20. A computer-readable storage medium, characterized in that: The computer-readable medium is used to store program codes, and when the program codes are executed by an electronic device, the method described in any one of claims 1 to 16 is implemented.
21. A computer program product, characterized in that The computer program product comprises instructions, and when the instructions are executed by an electronic device, the electronic device executes the method according to any one of claims 1 to 16.
Citation Information
Patent Citations
Connection control method, device, terminal equipment and system
CN111866831A
Wireless connection control method and device and electronic equipment
CN111988771A
Communication method and device, electronic equipment and storage medium
CN113068168A
Communication method and communication system of wearable equipment and related equipment
CN113365258A
Communication method and communication system of wearable device and related device
CN113596937A