Bluetooth connection establishment method and apparatus, and first terminal device
By using BLE connection to increase the traditional Bluetooth paging scanning duty cycle of the second terminal device in a multi-device networking environment, the problem of low success rate of traditional Bluetooth connection is solved and higher data transmission reliability is achieved.
Patent Information
- Application Number
- CN202311554300.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-21
- Publication Date
- 2025-05-23
AI Technical Summary
In a multi-device networking environment, the success rate of traditional Bluetooth connection is low, mainly due to the low duty cycle of BR paging scan, which causes the paging scan to be interrupted by other services, resulting in the problem of paging timeout.
By establishing a BLE connection between the first terminal device and the second terminal device, sending a message to the second terminal device instructs it to increase the duty cycle of the conventional Bluetooth paging scan, the specific method includes reducing the paging scan interval or increasing the paging scan window.
This improves the success rate of traditional Bluetooth connections, increases the duty cycle of paging scans, reduces the possibility of paging scans being interrupted, and improves the reliability of data transmission between devices.
Smart Images

Figure CN120034989A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of smart terminal technology, and in particular, to a method and apparatus for establishing a Bluetooth connection and a first terminal device. Background Art
[0002] During the distributed device networking stage, multiple Bluetooth connections are used, such as basic rate (BR) and / or Bluetooth low energy (BLE) to exchange data between devices. Frequent concurrency between Bluetooth connections will lead to Bluetooth resource shortage, affect the connection success rate of BR, and further cause problems such as slow online access or connection failure of terminal devices. Summary of the invention
[0003] The embodiments of the present application provide a method, apparatus and first terminal device for establishing a Bluetooth connection. The embodiments of the present application also provide a computer-readable storage medium to improve the duty cycle of traditional Bluetooth paging scanning and improve the success rate of traditional Bluetooth connections in a multi-device networking environment.
[0004] In the first aspect, an embodiment of the present application provides a method for establishing a Bluetooth connection, including: a first terminal device obtains data to be transmitted in response to a service trigger request; wherein the data to be transmitted includes data to be transmitted to a second terminal device; when a traditional Bluetooth connection is not established between the first terminal device and the second terminal device, but a low-power Bluetooth BLE connection has been established, the first terminal device sends a first message to the second terminal device through the BLE connection, and the first message instructs the second terminal device to increase the traditional Bluetooth paging scan duty cycle of the second terminal device; the first terminal device receives a second message sent by the second terminal device, and the second message indicates that the traditional Bluetooth paging scan duty cycle of the second terminal device has been adjusted; the first terminal device establishes a traditional Bluetooth connection with the second terminal device, and transmits the data to be transmitted to the second terminal device through the traditional Bluetooth connection.
[0005] In one possible implementation, the second terminal device increases the traditional Bluetooth paging scan duty cycle of the second terminal device, including: the second terminal device reduces the traditional Bluetooth paging scan interval of the second terminal device, and / or increases the traditional Bluetooth paging scan window of the second terminal device.
[0006] In one possible implementation, the adjustment range of the traditional Bluetooth paging scan window is 11.25 ms to 128 ms, the traditional Bluetooth paging scan interval is maintained at 1.28 s, and the adjustment range of the traditional Bluetooth paging scan duty cycle is 0.88% to 10%.
[0007] In one possible implementation, after the first terminal device establishes a traditional Bluetooth connection with the second terminal device, the method further includes: the first terminal device sends a third message to the second terminal device, wherein the third message instructs the second terminal device to restore the traditional Bluetooth paging scan duty cycle to the traditional Bluetooth paging scan duty cycle before the increase.
[0008] In one possible implementation, after the first terminal device sends the third message to the second terminal device, the method further includes: the first terminal device receives a fourth message sent by the second terminal device, wherein the fourth message indicates that the traditional Bluetooth paging scanning duty cycle of the second terminal device has been restored.
[0009] In one possible implementation, after the first terminal device sends the first message to the second terminal device through the BLE connection, before the first terminal device establishes a traditional Bluetooth connection with the second terminal device, it also includes: the first terminal device increases the BLE interval between the first terminal device and the second terminal device.
[0010] In one possible implementation, the first terminal device increases the BLE interval between the first terminal device and the second terminal device, including: the first terminal device increases the BLE interval between the first terminal device and the second terminal device according to the current status of Bluetooth resources used by the first terminal device and the transmission status of the BLE connection.
[0011] In one possible implementation, the first terminal device increases the BLE interval between the first terminal device and the second terminal device according to the status of the Bluetooth resource currently used by the first terminal device and the transmission status of the BLE connection, including: when the status of the Bluetooth resource currently used by the first terminal device is congested, and the BLE connection is performing data transmission, the first terminal device increases the BLE interval between the first terminal device and the second terminal device within a first interval; when the status of the Bluetooth resource currently used by the first terminal device is not congested, and / or the BLE connection is not performing data transmission, the first terminal device increases the BLE interval between the first terminal device and the second terminal device within a second interval; wherein the minimum values of the first interval and the second interval are equal, and the maximum value of the second interval is greater than the maximum value of the first interval.
[0012] In one possible implementation, the minimum value of the first interval and the second interval is 7.5 ms; the maximum value of the first interval is greater than 7.5 ms and less than or equal to 300 ms, the maximum value of the second interval is greater than 7.5 ms and less than or equal to 300 ms, and the maximum value of the second interval is greater than the maximum value of the first interval.
[0013] In one possible implementation, after the first terminal device increases the BLE interval between the first terminal device and the second terminal device, it further includes: the first terminal device sends a fifth message to the second terminal device, and the increased BLE interval is carried in the fifth message.
[0014] In one possible implementation, after the first terminal device sends the fifth message to the second terminal device, it further includes: the first terminal device receives a sixth message sent by the second terminal device, and the sixth message indicates that the second terminal device has increased the BLE interval between itself and the first terminal device.
[0015] In one possible implementation, after the first terminal device establishes a traditional Bluetooth connection with the second terminal device, it further includes: the first terminal device sends a seventh message to the second terminal device, and the BLE interval before the increase is carried in the seventh message to restore the BLE interval between the first terminal device and the second terminal device to the interval before the increase.
[0016] In one possible implementation, after the first terminal device sends the seventh message to the second terminal device, it further includes: the first terminal device receives an eighth message sent by the second terminal device, and the eighth message indicates that the second terminal device has restored the BLE interval between itself and the first terminal device to the interval before the increase.
[0017] In one possible implementation, before the first terminal device obtains the data to be transmitted in response to a service trigger request, it further includes: the first terminal device discovers a second terminal device and establishes a connection with the second terminal device.
[0018] In one possible implementation, the first terminal device discovers a second terminal device and establishes a connection with the second terminal device, including: after the Bluetooth switch of the first terminal device is turned on, it discovers the second terminal device through BLE broadcast and establishes a BLE connection with the second terminal device.
[0019] In one possible implementation, after the Bluetooth switch of the first terminal device is turned on and before the second terminal device is discovered through BLE broadcast, it also includes: the Bluetooth switch of the second terminal device is turned on, and the first terminal device and the second terminal device are logged in to the same user account; after the BLE connection is established with the second terminal device, it also includes: the first terminal device authenticates the second terminal device through the BLE connection to establish a trust relationship with the second terminal device.
[0020] In one possible implementation, after the first terminal device obtains the data to be transmitted in response to the service trigger request, the method further includes: when no traditional Bluetooth connection is established between the first terminal device and the second terminal device, and no BLE connection is established, the first terminal device establishes a traditional Bluetooth connection with the second terminal device, and transmits the data to be transmitted to the second terminal device through the traditional Bluetooth connection.
[0021] In one possible implementation, after the first terminal device obtains the data to be transmitted in response to the service trigger request, the method further includes: when a traditional Bluetooth connection has been established between the first terminal device and the second terminal device, the first terminal device transmits the data to be transmitted to the second terminal device via the traditional Bluetooth connection.
[0022] In a second aspect, an embodiment of the present application provides a device for establishing a Bluetooth connection, which is included in a first terminal device, and has the function of implementing the behavior of the first terminal device in the first aspect and the possible implementation of the first aspect. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above functions. For example, an acquisition module, a notification module, a receiving module, an establishment module, and a transmission module.
[0023] In a third aspect, an embodiment of the present application provides a first terminal device, including: one or more processors; a memory; a plurality of applications; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions, and when the instructions are executed by the first terminal device, the first terminal device executes the method provided in the first aspect. The first terminal device may adopt Figure 4 The structure shown is implemented.
[0024] It should be understood that the second and third aspects of the embodiments of the present application are consistent with the technical solutions of the first aspect of the embodiments of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here.
[0025] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer executes the method provided in the first aspect.
[0026] In a fifth aspect, an embodiment of the present application provides a computer program, which, when executed by a computer, is used to execute the method provided in the first aspect.
[0027] In one possible design, the program in the fifth aspect may be stored in whole or in part on a storage medium packaged together with the processor, or may be stored in whole or in part on a memory not packaged together with the processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 A schematic diagram of a multi-device network in a home or office environment;
[0029] Figure 2 This is a schematic diagram of actively releasing the BLE connection when there is no data transmission;
[0030] Figure 3 This is the scanning cycle timing diagram of BLE and BR;
[0031] Figure 4 A schematic diagram of the structure of a terminal device provided in one embodiment of the present application;
[0032] Figure 5 A schematic diagram of an application scenario provided for an embodiment of the present application;
[0033] Figure 6 A network diagram provided for an embodiment of the present application;
[0034] Figure 7 A flowchart of a method for establishing a Bluetooth connection provided by an embodiment of the present application;
[0035] FIG8( a) is a flow chart of a method for establishing a Bluetooth connection provided by another embodiment of the present application;
[0036] FIG8( b ) is a scanning cycle timing diagram of BLE and BR provided in one embodiment of the present application;
[0037] Fig. 9 A schematic diagram of the structure of a terminal device provided in another embodiment of the present application;
[0038] Fig.10 A schematic diagram of the structure of a terminal device provided in yet another embodiment of the present application. DETAILED DESCRIPTION
[0039] The terms used in the implementation section of this application are only used to explain the specific embodiments of this application and are not intended to limit this application.
[0040] Bluetooth (BT) is a wireless communication technology widely used worldwide. It operates in the open frequency band of 2.4GHz to 2.485GHz and is generally used for short-distance wireless transmission of 1 meter to 10 meters. BT can include traditional Bluetooth and BLE, among which traditional Bluetooth can also be called classic Bluetooth, and traditional Bluetooth can be BR Bluetooth or enhanced data rate (EDR) Bluetooth. Among them, BR / EDR has a relatively high transmission rate and can be applied to scenarios with large data volumes, for example, it can be applied to scenarios with large data volumes such as voice and / or music. BLE has the advantages of low power consumption and fast connection, but its transmission rate is lower than BR / EDR. Therefore, BLE can be applied to scenarios with high real-time requirements but low data transmission rate requirements, for example, it can be applied to scenarios with small data volumes such as mouse, keyboard, heart rate monitor, etc.
[0041] With the rapid development of terminal technology and Bluetooth technology, terminal devices with rich hardware resources such as mobile phones and tablets can be integrated with dual-mode Bluetooth chips, which can support BLE and BR / EDR at the same time. Among them, BLE is often used for discovery, connection and networking between devices due to its advantages such as low power consumption and fast connection. BR / EDR is often used for data transmission between devices due to its relatively high transmission rate.
[0042] Figure 1 A schematic diagram of a multi-device network in a home or office environment. Figure 1 In the example, device A can be a smart phone, device B can be a tablet computer, and device C can be a laptop computer. Figure 1 As shown, the above multi-device networking process may include:
[0043] Step 1: After device A comes online, it discovers device B through BLE broadcast, and a BLE connection is established between device A and device B for authentication. After the authentication is completed, in response to the service trigger request, device A establishes a BR connection with device B, and data is transmitted between device A and device B through the BR connection. In some embodiments, device A comes online when: the Bluetooth switch of device A is turned on, and device A has logged in to the user account, and before device A discovers device B through BLE broadcast, the Bluetooth switch of device B is turned on, and device B logs in to the same user account as device A.
[0044] Step 2: Device A establishes a BR connection with the watch, and device A establishes a BR connection with the headset.
[0045] Step 3, device A discovers device C through BLE broadcast. A BLE connection is established between device A and device C for authentication. After the authentication is completed, in response to the service trigger request, device A starts to establish a BR connection with device C. In the process of device A establishing a BR connection with device C, device A has 2 BLE connections and 3 BR connections concurrently. Among them, the 2 BLE connections are the BLE connection between device A and device B and the BLE connection between device A and device C; the 3 BR connections are the BR connection between device A and device B, the BR connection between device A and the watch, and the BR connection between device A and the headset. In addition, device A may also have other Bluetooth behaviors such as broadcast scanning. This results in a very low success rate of BR connection between device A and device C.
[0046] To solve this problem, one solution provided by the existing related technology is to actively release the BLE connection when it is detected that there is no data transmission in the BLE connection for 3 seconds, thereby reducing the maintenance time of the BLE connection. Figure 2 As shown, Figure 2 This is a schematic diagram of actively releasing the BLE connection when there is no data transmission.
[0047] However, the above solution cannot solve the following problems:
[0048] a. The BR page scan interval is too long and the page scan window is too short, resulting in a low duty cycle for the BR page scan. In a multi-device networking scenario, the terminal device's page scan is easily interrupted by other services, resulting in a page timeout.
[0049] b. In some scenarios, such as business occupation, or when the terminal device has a BLE connection with at least three devices, the BLE connection will be maintained for a long time. Since the BLE connection interval uses the minimum value of 7.5ms defined by the protocol, it occupies more Bluetooth resources, resulting in a low BR connection success rate.
[0050] Figure 3 This is the scanning cycle timing diagram of BLE and BR. Figure 3 It can be seen that the factors affecting the BR connection success rate may include the following:
[0051] 1. BR paging scan interval and window
[0052] Device A sends a basic rate paging (BR page) message, and device B listens for the BR page message in the paging scan window. If it is heard, device A and device B perform the BR connection process, which means that the BR page is successful. Figure 3 If device A sends a BR page message and a BLE connection event occurs before the paging scan window of device B arrives, the BLE connection event will preempt the BR page process. Then device B will not be able to monitor the BR page message in this paging scan window and can only wait for the next paging scan window. Figure 3 The periodic interval of the paging scan window, that is, the time interval between two adjacent paging scan windows is the paging scan interval (page scan interval), that is, the time interval between the end of the previous paging scan window and the beginning of the next paging scan window, refer to Figure 3 Specifically, the value and parameter description of the paging scan interval are shown in Table 1, and the value and parameter description of the paging scan window are shown in Table 2.
[0053] Table 1
[0054]
[0055] Table 2
[0056]
[0057] Among them, the paging scan duty cycle is the ratio of the paging scan window to the paging scan interval. Generally speaking, in the BR paging process, the protocol default value is used, that is, the paging scan interval is 1.28s and the paging scan window is 11.25ms. Due to the small paging scan window and the large paging scan interval, the paging scan duty cycle is very small, about 0.88%. In the Bluetooth concurrent scenario, it may result in the failure to receive the BR page message from the other end for a long time (7.68s).
[0058] 2. Data transmission of BLE connection
[0059] The data transmission of the BLE connection occupies the chip and Bluetooth resources, where the Bluetooth resources are Bluetooth air interface resources, and the Bluetooth resources can be resources such as communication frequencies and channels used by Bluetooth devices.
[0060] 3. Connection interval of BLE connection
[0061] After device A and device B successfully establish a BLE connection, device A will send a BLE connection event to device B at each BLE interval to maintain the BLE connection. Figure 3 As shown in 34 in FIG. 34, the time interval between two adjacent BLE connection events is the BLE interval, as shown in FIG. Figure 3 35 in . In the networking authentication scenario, the BLE interval is generally around 7.5ms (the minimum value defined by the protocol) to ensure fast networking and online. However, since the BLE interval is relatively short, the frequency of sending BLE connection events is relatively high, and sending BLE connection events will occupy the Bluetooth resources between device A and device B. The more BLE connection events are sent, the more Bluetooth resources are occupied. In this way, fewer Bluetooth resources are used for BR paging scanning, reducing the success rate of BR connection establishment between device A and device B. Specifically, the value and parameter description of the BLE interval can be shown in Table 3.
[0062] Table 3
[0063]
[0064] In summary, in the scenario of multi-device Bluetooth networking, the success rate of establishing a BR connection between two devices is low.
[0065] Based on the above problems, an embodiment of the present application provides a method for establishing a Bluetooth connection, which can improve the duty cycle of traditional Bluetooth paging scanning and improve the success rate of traditional Bluetooth connections in a multi-device environment.
[0066] The method for establishing a Bluetooth connection provided in the embodiment of the present application can be applied to a terminal device, wherein the terminal device can be a smart phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA) and the like; the embodiment of the present application does not impose any restrictions on the specific type of the terminal device.
[0067] For example, Figure 4 A schematic diagram of the structure of a terminal device provided in one embodiment of the present application is shown in FIG. Figure 4As shown, the terminal 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, an earphone interface 170D, a sensor module 180, a button 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, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light 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.
[0068] It is understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0069] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0070] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0071] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0072] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the terminal device 100. While the charging management module 140 is charging the battery 142, it may also power the terminal device 100 through the power management module 141.
[0073] The power management module 141 is used to connect 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, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0074] The wireless communication function of the terminal device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0075] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0076] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the terminal device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0077] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate 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 the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0078] The wireless communication module 160 can provide wireless communication solutions 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), infrared (IR), etc., which are applied to the terminal device 100. 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 the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0079] In some embodiments, the antenna 1 of the terminal device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the terminal device 100 can communicate with the network and other devices through wireless communication technology. The 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-CDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0080] The terminal device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
[0081] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the terminal device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0082] The terminal device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0083] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.
[0084] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the terminal device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0085] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the terminal device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0086] Video codecs are used to compress or decompress digital videos. The terminal device 100 may support one or more video codecs. Thus, the terminal device 100 may play or record videos in various coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0087] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of the terminal device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0088] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0089] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the terminal device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the terminal device 100 by running instructions stored in the internal memory 121, and / or instructions stored in a memory provided in the processor.
[0090] The terminal device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0091] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
[0092] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The terminal device 100 can listen to music or listen to a hands-free call through the speaker 170A.
[0093] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the terminal device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the ear.
[0094] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The terminal device 100 can be provided with at least one microphone 170C. In other embodiments, the terminal device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the terminal device 100 can also be provided with three, four or more microphones 170C to realize the collection of sound signals, noise reduction, identification of sound sources, realization of directional recording function, etc.
[0095] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0096] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The terminal device 100 may receive key input and generate key signal input related to user settings and function control of the terminal device 100.
[0097] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0098] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
[0099] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the terminal device 100 by inserting the SIM card interface 195 or pulling it out from the SIM card interface 195. The terminal device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The terminal device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the terminal device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the terminal device 100 and cannot be separated from the terminal device 100.
[0100] For ease of understanding, the following embodiments of the present application will be described in detail with Figure 4 Taking the terminal device of the shown structure as an example, the method for establishing a Bluetooth connection provided in the embodiment of the present application is specifically explained in combination with the accompanying drawings and application scenarios.
[0101] Figure 5 A schematic diagram of an application scenario provided for an embodiment of the present application, such as Figure 5 As shown, device A may be a smart phone, device B may be a tablet computer, and device C may be a laptop computer. Device A and device B are connected to the Wi-Fi network of router 1, and device C is connected to the Wi-Fi network of router 2. The Wi-Fi network of router 1 and the Wi-Fi network of router 2 are not connected to each other.
[0102] In some examples, the watch and the headset support Bluetooth BR and are connected to device A through pairing; in addition, device A, device B, device C and the watch can log in to the same user account. It is understandable that Figure 5Device A, device B, device C and the watch in the game can all use Figure 4 The structure shown is implemented.
[0103] Figure 6 A network diagram is provided for an embodiment of the present application, such as Figure 6 As shown, the networking process of device A, device B, device C, watch and headset may include:
[0104] Step 1: After turning on the Bluetooth switches of device A and device B, log in to the same user account, device A discovers device B through BLE broadcast, and establishes a BLE connection between device A and device B. Device A authenticates device B through the above BLE connection to establish a trust relationship with device B.
[0105] Step 2: Device A establishes a BR connection with the watch, and device A establishes a BR connection with the headset.
[0106] Step 3: After turning on the Bluetooth switch of device C, log in with the same user account as device A, and device A discovers device C through BLE broadcast, and a BLE connection is established between device A and device C. Device A authenticates device C through the BLE connection to establish a trust relationship with device C.
[0107] After the networking is completed, if device A responds to the service trigger request and needs to transmit data to device C, then device A establishes a traditional Bluetooth connection with device C and transmits data to device C through the traditional Bluetooth connection. The process of device A establishing a traditional Bluetooth connection with device C in the embodiment of the present application is introduced below.
[0108] Figure 7 A flowchart of a method for establishing a Bluetooth connection provided by an embodiment of the present application is shown in FIG. Figure 7 As shown, the method for establishing the above Bluetooth connection may include:
[0109] Step 701: Device A obtains data to be transmitted in response to a service trigger request; wherein the data to be transmitted includes data to be transmitted to device C.
[0110] In this embodiment, the data to be transmitted may be service data corresponding to the service trigger request. For example, the service trigger request may be a music transmission request initiated by a music application in device A, and the data to be transmitted may be a song that the music application in device A wants to transmit to device C.
[0111] Step 702: When a traditional Bluetooth connection is not established between device A and device C, but a BLE connection is established, device A sends a first message to device C via the BLE connection, and the first message instructs device C to increase a traditional Bluetooth paging scan duty cycle of device C.
[0112] In this embodiment, the traditional Bluetooth paging scan duty cycle only needs to be increased by device C. Device A only notifies device C to increase the traditional Bluetooth paging scan duty cycle, and device A itself does not need to increase its own traditional Bluetooth paging scan duty cycle.
[0113] The above-mentioned traditional Bluetooth connection may be a BR connection, the traditional Bluetooth paging scan parameter may be a BR paging scan parameter, the traditional Bluetooth paging scan interval may be a BR paging scan interval, and the traditional Bluetooth paging scan window may be a BR paging scan window. Device A notifies device C through the first message to increase the BR paging scan duty cycle, thereby improving the BR connection success rate between device A and device C in a multi-device networking environment.
[0114] The device C may increase the BR paging scan duty cycle of the device C by: the device C reduces the BR paging scan interval of the device C, and / or increases the traditional Bluetooth paging scan window of the device C. That is, the device C may increase the BR paging scan duty cycle of the device C in three ways: first, by reducing the BR paging scan interval of the device C; second, by increasing the BR paging scan window of the device C; third, by reducing the BR paging scan interval of the device C and increasing the BR paging scan window of the device C.
[0115] In some examples, the adjustment range of the BR paging scan window is: 11.25ms to 128ms, the BR paging scan interval can be maintained at 1.28s, and the BR paging scan duty cycle is the ratio of the BR paging scan window to the BR paging scan interval, so that the adjustment range of the BR paging scan duty cycle is 0.88% to 10%.
[0116] In some examples, device C may increase the traditional Bluetooth paging scan duty cycle of device C by: device C increases the traditional Bluetooth paging scan duty cycle of device C according to the current state of Bluetooth resources used by device C. Specifically, see Figure 6 The current status of device C using Bluetooth resources may include: the status of the BLE connection between device C and device A and the BLE connection between device C and device B using Bluetooth resources, and may also include the status of device C performing BLE broadcasting and using Bluetooth resources.
[0117] When the state of device C's current use of Bluetooth resources is relatively congested, the range of device C's adjustment of the BR paging scan duty cycle is relatively small; when the state of device C's current use of Bluetooth resources is not congested, the range of device C's adjustment of the BR paging scan duty cycle is relatively large. For example, assuming that the initial BR paging scan duty cycle of device C is 0.88%, when the state of device C's current use of Bluetooth resources is not congested, device C can increase the BR paging scan duty cycle from 0.88% to 10%; and when the state of device C's current use of Bluetooth resources is congested, device C can only increase the BR paging scan duty cycle from 0.88% to 1.6%.
[0118] Step 703: Device A receives a second message sent by device C, indicating that the duty cycle of the conventional Bluetooth paging scan of device C has been adjusted.
[0119] Step 704: Device A establishes a traditional Bluetooth connection with device C, and transmits the data to be transmitted to device C via the traditional Bluetooth connection.
[0120] In some examples, after step 704, device A may further send a third message to device C, the third message instructing device C to restore the traditional Bluetooth paging scan duty cycle to the traditional Bluetooth paging scan duty cycle before the increase. That is, after successfully establishing a traditional Bluetooth connection between device A and device C, device A may notify device C to restore the traditional Bluetooth paging scan duty cycle to the traditional Bluetooth paging scan duty cycle before the increase. For example, assuming that after receiving the first message, device C increases the traditional Bluetooth paging scan duty cycle of device C from 0.88% to 10%, then after device A establishes a traditional Bluetooth connection with device C, device A may send a third message to device C, and after receiving the third message, device C restores the traditional Bluetooth paging scan duty cycle to 0.88%. After device A sends the third message to device C, device A can also receive a fourth message sent by device C, and the fourth message indicates that the traditional Bluetooth paging scan duty cycle of device C has been restored. That is, after device C restores the traditional Bluetooth paging scan duty cycle to the traditional Bluetooth paging scan duty cycle before the increase, device C can send the fourth message to device A, so that device A can know that the traditional Bluetooth paging scan duty cycle of device C has been restored.
[0121] In some examples, after step 701, when a traditional Bluetooth connection is not established between device A and device C, and a BLE connection is not established, device A establishes a traditional Bluetooth connection with device C, and transmits the data to be transmitted to device C through the traditional Bluetooth connection. That is, after device A obtains the data to be transmitted to device C, if a traditional Bluetooth connection and a BLE connection are not established between device A and device C, device A may not notify device C to adjust the traditional Bluetooth paging parameters of device C, but directly establishes a traditional Bluetooth connection with device C, and then transmits the data to be transmitted to device C through the traditional Bluetooth connection.
[0122] In addition, in some examples, after step 701, when a traditional Bluetooth connection has been established between device A and device C, device A transmits the data to be transmitted to device C through the traditional Bluetooth connection. That is, after device A obtains the data to be transmitted to device C, if a traditional Bluetooth connection has been established between device A and device C, device A does not need to notify device C to adjust the traditional Bluetooth paging parameters of device C, but directly sends the data to be transmitted to device C through the traditional Bluetooth connection established between device A and device C.
[0123] In addition, in some examples, before step 701, device A can also discover device C and establish a connection with device C. Specifically, after the Bluetooth switch of device A is turned on, device A can also discover device C through BLE broadcast and establish a BLE connection with device C. After the Bluetooth switch of device A is turned on, before discovering device C through BLE broadcast, the Bluetooth switch of device C is turned on, and device A and device C log in to the same user account; after device A establishes a BLE connection with device C, device A can authenticate with device C through the above BLE connection to establish a trust relationship with device C. In this way, device A can achieve networking with device C. The process of networking between device A and device C can be seen in Figure 6 The description of the illustrated embodiment will not be repeated here.
[0124] In the above-mentioned method for establishing a Bluetooth connection, device A responds to a service trigger request and obtains data to be transmitted to device C. When a traditional Bluetooth connection is not established between device A and device C, but a BLE connection has been established, device A sends a first message to device C via the BLE connection. The first message instructs device C to increase the traditional Bluetooth paging scan duty cycle of device C. After device A receives the message sent by device C that the traditional Bluetooth paging scan duty cycle has been adjusted, device A establishes a traditional Bluetooth connection with device C, and transmits the data to be transmitted to device C via the above-mentioned traditional Bluetooth connection. In this way, before device A establishes a traditional Bluetooth connection with device C, the duty cycle of the traditional Bluetooth paging scan of device C can be increased, thereby improving the success rate of establishing traditional Bluetooth connections in a multi-device networking environment.
[0125] FIG8(a) is a flowchart of a method for establishing a Bluetooth connection provided by another embodiment of the present application. As shown in FIG8(a), the present application Figure 7 In the illustrated embodiment, after step 702 and before step 704, the following may also be included:
[0126] Step 801: Device A increases the BLE interval between device A and device C.
[0127] Specifically, device A increases the BLE interval between device A and device C by: device A increases the BLE interval between device A and device C according to the current state of Bluetooth resources used by device A and the transmission state of the above BLE connection.
[0128] Among them, the status of device A currently using Bluetooth resources may include: the status of the BLE connection between device A and device C and the BLE connection between device A and device B using Bluetooth resources, and may also include the status of device A using Bluetooth resources for Bluetooth broadcasting; the transmission status of the above-mentioned BLE connection may include: the transmission status of the BLE connection between device A and device C.
[0129] In some examples, if the status of the Bluetooth resource currently used by device A is congested, and the BLE connection between device A and device C is transmitting data, then device A can increase the BLE interval between device A and device C within a first interval; if the status of the Bluetooth resource currently used by device A is not congested, and / or the BLE connection between device A and device C is not transmitting data, then device A can increase the BLE interval between device A and device C within a second interval; wherein the minimum value of the first interval is equal to the minimum value of the second interval, and the maximum value of the second interval is greater than the maximum value of the first interval. In this embodiment, the default value of the BLE interval is 7.5ms, and the adjustment range of the BLE interval is 7.5ms to 300ms. For example, the first interval may be [7.5ms, 50ms], and the second interval may be [7.5ms, 300ms]; if the status of the Bluetooth resource currently used by device A is congested, and the BLE connection between device A and device C is transmitting data, then device A may increase the BLE interval between device A and device C from 7.5ms to 50ms; if the status of the Bluetooth resource currently used by device A is not congested, and / or the BLE connection between device A and device C is not transmitting data, then device A may increase the BLE interval between device A and device C from 7.5ms to 150ms.
[0130] In some examples, after device A increases the BLE interval between device A and device C, device A may send a fifth message to device C, and the fifth message carries the increased BLE interval. For example, assuming that device A determines to increase the BLE interval between device A and device C from 7.5ms to 50ms, device A may send a fifth message to device C, and the fifth message carries the increased BLE interval (i.e., 50ms). Then device A may receive a sixth message sent by device C, and the sixth message indicates that device C has increased the BLE interval with device A. In this way, BLE connection events can be sent between device A and device C according to the increased BLE interval.
[0131] In this embodiment, before device A establishes a traditional Bluetooth connection with device C, device A can increase the BLE interval between device A and device C, so that BLE connection events can be sent between device A and device C according to the increased BLE interval, thereby reducing the frequency of sending BLE connection events between device A and device C. In this way, the Bluetooth resources occupied by the BLE connection between device A and device C can be reduced, and the success rate of establishing a traditional Bluetooth connection between device A and device C can be improved.
[0132] FIG8( b ) is a timing diagram of the scanning cycle of BLE and BR provided in an embodiment of the present application. It can be seen that after using the method provided in the embodiment of the present application, compared with Figure 3 The paging scan window 31 in FIG. 8( b) is enlarged; compared with Figure 3 The paging scan interval 33 in FIG8( b) is reduced to 83, thereby increasing the BR paging scan duty cycle of device C, so that device C can quickly receive the BR paging message, and improve the success rate of BR connection establishment between device A and device C. In addition, compared with Figure 3 The BLE interval 35 in FIG8( b) and the BLE interval 82 in FIG8( b) are increased, which reduces the frequency of sending BLE connection events between device A and device C and reduces the Bluetooth resources occupied by the BLE connection between device A and device C. This can reduce the preemption of BR paging scanning resources, thereby improving the success rate of device C receiving BR paging messages and the success rate of establishing a BR connection between device A and device C.
[0133] In some examples, after step 704, device A may further send a seventh message to device C, where the seventh message carries the BLE interval before the increase, so as to restore the BLE interval between device A and device C to the BLE interval before the increase. After device A sends the seventh message to device C, device A may further receive an eighth message sent by device C, where the eighth message indicates that device C has restored the BLE interval between device C and device A to the BLE interval before the increase. For example, assuming that before device A establishes a traditional Bluetooth connection with device C, device A increases the BLE interval between device A and device C from 7.5ms to 50ms, then after device A establishes a traditional Bluetooth connection with device C, device A can send a seventh message to device C, and the BLE interval carried in the seventh message is 7.5ms, so as to restore the BLE interval between device A and device C to 7.5ms. In this way, after device C receives the seventh message, it can restore the BLE interval between device C and device A to 7.5ms, and then, device C sends an eighth message to device A, and the eighth message indicates that device C has restored the BLE interval between device C and device A to 7.5ms.
[0134] This application Figure 7 to Figure 8(b) In the illustrated embodiment, the method for establishing a Bluetooth connection provided in the embodiment of the present application is explained by taking the establishment of a traditional Bluetooth connection between device A and device C as an example. It can be understood that before device A responds to a service trigger request and establishes a traditional Bluetooth connection with device B, the same method can be used to improve the success rate of establishing a traditional Bluetooth connection between device A and device B.
[0135] It is to be understood that some or all of the steps or operations in the above embodiments are merely examples, and the present application embodiments may also perform other operations or variations of various operations. In addition, the various steps may be performed in different orders presented in the above embodiments, and it is possible that not all of the operations in the above embodiments need to be performed.
[0136] It is understandable that, in order to implement the above functions, the first terminal device includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiments disclosed in this application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of this application.
[0137] In this embodiment, the first terminal device may be divided into functional modules according to the above method embodiment. For example, each functional module may be divided according to each function, or two or more functions may be integrated into one module. The above integrated module may be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0138] Fig. 9 This is a schematic diagram of the structure of a terminal device provided in another embodiment of the present application. The terminal device in this embodiment can be used as a first terminal device. When each functional module is divided according to each function, Fig. 9 A possible schematic diagram of the composition of the terminal device 900 involved in the above embodiment is shown. Fig. 9 As shown, the terminal device 900 may include: an acquisition module 901, a notification module 902, a receiving module 903, a establishing module 904 and a transmission module 905;
[0139] The acquisition module 901 is used to acquire the data to be transmitted in response to the service trigger request; wherein the data to be transmitted includes data to be transmitted to the second terminal device;
[0140] Notification module 902 is used to send a first message to the second terminal device through the BLE connection when a traditional Bluetooth connection is not established between the first terminal device and the second terminal device, but a low-power Bluetooth BLE connection is established. The first message instructs the second terminal device to increase the traditional Bluetooth paging scan duty cycle of the second terminal device; specifically, the second terminal device increases the traditional Bluetooth paging scan duty cycle of the second terminal device by: the second terminal device reduces the traditional Bluetooth paging scan interval of the second terminal device, and / or increases the traditional Bluetooth paging scan window of the second terminal device; in this embodiment, the adjustment range of the above-mentioned traditional Bluetooth paging scan window is 11.25ms to 128ms, the traditional Bluetooth paging scan interval is maintained at 1.28s, and the adjustment range of the traditional Bluetooth paging scan duty cycle is 0.88% to 10%.
[0141] A receiving module 903 is configured to receive a second message sent by a second terminal device, where the second message indicates that a traditional Bluetooth paging scan duty cycle of the second terminal device has been adjusted;
[0142] Establishing module 904, used to establish a traditional Bluetooth connection with a second terminal device;
[0143] The transmission module 905 is used to transmit the data to be transmitted to the second terminal device through the above-mentioned traditional Bluetooth connection.
[0144] In some examples, the notification module 902 is also used to send a third message to the second terminal device after the establishment module 904 establishes a traditional Bluetooth connection with the second terminal device, and the third message instructs the second terminal device to restore the traditional Bluetooth paging scan duty cycle to the traditional Bluetooth paging duty cycle before the increase.
[0145] The receiving module 903 is further configured to receive a fourth message sent by the second terminal device after the notification module 902 sends the third message to the second terminal device, where the fourth message indicates that the traditional Bluetooth paging scanning duty cycle of the second terminal device has been restored.
[0146] In some examples, the establishment module 904 is also used to establish a traditional Bluetooth connection with the second terminal device after the acquisition module 901 acquires the data to be transmitted, when no traditional Bluetooth connection is established between the first terminal device and the second terminal device and no BLE connection is established; the transmission module 905 is also used to transmit the data to be transmitted to the second terminal device through the above-mentioned traditional Bluetooth connection.
[0147] In some examples, the transmission module 905 is further used to transmit the data to be transmitted to the second terminal device through the traditional Bluetooth connection when a traditional Bluetooth connection has been established between the first terminal device and the second terminal device after the acquisition module 901 acquires the data to be transmitted.
[0148] It should be noted that this application Figure 7 All relevant contents of each step involved in the illustrated method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.
[0149] The terminal device 900 provided in this embodiment is used to execute the present application Figure 7 The method for establishing a Bluetooth connection provided in the illustrated embodiment can therefore achieve the same effect as the above method.
[0150] Fig.10 A schematic diagram of a terminal device provided in another embodiment of the present application, Fig. 9 Compared with the terminal equipment shown in the figure, the difference is that Fig.10 The terminal device 900 shown may also include: an increasing module 906;
[0151] The increasing module 906 is also used to increase the BLE interval between the first terminal device and the second terminal device after the notification module 902 sends the first message to the second terminal device and before the establishment module 904 establishes the traditional Bluetooth connection with the second terminal device. In this embodiment, the increasing module 906 is specifically used to increase the BLE interval between the first terminal device and the second terminal device according to the state of the Bluetooth resource currently used by the first terminal device and the transmission state of the above-mentioned BLE connection. In some examples, when the state of the Bluetooth resource currently used by the first terminal device is congested, and the above-mentioned BLE connection is performing data transmission, the increasing module 906 increases the BLE interval between the first terminal device and the second terminal device within the first interval; when the state of the Bluetooth resource currently used by the first terminal device is not congested, and / or the above-mentioned BLE connection is not performing data transmission, the increasing module 906 increases the BLE interval between the first terminal device and the second terminal device within the second interval; wherein the minimum values of the first interval and the second interval are equal, and the maximum value of the second interval is greater than the maximum value of the first interval. Specifically, the minimum value of the first interval and the second interval can be 7.5ms; the maximum value of the first interval is greater than 7.5ms and less than or equal to 300ms, the maximum value of the second interval is greater than 7.5ms and less than or equal to 300ms, and the maximum value of the second interval is greater than the maximum value of the first interval.
[0152] In some examples, the notification module 902 is further used to send a fifth message to the second terminal device after the increase module 906 increases the BLE interval between the first terminal device and the second terminal device, and the fifth message carries the increased BLE interval.
[0153] The receiving module 903 is further used to receive a sixth message sent by the second terminal device after the notification module 902 sends the fifth message to the second terminal device, wherein the sixth message indicates that the second terminal device has increased the BLE interval between the second terminal device and the first terminal device.
[0154] In some examples, the notification module 902 is also used to send a seventh message to the second terminal device after the establishment module 904 establishes a traditional Bluetooth connection with the second terminal device, and the seventh message carries the BLE interval before the increase to restore the BLE interval between the first terminal device and the second terminal device to the BLE interval before the increase.
[0155] The receiving module 903 is also used to receive the eighth message sent by the second terminal device after the notification module 902 sends the seventh message to the second terminal device, and the eighth message indicates that the second terminal device has restored the BLE interval between the second terminal device and the first terminal device to the BLE interval before the increase.
[0156] The establishment module 904 is also used to discover the second terminal device and establish a connection with the second terminal device before the acquisition module 901 acquires the data to be transmitted. In this embodiment, the establishment module 904 is specifically used to discover the second terminal device through BLE broadcast and establish a BLE connection with the second terminal device after the Bluetooth switch of the first terminal device is turned on.
[0157] In some examples, the terminal device 900 may further include: an authentication module 907;
[0158] After the Bluetooth switch of the first terminal device is turned on and before the second terminal device is discovered through BLE broadcast, the Bluetooth switch of the second terminal device is turned on, and the first terminal device and the second terminal device log in to the same user account;
[0159] The authentication module 907 is further configured to perform authentication with the second terminal device through the BLE connection after the establishment module 904 establishes a BLE connection with the second terminal device, so as to establish a trust relationship with the second terminal device.
[0160] It should be noted that this application Figure 7 to Figure 8(b) All relevant contents of each step involved in the illustrated method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.
[0161] The terminal device 900 provided in this embodiment is used to execute the present application Figure 7 to Figure 8(b) The method for establishing a Bluetooth connection provided in the illustrated embodiment can therefore achieve the same effect as the above method.
[0162] It should be understood that the terminal device 900 may correspond to Figure 1 The functions of the notification module 902, the receiving module 903, the establishment module 904, the transmission module 905 and the authentication module 907 can be Figure 4 The processor 110, antenna 1 and mobile communication module 150 in the terminal device 100 shown in the figure, and / or, are implemented by the processor 110, antenna 2 and wireless communication module 160; the functions of the acquisition module 901 and the increase module 906 can be implemented by Figure 4 The processor 110 in the terminal device 100 is implemented.
[0163] In the case of adopting an integrated unit, the terminal device 900 may include a processing module, a storage module and a communication module.
[0164] The processing module can be used to control and manage the actions of the terminal device 900, for example, it can be used to support the terminal device 900 to execute the steps executed by the above modules. The storage module can be used to support the terminal device 900 to store program codes and data, etc. The communication module can be used to support the communication between the terminal device 900 and other devices.
[0165] Among them, the processing module can be a processor or a controller, which can implement or execute various exemplary logic boxes, modules and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, and so on. The storage module can be a memory. The communication module can specifically be a device that interacts with other electronic devices, such as a radio frequency circuit, a Bluetooth chip and / or a Wi-Fi chip.
[0166] In one embodiment, when the processing module is a processor and the storage module is a memory, the terminal device 900 involved in this embodiment can be a Figure 4 Device of the structure shown.
[0167] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer executes the present application. Figure 7 to Figure 8(b) The method provided by the illustrated embodiment.
[0168] The present application also provides a computer program product, which includes a computer program, which, when executed on a computer, enables the computer to execute the present application. Figure 7 to Figure 8(b) The method provided by the illustrated embodiment.
[0169] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.
[0170] Those of ordinary skill in the art will appreciate that the various units and algorithm steps described in the embodiments disclosed herein can be implemented in a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0171] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0172] In several embodiments provided in the present application, any function can be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as an independent product. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence or in other words, the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0173] The above is only a specific implementation of the present application. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. The protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for establishing a Bluetooth connection, It is characterized in that include: The first terminal device obtains the data to be transmitted in response to the service trigger request; wherein the data to be transmitted includes data to be transmitted to the second terminal device; When a traditional Bluetooth connection is not established between the first terminal device and the second terminal device, but a low-power Bluetooth BLE connection is established, the first terminal device sends a first message to the second terminal device through the BLE connection, and the first message instructs the second terminal device to increase the traditional Bluetooth paging scan duty cycle of the second terminal device; The first terminal device receives a second message sent by the second terminal device, where the second message indicates that a traditional Bluetooth paging scan duty cycle of the second terminal device has been adjusted; The first terminal device establishes a traditional Bluetooth connection with the second terminal device, and transmits the data to be transmitted to the second terminal device through the traditional Bluetooth connection.
2. The method according to claim 1, It is characterized in that The second terminal device increasing the traditional Bluetooth paging scan duty cycle of the second terminal device includes: the second terminal device reducing the traditional Bluetooth paging scan interval of the second terminal device, and / or increasing the traditional Bluetooth paging scan window of the second terminal device.
3. The method according to claim 2, It is characterized in that The adjustment range of the traditional Bluetooth paging scan window is 11.25 ms to 128 ms, the traditional Bluetooth paging scan interval is maintained at 1.28 s, and the adjustment range of the traditional Bluetooth paging scan duty cycle is 0.88% to 10%.
4. The method according to claim 1, It is characterized in that After the first terminal device establishes a traditional Bluetooth connection with the second terminal device, the method further includes: The first terminal device sends a third message to the second terminal device, where the third message instructs the second terminal device to restore the traditional Bluetooth paging scan duty cycle to the traditional Bluetooth paging scan duty cycle before the increase.
5. The method according to claim 4, It is characterized in that After the first terminal device sends the third message to the second terminal device, the method further includes: The first terminal device receives a fourth message sent by the second terminal device, where the fourth message indicates that the traditional Bluetooth paging scanning duty cycle of the second terminal device has been restored.
6. The method according to claim 1, It is characterized in that After the first terminal device sends the first message to the second terminal device through the BLE connection, before the first terminal device establishes a traditional Bluetooth connection with the second terminal device, the method further includes: The first terminal device increases the BLE interval between the first terminal device and the second terminal device.
7. The method according to claim 6, It is characterized in that The first terminal device increasing the BLE interval between the first terminal device and the second terminal device includes: The first terminal device increases the BLE interval between the first terminal device and the second terminal device according to the current status of the Bluetooth resource used by the first terminal device and the transmission status of the BLE connection.
8. The method according to claim 7, It is characterized in that The first terminal device increasing the BLE interval between the first terminal device and the second terminal device according to the current state of the Bluetooth resource used by the first terminal device and the transmission state of the BLE connection includes: When the status of the Bluetooth resource currently used by the first terminal device is congested and the BLE connection is performing data transmission, the first terminal device increases the BLE interval between the first terminal device and the second terminal device within a first interval; when the status of the Bluetooth resource currently used by the first terminal device is not congested, and / or the BLE connection is not performing data transmission, the first terminal device increases the BLE interval between the first terminal device and the second terminal device within a second interval; wherein the minimum values of the first interval and the second interval are equal, and the maximum value of the second interval is greater than the maximum value of the first interval.
9. The method according to claim 8, It is characterized in that The minimum value of the first interval and the second interval is 7.5ms; the maximum value of the first interval is greater than 7.5ms and less than or equal to 300ms, the maximum value of the second interval is greater than 7.5ms and less than or equal to 300ms, and the maximum value of the second interval is greater than the maximum value of the first interval.
10. The method according to claim 6, It is characterized in that After the first terminal device increases the BLE interval between the first terminal device and the second terminal device, the method further includes: The first terminal device sends a fifth message to the second terminal device, and the fifth message carries the increased BLE interval.
11. The method according to claim 6, It is characterized in that After the first terminal device sends the fifth message to the second terminal device, the method further includes: The first terminal device receives a sixth message sent by the second terminal device, where the sixth message indicates that the second terminal device has increased the BLE interval between the second terminal device and the first terminal device.
12. The method according to claim 6, It is characterized in that After the first terminal device establishes a traditional Bluetooth connection with the second terminal device, the method further includes: The first terminal device sends a seventh message to the second terminal device, wherein the seventh message carries the BLE interval before the increase, so as to restore the BLE interval between the first terminal device and the second terminal device to the BLE interval before the increase.
13. The method according to claim 12, It is characterized in that After the first terminal device sends the seventh message to the second terminal device, the method further includes: The first terminal device receives an eighth message sent by the second terminal device, and the eighth message indicates that the second terminal device has restored the BLE interval between the second terminal device and the first terminal device to the BLE interval before the increase.
14. The method according to any one of claims 1 to 13, It is characterized in that Before the first terminal device obtains the data to be transmitted in response to the service trigger request, the method further includes: The first terminal device discovers the second terminal device and establishes a connection with the second terminal device.
15. The method according to claim 14, It is characterized in that The first terminal device discovers the second terminal device, and establishes a connection with the second terminal device includes: After the Bluetooth switch of the first terminal device is turned on, the second terminal device is discovered through BLE broadcasting, and a BLE connection is established with the second terminal device.
16. The method according to claim 15, It is characterized in that After the Bluetooth switch of the first terminal device is turned on and before the second terminal device is discovered through BLE broadcast, the method further includes: The Bluetooth switch of the second terminal device is turned on, and the first terminal device and the second terminal device are logged in to the same user account; After establishing the BLE connection with the second terminal device, the method further includes: The first terminal device is connected via the BLE and authenticated with the second terminal device to establish a trust relationship with the second terminal device.
17. The method according to claim 1, It is characterized in that After the first terminal device obtains the data to be transmitted in response to the service trigger request, the method further includes: When a traditional Bluetooth connection is not established between the first terminal device and the second terminal device, and a BLE connection is not established, the first terminal device establishes a traditional Bluetooth connection with the second terminal device, and transmits the data to be transmitted to the second terminal device through the traditional Bluetooth connection.
18. The method according to claim 1, It is characterized in that After the first terminal device obtains the data to be transmitted in response to the service trigger request, the method further includes: When a traditional Bluetooth connection has been established between the first terminal device and the second terminal device, the first terminal device transmits the data to be transmitted to the second terminal device through the traditional Bluetooth connection.
19. A device for establishing a Bluetooth connection, It is characterized in that Set in a first terminal device, the device includes: An acquisition module, configured to acquire data to be transmitted in response to a service trigger request; wherein the data to be transmitted includes data to be transmitted to a second terminal device; a notification module, configured to, when no traditional Bluetooth connection is established between the first terminal device and the second terminal device, but a low-power Bluetooth BLE connection is established, send a first message to the second terminal device through the BLE connection, wherein the first message instructs the second terminal device to increase a traditional Bluetooth paging scan duty cycle of the second terminal device; A receiving module, configured to receive a second message sent by the second terminal device, wherein the second message indicates that a traditional Bluetooth paging scan duty cycle of the second terminal device has been adjusted; An establishing module, used to establish a traditional Bluetooth connection with the second terminal device; A transmission module is used to transmit the data to be transmitted to the second terminal device through the traditional Bluetooth connection.
20. A first terminal device, It is characterized in that include: one or more processors; Memory; Multiple applications; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions, which, when executed by the first terminal device, enable the first terminal device to perform the method according to any one of claims 1 to 18.
21. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, which, when executed on a computer, enables the computer to execute the method according to any one of claims 1 to 18.