CN116193413B - Bluetooth connection method, system, storage medium and device - Google Patents
Bluetooth connection method, system, storage medium and device Download PDFInfo
- Publication number
- CN116193413B CN116193413B CN202310466745.6A CN202310466745A CN116193413B CN 116193413 B CN116193413 B CN 116193413B CN 202310466745 A CN202310466745 A CN 202310466745A CN 116193413 B CN116193413 B CN 116193413B
- Authority
- CN
- China
- Prior art keywords
- bluetooth
- bluetooth device
- information
- application scene
- mobile phone
- 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.)
- Active
Links
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
- H04W52/00—Power management, e.g. TPC [Transmission Power Control], power saving or power classes
- H04W52/02—Power saving arrangements
- H04W52/0209—Power saving arrangements in terminal devices
- H04W52/0212—Power saving arrangements in terminal devices managed by the network, e.g. network or access point is master and terminal is slave
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/14—Direct-mode setup
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
- Telephone Function (AREA)
Abstract
The invention provides a Bluetooth connection method, a system, a storage medium and equipment, which are characterized in that whether a mobile phone is connected with Bluetooth equipment is judged by acquiring the Bluetooth state of the mobile phone and according to the Bluetooth state, if the mobile phone is judged to be connected with the Bluetooth equipment, first information of a first Bluetooth equipment which is currently connected and a Bluetooth equipment to-be-connected list are acquired, then the Bluetooth equipment to-be-connected list is updated in real time, whether other Bluetooth equipment which can be connected exists is judged, if the other Bluetooth equipment which can be connected exists is judged to exist, second information of a second Bluetooth equipment which can be connected is acquired, a preset application scene where a current user is located is identified according to the first information and the second information, and then switching of the first Bluetooth equipment and the second Bluetooth equipment is controlled according to the preset application scene, so that manual operation of the user is reduced, and the user experience is improved.
Description
Technical Field
The invention belongs to the technical field of short-distance communication, and particularly relates to a Bluetooth connection method, a system, a storage medium and equipment.
Background
Bluetooth (Bluetooth) is a wireless technology standard that enables short-range data interactions between different devices. For example, the mobile phone can start the Bluetooth module to perform short-distance data interaction with the Bluetooth headset, so that the Bluetooth headset can be used as an audio input/output device of the mobile phone to realize functions such as conversation, music playing and the like.
With the advent of the wireless smart era, users often have multiple bluetooth playback devices, such as bluetooth headsets, bluetooth speakers, etc., which can be used as audio input/output devices for a mobile phone, but select an appropriate bluetooth playback device when the user is in a different application scenario.
Taking a scene frequently encountered in daily life as an example, when a user goes home from work, music originally played in a TWS (1 Wireless Stereo) Bluetooth headset is required to be played continuously on a Bluetooth sound box in the home, and the following operations are generally required to be executed: clicking to pause music, taking off the earphone, putting the earphone into a charging box for storage, opening a Bluetooth sound box, automatically connecting a mobile phone, clicking to continue playing music, and the whole switching process is not intelligent, needs to consume a certain time and is slightly complicated in operation.
Disclosure of Invention
Based on this, the embodiments of the present invention provide a bluetooth connection method, a bluetooth connection system, a bluetooth connection storage medium, and a bluetooth connection device, so as to reduce manual operations.
A first aspect of an embodiment of the present invention provides a bluetooth connection method, applied to a mobile phone and a plurality of bluetooth devices, where the mobile phone is configured to be communicatively connected to the plurality of bluetooth devices, and the plurality of bluetooth devices are paired by a bluetooth low energy protocol, and a private communication command protocol is established, and the method includes:
acquiring a Bluetooth state of a mobile phone, and judging whether the mobile phone is connected with Bluetooth equipment according to the Bluetooth state;
if the mobile phone is connected with the Bluetooth device, acquiring first information of a first Bluetooth device which is connected currently and a to-be-connected list of the Bluetooth device;
updating the to-be-connected list of the Bluetooth equipment in real time, and judging whether other Bluetooth equipment capable of being connected exists or not;
if judging that other connectable Bluetooth devices exist, acquiring second information of a second connectable Bluetooth device, and identifying a preset application scene where a current user is located according to the first information and the second information;
according to the preset application scene, switching of the first Bluetooth device and the second Bluetooth device is controlled;
the step of controlling the switching between the first bluetooth device and the second bluetooth device according to the preset application scenario includes:
acquiring the preset application scene and judging whether the preset application scene is a home application scene or not;
if the preset application scene is judged to be a home application scene, judging whether the first Bluetooth device is an external device or not;
if the first Bluetooth device is judged not to be the external device, acquiring the running state of the current mobile phone, and judging whether the user is performing voice interaction or not according to the running state;
if the user is judged to be performing voice interaction, the connection between the mobile phone and the first Bluetooth device is maintained;
if the user is judged not to be in voice interaction, judging whether the second Bluetooth device is a play-out device or not;
if the second Bluetooth device is judged to be an outward-placed device, corresponding history pairing information is called according to a preset application scene where the identified current user is located, wherein the history pairing information is included in the preset application scene, and when the Bluetooth device to be connected list updates the second Bluetooth device, the connection frequency of the second Bluetooth device is changed;
judging whether the connection frequency of the second Bluetooth device is larger than a target value;
if yes, control is switched from the first Bluetooth device to the second Bluetooth device.
Further, if it is determined that there are other connectable bluetooth devices, acquiring second information of a second connectable bluetooth device, and identifying, according to the first information and the second information, a preset application scenario where a current user is located includes:
acquiring a history Bluetooth device connection list, and acquiring the geographic position of a corresponding preset application scene when the history Bluetooth device connection list is acquired;
identifying each connectable historical Bluetooth device in the historical Bluetooth device connection list, and acquiring an address number segment of each connectable historical Bluetooth device;
combining address number segments corresponding to each connectable historical Bluetooth device in the historical Bluetooth device connection list to form each address number segment group;
and establishing a mapping relation between each address number segment group and the geographic position to obtain a first mapping model, wherein the first mapping model is used for inputting the address number segment groups and outputting the corresponding geographic positions, and the geographic positions are used for representing the application scene.
Further, if it is determined that there are other connectable bluetooth devices, the step of acquiring second information of a second connectable bluetooth device and identifying, according to the first information and the second information, a preset application scenario where a current user is located includes:
acquiring the first information and the second information, wherein the first information at least comprises a first address number segment of the first Bluetooth device, and the second information at least comprises a second address number segment of the second Bluetooth device;
combining the first address number segment and the second address number segment to obtain a target address number segment group;
and inputting the target address number segment group into the first mapping model to obtain a corresponding target geographic position so as to identify a preset application scene where the current user is located.
Further, if the preset application scenario is determined to be a home application scenario, the step of determining whether the first bluetooth device is an external device includes:
when the first Bluetooth device is judged to be the external device, acquiring the running state of the current mobile phone, and judging whether the mobile phone receives a voice interaction request according to the running state;
if the mobile phone is judged to receive the voice interaction request, after the voice interaction request is accepted, the first Bluetooth device is controlled to be disconnected;
judging whether the second Bluetooth device is a Bluetooth headset or not;
if the second Bluetooth device is judged to be a Bluetooth headset, acquiring wearing information of the Bluetooth headset, and judging whether a user wears the Bluetooth headset or not;
if the user wearing the Bluetooth headset is judged, the control is switched to the Bluetooth headset from the external device.
Further, if the second bluetooth device is determined to be an external device, in the step of controlling to switch from the first bluetooth device to the second bluetooth device, the first bluetooth device is controlled to send a preset instruction to the second bluetooth device through a BLE protocol, and the preset instruction is used for triggering the second bluetooth device to be actively connected with a mobile phone.
A second aspect of the embodiment of the present invention provides a bluetooth connection system, applied to a mobile phone and a plurality of bluetooth devices, where the mobile phone is configured to be communicatively connected to the plurality of bluetooth devices, and the plurality of bluetooth devices are paired by a bluetooth low energy protocol, and a private communication command protocol is established, where the system includes:
the first judging module is used for acquiring the Bluetooth state of the mobile phone and judging whether the mobile phone is connected with Bluetooth equipment or not according to the Bluetooth state;
the first acquisition module is used for acquiring first information of a first Bluetooth device which is currently connected and a to-be-connected list of the Bluetooth device if the mobile phone is judged to be connected with the Bluetooth device;
the second judging module is used for updating the Bluetooth equipment to-be-connected list in real time and judging whether other Bluetooth equipment capable of being connected exists or not;
the application scene identification module is used for acquiring second information of a second Bluetooth device which can be connected if judging that other Bluetooth devices which can be connected exist, and identifying a preset application scene where a current user is located according to the first information and the second information;
the control module is used for controlling the switching of the first Bluetooth device and the second Bluetooth device according to the preset application scene;
the control module includes:
the first judging unit is used for acquiring the preset application scene and judging whether the preset application scene is a home application scene or not;
the second judging unit is used for judging whether the first Bluetooth device is an external device or not if the preset application scene is judged to be a home application scene;
the third judging unit is used for acquiring the running state of the current mobile phone if the first Bluetooth device is judged not to be the external device, and judging whether the user performs voice interaction or not according to the running state;
the maintenance unit is used for maintaining the connection between the mobile phone and the first Bluetooth device if the user is judged to be performing voice interaction;
a fourth judging unit, configured to judge whether the second bluetooth device is an external device if it is judged that the user is not performing voice interaction;
a calling unit, configured to, if the second bluetooth device is determined to be an external device, call corresponding history pairing information according to a preset application scenario in which the identified current user is located, where the history pairing information is included in the preset application scenario, and when a to-be-connected list of the bluetooth device updates the second bluetooth device, a connection frequency of the second bluetooth device;
a fifth judging unit, configured to judge whether the connection frequency of the second bluetooth device is greater than a target value;
and the first switching unit is used for controlling to switch from the first Bluetooth device to the second Bluetooth device when judging that the connection frequency of the second Bluetooth device is larger than the target value.
A third aspect of an embodiment of the present invention provides a computer-readable storage medium comprising:
the readable storage medium stores one or more programs which when executed by a processor implement the bluetooth connection method of the first aspect.
A fourth aspect of an embodiment of the present invention provides an electronic device, wherein the electronic device includes a memory and a processor, and wherein:
the memory is used for storing a computer program;
the processor is configured to implement the bluetooth connection method of the first aspect when executing the computer program stored on the memory.
According to the Bluetooth connection method, the Bluetooth connection system, the storage medium and the Bluetooth connection device, whether Bluetooth of the mobile phone is connected with Bluetooth equipment is judged through the Bluetooth state of the mobile phone, if yes, information of the connected Bluetooth equipment is obtained, information of other Bluetooth equipment which can be connected is obtained at the same time, a scene where a current user is located is determined according to the information, switching among the Bluetooth equipment is controlled according to the scene, manual operation of the user is reduced, and user experience is improved.
Drawings
Fig. 1 is a flowchart of a bluetooth connection method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a bluetooth connection system according to a third embodiment of the present invention;
fig. 3 is a block diagram of an electronic device according to a fourth embodiment of the present invention.
The following detailed description will be further described with reference to the above-described drawings.
Detailed Description
In order that the invention may be readily understood, a more complete description of the invention will be rendered by reference to the appended drawings. Several embodiments of the invention are presented in the figures. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
It will be understood that when an element is referred to as being "mounted" on another element, it can be directly on the other element or intervening elements may also be present. When an element is referred to as being "connected" to another element, it can be directly connected to the other element or intervening elements may also be present. The terms "vertical," "horizontal," "left," "right," and the like are used herein for illustrative purposes only.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and/or" as used herein includes any and all combinations of one or more of the associated listed items.
The Bluetooth connection method in the embodiment of the invention is applied to a mobile phone and a plurality of Bluetooth devices, the mobile phone is used for being in communication connection with the plurality of Bluetooth devices, the plurality of Bluetooth devices are paired through a Bluetooth low energy protocol (Bluetooth Low Energy, BLE), and a private communication command protocol is established. Specifically, the bluetooth device may be a TWS bluetooth headset, a bluetooth speaker, etc., where when in initial use, the TWS bluetooth headset and the bluetooth speaker are paired through a custom bluetooth low energy protocol and a private communication command protocol is established, if only the TWS bluetooth headset and the bluetooth speaker are in an application scenario, the TWS bluetooth headset and the bluetooth speaker are paired through the custom bluetooth low energy protocol, and the private communication command protocol between them is established.
Example 1
Referring to fig. 1, fig. 1 shows a bluetooth connection method according to a first embodiment of the present invention, and the method specifically includes steps S01 to S05.
And step S01, acquiring the Bluetooth state of the mobile phone, judging whether the mobile phone is connected with Bluetooth equipment according to the Bluetooth state, and if yes, executing step S02.
Specifically, when the Bluetooth function of the mobile phone is started, the Bluetooth function module of the mobile phone can automatically search Bluetooth equipment which can establish connection within a preset range, and when a plurality of connectable Bluetooth equipment are searched, if all the connectable Bluetooth equipment are used from unpaired connection, a user can select connection according to own requirements; if only one Bluetooth device which is matched and connected before is used in all connectable Bluetooth devices, the mobile phone is automatically connected with the Bluetooth device; if there are a plurality of bluetooth devices that have been paired for connection use before among all connectable bluetooth devices, the mobile phone will automatically connect with the bluetooth device that was last connected for use.
In this embodiment, the bluetooth state of the mobile phone includes a standby state and a connection state, where the standby state refers to the mobile phone being in a state to be accessed, and the connection state refers to the mobile phone having established a communication link with the bluetooth device, and specifically, when the bluetooth state of the mobile phone is in the connection state, it is indicated that the mobile phone is connected with the bluetooth device.
Step S02, first information of a first Bluetooth device connected currently and a list to be connected of the Bluetooth device are obtained.
When the mobile phone is connected with the bluetooth device, first information of a first bluetooth device which is currently connected is acquired, wherein the first information at least comprises an address number segment of the bluetooth device, and the address number segment is unique and can be used for identifying different bluetooth devices.
And step S03, updating the Bluetooth equipment to-be-connected list in real time, judging whether other Bluetooth equipment capable of being connected exists, and if so, executing step S04.
Specifically, the purpose of updating the to-be-connected list of the bluetooth device in real time is to know the application scene of the user in real time, and it can be understood that the coverage area of the bluetooth signal is limited, in addition, the coverage area is generally about 10 meters under the influence of the obstacle, and due to the smaller coverage area, the current application scene of the user can be known more accurately, for example, because the to-be-connected list of the bluetooth device is updated in real time, the to-be-connected list of the bluetooth device is updated out of the bluetooth device used in the home, for example, the bluetooth sound box is updated out of the bluetooth device of the bluetooth sound box in the home when the user enters the home.
Step S04, second information of a connectable second Bluetooth device is obtained, and a preset application scene where a current user is located is identified according to the first information and the second information.
It should be noted that, before identifying the preset application scenario where the current user is located, a first mapping model needs to be established, where the specific step of establishing the first mapping model is to obtain a connection list of the historical bluetooth device, and obtain the geographic position of the preset application scenario corresponding to the connection list of the historical bluetooth device, for example, when the preset application scenario is a residence, obtain the geographic position of the residence, further, identify each connectable historical bluetooth device in the connection list of the historical bluetooth device, and obtain address number segments of each connectable historical bluetooth device, and it can be understood that when a sound box or other audio-visual bluetooth devices exist in the residence, respectively obtain address number segments of each connectable historical bluetooth device, for example: 00:11:22:33:44:55, and combining address number segments corresponding to each connectable historical Bluetooth device in a historical Bluetooth device connection list to form each address number segment group, and finally establishing a mapping relation between each address number segment group and the geographic position to obtain a first mapping model, wherein the first mapping model is used for inputting the address number segment groups and outputting the corresponding geographic position, and the geographic position is used for representing the application scene where the address number segment groups are located.
After the first mapping model is built, in the subsequent practical use process, first information and second information are acquired, wherein the first information at least comprises a first address number segment of first Bluetooth equipment, the second information at least comprises a second address number segment of second Bluetooth equipment, then the first address number segment and the second address number segment are combined to obtain a target address number segment group, and finally the target address number segment group is input into the first mapping model to obtain a corresponding target geographic position so as to identify a preset application scene where a current user is located.
And step S05, controlling the switching of the first Bluetooth device and the second Bluetooth device according to the preset application scene.
In this embodiment, according to the target geographic location, a preset application scenario where the current user is located is determined, and whether the preset application scenario is a home application scenario is determined, if the preset application scenario is determined to be a home application scenario, whether the first bluetooth device is an external device is determined, if the first bluetooth device is determined not to be an external device, that is, a playing device with better privacy such as a bluetooth headset, the running state of the current mobile phone is obtained, according to the running state, whether the user is performing voice interaction is determined, if the user is performing voice interaction is determined, connection between the mobile phone and the first bluetooth device is maintained, and it is understood that, taking the bluetooth headset as an example, when a microphone radio function of the bluetooth headset is turned on, the user is considered to be performing voice interaction, and in order to ensure the privacy of the call, connection between the mobile phone and the first bluetooth device, that is, the connection between the bluetooth headset is maintained.
Further, if it is determined that the user is not performing voice interaction, it is determined whether the second bluetooth device is an external device, and if it is determined that the second bluetooth device is an external device, control is switched from the first bluetooth device to the second bluetooth device, and it can be understood that audio such as music being played in the bluetooth headset is transferred to the external device in home to continue playing, for example, a bluetooth speaker in home.
Further, if the user is judged not to be in voice interaction, whether the second Bluetooth device is an outward-playing device is judged, if the second Bluetooth device is judged to be the outward-playing device, corresponding historical pairing information is called according to a preset application scene where the identified current user is located, wherein the historical pairing information is included in the preset application scene, when a Bluetooth device to be connected list updates the second Bluetooth device, the connection frequency of the second Bluetooth device is judged, whether the connection frequency of the second Bluetooth device is larger than a target value is judged, and if yes, the first Bluetooth device is controlled to be switched to the second Bluetooth device. It can be understood that if the first bluetooth device is a bluetooth headset, the second bluetooth device is a bluetooth speaker, in the history pairing information is obtained, when the bluetooth headset and the bluetooth speaker appear in the bluetooth device to be connected list simultaneously, the connection frequency of the bluetooth speaker needs to be described, that is, when the bluetooth speaker and the bluetooth headset appear simultaneously, the connection frequency is switched from the bluetooth headset to the bluetooth speaker, specifically, when the user keeps the connection of the bluetooth headset, if the bluetooth speaker appears when the bluetooth device to be connected list is updated in real time, the connection frequency is counted as a switching time, if the user does switch the bluetooth headset to the bluetooth speaker at this time, the connection frequency is counted as a switching time divided by the total number of switching times. In addition, when the connection frequency of the second bluetooth device is greater than the target value, it is stated that from the viewpoint of user habit, after coming home, the audio in the earphone is more prone to be transferred to the home playback device to continue playing.
It should be noted that, the switching between bluetooth devices, specifically, through the BLE protocol, the first bluetooth device is controlled to send a preset instruction to the second bluetooth device, where the preset instruction is used to trigger the second bluetooth device to be actively connected with the mobile phone, so that the switching from the first bluetooth device to the second bluetooth device is completed, and similarly, the switching from the second bluetooth device to the first bluetooth device can be completed in the same manner.
In summary, the bluetooth connection method in the embodiment of the invention judges whether the bluetooth of the mobile phone is connected with the bluetooth device or not according to the bluetooth state of the mobile phone, if yes, acquires the information of the connected bluetooth device, acquires the information of other bluetooth devices which can be connected, determines the scene of the current user according to the information, and controls the switching between the bluetooth devices according to the scene, so as to reduce the manual operation of the user and improve the user experience.
Example two
The second embodiment of the present invention also provides a bluetooth connection method, which is different from the first embodiment of the present invention in that if it is determined that the preset application scenario is a home application scenario, the step of determining whether the first bluetooth device is an external device includes:
when the first Bluetooth device is judged to be the outward-playing device, the running state of the current mobile phone is obtained, whether the mobile phone receives a voice interaction request or not is judged according to the running state, namely, the mobile phone receives an incoming call, if the mobile phone receives the voice interaction request, the first Bluetooth device is controlled to be disconnected after the voice interaction request is received, namely, in order to ensure the privacy of a call, the outward-playing device is disconnected, further, whether the second Bluetooth device is a Bluetooth headset is judged, if the second Bluetooth device is judged to be the Bluetooth headset, the wearing information of the Bluetooth headset is obtained, whether the user wears the Bluetooth headset is judged, if the user wears the Bluetooth headset is judged, the mobile phone is controlled to be switched from the outward-playing device to the Bluetooth headset, and specifically, whether the user wears the Bluetooth headset can be determined through a wearing sensor on the Bluetooth headset.
Example III
Referring to fig. 2, fig. 2 is a schematic structural diagram of a bluetooth connection system according to a third embodiment of the invention, where the bluetooth connection system 200 includes: the first judging module 21, the first acquiring module 22, the second judging module 23, the application scene identifying module 24 and the control module 25, wherein:
a first judging module 21, configured to obtain a bluetooth state of the mobile phone, and judge whether the mobile phone is connected to the bluetooth device according to the bluetooth state;
the first obtaining module 22 is configured to obtain, if it is determined that the mobile phone is connected to the bluetooth device, first information of a first bluetooth device that is currently connected, and a list to be connected of the bluetooth device;
a second judging module 23, configured to update the to-be-connected list of bluetooth devices in real time, and judge whether other bluetooth devices that can be connected exist;
the application scenario identifying module 24 is configured to obtain second information of a second bluetooth device that can be connected if it is determined that other bluetooth devices that can be connected exist, and identify a preset application scenario where a current user is located according to the first information and the second information;
the control module 25 is configured to control switching between the first bluetooth device and the second bluetooth device according to the preset application scenario;
the control module includes:
the first judging unit is used for acquiring the preset application scene and judging whether the preset application scene is a home application scene or not;
the second judging unit is used for judging whether the first Bluetooth device is an external device or not if the preset application scene is judged to be a home application scene;
the third judging unit is used for acquiring the running state of the current mobile phone if the first Bluetooth device is judged not to be the external device, and judging whether the user performs voice interaction or not according to the running state;
the maintenance unit is used for maintaining the connection between the mobile phone and the first Bluetooth device if the user is judged to be performing voice interaction;
a fourth judging unit, configured to judge whether the second bluetooth device is an external device if it is judged that the user is not performing voice interaction;
a calling unit, configured to, if the second bluetooth device is determined to be an external device, call corresponding history pairing information according to a preset application scenario in which the identified current user is located, where the history pairing information is included in the preset application scenario, and when a to-be-connected list of the bluetooth device updates the second bluetooth device, a connection frequency of the second bluetooth device;
a fifth judging unit, configured to judge whether the connection frequency of the second bluetooth device is greater than a target value;
and the first switching unit is used for controlling to switch from the first Bluetooth device to the second Bluetooth device when judging that the connection frequency of the second Bluetooth device is larger than the target value, wherein the first Bluetooth device is controlled to send a preset instruction to the second Bluetooth device through a BLE protocol, and the preset instruction is used for triggering the second Bluetooth device to be actively connected with a mobile phone.
Further, in other embodiments of the present invention, the bluetooth connection system 200 further includes:
the second acquisition module is used for acquiring a historical Bluetooth device connection list and the geographic position of a corresponding preset application scene when the historical Bluetooth device connection list is acquired;
the third acquisition module is used for identifying each connectable historical Bluetooth device in the historical Bluetooth device connection list and acquiring an address number segment of each connectable historical Bluetooth device;
the combination module is used for combining address number segments corresponding to the connectable historical Bluetooth devices in the historical Bluetooth device connection list to form address number segment groups;
the first mapping model building module is used for building a mapping relation between each address number segment group and the geographic position to obtain a first mapping model, wherein the first mapping model is used for inputting the address number segment groups and outputting the corresponding geographic position, and the geographic position is used for representing the application scene.
Further, in other embodiments of the present invention, the application scene recognition module 24 includes:
a first obtaining unit, configured to obtain the first information and the second information, where the first information includes at least a first address number segment of the first bluetooth device, and the second information includes at least a second address number segment of the second bluetooth device;
the first combination unit is used for combining the first address number segment and the second address number segment to obtain a target address number segment group;
the first identification unit is used for inputting the target address number segment group into the first mapping model to obtain a corresponding target geographic position so as to identify a preset application scene where the current user is located.
Further, in other embodiments of the present invention, the control module 25 further includes:
a sixth judging unit, configured to obtain an operation state of the current mobile phone when the first bluetooth device is determined to be an external device, and determine whether the mobile phone receives a voice interaction request according to the operation state;
the disconnection unit is used for controlling the first Bluetooth device to be disconnected after the voice interaction request is accepted if the mobile phone is judged to receive the voice interaction request;
a seventh judging unit, configured to judge whether the second bluetooth device is a bluetooth headset;
an eighth judging unit, configured to obtain wearing information of the bluetooth headset if the second bluetooth device is determined to be the bluetooth headset, and judge whether a user wears the bluetooth headset;
and the second switching unit is used for controlling to switch from the external device to the Bluetooth headset if the user wearing the Bluetooth headset is judged.
Example IV
In another aspect, referring to fig. 3, a block diagram of an electronic device according to a fourth embodiment of the present invention is provided, including a memory 20, a processor 10, and a computer program 30 stored in the memory and capable of running on the processor, where the processor 10 implements the bluetooth connection method as described above when executing the computer program 30.
The processor 10 may be, among other things, a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, a microprocessor or other data processing chip for running program code or processing data stored in the memory 20, e.g. executing an access restriction program or the like, in some embodiments.
The memory 20 includes at least one type of readable storage medium including flash memory, a hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 20 may in some embodiments be an internal storage unit of the electronic device, such as a hard disk of the electronic device. The memory 20 may also be an external storage device of the electronic device in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like. Further, the memory 20 may also include both internal storage units and external storage devices of the electronic device. The memory 20 may be used not only for storing application software of an electronic device and various types of data, but also for temporarily storing data that has been output or is to be output.
It should be noted that the structure shown in fig. 3 does not constitute a limitation of the electronic device, and in other embodiments the electronic device may comprise fewer or more components than shown, or may combine certain components, or may have a different arrangement of components.
The embodiment of the invention also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor implements the bluetooth connection method as described above.
Those of skill in the art will appreciate that the logic and/or steps represented in the flow diagrams or otherwise described herein, e.g., a ordered listing of executable instructions for implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electrical device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium may even be paper or other suitable medium upon which the program is printed, as the program may be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.
It is to be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, may be implemented using any one or combination of the following techniques, as is well known in the art: discrete logic circuits having logic gates for implementing logic functions on data states, application specific integrated circuits having suitable combinational logic gates, programmable Gate Arrays (PGAs), field Programmable Gate Arrays (FPGAs), and the like.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The foregoing examples illustrate only a few embodiments of the invention, which are described in detail and are not to be construed as limiting the scope of the invention. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the invention, which are all within the scope of the invention. Accordingly, the scope of protection of the present invention is to be determined by the appended claims.
Claims (6)
1. The Bluetooth connection method is applied to a mobile phone and a plurality of Bluetooth devices, wherein the mobile phone is used for being in communication connection with the plurality of Bluetooth devices, the plurality of Bluetooth devices are paired through a Bluetooth low-power-consumption protocol, and a private communication command protocol is established, and the method is characterized by comprising the following steps:
acquiring a Bluetooth state of a mobile phone, and judging whether the mobile phone is connected with Bluetooth equipment according to the Bluetooth state;
if the mobile phone is connected with the Bluetooth device, acquiring first information of a first Bluetooth device which is connected currently and a to-be-connected list of the Bluetooth device;
updating the to-be-connected list of the Bluetooth equipment in real time, and judging whether other Bluetooth equipment capable of being connected exists or not;
if judging that other connectable Bluetooth devices exist, acquiring second information of a second connectable Bluetooth device, and identifying a preset application scene where a current user is located according to the first information and the second information;
according to the preset application scene, switching of the first Bluetooth device and the second Bluetooth device is controlled;
the step of controlling the switching between the first bluetooth device and the second bluetooth device according to the preset application scenario includes:
acquiring the preset application scene and judging whether the preset application scene is a home application scene or not;
if the preset application scene is judged to be a home application scene, judging whether the first Bluetooth device is an external device or not;
if the first Bluetooth device is judged not to be the external device, acquiring the running state of the current mobile phone, and judging whether the user is performing voice interaction or not according to the running state;
if the user is judged to be performing voice interaction, the connection between the mobile phone and the first Bluetooth device is maintained;
if the user is judged not to be in voice interaction, judging whether the second Bluetooth device is a play-out device or not;
if the second Bluetooth device is the external device, calling corresponding history pairing information according to a preset application scene where the identified current user is located, wherein the history pairing information comprises connection frequency of the second Bluetooth device when a to-be-connected list of the Bluetooth device updates the second Bluetooth device in the preset application scene, and the connection frequency is represented as frequency of switching from the first Bluetooth device of the non-external device to the second Bluetooth device of the external device when the first Bluetooth device of the non-external device and the second Bluetooth device of the external device are simultaneously present, and specifically, the connection frequency is the total number of switching times divided by the total number of switching times;
judging whether the connection frequency of the second Bluetooth device is larger than a target value;
if yes, controlling to switch from the first Bluetooth device to the second Bluetooth device;
if it is determined that there are other connectable bluetooth devices, acquiring second information of a connectable second bluetooth device, and identifying, according to the first information and the second information, a preset application scenario where a current user is located, where the step includes:
acquiring a history Bluetooth device connection list, and acquiring the geographic position of a corresponding preset application scene when the history Bluetooth device connection list is acquired;
identifying each connectable historical Bluetooth device in the historical Bluetooth device connection list, and acquiring an address number segment of each connectable historical Bluetooth device;
combining address number segments corresponding to each connectable historical Bluetooth device in the historical Bluetooth device connection list to form each address number segment group;
establishing a mapping relation between each address number segment group and the geographic position to obtain a first mapping model, wherein the first mapping model is used for inputting the address number segment groups and outputting the corresponding geographic positions, and the geographic positions are used for representing the application scene;
if it is determined that there are other connectable bluetooth devices, acquiring second information of a second connectable bluetooth device, and identifying, according to the first information and the second information, a preset application scenario where a current user is located includes:
acquiring the first information and the second information, wherein the first information at least comprises a first address number segment of the first Bluetooth device, and the second information at least comprises a second address number segment of the second Bluetooth device;
combining the first address number segment and the second address number segment to obtain a target address number segment group;
and inputting the target address number segment group into the first mapping model to obtain a corresponding target geographic position so as to identify a preset application scene where the current user is located.
2. The bluetooth connection method according to claim 1, wherein the step of determining whether the first bluetooth device is an external device if the preset application scenario is determined to be a home application scenario comprises:
when the first Bluetooth device is judged to be the external device, acquiring the running state of the current mobile phone, and judging whether the mobile phone receives a voice interaction request according to the running state;
if the mobile phone is judged to receive the voice interaction request, after the voice interaction request is accepted, the first Bluetooth device is controlled to be disconnected;
judging whether the second Bluetooth device is a Bluetooth headset or not;
if the second Bluetooth device is judged to be a Bluetooth headset, acquiring wearing information of the Bluetooth headset, and judging whether a user wears the Bluetooth headset or not;
if the user wearing the Bluetooth headset is judged, the control is switched to the Bluetooth headset from the external device.
3. The bluetooth connection method according to claim 2, wherein in the step of controlling to switch from the first bluetooth device to the second bluetooth device if the second bluetooth device is determined to be an external device, the first bluetooth device is controlled to send a preset instruction to the second bluetooth device through a BLE protocol, and the preset instruction is used for triggering the second bluetooth device to actively connect with a mobile phone.
4. The utility model provides a bluetooth connected system, is applied to among cell-phone and the bluetooth equipment of a plurality of, the cell-phone is used for with a plurality of bluetooth equipment communication connection, a plurality of bluetooth equipment is paired through bluetooth low energy agreement to establish private communication command protocol, its characterized in that, the system includes:
the first judging module is used for acquiring the Bluetooth state of the mobile phone and judging whether the mobile phone is connected with Bluetooth equipment or not according to the Bluetooth state;
the first acquisition module is used for acquiring first information of a first Bluetooth device which is currently connected and a to-be-connected list of the Bluetooth device if the mobile phone is judged to be connected with the Bluetooth device;
the second judging module is used for updating the Bluetooth equipment to-be-connected list in real time and judging whether other Bluetooth equipment capable of being connected exists or not;
the application scene identification module is used for acquiring second information of a second Bluetooth device which can be connected if judging that other Bluetooth devices which can be connected exist, and identifying a preset application scene where a current user is located according to the first information and the second information;
the control module is used for controlling the switching of the first Bluetooth device and the second Bluetooth device according to the preset application scene;
the control module includes:
the first judging unit is used for acquiring the preset application scene and judging whether the preset application scene is a home application scene or not;
the second judging unit is used for judging whether the first Bluetooth device is an external device or not if the preset application scene is judged to be a home application scene;
the third judging unit is used for acquiring the running state of the current mobile phone if the first Bluetooth device is judged not to be the external device, and judging whether the user performs voice interaction or not according to the running state;
the maintenance unit is used for maintaining the connection between the mobile phone and the first Bluetooth device if the user is judged to be performing voice interaction;
a fourth judging unit, configured to judge whether the second bluetooth device is an external device if it is judged that the user is not performing voice interaction;
a calling unit, configured to, if the second bluetooth device is determined to be an external device, call corresponding history pairing information according to a preset application scenario in which the identified current user is located, where the history pairing information is included in the preset application scenario, and when a to-be-connected list of the bluetooth device updates the second bluetooth device, a connection frequency of the second bluetooth device;
a fifth judging unit, configured to judge whether the connection frequency of the second bluetooth device is greater than a target value;
a first switching unit configured to control switching from the first bluetooth device to the second bluetooth device when it is determined that the connection frequency of the second bluetooth device is greater than a target value;
the bluetooth connection system further includes:
the second acquisition module is used for acquiring a historical Bluetooth device connection list and the geographic position of a corresponding preset application scene when the historical Bluetooth device connection list is acquired;
the third acquisition module is used for identifying each connectable historical Bluetooth device in the historical Bluetooth device connection list and acquiring an address number segment of each connectable historical Bluetooth device;
the combination module is used for combining address number segments corresponding to the connectable historical Bluetooth devices in the historical Bluetooth device connection list to form address number segment groups;
the first mapping model building module is used for building a mapping relation between each address number segment group and the geographic position to obtain a first mapping model, wherein the first mapping model is used for inputting the address number segment groups and outputting the corresponding geographic position, and the geographic position is used for representing the application scene;
the application scene identification module comprises:
a first obtaining unit, configured to obtain the first information and the second information, where the first information includes at least a first address number segment of the first bluetooth device, and the second information includes at least a second address number segment of the second bluetooth device;
the first combination unit is used for combining the first address number segment and the second address number segment to obtain a target address number segment group;
the first identification unit is used for inputting the target address number segment group into the first mapping model to obtain a corresponding target geographic position so as to identify a preset application scene where the current user is located.
5. A computer-readable storage medium, comprising:
the readable storage medium stores one or more programs which when executed by a processor implement the bluetooth connection method according to any of claims 1-3.
6. An electronic device comprising a memory and a processor, wherein:
the memory is used for storing a computer program;
the processor is configured to implement the bluetooth connection method according to any one of claims 1-3 when executing the computer program stored on the memory.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310466745.6A CN116193413B (en) | 2023-04-27 | 2023-04-27 | Bluetooth connection method, system, storage medium and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310466745.6A CN116193413B (en) | 2023-04-27 | 2023-04-27 | Bluetooth connection method, system, storage medium and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116193413A CN116193413A (en) | 2023-05-30 |
CN116193413B true CN116193413B (en) | 2023-08-15 |
Family
ID=86449358
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310466745.6A Active CN116193413B (en) | 2023-04-27 | 2023-04-27 | Bluetooth connection method, system, storage medium and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116193413B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117255332B (en) * | 2023-11-17 | 2024-03-19 | Tcl通讯科技(成都)有限公司 | Bluetooth connection control method and device, storage medium and electronic equipment |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102833679A (en) * | 2012-09-06 | 2012-12-19 | 北京天宇朗通通信设备股份有限公司 | Play method and device of multimedia file and mobile terminal |
JP2013172327A (en) * | 2012-02-21 | 2013-09-02 | Nec Access Technica Ltd | Presence-in-residence situation notification system, presence-in-residence situation notification method, and router |
CN105391477A (en) * | 2015-12-15 | 2016-03-09 | 小米科技有限责任公司 | A communication method and device between bluetooth devices |
CN105847582A (en) * | 2016-05-09 | 2016-08-10 | 南京云恩通讯科技有限公司 | Method for realizing automatic control of intelligent equipment by use of intelligent mobile phone |
CN111510886A (en) * | 2020-04-20 | 2020-08-07 | 肇庆小鹏汽车有限公司 | Vehicle-mounted Bluetooth control method, vehicle-mounted Bluetooth control system, vehicle and storage medium |
CN111698369A (en) * | 2020-06-12 | 2020-09-22 | 赵辛 | Music playing system |
CN113568320A (en) * | 2021-07-19 | 2021-10-29 | 珠海格力电器股份有限公司 | Device control method and device, electronic device and computer-readable storage medium |
CN113747406A (en) * | 2021-08-06 | 2021-12-03 | 深圳Tcl新技术有限公司 | Bluetooth connection method, device, Bluetooth equipment and storage medium |
WO2022166461A1 (en) * | 2021-02-08 | 2022-08-11 | 华为技术有限公司 | Method, apparatus and system for determining device position |
-
2023
- 2023-04-27 CN CN202310466745.6A patent/CN116193413B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2013172327A (en) * | 2012-02-21 | 2013-09-02 | Nec Access Technica Ltd | Presence-in-residence situation notification system, presence-in-residence situation notification method, and router |
CN102833679A (en) * | 2012-09-06 | 2012-12-19 | 北京天宇朗通通信设备股份有限公司 | Play method and device of multimedia file and mobile terminal |
CN105391477A (en) * | 2015-12-15 | 2016-03-09 | 小米科技有限责任公司 | A communication method and device between bluetooth devices |
CN105847582A (en) * | 2016-05-09 | 2016-08-10 | 南京云恩通讯科技有限公司 | Method for realizing automatic control of intelligent equipment by use of intelligent mobile phone |
CN111510886A (en) * | 2020-04-20 | 2020-08-07 | 肇庆小鹏汽车有限公司 | Vehicle-mounted Bluetooth control method, vehicle-mounted Bluetooth control system, vehicle and storage medium |
CN111698369A (en) * | 2020-06-12 | 2020-09-22 | 赵辛 | Music playing system |
WO2022166461A1 (en) * | 2021-02-08 | 2022-08-11 | 华为技术有限公司 | Method, apparatus and system for determining device position |
CN113568320A (en) * | 2021-07-19 | 2021-10-29 | 珠海格力电器股份有限公司 | Device control method and device, electronic device and computer-readable storage medium |
CN113747406A (en) * | 2021-08-06 | 2021-12-03 | 深圳Tcl新技术有限公司 | Bluetooth connection method, device, Bluetooth equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN116193413A (en) | 2023-05-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11812485B2 (en) | Bluetooth communication method and terminal | |
CN108551670B (en) | Bluetooth connection method and device and intelligent terminal | |
EP3343559B1 (en) | De-reverberation control method and device thereof | |
CN108399917B (en) | Speech processing method, apparatus and computer readable storage medium | |
CN106060261B (en) | Audio playing device and method | |
US11445285B2 (en) | Interactive control method and device of an earphone case, earphone case and storage medium | |
CN116193413B (en) | Bluetooth connection method, system, storage medium and device | |
CN109284080B (en) | Sound effect adjusting method and device, electronic equipment and storage medium | |
CN109525012B (en) | Charging device, charging control method, charging control system, and storage medium | |
CN110366062B (en) | TWS earphone in-place detection method and system | |
CN105848037A (en) | Headset and terminal device controlling method | |
CN103167184A (en) | Terminal device and control method thereof | |
CN111199743A (en) | Audio coding format determining method and device, storage medium and electronic equipment | |
CN105682008A (en) | Method and device for controlling terminal through earphone | |
CN111372159A (en) | Earphone play control method and earphone | |
CN105224494A (en) | Method for handover control and device | |
CN104837154A (en) | Wireless access point control method and device | |
CN104869206A (en) | Communication method and terminal | |
KR20200072196A (en) | Electronic device audio enhancement and method thereof | |
CN105679350A (en) | Audio playing method and device | |
CN108513196A (en) | A kind of wireless headset and its matching method | |
CN112806023B (en) | Control method of wireless earphone and related product | |
CN105306729A (en) | Method and system for adjusting call volume | |
CN111132117A (en) | Bluetooth connection method, device, vehicle and storage medium | |
CN111596881A (en) | Audio playing device, system, switching method, Bluetooth loudspeaker box and Bluetooth earphone |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |