CN111741456A - Bluetooth device, Bluetooth preemption method and device thereof, and computer-readable storage medium - Google Patents

Bluetooth device, Bluetooth preemption method and device thereof, and computer-readable storage medium Download PDF

Info

Publication number
CN111741456A
CN111741456A CN202010551524.5A CN202010551524A CN111741456A CN 111741456 A CN111741456 A CN 111741456A CN 202010551524 A CN202010551524 A CN 202010551524A CN 111741456 A CN111741456 A CN 111741456A
Authority
CN
China
Prior art keywords
bluetooth
bluetooth module
external
connection
currently connected
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
CN202010551524.5A
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.)
Chengdu Jimi Technology Co Ltd
Chengdu XGIMI Technology Co Ltd
Original Assignee
Chengdu Jimi 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 Chengdu Jimi Technology Co Ltd filed Critical Chengdu Jimi Technology Co Ltd
Priority to CN202010551524.5A priority Critical patent/CN111741456A/en
Publication of CN111741456A publication Critical patent/CN111741456A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/16Discovering, processing access restriction or access information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup

Abstract

The application discloses a Bluetooth device, a Bluetooth preemption method and device thereof and a computer readable storage medium. The Bluetooth device comprises a Bluetooth module, the Bluetooth module is used for establishing Bluetooth connection with the external device, the Bluetooth device locally stores a device type table indicating the priority of the device type for Bluetooth preemption and/or a connection device table indicating the external device currently connected with the Bluetooth module, and the method comprises the following steps: receiving a message sent by a Bluetooth module; judging whether the device type of the new external device can be acquired from the received message; and if the device type of the new external device is acquired and the Bluetooth module is currently connected with the external device, inquiring the device type table and/or the connection device table, and controlling the Bluetooth module to establish the connection of the new external device according to the device type table and/or the connection device table. This application has realized that the bluetooth is preempted, and whole process does not need the manual operation, uses more convenient comfortable, and this application preempts speed fast enough, experiences better.

Description

Bluetooth device, Bluetooth preemption method and device thereof, and computer-readable storage medium
Technical Field
The present application relates to the field of bluetooth communications, and in particular, to a bluetooth device, a bluetooth preemption method and apparatus thereof, and a computer-readable storage medium.
Background
Equipment accessible such as cell-phone is from audio equipment broadcast audio data such as music, but, people are more and more high to the pursuit of sound effect, and in order to reach better audio playback effect, the user can connect external bluetooth sound equipment through the bluetooth, utilizes audio data such as external bluetooth sound equipment broadcast music.
The bluetooth communication technology is a commonly used short-distance wireless communication technology, and bluetooth communication connection can be established between bluetooth equipment equipped with a bluetooth module and other external equipment supporting bluetooth functions through the bluetooth module so as to communicate with the external equipment, and the functions of the external equipment are used or the external equipment is enabled to use the functions of the bluetooth equipment. And disconnecting the currently connected external equipment, and continuing to connect the new external equipment, wherein the process is called Bluetooth preemption. Under the condition that the existing Bluetooth equipment is connected with external audio equipment, the new external audio equipment can only be paired, and finally, audio connection cannot be established and cannot be preempted. Although some bluetooth devices support the simultaneous connection of a plurality of external bluetooth audio devices, the number of external audio devices that can be connected is limited, and when the number exceeds the number, new external audio devices can only be paired, and finally, audio connection cannot be established, and preemption cannot be achieved. Because bluetooth communication resources are very limited, if a new external device wants to establish an audio connection, it is necessary to manually disconnect a currently connected external audio device from the bluetooth connection of the bluetooth device and then establish a connection with the new external device.
Disclosure of Invention
In view of the above, the present application provides a bluetooth device, a bluetooth preemption method and apparatus thereof, and a computer-readable storage medium.
In a first aspect, the present application provides a bluetooth preemption method for a bluetooth device, where the bluetooth device includes a bluetooth module, the bluetooth module is configured to establish a bluetooth connection with an external device, and the bluetooth device locally stores a device type table for indicating a device type priority for bluetooth preemption, and the method includes:
receiving a message sent by a Bluetooth module;
judging whether the device type of the new external device can be acquired from the received message;
and if the device type of the new external device is acquired and the Bluetooth module is currently connected with the external device, inquiring a device type table, and controlling the Bluetooth module to establish the connection of the new external device according to the device type priority in the device type table.
In one possible design, the device type table includes device types and a priority class indicating whether to monopolize the bluetooth link, and the controlling the bluetooth module to establish a connection with a new external device according to the device type priorities in the device type table includes:
if the priority class of the new external equipment is exclusive, controlling the Bluetooth module to disconnect all the currently connected external equipment and establishing the connection of the new external equipment;
and if the priority class of the new external equipment is non-exclusive and the number of the external equipment currently connected with the Bluetooth module is less than the maximum number of the external equipment capable of being connected with the Bluetooth module, controlling the Bluetooth module to establish the connection of the new external equipment.
In another possible design, the device type table includes a device type and a priority level for indicating a priority level, the bluetooth device further locally stores a connection device table indicating the external device currently connected to the bluetooth module, where the connection device table includes device types of the external devices currently connected to the bluetooth module, and the controlling the bluetooth module to establish connection with a new external device according to the device type priority in the device type table includes:
inquiring a connection device table, and counting the number of external devices currently connected with the Bluetooth module;
if the number of the external devices currently connected with the Bluetooth module is less than the maximum number of the external devices capable of being connected with the Bluetooth module, controlling the Bluetooth module to establish connection of new external devices;
if the number of the external devices currently connected with the Bluetooth module is equal to the maximum number of the external devices capable of being connected with the Bluetooth module, judging whether the priority level of the new external device is higher than that of the external device currently connected with the Bluetooth module;
and if the priority level of the new external equipment is at least higher than that of the currently connected external equipment or the currently connected external equipment with the priority level same as that of the new external equipment exists, controlling the Bluetooth module to disconnect the external equipment with the lowest priority level in the currently connected external equipment and establish the connection of the new external equipment.
Optionally, the connection device table further includes connection time of each external device currently connected, and the controlling the bluetooth module to disconnect the external device with the lowest priority level in the external devices currently connected includes:
and if a plurality of currently connected external devices with the lowest priority level exist, controlling the Bluetooth module to disconnect the currently connected external device with the longest or shortest connection time in the lowest priority level.
Optionally, the external device is an external audio device.
Optionally, the bluetooth preemption method further includes:
and after the new external equipment is disconnected, controlling the Bluetooth module to reconnect the disconnected external equipment.
In a second aspect, the present application provides another bluetooth preemption method for a bluetooth device, where the bluetooth device includes a bluetooth module, the bluetooth module is configured to establish a bluetooth connection with an external device, and the bluetooth device locally stores a connection device table indicating the external device currently connected to the bluetooth module, where the connection device table includes device types of the external devices currently connected to the bluetooth module and connection times and/or priority levels of the external devices, and the method includes:
receiving a message sent by a Bluetooth module;
judging whether the device type of the new external device can be acquired from the received message;
if the device type of the new external device is obtained, inquiring a connected device table, and counting the number of the external devices currently connected with the Bluetooth module;
if the number of the external devices currently connected with the Bluetooth module is less than the maximum number of the external devices capable of being connected with the Bluetooth module, controlling the Bluetooth module to establish connection of new external devices;
if the number of the external devices currently connected with the Bluetooth module is equal to the maximum number of the external devices capable of being connected with the Bluetooth module, the Bluetooth module is controlled to disconnect one currently connected external device with the longest connection time or the shortest connection time or the lowest priority level, and the connection of a new external device is established.
In one possible design, the controlling the bluetooth module to disconnect a currently connected external device with the longest connection time or the shortest connection time or the lowest priority level and establish a connection with a new external device includes:
judging whether the equipment type of the new external equipment is a preset type or not;
and when the device type of the new external device is a preset type, controlling the Bluetooth module to disconnect the currently connected external device with the longest or shortest connection time or the lowest priority level, and establishing the connection of the new external device.
Optionally, the external device is an external audio device.
In a third aspect, the present application provides a bluetooth preemption device for a bluetooth device, where the bluetooth device includes a bluetooth module, the bluetooth module is configured to establish a bluetooth connection with an external device, and the bluetooth device locally stores a device type table for indicating a device type priority for bluetooth preemption, and the device includes:
the receiving unit is used for receiving the message sent by the Bluetooth module;
and the preemption unit is used for judging whether the equipment type of the new external equipment can be acquired from the received message, inquiring the equipment type table if the equipment type of the new external equipment is acquired and the Bluetooth module is currently connected with the external equipment, and controlling the Bluetooth module to establish the connection of the new external equipment according to the equipment type priority in the equipment type table.
In a fourth aspect, the present application provides another bluetooth preemption device for a bluetooth device, where the bluetooth device includes a bluetooth module, the bluetooth module is configured to establish a bluetooth connection with an external device, and the bluetooth device locally stores a connection device table indicating the external device currently connected to the bluetooth module, where the connection device table includes device types of the external devices currently connected to each bluetooth device and connection times and/or priority levels of the external devices, and the device includes:
the receiving unit is used for receiving the message sent by the Bluetooth module;
the preemption unit is used for judging whether the equipment type of the new external equipment can be acquired from the received message; if the device type of the new external device is obtained, inquiring a connected device table, and counting the number of the external devices currently connected with the Bluetooth module; if the number of the external devices currently connected with the Bluetooth module is less than the maximum number of the external devices capable of being connected with the Bluetooth module, controlling the Bluetooth module to establish connection of new external devices; if the number of the external devices currently connected with the Bluetooth module is equal to the maximum number of the external devices capable of being connected with the Bluetooth module, the Bluetooth module is controlled to disconnect one currently connected external device with the longest connection time or the shortest connection time or the lowest priority level, and the connection of a new external device is established.
In a fifth aspect, the present application provides a bluetooth device, including a bluetooth module, where the bluetooth device locally stores a device type table for indicating a device type priority for bluetooth preemption, and the bluetooth device further includes a preemption module in communication connection with the bluetooth module, where the bluetooth module is configured to establish bluetooth connection with an external device and execute a corresponding operation according to control of the preemption module;
the preemption module is configured to perform the bluetooth preemption method as described in the first aspect or any of its possible implementations.
In a sixth aspect, the present application provides another bluetooth device, including a bluetooth module, where the bluetooth device locally stores a connection device table indicating external devices currently connected to the bluetooth module, where the connection device table includes device types of the external devices currently connected to the bluetooth module and connection time and/or priority levels of the external devices, and the bluetooth device further includes a preemption module in communication connection with the bluetooth module, where the bluetooth module is configured to establish bluetooth connection with the external devices and execute corresponding operations according to control of the preemption module;
the preemption module is configured to perform the bluetooth preemption method as described in the second aspect or any of its possible implementations.
In a seventh aspect, the present application provides a computer-readable storage medium comprising computer instructions that, when executed by a processor, may implement the bluetooth preemption method as described in the first aspect, the second aspect, any of the possible implementations of the first aspect, or any of the possible implementations of the second aspect.
It should be noted that, in the present application, the bluetooth preemption device of the third aspect and the fourth aspect, the bluetooth device of the fifth aspect and the sixth aspect, and the computer-readable storage medium of the seventh aspect are used to execute the method provided in the first aspect or the second aspect, so that the same beneficial effects as those of the method in the first aspect or the second aspect can be achieved, and no further description is given in this application embodiment.
This application has realized that the bluetooth is preempted, when new external equipment wants to connect bluetooth equipment, does not need the external equipment of artificial disconnection current connection, after this new external equipment disconnection, but the external equipment that is disconnected of automatic connection, whole process does not need the manual operation, uses more convenient comfortable, and the speed of preempting of this application is fast enough, experiences better.
Drawings
The present application will now be described by way of example only and with reference to the accompanying drawings in which:
fig. 1 is a flowchart of a bluetooth preemption method for a bluetooth device according to an embodiment of the present application;
fig. 2 is a flowchart of a bluetooth preemption method for a bluetooth device according to another embodiment of the present application.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
All other embodiments, which can be derived by a person skilled in the art from the exemplary embodiments shown in the present application without inventive effort, shall fall within the scope of protection of the present application. Moreover, while the disclosure herein has been presented in terms of exemplary one or more examples, it is to be understood that each aspect of the disclosure can be utilized independently and separately from other aspects of the disclosure to provide a complete disclosure.
In the embodiments of the present application, the words "exemplary," "for example," and the like are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, the term using examples is intended to present concepts in a concrete fashion.
Unless defined otherwise, technical or scientific terms used herein shall have the ordinary meaning as understood by one of ordinary skill in the art to which this application belongs. The use of "first," "second," and similar terms in this application do not denote any order, quantity, or importance, but rather the description is used to distinguish one element from another. The terms "comprises" and "comprising," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a product or apparatus that comprises a list of elements is not necessarily limited to those elements explicitly listed, but may include other elements not expressly listed or inherent to such product or apparatus.
The term "remote control" as used herein refers to a component of an electronic device (e.g., a bluetooth device as disclosed herein) that is typically wirelessly controllable over a relatively short range. Typically using infrared and/or Radio Frequency (RF) signals and/or bluetooth to connect with the electronic device, and may also include WiFi, wireless USB, bluetooth, motion sensor, etc. The term "new external device" is used only to distinguish "currently connected external device".
In the following embodiments, a bluetooth device refers to an electronic device including a bluetooth module, and through the bluetooth module, the bluetooth device may establish a bluetooth connection with other external devices supporting a bluetooth function. Since the external device is a device supporting the bluetooth function, the external device is also a bluetooth device. In some embodiments, the bluetooth device may further include a passive NFC tag or an active NFC tag, the bluetooth MAC address of the bluetooth device is stored in the NFC tag, and after the bluetooth device touches the external device with the NFC function and supporting the bluetooth function, the external device may be connected by taking the bluetooth MAC address, if the external device and the bluetooth device are not connected, the bluetooth device or the external device may initiate scanning pairing first, and establish connection after pairing is successful, and after connection is successful, the external device may use a function of the external device or use a function of the bluetooth device.
After the traditional Bluetooth equipment is started, certain keys are required to be triggered again to enter a connectable mode, at the moment, the external equipment can search the Bluetooth equipment in a Bluetooth list and carry out pairing connection, and under the condition that pairing is not removed, both sides are started next time, and the external equipment can be connected back to continue to be used in a single mode. Generally, after the bluetooth device is connected, other external devices cannot be searched, because the bluetooth device is in an undiscoverable state.
The bluetooth device with the passive NFC tag needs to be connected to the external device, and the mode needs to be set to be discoverable first, and because the external device touches the passive NFC tag, the bluetooth device does not know, so the bluetooth device needs to be discoverable all the time. The Bluetooth device with the active NFC label only needs to be in a starting mode, and the external device can be connected by touching the NFC label.
After the external device is started, the Bluetooth is set to be discoverable, and the Bluetooth name is set, so that the Bluetooth device can be connected with the external device, and the method comprises two steps:
1) opening the Bluetooth, entering a Bluetooth setting to search the Bluetooth of the external equipment, and clicking connection;
2) and opening the NFC of the Bluetooth device, and connecting the Bluetooth device with the NFC label of the external device by touching the NFC label.
In general, the connection procedure of bluetooth can be divided into:
ACL connection phase, namely Bluetooth link layer connection establishment phase. The Bluetooth device is connected for the first time, and at this stage, the Bluetooth device cannot acquire any other effective information except the MAC address of the external device.
2. And (5) a centering stage. At this stage the bluetooth device can access the device type of the external device (e.g. phone, headset, handle, etc.).
3. A paired stage. After the pairing is completed, the external device support profile type list can be acquired according to the uuids of the external device, and preparation is made for next profile connection.
Profile is in the connection phase. And establishing audio connection, wherein the profile represents that the external equipment has certain type of capability, and the connection is carried out according to the profile type.
Profile connected phase. After the connection is successful, the Bluetooth device can have corresponding functions, for example, after the A2dpSinkProfile is connected, the Bluetooth device plays music and can make a sound at an external device.
The external device is connected for the first time through all stages 1-5, and the external device which is paired is connected again to be called back to be connected, and only three stages 1, 4 and 5 are needed. In order to achieve a better experience, the preemption speed must be fast enough, so the preemption timing needs to be as early as possible. The method and the device realize preemption in the stage 1 or the stage 2 by judging whether the device type of the external device can be acquired.
Fig. 1 is a flowchart of a bluetooth preemption method for a bluetooth device according to an embodiment of the present application, where in the embodiment, a device type table is locally stored in the bluetooth device and used for indicating a device type priority for performing bluetooth preemption. As shown in fig. 1, the bluetooth preemption method includes:
receiving a message sent by a Bluetooth module, illustratively comprising:
1) ACL connection stage, receive the already set up broadcast of the connection path (set up the connection path);
2) a pairing stage, wherein a pairing broadcast (pairing) is received;
3) a paired stage, receiving a paired broadcast (paired);
4) the profile is in the connection stage, and the audio connection is received and broadcast (the audio connection is being established);
5) profile connected phase, audio connection connected broadcast is received (audio connection established).
And judging whether the device type of the new external device can be acquired from the received message, if the device type of the new external device is acquired and the Bluetooth module is currently connected with the external device, inquiring a device type table, and controlling the Bluetooth module to establish the connection of the new external device according to the device type priority in the device type table. Otherwise, continuing to receive the message sent by the Bluetooth module.
In some embodiments, the device type table includes device types and priority classes for indicating whether to monopolize the bluetooth link, illustratively as shown in table 1. After the device type of the new external device is obtained, if the Bluetooth module is currently connected with the external device, inquiring a device type table, and if the priority class of the new external device is exclusive, controlling the Bluetooth module to disconnect all currently connected external devices and establishing the connection of the new external device; and if the priority class of the new external equipment is non-exclusive and the number of the external equipment currently connected with the Bluetooth module is less than the maximum number of the external equipment capable of being connected with the Bluetooth module, controlling the Bluetooth module to establish the connection of the new external equipment.
TABLE 1
Type of device Priority classes
Earphone set Monopolizing
Sound box Non-exclusive
In some embodiments, the device type table includes device types and priority levels indicating the priority levels are low, illustratively as shown in table 2, where lower numbers of priority levels represent higher levels. The bluetooth device also locally stores a connected device table indicating the external devices currently connected to the bluetooth module, including the device types of the external devices currently connected, as shown in table 3 or table 4, for example. After the device type of the new external device is obtained, a connected device table is inquired, the number of the external devices currently connected with the Bluetooth module is counted, and if the number of the external devices currently connected with the Bluetooth module is smaller than the maximum number of the external devices capable of being connected with the Bluetooth module, the Bluetooth module is controlled to establish connection of the new external device; if the number of the external devices currently connected by the Bluetooth module is equal to the maximum number of the external devices capable of being connected by the Bluetooth module, judging whether the priority level of the new external device is higher than that of the currently connected external device, and if the priority level of the new external device is at least higher than that of one currently connected external device or the currently connected external device with the same priority level as that of the new external device exists, controlling the Bluetooth module to disconnect the external device with the lowest priority level in the currently connected external device and establish the connection of the new external device.
Obviously, there may be a plurality of currently connected external devices with the lowest priority levels, as shown in table 3 or table 4, where there are two speakers with the lowest priority levels. The connected device table may further include connection time of each external device currently connected, for example, as shown in table 3. At this time, the bluetooth module may be controlled to disconnect one currently connected external device with the longest or shortest connection time among the lowest priority levels, or one currently connected external device may be randomly selected to disconnect from the currently connected external device.
TABLE 2
Type of device Priority level
Earphone set 1
Sound box 2
TABLE 3
Figure BDA0002542689400000081
Figure BDA0002542689400000091
TABLE 4
Type of device Number of
Earphone set 1
Sound box 2
In some embodiments, the device type table may also include both a priority class for indicating whether to monopolize the bluetooth link and a priority level for indicating a lower priority level, illustratively as shown in table 5, where a lower number of priority levels represents a higher level. The bluetooth device also locally stores a connected device table indicating the external devices currently connected to the bluetooth module, including the device types of the external devices currently connected, as shown in table 3 or table 4, for example.
After the device type of the new external device is obtained, if the Bluetooth module is currently connected with the external device, inquiring a device type table, firstly judging the priority class of the new external device, and if the priority class of the new external device is exclusive, controlling the Bluetooth module to disconnect all currently connected external devices and establishing the connection of the new external device; if the priority class of the new external equipment is not exclusive, inquiring a connection equipment table, counting the number of the external equipment currently connected by the Bluetooth module, if the number of the external equipment currently connected by the Bluetooth module is smaller than the maximum number of the external equipment capable of being connected by the Bluetooth module, controlling the Bluetooth module to establish the connection of the new external equipment, and if the number of the external equipment currently connected by the Bluetooth module is equal to the maximum number of the external equipment capable of being connected by the Bluetooth module, judging the priority level of the new external equipment and the priority level of the external equipment currently connected by the Bluetooth module.
TABLE 5
Type of device Priority classes Priority level
Earphone set Monopolizing 1
Sound box Non-exclusive 2
Fig. 2 is a flowchart of a bluetooth preemption method for a bluetooth device according to another embodiment of the present application, in which in this embodiment, the bluetooth device locally stores a connection device table indicating external devices currently connected to a bluetooth module, including device types of the external devices currently connected to the bluetooth module and connection times and/or priority levels of the external devices.
As shown in fig. 2, the bluetooth preemption method includes: receiving a message sent by a Bluetooth module; judging whether the device type of the new external device can be acquired from the received message; if the device type of the new external device is obtained, inquiring a connected device table, and counting the number of the external devices currently connected with the Bluetooth module; if the number of the external devices currently connected with the Bluetooth module is less than the maximum number of the external devices capable of being connected with the Bluetooth module, controlling the Bluetooth module to establish connection of new external devices; if the number of the external devices currently connected with the Bluetooth module is equal to the maximum number of the external devices capable of being connected with the Bluetooth module, the Bluetooth module is controlled to disconnect one currently connected external device with the longest connection time or the shortest connection time or the lowest priority level, and the connection of a new external device is established.
Illustratively, as shown in table 6, the connected device table includes the device type of each external device currently connected and the connection time of each external device, and when the currently connected external device needs to be disconnected, the currently connected external device with the longest or shortest connection time is selected to be disconnected.
TABLE 6
Type of device Connection time
Earphone 1 9:00
Sound box 1 9:40
Sound box 2 10:00
Illustratively, as shown in table 7, the connected device table includes the device type of each external device currently connected and the priority level of each external device, and when the currently connected external device needs to be disconnected, the currently connected external device with the lowest priority level is selected to be disconnected.
TABLE 7
Type of device Priority level
Earphone 1 1
Sound box 1 2
Sound box 2 2
For example, as shown in table 8, the connected device table includes the device type, the connection time, and the priority level of each external device currently connected, when the external device currently connected needs to be disconnected, the currently connected external device with the longest or shortest connection time may be selected to be disconnected, the currently connected external device with the lowest priority level may also be selected to be disconnected, and when there are a plurality of currently connected external devices with the lowest priority level, the currently connected external device with the longest or shortest connection time in the lowest priority level may be disconnected, and a disconnection may also be randomly selected from the currently connected external devices.
TABLE 8
Figure BDA0002542689400000101
Figure BDA0002542689400000111
In some embodiments, when the external devices are devices such as a remote controller and a keyboard, it is not desirable that the devices occupy limited bluetooth communication resources, at this time, it is necessary to determine a device type of a new external device that wants to establish a new connection, and when the device type of the new external device is a preset type, the bluetooth module is controlled to disconnect the currently connected external device and establish a connection of the new external device.
For example, a preemption instruction may be generated and sent to the bluetooth module to cause the bluetooth module to disconnect the currently connected external device, such as calling an A2dpSinkProfile disconnect interface. After the new external device is disconnected, the Bluetooth module can be controlled to reconnect the disconnected external device. Illustratively, the process of disconnecting the currently connected external device includes:
1) calling an A2dpSinkProfile disconnect interface;
2) a2dp Sink Profile is in the disconnection stage, and the audio connection is disconnected and broadcast is received;
3) a2dp Sink Profile disconnected stage, receiving the audio connection disconnected broadcast;
4) ACL DISCONNECT phase, the broadcast is received that the connection path has been disconnected.
The embodiment of the present application further provides a bluetooth preemption device for a bluetooth device, where the bluetooth device locally stores a device type table for indicating a device type priority for bluetooth preemption, and the device is used to implement the bluetooth preemption method according to any embodiment in fig. 1, and the method may be implemented by hardware or by executing corresponding software by hardware. The hardware or software includes one or more units corresponding to the above-described functions, e.g., a receiving unit, a preemption unit, etc.
The embodiment of the present application further provides another bluetooth preemption device for a bluetooth device, where the bluetooth device locally stores a connection device table indicating external devices currently connected to a bluetooth module, where the connection device table includes device types of the external devices currently connected to the bluetooth module and connection time and/or priority levels of the external devices. The hardware or software includes one or more units corresponding to the above-described functions, e.g., a receiving unit, a preemption unit, etc.
The embodiment of the present application further provides a bluetooth device, where the bluetooth device locally stores a device type table for indicating a device type priority for bluetooth preemption, and the bluetooth device includes a bluetooth module and a preemption module communicatively connected to the bluetooth module, where the preemption module is configured to execute the method according to any embodiment in fig. 1.
The embodiment of the present application further provides another bluetooth device, where the bluetooth device locally stores a connection device table indicating external devices currently connected to a bluetooth module, where the connection device table includes device types of the external devices currently connected to the bluetooth device and connection times and/or priority levels of the external devices, and the bluetooth device includes a bluetooth module and a preemption module communicatively connected to the bluetooth module, where the preemption module is configured to execute the method according to any embodiment in fig. 2.
Embodiments of the present application further provide a computer-readable storage medium, where the computer-readable storage medium stores computer instructions, and the computer instructions, when executed by a processor, implement a method according to any of the embodiments in fig. 1 or fig. 2.
The application of the bluetooth preemption method is further described below in conjunction with a specific embodiment. Since the external non-audio device occupies less bluetooth communication resources, in this embodiment, bluetooth preemption is only performed for the external audio device. In this specific embodiment, the bluetooth device is a projector, the projector may be connected to at most 2 external audio devices, the external audio devices are external bluetooth speakers and earphones, and the priority level of the earphone type is higher than that of the speaker type.
The projector has connected 2 external bluetooth speaker, and the connection time of first external bluetooth speaker is longer than the connection time of second external bluetooth speaker. When the bluetooth headset wants to connect to the projector, the ACL connection stage judges whether the device type can be acquired, if not, the ACL connection stage ignores the device type, and if the device type can be acquired and is the headset type, one external bluetooth speaker is disconnected (if the priority class of the headset type is exclusive, 2 external bluetooth speakers are disconnected). And in the binding stage, if the type is acquired and the type is the earphone type, one external Bluetooth sound box is disconnected (if the priority class of the earphone type is exclusive, 2 external Bluetooth sound boxes are disconnected). For example, the first external bluetooth speaker with longer connection time may be disconnected, and the second external bluetooth speaker with shorter connection time may also be disconnected. After the connection between the Bluetooth headset and the projector is disconnected, the disconnected external Bluetooth sound box can be reconnected.
Because the bluetooth bandwidth is limited, in order to realize bluetooth preemption, bluetooth bandwidth equalization is required. For example, the usage scenario of bluetooth bandwidth includes:
1) keeping the stable connection of the Bluetooth remote controller;
2) the stable audio transmission of the connected Bluetooth sound equipment is ensured;
3) in response to a bluetooth headset Page connection request.
Since the audio transmission priority of the connected bluetooth sound is higher, audio jamming can occur due to the reduction of the bandwidth occupation, the equalization adjustment from the other two directions is modified as follows, for example:
1) the connection parameters of the Bluetooth remote controller are increased by 3-5ms, so that the requirement of the remote controller can be met, and the frequency of keeping connection and communication with the remote controller is reduced;
2) the interval time of Page Scan is shortened by 500-600ms, so as to respond the Page connection request of the Bluetooth headset more quickly.
It should be understood that, in various embodiments of the present application, the sequence numbers of the above-mentioned processes do not mean the execution sequence, some or all of the steps may be executed in parallel or executed sequentially, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, a network device or a terminal device, etc.) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: u disk, removable hard disk, ROM, RAM) magnetic or optical disk, or the like.
The terminology used in the embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the examples of this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. The character "/" herein generally indicates that the former and latter associated objects are in an "or" relationship.
The word "if" or "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrases "if determined" or "if detected (a stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when detected (a stated condition or event)" or "in response to a detection (a stated condition or event)", depending on the context.
It will be understood by those skilled in the art that all or part of the steps in the method for implementing the above embodiments may be implemented by instructing the relevant hardware through a program, which may be stored in a storage medium readable by a device and includes all or part of the steps when executed, such as: FLASH, EEPROM, etc.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (13)

1.A Bluetooth preemption method for a Bluetooth device, wherein the Bluetooth device comprises a Bluetooth module, and the Bluetooth module is used for establishing Bluetooth connection with an external device, and the Bluetooth device locally stores a device type table for indicating the priority of the device type for Bluetooth preemption, the method comprises the following steps:
receiving a message sent by a Bluetooth module;
judging whether the device type of the new external device can be acquired from the received message;
and if the device type of the new external device is acquired and the Bluetooth module is currently connected with the external device, inquiring a device type table, and controlling the Bluetooth module to establish the connection of the new external device according to the device type priority in the device type table.
2. The method according to claim 1, wherein the device type table includes device types and a priority class indicating whether to monopolize the bluetooth link, and the controlling the bluetooth module to establish the connection with the new external device according to the device type priority in the device type table includes:
if the priority class of the new external equipment is exclusive, controlling the Bluetooth module to disconnect all the currently connected external equipment and establishing the connection of the new external equipment;
and if the priority class of the new external equipment is non-exclusive and the number of the external equipment currently connected with the Bluetooth module is less than the maximum number of the external equipment capable of being connected with the Bluetooth module, controlling the Bluetooth module to establish the connection of the new external equipment.
3. The method according to claim 1, wherein the device type table includes device types and priority levels indicating the priority levels, the bluetooth device further stores a connection device table locally indicating external devices currently connected to the bluetooth module, the connection device table includes device types of the currently connected external devices, and the controlling the bluetooth module to establish a connection with a new external device according to the device type priorities in the device type table includes:
inquiring a connection device table, and counting the number of external devices currently connected with the Bluetooth module;
if the number of the external devices currently connected with the Bluetooth module is less than the maximum number of the external devices capable of being connected with the Bluetooth module, controlling the Bluetooth module to establish connection of new external devices;
if the number of the external devices currently connected with the Bluetooth module is equal to the maximum number of the external devices capable of being connected with the Bluetooth module, judging whether the priority level of the new external device is higher than that of the external device currently connected with the Bluetooth module;
and if the priority level of the new external equipment is at least higher than that of the currently connected external equipment or the currently connected external equipment with the priority level same as that of the new external equipment exists, controlling the Bluetooth module to disconnect the external equipment with the lowest priority level in the currently connected external equipment and establish the connection of the new external equipment.
4. The method of claim 3, wherein the connection device table further includes connection time of currently connected external devices, and the controlling the bluetooth module to disconnect an external device with a lowest priority level from among the currently connected external devices comprises:
and if a plurality of currently connected external devices with the lowest priority level exist, controlling the Bluetooth module to disconnect the currently connected external device with the longest or shortest connection time in the lowest priority level.
5. The method of any of claims 1-4, wherein the external device is an external audio device.
6. A Bluetooth preemption method for a Bluetooth device, wherein the Bluetooth device comprises a Bluetooth module, the Bluetooth module is used for establishing Bluetooth connection with external devices, the Bluetooth device locally stores a connection device table indicating the external devices currently connected with the Bluetooth module, and the connection device table comprises the device types of the external devices currently connected and the connection time and/or priority level of the external devices, the method comprises the following steps:
receiving a message sent by a Bluetooth module;
judging whether the device type of the new external device can be acquired from the received message;
if the device type of the new external device is obtained, inquiring a connected device table, and counting the number of the external devices currently connected with the Bluetooth module;
if the number of the external devices currently connected with the Bluetooth module is less than the maximum number of the external devices capable of being connected with the Bluetooth module, controlling the Bluetooth module to establish connection of new external devices;
if the number of the external devices currently connected with the Bluetooth module is equal to the maximum number of the external devices capable of being connected with the Bluetooth module, the Bluetooth module is controlled to disconnect one currently connected external device with the longest connection time or the shortest connection time or the lowest priority level, and the connection of a new external device is established.
7. The method according to claim 6, wherein the controlling the bluetooth module to disconnect a currently connected external device with the longest connection time or the shortest connection time or the lowest priority level and establish a connection with a new external device comprises:
judging whether the equipment type of the new external equipment is a preset type or not;
and when the device type of the new external device is a preset type, controlling the Bluetooth module to disconnect the currently connected external device with the longest or shortest connection time or the lowest priority level, and establishing the connection of the new external device.
8. The method of any of claims 6-7, wherein the external device is an external audio device.
9. A Bluetooth preemption device for Bluetooth equipment, wherein the Bluetooth equipment comprises a Bluetooth module, the Bluetooth module is used for establishing Bluetooth connection with an external device, the Bluetooth equipment is characterized in that the Bluetooth equipment locally stores an equipment type table for indicating the equipment type priority for Bluetooth preemption, and the device comprises:
the receiving unit is used for receiving the message sent by the Bluetooth module;
and the preemption unit is used for judging whether the equipment type of the new external equipment can be acquired from the received message, inquiring the equipment type table if the equipment type of the new external equipment is acquired and the Bluetooth module is currently connected with the external equipment, and controlling the Bluetooth module to establish the connection of the new external equipment according to the equipment type priority in the equipment type table.
10. A Bluetooth preemption device for a Bluetooth device, the Bluetooth device comprising a Bluetooth module, the Bluetooth module being used for establishing Bluetooth connection with an external device, wherein the Bluetooth device locally stores a connection device table indicating the external device currently connected to the Bluetooth module, the connection device table including the device type of each external device currently connected to the Bluetooth module and the connection time and/or priority level of each external device, the device comprising:
the receiving unit is used for receiving the message sent by the Bluetooth module;
the preemption unit is used for judging whether the equipment type of the new external equipment can be acquired from the received message; if the device type of the new external device is obtained, inquiring a connected device table, and counting the number of the external devices currently connected with the Bluetooth module; if the number of the external devices currently connected with the Bluetooth module is less than the maximum number of the external devices capable of being connected with the Bluetooth module, controlling the Bluetooth module to establish connection of new external devices; if the number of the external devices currently connected with the Bluetooth module is equal to the maximum number of the external devices capable of being connected with the Bluetooth module, the Bluetooth module is controlled to disconnect one currently connected external device with the longest connection time or the shortest connection time or the lowest priority level, and the connection of a new external device is established.
11. The Bluetooth equipment comprises a Bluetooth module, and is characterized in that the Bluetooth equipment is locally stored with an equipment type table for indicating the equipment type priority for Bluetooth preemption, and also comprises a preemption module in communication connection with the Bluetooth module, wherein the Bluetooth module is used for establishing Bluetooth connection with external equipment and executing corresponding operation according to the control of the preemption module;
the preemption module is configured to perform the bluetooth preemption method of any of claims 1-5.
12. The Bluetooth device comprises a Bluetooth module, and is characterized in that the Bluetooth device locally stores a connection device table indicating external devices currently connected with the Bluetooth module, the connection device table comprises device types of the external devices currently connected and connection time and/or priority levels of the external devices, the Bluetooth device further comprises a preemption module in communication connection with the Bluetooth module, and the Bluetooth module is used for establishing Bluetooth connection with the external devices and executing corresponding operation according to the control of the preemption module;
the preemption module is configured to perform the bluetooth preemption method of any of claims 6-8.
13. A computer readable storage medium comprising computer instructions which, when executed by a processor, implement the bluetooth preemption method of any of claims 1-8.
CN202010551524.5A 2020-06-17 2020-06-17 Bluetooth device, Bluetooth preemption method and device thereof, and computer-readable storage medium Pending CN111741456A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010551524.5A CN111741456A (en) 2020-06-17 2020-06-17 Bluetooth device, Bluetooth preemption method and device thereof, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010551524.5A CN111741456A (en) 2020-06-17 2020-06-17 Bluetooth device, Bluetooth preemption method and device thereof, and computer-readable storage medium

Publications (1)

Publication Number Publication Date
CN111741456A true CN111741456A (en) 2020-10-02

Family

ID=72649893

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010551524.5A Pending CN111741456A (en) 2020-06-17 2020-06-17 Bluetooth device, Bluetooth preemption method and device thereof, and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN111741456A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112911563A (en) * 2021-01-27 2021-06-04 广州橙行智动汽车科技有限公司 Bluetooth connection method and system based on multiple terminals
WO2023098235A1 (en) * 2021-11-30 2023-06-08 Oppo广东移动通信有限公司 Device connection switching method, and apparatus, electronic device and computer-readable storage medium
WO2023098234A1 (en) * 2021-11-30 2023-06-08 Oppo广东移动通信有限公司 Device connection switching method and apparatus, and electronic device and computer-readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014077678A1 (en) * 2012-11-13 2014-05-22 Lely Patent N.V. Network expansion method for a bluetooth network
CN104093216A (en) * 2014-06-16 2014-10-08 小米科技有限责任公司 Method and device for wireless data transmission
CN105282691A (en) * 2015-11-05 2016-01-27 广东欧珀移动通信有限公司 Bluetooth equipment connection method and device
CN107493594A (en) * 2017-07-21 2017-12-19 深圳市盛路物联通讯技术有限公司 A kind of internet of things equipment access AP method and AP
CN108347720A (en) * 2018-02-08 2018-07-31 广东欧珀移动通信有限公司 communication connecting method, device, terminal and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014077678A1 (en) * 2012-11-13 2014-05-22 Lely Patent N.V. Network expansion method for a bluetooth network
CN104093216A (en) * 2014-06-16 2014-10-08 小米科技有限责任公司 Method and device for wireless data transmission
CN105282691A (en) * 2015-11-05 2016-01-27 广东欧珀移动通信有限公司 Bluetooth equipment connection method and device
CN107493594A (en) * 2017-07-21 2017-12-19 深圳市盛路物联通讯技术有限公司 A kind of internet of things equipment access AP method and AP
CN108347720A (en) * 2018-02-08 2018-07-31 广东欧珀移动通信有限公司 communication connecting method, device, terminal and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
余子安: "基于NB-IoT的智能家居系统设计", 《中国优秀硕士学位论文全文数据库(电子期刊)》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112911563A (en) * 2021-01-27 2021-06-04 广州橙行智动汽车科技有限公司 Bluetooth connection method and system based on multiple terminals
WO2023098235A1 (en) * 2021-11-30 2023-06-08 Oppo广东移动通信有限公司 Device connection switching method, and apparatus, electronic device and computer-readable storage medium
WO2023098234A1 (en) * 2021-11-30 2023-06-08 Oppo广东移动通信有限公司 Device connection switching method and apparatus, and electronic device and computer-readable storage medium

Similar Documents

Publication Publication Date Title
CN111447602B (en) Bluetooth device, Bluetooth preemption method and device thereof, and computer-readable storage medium
CN111741456A (en) Bluetooth device, Bluetooth preemption method and device thereof, and computer-readable storage medium
WO2016131261A1 (en) Multipoint connection control method, apparatus, terminal, and multipoint bluetooth earphone
US11350200B2 (en) Wireless audio source switching
CN107852762B (en) Method for managing Bluetooth connection, Bluetooth master device and device
US20140087665A1 (en) Method for Bluetooth Accessory Pairing with Bluetooth Device, and Bluetooth Accessory
WO2019090726A1 (en) Method for selecting bluetooth device, terminal, and system
US20150312703A1 (en) Timed and variable duration for multiple device synching
EP3068150B1 (en) Method and device for controlling device
EP3131276B1 (en) Incoming call forwarding method and user equipment
CN103391121A (en) Method for pairing and connecting multiple devices and Bluetooth device
JP7252259B2 (en) Access control method, message broadcasting method and related device
CN111818667B (en) Device connection method, device and readable storage medium
EP3182787A1 (en) Communication method and device
EP2575331A1 (en) Electronic Apparatus and Media System Using Information Terminal
CN116058003A (en) Seamless Bluetooth switching system
CN110177357B (en) Bluetooth management method, mobile terminal and computer storage medium
CN110856086A (en) Method and device for controlling sound system and readable storage medium
CN109314738B (en) Wireless audio source switching
WO2020164522A1 (en) Data transmission control method and related product
US11937159B2 (en) Proximity-based connection for Bluetooth devices
CN116528202A (en) Connection control method, device, electronic equipment and storage medium
US10083600B1 (en) Mobile computing device wireless data transmission
CN113923722B (en) Data transmission method, device and storage medium
US20180070392A1 (en) Connection method of communication device and the communication device

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
CB02 Change of applicant information

Address after: 610041 building 4, zone a, Tianfu Software Park, No. 1129, shijicheng Road, high tech Zone, Chengdu, Sichuan

Applicant after: Jimi Technology Co.,Ltd.

Address before: No.2, floor 2, unit 1, building 4, Tianfu Software Park, no.1129, shijicheng Road, hi tech Zone, Chengdu, Sichuan 610041

Applicant before: Chengdu Jimi Technology Co.,Ltd.

CB02 Change of applicant information
RJ01 Rejection of invention patent application after publication

Application publication date: 20201002

RJ01 Rejection of invention patent application after publication