Bluetooth communication method and device, electronic equipment, storage medium and program product

By adjusting the signal transmission power and convolutional code of Bluetooth communication devices in real time, and optimizing Bluetooth communication based on signal strength and data packet loss, the stability and smoothness issues of Bluetooth communication in complex environments are resolved, and communication quality is improved.

CN121645187APending Publication Date: 2026-03-10VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Bluetooth communication quality degrades when the distance is too far or there is environmental interference, leading to signal interruption or connection loss, which affects the stability and smoothness of communication between electronic devices.

Method used

By acquiring signal strength and data packet loss data between electronic devices, the signal transmission power and convolutional code are adjusted to optimize Bluetooth communication quality.

Benefits of technology

It improves the stability and smoothness of Bluetooth communication, ensuring communication quality under different signal strengths and interference environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121645187A_ABST
    Figure CN121645187A_ABST
Patent Text Reader

Abstract

The invention discloses a Bluetooth communication method and device, electronic equipment, a storage medium and a program product, and belongs to the technical field of communication. The method comprises the steps that under the condition that first electronic equipment is in Bluetooth connection with second electronic equipment, a first parameter is obtained, and the first parameter comprises at least one of the following parameters: the signal strength between the first electronic equipment and the second electronic equipment and the data packet loss number between the first electronic equipment and the second electronic equipment; and based on the first parameter, adjusting the signal transmitting power and / or a convolutional code of the first electronic device, the convolutional code being a convolutional code adopted when the first electronic device encodes the transmitted data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of communication technology, specifically relating to a Bluetooth communication method, device, electronic device, storage medium, and program product. Background Technology

[0002] Bluetooth technology, as a short-range wireless communication standard, has replaced the traditional wired connection method. It is convenient and quick to connect and can perform adaptive frequency hopping to resist interference. It is often used in scenarios involving audio data transmission.

[0003] When electronic devices are in environments without mobile networks, such as outdoor activities like hiking, cave exploration, or camping, users can use their devices' Bluetooth communication function to communicate with other devices via voice. However, factors such as excessive distance or environmental interference can severely affect the quality of Bluetooth communication. Therefore, ensuring the quality of Bluetooth communication between electronic devices is a problem that urgently needs to be solved. Summary of the Invention

[0004] The purpose of this application is to provide a Bluetooth communication method, apparatus, electronic device, storage medium, and program product that can improve the quality of Bluetooth communication between electronic devices.

[0005] In a first aspect, embodiments of this application provide a Bluetooth communication method, the method comprising: when a first electronic device and a second electronic device are connected via Bluetooth, acquiring a first parameter, the first parameter including at least one of the following: signal strength between the first electronic device and the second electronic device, and the number of data packet losses between the first electronic device and the second electronic device. Based on the first parameter, adjusting the signal transmission power and / or convolutional code of the first electronic device, the convolutional code being the convolutional code used by the first electronic device when encoding the transmitted data.

[0006] Secondly, embodiments of this application provide a Bluetooth communication device, comprising: an acquisition module and an execution module. The acquisition module is configured to acquire a first parameter when a first electronic device and a second electronic device are connected via Bluetooth. The first parameter includes at least one of the following: the signal strength between the first electronic device and the second electronic device, and the number of data packet losses between the first electronic device and the second electronic device. The execution module is configured to adjust the signal transmission power and / or convolutional code of the first electronic device based on the first parameter acquired by the acquisition module. The convolutional code is the convolutional code used by the first electronic device when encoding transmitted data.

[0007] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, wherein the memory stores programs or instructions executable on the processor, and the programs or instructions, when executed by the processor, implement the steps of the method described in the first aspect.

[0008] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.

[0009] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the method as described in the first aspect.

[0010] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the method described in the first aspect.

[0011] In this embodiment, when a first electronic device and a second electronic device are connected via Bluetooth, the first electronic device can obtain a first parameter, which includes at least one of the following: the signal strength between the first and second electronic devices, and the number of data packet losses between the first and second electronic devices. Based on the first parameter, the first electronic device can adjust its signal transmission power and / or the convolutional code used for encoding the transmitted data. In this solution, when the first electronic device is connected to another electronic device via Bluetooth, it can adjust its transmission power and / or the convolutional code used for encoding the transmitted data based on at least one of the current signal strength between the two electronic devices and the number of data packet losses between them. That is, the stability of Bluetooth communication between the two electronic devices can be determined by the signal strength between them, allowing the first electronic device to adjust its signal transmission power and / or the convolutional code used for encoding the transmitted data during the Bluetooth communication process. Furthermore, signal transmission power and convolutional code are factors affecting the stability and other quality aspects of Bluetooth communication; different signal strengths require different signal transmission power and / or convolutional code. Therefore, by adjusting the signal transmission power and / or convolutional code of the first electronic device for Bluetooth communication, the stability and other quality aspects of Bluetooth communication can be improved. Alternatively, since the amount of data packet loss between two electronic devices affects the smoothness of Bluetooth communication, the smoothness of Bluetooth communication can be judged by the amount of data packet loss between the two electronic devices. This allows for adjustments to the signal transmission power of the first electronic device and / or the convolutional code used for encoding the transmitted data during the Bluetooth communication process. Furthermore, signal transmission power and convolutional codes are factors affecting the smoothness and other quality aspects of Bluetooth communication. In other words, different amounts of data packet loss require different signal transmission power and / or convolutional code. Therefore, by adjusting the signal transmission power and / or convolutional code of the first electronic device for Bluetooth communication, the smoothness and other quality aspects of Bluetooth communication can be improved. Thus, by selecting appropriate signal transmission power and / or the convolutional code used for encoding, the communication quality of Bluetooth communication is improved. Attached Figure Description

[0012] Figure 1 This is one of the flowcharts of the Bluetooth communication method provided in the embodiments of this application;

[0013] Figure 2 This is the second flowchart of the Bluetooth communication method provided in the embodiments of this application;

[0014] Figure 3 This is the third flowchart of the Bluetooth communication method provided in the embodiments of this application;

[0015] Figure 4 This is the fourth flowchart of the Bluetooth communication method provided in the embodiments of this application;

[0016] Figure 5This is a schematic diagram of the Bluetooth connection process provided in an embodiment of this application;

[0017] Figure 6 This is a schematic diagram of the voice intercom interface provided in an embodiment of this application;

[0018] Figure 7 This is a schematic diagram illustrating the execution process of the Bluetooth communication method provided in the embodiments of this application;

[0019] Figure 8 This is a schematic diagram of the Bluetooth communication device provided in the embodiments of this application;

[0020] Figure 9 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application;

[0021] Figure 10 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0022] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0023] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0024] The terms "at least one," "at least one," etc., in this application refer to any one, any two, or a combination of two or more of the included objects. For example, at least one of a, b, and c can mean: "a," "b," "c," "a and b," "a and c," "b and c," and "a, b, and c," where a, b, and c can be single or multiple. Similarly, "at least two" refers to two or more, and its meaning is similar to that of "at least one."

[0025] The Bluetooth communication method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.

[0026] This application's embodiments can be applied to scenarios where electronic devices use Bluetooth technology for short-range wireless communication. Examples include outdoor adventures, emergency communications, commercial venues, tourist guides, building navigation, and personal communications, where multiple electronic devices communicate via Bluetooth.

