Bluetooth connection methods, electronic devices, storage media, and computer program products

By employing a hybrid coding method and a connection-state-aware Bluetooth connection approach, the problem of unstable BLE connections in interference environments has been solved, improving the success rate and stability of Bluetooth connections and ensuring the smooth operation of interconnection services between electronic devices.

CN122317992APending Publication Date: 2026-06-30HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HONOR DEVICE CO LTD
Filing Date
2024-12-30
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

In environments with interference, BLE technology is prone to broadcast packet loss, high connection delay, and high probability of disconnection, resulting in unstable Bluetooth connections and failure to connect successfully.

Method used

Bluetooth broadcasting uses a hybrid encoding method, employing a physical layer encoding method with stronger anti-interference capabilities. After a successful Bluetooth connection, the encoding method is switched according to the connection status to maintain a stable connection, and the user is prompted to improve the environment when the signal is weak.

Benefits of technology

It improves the success rate and stability of Bluetooth connections, ensuring smooth interconnection between electronic devices and enhancing the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122317992A_ABST
    Figure CN122317992A_ABST
Patent Text Reader

Abstract

This application discloses a Bluetooth connection method, electronic device, storage medium, and computer program product, belonging to the field of terminal technology. Applied to a first electronic device, the method includes: continuously broadcasting Bluetooth signals, each broadcast carrying either a first physical layer encoding method or a second physical layer encoding method, wherein the first physical layer encoding method has greater anti-interference capabilities than the second physical layer encoding method; upon receiving a response message from a second electronic device, establishing a Bluetooth connection with the second electronic device; and maintaining the Bluetooth connection with the second electronic device after successful connection, based on the Bluetooth connection status and using the corresponding physical layer encoding method. This application uses mixed broadcasting with different physical layer encoding methods, and one of these methods has strong anti-interference capabilities, thereby improving the success rate of Bluetooth connections in interference scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminal technology, and in particular to a Bluetooth connection method, electronic device, storage medium, and computer program product. Background Technology

[0002] With the development of terminal technology, the application scenarios of Bluetooth Low Energy (BLE) technology are constantly increasing. For example, BLE can be used in fields such as interconnection between electronic devices, smart homes, smart shopping malls, and industrial production automation management.

[0003] However, BLE typically uses 1M uncoded PHY modulation to transmit data by default. As a result, in some interference environments, problems such as broadcast packet loss, high connection delay, and high probability of disconnection can easily occur, leading to Bluetooth failure or unstable Bluetooth connection. Summary of the Invention

[0004] This application provides a Bluetooth connection method, electronic device, storage medium, and computer program product, which can be used to improve the Bluetooth connection success rate in interference environments. The technical solution is as follows:

[0005] In a first aspect, a Bluetooth connection method is provided, applied to a first electronic device, the method comprising:

[0006] Continuously broadcast Bluetooth messages, each of which carries either a first physical layer encoding method or a second physical layer encoding method. The first physical layer encoding method has greater anti-interference capabilities than the second physical layer encoding method. Upon receiving a response message from a second electronic device, a Bluetooth connection is established with the second electronic device. This response message is the second electronic device's response to the Bluetooth broadcast. After a successful Bluetooth connection, the Bluetooth connection with the second electronic device is maintained using the corresponding physical layer encoding method, depending on the Bluetooth connection status.

[0007] In this way, the first electronic device can perform mixed Bluetooth broadcasting using different physical layer encoding methods, and one of these methods has strong anti-interference capabilities, thus ensuring the success rate of Bluetooth connection between the first and second electronic devices in interference scenarios. Secondly, after the Bluetooth connection is established, the first electronic device can maintain the connection based on its status, thereby maximizing the stability of the Bluetooth connection and ensuring the smooth operation of interconnection services between electronic devices.

[0008] As an example of this application, the operation of the first electronic device continuously performing Bluetooth broadcasting includes:

[0009] Obtain the encoding ratio, which is the ratio between the number of Bluetooth broadcasts carrying the first physical layer encoding method and the number of Bluetooth broadcasts carrying the second physical layer encoding method;

[0010] Bluetooth broadcasts will continue according to the encoding ratio.

[0011] In this way, by setting a certain encoding ratio, the function of judging the current network environment can be realized.

[0012] As an example of this application, the first physical layer encoding method can be Coded PHY, and the second physical layer encoding method can be Uncoded PHY.

[0013] Thus, because Uncoded PHY has a high data transmission rate and Coded PHY has a low data transmission rate, and Coded PHY has a higher interference resistance than Uncoded PHY, Bluetooth broadcasting is performed using a hybrid encoding method, thereby ensuring the success of Bluetooth connections in interference scenarios.

[0014] As an example of this application, after a successful Bluetooth connection, the operation of the first electronic device maintaining the Bluetooth connection with the second electronic device according to the Bluetooth connection status and through the corresponding physical layer encoding method includes:

[0015] After successfully establishing an initial Bluetooth connection with the second electronic device, the Bluetooth connection status between the two devices is determined, including the physical layer encoding method and the Bluetooth signal strength.

[0016] When the physical layer encoding method is the first physical layer encoding method and the Bluetooth signal strength is greater than or equal to a preset strength threshold, the Bluetooth connection with the second electronic device is maintained using the first physical layer encoding method.

[0017] When the physical layer encoding method is the second physical layer encoding method and the Bluetooth signal strength is greater than or equal to a preset strength threshold, the Bluetooth connection with the second electronic device is maintained using the second physical layer encoding method.

[0018] In this way, by selecting an appropriate physical layer encoding method based on the Bluetooth connection status with the second electronic device, the reliability of the Bluetooth connection is guaranteed.

[0019] As an example of this application, after the first electronic device successfully establishes a Bluetooth connection with the second electronic device for the first time and determines the Bluetooth connection status with the second electronic device, it can also determine the connection duration with the second electronic device if the physical layer encoding method is the first physical layer encoding method and the Bluetooth signal strength is greater than or equal to a preset strength threshold.

[0020] If the connection duration is greater than or equal to the duration threshold, the first physical layer encoding method is switched to the second physical layer encoding method to establish a Bluetooth connection with the second electronic device through the second physical layer encoding method.

[0021] In this way, by switching the physical layer encoding method of the Bluetooth connection in a timely manner according to the Bluetooth connection status, excessive Bluetooth latency is avoided.

[0022] As an example of this application, after the first electronic device successfully establishes an initial Bluetooth connection with the second electronic device, and after determining the Bluetooth connection status between the first electronic device and the second electronic device, if the physical layer encoding method is the second physical layer encoding method and the Bluetooth signal strength is less than a preset strength threshold, and if the Bluetooth service between the first electronic device and the second electronic device has been started, then the first electronic device will not respond to the started Bluetooth service and / or will display a first prompt message. The first prompt message is used to indicate that the Bluetooth signal does not support some Bluetooth services between the first electronic device and the second electronic device.

[0023] For example, a first electronic device initiates a trust loop and then establishes a Bluetooth connection with a second electronic device. After the Bluetooth connection is established, if the first and second electronic devices establish the Bluetooth connection via a second physical layer encoding method and the Bluetooth signal strength is less than a preset strength threshold, the device identifier of the second electronic device will not be displayed in the trust loop. Alternatively, the device identifier of the second electronic device can be displayed in the trust loop, and the first electronic device can indicate that Bluetooth services with high communication speed and latency requirements are unavailable and indicate a weak Bluetooth signal.

[0024] In this way, when the Bluetooth signal is weak, prompts can be sent to the user to improve the Bluetooth environment, thereby enhancing the intelligence of electronic devices.

[0025] As an example of this application, after the first electronic device successfully connects to the Bluetooth network, it can maintain the Bluetooth connection with the second electronic device through the corresponding physical layer encoding method according to the Bluetooth connection status. It can also respond to user operation and start the target Bluetooth service with the second electronic device.

[0026] Based on the service type of the target Bluetooth service, determine whether to establish a communication connection with the second electronic device other than the Bluetooth connection;

[0027] When establishing other communication connections, during the process of performing the target Bluetooth service, the communication mode is switched or Bluetooth reconnection is performed according to the Bluetooth connection status and the communication requirements of the target Bluetooth service.

[0028] It should be noted that other communication connections may include WiFi P2P connections.

[0029] In this way, during Bluetooth service operations, alternative communication connections can be established based on the service type of the Bluetooth service, thereby ensuring the smooth operation of the Bluetooth service and improving the Bluetooth service experience.

[0030] As an example of this application, when establishing other communication connections, the first electronic device, during the process of performing the target Bluetooth service, switches the communication mode or performs Bluetooth reconnection operations according to the Bluetooth connection status and the communication requirements of the target Bluetooth service, including:

[0031] In the case of establishing other communication connections, during the process of carrying out the target Bluetooth service, if the communication rate requirement of the target Bluetooth service is greater than or equal to the rate threshold, the target Bluetooth service is carried out through other communication connections.

[0032] If the packet loss rate during the execution of the target Bluetooth service is greater than or equal to the packet loss rate threshold, and / or if the delay duration during the execution of the target Bluetooth service is greater than or equal to the preset duration, determine the physical layer encoding method used by the current Bluetooth connection.

[0033] If the current Bluetooth connection uses the first physical layer encoding method, re-establish the Bluetooth connection with the second electronic device;

[0034] If the current Bluetooth connection uses the second physical layer encoding method, switch the second physical layer encoding method to the first physical layer encoding method, and establish a Bluetooth connection with the second electronic device through the first physical layer encoding method.

[0035] In this way, different Bluetooth service states can be configured under different signal scenarios during Bluetooth service operations, thereby improving the service experience.

[0036] As an example of this application, after a successful Bluetooth connection, the first electronic device can maintain the Bluetooth connection with the second electronic device by using the corresponding physical layer encoding method according to the Bluetooth connection status, and can also periodically detect the Bluetooth connection status.

[0037] If a successful Bluetooth connection maintenance is detected, maintain the Bluetooth connection with the second electronic device using the current physical layer encoding method;

[0038] If a Bluetooth connection failure is detected, a new Bluetooth connection is established with the second electronic device using the first physical layer encoding method.

[0039] In this way, by periodically checking the Bluetooth connection status and switching the Bluetooth connection method according to the Bluetooth connection status, the reliability of the Bluetooth connection is improved.

[0040] Secondly, a Bluetooth connection device is provided, which has the function of implementing the Bluetooth connection method behavior described in the first aspect above. The Bluetooth connection device includes at least one module, which is used to implement the Bluetooth connection method provided in the first aspect above.

[0041] Thirdly, an electronic device (first electronic device) is provided, comprising a processor and a memory. The memory stores a program that supports the electronic device in executing the Bluetooth connection method provided in the first aspect, and stores data related to implementing the Bluetooth connection method described in the first aspect. The processor is configured to execute the program stored in the memory. The electronic device may further include a communication bus for establishing a connection between the processor and the memory.

[0042] Fourthly, a computer-readable storage medium is provided, wherein instructions are stored therein, which, when executed on a computer, cause the computer to perform the Bluetooth connection method described in the first aspect.

[0043] Fifthly, a computer program product containing instructions is provided, which, when run on a computer, causes the computer to execute the Bluetooth connection method described in the first aspect.

[0044] The technical effects achieved by the second, third, fourth, and fifth aspects mentioned above are similar to those achieved by the corresponding technical means in the first aspect mentioned above, and will not be repeated here. Attached Figure Description

[0045] Figure 1 This is a schematic diagram illustrating an application scenario provided in an embodiment of this application;

[0046] Figure 2 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0047] Figure 3 This is a block diagram of a software system for an electronic device provided in an embodiment of this application;

[0048] Figure 4 A schematic diagram illustrating another application scenario provided in this application embodiment;

[0049] Figure 5 A schematic diagram illustrating another application scenario provided in this application embodiment;

[0050] Figure 6 A schematic diagram illustrating another application scenario provided in this application embodiment;

[0051] Figure 7This application provides a schematic flowchart of a Bluetooth connection method.

[0052] Figure 8 This is a schematic diagram of a Bluetooth physical layer encoding method provided in an embodiment of this application;

[0053] Figure 9 This is a schematic diagram of a Bluetooth connection interaction process provided in an embodiment of this application;

[0054] Figure 10 This is a schematic diagram of another Bluetooth connection method provided in an embodiment of this application. Detailed Implementation

[0055] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0056] It should be understood that "multiple" as mentioned in this application refers to two or more. In the description of this application, unless otherwise stated, " / " indicates "or," for example, A / B can mean A or B; "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist, for example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, to facilitate a clear description of the technical solutions of this application, the terms "first," "second," etc., are used to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first," "second," etc., do not limit the quantity or execution order, and that "first," "second," etc., do not necessarily imply differences.

[0057] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0058] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0059] With the development of terminal technology, the interconnectivity services between multiple electronic devices are becoming increasingly diverse. For example, multiple electronic devices can share files, share keyboards and mice, and cast screens. These interconnectivity services can be achieved through various methods, for example, see [link to relevant documentation]. Figure 1 The first electronic device (a mobile phone in the attached diagram) can share network services with the second electronic device (a laptop in the attached diagram) through a trust ring. A trust ring is formed when two or more electronic devices establish a trust relationship through trusted authentication. Multiple electronic devices can form a trust ring in different ways, such as logging into the same account, authenticating via cloud authentication, or authenticating through a private protocol. This embodiment only illustrates the formation of a trust ring via Bluetooth connection.

[0060] Currently, in the context of enabling interconnectivity between multiple electronic devices, Bluetooth connectivity is sometimes required. For example, when using a trust loop function to enable interconnectivity between multiple electronic devices, Bluetooth connectivity is required.

[0061] However, when multiple electronic devices are connected via Bluetooth, issues such as Bluetooth connection failure, unstable Bluetooth connections, and severe Bluetooth packet loss may occur, affecting the interoperability of these devices. Furthermore, in interference-prone scenarios, the trust loop function may not be able to enable interoperability between multiple electronic devices.

[0062] To improve the success rate and stability of Bluetooth connections and ensure smooth operation of interconnection services between multiple electronic devices, this application provides a Bluetooth connection method. In this method, when a first electronic device broadcasts Bluetooth data, it can use a hybrid encoding method, meaning each Bluetooth broadcast can carry different physical layer encoding methods. For example, each Bluetooth broadcast can carry either a first physical layer encoding method or a second physical layer encoding method, with the first physical layer encoding method having greater anti-interference capabilities than the second physical layer encoding method. Upon receiving a response message from a second electronic device based on the Bluetooth broadcast, a Bluetooth connection is established with the second electronic device. After a successful Bluetooth connection, the connection is maintained with the second electronic device using the corresponding physical layer encoding method based on the Bluetooth connection status. Because this application embodiment allows for hybrid broadcasting using different physical layer encoding methods, and one of these methods has strong anti-interference capabilities, the success rate of Bluetooth connections is ensured even in interference scenarios. Furthermore, since the Bluetooth connection can be maintained based on its status after connection, the stability of the Bluetooth connection is maximized, ensuring smooth operation of interconnection services between electronic devices.

[0063] Before providing a detailed explanation of the Bluetooth connection method provided in the embodiments of this application, the electronic devices involved in the embodiments of this application will be described first.

[0064] As an example, this method can be applied to electronic devices capable of Bluetooth connectivity with other electronic devices. As an example and not a limitation, the electronic device can be, but is not limited to, tablet computers, desktop computers, laptop computers, handheld computers, laptops, in-vehicle devices, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), mobile phones, smartwatches, etc., and this application embodiment does not limit this.

[0065] Figure 2 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. See also... Figure 2The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0066] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0067] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0068] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.

[0069] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from this memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0070] In some embodiments, the processor 110 may include one or more interfaces, such as an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0071] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C interfaces. The processor 110 can couple to the touch sensor 180K, charger, flash, camera 193, etc., through different I2C interfaces. For example, the processor 110 can couple to the touch sensor 180K through the I2C interface, enabling the processor 110 and the touch sensor 180K to communicate through the I2C interface, thereby realizing the touch function of the electronic device 100.

[0072] The I2S interface can be used for audio communication. In some embodiments, the processor 110 may include multiple I2S interfaces. The processor 110 can be coupled to the audio module 170 through the I2S interface to realize communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 through the I2S interface to realize the function of answering phone calls through a Bluetooth headset.

[0073] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via the PCM interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering phone calls through a Bluetooth headset.

[0074] The UART interface is a universal serial data bus used for asynchronous communication. The UART interface can be a bidirectional communication bus. It can convert data between serial and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface to enable music playback through Bluetooth headphones.

[0075] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to enable the electronic device 100 to capture images. The processor 110 and the display screen 194 communicate via the DSI interface to enable the electronic device 100 to display images.

[0076] The GPIO interface can be configured via software. It can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to a camera 193, a display screen 194, a wireless communication module 160, an audio module 170, a sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0077] USB port 130 is a USB standard compliant interface, specifically a Mini USB port, Micro USB port, USB Type-C port, etc. USB port 130 can be used to connect a charger to charge electronic device 100, and can also be used for data transfer between electronic device 100 and peripheral devices. It can also be used to connect headphones for audio playback. USB port 130 can also be used to connect other terminals, such as AR devices.

[0078] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0079] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via a USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device 100 via the power management module 141.

[0080] The power management module 141 connects the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, internal memory 121, external memory, display screen 194, camera 193, and wireless communication module 160, etc. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 141 may also be located within the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be located in the same device.

[0081] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.

[0082] Antennas 1 and 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with a tuning switch.

[0083] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.

[0084] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 170A, receiver 170B, etc.) or displays images or videos through the display screen 194. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the mobile communication module 150 or other functional modules.

[0085] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0086] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with networks and other devices via wireless communication technology. Wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. GNSS can include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).

[0087] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0088] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Mini LED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is an integer greater than 1.

[0089] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.

[0090] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's image sensor. The light signal is converted into an electrical signal, and the image sensor transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimizations on image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be integrated into the camera 193.

[0091] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is an integer greater than 1.

[0092] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 100 selects a frequency, the DSP performs Fourier transforms on the frequency energy.

[0093] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG 2, MPEG 3, MPEG 4, etc.

[0094] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.

[0095] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions, such as saving music, video, and other files on the external memory card.

