CN114095907A - Bluetooth connection control method, device and equipment - Google Patents
Bluetooth connection control method, device and equipment Download PDFInfo
- Publication number
- CN114095907A CN114095907A CN202111264788.3A CN202111264788A CN114095907A CN 114095907 A CN114095907 A CN 114095907A CN 202111264788 A CN202111264788 A CN 202111264788A CN 114095907 A CN114095907 A CN 114095907A
- Authority
- CN
- China
- Prior art keywords
- response delay
- connection interval
- adjusting
- slave
- connection
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 39
- 230000004044 response Effects 0.000 claims abstract description 160
- 238000012544 monitoring process Methods 0.000 claims abstract description 18
- 238000004891 communication Methods 0.000 claims description 123
- 238000012545 processing Methods 0.000 claims description 17
- 230000005540 biological transmission Effects 0.000 claims description 8
- 238000004590 computer program Methods 0.000 claims description 5
- 230000004622 sleep time Effects 0.000 claims description 5
- 238000010586 diagram Methods 0.000 description 9
- 230000006870 function Effects 0.000 description 9
- 230000003287 optical effect Effects 0.000 description 9
- 238000005516 engineering process Methods 0.000 description 4
- 238000003491 array Methods 0.000 description 2
- 230000003247 decreasing effect Effects 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- FFBHFFJDDLITSX-UHFFFAOYSA-N benzyl N-[2-hydroxy-4-(3-oxomorpholin-4-yl)phenyl]carbamate Chemical compound OC1=C(NC(=O)OCC2=CC=CC=C2)C=CC(=C1)N1CCOCC1=O FFBHFFJDDLITSX-UHFFFAOYSA-N 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000001934 delay Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000008707 rearrangement Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/80—Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/20—Manipulation of established connections
Abstract
The embodiment of the invention discloses a control method, a device and equipment for Bluetooth connection. Monitoring validity information of a set number of data packets continuously transmitted by slave equipment; the validity information comprises a null data packet or a valid data packet; and adjusting the connection interval and the response delay corresponding to the slave equipment according to the validity information. According to the control method for the Bluetooth connection, provided by the embodiment of the invention, the connection interval and the response delay corresponding to the slave equipment are adjusted based on the validity information of the data packets with the continuously set number, so that the connection parameters between the master equipment and the slave equipment can be dynamically adjusted, and the stability of the Bluetooth connection is ensured.
Description
Technical Field
The embodiment of the invention relates to the technical field of Bluetooth, in particular to a Bluetooth connection control method, device and equipment.
Background
With the rapid development of Bluetooth technology, Bluetooth Low Energy (BLE) technology is increasingly used in smart devices. The BLE technology has the characteristics of ultra-low power consumption and high-speed connection, but the transmission speed and the transmission stability in a multi-connection state are short boards of the current industry technology, and especially when the transmission of files such as pictures, audio or upgrade packages and the like simultaneously needs in the multi-connection state, the dynamic adjustment of the transmission speed is very important.
Disclosure of Invention
The embodiment of the invention provides a control method, a control device and control equipment for Bluetooth connection, which can dynamically adjust connection parameters between master equipment and slave equipment, thereby ensuring the stability of Bluetooth connection.
In a first aspect, an embodiment of the present invention provides a method for controlling a bluetooth connection, where the method is performed by a master device, and the master device establishes a bluetooth connection with at least one slave device, and includes:
monitoring validity information of a set number of data packets continuously transmitted with the slave device; wherein the validity information comprises a null data packet or a valid data packet;
and adjusting the connection interval and the response delay corresponding to the slave equipment according to the validity information.
Further, adjusting the connection interval and the response delay corresponding to the slave device according to the validity information includes:
if the validity information indicates that the set number of data packets are all null data packets, increasing the connection interval and response delay corresponding to the slave device;
and if the validity information is that at least one valid data packet is contained in the data packets with the set number, reducing the connection interval and response delay corresponding to the slave equipment.
Further, before monitoring validity information of a set number of data packets continuously transmitted from the slave device, the method further includes:
when the master equipment establishes connection with the newly accessed slave equipment, acquiring a first communication type between the master equipment and the newly accessed slave equipment;
acquiring the number of accessed slave devices and a second communication type between the accessed slave devices;
determining a first connection interval and a first response delay corresponding to the newly accessed slave equipment according to the first communication type, the number of the accessed slave equipment and the second communication type; the communication types include short packet communication and long packet communication.
Further, determining a first connection interval and a first response delay corresponding to the newly accessed slave device according to the first communication type, the number of accessed slave devices, and the second communication type includes:
acquiring a maximum communication processing capacity parameter of the main equipment;
if the first communication type is short packet communication, determining a first connection interval according to the following formula: the first connection interval is more than or equal to T (A +1)2/A, and the first response delay is set as a first set value; wherein, T is the parameter of the maximum communication processing capacity, A is the number of the slave devices of which the second communication type is short packet communication;
if the first communication type is long packet communication, determining a first connection interval according to the following formula: the first connection interval is greater than or equal to T × A (B +1), and the first response delay is set to a first set value; wherein, T is the maximum communication processing capability parameter, a is the number of slave devices whose second communication type is short packet communication, and B is the number of slave devices whose second communication type is long packet communication.
Further, after determining a first connection interval and a first response delay corresponding to the newly accessed slave device according to the first communication type, the number of accessed slave devices, and the second communication type, adjusting the connection interval and the response delay corresponding to the slave device according to the validity information includes:
if the validity information indicates that the set number of data packets are all null data packets, adjusting the first connection interval corresponding to the slave device to be a second connection interval, and adjusting the first response delay to be a second response delay; wherein the second connection interval is greater than the first connection interval, the second response delay is greater than the first response delay;
if the validity information indicates that the set number of data packets contains at least one valid data packet, adjusting a first connection interval corresponding to the slave device to a zeroth connection interval, and adjusting a first response delay to a zeroth response delay; wherein the zeroth connection interval is less than the first connection interval and the zeroth response delay is less than or equal to the first response delay.
Further, adjusting the connection interval and the response delay corresponding to the slave device according to the validity information after adjusting the first connection interval corresponding to the slave device to be the second connection interval and adjusting the first response delay to be the second response delay includes:
if the validity information indicates that the set number of data packets are all empty data packets, determining that the slave device is in an idle state, adjusting a second connection interval corresponding to the slave device to a third connection interval, and adjusting a second response delay to a third response delay; wherein the third connection interval and the third response delay satisfy the following condition: d3 ≦ L3+1 protocol sleep time;
if the validity information indicates that the set number of data packets includes at least one valid data packet, adjusting a second connection interval corresponding to the slave device to be a first connection interval, and adjusting a second response delay to be a first response delay.
Further, after determining that the slave device is in an idle state, the method further includes:
and if a connection parameter updating request of the slave equipment in an idle state is received, adjusting a third connection interval corresponding to the slave equipment to be the first connection interval, and adjusting a third response delay to be the first response delay.
Further, after adjusting the first connection interval corresponding to the slave device to a zeroth connection interval and adjusting the first response delay to a zeroth response delay, adjusting the connection interval and the response delay corresponding to the slave device according to the validity information includes:
if the validity information indicates that the set number of data packets are all null data packets, adjusting the zeroth connection interval corresponding to the slave device to be the first connection interval, and adjusting the zeroth response delay to be the first response delay.
In a second aspect, an embodiment of the present invention further provides an apparatus for controlling bluetooth connection, where the apparatus is disposed in a master device, and the master device establishes bluetooth connection with at least one slave device, and the apparatus includes:
the data packet validity information monitoring module is used for monitoring validity information of a set number of data packets continuously transmitted with the slave equipment; wherein the validity information comprises a null data packet or a valid data packet;
and the adjusting module is used for adjusting the connection interval and the response delay corresponding to the slave equipment according to the validity information.
In a third aspect, an embodiment of the present invention further provides a computer device, where the computer device includes: the bluetooth connection control system comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor executes the program to realize the bluetooth connection control method according to the embodiment of the invention.
The embodiment of the invention discloses a control method, a device and equipment for Bluetooth connection. Monitoring validity information of a set number of data packets continuously transmitted by slave equipment; the validity information comprises a null data packet or a valid data packet; and adjusting the connection interval and the response delay corresponding to the slave equipment according to the validity information. According to the control method for the Bluetooth connection, provided by the embodiment of the invention, the connection interval and the response delay corresponding to the slave equipment are adjusted based on the validity information of the data packets with the continuously set number, so that the connection parameters between the master equipment and the slave equipment can be dynamically adjusted, and the stability of the Bluetooth connection is ensured.
Drawings
Fig. 1 is a flowchart of a method for controlling bluetooth connection according to a first embodiment of the present invention;
fig. 2 is a schematic structural diagram of a bluetooth connection control apparatus according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a computer device in a third embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Under the non-idle state, the Bluetooth baseband works in frequency hopping, the master device and the slave device can negotiate for a plurality of times to carry out frequency hopping connection, and jump to a new channel after a specific time, and a Link Layer (Link Layer) is responsible for channel switching. If the device is preparing to receive and transmit data during switching, it is called a connection event, but although no data needs to be received and transmitted, link layer data is still exchanged between the two devices to maintain connection, which causes waste of bandwidth resources.
Example one
Fig. 1 is a flowchart of a bluetooth connection control method according to an embodiment of the present invention, which is applicable to adjusting a connection interval and a response delay between a master device and a slave device of a bluetooth connection, and the method may be executed by a bluetooth connection control apparatus, which may be composed of hardware and/or software and may be generally integrated into a device having a bluetooth connection control function, where the device may be an electronic device such as a server or a server cluster. The control means for bluetooth connection may be a master device, which establishes a bluetooth connection with at least one slave device. As shown in fig. 1, the method specifically comprises the following steps:
step 110, monitoring and controlling the validity information of the set number of data packets continuously transmitted from the slave device.
Wherein, the validity information comprises a null data packet or a valid data packet. The set number may be set to any value between 4-8. The master device and the slave device establish connection at regular connection intervals, and each time the connection is established, one data packet is transmitted. Monitoring and monitoring the validity information of a set number of data packets transmitted in succession from a device can be understood as: and monitoring the validity of the data packet transmitted each time when the master device and the slave device are continuously connected for a set number of times.
The validity information of the set number of packets may include: the data packets with the set number are all null data packets, and the data packets with the set number comprise at least one valid data packet. For example, assuming that the set number is 4, the validity information may be: continuous 4 null data packets are transmitted between the master device and the slave device, and the 4 data packets comprise at least one valid data packet.
And step 120, adjusting the connection interval and the response delay corresponding to the slave device according to the validity information.
The connection interval may be a time interval between two consecutive times of sending connection requests from the master device to the slave device. The response delay may be understood as the number of response delays of the slave device to the connection request sent by the master device, for example, if the response delay is set to N, the slave device responds to the connection request of the master device every N times. For example, assuming that the response delay is set to 0, the slave device responds to each connection request of the master device; assuming that the response delay is set to 1, the slave device responds to the master device's connection request every other time.
The connection interval may be adjusted in an increasing or decreasing manner, and the response delay may be adjusted in an increasing or decreasing manner.
In this embodiment, the manner of adjusting the connection interval and the response delay corresponding to the slave device according to the validity information may be: if the validity information indicates that the data packets with the set number are all empty data packets, the connection interval and the response delay corresponding to the slave equipment are increased; and if the validity information is that at least one valid data packet is contained in the data packets with the set number, reducing the connection interval and response delay corresponding to the slave equipment.
Optionally, before monitoring and monitoring validity information of a set number of data packets continuously transmitted from the slave device, the method further includes the following steps: when the master equipment establishes connection with the newly accessed slave equipment, acquiring a first communication type between the master equipment and the newly accessed slave equipment; acquiring the number of accessed slave devices and a second communication type between each accessed slave device; and determining a first connection interval and a first response delay corresponding to the newly accessed slave equipment according to the first communication type, the number of the accessed slave equipment and the second communication type.
The communication type may include short packet communication and long packet communication, among others. In this embodiment, the master device establishes a connection with the slave device by capturing a device identifier (Service UUID) broadcasted by the slave device, a bluetooth low energy physical connection function, and a device name.
The manner of acquiring the first communication type with the newly accessed slave device may be: the corresponding relation between the data type and the communication type is established in advance and stored, and after the master device receives the data type sent by the slave device, the communication type between the master device and the slave device can be obtained from the corresponding relation according to the data type. For example, data of an instruction type (e.g., short message, barcode scan) may be set to short packet transmission, and flag is 0, and data of the remaining type may be set to long packet transmission, and flag is 1. The short packet communication type has higher priority and can occupy the transmission resource of the long packet communication type.
In this embodiment, the manner of determining the first connection interval and the first response delay corresponding to the newly accessed slave device according to the first communication type, the number of accessed slave devices, and the second communication type may be: acquiring a maximum communication processing capacity parameter of the main equipment; if the first communication type is short packet communication, determining a first connection interval according to the following formula: the first connection interval is ≧ T (A +1)2/A, and the first response delay is set to a first set value.
Wherein, T is the parameter of the maximum communication processing capacity, A is the number of the slave devices of which the second communication type is short packet communication; the first set value may be 0. T may represent the minimum time interval for a piece of Data (PUD) to be processed by a master. For example, suppose that, at a certain time, an X slave device initiates an advertisement to a master device, a master device MCU calls a pre-stored resource in a memory to obtain that at this time, a number of slave devices are performing short packet communication, a number of B slave devices are performing long packet communication, and an X slave device belongs to short packet communication, a first connection interval of the X slave device is set to satisfy D1 ≧ T (a +1) 2/a.
In this embodiment, the manner of determining the first connection interval and the first response delay corresponding to the newly accessed slave device according to the first communication type, the number of accessed slave devices, and the second communication type may be: acquiring a maximum communication processing capacity parameter of the main equipment; if the first communication type is long packet communication, determining a first connection interval according to the following formula: the first connection interval ≧ T × A (B +1), and the first response delay is set to a first set value.
Where T is the maximum communication throughput parameter, a is the number of slave devices whose second communication type is short packet communication, B is the number of slave devices whose second communication type is long packet communication, and the first setting value may be 0. Illustratively, at a certain time, the slave device X initiates an advertisement to the master device, the master device MCU calls a pre-stored resource in the memory, and finds that at this time, a slave devices are performing short packet communication, B slave devices are performing long packet communication, and the slave device X belongs to long packet communication, then the first connection interval of the slave device X needs to satisfy D1 ≧ T × a (B + 1).
Optionally, after determining the first connection interval and the first response delay corresponding to the newly accessed slave device according to the first communication type, the number of the accessed slave devices, and the second communication type, a manner of adjusting the connection interval and the response delay corresponding to the slave device according to the validity information may be: if the validity information indicates that the set number of data packets are all null data packets, the first connection interval corresponding to the slave device is adjusted to be the second connection interval, and the first response delay is adjusted to be the second response delay.
Wherein the second connection interval is greater than the first connection interval and the second response delay is greater than the first response delay. In this embodiment, if the validity information indicates that all the set number of data packets are null data packets, the connection interval and the response delay need to be increased. The second response delay may be set to 1.
Optionally, after determining the first connection interval and the first response delay corresponding to the newly accessed slave device according to the first communication type, the number of the accessed slave devices, and the second communication type, a manner of adjusting the connection interval and the response delay corresponding to the slave device according to the validity information may be: if the validity information is that at least one valid data packet is included in the data packets with the set number, the first connection interval corresponding to the slave device is adjusted to be the zeroth connection interval, and the first response delay is adjusted to be the zeroth response delay.
Wherein the zeroth connection interval is less than the first connection interval and the zeroth response delay is less than or equal to the first response delay. If the first response delay is set to 0, the zeroth response delay is still 0. The zeroth connection interval may be a minimum interval specified by the bluetooth protocol, and may be determined according to the number of connected slave devices and the communication type. For example, if the slave device is of a short packet communication type, the formula of the zeroth connection interval is D0 ═ T (a +1) 2/a; if the slave device is of a long packet communication type, the calculation formula of the zeroth connection interval is D0 ═ T × a (B + 1); wherein, T is the maximum communication processing capability parameter, a is the number of slave devices whose second communication type is short packet communication, and B is the number of slave devices whose second communication type is long packet communication.
Optionally, after adjusting the first connection interval corresponding to the slave device to be the second connection interval and adjusting the first response delay to be the second response delay, the manner of adjusting the connection interval and the response delay corresponding to the slave device according to the validity information may be: and if the validity information indicates that the set number of data packets are all empty data packets, determining that the slave device is in an idle state, adjusting a second connection interval corresponding to the slave device to a third connection interval, and adjusting the second response delay to a third response delay.
Wherein the third connection interval and the third response delay satisfy the following condition: d3 ≦ protocol sleep time (L3+1), D3 is the third connection interval, and L3 is the third response delay.
Optionally, after determining that the slave device is in the idle state, the method further includes the following steps: and if the connection parameter updating request of the slave equipment in the idle state is received, adjusting a third connection interval corresponding to the slave equipment to be the first connection interval, and adjusting a third response delay to be the first response delay.
In this embodiment, when the master device determines that the slave device is in an idle state and the slave device needs to transmit data, the slave device triggers and wakes up through a General Purpose Input/Output (GPIO) to send a connection parameter update request to the master device, so that the master device adjusts a third connection interval corresponding to the slave device to a first connection interval according to the connection parameter update request and adjusts a third response delay to a first response delay.
Optionally, after adjusting the first connection interval corresponding to the slave device to be the second connection interval and adjusting the first response delay to be the second response delay, the manner of adjusting the connection interval and the response delay corresponding to the slave device according to the validity information may be: and if the validity information is that at least one valid data packet is included in the data packets with the set number, adjusting the second connection interval corresponding to the slave device to be the first connection interval, and adjusting the second response delay to be the first response delay.
Optionally, after adjusting the first connection interval corresponding to the slave device to be the zeroth connection interval and adjusting the first response delay to be the zeroth response delay, the manner of adjusting the connection interval and the response delay corresponding to the slave device according to the validity information may be: if the validity information indicates that the set number of data packets are all null data packets, the zeroth connection interval corresponding to the slave device is adjusted to be the first connection interval, and the zeroth response delay is adjusted to be the first response delay.
In this embodiment, T < zeroth connection interval < first connection interval < second connection interval < < protocol maximum sleep time. T is the maximum communication processing capability parameter of the host device, i.e. the minimum time interval for the host device to process 1 piece of data.
According to the technical scheme of the embodiment, the effectiveness information of a set number of data packets continuously transmitted by slave equipment is monitored; the validity information comprises a null data packet or a valid data packet; and adjusting the connection interval and the response delay corresponding to the slave equipment according to the validity information. According to the control method for the Bluetooth connection, provided by the embodiment of the invention, the connection interval and the response delay corresponding to the slave equipment are adjusted based on the validity information of the data packets with the continuously set number, so that the connection parameters between the master equipment and the slave equipment can be dynamically adjusted, and the stability of the Bluetooth connection is ensured.
Example two
Fig. 2 is a schematic structural diagram of a bluetooth connection control apparatus according to a second embodiment of the present invention, where the apparatus is disposed in a master device, and the master device establishes a bluetooth connection with at least one slave device, and the apparatus includes:
a packet validity information monitoring module 210, configured to monitor validity information of a set number of packets continuously transmitted from a slave device; the validity information comprises a null data packet or a valid data packet;
and an adjusting module 220, configured to adjust a connection interval and a response delay corresponding to the slave device according to the validity information.
Optionally, the adjusting module 220 is further configured to:
if the validity information indicates that the data packets with the set number are all empty data packets, the connection interval and the response delay corresponding to the slave equipment are increased;
and if the validity information is that at least one valid data packet is contained in the data packets with the set number, reducing the connection interval and response delay corresponding to the slave equipment.
Optionally, the method further includes: a first connection interval and first response delay determination module to:
when the master equipment establishes connection with the newly accessed slave equipment, acquiring a first communication type between the master equipment and the newly accessed slave equipment;
acquiring the number of accessed slave devices and a second communication type between each accessed slave device;
determining a first connection interval and a first response delay corresponding to the newly accessed slave equipment according to the first communication type, the number of the accessed slave equipment and the second communication type; the communication types include short packet communication and long packet communication.
Optionally, the first connection interval and first response delay determining module is further configured to:
acquiring a maximum communication processing capacity parameter of the main equipment;
if the first communication type is short packet communication, determining a first connection interval according to the following formula: the first connection interval is not less than T (A +1)2A, and setting the first response delay to a first set value; wherein, T is the parameter of the maximum communication processing capacity, A is the number of the slave devices of which the second communication type is short packet communication;
if the first communication type is long packet communication, determining a first connection interval according to the following formula: the first connection interval is greater than or equal to T × A (B +1), and the first response delay is set to a first set value; wherein, T is the maximum communication processing capability parameter, a is the number of slave devices whose second communication type is short packet communication, and B is the number of slave devices whose second communication type is long packet communication.
Optionally, after determining the first connection interval and the first response delay corresponding to the newly accessed slave device according to the first communication type, the number of accessed slave devices, and the second communication type, the adjusting module 220 is further configured to:
if the validity information indicates that the data packets with the set number are all null data packets, adjusting the first connection interval corresponding to the slave device to be a second connection interval, and adjusting the first response delay to be a second response delay; wherein the second connection interval is greater than the first connection interval and the second response delay is greater than the first response delay;
if the validity information is that at least one valid data packet is included in the data packets with the set number, adjusting the first connection interval corresponding to the slave device to be a zeroth connection interval, and adjusting the first response delay to be a zeroth response delay; wherein the zeroth connection interval is less than the first connection interval and the zeroth response delay is less than or equal to the first response delay.
Optionally, after adjusting the first connection interval corresponding to the slave device to be the second connection interval and adjusting the first response delay to be the second response delay, the adjusting module 220 is further configured to:
if the validity information indicates that the set number of data packets are all empty data packets, the slave device is determined to be in an idle state, a second connection interval corresponding to the slave device is adjusted to be a third connection interval, and a second response delay is adjusted to be a third response delay; wherein the third connection interval and the third response delay satisfy the following condition: d3 ≦ L3+1 protocol sleep time; d3 is the third connection interval and L3 is the third response delay;
and if the validity information is that at least one valid data packet is included in the data packets with the set number, adjusting the second connection interval corresponding to the slave device to be the first connection interval, and adjusting the second response delay to be the first response delay.
Optionally, the method further includes: a connection parameter update request receiving module, configured to:
and if the connection parameter updating request of the slave equipment in the idle state is received, adjusting a third connection interval corresponding to the slave equipment to be the first connection interval, and adjusting a third response delay to be the first response delay.
Optionally, after adjusting the first connection interval corresponding to the slave device to be the zeroth connection interval and adjusting the first response delay to be the zeroth response delay, the adjusting module 220 is further configured to:
if the validity information indicates that the set number of data packets are all null data packets, the zeroth connection interval corresponding to the slave device is adjusted to be the first connection interval, and the zeroth response delay is adjusted to be the first response delay.
The device can execute the methods provided by all the embodiments of the invention, and has corresponding functional modules and beneficial effects for executing the methods. For details not described in detail in this embodiment, reference may be made to the methods provided in all the foregoing embodiments of the present invention.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a computer device according to a third embodiment of the present invention. FIG. 3 illustrates a block diagram of a computer device 312 suitable for use in implementing embodiments of the present invention. The computer device 312 shown in FIG. 3 is only an example and should not bring any limitations to the functionality or scope of use of embodiments of the present invention. Device 312 is a computing device that controls functions of a typical bluetooth connection.
As shown in FIG. 3, computer device 312 is in the form of a general purpose computing device. The components of computer device 312 may include, but are not limited to: one or more processors 316, a storage device 328, and a bus 318 that couples the various system components including the storage device 328 and the processors 316.
The computer device 312 may also communicate with one or more external devices 314 (e.g., keyboard, pointing device, camera, display 324, etc.), with one or more devices that enable a user to interact with the computer device 312, and/or with any devices (e.g., network card, modem, etc.) that enable the computer device 312 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 322. Also, computer device 312 may communicate with one or more networks (e.g., a Local Area Network (LAN), Wide Area Network (WAN), etc.) and/or a public Network, such as the internet, via Network adapter 320. As shown, network adapter 320 communicates with the other modules of computer device 312 via bus 318. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the computer device 312, including but not limited to: microcode, device drivers, Redundant processing units, external disk drive Arrays, disk array (RAID) systems, tape drives, and data backup storage systems, to name a few.
The processor 316 executes various functional applications and data processing by executing programs stored in the storage 328, for example, implementing the control method of bluetooth connection provided by the above-described embodiment of the present invention.
Example four
An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processing apparatus, implements a control method of bluetooth connection as in the embodiment of the present invention. The computer readable medium of the present invention described above may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: monitoring validity information of a set number of data packets continuously transmitted with the slave device; wherein the validity information comprises a null data packet or a valid data packet; and adjusting the connection interval and the response delay corresponding to the slave equipment according to the validity information.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of an element does not in some cases constitute a limitation on the element itself.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims (10)
1. A method for controlling bluetooth connection, the method being performed by a master device, the master device establishing a bluetooth connection with at least one slave device, comprising:
monitoring validity information of a set number of data packets continuously transmitted with the slave device; wherein the validity information comprises a null data packet or a valid data packet;
and adjusting the connection interval and the response delay corresponding to the slave equipment according to the validity information.
2. The method of claim 1, wherein adjusting the connection interval and response delay corresponding to the slave device according to the validity information comprises:
if the validity information indicates that the set number of data packets are all null data packets, increasing the connection interval and response delay corresponding to the slave device;
and if the validity information is that at least one valid data packet is contained in the data packets with the set number, reducing the connection interval and response delay corresponding to the slave equipment.
3. The method of claim 1, further comprising, prior to monitoring validity information for a set number of consecutive transmissions of data packets with the slave device:
when the master equipment establishes connection with the newly accessed slave equipment, acquiring a first communication type between the master equipment and the newly accessed slave equipment;
acquiring the number of accessed slave devices and a second communication type between the accessed slave devices;
determining a first connection interval and a first response delay corresponding to the newly accessed slave equipment according to the first communication type, the number of the accessed slave equipment and the second communication type; the communication types include short packet communication and long packet communication.
4. The method of claim 3, wherein determining the first connection interval and the first response delay corresponding to the newly accessed slave device according to the first communication type, the number of accessed slave devices and the second communication type comprises:
acquiring a maximum communication processing capacity parameter of the main equipment;
if the first communication type is short packet communication, determining a first connection interval according to the following formula: the first connection interval is not less than T (A +1)2A, and setting the first response delay to a first set value; wherein, T is the parameter of the maximum communication processing capacity, A is the number of the slave devices of which the second communication type is short packet communication;
if the first communication type is long packet communication, determining a first connection interval according to the following formula: the first connection interval is greater than or equal to T × A (B +1), and the first response delay is set to a first set value; wherein, T is the maximum communication processing capability parameter, a is the number of slave devices whose second communication type is short packet communication, and B is the number of slave devices whose second communication type is long packet communication.
5. The method of claim 3, wherein after determining a first connection interval and a first response delay corresponding to the newly accessed slave device according to the first communication type, the number of accessed slave devices, and the second communication type, adjusting the connection interval and the response delay corresponding to the slave device according to the validity information comprises:
if the validity information indicates that the set number of data packets are all null data packets, adjusting the first connection interval corresponding to the slave device to be a second connection interval, and adjusting the first response delay to be a second response delay; wherein the second connection interval is greater than the first connection interval, the second response delay is greater than the first response delay;
if the validity information indicates that the set number of data packets contains at least one valid data packet, adjusting a first connection interval corresponding to the slave device to a zeroth connection interval, and adjusting a first response delay to a zeroth response delay; wherein the zeroth connection interval is less than the first connection interval and the zeroth response delay is less than or equal to the first response delay.
6. The method of claim 5, wherein adjusting the connection interval and the response delay corresponding to the slave device according to the validity information after adjusting the first connection interval corresponding to the slave device to be the second connection interval and adjusting the first response delay to be the second response delay comprises:
if the validity information indicates that the set number of data packets are all empty data packets, determining that the slave device is in an idle state, adjusting a second connection interval corresponding to the slave device to a third connection interval, and adjusting a second response delay to a third response delay; wherein the third connection interval and the third response delay satisfy the following condition: d3 ≦ L3+1 protocol sleep time; d3 is the third connection interval and L3 is the third response delay;
if the validity information indicates that the set number of data packets includes at least one valid data packet, adjusting a second connection interval corresponding to the slave device to be a first connection interval, and adjusting a second response delay to be a first response delay.
7. The method of claim 6, further comprising, after determining the slave device to be in an idle state:
and if a connection parameter updating request of the slave equipment in an idle state is received, adjusting a third connection interval corresponding to the slave equipment to be the first connection interval, and adjusting a third response delay to be the first response delay.
8. The method of claim 5, wherein after adjusting the first connection interval corresponding to the slave device to the connection interval of zero and the first response delay to the response delay of zero, adjusting the connection interval and the response delay corresponding to the slave device according to the validity information comprises:
if the validity information indicates that the set number of data packets are all null data packets, adjusting the zeroth connection interval corresponding to the slave device to be the first connection interval, and adjusting the zeroth response delay to be the first response delay.
9. A control device of Bluetooth connection, wherein the device is disposed in a master device, and the master device establishes Bluetooth connection with at least one slave device, comprising:
the data packet validity information monitoring module is used for monitoring validity information of a set number of data packets continuously transmitted with the slave equipment; wherein the validity information comprises a null data packet or a valid data packet;
and the adjusting module is used for adjusting the connection interval and the response delay corresponding to the slave equipment according to the validity information.
10. A computer device, the device comprising: comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of controlling a bluetooth connection according to any one of claims 1 to 8 when executing the program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111264788.3A CN114095907A (en) | 2021-10-28 | 2021-10-28 | Bluetooth connection control method, device and equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111264788.3A CN114095907A (en) | 2021-10-28 | 2021-10-28 | Bluetooth connection control method, device and equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114095907A true CN114095907A (en) | 2022-02-25 |
Family
ID=80298039
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111264788.3A Pending CN114095907A (en) | 2021-10-28 | 2021-10-28 | Bluetooth connection control method, device and equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114095907A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114286433A (en) * | 2022-03-07 | 2022-04-05 | 荣耀终端有限公司 | Method for reducing power consumption of equipment and electronic equipment |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110021142A1 (en) * | 2009-07-24 | 2011-01-27 | Prasanna Desai | Method and system for a dual-mode bluetooth low energy device |
CN107087254A (en) * | 2017-06-30 | 2017-08-22 | 北京小米移动软件有限公司 | Give out a contract for a project method, device and bluetooth low energy consumption slave unit |
CN109286919A (en) * | 2017-07-20 | 2019-01-29 | 展讯通信(上海)有限公司 | BLE equipment and its data packet receiving method, computer readable storage medium |
CN111163450A (en) * | 2019-12-26 | 2020-05-15 | 重庆物奇科技有限公司 | Equipment communication method and system for wireless communication system |
CN111277987A (en) * | 2020-03-17 | 2020-06-12 | 北京百瑞互联技术有限公司 | Method for dynamically negotiating Bluetooth connection interval |
CN111491284A (en) * | 2020-06-28 | 2020-08-04 | 深圳市中科蓝讯科技股份有限公司 | Bluetooth B L E time delay optimization method, equipment and storage medium |
CN112367647A (en) * | 2020-09-27 | 2021-02-12 | 浙江三维万易联科技有限公司 | Bluetooth connection parameter updating method and device, Bluetooth system and storage medium |
CN113206687A (en) * | 2020-12-31 | 2021-08-03 | 珠海市杰理科技股份有限公司 | Bluetooth communication method, Bluetooth slave device, Bluetooth communication system, and storage medium |
-
2021
- 2021-10-28 CN CN202111264788.3A patent/CN114095907A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110021142A1 (en) * | 2009-07-24 | 2011-01-27 | Prasanna Desai | Method and system for a dual-mode bluetooth low energy device |
CN107087254A (en) * | 2017-06-30 | 2017-08-22 | 北京小米移动软件有限公司 | Give out a contract for a project method, device and bluetooth low energy consumption slave unit |
CN109286919A (en) * | 2017-07-20 | 2019-01-29 | 展讯通信(上海)有限公司 | BLE equipment and its data packet receiving method, computer readable storage medium |
CN111163450A (en) * | 2019-12-26 | 2020-05-15 | 重庆物奇科技有限公司 | Equipment communication method and system for wireless communication system |
CN111277987A (en) * | 2020-03-17 | 2020-06-12 | 北京百瑞互联技术有限公司 | Method for dynamically negotiating Bluetooth connection interval |
CN111491284A (en) * | 2020-06-28 | 2020-08-04 | 深圳市中科蓝讯科技股份有限公司 | Bluetooth B L E time delay optimization method, equipment and storage medium |
CN112367647A (en) * | 2020-09-27 | 2021-02-12 | 浙江三维万易联科技有限公司 | Bluetooth connection parameter updating method and device, Bluetooth system and storage medium |
CN113206687A (en) * | 2020-12-31 | 2021-08-03 | 珠海市杰理科技股份有限公司 | Bluetooth communication method, Bluetooth slave device, Bluetooth communication system, and storage medium |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114286433A (en) * | 2022-03-07 | 2022-04-05 | 荣耀终端有限公司 | Method for reducing power consumption of equipment and electronic equipment |
CN114286433B (en) * | 2022-03-07 | 2022-07-12 | 荣耀终端有限公司 | Method for reducing power consumption of equipment and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110391873B (en) | Method, apparatus and computer program product for determining a data transfer mode | |
CN110781373A (en) | List updating method and device, readable medium and electronic equipment | |
CN110795446A (en) | List updating method and device, readable medium and electronic equipment | |
CN111246228A (en) | Method, device, medium and electronic equipment for updating gift resources of live broadcast room | |
CN113760536A (en) | Data caching method and device, electronic equipment and computer readable medium | |
CN109428926B (en) | Method and device for scheduling task nodes | |
CN114095907A (en) | Bluetooth connection control method, device and equipment | |
CN113760498A (en) | Message consumption method, device, electronic equipment and computer readable medium | |
CN112418389A (en) | Data processing method and device, electronic equipment and computer readable storage medium | |
CN111756833B (en) | Node processing method, node processing device, electronic equipment and computer readable medium | |
CN112817701B (en) | Timer processing method, device, electronic equipment and computer readable medium | |
CN112163176A (en) | Data storage method and device, electronic equipment and computer readable medium | |
CN113824675B (en) | Method and device for managing login state | |
CN112527454A (en) | Container group scheduling method and device, electronic equipment and computer readable medium | |
CN112860431A (en) | Connection method, system, equipment and storage medium of micro service node | |
CN111698132B (en) | Method, apparatus, device and medium for controlling heartbeat events in a cluster | |
CN117170986B (en) | Chip consistency processing system, method, device, equipment and medium thereof | |
CN114745276B (en) | Switch bandwidth adjusting method and device, electronic equipment and computer readable medium | |
CN113704076B (en) | Task optimization method and device, electronic equipment and computer readable medium | |
CN112685455B (en) | Real-time data classification display method and device, electronic equipment and readable medium | |
CN111246229B (en) | Method, device, medium and electronic equipment for updating gift resources of live broadcast room | |
CN112235167B (en) | Flow alarm method, device, electronic equipment and computer readable medium | |
CN117938865A (en) | Service request execution method and device, electronic equipment and readable medium | |
CN111949833A (en) | Index construction method, data processing method, device, electronic equipment and medium | |
CN115269645A (en) | Information query method and device, electronic equipment and computer readable medium |
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 |