[0027] It should be noted that the embodiments of this application are illustrated using Bluetooth communication between two electronic devices (a first electronic device and a second electronic device). The solution of this application can also be applied to Bluetooth communication between more than two electronic devices.

[0028] For example, taking outdoor adventure as an example, the embodiments of this application can be applied to scenarios in outdoor adventure activities where team members use electronic devices to communicate via Bluetooth to maintain contact in areas without mobile network coverage.

[0029] For example, taking emergency communication as an example, the embodiments of this application can be applied to scenarios in emergency service fields such as policing, fire fighting, and rescue, where staff communicate in real time in complex and harsh environments.

[0030] For example, taking commercial venues as an example, the embodiments of this application can be applied to scenarios in commercial venues such as hotels, shopping malls, and exhibition halls where employees maintain communication between different areas to provide timely services.

[0031] For example, taking tourist guides as an example, the embodiments of this application can be applied to scenarios where tour guides use electronic devices to transmit explanation information to tourists via Bluetooth communication in tourist attractions such as museums, historical sites, and parks.

[0032] For example, taking building logistics as an example, the embodiments of this application can be applied to scenarios in construction sites and logistics distribution where workers and drivers maintain contact and coordinate workflows in environments with obstructed visibility or high noise levels.

[0033] For example, taking personal communication as an example, the embodiments of this application can be applied to scenarios where friends and family members have private conversations at outdoor gatherings or events without being disturbed by the surrounding crowd.

[0034] Currently, electronic devices can use Bluetooth communication to communicate with each other. However, because Bluetooth technology is a short-range communication technology, factors such as excessive distance or environmental interference can severely affect the quality of Bluetooth communication, causing signal interruptions or even disconnections between electronic devices. Therefore, ensuring the quality of Bluetooth communication between electronic devices is an urgent problem to be solved.

[0035] This application provides a Bluetooth communication method. When a first electronic device and a second electronic device are connected via Bluetooth, the first electronic device can obtain a first parameter, which includes at least one of the following: the signal strength between the first and second electronic devices, and the number of data packet losses between the first and second electronic devices. Based on the first parameter, the first electronic device can adjust its signal transmission power and / or the convolutional code used for encoding the transmitted data. In this solution, when the first electronic device is connected to another electronic device via Bluetooth, it can adjust its transmission power and / or the convolutional code used for encoding the transmitted data based on at least one of the current signal strength between the two electronic devices and the number of data packet losses between them. That is, the stability of Bluetooth communication between the two electronic devices can be determined by the signal strength between them, allowing the first electronic device to adjust its signal transmission power and / or the convolutional code used for encoding the transmitted data during the Bluetooth communication process. Furthermore, signal transmission power and convolutional code are factors affecting the stability and other quality aspects of Bluetooth communication. In other words, different signal strengths require different signal transmission power and / or convolutional code. Therefore, by adjusting the signal transmission power and / or convolutional code of the first electronic device for Bluetooth communication, the stability and other quality aspects of Bluetooth communication can be improved. Alternatively, since the amount of data packet loss between two electronic devices affects the smoothness of Bluetooth communication, the smoothness of Bluetooth communication can be judged by the amount of data packet loss between the two electronic devices. This allows for adjustments to the signal transmission power of the first electronic device and / or the convolutional code used for encoding the transmitted data during the Bluetooth communication process. Furthermore, signal transmission power and convolutional codes are factors affecting the smoothness and other quality aspects of Bluetooth communication. In other words, different amounts of data packet loss require different signal transmission power and / or convolutional code. Therefore, by adjusting the signal transmission power and / or convolutional code of the first electronic device for Bluetooth communication, the smoothness and other quality aspects of Bluetooth communication can be improved. Thus, by selecting appropriate signal transmission power and / or the convolutional code used for encoding, the communication quality of Bluetooth communication is improved.

[0036] The Bluetooth communication method provided in this application can be implemented by a Bluetooth communication device, which can be an electronic device, or a functional module or functional entity within an electronic device. The following description uses an electronic device as an example to illustrate the technical solution provided in this application.

[0037] Figure 1 A flowchart of a Bluetooth communication method provided in an embodiment of this application is shown, as follows: Figure 1 As shown, the Bluetooth communication method provided in this application embodiment may include the following steps 201 and 202.

[0038] Step 201: When the first electronic device and the second electronic device are connected via Bluetooth, the first electronic device acquires the first parameter.

[0039] In this embodiment of the application, the first parameter includes at least one of the following: the signal strength between the first electronic device and the second electronic device, and the number of data packets lost between the first electronic device and the second electronic device.

[0040] It should be noted that Bluetooth is an open global standard for wireless data and voice communication. It's a special short-range wireless technology that establishes a communication environment for fixed and mobile devices based on low-cost, short-range wireless connections (typically within 10 meters). Bluetooth technology, based on low-cost, short-range wireless connections, can establish a communication environment for both fixed and mobile electronic devices, allowing various electronic devices such as mobile phones, computers, headphones, and printers to communicate or operate with each other without wires or cables.

[0041] The Bluetooth connection described above establishes a wireless communication link between two or more electronic devices using Bluetooth technology. When multiple electronic devices are connected via Bluetooth, they can perform data transmission, audio stream sharing, or other forms of interaction.

[0042] In this embodiment, the first electronic device can acquire the signal strength, i.e., the signal strength between the first electronic device and the second electronic device, every preset time interval (e.g., 200ms). The signal strength can be the strength of the signal received in Bluetooth communication, and can be a received signal strength indication value, which is a negative number representing the received signal power.

[0043] It's important to note that this signal strength is related to the distance between Bluetooth devices. When Bluetooth devices are closer together, the received signal strength indicator (SSM) value is higher, indicating a better signal strength; conversely, when the distance is greater, the SSM value is lower, indicating a weaker signal strength. In practical applications, signal strength in Bluetooth communication is a key factor affecting communication stability and other quality aspects. If the signal strength is too low, it may lead to unstable connections or even disconnection between devices.

[0044] In this embodiment of the application, the aforementioned data packet loss count refers to the number of data packets that are continuously sent by the first electronic device to the second electronic device but fail to be successfully delivered to the second electronic device during the data transmission process. For example, if data is sent once every preset time interval (e.g., 40ms), and data packets are lost multiple times consecutively (e.g., 3 times), then 120ms of data is considered as continuously sent data packets that fail to be successfully delivered to the second electronic device.

[0045] It should be noted that the data transmitted from the first electronic device to the second electronic device is encoded data. For example, voice / audio data can be encoded using an Adaptive Multi-Rate Narrowband (AMRNB) audio codec. Then, encoded data is recorded every preset interval (e.g., 40ms) and transmission begins. According to the Bluetooth Low Energy (BLE) communication mechanism, if the link layer does not receive confirmation from the receiver when sending a data packet, it will attempt to retransmit the data packet until successful confirmation is received. If the link layer data packet fails to be transmitted multiple times, it will block the Bluetooth Low Energy write data interface of the electronic device's system framework. In this case, because the write data interface is blocked, new data cannot be accepted or processed, and new audio data will be discarded.

[0046] Step 202: The first electronic device adjusts its signal transmission power and / or convolutional code based on the first parameter.

[0047] In this embodiment of the application, the convolutional code is the convolutional code used by the first electronic device when encoding the transmitted data.

[0048] In this embodiment, the aforementioned signal transmission power refers to the power used by the electronic device when transmitting wireless signals. This power determines the communication range and penetration capability of the electronic device's Bluetooth communication. Specifically, a higher signal transmission power results in a greater communication range and penetration capability, but also higher power consumption. Conversely, a lower signal transmission power results in a smaller communication range and penetration capability, but also lower power consumption. For example, the maximum signal transmission power of the electronic device can reach +20dB, at which point the Bluetooth communication range and penetration capability are maximized, but power consumption is high. The minimum signal transmission power of the electronic device can be -20dB, at which point the Bluetooth communication range and penetration capability are lower, but power consumption is also lower, improving the battery life of the electronic device. Therefore, by adjusting the signal transmission power, a better balance can be achieved between the communication quality of Bluetooth communication and the power consumption of the electronic device.

[0049] In this embodiment, the electronic device can adjust its signal transmission power using Low Energy Power Control. Low Energy Power Control is a bidirectional power control protocol for Bluetooth Low Energy defined in the Bluetooth 5.2 standard. It optimizes power consumption by adjusting the power levels of both communicating parties, while simultaneously improving the stability and reliability of the device connection.

[0050] In this embodiment, the convolutional code is a commonly used forward error correction coding technique in Bluetooth communication. This technique increases the system's error detection and correction capabilities by converting the input information sequence into a redundant code sequence. It can resist noise and interference in the channel to a certain extent, thereby improving the reliability of the communication system. It is widely used in wireless communication, especially in situations where it is necessary to improve the system's anti-noise and anti-fading performance.

[0051] In this embodiment, Bluetooth 5.0 can use convolutional codes of 2x to 8x at the physical layer. When using 8x convolutional codes at the Bluetooth physical layer of an electronic device, the signal sensitivity can be improved by 12dB compared to an electronic device without convolutional codes, significantly increasing the coverage distance of the communication signal. When using 2x convolutional codes at the Bluetooth physical layer of an electronic device, the amount of data it carries (i.e., the redundant coding portion) is one-quarter of that of 8x convolutional codes. This means that when transmitting data at high power, the power consumption increase will be three-quarters lower than that of 8x convolutional codes. Measurements show that the power consumption of transmitting 5kbps data using 8x convolutional codes is approximately 100mA, while the power consumption of transmitting 5kbps data using 2x convolutional codes is approximately 30mA, significantly reducing power consumption compared to 8x convolutional codes. When two electronic devices are connected via Bluetooth, the choice between 8x and 2x convolutional codes is determined by the transmitting party, without needing negotiation with the receiving party.

[0052] It's understandable that a stronger signal results in more stable Bluetooth communication, requiring less signal transmission power or convolutional code; conversely, a weaker signal results in less stable Bluetooth communication, requiring more signal transmission power or convolutional code. Similarly, fewer packet losses result in smoother Bluetooth communication, requiring less signal transmission power or convolutional code; conversely, more packet losses result in poorer Bluetooth communication, requiring more signal transmission power or convolutional code.

[0053] Optionally, in this embodiment of the application, the first parameter mentioned above includes the signal strength. For example, in combination with... Figure 1 ,like Figure 2 As shown, step 202 can be implemented by any one of steps 202a and 202b below.

[0054] Step 202a: When the signal strength is less than or equal to the first threshold, the first electronic device increases the signal transmission power of the first electronic device, and / or switches the convolutional code used by the first electronic device to the maximum convolutional code when encoding the transmitted data.

[0055] In this embodiment of the application, the first electronic device can acquire a received signal strength indication value every preset time interval. If the received signal strength indication value is less than or equal to a first threshold (e.g., -85dB) for a preset number of consecutive times, the first electronic device determines that the current signal strength is weak, that is, the stability and other quality of Bluetooth communication are poor. Then, the first electronic device can increase the signal transmission power and / or use maximum convolutional code to encode the transmitted data to improve the communication quality of Bluetooth communication.

[0056] It should be noted that the above-mentioned maximum convolutional code refers to the convolutional code that can provide the maximum communication distance and the best performance in specific application scenarios.

[0057] Optionally, in this embodiment of the application, the electronic device may pre-set multiple preset convolutional codes, and the aforementioned maximum convolutional code may be the largest convolutional code among these multiple preset convolutional codes. Alternatively, the aforementioned maximum convolutional code may also be the largest convolutional code that the first electronic device can effectively utilize under the hardware limitations and system performance requirements of the electronic device when encoding transmitted data.

[0058] Similarly, the minimum convolutional code described below can be the minimum convolutional code among multiple preset convolutional codes pre-set by the electronic device, or the minimum convolutional code described below can also be the minimum convolutional code that the first electronic device can effectively use under the hardware limitations and system performance requirements of the electronic device when encoding transmitted data.

[0059] Optionally, in this embodiment of the application, the maximum convolutional code can be a preset maximum convolutional code, such as an 8x convolutional code.

[0060] In this way, the first electronic device can determine the current signal strength and increase the signal transmission power and / or use maximum convolutional coding when the signal strength is weak, so as to improve the communication distance and penetration capability of Bluetooth communication and maximize the error detection and correction capability, thereby maintaining the communication quality of Bluetooth communication when the signal strength is weak.

[0061] Step 202b: When the signal strength is greater than or equal to the second threshold, the first electronic device reduces the signal transmission power of the first electronic device and / or switches the convolutional code used by the first electronic device to the minimum convolutional code when encoding the transmitted data.

[0062] In this embodiment of the application, the first electronic device can acquire a received signal strength indication value every preset time interval. If the received signal strength indication value is greater than or equal to a second threshold (e.g., -80dB) for a preset number of consecutive times, the first electronic device determines that the current signal strength is strong, that is, the stability and other quality of Bluetooth communication are good. Then, the first electronic device can reduce the signal transmission power and / or use the minimum convolution code to encode the transmitted data to reduce the power consumption of the electronic device.

[0063] Optionally, in this embodiment of the application, the aforementioned minimum convolutional code can be a preset minimum convolutional code, such as a 2x convolutional code.

[0064] In this embodiment of the application, the second threshold is greater than the first threshold.

[0065] In this way, the first electronic device can determine the current signal strength and reduce the signal transmission power and / or use minimum convolution code for encoding when the signal strength is strong, so that the first electronic device can reduce the power consumption of Bluetooth communication without affecting the quality of Bluetooth communication, thereby improving the battery life of the first electronic device when conducting Bluetooth communication.

[0066] Optionally, in this embodiment of the application, the first parameter mentioned above includes at least the number of data packet losses. For example, combined with... Figure 1 ,like Figure 3 As shown, step 202 can be implemented by any one of steps 202c and 202d below.

[0067] Step 202c: If the number of data packet losses is greater than or equal to the third threshold, the first electronic device adjusts its signal transmission power to the maximum transmission power and / or switches the convolutional code used by the first electronic device to the maximum convolutional code when encoding the transmitted data.

