CN117377132A - Bluetooth connection method, device, equipment, system and storage medium - Google Patents

Bluetooth connection method, device, equipment, system and storage medium Download PDF

Info

Publication number
CN117377132A
CN117377132A CN202311391292.1A CN202311391292A CN117377132A CN 117377132 A CN117377132 A CN 117377132A CN 202311391292 A CN202311391292 A CN 202311391292A CN 117377132 A CN117377132 A CN 117377132A
Authority
CN
China
Prior art keywords
connection
bluetooth device
parameter
broadcast data
parameters
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311391292.1A
Other languages
Chinese (zh)
Inventor
沈沛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Zhongke Lanxun Technology Co ltd
Original Assignee
Shenzhen Zhongke Lanxun Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Zhongke Lanxun Technology Co ltd filed Critical Shenzhen Zhongke Lanxun Technology Co ltd
Priority to CN202311391292.1A priority Critical patent/CN117377132A/en
Publication of CN117377132A publication Critical patent/CN117377132A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/40Connection management for selective distribution or broadcast
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application provides a Bluetooth connection method, a device, equipment, a system and a storage medium, which are applied to a slave Bluetooth device, wherein the slave Bluetooth device is in communication connection with a master Bluetooth device, and the method comprises the following steps: the method comprises the steps of obtaining current connection parameters, determining target broadcast data according to the connection parameters, sending the target broadcast data by a slave Bluetooth device through broadcasting, and receiving the target broadcast data by a master Bluetooth device, wherein the target broadcast data comprises connection interval parameters, the connection interval parameters are used for appointing BLE communication intervals after the master Bluetooth device is connected with the slave Bluetooth device BLE, sending the target broadcast data to the master Bluetooth device, receiving a connection request sent by the slave Bluetooth device, and establishing BLE data communication connection with the master Bluetooth device according to the connection interval parameters in the target broadcast data. The present example may ensure that there is still sufficient bandwidth usage with other bluetooth links that remain connected from the bluetooth device after the BLE connection is established by adjusting the connection interval parameters.

Description