[0096] Internal memory 121 can be used to store computer-executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created by electronic device 100 during use (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

[0097] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D and application processor.

[0098] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110.

[0099] The speaker 170A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or make hands-free calls through the speaker 170A.

[0100] The receiver 170B, also known as the "earpiece," is used to convert audio electrical signals into sound signals. When the electronic device 100 answers a telephone call or voice message, the receiver 170B can be brought close to the ear to listen to the voice.

[0101] Microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 170C, inputting the sound signal into microphone 170C. Electronic device 100 may have at least one microphone 170C. In some embodiments, electronic device 100 may have two microphones 170C, which, in addition to collecting sound signals, can also perform noise reduction. In other embodiments, electronic device 100 may also have three, four, or more microphones 170C, which can collect sound signals, reduce noise, identify the sound source, and perform directional recording, etc.

[0102] The 170D headphone jack is used to connect wired headphones. The 170D headphone jack can be a USB 130 interface or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, a CTIA (Cellular Telecommunications Industry Association of the USA) standard interface.

[0103] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be disposed on display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive material. When force is applied to pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the touch operation intensity based on pressure sensor 180A. Electronic device 100 can also calculate the touch position based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands. For example, when a touch operation with an intensity less than the pressure threshold is applied to the SMS application icon, a command to view an SMS message is executed. When a touch operation with an intensity greater than or equal to the pressure threshold is applied to the SMS application icon, a command to create a new SMS message is executed.

[0104] The gyroscope sensor 180B can be used to determine the motion attitude of the electronic device 100. In some embodiments, the gyroscope sensor 180B can determine the angular velocity of the electronic device 100 about three axes (i.e., the x, y, and z axes). The gyroscope sensor 180B can be used for image stabilization. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the shake of the electronic device 100, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to counteract the shake of the electronic device 100 by moving in the opposite direction, thus achieving image stabilization. The gyroscope sensor 180B can also be used in navigation and motion-sensing game scenarios.

[0105] The barometric pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates altitude using the air pressure value measured by the barometric pressure sensor 180C to assist in positioning and navigation.

[0106] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip cover. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover based on the magnetic sensor 180D. Based on the detected opening and closing state of the cover or the flip cover, the electronic device 100 can set features such as automatic flip unlocking.

[0107] The accelerometer 180E can detect the magnitude of acceleration of electronic device 100 in various directions (generally three axes). When electronic device 100 is stationary, it can detect the magnitude and direction of gravity. The accelerometer 180E can also be used to identify the attitude of electronic device 100, and can be applied to applications such as screen orientation switching and pedometers.

[0108] A distance sensor 180F is used to measure distance. Electronic device 100 can measure distance via infrared or laser. In some embodiments, during a shooting scenario, electronic device 100 can utilize the distance sensor 180F for distance measurement to achieve fast focusing.

[0109] The proximity sensor 180G may include a light-emitting diode (LED) and a light detector, such as a photodiode. The LED may be an infrared LED. The electronic device 100 emits infrared light outward through the LED. The electronic device 100 uses the photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, the electronic device 100 can determine that an object is nearby. When insufficient reflected light is detected, it can determine that no object is nearby. The electronic device 100 can use the proximity sensor 180G to detect when a user holds the electronic device 100 close to their ear for a phone call, so as to automatically turn off the screen to save power. The proximity sensor 180G can also be used in holster mode and pocket mode for automatic unlocking and locking of the screen.

[0110] The ambient light sensor 180L is used to sense the brightness of ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 194 based on the sensed ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also work with the proximity sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.

[0111] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can utilize the characteristics of the collected fingerprints to achieve fingerprint unlocking, accessing application locks, taking photos with fingerprints, answering calls with fingerprints, etc.

[0112] Temperature sensor 180J is used to detect temperature. In some embodiments, electronic device 100 uses the temperature detected by temperature sensor 180J to execute a temperature handling strategy. For example, when the temperature reported by temperature sensor 180J exceeds a threshold, electronic device 100 reduces the performance of a processor located near temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is below another threshold, electronic device 100 heats battery 142 to prevent abnormal shutdown of electronic device 100 due to low temperature. In still other embodiments, when the temperature is below yet another threshold, electronic device 100 boosts the output voltage of battery 142 to prevent abnormal shutdown due to low temperature.

[0113] Touch sensor 180K, also known as a "touch panel," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touch display." Touch sensor 180K detects touch operations applied to or near it. Touch sensor 180K can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be located on the surface of electronic device 100, in a different position than display screen 194.

[0114] The bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire vibration signals from the vibrating bone segments of the human vocal cords. The bone conduction sensor 180M can also contact the human pulse to receive blood pressure signals. In some embodiments, the bone conduction sensor 180M can also be incorporated into headphones to form bone conduction headphones. The audio module 170 can parse the voice signals from the vibrating bone segments of the vocal cords acquired by the bone conduction sensor 180M to realize voice functionality. The application processor can parse heart rate information from the blood pressure signals acquired by the bone conduction sensor 180M to realize heart rate detection functionality.

[0115] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch buttons. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of electronic device 100.

[0116] Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. For example, different vibration feedback effects can be corresponding to touch operations applied to different applications (such as taking photos, playing audio, etc.). Touch operations applied to different areas of the display screen 194 can also correspond to different vibration feedback effects. Different application scenarios (such as time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also be customized.

[0117] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.

[0118] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to make contact with and separate from the electronic device 100. The electronic device 100 can support one or N SIM card interfaces, where N is an integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 simultaneously. The multiple cards can be of the same or different types. The SIM card interface 195 is also compatible with different types of SIM cards. The SIM card interface 195 is also compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to realize functions such as calls and data communication. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0119] The software system of electronic device 100 will be described next.

[0120] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses a layered Android system as an example to illustrate the software system of electronic device 100.

[0121] Figure 3 This is a block diagram of a software system for an electronic device 100 provided in an embodiment of this application. See also... Figure 3 A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime, the system layer, and the kernel layer.

[0122] The application layer can include a series of application packages. For example... Figure 3 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and SMS.

[0123] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions. For example... Figure 3 As shown, the application framework layer can include a window manager, content providers, a view system, a phone manager, a resource manager, and a notification manager. The window manager manages window programs. It can obtain the screen size, determine if a status bar is present, lock the screen, and capture the screen. The content provider stores and retrieves data, making this data accessible to the application. This data can include videos, images, audio, made and received phone calls, browsing history and bookmarks, and phone books. The view system includes visual controls, such as controls for displaying text and controls for displaying images. The view system can be used to build the application's display interface, which can consist of one or more views, such as a view displaying SMS notification icons, a view displaying text, and a view displaying images. The phone manager provides communication functions for the electronic device 100, such as managing call status (including connection and disconnection). The resource manager provides the application with various resources, such as localized strings, icons, images, layout files, and video files. The notification manager allows the application to display notification information in the status bar, which can be used to convey informational messages and can disappear automatically after a short pause without user interaction. For example, the notification manager is used to notify users of download completions and message alerts. The notification manager can also display notifications as icons or scrolling text in the system's top status bar, such as notifications from background applications. Furthermore, the notification manager can appear as dialog boxes on the screen, such as displaying text messages in the status bar, emitting sounds, causing electronic devices to vibrate, or flashing indicator lights.

[0124] As an example, the application framework layer may include distributed frameworks, etc.

[0125] The distributed framework is used to achieve data synchronization between devices within a local area network (LAN). The distributed framework includes a distributed service management module. This module establishes trust relationships with devices within the LAN, thereby creating a trust loop, and manages the devices within that loop.

[0126] The Android Runtime consists of the core libraries and the virtual machine. The Android runtime is responsible for scheduling and managing the Android system. The core libraries consist of two parts: one part contains the functionalities that Java needs to call, and the other part is the core Android library itself. The application layer and application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0127] The system library can include multiple functional modules, such as a surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), and 2D graphics engines (e.g., SGL). The surface manager manages the display subsystem and provides fusion of 2D and 3D layers for multiple applications. The media libraries support playback and recording of various common audio and video formats, as well as still image files. The media libraries support various audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG. The 3D graphics processing libraries are used for 3D graphics drawing, image rendering, compositing, and layer processing. The 2D graphics engine is the drawing engine for 2D graphics.

[0128] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.

[0129] The following example, using a scene of capturing a photograph, illustrates the workflow of the software and hardware of the electronic device 100.

[0130] When touch sensor 180K receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including touch coordinates, touch operation timestamp, etc.). The raw input event is stored in the kernel layer. The application framework layer retrieves the raw input event from the kernel layer and identifies the control corresponding to the raw input event. Taking a single-click operation as an example, where the corresponding control is the camera application icon, the camera application calls the interface of the application framework layer to launch the camera application, and then calls the kernel layer to launch the camera driver, capturing still images or videos through camera 193.

[0131] In this application embodiment, the electronic device involves a first electronic device and a second electronic device. The first electronic device and the second electronic device can communicate with each other, such as through Internet communication or near-field communication. Near-field communication includes Bluetooth, WiFi, NFC, etc.

[0132] The first electronic device and the second electronic device can be of the same type or different types of electronic devices, unless otherwise specified. Figure 2 and Figure 3 The description of the electronic device in question refers to the first electronic device.

[0133] It is understood that in the embodiments of this application, the hardware structure of the second electronic device may be the same as that of the first electronic device in both hardware and software. Of course, the second electronic device may also differ from the hardware and / or software structure of the first electronic device; for example, the second electronic device may include a different hardware and / or software structure than the first electronic device. Figure 2 and Figure 3 The structure shown may have more or fewer components, may combine two or more components, or may have different component configurations. For example, the second electronic device may not include a SIM card interface. If the second electronic device does not include a SIM card interface, its software architecture may not include a calling module. This application does not impose any limitations on the structure of the second electronic device.