[0068] Typically, data packet loss can cause the write data interface to become blocked, preventing the acceptance or processing of new data and resulting in the discarding of new audio data. When new audio data is discarded multiple times consecutively, it will affect the smoothness and quality of Bluetooth communication. Therefore, this embodiment of the application can determine the smoothness of the current Bluetooth communication by detecting the number of data packet losses, and adjust the signal transmission power and convolutional code to improve communication quality when the smoothness of Bluetooth communication is poor.

[0069] In this embodiment, when a large number of data packet losses are detected, indicating Bluetooth communication disruption, the convolutional code used for encoding can be switched to maximum convolutional code in a timely manner, and maximum transmit power can be used for transmission, thus avoiding further stuttering issues. At this time, low-power control cannot be relied upon, because in the event of impending signal disruption, such an automatic control mechanism may not react quickly enough or adjust insufficiently. Instead, a custom interface for forcing maximum power mode needs to be provided to the upper-layer software or application, offering a more direct and rapid power boost. This allows the upper-layer software or application to determine and trigger the use of maximum power when Bluetooth communication disruption is detected, in order to address sudden signal problems.

[0070] Optionally, in this embodiment of the application, the electronic device may have multiple preset transmission powers, and the maximum transmission power may be the maximum transmission power among these multiple preset transmission powers. Alternatively, the maximum transmission power may also be the maximum transmission power that the electronic device can effectively utilize under the hardware limitations and system performance requirements of the electronic device when transmitting signals.

[0071] Optionally, in this embodiment of the application, the maximum transmission power can be a preset maximum transmission power, such as +20dB.

[0072] In this embodiment of the application, the first electronic device can monitor whether data packets are lost. If the number of data packets lost is greater than or equal to a third threshold, the first electronic device determines that the current data transmission is not smooth and affects the smoothness and quality of Bluetooth communication. Then, the first electronic device can adjust the signal transmission power to the maximum transmission power and / or use the maximum convolution code to encode the transmitted data.

[0073] For example, when the first electronic device loses more than or equal to 3 data packets during Bluetooth communication, such as voice data of more than 120ms that are continuously sent but fail to be delivered to the second electronic device, the voice conversation will be obviously interrupted. At this time, even if the received signal strength indicator value is high, there will be a problem of unsmooth data transmission, that is, there may be signal interference. In this case, the first electronic device can adjust the signal transmission power to the preset maximum transmission power + 20dB, and / or use 8x convolutional code encoding to improve the anti-interference capability of Bluetooth communication.

[0074] In this way, the first electronic device can judge the smoothness of the current Bluetooth communication in real time by the number of data packet loss, and use the maximum signal transmission power and / or the maximum convolution code for encoding when the smoothness is low, so as to improve the anti-interference capability of Bluetooth communication and maintain the communication quality of Bluetooth communication when the first electronic device is subjected to signal interference.

[0075] Furthermore, since the first electronic device can monitor the number of data packet losses, and it acquires the received signal strength indicator value every preset time interval, the method of determining whether to adjust the transmit power and / or convolutional code based on the received signal strength indicator value may be limited by the acquisition frequency, potentially leading to untimely acquisition. Using the number of data packet losses to determine whether to adjust the transmit power and / or convolutional code, that is, using the smoothness of data transmission as the criterion, provides better real-time performance than relying solely on the received signal strength indicator value. Moreover, even under conditions of high signal strength, there may be interference within the same frequency band, causing transmission congestion. This would prevent the determination of whether to adjust the transmit power and / or convolutional code based solely on the received signal strength indicator value; instead, the number of data packet losses would be used to determine whether interference has occurred, thus requiring a decision on whether to adjust the transmit power and / or convolutional code.

[0076] Step 202d: If the number of data packet losses is less than the third threshold, the first electronic device reduces the signal transmission power of the first electronic device and / or switches the convolutional code used by the first electronic device to the minimum convolutional code when encoding the transmitted data.

[0077] In this embodiment, the first electronic device can monitor whether data packets are lost and acquire a received signal strength indication value every preset time interval. If the number of data packets lost is less than a third threshold, the first electronic device determines that the current data transmission is smooth, the Bluetooth communication is of good quality, and the current signal strength is strong. In this case, the first electronic device can reduce the signal transmission power and use minimum convolutional codes to encode the transmitted data.

[0078] Optionally, in this embodiment of the application, when the number of data packet loss is less than the third threshold, the first electronic device can determine the signal strength to determine whether to adjust the signal transmission power and / or convolutional code. For example, when the signal strength is greater than or equal to the second threshold, the first electronic device can determine that the current Bluetooth communication is smooth and of good quality, and the current signal strength is strong. In this case, the first electronic device can reduce the signal transmission power of the first electronic device and / or switch the convolutional code used by the first electronic device to encode the transmitted data to the minimum convolutional code.

[0079] In this way, the first electronic device can judge the smoothness of the current Bluetooth communication in real time by the number of data packet loss, and reduce the signal transmission power and / or use minimum convolution code for encoding when the smoothness is high, so that the first electronic device can reduce the power consumption of Bluetooth communication without affecting the quality of Bluetooth communication, thereby improving the battery life of the first electronic device when conducting Bluetooth communication.

[0080] Optionally, in this embodiment, when the first parameter includes the number of data packet losses and the signal strength:

[0081] (1) If the signal strength is greater than or equal to the second threshold and the number of lost packets is greater than or equal to the third threshold, the first electronic device will adjust the signal transmission power of the first electronic device to the maximum transmission power, and / or switch the convolutional code used by the first electronic device to the maximum convolutional code when encoding the transmitted data.

[0082] (2) If the signal strength is greater than or equal to the second threshold and the number of lost packets is less than the third threshold, the first electronic device reduces the signal transmission power of the first electronic device and / or switches the convolutional code used by the first electronic device to the minimum convolutional code when encoding the transmitted data (i.e., step 202d above).

[0083] (3) If the signal strength is less than the second threshold and the number of packet losses is less than the third threshold, the first electronic device can adjust the signal transmission power and convolutional code according to the signal strength, increasing the signal transmission power of the first electronic device and / or switching the convolutional code used by the first electronic device to encode the transmitted data to the maximum convolutional code. Alternatively, the electronic device can adjust the signal transmission power and convolutional code according to the number of packet losses, decreasing the signal transmission power of the first electronic device and / or switching the convolutional code used by the first electronic device to encode the transmitted data to the minimum convolutional code.

[0084] (4) If the signal strength is less than the second threshold and the number of lost packets is greater than or equal to the third threshold, the first electronic device will adjust the signal transmission power of the first electronic device to the maximum transmission power, and / or switch the convolutional code used by the first electronic device to the maximum convolutional code when encoding the transmitted data.

[0085] Optionally, in the embodiments of this application, when the first electronic device adjusts the signal transmission power and the convolutional code, it can adjust the signal transmission power separately, or it can adjust the convolutional code separately, or the first electronic device can adjust the signal transmission power and the convolutional code simultaneously.

[0086] For example, when the first electronic device adjusts both the signal transmission power and the convolutional code, step 202d above can be: if the number of data packet loss is less than the third threshold, and the signal strength is greater than or equal to the second threshold, then the first electronic device lowers its signal transmission power and switches the convolutional code used by the first electronic device to encode the transmitted data to the minimum convolutional code.

[0087] Optionally, in this embodiment of the application, after step 202b or step 202d above, the Bluetooth communication method provided in this embodiment of the application further includes step 203 as described below.

[0088] Step 203: Upon detecting the third voice data to be transmitted, the first electronic device encodes the third voice data using the minimum convolutional code and the target bit rate, and sends the encoded third voice data to the second electronic device.

[0089] In this embodiment of the application, the target bitrate is greater than the preset bitrate corresponding to the voice type data.

[0090] It should be noted that the bitrate mentioned above refers to the ratio of useful data in the encoded data stream to the entire data stream in a communication system. Bitrate is an important performance indicator, reflecting the redundancy in the encoding process and the system's effective data transmission capability. A higher bitrate means more information is contained in each transmitted symbol, but interference resistance may decrease; a lower bitrate results in more reliable data transmission, but lower transmission efficiency. For the embodiments of this application, the bitrate determines the size and sound quality of the voice data during voice communication. A higher bitrate means more information in the voice data and better sound quality, but the corresponding file size is also larger. While lower bitrate voice data is smaller in size, sound quality is sacrificed.

[0091] In this embodiment of the application, when using the minimum convolutional code for encoding, the first electronic device can use a higher code rate for encoding, such as 4750, 5150, 5900, 6700, 7400, 7950, 10200, 12200, etc., so that the first electronic device can provide clearer voice when the signal strength is high or the signal interference is low.

[0092] In this embodiment, the use of minimum convolutional codes for Bluetooth communication by the first electronic device indicates a strong signal strength, thereby allowing for a higher bit rate to improve the audio quality of the voice intercom. When the first electronic device uses minimum convolutional codes for Bluetooth communication, upon detecting third voice data to be transmitted, the first electronic device can use minimum convolutional codes and a target bit rate higher than the preset bit rate corresponding to the voice type to encode the third voice data, and then send the encoded third voice data to the second electronic device.

[0093] In this way, when the signal strength of the electronic device is strong, the first electronic device can encode the third voice data at a higher bit rate and send it to the second electronic device, thereby improving the sound quality of the voice intercom without affecting the Bluetooth communication quality.

[0094] This application provides a Bluetooth communication method. When a first electronic device is connected to another electronic device via Bluetooth, it can adjust its transmission power and / or the convolutional code used for encoding the transmitted data based on at least one of the signal strength between the two electronic devices and the number of data packet losses between them. That is, the stability of Bluetooth communication between the two electronic devices can be determined by the signal strength between them, allowing the first electronic device to adjust its signal transmission power and / or the convolutional code used for encoding the transmitted data during the Bluetooth communication process. Furthermore, signal transmission power and convolutional code are factors affecting the stability and other quality aspects of Bluetooth communication; different signal strengths require different signal transmission power and / or convolutional code. Therefore, by adjusting the signal transmission power and / or convolutional code of the first electronic device for Bluetooth communication, the stability and other quality aspects of Bluetooth communication can be improved. Alternatively, since the amount of data packet loss between two electronic devices affects the smoothness of Bluetooth communication, the smoothness of Bluetooth communication can be judged by the amount of data packet loss between the two electronic devices. This allows for adjustments to the signal transmission power of the first electronic device and / or the convolutional code used for encoding the transmitted data during the Bluetooth communication process. Furthermore, signal transmission power and convolutional codes are factors affecting the smoothness and other quality aspects of Bluetooth communication. In other words, different amounts of data packet loss require different signal transmission power and / or convolutional code. Therefore, by adjusting the signal transmission power and / or convolutional code of the first electronic device for Bluetooth communication, the smoothness and other quality aspects of Bluetooth communication can be improved. Thus, by selecting appropriate signal transmission power and / or the convolutional code used for encoding, the communication quality of Bluetooth communication is improved.

[0095] Optionally, in the embodiments of this application, combined with Figure 1 ,like Figure 4 As shown, prior to step 201 above, the Bluetooth communication method provided in this application embodiment further includes steps 301 and 302 as described below.

[0096] Step 301: With Bluetooth enabled, the first electronic device encodes the signal using a preset maximum convolutional code and transmits the encoded signal using a preset maximum transmission power.

[0097] In this embodiment of the application, the signal includes the identifier and address information of the first electronic device.

[0098] Optionally, in the embodiments of this application, the above-mentioned identifier includes, but is not limited to, at least one of the following: the device name of the first electronic device, the device icon of the electronic device, etc.

[0099] In this embodiment of the application, the address information mentioned above can be the Bluetooth address of the electronic device, which is a 48-bit unique identifier used for mutual identification and establishment of Bluetooth connections between electronic devices.

[0100] In this embodiment of the application, before the first electronic device scans the second electronic device or establishes a connection with the second electronic device, since the signal strength between the two electronic devices is unknown, in order to prevent poor Bluetooth communication quality between the first electronic device and the second electronic device when the signal strength is low, the first electronic device defaults to using a preset maximum convolutional code and a preset maximum transmit power to transmit the signal, so as to ensure that the second electronic device can receive the signal transmitted by the first electronic device.

[0101] Step 302: Upon receiving a Bluetooth connection request from the second electronic device, the first electronic device establishes a Bluetooth connection with the second electronic device.

[0102] In this embodiment, when the first electronic device is not connected to the second electronic device via Bluetooth, and the first electronic device has its Bluetooth function enabled, it can encode a signal including the identifier and address information of the first electronic device using a preset maximum convolutional code, and transmit the encoded signal using a preset maximum transmission power. The second electronic device can detect this signal and display the identifier of the first electronic device. The second electronic device can send a Bluetooth connection request to the first electronic device based on the address information of the first electronic device. Upon receiving the Bluetooth connection request from the second electronic device, the first electronic device establishes a Bluetooth connection with the second electronic device.

[0103] For example, such as Figure 5 As shown in (a), when the first electronic device is not connected to the second electronic device via Bluetooth, the first electronic device can display a Bluetooth connection control. The user can input information into this control to enable Bluetooth on the first electronic device. The signal, including the identifier and address information of the first electronic device, is encoded using 8x convolutional coding, and the encoded signal is transmitted using a preset maximum transmission power. Figure 5 As shown in (b), when the second electronic device detects the signal, it can display the identifier of the first electronic device. The user can then input the identifier of the first electronic device, allowing the second electronic device to send a Bluetooth connection request to the first electronic device based on the address information of the first electronic device corresponding to that identifier. This enables the first electronic device to establish a Bluetooth connection with the second electronic device upon receiving the Bluetooth connection request.

[0104] In this way, the first electronic device can encode the signal using a preset maximum convolutional code and transmit the encoded signal using a preset maximum transmission power, so that the signal has a larger coverage area and stronger anti-interference capability, thereby improving the recognition effect of the second electronic device on the signal and facilitating the establishment of a Bluetooth connection between the two electronic devices.

[0105] Optionally, in this embodiment of the application, after step 302 above, the Bluetooth communication method provided in this embodiment of the application further includes steps 401 to 403 as described below.

[0106] Step 401: The first electronic device displays the voice intercom interface.

[0107] In this embodiment of the application, the above-mentioned voice intercom interface is used to transmit voice data between the first electronic device and the second electronic device.

[0108] It is understandable that when the voice intercom interface is displayed, the user can send voice data to the second electronic device or receive voice data from the second electronic device through the voice intercom interface.

[0109] Step 402: The first electronic device receives the user's voice input to the voice intercom interface.

[0110] In this embodiment of the application, the above-mentioned voice input is used for voice data input by the user to trigger the first electronic device to send the voice data to the second electronic device.

[0111] Optionally, in this embodiment of the application, the above-mentioned voice intercom interface includes a voice control. The user can input the voice control to trigger the microphone function of the first electronic device, so that the user can input voice data.

[0112] Step 403: In response to the voice input, the first electronic device sends the first voice data corresponding to the voice input to the second electronic device and receives the second voice data from the second electronic device.

[0113] In this embodiment of the application, the aforementioned second voice data is voice data transmitted based on the voice intercom interface of the second electronic device.

[0114] In this embodiment of the application, after the first electronic device establishes a Bluetooth connection with the second electronic device, the second electronic device can also display a voice intercom interface. The user of the second electronic device can then make voice inputs in the voice intercom interface to trigger the second electronic device to send the voice input voice data to the first electronic device. Thus, the user of the first electronic device can receive voice data from the second electronic device in the voice intercom interface of the first electronic device, thereby realizing voice intercom between the two electronic devices.

[0115] For example, such as Figure 6As shown, after the first electronic device establishes a Bluetooth connection with the second electronic device, the second electronic device displays a voice intercom interface C. The user of the second electronic device can input voice data into the voice intercom interface C of the first electronic device, triggering the second electronic device to send the user's voice input to the first electronic device.

[0116] Thus, when the first and second electronic devices are connected via Bluetooth, the user of the first electronic device can have a voice conversation with the user of the second electronic device through the voice intercom interface. That is, voice conversation can be achieved through Bluetooth connection without the need for other communication software, which improves the flexibility and efficiency of voice conversation and enhances human-computer interaction performance.

[0117] Figure 7 This is a schematic diagram illustrating the execution process of the Bluetooth communication method provided in this embodiment. Figure 7 As shown, the Bluetooth communication method provided in this application embodiment may include the following steps 11 to 18.

[0118] Step 11: The first electronic device and the second electronic device connect via Bluetooth.

[0119] Step 12: The first electronic device encodes the signal using maximum convolutional code and transmits the encoded signal using maximum transmission power.

[0120] Step 13: The first electronic device determines the magnitude of the signal strength.

[0121] It should be noted that if the signal strength is greater than or equal to the first threshold, then step 14 is executed; if the signal strength is less than the second threshold, then step 15 is executed.

[0122] Step 14: The first electronic device increases its signal transmission power and / or switches the convolutional code used by the first electronic device to the maximum convolutional code when encoding the transmitted data.

[0123] Step 15: The first electronic device reduces its signal transmission power and / or switches the convolutional code used by the first electronic device to the minimum convolutional code when encoding the transmitted data.

[0124] Step 16: The first electronic device determines whether the number of lost data packets is less than the third threshold.

[0125] It should be noted that if the number of lost packets is less than the third threshold, then step 15 above is executed; if the number of lost packets is greater than or equal to the third threshold, then step 17 below is executed.

[0126] Step 17: The first electronic device adjusts its signal transmission power to the maximum transmission power, and / or switches the convolutional code used by the first electronic device to the maximum convolutional code when encoding the transmitted data.

[0127] Step 18: Upon detecting the third voice data to be transmitted, the first electronic device encodes the third voice data using the minimum convolutional code and the target bit rate, and sends the encoded third voice data to the second electronic device. The target bit rate is greater than the preset bit rate corresponding to the voice type of data.

[0128] Each of the above-described method embodiments, or various possible implementations of each method embodiment, can be executed individually or in combination of any two or more. The specific implementation can be determined according to actual usage requirements, and this application does not impose any restrictions on this.

[0129] The Bluetooth communication method provided in this application can be executed by a Bluetooth communication device. This application uses a Bluetooth communication device executing the Bluetooth communication method as an example to illustrate the Bluetooth communication device provided in this application.

[0130] Figure 8 A schematic diagram of a possible structure of a Bluetooth communication device involved in some embodiments of this application is shown. For example... Figure 8 As shown, the Bluetooth communication device 70 may include an acquisition module 71 and an execution module 72.

[0131] The acquisition module 71 is used to acquire a first parameter when the first electronic device and the second electronic device are connected via Bluetooth. The first parameter includes at least one of the following: the signal strength between the first electronic device and the second electronic device, and the number of data packets lost between the first electronic device and the second electronic device.

[0132] The execution module 72 is used to adjust the signal transmission power and / or convolutional code of the first electronic device based on the first parameters obtained by the acquisition module 71. The convolutional code is the convolutional code used by the first electronic device to encode the transmitted data.

[0133] In one possible implementation, the execution module 72 is further configured to: when the first electronic device and the second electronic device are connected via Bluetooth, before obtaining the first parameter, with the Bluetooth function enabled, encode the signal using maximum convolutional code and transmit the encoded signal using maximum transmission power, the signal including the identifier and address information of the first electronic device; and establish a Bluetooth connection with the second electronic device upon receiving a Bluetooth connection request from the second electronic device.

[0134] In one possible implementation, the Bluetooth communication device 70 provided in this application embodiment further includes a display module and a receiving module. The display module is used to display a voice intercom interface after establishing a Bluetooth connection with the second electronic device. This voice intercom interface is used to transmit voice data between the first electronic device and the second electronic device. The receiving module is used to receive voice input from the user onto the voice intercom interface displayed by the display module. The execution module 72 is further used to, in response to the voice input received by the receiving module, send first voice data corresponding to the voice input to the second electronic device and receive second voice data from the second electronic device.

[0135] In one possible implementation, the first parameter includes signal strength. Execution module 72 is specifically configured to: increase the signal transmission power of the first electronic device when the signal strength is less than or equal to a first threshold, and / or switch the convolutional code used by the first electronic device to encode the transmitted data to a maximum convolutional code; or, when the signal strength is greater than or equal to a second threshold, decrease the signal transmission power of the first electronic device, and / or switch the convolutional code used by the first electronic device to encode the transmitted data to a minimum convolutional code.

[0136] In one possible implementation, the first parameter includes at least the number of data packet losses. Execution module 72 is specifically configured to: adjust the signal transmission power of the first electronic device to the maximum transmission power when the number of data packet losses is greater than or equal to a third threshold, and / or switch the convolutional code used by the first electronic device to the maximum convolutional code when encoding the transmitted data; or, when the number of data packet losses is less than the third threshold, reduce the signal transmission power of the first electronic device, and / or switch the convolutional code used by the first electronic device to the minimum convolutional code when encoding the transmitted data.

[0137] In one possible implementation, the execution module 72 is further configured to: after switching the convolutional code used by the first electronic device to encode the transmitted data to the minimum convolutional code, when it is necessary to transmit the third voice data, encode the third voice data using the minimum convolutional code and the target bit rate, and send the encoded third voice data to the second electronic device, wherein the target bit rate is greater than the bit rate corresponding to the voice data.

[0138] This application provides a Bluetooth communication device. When a first Bluetooth communication device is connected to another Bluetooth communication device, it can adjust its transmission power and / or the convolutional code used for encoding the transmitted data based on at least one of the signal strength between the two Bluetooth communication devices and the number of data packet losses between them. That is, the stability of Bluetooth communication between the two Bluetooth communication devices can be determined by the signal strength between them, allowing the first Bluetooth communication device to adjust its signal transmission power and / or the convolutional code used for encoding the transmitted data during the Bluetooth communication process. Since signal transmission power and convolutional code are factors affecting the stability and other quality aspects of Bluetooth communication, different signal strengths require different signal transmission power and / or convolutional code. Therefore, by adjusting the signal transmission power and / or convolutional code of the first Bluetooth communication device for Bluetooth communication, the stability and other quality aspects of Bluetooth communication can be improved. Alternatively, since the number of data packet losses between two Bluetooth communication devices affects the smoothness of Bluetooth communication, this number can be used to determine the smoothness of Bluetooth communication. This allows for adjustments to the signal transmission power and / or the convolutional code used by the first Bluetooth communication device during data encoding. Signal transmission power and convolutional codes are factors affecting the smoothness and other quality aspects of Bluetooth communication; different numbers of data packet losses require different levels of signal transmission power and / or convolutional code. Therefore, adjusting the signal transmission power and / or convolutional code of the first Bluetooth communication device can improve the smoothness and other quality aspects of Bluetooth communication. Thus, by selecting appropriate signal transmission power and / or convolutional codes for encoding, the communication quality of Bluetooth is improved.

[0139] The Bluetooth communication device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the specific device.

[0140] The Bluetooth communication device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system used.

[0141] The Bluetooth communication device provided in this application embodiment can implement all the processes implemented in the above method embodiments, and will not be described again here to avoid repetition.

[0142] Optionally, such as Figure 9 As shown, this application embodiment also provides an electronic device 1000, including a processor 1001 and a memory 1002. The memory 1002 stores a program or instructions that can run on the processor 1001. When the program or instructions are executed by the processor 1001, they implement the various steps of the Bluetooth communication method embodiment described above and can achieve the same technical effect. To avoid repetition, they will not be described again here.

[0143] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.

[0144] Figure 10 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application.

[0145] The electronic device 100 includes, but is not limited to, components such as: radio frequency unit 101, network module 102, audio output unit 103, input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, and processor 110.

[0146] Those skilled in the art will understand that the electronic device 100 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 110 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 10 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.

[0147] The processor 110 is configured to acquire a first parameter when the first electronic device and the second electronic device are connected via Bluetooth. The first parameter includes at least one of the following: the signal strength between the first electronic device and the second electronic device, and the number of data packets lost between the first electronic device and the second electronic device.

[0148] The processor 110 is also configured to adjust the signal transmission power and / or convolutional code of the first electronic device based on a first parameter, the convolutional code being the convolutional code used by the first electronic device when encoding transmitted data.

[0149] This application provides an electronic device in which, when a first electronic device is connected to another electronic device via Bluetooth, it can adjust its transmission power and / or the convolutional code used for encoding the transmitted data based on at least one of the signal strength between the two electronic devices and the number of data packet losses between them. That is, the stability of Bluetooth communication between the two electronic devices can be determined by the signal strength between them, allowing the first electronic device to adjust its signal transmission power and / or the convolutional code used for encoding the transmitted data during the Bluetooth communication process. Since signal transmission power and convolutional code are factors affecting the stability and other quality aspects of Bluetooth communication, different signal strengths require different signal transmission power and / or convolutional code. Therefore, by adjusting the signal transmission power and / or convolutional code of the first electronic device for Bluetooth communication, the stability and other quality aspects of Bluetooth communication can be improved. Alternatively, since the amount of data packet loss between two electronic devices affects the smoothness of Bluetooth communication, the smoothness of Bluetooth communication can be judged by the amount of data packet loss between the two electronic devices. This allows for adjustments to the signal transmission power of the first electronic device and / or the convolutional code used for encoding the transmitted data during the Bluetooth communication process. Furthermore, signal transmission power and convolutional codes are factors affecting the smoothness and other quality aspects of Bluetooth communication. In other words, different amounts of data packet loss require different signal transmission power and / or convolutional code. Therefore, by adjusting the signal transmission power and / or convolutional code of the first electronic device for Bluetooth communication, the smoothness and other quality aspects of Bluetooth communication can be improved. Thus, by selecting appropriate signal transmission power and / or the convolutional code used for encoding, the communication quality of Bluetooth communication is improved.

[0150] Optionally, the processor 110 is further configured to: when the first electronic device and the second electronic device are connected via Bluetooth, before acquiring the first parameter, with Bluetooth enabled, encode the signal using maximum convolutional code and transmit the encoded signal using maximum transmit power, the signal including the identifier and address information of the first electronic device; and establish a Bluetooth connection with the second electronic device upon receiving a Bluetooth connection request from the second electronic device.

[0151] Optionally, the display unit 106 is configured to display a voice intercom interface after establishing a Bluetooth connection with the second electronic device. This voice intercom interface is used to transmit voice data between the first and second electronic devices. The user input unit 107 is configured to receive voice input from the user onto the voice intercom interface. The processor 110 is further configured to, in response to the voice input, send first voice data corresponding to the voice input to the second electronic device and receive second voice data from the second electronic device.

[0152] Optionally, the first parameter includes signal strength. The processor 110 is specifically configured to: increase the signal transmission power of the first electronic device when the signal strength is less than or equal to a first threshold, and / or switch the convolutional code used by the first electronic device to a maximum convolutional code when encoding the transmitted data; or, decrease the signal transmission power of the first electronic device when the signal strength is greater than or equal to a second threshold, and / or switch the convolutional code used by the first electronic device to a minimum convolutional code when encoding the transmitted data.

[0153] Optionally, the first parameter includes at least the number of data packet losses. The processor 110 is specifically configured to: adjust the signal transmission power of the first electronic device to the maximum transmission power, and / or switch the convolutional code used by the first electronic device to the maximum convolutional code when encoding the transmitted data, if the number of data packet losses is greater than or equal to a third threshold; or, if the number of data packet losses is less than the third threshold, reduce the signal transmission power of the first electronic device, and / or switch the convolutional code used by the first electronic device to the minimum convolutional code when encoding the transmitted data.

[0154] Optionally, the processor 110 is further configured to: after switching the convolutional code used by the first electronic device to encode the transmitted data to a minimum convolutional code, when it is necessary to transmit third voice data, encode the third voice data using the minimum convolutional code and a target bit rate, and send the encoded third voice data to the second electronic device, wherein the target bit rate is greater than the bit rate corresponding to the voice data.

[0155] The electronic device provided in this application embodiment can implement the various processes implemented in the above method embodiments and achieve the same technical effect. To avoid repetition, it will not be described again here.

[0156] For details on the beneficial effects of the various implementation methods in this embodiment, please refer to the beneficial effects of the corresponding implementation methods in the above method embodiments. To avoid repetition, these will not be repeated here.

[0157] It should be understood that, in this embodiment, the input unit 104 may include a graphics processing unit (GPU) 1041 and a microphone 1042. The GPU 1041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 107 includes at least one of a touch panel 1071 and other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control buttons, power buttons, etc.), a trackball, a mouse, and a joystick, which will not be described in detail here.

[0158] The memory 109 can be used to store software programs and various data. The memory 109 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 109 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 109 in the embodiments of this application includes, but is not limited to, these and any other suitable types of memory.

[0159] Processor 110 may include one or more processing units; optionally, processor 110 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 110.

[0160] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the Bluetooth communication method embodiments described above and achieve the same technical effects. To avoid repetition, they will not be described again here.

[0161] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0162] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above Bluetooth communication method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0163] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0164] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the Bluetooth communication method embodiment described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0165] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0166] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0167] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A Bluetooth communication method, characterized by, The method applied to a first electronic device comprises: In a case where the first electronic device is in Bluetooth connection with a second electronic device, a first parameter is acquired, the first parameter comprising at least one of a signal strength between the first electronic device and the second electronic device and a data packet loss number between the first electronic device and the second electronic device; Based on the first parameter, a signal transmission power of the first electronic device and / or a convolution code used by the first electronic device for encoding data to be transmitted are adjusted.

2. The method of claim 1, wherein, Before the first parameter is acquired, the method further comprises: In a case where a Bluetooth function is turned on, a signal is encoded by using a maximum convolution code, and the encoded signal is transmitted by using a maximum transmission power, the signal comprising identification and address information of the first electronic device; In a case where a Bluetooth connection request of the second electronic device is received, a Bluetooth connection with the second electronic device is established.

3. The method of claim 2, wherein, After the Bluetooth connection with the second electronic device is established, the method further comprises: A voice intercom interface is displayed, the voice intercom interface being used for transmitting voice data between the first electronic device and the second electronic device; A voice input of a user to the voice intercom interface is received; In response to the voice input, first voice data corresponding to the voice input is sent to the second electronic device, and second voice data from the second electronic device is received.

4. The method of claim 1, wherein, The first parameter comprises the signal strength; The adjustment of the signal transmission power of the first electronic device and / or the convolution code used by the first electronic device for encoding data to be transmitted based on the first parameter comprises: In a case where the signal strength is less than or equal to a first threshold value, the signal transmission power of the first electronic device is increased, and / or the convolution code used by the first electronic device for encoding data to be transmitted is switched to a maximum convolution code; Or, In a case where the signal strength is greater than or equal to a second threshold value, the signal transmission power of the first electronic device is decreased, and / or the convolution code used by the first electronic device for encoding data to be transmitted is switched to a minimum convolution code.

5. The method of claim 1, wherein, The first parameter comprises at least the data packet loss number; The adjustment of the signal transmission power of the first electronic device and / or the convolution code used by the first electronic device for encoding data to be transmitted based on the first parameter comprises: In a case where the data packet loss number is greater than or equal to a third threshold value, the signal transmission power of the first electronic device is adjusted to a maximum transmission power, and / or the convolution code used by the first electronic device for encoding data to be transmitted is switched to a maximum convolution code; Or, In a case where the data packet loss number is less than the third threshold value, the signal transmission power of the first electronic device is decreased, and / or the convolution code used by the first electronic device for encoding data to be transmitted is switched to a minimum convolution code.

6. The method according to claim 4 or 5, characterized in that, After the convolution code used by the first electronic device for encoding data to be transmitted is switched to the minimum convolution code, the method further comprises: In a case that third voice data needs to be transmitted, the third voice data is encoded by using the minimum convolution code and a target code rate, and the encoded third voice data is sent to the second electronic device, the target code rate being greater than a code rate corresponding to voice data.

7. A Bluetooth communication device, characterized in that The device is applied to a first electronic device, and the device comprises an obtaining module and an executing module. The obtaining module is configured to, in a case that the first electronic device is in Bluetooth connection with a second electronic device, obtain a first parameter, the first parameter comprising at least one of a signal strength between the first electronic device and the second electronic device and a data packet loss quantity between the first electronic device and the second electronic device. The executing module is configured to, based on the first parameter obtained by the obtaining module, adjust a signal transmission power of the first electronic device and / or a convolution code used by the first electronic device when encoding data to be transmitted.

8. The apparatus of claim 7, wherein, The executing module is further configured to: Before the first parameter is obtained in the case that the first electronic device is in Bluetooth connection with the second electronic device, in a case that a Bluetooth function is turned on, encode a signal by using a maximum convolution code, and transmit the encoded signal by using a maximum transmission power, the signal comprising identification and address information of the first electronic device; In a case that a Bluetooth connection request of the second electronic device is received, establish Bluetooth connection with the second electronic device.

9. The apparatus of claim 8, wherein, The device further comprises a display module and a receiving module. The display module is configured to, after the Bluetooth connection with the second electronic device is established, display a voice intercom interface, the voice intercom interface being used to transmit voice data between the first electronic device and the second electronic device. The receiving module is configured to receive voice input of the voice intercom interface displayed by the display module. The executing module is further configured to, in response to the voice input received by the receiving module, send first voice data corresponding to the voice input to the second electronic device, and receive second voice data from the second electronic device.

10. The apparatus of claim 7, wherein, The first parameter comprises the signal strength. The executing module is specifically configured to: In a case that the signal strength is less than or equal to a first threshold value, increase the signal transmission power of the first electronic device, and / or switch a convolution code used by the first electronic device when encoding data to be transmitted to a maximum convolution code; Or, In a case that the signal strength is greater than or equal to a second threshold value, decrease the signal transmission power of the first electronic device, and / or switch the convolution code used by the first electronic device when encoding data to be transmitted to a minimum convolution code.

11. The apparatus of claim 7, wherein, The first parameter comprises at least the data packet loss quantity. The executing module is specifically configured to: In a case that the data packet loss quantity is greater than or equal to a third threshold value, adjust the signal transmission power of the first electronic device to a maximum transmission power, and / or switch the convolution code used by the first electronic device when encoding data to be transmitted to a maximum convolution code; Or, In a case where the data packet loss quantity is less than a third threshold value, the signal transmission power of the first electronic device is reduced, and / or a convolution code used by the first electronic device for encoding data to be transmitted is switched to a minimum convolution code.

12. The apparatus of claim 10 or 11, wherein, The execution module is further configured to: After the convolution code used by the first electronic device for encoding data to be transmitted is switched to the minimum convolution code, in a case where third voice data needs to be transmitted, the third voice data is encoded by using the minimum convolution code and a target code rate, and the encoded third voice data is transmitted to the second electronic device, the target code rate being greater than a code rate corresponding to voice data.

13. An electronic device, comprising: A processor and a memory are included, the memory stores programs or instructions executable on the processor, and the programs or instructions are executed by the processor to implement the steps of the Bluetooth communication method according to any one of claims 1-6.

14. A readable storage medium, characterized by, The readable storage medium stores programs or instructions, and the programs or instructions are executed by the processor to implement the steps of the Bluetooth communication method according to any one of claims 1-6.

15. A computer program product, characterised in that, The program product is stored in a storage medium, and the program product is executed by at least one processor to implement the Bluetooth communication method according to any one of claims 1-6.