Bluetooth connection method, device, equipment, system and storage medium
Technical Field
The present application relates to the field of bluetooth connection, and in particular, to a bluetooth connection method, apparatus, device, system, and storage medium.
Background
Bluetooth is a standard wireless communication technology, which is used to exchange data between devices within a short distance, so as to simplify the data interaction process between electronic devices. As technology evolves, BLE is introduced in the bluetooth 4.0 standard, also known as bluetooth low energy (Bluetooth Low Energy). BLE is specifically designed for low power applications such as health monitoring, smart home, sensors, etc. It introduces broadcast and connection modes, supports fast set-up of connections and short data transmissions, while minimizing power consumption.
The bluetooth technology can establish connection with a true wireless stereo headset (TWS headset), and generally adopts BLE to communicate between a mobile device and the headset, because of the specific TWS itself, there may be a one-to-two device connection or a low-delay mode, the connection interval is easily set to be very small when the BLE initiates a connection, which results in frequent communication of the BLE and occupation of a lot of bandwidth, thereby resulting in insufficient classical bluetooth bandwidth after the BLE is connected, and further resulting in a problem of audio clip.
Disclosure of Invention
The application provides a Bluetooth connection method, a device, equipment, a system and a storage medium, so as to solve the technical problem that when classical Bluetooth communication is carried out, classical Bluetooth bandwidth can be occupied easily when BLE connection is established, the classical Bluetooth bandwidth is insufficient, and then audio playing is blocked.
In a first aspect, a bluetooth connection method is provided and applied to a slave bluetooth device, where the slave bluetooth device is in communication connection with a master bluetooth device; the method comprises the following steps:
acquiring current connection parameters;
determining target broadcast data according to the connection parameters, wherein the target broadcast data is sent by the slave Bluetooth equipment through broadcasting and received by the master Bluetooth equipment, and the target broadcast data comprises connection interval parameters which are used for appointing BLE communication intervals after the master Bluetooth equipment and the slave Bluetooth equipment BLE are connected;
transmitting the target broadcast data to the master Bluetooth device;
and receiving a connection request sent from the main Bluetooth device, and establishing BLE data communication connection with the main Bluetooth device according to the connection interval parameter in the target broadcast data.
With reference to the first aspect, in one possible implementation manner, the connection parameter is a first connection parameter, where the first connection parameter includes a first connection number and a first mode, and the determining target broadcast data according to the connection parameter includes: acquiring a first connection number, wherein the first connection number is the connection number of the master Bluetooth device in the slave Bluetooth devices; determining whether a first mode is adopted, wherein the first mode is that the slave Bluetooth equipment is in a low-delay mode; when the first connection number is greater than the preset connection number and in the first mode, determining first target broadcast data, wherein the first target broadcast data comprises first connection interval parameters, and the first connection interval parameters are greater than the preset connection interval parameters.
With reference to the first aspect, in a possible implementation manner, after the determining whether the slave bluetooth device is in the first mode, the first mode is a low-latency mode, the method further includes: and when the first connection number is smaller than the preset connection number or not in the first mode, determining second target broadcast data, wherein the second target broadcast data comprises second connection interval parameters, and the second connection interval parameters are smaller than the preset connection interval parameters.
With reference to the first aspect, in one possible implementation manner, the connection parameter is a second connection parameter, the second connection parameter is an electric quantity of the slave bluetooth device, and determining the target broadcast data according to the connection parameter includes: acquiring a second connection parameter; and if the second connection parameter is smaller than the preset slave Bluetooth equipment electric quantity, determining third target broadcast data, wherein the third target broadcast comprises a third connection interval parameter, and the third connection interval parameter is larger than the preset connection interval parameter.
With reference to the first aspect, in a possible implementation manner, after the acquiring the second connection parameter, the method further includes: and if the second connection parameter is larger than the preset slave Bluetooth equipment electric quantity, determining fourth target broadcast data, wherein the fourth target broadcast data comprises fourth connection interval parameters, and the fourth connection interval parameters are smaller than the preset connection interval parameters.
With reference to the first aspect, in one possible implementation manner, after the receiving the connection request sent from the master bluetooth device, establishing a BLE data communication connection with the master bluetooth device according to a connection interval parameter in the target broadcast data, the method further includes: continuously acquiring a third connection parameter, wherein the third connection parameter is the connection parameter of the slave Bluetooth device after BLE communication is established; if the third connection parameter is different from the connection parameter corresponding to the target broadcast data, determining a target connection interval parameter according to the third connection parameter; transmitting the target connection interval parameter to the master Bluetooth device; receiving target connection parameters sent from the main Bluetooth equipment, wherein the target connection parameters comprise the target connection interval parameters and starting update time; and updating the connection interval parameters of the BLE data communication connection according to the target connection parameters.
In a second aspect, a bluetooth connection method is provided and applied to a master bluetooth device, where the master bluetooth device is communicatively connected to a slave bluetooth device, and the method further includes:
receiving target broadcast data, wherein the target broadcast data is sent by the slave Bluetooth device through broadcasting and is received by the master Bluetooth device, and the target broadcast data comprises a connection interval parameter, wherein the connection interval parameter is used for appointing BLE communication interval after the master Bluetooth device is connected with the slave Bluetooth device BLE;
Analyzing the target broadcast data to obtain a connection interval parameter;
and sending a connection request to the slave Bluetooth device, and establishing BLE communication connection with the slave Bluetooth device according to the connection interval parameter in the target broadcast data.
With reference to the second aspect, in a possible implementation manner, the method further includes: receiving a target connection interval parameter, wherein the target connection interval parameter is data sent when the slave Bluetooth equipment detects that the connection parameter of the slave Bluetooth equipment changes after BLE communication is established; transmitting target connection parameters to the slave Bluetooth equipment, wherein the target connection parameters comprise the target connection interval parameters and starting update time; and updating the connection interval parameters of the BLE data communication connection according to the target connection parameters.
In a third aspect, a bluetooth connection apparatus is provided, which is applied to a slave bluetooth device, where the slave bluetooth device is communicatively connected to a master bluetooth device; the device comprises:
the acquisition module is used for acquiring the current connection parameters;
the determining module is used for determining target broadcast data according to the connection parameters, the target broadcast data is sent by the slave Bluetooth equipment through broadcasting and is received by the master Bluetooth equipment, wherein the target broadcast data comprises connection interval parameters, and the connection interval parameters are used for appointing BLE communication intervals after the master Bluetooth equipment and the slave Bluetooth equipment BLE are connected;
The sending module is used for sending the target broadcast data to the main Bluetooth equipment;
and the connection module is used for receiving a connection request sent from the main Bluetooth device and establishing BLE data communication connection with the main Bluetooth device according to the connection interval parameter in the target broadcast data.
In a fourth aspect, a bluetooth connection apparatus is provided, which is applied to a master bluetooth device, where the master bluetooth device is communicatively connected to a slave bluetooth device; the device comprises:
the receiving module is used for receiving target broadcast data, the target broadcast data is sent out by the slave Bluetooth equipment through broadcasting and is received by the master Bluetooth equipment, wherein the target broadcast data comprises a connection interval parameter, and the connection interval parameter is used for appointing BLE communication interval after the master Bluetooth equipment and the slave Bluetooth equipment BLE are connected;
the analysis module is used for analyzing the target broadcast data to obtain a connection interval parameter;
and the sending module is used for sending a connection request to the slave Bluetooth equipment, and establishing BLE communication connection with the slave Bluetooth equipment according to the connection interval parameter in the target broadcast data.
In a fifth aspect, there is provided a bluetooth device comprising a memory and one or more processors and a transceiver connected to the one or more processors, the transceiver for transmitting or receiving data, the one or more processors for executing one or more computer programs stored in the memory, the one or more processors, when executing the one or more computer programs, causing the bluetooth device to implement the bluetooth connection method of the first and/or second aspects described above.
In a sixth aspect, there is provided a computer readable storage medium storing a computer program comprising program instructions which, when executed by a processor, cause the processor to perform the bluetooth connection method of the first and/or second aspects.
In a seventh aspect, a bluetooth system is provided, which comprises a master bluetooth device and a slave bluetooth device, where the slave bluetooth device is configured to perform the bluetooth connection method of the first aspect, and the master bluetooth device is configured to perform the bluetooth connection method of the second aspect.
In the solution implemented by the above bluetooth connection method, apparatus, device, system and storage medium, the bluetooth system in this embodiment includes a master bluetooth device and a slave bluetooth device, where the slave bluetooth device obtains current connection parameters, determines target broadcast data according to the connection parameters, where the target broadcast data is sent by the slave bluetooth device through broadcasting and is received by the master bluetooth device, where the target broadcast data includes connection interval parameters, the connection interval parameters are used to agree on establishing a BLE communication interval after the master bluetooth device is connected with the slave bluetooth device BLE, send the target broadcast data to the master bluetooth device, the master bluetooth device receives the target broadcast data, analyzes the target broadcast data to obtain connection interval parameters, sends a connection request to the slave bluetooth device, receives the connection request sent by the master bluetooth device, and establishes BLE data communication connection with the master bluetooth device according to the connection interval parameters in the target broadcast data. The application can realize the following technical effects: the method can determine the connection interval parameter when the BLE connection is established with the master Bluetooth device through the connection parameter of the slave Bluetooth device under the condition that the master Bluetooth device and the slave Bluetooth device are not in communication, namely under the condition that the ideal connection interval parameter of the slave Bluetooth device cannot be acquired, and the communication connection between the master Bluetooth device and the slave Bluetooth device is established according to the connection interval parameter without bandwidth occupation conflict, namely under the condition that normal BLE communication is ensured, other Bluetooth links which are in connection with the slave Bluetooth device still have enough bandwidth use.
Drawings
Fig. 1A is a schematic diagram of a bluetooth system according to an embodiment of the present application;
fig. 1B is a schematic flow chart of an interaction process in a bluetooth system according to an embodiment of the present application
Fig. 2 is a schematic flow chart of a bluetooth connection method according to an embodiment of the present application;
fig. 3 is a flowchart of another bluetooth connection method according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a bluetooth connection device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of another bluetooth connection device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a bluetooth device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
The technical scheme is suitable for a Bluetooth connection scene, particularly suitable for a scene that BLE communication is carried out between a master Bluetooth device and a slave Bluetooth device in the Bluetooth connection scene, wherein the master Bluetooth device is the Bluetooth device which searches and actively establishes connection in the Bluetooth connection scene, and the master Bluetooth device can search surrounding Bluetooth devices and select the Bluetooth devices which need to be connected to pair and connect; the slave bluetooth device refers to a device waiting to be searched for a connection by the master bluetooth device in a bluetooth connection scenario. Specifically, the main bluetooth device may be a mobile phone, a notebook computer, etc.; the slave bluetooth device may be a headset, a smart stereo, etc., for example, the slave bluetooth device may be a TWS headset, which is an abbreviation for "True Wireless Stereo" headset, meaning a true wireless stereo headset. This type of earphone is a wireless audio device that does not require a conventional connection wire nor a cable that connects to a cell phone, music player or other device. In contrast, the TWS headset realizes connection between the left and right two headsets through the bluetooth technology, and communicates with the audio source device. TWS headphones typically consist of two separate headphone units, each containing one speaker and one battery. The two headphones may be connected to the audio source device at the same time and play music or other sounds in stereo mode. The user can put them into the ear without any connecting wires, so they are called "true wireless". The present application is not limited. It should be appreciated that a bluetooth device may either initiate a communication connection as a master bluetooth device or receive a communication connection as a slave bluetooth device; one bluetooth device can also serve as a master bluetooth device and a slave bluetooth device at the same time.
The technical solution of the present application may be applied to a bluetooth system composed of a master bluetooth device and a slave bluetooth device, as shown in fig. 1A, where the bluetooth system 10 may include a slave bluetooth device 101 and a master bluetooth device 102, where the master bluetooth device may include a plurality of master bluetooth devices (E1, E2 …, en), n is the number of master bluetooth devices, and n may theoretically be any integer greater than 0.
In the bluetooth system 10, there may be multiple communication channels between the slave bluetooth device 101 and the master bluetooth device 102, such as a classical bluetooth channel established by classical bluetooth and a bluetooth low energy channel established by BLE, and when connected together, the master bluetooth device 102 may establish a BLE connection and a classical bluetooth connection with the slave bluetooth device 101 at the same time to meet different communication requirements. For example, BLE connections may be used for low power, low latency audio transmissions, while classical bluetooth connections may be used for high quality audio transmissions and other data transmissions. The double-channel operation mode enables the mobile phone and the earphone to realize flexible communication under different scenes. Wherein BLE communication channels are generally divided into broadcast channels and data communication channels. The slave bluetooth device 101 may broadcast its own presence and basic information, i.e. the connection parameters in this scheme, before connection using the BLE broadcast channel. The master bluetooth device 102 may listen to the broadcast channel to discover nearby slave bluetooth devices 101 and obtain device information, which may be transmitted bi-directionally over the BLE data communication channel once a BLE connection is established between the slave bluetooth devices 101 and the master bluetooth device 102. This is typically used to transmit control commands, device status information, etc.
It should be understood that the slave bluetooth device and the master bluetooth device in the bluetooth connection system may not be limited to the above-described case, but may be more cases, and the present application is not limited thereto.
Based on the bluetooth system shown in fig. 1A, the technical solution of the present application may be implemented, where the technical solution of the present application is specifically applied to a bluetooth system 10, where the bluetooth system 10 is composed of a master bluetooth device and a slave bluetooth device, and fig. 1B may be referred to, and fig. B is a schematic flow diagram of an interaction process in the bluetooth system provided in the embodiment of the present application, where the method includes the following steps:
s101, acquiring current connection parameters from Bluetooth equipment, determining target broadcast data according to the connection parameters, wherein the target broadcast data is sent by the Bluetooth equipment through broadcasting and received by main Bluetooth equipment, and the target broadcast data comprises connection interval parameters which are used for appointing BLE communication intervals after the BLE connection between the main Bluetooth equipment and the Bluetooth equipment is established.
S102, the target broadcast data is sent from the Bluetooth device to the master Bluetooth device.
S103, the main Bluetooth device receives the target broadcast data.
S104, the main Bluetooth device analyzes the target broadcast data to obtain the connection interval parameters.
S105, the master Bluetooth device sends a connection request to the slave Bluetooth device.
S106, the slave Bluetooth device receives a connection request sent by the master Bluetooth device.
And S107, the slave Bluetooth device establishes BLE data communication connection with the master Bluetooth device according to the connection interval parameter in the target broadcast data.
Through the interaction process, in the case that the master bluetooth device and the slave bluetooth device are not in communication, that is, the ideal connection interval parameter of the slave bluetooth device cannot be obtained, the connection interval parameter when the slave bluetooth device establishes BLE connection with the master bluetooth device is determined, and the communication connection between the master bluetooth device and the slave bluetooth device is established according to the connection interval parameter without bandwidth occupation conflict, that is, under the condition that normal BLE communication is ensured, other bluetooth links which are connected with the slave bluetooth device still have enough bandwidth use.
Based on the bluetooth system shown in fig. 1A, the technical scheme of the application can be implemented, wherein the technical scheme of the application is specifically applied to a slave bluetooth device in the bluetooth system, and the slave bluetooth device is in communication connection with a master bluetooth device.
The following specifically describes the technical scheme of the present application.
Referring to fig. 2, fig. 2 is a schematic flow chart of a bluetooth connection method provided in an embodiment of the present application, where the method may be applied to a bluetooth system, and the bluetooth system may be as shown in fig. 1A. As shown in fig. 2, the method comprises the steps of:
s201, acquiring current connection parameters from the Bluetooth device.
The connection parameters of the slave bluetooth device refer to a plurality of parameters related to bluetooth connection, the connection parameters determine performance and behavior of the bluetooth connection, and the connection parameters are used for evaluating stability, transmission rate, response time of the connection and optimizing when the number of connections increases, the device is in a low-delay mode or the power is low.
The connection parameters of the slave bluetooth device may include, but are not limited to, the number of connections with other bluetooth devices in the slave bluetooth device, or the slave bluetooth device is in a low-latency mode, or the power of the slave bluetooth device.
The connection parameters of the slave bluetooth device can be obtained through the API or the instruction of the bluetooth chip, and the specific operation mode depends on the model and manufacturer of the bluetooth chip.
In particular, if the number of connections is known among the number of connections with other bluetooth devices in the slave bluetooth device, it can help the slave bluetooth device decide whether or not to optimize connection management, such as allocating resources when multiple connections exist, limiting the number of connections, or providing higher bandwidth, etc.; if the slave Bluetooth device is in the low-delay mode, the mode indicates whether the slave Bluetooth device is currently in the low-delay audio transmission mode. If real-time audio transmission (e.g., music playing or talking) is desired from the bluetooth device, the low latency mode may be enabled to reduce the delay of the audio transmission. Knowing whether the slave bluetooth device is in a low latency mode can affect the configuration of the connection parameters to meet the requirements of low latency audio transmission; if the slave Bluetooth device is powered, the battery power level of the slave Bluetooth device is represented. Knowing the battery level may help the device decide whether or not to adjust the connection parameters to extend battery life. When the power is low, measures may be taken to reduce the frequency of bluetooth communications or increase the connection interval, thereby reducing power consumption.
It can be seen that the adjustment of the connection parameters depends on the current state of the slave bluetooth device and the connection requirements. By monitoring the connection quantity, the low-delay mode and the electric quantity state of the main Bluetooth device, the connection parameters can be flexibly configured so as to meet different application scenes and performance requirements. This allows optimizing the stability, performance and energy consumption of the connection.
S202, determining target broadcast data according to the connection parameters, wherein the target broadcast data is sent by the slave Bluetooth device through broadcasting and is received by the master Bluetooth device, and the target broadcast data comprises connection interval parameters which are used for appointing BLE communication intervals after the master Bluetooth device is connected with the slave Bluetooth device BLE.
Wherein the broadcast data refers to data for broadcasting, the broadcast data containing information for identifying and describing broadcasting devices, comprising: the broadcast data flag (Advertising Flags) is used to describe the function and status of the broadcast device. For example, it may indicate whether the device supports BLE connection, whether low power mode is supported, whether it is in a connectable state, etc.; local device Name (Local Name): for identifying devices, for example, when you search for bluetooth devices on a cell phone, you see the names of nearby devices. The local device name is typically user defined for easy identification of the device; the service UUID (Service UUID) this field contains one or more UUID (Universally Unique Identifier) for identifying BLE services supported by the device, from which the master bluetooth device can determine whether to establish a connection with the broadcasting device and further learn about the services provided by the device; connection interval parameters in broadcast packets: in some cases, the broadcast data may include parameters related to the BLE connection, such as connection interval parameters, which are typically used to tell other devices how to establish a connection or communicate; other optional fields: the broadcast data may also contain other optional information such as battery power of the device, temperature sensor data, etc., depending on the application and design of the device. Other data are not listed.
Wherein broadcasting is a passive communication mode, and the slave bluetooth devices periodically broadcast the data so that nearby master bluetooth devices can receive the data, and the master bluetooth devices can decide whether to establish a connection with a specific device according to information contained in the broadcast data.
The connection interval parameter is used for telling the communication time interval which should be used after the BLE connection is established between the master Bluetooth device and the slave Bluetooth device.
It can be seen that communicating the connection interval parameter from the slave bluetooth device to the master bluetooth device via broadcast data helps ensure that the BLE connection established between the master bluetooth device and the slave bluetooth device has proper performance and stability to meet the communication requirements.
And S203, the target broadcast data is sent to the main Bluetooth device.
Before the target broadcast data is sent, the target broadcast data may be packaged into a broadcast data packet, and then the broadcast data packet is sent to the master bluetooth device.
Wherein the transmission may be periodically transmitted by the slave bluetooth device using a BLE broadcast channel, and the broadcast data packets are transmitted over BLE broadcast frames, which are transmitted during a particular broadcast interval.
It can be seen that before the BLE connection is established, the slave bluetooth device will send the target broadcast data to the master bluetooth device, and this procedure is to let the master bluetooth device know the existence, service and connection parameters of the slave bluetooth device, and based thereon decide whether to establish the BLE connection and how to configure the connection, so that the BLE communication is very convenient and adaptive through the discovery and connection procedure of the broadcast communication.
S204, receiving a connection request sent from the main Bluetooth device, and establishing BLE data communication connection with the main Bluetooth device according to the connection interval parameter in the target broadcast data.
The slave Bluetooth device monitors the connection request on the broadcast channel, and once the slave Bluetooth device receives the connection request of the master Bluetooth device, the slave Bluetooth device analyzes the request to acquire the connection parameter request, particularly the connection interval parameter, contained in the request.
Specifically, after receiving a connection establishment request, the slave bluetooth device responds to the request and configures connection according to a connection interval parameter in the request, wherein the connection interval parameter ensures that the performance and the power consumption of the connection meet the requirements. When the BLE connection is established, two-way BLE data communication may commence between the master bluetooth device and the slave bluetooth device, which may include transmission control commands, audio data, sensor data, or other types of information.
After the connection of the BLE data communication is established successfully, continuously monitoring the connection parameters of the slave bluetooth device, and if the connection parameters change after connection, updating the connection interval parameters of the BLE data communication to update the connection interval information on the BLE data channel according to the new connection interval parameters.
The connection interval parameter in the target broadcast data defines the frequency of communication between the master bluetooth device and the slave bluetooth device after connection, namely, the connection interval parameter refers to the time interval of data communication after connection, the shorter connection interval parameter can increase the frequency of data communication and further increase the energy consumption, and conversely, the longer connection interval parameter can reduce the frequency of data communication and further reduce the energy consumption, thereby being beneficial to prolonging the battery life of the device. Thus, by adjusting the connection interval parameter, a balance can be found between battery life and communication frequency.
Further, the connection interval parameter in the target broadcast data also affects the communication response time between the bluetooth device and the surrounding devices. Shorter intervals will allow the broadcaster to respond to communication requests faster, suitable for applications requiring low latency, such as real sensor data or audio transmissions. Longer intervals may result in longer response times, but may reduce power consumption. Shorter connection intervals may improve the stability of communications between devices because they exchange information more frequently. This is important for applications requiring highly reliable communication. Longer connection intervals may increase the risk of packet loss of the communication, thereby reducing the stability of the communication.
In general, the connection interval parameter when the BLE connection is established with the master Bluetooth device is determined through the connection parameter of the slave Bluetooth device, so that the problem that a reasonable connection interval parameter is set according to the connection parameter of the slave Bluetooth device under the condition that the master Bluetooth device and the slave Bluetooth device are not in communication is solved, a reasonable BLE channel can be established, the bandwidth occupation conflict between the BLE device and other Bluetooth devices after the BLE connection is established is effectively reduced, and the communication link between the BLE device and the other Bluetooth devices is ensured to still have enough bandwidth use.
In an embodiment, the connection parameter is a first connection parameter, the first connection parameter includes a first connection number and a first mode, and determining the target broadcast data according to the connection parameter includes: acquiring a first connection number, wherein the first connection number is the connection number between the slave Bluetooth device and other Bluetooth devices; determining whether a first mode is adopted, wherein the first mode is that the slave Bluetooth equipment is in a low-delay mode; when the first connection number is greater than the preset connection number and in the first mode, determining first target broadcast data, wherein the first target broadcast data comprises first connection interval parameters, and the first connection interval parameters are greater than the preset connection interval parameters.
Wherein the first connection number refers to the number of bluetooth devices connected from the bluetooth devices, and the number may be 1, 2, etc., which is not limited only herein. And the connection status of the slave bluetooth device can be evaluated by the first connection number.
In particular, the acquisition of the first number of connections and the determination of whether the first mode is the first mode may be acquired from an API or instruction of the bluetooth chip of the bluetooth device, the specific manner of operation depending on the model and manufacturer of the bluetooth chip.
The low-delay mode is a communication mode between the bluetooth device and other bluetooth devices, and refers to a mode in which an interval time from transmission to reception is shortened.
The number of preset connections may be defined by the development of technology, and in this embodiment, the number of preset connections may be 2.
The preset connection interval parameter refers to a connection interval set when the bluetooth device leaves the factory, and may be determined by its own hardware, for example, may be 30 ms, 50 ms, etc., which is not limited only herein.
In the case where the first connection interval parameter is greater than the preset connection interval parameter, the first connection interval parameter is set to be greater than the preset connection interval parameter, and there is no limitation in scope, for example, if the preset connection interval parameter is 30 ms, the first connection interval parameter may be 31 ms, 40 ms, 50 ms, etc., which is not limited only herein.
Wherein the connection interval parameter defines the time interval between two connection packets, a shorter connection interval will result in more frequent communication interactions, while a longer interval will reduce the frequency of communication interactions.
Specifically, when the slave bluetooth device detects that bluetooth communication connection is established between the slave bluetooth device and 2 bluetooth devices, and the slave bluetooth device itself has started a low-latency mode, the first connection interval parameter is set to be 100 ms, i.e. the connection interval parameter is set to be larger than the preset connection interval parameter, so that the communication frequency between the master bluetooth device and the slave bluetooth device can be reduced, the electric quantity of the slave bluetooth device is saved, the power consumption is reduced, the service time is prolonged, the bandwidth occupying other bluetooth channels in the low-latency mode can be reduced, and normal communication with other bluetooth devices is ensured.
Therefore, when the slave Bluetooth device meets the first connection quantity requirement and the first mode, the connection interval parameter can be adjusted in the broadcasting stage, so that after BLE connection is established, the communication frequency between the master Bluetooth device and the slave Bluetooth device can be reduced, the electric quantity of the slave Bluetooth device is saved, the power consumption is reduced, the service time is prolonged, the bandwidth occupying other Bluetooth channels can be reduced, and the normal communication of other Bluetooth devices is ensured.
In an embodiment, after the determining whether the first mode is the low latency mode of the slave bluetooth device, the method further includes: and when the first connection number is smaller than the preset connection number or not in the first mode, determining second target broadcast data, wherein the second target broadcast data comprises second connection interval parameters, and the second connection interval parameters are smaller than the preset connection interval parameters.
When the slave Bluetooth device detects that the Bluetooth communication connection is not established between the slave Bluetooth device and 2 or more Bluetooth devices, and the slave Bluetooth device does not start a low-delay mode, the slave Bluetooth device is in a standby or low-power mode currently, and waits for a further connection request or a communication triggering event.
In the case where the second connection interval parameter is smaller than the preset connection interval parameter, the second connection interval parameter is set to be smaller than the preset connection interval parameter, and there is no limitation in scope, for example, if the preset connection interval parameter is 30 ms, the first connection interval parameter may be 20 ms, 25 ms, 10 ms, etc., which is not limited only herein.
It can be seen that decreasing the connection interval parameter may cause the BLE device to increase the frequency of data communication, thereby improving the real-time performance of the user operating on the main device, and the frequency of communication between devices is more frequent, so that the user can begin to exchange or operate data more quickly.
In an embodiment, the connection parameter is a second connection parameter, the second connection parameter is an electric quantity of the slave bluetooth device, and determining the target broadcast data according to the connection parameter includes: acquiring a second connection parameter; and if the second connection parameter is smaller than the preset slave Bluetooth equipment electric quantity, determining third target broadcast data, wherein the third target broadcast comprises a third connection interval parameter, and the third connection interval parameter is larger than the preset connection interval parameter.
The slave bluetooth device power is obtained through an API or an instruction of a bluetooth chip of the slave bluetooth device, and the specific operation mode depends on the model and manufacturer of the bluetooth chip.
The preset slave bluetooth device power may be set to 40%, which is not limited herein.
If the second connection parameter is smaller than the preset slave bluetooth device power, the current slave bluetooth device power is insufficient, if the second connection parameter is connected according to the preset connection interval, the power is lost rapidly due to frequent communication.
In the case where the third connection interval parameter is greater than the preset connection interval parameter, the third connection interval parameter is set to be greater than the preset connection interval parameter, and there is no limitation in scope, for example, if the preset connection interval parameter is 30 ms, the third connection interval parameter may be 31 ms, 40 ms, 50 ms, etc., which is not limited only herein.
It can be seen that by increasing the connection interval parameter, the bluetooth device can reduce the frequency of communication, thereby reducing the power consumption. This helps to extend the battery life of the device, and this energy saving measure is particularly important, especially when the power is low, to ensure that the device is still usable when needed.
In an embodiment, after the obtaining the second connection parameter, the method further comprises: and if the second connection parameter is larger than the preset slave Bluetooth equipment electric quantity, determining fourth target broadcast data, wherein the fourth target broadcast data comprises fourth connection interval parameters, and the fourth connection interval parameters are smaller than the preset connection interval parameters.
If the second connection parameter is larger than the preset slave bluetooth equipment electric quantity, the current slave bluetooth equipment electric quantity is sufficient, and energy-saving setting is not needed.
In the case where the fourth connection interval parameter is smaller than the preset connection interval parameter, the fourth connection interval parameter is set to be smaller than the preset connection interval parameter, and there is no limitation in scope, for example, if the preset connection interval parameter is 30 ms, the fourth connection interval parameter may be 20 ms, 25 ms, 10 ms, etc., which is not limited only herein.
Therefore, when the electric quantity of the slave Bluetooth device is sufficient, the frequency of data communication is increased by reducing the connection interval parameter, so that the real-time performance of the operation of the user on the master device is improved, the frequency of communication between the devices is more frequent, and the user can start data exchange or operation more quickly.
In an embodiment, after the receiving the connection request sent from the master bluetooth device and establishing a BLE data communication connection with the master bluetooth device according to the connection interval parameter in the target broadcast data, the method further includes: continuously acquiring a third connection parameter, wherein the third connection parameter is the connection parameter of the slave Bluetooth device after BLE communication is established; if the third connection parameter is different from the connection parameter corresponding to the target broadcast data, determining a target connection interval parameter according to the third connection parameter; transmitting the target connection interval parameter to the master Bluetooth device; and receiving a target connection parameter sent from the main Bluetooth device, wherein the target connection parameter comprises the target connection interval parameter and a start update time, and updating the connection interval parameter of the BLE data communication connection according to the target connection parameter.
The third connection parameter includes a first connection parameter and a second connection parameter, that is, after connection, information such as an electric quantity, a low power consumption mode, and the number of connections of the slave bluetooth device is continuously monitored.
If the third connection parameter varies, it is further determined that the connection interval parameter required by the bluetooth device at this time does not match the target broadcast data, and at this time, the content of the connection parameter in the data channel is adjusted according to the real-time device state and performance requirement, so as to optimize BLE communication.
Furthermore, the target connection interval parameter can be determined according to the adjustment modes respectively corresponding to the first connection parameter and the second connection parameter, and the connection interval parameter of the BLE data communication connection is updated according to the target connection interval parameter and the start update time, so that the instantaneity of the connection parameter is ensured, and the communication performance is optimized.
The target connection parameter is sent by a master Bluetooth device, when the master Bluetooth device establishes BLE connection with a slave Bluetooth device, and when the self connection parameter of the slave Bluetooth device is determined to change, the master Bluetooth device can actively send a new connection interval parameter to the master Bluetooth device, after receiving, the master Bluetooth device can set a start update time, package the connection interval parameter between the two synchronous devices and the start update time into the target connection parameter and send the target connection parameter to the slave Bluetooth device, and when the start update time arrives, the connection interval parameter of the BLE data communication connection is synchronously updated between the two devices.
It can be seen that the state of the slave bluetooth device is continuously detected after the BLE connection is established, and the connection interval parameter between data communications is updated in time to meet specific communication requirements. This helps to improve the real-time nature of the communication, ensuring that the device can respond quickly under different conditions.
Based on the bluetooth system shown in fig. 1A, the technical scheme of the application can be realized, wherein the technical scheme of the application is specifically applied to a master bluetooth device, and the master bluetooth device is in communication connection with a slave bluetooth device.
The following specifically describes the technical scheme of the present application.
Referring to fig. 3, fig. 3 is a schematic flow chart of a bluetooth connection method provided in an embodiment of the present application, where the method may be applied to a bluetooth system, and the bluetooth system may be as shown in fig. 1A. As shown in fig. 2, the method comprises the steps of:
s301, receiving target broadcast data, wherein the target broadcast data is sent by the slave Bluetooth device through broadcasting and received by the master Bluetooth device, and the target broadcast data comprises a connection interval parameter, wherein the connection interval parameter is used for appointing BLE communication interval after the master Bluetooth device is connected with the slave Bluetooth device BLE.
S302, analyzing the target broadcast data to obtain the connection interval parameters.
S303, sending a connection request to the slave Bluetooth device, and establishing BLE communication connection with the slave Bluetooth device according to the connection interval parameter in the target broadcast data.
Specifically, the master bluetooth device first initiates a scanning operation to listen to the broadcast channel and discover nearby BLE devices, including the target slave bluetooth device; when the master Bluetooth device scans broadcast data sent by the target slave Bluetooth device, the master Bluetooth device receives the broadcast data packets; the main Bluetooth device analyzes the received broadcast data packet to acquire information about the target device, including connection interval parameters; the process of parsing broadcast data generally includes the steps of: identifying a field in the broadcast data packet containing a connection interval parameter; typically, the connection interval parameter will be encoded in a specific manner and contained at a specific location of the broadcast data; extracting a value of a connection interval parameter, typically in milliseconds, representing a time interval between two BLE communications; once the master bluetooth device successfully parses the connection interval parameter, it can use this parameter to establish a BLE connection; the connection interval parameter tells the communication time interval which should be used after the BLE connection is established between the main Bluetooth device and the target device; the master bluetooth device may negotiate and establish a BLE data communication connection using the parsed connection interval parameters, as well as other connection parameters.
It can be seen that both the performance and stability of the connection can be ensured to meet the requirements. Once the BLE connection is established, bi-directional BLE data communication may begin between the master bluetooth device and the target device, with configuration of connection interval parameters helping to determine the rate and stability of data transmission.
In general, the implementation can further reduce the bandwidth occupation conflict between BLE and other Bluetooth devices after BLE connection is established by receiving the connection interval parameter sent by the slave Bluetooth device under the condition that the master Bluetooth device and the slave Bluetooth device are not in communication, namely, the ideal connection interval parameter of the slave Bluetooth device cannot be obtained, so that the other Bluetooth devices still have enough bandwidth use.
In an embodiment, the method further comprises: receiving a target connection interval parameter, wherein the target connection interval parameter is data sent when the slave Bluetooth equipment detects that the connection parameter of the slave Bluetooth equipment changes after BLE communication is established; transmitting target connection parameters to the slave Bluetooth equipment, wherein the target connection parameters comprise the target connection interval parameters and starting update time; and updating the connection interval parameters of the BLE data communication connection according to the target connection parameters.
The target connection parameter is sent by a master Bluetooth device, when the master Bluetooth device establishes BLE connection with a slave Bluetooth device, the slave Bluetooth device can actively send a new connection interval parameter update request to the master Bluetooth device through a BLE data channel after determining that the connection parameter of the slave Bluetooth device changes, the master Bluetooth device can set a start update time after receiving the new connection interval parameter, package the connection interval parameter and the start update time between the two synchronous devices into the target connection parameter and send the target connection parameter to the slave Bluetooth device, and when the start update time arrives, the connection interval parameter of the BLE data communication connection is synchronously updated between the two devices.
It can be seen that the master bluetooth device can know that the connection parameters of the slave bluetooth device have changed, and by transmitting the target connection parameters to the slave bluetooth device, the master bluetooth device can negotiate new connection parameters with the slave bluetooth device. This negotiation procedure helps to ensure that both parties to the communication use the same connection parameters to provide consistent communication quality and performance.
The method of the present application is described above and the apparatus of the present application is described below.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a bluetooth connection device provided in an embodiment of the present application, which is applied to a slave bluetooth device, where the slave bluetooth device is in communication connection with a master bluetooth device. As shown in fig. 4, the bluetooth connection device 40 includes:
An obtaining module 401, configured to obtain a current connection parameter;
a determining module 402, configured to determine, according to the connection parameter, target broadcast data, where the target broadcast data is sent by the slave bluetooth device through broadcasting and is received by the master bluetooth device, and the target broadcast data includes a connection interval parameter, where the connection interval parameter is used to agree on a BLE communication interval after the master bluetooth device is connected to the slave bluetooth device BLE;
a transmitting module 403, configured to transmit the target broadcast data to the master bluetooth device;
and a connection module 404, configured to receive a connection request sent from the master bluetooth device, and establish BLE data communication connection with the master bluetooth device according to a connection interval parameter in the target broadcast data.
According to the method and the device, the connection interval parameter when BLE connection is established with the master Bluetooth device is determined through the connection parameter of the slave Bluetooth device, so that the problem that reasonable connection interval parameters are set according to the connection parameter of the slave Bluetooth device under the condition that the master Bluetooth device and the slave Bluetooth device are not in communication is solved, a reasonable BLE channel can be established, bandwidth occupation conflict between BLE and other Bluetooth devices after BLE connection is established is effectively reduced, and other Bluetooth devices are guaranteed to still have enough bandwidth to use.
In one possible design, in the determining the target broadcast data according to the connection parameter, the determining module 402 is further configured to: acquiring a first connection number, wherein the first connection number is the connection number between the slave Bluetooth device and other Bluetooth devices; determining whether a first mode is adopted, wherein the first mode is that the slave Bluetooth equipment is in a low-delay mode; when the first connection number is greater than the preset connection number and in the first mode, determining first target broadcast data, wherein the first target broadcast data comprises first connection interval parameters, and the first connection interval parameters are greater than the preset connection interval parameters.
In one possible design, after the determining whether the first mode is the low latency mode of the slave bluetooth device, the determining module 402 is further configured to: and when the first connection number is smaller than the preset connection number or not in the first mode, determining second target broadcast data, wherein the second target broadcast data comprises second connection interval parameters, and the second connection interval parameters are smaller than the preset connection interval parameters.
In one possible design, in the determining the target broadcast data according to the connection parameter, the determining module 402 is further configured to: acquiring a second connection parameter; and if the second connection parameter is smaller than the preset slave Bluetooth equipment electric quantity, determining third target broadcast data, wherein the third target broadcast comprises a third connection interval parameter, and the third connection interval parameter is larger than the preset connection interval parameter.
In one possible design, after the second connection parameter is obtained, the determining module 402 is further configured to: and if the second connection parameter is larger than the preset slave Bluetooth equipment electric quantity, determining fourth target broadcast data, wherein the fourth target broadcast data comprises fourth connection interval parameters, and the fourth connection interval parameters are smaller than the preset connection interval parameters.
In one possible design, after the receiving the connection request sent from the master bluetooth device and establishing a BLE data communication connection with the master bluetooth device according to the connection interval parameter in the target broadcast data, the connection module 40 is further configured to: continuously acquiring a third connection parameter, wherein the third connection parameter is the connection parameter of the slave Bluetooth device after BLE communication is established; if the third connection parameter is different from the connection parameter corresponding to the target broadcast data, determining a target connection interval parameter according to the third connection parameter; transmitting the target connection interval parameter to the master Bluetooth device; receiving target connection parameters sent from the main Bluetooth equipment, wherein the target connection parameters comprise the target connection interval parameters and starting update time; and updating the connection interval parameters of the BLE data communication connection according to the target connection parameters. It should be noted that, in the embodiment corresponding to fig. 4, the details not mentioned in the foregoing description of the method embodiment may be referred to, and will not be repeated here.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a bluetooth connection device provided in an embodiment of the present application, where the bluetooth connection device is applied to a master bluetooth device, and the master bluetooth device is communicatively connected with a slave bluetooth device. As shown in fig. 5, the bluetooth connection device 50 includes:
a receiving module 501, configured to receive target broadcast data, where the target broadcast data is sent by the slave bluetooth device through broadcasting and is received by the master bluetooth device, and the target broadcast data includes a connection interval parameter, where the connection interval parameter is used to agree on a BLE communication interval after the master bluetooth device is connected with the slave bluetooth device BLE;
the parsing module 502 is configured to parse the target broadcast data to obtain a connection interval parameter;
a sending module 503, configured to send a connection request to the slave bluetooth device, and establish BLE communication connection with the slave bluetooth device according to a connection interval parameter in the target broadcast data.
According to the implementation, under the condition that the master Bluetooth device and the slave Bluetooth device are not in communication, namely, the ideal connection interval parameter of the slave Bluetooth device cannot be acquired, a reasonable BLE channel is established by receiving the connection interval parameter sent by the slave Bluetooth device, so that the bandwidth occupation conflict between BLE and other Bluetooth devices after BLE connection is established is further reduced, and other Bluetooth devices are guaranteed to still have enough bandwidth usage.
In one possible design, the receiving module 501 is further configured to receive a target connection interval parameter, where the target connection interval parameter is data sent when the slave bluetooth device detects that a connection parameter of the slave bluetooth device changes after BLE communication is established; the sending module 503 is further configured to send a target connection parameter to the slave bluetooth device, where the target connection parameter includes the target connection interval parameter and a start update time; and updating the connection interval parameters of the BLE data communication connection according to the target connection parameters.
It should be noted that, in the embodiment corresponding to fig. 5, the details not mentioned in the foregoing description of the method embodiment may be referred to, and will not be repeated here.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a bluetooth device provided in an embodiment of the present application, where the bluetooth device 60 includes a processor 601, a memory 602, and a transceiver 603. The memory 602 is connected to the processor 601, for example via a bus.
The processor 601 is configured to support the bluetooth device 40 to perform the corresponding functions in the method embodiments described above. The processor 601 may be a central processing unit (central processing unit, CPU), a network processor (network processor, NP), a hardware chip or any combination thereof. The hardware chip may be an application specific integrated circuit (application specific integrated circuit, ASIC), a programmable logic device (programmable logic device, PLD), or a combination thereof. The PLD may be a complex programmable logic device (complex programmable logic device, CPLD), a field-programmable gate array (field-programmable gate array, FPGA), general-purpose array logic (generic array logic, GAL), or any combination thereof.
The memory 602 is used for storing program codes and the like. The memory 602 may include Volatile Memory (VM), such as random access memory (random access memory, RAM); the memory 602 may also include a non-volatile memory (NVM), such as read-only memory (ROM), flash memory (flash memory), hard disk (HDD) or Solid State Drive (SSD); the memory 602 may also include a combination of the types of memory described above.
The transceiver 603 is used for transmitting data, in particular, the transceiver 603 is a bluetooth transceiver.
The processor 601 may call the program code to:
acquiring current connection parameters;
determining target broadcast data according to the connection parameters, wherein the target broadcast data is sent by the slave Bluetooth equipment through broadcasting and received by the master Bluetooth equipment, and the target broadcast data comprises connection interval parameters which are used for appointing BLE communication intervals after the master Bluetooth equipment and the slave Bluetooth equipment BLE are connected;
transmitting the target broadcast data to the master Bluetooth device;
And receiving a connection request sent from the main Bluetooth device, and establishing BLE data communication connection with the main Bluetooth device according to the connection interval parameter in the target broadcast data. The processor 601 may also call the program code to:
receiving target broadcast data, wherein the target broadcast data is sent by the slave Bluetooth device through broadcasting and is received by the master Bluetooth device, and the target broadcast data comprises a connection interval parameter, wherein the connection interval parameter is used for appointing BLE communication interval after the master Bluetooth device is connected with the slave Bluetooth device BLE;
analyzing the target broadcast data to obtain a connection interval parameter;
and sending a connection request to the slave Bluetooth device, and establishing BLE communication connection with the slave Bluetooth device according to the connection interval parameter in the target broadcast data.
The present application also provides a computer-readable storage medium storing a computer program comprising program instructions that, when executed by a computer, cause the computer to perform the method of the previous embodiments.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in the embodiments may be accomplished by computer programs stored in a computer-readable storage medium, which when executed, may include the steps of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only memory (ROM), a random-access memory (Random Access memory, RAM), or the like.
The foregoing disclosure is only illustrative of the preferred embodiments of the present application and is not intended to limit the scope of the claims herein, as the equivalent of the claims herein shall be construed to fall within the scope of the claims herein.

Claims (11)

1. A bluetooth connection method, applied to a slave bluetooth device, the slave bluetooth device being communicatively connected to a master bluetooth device, the method further comprising:
acquiring current connection parameters;
determining target broadcast data according to the connection parameters, wherein the target broadcast data is sent by the slave Bluetooth equipment through broadcasting and received by the master Bluetooth equipment, and the target broadcast data comprises connection interval parameters which are used for appointing BLE communication intervals after the master Bluetooth equipment and the slave Bluetooth equipment BLE are connected;
transmitting the target broadcast data to the master Bluetooth device;
and receiving a connection request sent from the main Bluetooth device, and establishing BLE data communication connection with the main Bluetooth device according to the connection interval parameter in the target broadcast data.
2. The method of claim 1, wherein the connection parameter is a first connection parameter, the first connection parameter including a first number of connections and a first pattern, the determining the target broadcast data based on the connection parameter comprising:
Acquiring a first connection number, wherein the first connection number is the connection number of the master Bluetooth device in the slave Bluetooth devices;
determining whether a first mode is adopted, wherein the first mode is that the slave Bluetooth equipment is in a low-delay mode;
when the first connection number is greater than the preset connection number and in the first mode, determining first target broadcast data, wherein the first target broadcast data comprises first connection interval parameters, and the first connection interval parameters are greater than the preset connection interval parameters.
3. The method of claim 2, wherein after said determining whether the first mode is the slave bluetooth device is a low latency mode, the method further comprises:
and when the first connection number is smaller than the preset connection number or not in the first mode, determining second target broadcast data, wherein the second target broadcast data comprises second connection interval parameters, and the second connection interval parameters are smaller than the preset connection interval parameters.
4. The method of claim 1, wherein the connection parameter is a second connection parameter, the second connection parameter is an amount of power of the slave bluetooth device, and determining the target broadcast data according to the connection parameter comprises:
Acquiring a second connection parameter;
and if the second connection parameter is smaller than the preset slave Bluetooth equipment electric quantity, determining third target broadcast data, wherein the third target broadcast comprises a third connection interval parameter, and the third connection interval parameter is larger than the preset connection interval parameter.
5. The method of claim 4, wherein after the obtaining the second connection parameter, the method further comprises:
and if the second connection parameter is larger than the preset slave Bluetooth equipment electric quantity, determining fourth target broadcast data, wherein the fourth target broadcast data comprises fourth connection interval parameters, and the fourth connection interval parameters are smaller than the preset connection interval parameters.
6. The method of claim 1, wherein after said receiving a connection request sent from the master bluetooth device establishes a BLE data communication connection with the master bluetooth device according to a connection interval parameter in the target broadcast data, the method further comprises:
continuously acquiring a third connection parameter, wherein the third connection parameter is the connection parameter of the slave Bluetooth device after BLE communication is established;
if the third connection parameter is different from the connection parameter corresponding to the target broadcast data, determining a target connection interval parameter according to the third connection parameter;
Transmitting the target connection interval parameter to the master Bluetooth device;
receiving target connection parameters sent from the main Bluetooth equipment, wherein the target connection parameters comprise the target connection interval parameters and starting update time;
and updating the connection interval parameters of the BLE data communication connection according to the target connection parameters.
7. A bluetooth connection method, applied to a master bluetooth device, the master bluetooth device being communicatively connected to a slave bluetooth device, the method further comprising:
receiving target broadcast data, wherein the target broadcast data is sent by the slave Bluetooth device through broadcasting and is received by the master Bluetooth device, and the target broadcast data comprises a connection interval parameter, wherein the connection interval parameter is used for appointing BLE communication interval after the master Bluetooth device is connected with the slave Bluetooth device BLE;
analyzing the target broadcast data to obtain a connection interval parameter;
and sending a connection request to the slave Bluetooth device, and establishing BLE communication connection with the slave Bluetooth device according to the connection interval parameter in the target broadcast data.
8. The method of claim 7, wherein the method further comprises:
Receiving a target connection interval parameter, wherein the target connection interval parameter is data sent when the slave Bluetooth equipment detects that the connection parameter of the slave Bluetooth equipment changes after BLE communication is established;
transmitting target connection parameters to the slave Bluetooth equipment, wherein the target connection parameters comprise the target connection interval parameters and starting update time;
and updating the connection interval parameters of the BLE data communication connection according to the target connection parameters.
9. A bluetooth system comprising a master bluetooth device for performing the method according to any of claims 1-6 and a slave bluetooth device for performing the method according to any of claims 7-8.
10. A bluetooth device comprising a memory, a processor and a transceiver, the memory and the transceiver being connected to the processor, the transceiver being for transmitting or receiving data, the processor being for executing one or more computer programs stored in the memory, the processor, when executing the one or more computer programs, causing the bluetooth device to implement the method of any of claims 1-8.
11. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program comprising program instructions which, when executed by a processor, cause the processor to perform the method of any of claims 1-8.
CN202311391292.1A 2023-10-25 2023-10-25 Bluetooth connection method, device, equipment, system and storage medium Pending CN117377132A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311391292.1A CN117377132A (en) 2023-10-25 2023-10-25 Bluetooth connection method, device, equipment, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311391292.1A CN117377132A (en) 2023-10-25 2023-10-25 Bluetooth connection method, device, equipment, system and storage medium