[0134] Next, to facilitate understanding of the embodiments of this application, the application scenarios of these embodiments will be explained. In this embodiment, a mobile phone is used as the first electronic device, a laptop as the second electronic device, and the first electronic device achieves interconnection and interoperability with the second electronic device through a trust ring function.

[0135] See Figure 4 , Figure 4 This is a schematic diagram illustrating an application scenario provided by an embodiment of this application. In one application scenario, see... Figure 4 The first electronic device P1 can perform Bluetooth broadcasting. During Bluetooth broadcasting, the first electronic device P1 broadcasts according to a certain encoding ratio. The encoding ratio refers to the ratio between the number of Bluetooth broadcasts carrying the first physical layer encoding method and the number of Bluetooth broadcasts carrying the second physical layer encoding method; for example, see... Figure 4 The first electronic device can broadcast via Bluetooth at a 1:5 encoding ratio. The second electronic device P2, in response to this Bluetooth broadcast, can establish a Bluetooth connection with the first electronic device.

[0136] It should be noted that the first physical layer encoding method is Coded PHY, and the second physical layer encoding method is Uncoded PHY.

[0137] In another application scenario, after the initial successful Bluetooth connection, see [link to relevant documentation]. Figure 5In Figure (a), the first electronic device activates a trust loop. If the first electronic device P1 and the second electronic device P2 establish a Bluetooth connection via the second physical layer encoding method, and the Bluetooth signal strength is greater than or equal to a preset strength threshold, then the first electronic device P1 can discover trusted devices. In this case, see [reference needed]. Figure 5 In Figure (b), the trust ring can display the device identifiers of the first electronic device P2 and the second electronic device P3, indicating that the first electronic device P1 and the second electronic device P2 are located in the same trust ring. In this case, the user can select the desired service from the interconnection services displayed by the first electronic device P1, such as network sharing service, screen sharing service, etc.

[0138] In another application scenario, if the first electronic device and the second electronic device establish a Bluetooth connection via a first physical layer encoding method, and the Bluetooth signal strength is greater than or equal to a preset strength threshold, then the first electronic device P1 can also display in the trust ring as shown below. Figure 5 The device identifier P3 is shown for the second electronic device P2 in Figure (b).

[0139] In another application scenario, after the initial successful Bluetooth connection, see [link to relevant documentation]. Figure 6 In Figure (a), the first electronic device P1 activates a trust loop. If the first electronic device P1 and the second electronic device P2 establish a Bluetooth connection via the second physical layer encoding method, and the Bluetooth signal strength is less than a preset strength threshold, then the first electronic device P1 may be unable to discover trusted devices. In this case, see [reference needed]. Figure 6 In Figure (b), the device identifier P3 of the second electronic device P2 cannot be displayed in the trust ring. Alternatively, the first electronic device can discover trusted devices; see [reference needed]. Figure 6 In Figure (c), the device identifier P3 of the second electronic device can be displayed in the trust ring, and the first prompt message P4 is displayed in the trust ring interface. The first prompt message P4 is used to indicate that the Bluetooth signal does not support the current part of the interconnection service (also known as Bluetooth service). For example, the first prompt message can be "Bluetooth connection signal is weak, please shorten the distance between the two devices and try to avoid obstruction between devices".

[0140] As an example, when the first prompt message P4 is displayed, the first electronic device and the second electronic device may not be able to perform services such as screen sharing and network sharing, but they can perform services with lower communication speed and experimental requirements, such as document transfer.

[0141] It should be noted that the embodiments in this application are based only on the above. Figures 4-6 The application scenarios shown are illustrated as examples and do not constitute a limitation on the embodiments of this application.

[0142] Based on the execution entity provided in the above embodiments, the Bluetooth connection method provided in this application will now be described. Please refer to... Figure 7 , Figure 7 This is a schematic diagram illustrating a Bluetooth connection method, which is illustrative and not limiting. The method is described using the interaction between a first electronic device and a second electronic device as an example, and may include some or all of the following:

[0143] Step 701: The first electronic device continues to broadcast via Bluetooth.

[0144] It should be noted that each Bluetooth broadcast can carry either a first physical layer encoding method or a second physical layer encoding method, and the first physical layer encoding method has a greater anti-interference capability than the second physical layer encoding method.

[0145] As an example, the first physical layer is encoded as Coded PHY, and the second physical layer is encoded as Uncoded PHY.

[0146] In some embodiments, the first electronic device may actively send discoverable broadcasts (also known as broadcast packets, broadcast messages, or Bluetooth broadcasts) at regular time intervals so that the device can be discovered by other devices. Typically, when the first electronic device is in a pairable state, it can send discoverable broadcasts to its surroundings. When the first electronic device is in a paired state, for the sake of user information security, the first electronic device no longer establishes connections with other devices; in this case, the first electronic device does not send discoverable broadcasts to its surroundings.

[0147] The data packet format is the same for all physical layer types (PHYs) in Bluetooth Low Energy. Bluetooth Low Energy has three physical layer types (or three physical layer encoding methods): LE 1M PHY (i.e., the second physical layer encoding method in this embodiment: Uncoded PHY), LE 2M PHY, and LE Coded PHY (i.e., the first physical layer encoding method in this embodiment: Coded PHY). The relevant parameters for these three physical layer types are as follows. Figure 8 As shown, from Figure 8 It can be seen that the data transmission rate of LE 2M PHY is greater than that of LE 1M PHY, and the data transmission rate of LE 1M PHY is greater than that of LE Coded PHY.

[0148] Typically, the first electronic device uses the default 1M Uncoded PHY for Bluetooth broadcasting. However, as mentioned above, in a 2.4G interference environment, issues such as broadcast packet loss, high connection latency, and high disconnection probability are prone to occur. Therefore, to improve the Bluetooth connection success rate, the first electronic device can perform hybrid broadcasting according to a certain encoding ratio during Bluetooth broadcasting. The ratio between the number of Bluetooth broadcasts carrying the first physical layer encoding method and the number of Bluetooth broadcasts carrying the second physical layer encoding method in the hybrid broadcast is called the encoding ratio.

[0149] That is, the operation of the first electronic device to continuously broadcast via Bluetooth includes: obtaining an encoding ratio, which is the ratio between the number of Bluetooth broadcasts carrying the first physical layer encoding method and the number of Bluetooth broadcasts carrying the second physical layer encoding method; and continuously broadcasting via Bluetooth according to the encoding ratio.

[0150] It should be noted that the encoding ratio can be preset as needed, or it can be dynamically adjusted according to the Bluetooth connection status. That is, the encoding ratio can be a fixed value or a value that can be dynamically adjusted at any time. This application embodiment does not impose specific limitations on this.

[0151] As mentioned above, the data transmission rate of Coded PHY is the lowest among the three physical layer encoding methods. Therefore, the lower the proportion of Coded PHY broadcasts (i.e., the lower the proportion of Bluetooth broadcasts carrying the first physical layer encoding method), the higher the latency for establishing a Bluetooth connection between the first and second electronic devices in interference scenarios, but the higher the accuracy of determining whether an interference scenario exists. Conversely, the higher the proportion of Coded PHY broadcasts (i.e., the higher the proportion of Bluetooth broadcasts carrying the first physical layer encoding method), the higher the connection latency for other devices without Coded PHY enabled, but the lower the accuracy of determining whether an interference scenario exists. Therefore, under normal circumstances, the proportion of Coded PHY broadcasts is usually relatively low. For example, this encoding ratio can be 1:5, and the application scenarios for this encoding ratio can be referenced above. Figure 4 The application scenarios shown.

[0152] Step 702: The second electronic device responds to the Bluetooth broadcast by sending a first connection request to the first electronic device.

[0153] It should be noted that the first connection request carries either the first physical layer encoding method or the second physical layer encoding method, that is, the first connection request carries the physical layer encoding method used when the second electronic device establishes a Bluetooth connection with the first electronic device.

[0154] As an example, if a second electronic device can establish a Bluetooth connection with a first electronic device through a second physical layer encoding method in response to a Bluetooth broadcast, then the second electronic device can establish a Bluetooth connection with the first electronic device according to the second physical layer encoding method and send a first connection request to the first electronic device, which carries the second physical layer encoding method.

[0155] Because signal interference may occur when the first electronic device and the second electronic device establish a Bluetooth connection, the second electronic device may be unable to establish a Bluetooth connection with the first electronic device using the second physical layer encoding method. In this case, if the second electronic device receives a Bluetooth broadcast carrying the first physical layer encoding method, the second electronic device can still continue to establish a Bluetooth connection with the first electronic device using the first physical layer encoding method. After the second electronic device establishes a Bluetooth connection with the first electronic device using the first physical layer encoding method, it can send a first connection request to the first electronic device, which carries the first physical layer encoding method.

[0156] In other words, in this embodiment, in the absence of signal interference, the second electronic device can establish a Bluetooth connection with the first electronic device through the second physical layer encoding method. In the presence of signal interference, the second electronic device can establish a Bluetooth connection with the first electronic device through the first physical layer encoding method.

[0157] It is worth noting that, regardless of the presence of signal interference, the second electronic device can establish a Bluetooth connection with the first electronic device, thereby improving the success rate of Bluetooth connection.

[0158] Step 703: The first electronic device receives the first connection request sent by the second electronic device, and determines to establish a Bluetooth connection with the second electronic device based on the first connection request.

[0159] It should be noted that, for the second electronic device, the Bluetooth connection is considered established once the first connection request is sent. When the first electronic device receives the connection request, it also determines that it is already in a Bluetooth connection, and the Bluetooth connection has been created.

[0160] In some embodiments, the process of establishing a Bluetooth connection between the first electronic device and the second electronic device can be an example of steps 701-703 described above, or it can be other methods, and the embodiments of this application do not limit this.

[0161] For example, after the first electronic device continuously broadcasts Bluetooth, the second electronic device responds to the Bluetooth broadcast by sending a scan request to the first electronic device. The scan request includes a request for a first physical layer encoding method and / or a request for a second physical layer encoding method. The first electronic device receives the scan request sent by the second electronic device. In response to the scan request, the first electronic device sends a corresponding scan response message to the second electronic device. In response to the scan response message, the second electronic device sends a second connection request to the first electronic device. The first electronic device receives the second connection request, which carries either the first physical layer encoding method or the second physical layer encoding method. Based on the second connection request, the first electronic device determines to establish a Bluetooth connection with the second electronic device.

[0162] That is, see Figure 9 When the first electronic device is in a pairable state, it can continuously send Bluetooth advertisements to its surroundings. Each Bluetooth advertisement can carry either a first physical layer encoding or a second physical layer encoding. Upon receiving a Bluetooth advertisement from the first electronic device, the second electronic device can initiate a scan request to obtain more device information from the first electronic device, such as device name and device type. After receiving the scan request, the first electronic device can send a scan response to the second electronic device. The scan response can include the device information of the first electronic device. In this case, the second electronic device can be the connection initiator (master device), and the first electronic device can be the connection receiver (slave device). Afterward, the first and second electronic devices can establish a physical link. Once the physical link is established, the first and second electronic devices will connect via Bluetooth.

[0163] In some embodiments, the first electronic device sends a corresponding scan response message to the second electronic device in response to a scan request, including the following situations: If the first electronic device receives a scan request from the second electronic device regarding the second physical layer encoding method (or a Bluetooth broadcast carrying the second physical layer encoding method), the first electronic device can directly respond to the scan request and establish a Bluetooth connection with the second electronic device. Alternatively, if the first electronic device receives a scan request from the second electronic device regarding the first physical layer encoding method (or a Bluetooth broadcast carrying the first physical layer encoding method), and after waiting for n broadcast cycles, receives another scan request from the second electronic device regarding the second physical layer encoding method (or a Bluetooth broadcast carrying the second physical layer encoding method), the first electronic device can respond to the scan request regarding the second physical layer encoding method (or a Bluetooth broadcast carrying the second physical layer encoding method) and establish a Bluetooth connection with the second electronic device. Alternatively, if the first electronic device receives a scan request from the second electronic device for the first physical layer encoding method (or for Bluetooth broadcasts carrying the first physical layer encoding method), and after waiting for n broadcast cycles, if it does not receive a scan request from the second electronic device for the second physical layer encoding method (or for Bluetooth broadcasts carrying the second physical layer encoding method), the first electronic device may respond to the scan request sent for the first physical layer encoding method (or for Bluetooth broadcasts carrying the first physical layer encoding method) and establish a Bluetooth connection with the second electronic device.

[0164] Step 704: After the first electronic device successfully establishes an initial Bluetooth connection with the second electronic device, it determines the Bluetooth connection status between the two devices.

[0165] It should be noted that the initial Bluetooth connection between the first and second electronic devices refers to a situation where the Bluetooth connection between the first and second electronic devices was disconnected prior to this connection. For example, if the first and second electronic devices have never connected via Bluetooth before, then this Bluetooth connection is considered the initial Bluetooth connection. Similarly, if the first and second electronic devices have previously connected via Bluetooth, and were disconnected before this connection, then this connection is also considered the initial Bluetooth connection.

[0166] The success rate and smoothness of interconnection between the first and second electronic devices are determined by the quality of Bluetooth communication between them. When the Bluetooth communication quality is good, the success rate and stability of interconnection are high. Conversely, when the Bluetooth communication quality is poor, the success rate of interconnection is low, and service interruption may occur during the interconnection process. Therefore, after the first and second electronic devices successfully establish a Bluetooth connection for the first time, the Bluetooth connection status between them must be confirmed.

[0167] It should be noted that the Bluetooth connection status includes both the physical layer encoding method and the Bluetooth signal strength. This Bluetooth signal strength can refer to the Received Signal Strength Indication (RSSI) of the first electronic device.

[0168] Step 705: The first electronic device maintains the Bluetooth connection with the second electronic device according to the Bluetooth connection status.

[0169] As an example, when the physical layer encoding method is the first physical layer encoding method and the Bluetooth signal strength is greater than or equal to a preset strength threshold, the Bluetooth connection with the second electronic device is maintained using the first physical layer encoding method; when the physical layer encoding method is the second physical layer encoding method and the Bluetooth signal strength is greater than or equal to the preset strength threshold, the Bluetooth connection with the second electronic device is maintained using the second physical layer encoding method.

[0170] It should be noted that the preset intensity threshold can be set in advance according to requirements. For example, the preset intensity threshold can be -130dBm, -120dBm, -110dBm, etc.

[0171] As described above, the first electronic device and the second electronic device may connect via Bluetooth using either a first physical layer encoding method or a second physical layer encoding method. When the first and second electronic devices connect via Bluetooth using the first physical layer encoding method, it indicates that they are in a Bluetooth interference environment. Therefore, to avoid Bluetooth disconnection, if the current Bluetooth signal strength is greater than or equal to a preset strength threshold, the first electronic device can continue to maintain the Bluetooth connection with the second electronic device using the first physical layer encoding method. When the first and second electronic devices connect via Bluetooth using the second physical layer encoding method, if the Bluetooth signal strength is greater than or equal to the preset strength threshold, it indicates a strong Bluetooth signal. Therefore, the first electronic device can continue to maintain the Bluetooth connection with the second electronic device using the second physical layer encoding method.

[0172] In some embodiments, since the first electronic device and the second electronic device may not be in a Bluetooth interference environment for extended periods, when the first electronic device and the second electronic device establish a Bluetooth connection via a second physical layer encoding method, and the Bluetooth signal strength is greater than or equal to a preset strength threshold, the first electronic device, while maintaining the Bluetooth connection with the second electronic device via the first physical layer encoding method, can also determine the connection duration with the second electronic device to reduce Bluetooth latency; if the connection duration is greater than or equal to the duration threshold, the first physical layer encoding method is switched to the second physical layer encoding method to establish a Bluetooth connection with the second electronic device via the second physical layer encoding method.

[0173] It should be noted that this duration threshold can be preset according to needs, for example, the duration threshold can be 3 minutes, 5 minutes, etc.

[0174] In some embodiments, the first electronic device and the second electronic device may establish a Bluetooth connection after initiating a relevant Bluetooth service, or the relevant Bluetooth service may be initiated after establishing this Bluetooth connection. When the first electronic device and the second electronic device establish a Bluetooth connection via a second physical layer encoding method, and the Bluetooth signal strength is less than a preset strength threshold, if the first electronic device has already initiated a Bluetooth service with the second electronic device, the first electronic device may not respond to the initiated portion of the Bluetooth service, and / or the first electronic device may display a first prompt message indicating that the Bluetooth signal does not support certain Bluetooth services with the second electronic device.

[0175] It should be noted that the first electronic device may not respond to some Bluetooth services that have been started, which may refer to services with high communication speed and / or high latency requirements, such as screen sharing services, network sharing services, etc.

[0176] For example, a first electronic device initiates a trust loop and then establishes a Bluetooth connection with a second electronic device. After the Bluetooth connection is established, if the first and second electronic devices establish the Bluetooth connection via a second physical layer encoding method and the Bluetooth signal strength is less than a preset strength threshold, the device identifier of the second electronic device will not be displayed in the trust loop. Alternatively, the device identifier of the second electronic device can be displayed in the trust loop, and the first electronic device can indicate that Bluetooth services with high communication speed and latency requirements are unavailable and indicate a weak Bluetooth signal.

[0177] As an example, if a Bluetooth connection is established between a first electronic device and a second electronic device via a second physical layer encoding method, and the Bluetooth signal strength is less than a preset strength threshold, the Bluetooth services performed between the first electronic device and the second electronic device include services with low communication rate requirements and / or low latency requirements, such as document transfer services. In this case, the first electronic device can continue to perform such Bluetooth services.

[0178] In some embodiments, if no interconnection service is performed between the first electronic device and the second electronic device while the first electronic device maintains a Bluetooth connection with the second electronic device, the first electronic device may periodically detect the Bluetooth connection status with the second electronic device, that is, the first electronic device may perform the following steps 711 or 712.

[0179] Step 706: The first electronic device responds to the user's operation and initiates the target Bluetooth service with the second electronic device.

[0180] As described above, the first electronic device and the second electronic device may trigger some Bluetooth services before establishing a Bluetooth connection, and they may also trigger some Bluetooth services after establishing a Bluetooth connection. In this embodiment, the example of the target Bluetooth service being triggered after establishing a Bluetooth connection between the first and second electronic devices will be used for illustration. That is, after step 705, the first electronic device can also perform the operation in step 706.

[0181] It should be noted that the target Bluetooth service is a service that enables interconnection between the first electronic device and the second electronic device. For example, the target Bluetooth service can be a screen sharing service, a document transfer service, a network sharing service, etc.

[0182] Step 707: The first electronic device selects whether to establish a communication connection with the second electronic device other than a Bluetooth connection, based on the service type of the target Bluetooth service. If yes, proceed to step 708 below; otherwise, proceed to step 709 below.

[0183] It should be noted that other communication connections include Wi-Fi IP2P connections (WiFi peer-to-peer, also known as Wi-Fi Direct, a technology that allows direct connections between devices).

[0184] After establishing a Bluetooth connection, some interconnection services between the first and second electronic devices require high data transmission rates and may necessitate other communication connections in addition to the Bluetooth connection. Therefore, the first electronic device can choose whether to establish other communication connections with the second electronic device besides the Bluetooth connection, depending on the type of the target Bluetooth service.

[0185] As an example, when the service type is screen sharing, network sharing, or similar services, the first electronic device can establish a communication connection with the second device other than a Bluetooth connection. When the service type is not screen sharing, network sharing, or similar services, no other communication connection needs to be established between the first and second electronic devices.

[0186] It should be noted that the communication rate (or data transmission rate) of other communication connections is usually greater than that of Bluetooth connections.

[0187] Step 708: If other communication connections are established, the first electronic device communicates with the second electronic device via Bluetooth and / or other communication connections, and performs the operation described in step 710 below.

[0188] Since there may be multiple communication methods between the first electronic device and the second electronic device, such as Bluetooth connection, WiFi P2P and other communication methods, the first electronic device can communicate with the second electronic device through Bluetooth connection and / or other communication connections.

[0189] Step 709: In the absence of establishing other communication connections, the first electronic device continues to communicate with the second electronic device via Bluetooth and performs the operation described in step 710 below.

[0190] Step 710: During the target Bluetooth service process, switch the communication mode or reconnect via Bluetooth according to the Bluetooth connection status and the communication requirements of the target Bluetooth service.

[0191] In some embodiments, during the execution of a target Bluetooth service, if the communication rate requirement of the target Bluetooth service is greater than or equal to a rate threshold, and if another communication connection is established, the target Bluetooth service is executed through that other communication connection; if no other communication connection is established, the Bluetooth connection status is continuously monitored; if the packet loss rate generated during the execution of the target Bluetooth service is greater than or equal to a packet loss rate threshold, and / or if the latency generated during the execution of the target Bluetooth service is greater than or equal to a preset latency, the physical layer encoding method used by the current Bluetooth connection is determined; if the physical layer encoding method used by the current Bluetooth connection is a first physical layer encoding method, the Bluetooth connection with the second electronic device is re-established; if the physical layer encoding method used by the current Bluetooth connection is a second physical layer encoding method, the second physical layer encoding method is switched to the first physical layer encoding method, and a Bluetooth connection is established with the second electronic device through the first physical layer encoding method.

[0192] Since the communication rate requirement of the target Bluetooth service is greater than or equal to the rate threshold, the communication method of the Bluetooth connection may not be able to fully meet the communication rate requirement of the target Bluetooth service. Therefore, the first electronic device can use other communication connections to carry out the target Bluetooth service.

[0193] It should be noted that the rate threshold can be preset according to requirements, for example, the rate threshold can be 1Mb / s, 2Mb / s, etc. The preset duration can also be preset, for example, the preset duration can be 5s, 4s, 3s, etc., and this application embodiment does not impose specific limitations on it.

[0194] As an example, if the communication rate requirement of the target Bluetooth service is less than the rate threshold, the first electronic device can continue to perform the target Bluetooth service via Bluetooth connection.

[0195] In some embodiments, during the execution of a target Bluetooth service, if severe Bluetooth packet loss, high latency, or Bluetooth disconnection occurs, the first electronic device can determine the physical layer encoding method used for the current Bluetooth connection. If the current Bluetooth connection uses the first physical layer encoding method, the first electronic device can re-establish the Bluetooth connection with the second electronic device regardless of whether a Bluetooth disconnection has occurred. If the current Bluetooth connection uses the second physical layer encoding method, and no Bluetooth disconnection has occurred, the first electronic device can switch from the second physical layer encoding method to the first physical layer encoding method and establish a Bluetooth connection with the second electronic device using the first physical layer encoding method. If the Bluetooth connection has been disconnected, the first electronic device directly re-establishes a Bluetooth connection with the second electronic device using the first physical layer encoding method.

[0196] It should be noted that the operation of re-establishing the Bluetooth connection between the first electronic device and the second electronic device can refer to the operation of steps 701-703 above, and will not be described in detail in this embodiment.

[0197] As can be seen from the above, there may be no other communication connection between the first electronic device and the second electronic device. In the absence of other communication connection between the first electronic device and the second electronic device, the first electronic device can continue to conduct target Bluetooth services with the second electronic device via Bluetooth connection.

[0198] Step 711: The first electronic device determines whether to establish other communication connections with the second electronic device. If yes, it performs the operation of step 708 above; if no, it performs the operation of step 712 below.

[0199] Normally, during the interconnection process between the first and second electronic devices via Bluetooth, the first electronic device does not need to periodically check the connection status with the second electronic device. Once the first electronic device has completed the interconnection process with the second electronic device, or even if the first and second electronic devices are not interconnecting, the first electronic device can periodically check the connection status with the second electronic device.

[0200] As an example, during the process of the first electronic device periodically checking the connection status with the second electronic device, the first electronic device can first determine whether to establish other communication connections with the second electronic device. For example, the first electronic device can determine whether to establish a WiFi P2P connection with the second electronic device. If so, the first electronic device and the second electronic device can continue to communicate via the WiFi P2P connection. Therefore, the first electronic device can return to the operation of step 708 above. If no other communication connection is established with the second electronic device, the first electronic device needs to check whether the Bluetooth connection with the second electronic device is maintained. That is, the first electronic device can perform the operation of step 712 below.

[0201] Step 712: The first electronic device periodically sends Bluetooth heartbeat signals to the second electronic device.

[0202] In other words, the first electronic device periodically sends Bluetooth heartbeat packets to the second electronic device.

[0203] Step 713: The first electronic device determines whether to maintain a Bluetooth connection with the second electronic device based on the Bluetooth heartbeat signal. If yes, then the operation of step 714 below is performed; if no, then the operation of step 715 below is performed.

[0204] Since the first electronic device and the second electronic device can periodically exchange data after establishing a Bluetooth connection to ensure the Bluetooth connection is maintained, if the first electronic device receives a feedback signal from the second electronic device after sending a Bluetooth heartbeat signal, it indicates that the Bluetooth connection between the two electronic devices is maintained. Therefore, the first electronic device can perform the operation in step 714 below. If a feedback signal is received from the second electronic device, but the waiting time exceeds a preset waiting time, or if no feedback signal is received from the second electronic device, it can be determined that there is a problem with the Bluetooth connection with the second electronic device. In this case, it can be determined that the first electronic device has failed to maintain a Bluetooth connection with the second electronic device. Therefore, the first electronic device can perform the operation in step 715 below.

[0205] Step 714: The first electronic device maintains a Bluetooth connection with the second electronic device using the current physical layer encoding method.

[0206] When the first electronic device determines that it needs to maintain a Bluetooth connection with the second electronic device based on the Bluetooth heartbeat signal, the Bluetooth signal between the two electronic devices is usually strong; for example, the Bluetooth signal strength is usually greater than or equal to a preset strength threshold. Therefore, the first electronic device can continue to maintain the Bluetooth connection with the second electronic device using the current physical layer coding method.

[0207] Step 715: The first electronic device re-establishes a Bluetooth connection with the second electronic device using the first physical layer encoding method.

[0208] In some embodiments, if the first electronic device fails to connect to the second electronic device periodically, the first electronic device may establish a Bluetooth connection with the second electronic device through a second physical layer encoding method. In this case, the first electronic device can switch from the second physical layer encoding method to the first physical layer encoding method and reconnect to the second electronic device via Bluetooth through the first physical layer encoding method.

[0209] Of course, the first electronic device may have already established a Bluetooth connection with the second electronic device through the second physical layer encoding method in the event of periodic connection failure. In this case, the first electronic device can still continue to reconnect with the second electronic device via Bluetooth through the first physical layer encoding method.

[0210] In this embodiment, the first electronic device can perform hybrid Bluetooth broadcasting using different physical layer encoding methods, and one of these methods has strong anti-interference capabilities, thus ensuring the success rate of Bluetooth connection between the first and second electronic devices in interference scenarios. Furthermore, after the Bluetooth connection is established, the first electronic device can maintain the connection based on its status, thereby maximizing the stability of the Bluetooth connection and ensuring the smooth operation of interconnection services between electronic devices.

[0211] It should be noted that for other communication methods with multiple encoding methods, the first electronic device can also use the method provided in the embodiments of this application to connect during other communication connections. That is, for other communication methods with multiple encoding methods, different encoding methods can also be mixed and broadcast during the connection process to improve the success rate and reliability of communication connections.

[0212] Furthermore, the above description uses the interaction between the first electronic device and the second electronic device to illustrate the Bluetooth connection method. Next, to further understand the embodiments of this application, the description will focus on the method being executed by the first electronic device. Please refer to [link / reference needed]. Figure 10 , Figure 10 This is a schematic flowchart illustrating a Bluetooth connection method according to another exemplary embodiment. As an example and not a limitation, the method may include some or all of the following:

[0213] Step 1001: Continue Bluetooth broadcasting.

[0214] It should be noted that each Bluetooth broadcast can carry either a first physical layer encoding method or a second physical layer encoding method. The first physical layer encoding method has a greater resistance to interference than the second physical layer encoding method.

[0215] As an example, the first physical layer is encoded as Coded PHY, and the second physical layer is encoded as Uncoded PHY.

[0216] It is worth noting that, since Uncoded PHY has a high data transmission rate and Coded PHY has a low data transmission rate, and Coded PHY has a higher interference resistance than Uncoded PHY, Bluetooth broadcasting is performed using a hybrid encoding method to ensure the success of Bluetooth connections in interference scenarios.

[0217] In some embodiments, the operation of the first electronic device continuously performing Bluetooth broadcasting includes: obtaining an encoding ratio, which is the ratio between the number of Bluetooth broadcasts carrying a first physical layer encoding method and the number of Bluetooth broadcasts carrying a second physical layer encoding method; and continuously performing Bluetooth broadcasting according to the encoding ratio.

[0218] It should be noted that the encoding ratio can be preset as needed, or it can be dynamically adjusted according to the Bluetooth connection status. That is, the encoding ratio can be a fixed value, such as 1:5, or it can be a value that can be dynamically adjusted at any time. This application embodiment does not impose specific limitations on this.

[0219] It is worth noting that by setting a certain encoding ratio, the function of judging the current network environment is realized.

[0220] Step 1002: Upon receiving a response message from the second electronic device, establish a Bluetooth connection with the second electronic device.

[0221] It should be noted that the response message is the message in which the second electronic device responds to the Bluetooth broadcast.

[0222] In some embodiments, the response message may be a second electronic device responding to a Bluetooth broadcast by sending a first connection request to the first electronic device.

[0223] In other words, if the second electronic device can establish a Bluetooth connection with the first electronic device via the second physical layer encoding method in response to the Bluetooth broadcast, then the second electronic device can establish a Bluetooth connection with the first electronic device according to the second physical layer encoding method and send a first connection request to the first electronic device, which carries the second physical layer encoding method. Alternatively, if the second electronic device receives a Bluetooth broadcast carrying the first physical layer encoding method, the second electronic device can continue to establish a Bluetooth connection with the first electronic device via the first physical layer encoding method. After establishing a Bluetooth connection with the first electronic device via the first physical layer encoding method, the second electronic device can send a first connection request to the first electronic device, which carries the first physical layer encoding method.

[0224] It should be noted that, for the second electronic device, the Bluetooth connection is considered established once the first connection request is sent. When the first electronic device receives the connection request, it also determines that it is already connected and the connection has been established.

[0225] In some embodiments, the response message may also be a second electronic device responding to a scan request sent by a Bluetooth broadcast to the first electronic device. That is, in the Bluetooth protocol, the second electronic device may send a scan request after receiving a Bluetooth broadcast.

[0226] For example, after the first electronic device continuously broadcasts Bluetooth, the second electronic device responds to the Bluetooth broadcast by sending a scan request to the first electronic device. The scan request includes a request for a first physical layer encoding method and / or a request for a second physical layer encoding method. The first electronic device receives the scan request sent by the second electronic device. In response to the scan request, the first electronic device sends a corresponding scan response message to the second electronic device. In response to the scan response message, the second electronic device sends a second connection request to the first electronic device. The first electronic device receives the second connection request, which carries the physical layer encoding method. Based on the second connection request, the first electronic device determines to establish a Bluetooth connection with the second electronic device.

[0227] Step 1003: After a successful Bluetooth connection, maintain the Bluetooth connection with the second electronic device using the corresponding physical layer encoding method according to the Bluetooth connection status.

[0228] In some embodiments, after a successful Bluetooth connection, the operation of maintaining the Bluetooth connection between the first electronic device and the second electronic device using a corresponding physical layer encoding method according to the Bluetooth connection status includes: after the initial successful Bluetooth connection with the second electronic device, determining the Bluetooth connection status between the first electronic device and the second electronic device, the Bluetooth connection status including the physical layer encoding method and the Bluetooth signal strength; maintaining the Bluetooth connection between the first electronic device and the second electronic device using the first physical layer encoding method when the physical layer encoding method is the first physical layer encoding method and the Bluetooth signal strength is greater than or equal to a preset strength threshold; and maintaining the Bluetooth connection between the second electronic device using the second physical layer encoding method when the physical layer encoding method is the second physical layer encoding method and the Bluetooth signal strength is greater than or equal to the preset strength threshold.

[0229] It should be noted that the preset intensity threshold can be set in advance according to requirements. For example, the preset intensity threshold can be -130dBm, -120dBm, -110dBm, etc.

[0230] It is worth noting that by selecting an appropriate physical layer encoding method based on the Bluetooth connection status with the second electronic device, the reliability of the Bluetooth connection is ensured.

[0231] In some embodiments, since the first electronic device and the second electronic device may not be in a Bluetooth interference environment for an extended period, after the first electronic device determines the Bluetooth connection status with the second electronic device, if the physical layer encoding method is the first physical layer encoding method and the Bluetooth signal strength is greater than or equal to a preset strength threshold, the connection duration with the second electronic device can also be determined; if the connection duration is greater than or equal to the duration threshold, the first physical layer encoding method is switched to the second physical layer encoding method to establish a Bluetooth connection with the second electronic device through the second physical layer encoding method.

[0232] It should be noted that this duration threshold can be preset according to needs, for example, the duration threshold can be 3 minutes, 5 minutes, etc.

[0233] It is worth noting that by switching the physical layer encoding method of the Bluetooth connection in a timely manner according to the Bluetooth connection status, excessive Bluetooth latency is avoided.

[0234] In some embodiments, the first electronic device and the second electronic device may establish a Bluetooth connection after initiating a relevant Bluetooth service, or the relevant Bluetooth service may be initiated after establishing this Bluetooth connection. Thus, if the physical layer encoding method is the second physical layer encoding method and the Bluetooth signal strength is less than the preset strength threshold, and if a Bluetooth service with the second electronic device has already been initiated, the initiated portion of the Bluetooth service will not be responded to, and / or a first prompt message will be displayed. This first prompt message indicates that the Bluetooth signal does not support certain Bluetooth services with the second electronic device.

[0235] For example, a first electronic device initiates a trust loop and then establishes a Bluetooth connection with a second electronic device. After the Bluetooth connection is established, if the first and second electronic devices establish the Bluetooth connection via a second physical layer encoding method and the Bluetooth signal strength is less than a preset strength threshold, the device identifier of the second electronic device will not be displayed in the trust loop. Alternatively, the device identifier of the second electronic device can be displayed in the trust loop, and the first electronic device can indicate that Bluetooth services with high communication speed and latency requirements are unavailable and indicate a weak Bluetooth signal.

[0236] It is worth noting that when the Bluetooth signal is weak, prompts are sent to the user to improve the Bluetooth environment, thereby enhancing the intelligence of the electronic device.

[0237] Since users may also trigger related Bluetooth services (interoperability services) after the first and second electronic devices are connected via Bluetooth, the operation of the first electronic device after the user triggers the Bluetooth service will be explained below.

[0238] In some embodiments, after a successful Bluetooth connection, the first electronic device maintains the Bluetooth connection with the second electronic device according to the Bluetooth connection status and the corresponding physical layer encoding method. It can also receive user operations and, in response to user operations, initiate a target Bluetooth service with the second electronic device. Based on the service type of the target Bluetooth service, it determines whether to establish other communication connections with the second electronic device besides the Bluetooth connection. If other communication connections are established, during the execution of the target Bluetooth service, it switches the communication mode or performs Bluetooth reconnection according to the Bluetooth connection status and the communication requirements of the target Bluetooth service.

[0239] Because different types of Bluetooth services have different data transmission requirements, for Bluetooth services with high communication speed and latency requirements, such as network sharing and screen sharing services, the first electronic device may need to establish other communication connections besides the Bluetooth connection with the second electronic device. Therefore, the first electronic device can determine whether to establish other communication connections with the second electronic device besides the Bluetooth connection based on the service type of the target Bluetooth service.

[0240] It should be noted that other communication connections may include WiFi P2P connections.

[0241] It is worth noting that during Bluetooth service operations, alternative communication connections can be established based on the service type of the Bluetooth service, thereby ensuring the smooth operation of the Bluetooth service and improving the Bluetooth service experience.

[0242] In some embodiments, when establishing other communication connections, during the process of performing the target Bluetooth service, the operation of the first electronic device switching the communication mode or performing Bluetooth reconnection according to the Bluetooth connection status and the communication requirements of the target Bluetooth service includes: performing the target Bluetooth service through other communication connections when the communication rate requirement of the target Bluetooth service is greater than or equal to a rate threshold; determining the physical layer encoding method used by the current Bluetooth connection when the packet loss rate generated during the process of performing the target Bluetooth service is greater than or equal to a packet loss rate threshold, and / or when the delay duration generated during the process of performing the target Bluetooth service is greater than or equal to a preset duration; re-establishing the Bluetooth connection with the second electronic device when the physical layer encoding method used by the current Bluetooth connection is the first physical layer encoding method; and switching the second physical layer encoding method to the first physical layer encoding method when the physical layer encoding method used by the current Bluetooth connection is the second physical layer encoding method, and performing Bluetooth connection with the second electronic device through the first physical layer encoding method.

[0243] It is worth noting that different Bluetooth service states are configured under different signal scenarios during Bluetooth service operations, thereby improving the service experience.

[0244] Typically, after the first electronic device and the second electronic device are connected via Bluetooth, the first electronic device can periodically check the connection status with the second electronic device.

[0245] In other words, after a successful Bluetooth connection, the first electronic device maintains the Bluetooth connection with the second electronic device according to the Bluetooth connection status and the corresponding physical layer encoding method. The first electronic device can periodically check the Bluetooth connection status. If the Bluetooth connection is successfully maintained, the Bluetooth connection with the second electronic device is maintained using the current physical layer encoding method. If the Bluetooth connection fails, the Bluetooth connection with the second electronic device is re-established using the first physical layer encoding method.

[0246] It is worth noting that by periodically checking the Bluetooth connection status and switching the Bluetooth connection method according to the Bluetooth connection status, the reliability of the Bluetooth connection is improved.

[0247] In some embodiments, the first electronic device periodically detects the Bluetooth connection status with the second electronic device by periodically sending Bluetooth heartbeat signals (or Bluetooth heartbeat packets) to the second electronic device. If the first electronic device receives a feedback signal from the second electronic device in response to the Bluetooth heartbeat packet within a preset waiting time, it determines that the periodic Bluetooth connection has been successfully maintained. In this case, the Bluetooth signal strength between the first and second electronic devices is typically greater than or equal to a preset strength threshold, and the first electronic device can continue to maintain the Bluetooth connection with the second electronic device using the current physical layer encoding method. If the first electronic device receives a feedback signal from the second electronic device in response to the Bluetooth heartbeat packet, and the waiting time exceeds a preset waiting time, or if the first electronic device does not receive a feedback signal in response to the Bluetooth heartbeat packet for an extended period, the first electronic device can determine that the periodic Bluetooth connection has failed. In this case, regardless of the encoding method used for the Bluetooth connection between the first and second electronic devices, the first electronic device can switch to the first physical layer encoding method to re-establish the Bluetooth connection with the second electronic device.

[0248] It should be noted that if the first electronic device does not receive a feedback signal for the Bluetooth heartbeat packet for an extended period, and if it re-establishes a Bluetooth connection with the second electronic device using the first physical layer encoding method, the Bluetooth signal strength will typically be lower than the signal strength threshold after a successful connection. Conversely, if the first electronic device receives a feedback signal for the Bluetooth heartbeat packet from the second electronic device and waits for a duration longer than a preset waiting time, and if it re-establishes a Bluetooth connection with the second electronic device using the first physical layer encoding method, the Bluetooth signal strength will typically be greater than or equal to the signal strength threshold after a successful connection.

[0249] In this embodiment, the first electronic device can perform hybrid Bluetooth broadcasting using different physical layer encoding methods, and one of these methods has strong anti-interference capabilities, thus ensuring the success rate of Bluetooth connection between the first and second electronic devices in interference scenarios. Furthermore, after the Bluetooth connection is established, the first electronic device can maintain the connection based on its status, thereby maximizing the stability of the Bluetooth connection and ensuring the smooth operation of interconnection services between electronic devices.

[0250] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line, DSL) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer, or a data storage device such as a server or data center that integrates one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., Digital Versatile Discs (DVDs)), or semiconductor media (e.g., Solid State Disks (SSDs)).

[0251] The above-described embodiments are optional embodiments provided by this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the technical scope disclosed in this application should be included within the protection scope of this application.

Claims

1. A Bluetooth connection method, characterized in that, Applied to a first electronic device, the method includes: Continuous Bluetooth broadcasting is performed, and each Bluetooth broadcast carries a first physical layer encoding method or a second physical layer encoding method, wherein the anti-interference ability of the first physical layer encoding method is greater than that of the second physical layer encoding method; Upon receiving a response message from the second electronic device, a Bluetooth connection is established with the second electronic device, wherein the response message is a message from the second electronic device responding to the Bluetooth broadcast; After a successful Bluetooth connection, the Bluetooth connection with the second electronic device is maintained through the corresponding physical layer encoding method according to the Bluetooth connection status.

2. The method as described in claim 1, characterized in that, The continuous Bluetooth broadcasting includes: Obtain the encoding ratio, which is the ratio between the number of Bluetooth broadcasts carrying the first physical layer encoding method and the number of Bluetooth broadcasts carrying the second physical layer encoding method; Bluetooth broadcasting continues according to the stated encoding ratio.

3. The method as described in claim 1 or 2, characterized in that, The first physical layer encoding method is Coded PHY, and the second physical layer encoding method is Uncoded PHY.

4. The method according to any one of claims 1-3, characterized in that, After a successful Bluetooth connection, maintaining the Bluetooth connection with the second electronic device according to the Bluetooth connection status through the corresponding physical layer encoding method includes: After successfully establishing an initial Bluetooth connection with the second electronic device, the Bluetooth connection status between the two devices is determined, including the physical layer encoding method and the Bluetooth signal strength. When the physical layer encoding method is the first physical layer encoding method and the Bluetooth signal strength is greater than or equal to a preset strength threshold, the Bluetooth connection with the second electronic device is maintained using the first physical layer encoding method. When the physical layer encoding method is the second physical layer encoding method and the Bluetooth signal strength is greater than or equal to the preset strength threshold, the Bluetooth connection with the second electronic device is maintained using the second physical layer encoding method.

5. The method as described in claim 4, characterized in that, After successfully establishing an initial Bluetooth connection with the second electronic device and determining the Bluetooth connection status with the second electronic device, the process further includes: When the physical layer encoding method is the first physical layer encoding method and the Bluetooth signal strength is greater than or equal to a preset strength threshold, the connection duration with the second electronic device is determined. If the connection duration is greater than or equal to the duration threshold, the first physical layer encoding method is switched to the second physical layer encoding method to establish a Bluetooth connection with the second electronic device through the second physical layer encoding method.

6. The method as described in claim 4, characterized in that, After successfully establishing an initial Bluetooth connection with the second electronic device and determining the Bluetooth connection status with the second electronic device, the process further includes: When the physical layer encoding method is the second physical layer encoding method and the Bluetooth signal strength is less than the preset strength threshold, if a Bluetooth service with the second electronic device has been started, the started Bluetooth service will not be responded to, and / or a first prompt message will be displayed. The first prompt message is used to indicate that the Bluetooth signal does not support some Bluetooth services with the second electronic device.

7. The method according to any one of claims 1-6, characterized in that, After a successful Bluetooth connection is established, the process of maintaining the Bluetooth connection with the second electronic device using the corresponding physical layer encoding method based on the Bluetooth connection status further includes: In response to user input, initiate the target Bluetooth service with the second electronic device; Based on the service type of the target Bluetooth service, determine whether to establish a communication connection with the second electronic device other than a Bluetooth connection; In the case of establishing the other communication connection, during the process of performing the target Bluetooth service, the communication mode is switched or Bluetooth reconnection is performed according to the Bluetooth connection status and the communication requirements of the target Bluetooth service.

8. The method as described in claim 7, characterized in that, In the case of establishing the other communication connection, during the process of performing the target Bluetooth service, switching the communication mode or reconnecting via Bluetooth according to the Bluetooth connection status and the communication requirements of the target Bluetooth service includes: In the case of establishing the other communication connection, during the process of performing the target Bluetooth service, if the communication rate requirement of the target Bluetooth service is greater than or equal to the rate threshold, the target Bluetooth service is performed through the other communication connection. If the packet loss rate generated during the execution of the target Bluetooth service is greater than or equal to the packet loss rate threshold, and / or if the delay duration generated during the execution of the target Bluetooth service is greater than or equal to the preset duration, the physical layer encoding method used by the current Bluetooth connection shall be determined. If the physical layer encoding method used in the current Bluetooth connection is the first physical layer encoding method, re-establish the Bluetooth connection with the second electronic device; If the physical layer encoding method used for the current Bluetooth connection is the second physical layer encoding method, switch the second physical layer encoding method to the first physical layer encoding method, and establish a Bluetooth connection with the second electronic device through the first physical layer encoding method.

9. The method according to any one of claims 1-6, characterized in that, After a successful Bluetooth connection is established, the process of maintaining the Bluetooth connection with the second electronic device using the corresponding physical layer encoding method based on the Bluetooth connection status further includes: Periodically check the Bluetooth connection status; If a successful Bluetooth connection maintenance is detected, the Bluetooth connection with the second electronic device is maintained using the current physical layer encoding method. If a Bluetooth connection failure is detected, a new Bluetooth connection is established with the second electronic device using the first physical layer encoding method.

10. An electronic device, characterized in that, The device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, characterized in that, when the processor executes the computer program, the electronic device performs the method as described in any one of claims 1-9.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1-9.

12. A computer program product, characterized in that, Includes a computer program, which, when run, causes the method as described in any one of claims 1-9 to be performed.