Publications (1)

Publication Number Publication Date
CN117377132A true CN117377132A (en) 2024-01-09

Family

ID=89392529

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311391292.1A Pending CN117377132A (en) 2023-10-25 2023-10-25 Bluetooth connection method, device, equipment, system and storage medium

Country Status (1)

Country Link
CN (1) CN117377132A (en)

Similar Documents

Publication Publication Date Title
CN108600892B (en) Upgrading method and device, wireless headset, TWS headset and charging box
US20200245386A1 (en) Wireless connection method and device
EP2723108B1 (en) Wi-Fi P2P communication terminal device and communication method thereof
CN111464993B (en) Bluetooth headset pairing method and wireless headset for Bluetooth headset
US9113500B2 (en) Device and method for communication of management information in ad-hoc wireless networks
WO2018137601A1 (en) Communication method and related device
CN110945943B (en) Data processing system, method, device, equipment and readable storage medium
JP2018533308A (en) Method and device for measuring signal strength
KR20200112377A (en) Apparatus and method for controlling transmission power of electronic device in a wireless communication system
EP3923608A1 (en) Data transmission method between tws bluetooth devices and tws bluetooth device therefor
US20230224654A1 (en) Earphone debugging method and device, and storage medium
US9866682B2 (en) Method for processing non-access stratum message, user equipment, and network side device
CN110830973B (en) Method for transmitting audio information by using wireless earphone
KR20200035730A (en) An method of operating an application that requires communication whit and external device, and an electronic device
KR102333306B1 (en) Data communication method and system, electronic device, chip and storage medium
CN105828253A (en) Wireless connection control method and device in audio playing system
US8855693B2 (en) Method and apparatus for controlling wireless devices
CN111954123A (en) Method, system, medium, and wireless audio device for information synchronization of wireless audio devices
CN117377132A (en) Bluetooth connection method, device, equipment, system and storage medium
CN115694742A (en) Method and electronic device for transmitting acknowledgement signal in wireless communication system
EP3843495B1 (en) Communication method and apparatus, and device
EP3461211A1 (en) Method and apparatus for low-power-consumption terminal to access network
CN109743715B (en) Processing method and system and electronic equipment
CN111093179A (en) Wireless communication method, device and system
CN113365325B (en) Data transmission method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination