CN110784858B - Bluetooth device control method and device, electronic device and storage medium - Google Patents

Bluetooth device control method and device, electronic device and storage medium Download PDF

Info

Publication number
CN110784858B
CN110784858B CN201910980889.7A CN201910980889A CN110784858B CN 110784858 B CN110784858 B CN 110784858B CN 201910980889 A CN201910980889 A CN 201910980889A CN 110784858 B CN110784858 B CN 110784858B
Authority
CN
China
Prior art keywords
bluetooth
application program
bluetooth device
state
activation
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
Application number
CN201910980889.7A
Other languages
Chinese (zh)
Other versions
CN110784858A (en
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.)
Realme Chongqing Mobile Communications Co Ltd
Original Assignee
Realme Chongqing Mobile Communications 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 Realme Chongqing Mobile Communications Co Ltd filed Critical Realme Chongqing Mobile Communications Co Ltd
Priority to CN201910980889.7A priority Critical patent/CN110784858B/en
Publication of CN110784858A publication Critical patent/CN110784858A/en
Application granted granted Critical
Publication of CN110784858B publication Critical patent/CN110784858B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • H04W76/00Connection management
    • H04W76/20Manipulation of established connections
    • H04W76/23Manipulation of direct-mode connections
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/20Manipulation of established connections
    • H04W76/28Discontinuous transmission [DTX]; Discontinuous reception [DRX]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The application discloses a Bluetooth device control method, a Bluetooth device control device, electronic equipment and a storage medium. The method comprises the following steps: acquiring the current state of the Bluetooth equipment when the starting of a target application program is detected; judging whether the current state of the Bluetooth equipment is an activated state or not, wherein the activated state indicates that audio data can be directly sent to the Bluetooth equipment for playing; if not, sending an activation instruction to the Bluetooth equipment, wherein the activation instruction is used for indicating the Bluetooth equipment to perform activation state. Through detection of the target application program and judgment of the state of the Bluetooth device, the Bluetooth device is activated when the target application program is started, so that play delay generated by activating the Bluetooth device when the Bluetooth device plays the audio data is reduced, and the use experience of a user is improved.

Description

Bluetooth device control method and device, electronic device and storage medium
Technical Field
The present disclosure relates to the field of electronic devices, and in particular, to a bluetooth device control method, apparatus, electronic device, and storage medium.
Background
With the development of electronic equipment technology and wireless connection technology, the technology development of bluetooth headset is more and more mature, and the application is more and more extensive. The Bluetooth earphone is connected to the electronic equipment through Bluetooth wireless connection, audio data transmitted by the electronic equipment can be received for audio playing, data transmission between the earphone and the electronic equipment is not dependent on wired connection any more, and the use convenience is greatly improved. However, in the existing bluetooth headset use process, higher data transmission delay is easy to occur, and user experience is affected.
Disclosure of Invention
The application provides a Bluetooth device control method, a Bluetooth device control device, an electronic device and a storage medium, so as to solve the problem of high delay generated when the Bluetooth device plays audio data of the electronic device.
In a first aspect, an embodiment of the present application provides a bluetooth device control method, where the method includes: acquiring the current state of the Bluetooth device when the starting of the target application program is detected; judging whether the current state of the Bluetooth equipment is an activated state or not, wherein the activated state indicates that audio data can be directly sent to the Bluetooth equipment for playing; if not, sending an activation instruction to the Bluetooth equipment, wherein the activation instruction is used for indicating the Bluetooth equipment to enter an activation state.
In a second aspect, an embodiment of the present application provides an apparatus for controlling a bluetooth device, which is applied to an electronic device, where the electronic device is connected with the bluetooth device through bluetooth, and the apparatus includes: the acquisition module is used for acquiring the current state of the Bluetooth device when the starting of the target application program is detected; the judging module is used for judging whether the current state of the Bluetooth device is an activated state or not, wherein the activated state indicates that audio data can be directly sent to the Bluetooth device for playing; and the control module is used for sending an activation instruction to the Bluetooth equipment, wherein the activation instruction is used for indicating the Bluetooth equipment to enter an activated state.
In a third aspect, embodiments of the present application provide an electronic device including one or more processors; a memory; one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to perform a method as described above as applied to an electronic device.
In a fourth aspect, embodiments of the present application provide a computer readable storage medium having program code stored therein, wherein the method described above is performed when the program code is run.
Compared with the prior art, the Bluetooth equipment control method, the Bluetooth equipment control device, the electronic equipment and the storage medium provided by the embodiment of the application acquire the current state of the Bluetooth equipment when the starting of the target application program is detected; judging whether the current state of the Bluetooth equipment is an activated state or not, wherein the activated state indicates that audio data can be directly sent to the Bluetooth equipment for playing; if not, sending an activation instruction to the Bluetooth equipment, wherein the activation instruction is used for indicating the Bluetooth equipment to perform activation state. Through detection of the target application program and judgment of the state of the Bluetooth device, the Bluetooth device is activated, so that play delay caused by activating the Bluetooth device when the Bluetooth device plays the audio data is reduced, and the use experience of a user is improved.
These and other aspects of the present application will be more readily apparent from the following description of the embodiments.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a method for controlling a bluetooth device according to an embodiment of the present application.
Fig. 2 is a flowchart of a method for controlling a bluetooth device according to another embodiment of the present application.
Fig. 3 is a flowchart of a method for controlling a bluetooth device according to yet another embodiment of the present application.
Fig. 4 is a flowchart illustrating a method for bluetooth device control according to yet another embodiment of the present application.
Fig. 5 is a functional block diagram of an apparatus for controlling a bluetooth device according to an embodiment of the present application.
Fig. 6 shows a block diagram of an electronic device for executing a method for bluetooth device control according to an embodiment of the present application.
Fig. 7 illustrates a storage medium for storing or carrying program codes for implementing a bluetooth device control method according to an embodiment of the present application.
Detailed Description
In order to enable those skilled in the art to better understand the present application, the following description will make clear and complete descriptions of the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application.
Bluetooth equipment can be connected with electronic equipment through bluetooth, carries out the transmission of data. The common Bluetooth equipment is provided with a Bluetooth sound box, a Bluetooth earphone and the like, wherein the Bluetooth earphone is connected with the electronic equipment through Bluetooth, and the electronic equipment can transmit audio data to the Bluetooth earphone for playing. However, when playing audio data, the bluetooth headset is prone to delay, and if the user is watching video or playing a game, the phenomenon that the sound and the picture are not synchronous can occur, so that the use experience of the user is affected.
One important factor for the delay is the time required for the bluetooth device to activate the process, thereby causing the bluetooth device to delay when playing audio data. In general, when the bluetooth device is used to play audio data, the audio processing module of the electronic device sends the audio data to the bluetooth module, and then the bluetooth module sends the audio data to the bluetooth device. The activation process may be that the electronic device sends a start instruction of the advanced audio distribution configuration file to the bluetooth device, and after waiting for the bluetooth device to reply to the start instruction of the advanced audio distribution configuration file, the electronic device confirms that the bluetooth device is activated, and is in an activated state, and can send audio data to the bluetooth device. This activation process takes a long time, about 200-600ms, and thus, a phenomenon of delay in playing audio data using a bluetooth device occurs. If the Bluetooth device can be activated in advance, when the Bluetooth device plays the audio data, the playing delay generated by activating the Bluetooth device can be reduced, so that the use experience of a user can be improved.
Therefore, the inventor proposes a Bluetooth device control method, a Bluetooth device control device, an electronic device and a storage medium, and the current state of the Bluetooth device is obtained when a target application program is detected to be started; judging whether the current state of the Bluetooth equipment is an activated state or not, wherein the activated state indicates that audio data can be directly sent to the Bluetooth equipment for playing; if not, sending an activation instruction to the Bluetooth equipment, wherein the activation instruction is used for indicating the Bluetooth equipment to perform activation state. Through detection of the target application program and judgment of the state of the Bluetooth device, the Bluetooth device is activated when the target application program is started, so that play delay caused by activating the Bluetooth device when the Bluetooth device plays the audio data is reduced, and the use experience of a user is improved.
The embodiments of the present application will be described in detail below.
Referring to fig. 1, an embodiment of the present application provides a method for controlling a bluetooth device, where an execution body of a processing flow described in this embodiment may be an electronic device. The method specifically comprises the following steps:
step S110, the current state of the Bluetooth device is obtained when the starting of the target application program is detected.
In general, an electronic device and a bluetooth device are connected through bluetooth to realize data transmission, wherein the electronic device may install various application programs to realize various functions. The electronic equipment detects the started application program, and if the starting of the target application program is detected, the state of the Bluetooth equipment connected with the electronic equipment can be obtained. The target application program can be some application programs selected by a user according to own requirements or some application programs sensitive to delay. For example, because the application programs such as video and game are sensitive to delay, when playing audio, if the time when the bluetooth device starts playing is delayed relative to the time when the electronic device actually starts playing, the audio played by the bluetooth device cannot correspond to the video displayed by the application program, and the user experiences the delay obviously, so that the target application program can be an application program such as video and game. The current state of the connected bluetooth device may be obtained when the electronic device detects that these applications are started, i.e. when the target application is started, to determine whether to activate the bluetooth device in advance to reduce the time delay in audio playback. The state of the bluetooth device may be an active state, a dormant state, etc.
Step S120, determining whether the current state of the bluetooth device is an active state, where the active state indicates that audio data can be directly sent to the bluetooth device for playing.
When the current state of the Bluetooth device is obtained, judging whether the current state of the Bluetooth device is an activated state, wherein if the Bluetooth device is in the activated state, audio data can be directly sent to the Bluetooth device for playing, namely, the operation of activating the Bluetooth device is not needed, when the audio data is sent to the Bluetooth module, the Bluetooth module can immediately send the audio data to the Bluetooth device, and delay is not generated when the audio data is played. If the Bluetooth device is not in an activated state, the electronic device cannot directly send the audio data to the Bluetooth device, only the audio data can be temporarily stored in the buffer area, and the audio data is sent to the Bluetooth device after the Bluetooth device is activated by the activation instruction, so that the audio data cannot be played in time due to the activation of the Bluetooth device, and play delay is generated.
Step S130, if not, an activation instruction is sent to the Bluetooth device, wherein the activation instruction is used for indicating the Bluetooth device to enter an activation state.
If the current state of the Bluetooth device is not the active state, an active instruction needs to be sent to the Bluetooth device to instruct the Bluetooth device to enter the active state. When the Bluetooth device is in an activated state, the audio data can be directly sent to the Bluetooth device for playing, and the Bluetooth device does not need to be activated again, so that the time delay can be reduced.
The activation instruction may be a start command of the advanced audio distribution configuration file, and may send audio data carrying the start command of the advanced audio distribution configuration file to the bluetooth device in advance to activate the bluetooth device, so as to directly play the audio data, and reduce play delay of the bluetooth device.
According to the Bluetooth equipment control method, when the starting of the target application program is detected, the current state of the Bluetooth equipment is obtained; judging whether the current state of the Bluetooth equipment is an activated state or not, wherein the activated state indicates that audio data can be directly sent to the Bluetooth equipment for playing; if not, sending an activation instruction to the Bluetooth equipment, wherein the activation instruction is used for indicating the Bluetooth equipment to enter an activation state. Through the detection of the target application program and the judgment of the state of the Bluetooth device, the Bluetooth device is activated when the target application program is detected to be started, so that delay in audio data transmission of the Bluetooth device and the electronic device is reduced when the target application program needs to be played through the Bluetooth device, and the use experience of a user is improved.
Referring to fig. 2, another embodiment of the present application provides a bluetooth device control method, which is based on the foregoing embodiment, and mainly describes a process of determining a target application, where the method may include:
step S210, detecting the starting of the application program, and judging whether the application program is a target application program.
The electronic device detects an application program installed on the electronic device in real time, and when the application program is detected to be started, the electronic device can judge whether the started application program is a target application program, wherein the target application program can be an application program sensitive to delay, for example, an application program for playing audio.
In some embodiments, determining whether the application is a target application may be determining whether the application is an application for audio playback. If the application program is an application program for playing audio data, such as a music application program, a video application program, a game application program, etc., the application program may transmit and play audio data with the connected bluetooth device, and at this time, a sound delay of the bluetooth device may occur, which brings bad use experience to the user. Thus, it is possible to determine whether or not the application program is a target application program by judging whether or not the started application program is an application program for audio playback.
Specifically, the application program for playing the audio data may be stored in advance as an information table, where the information table is the application program for playing the audio data. The application program for playing the audio data may be set according to the function of the application program, the application program with the music playing function, such as internet music, QQ music, etc., may be set in the information table, and the application program with the video playing function, such as an aiqi video, a Tencel video, etc., may be set in the information table.
The method can also be a setting option on the electronic equipment, a user can select the installed application program according to the self requirement, and the application program selected by the user is stored as an information table. The application selected by the user may be considered as an application for playing audio data. Then, upon detecting that an application is started, it may be determined whether the application is in the information table to determine whether the application is a target application; if the application is in the information table, the application can be determined to be the target application.
In some embodiments, some applications playing audio may not have high latency requirements, while some applications for social interaction may have high latency requirements, for example, voice information is usually received in WeChat, and when listening to voice, the Bluetooth device may have high latency when playing voice, which may affect the user experience. Determining whether the application is a target application may also be determining whether the application is a delay sensitive application. Specifically, when the starting of the application program is detected, the delay time corresponding to the application program can be obtained; judging whether the acquired delay time is smaller than a preset delay time or not, wherein the preset delay time is prestored and represents the time required for activating the Bluetooth equipment; and if the acquired delay time is smaller than the preset delay, judging that the application program is a target application program.
The correspondence between each application program and the delay time is prestored in the electronic device, and specifically, the correspondence between the application program installed on the electronic device and the delay time may be prestored, that is, the newly added application program on the electronic device is detected in real time, and if one application program is newly added, the correspondence between the application program and the delay time is stored. Wherein the delay time represents the maximum delay time acceptable to the application program. For example, the delay time corresponding to the application program a is 5ms, and if the delay time is greater than 5ms, the user can obviously feel when using the application program a, and the experience of the user is affected. When the fact that an application program is started on the electronic equipment is detected, the delay time corresponding to the application program can be obtained through the corresponding relation, after the delay time is obtained, the delay time is compared with the preset delay time, the preset delay time is the time required for activating the Bluetooth equipment in a pre-stored mode, if the delay time is smaller than the preset delay time, the time required for activating the Bluetooth equipment is larger than the maximum delay acceptable by the application program, therefore, the application program can be judged to be a target application program, and the started application program can be judged to be a target application program.
Step S220, if yes, the current state of the Bluetooth device is obtained.
When the starting of the target application program is detected, the current state of the Bluetooth device can be obtained, and the next operation is determined according to the current state of the Bluetooth device. The state of the bluetooth device may be an active state as well as a dormant state. If the Bluetooth device is in an activated state, the electronic device can directly send the audio data of the application program to the Bluetooth device for playing, and delay is not generated; if the state of the Bluetooth device is in the dormant state, the state indicates that the Bluetooth device needs to be activated when audio data of an application program is sent to the Bluetooth device, the audio data cannot be played in time, and the Bluetooth device needs to be played after being activated successfully. Thus, the current state of the bluetooth device can be acquired to determine the next operation.
Step S230, determining whether the current state of the bluetooth device is an active state, where the active state indicates that audio data can be directly sent to the bluetooth device for playing.
Step S240, if not, sending an activation instruction to the bluetooth device, where the activation instruction is used to instruct the bluetooth device to enter an activated state.
The steps S230 to S240 may refer to the corresponding parts of the foregoing embodiments, and are not repeated here.
According to the Bluetooth equipment control method, whether the application program is a target application program is judged by detecting the starting of the application program. If the application program is a target application program, acquiring the current state of the Bluetooth device; and judging whether the current state of the Bluetooth equipment is an activated state or not, wherein the activated state indicates that audio data can be directly sent to the Bluetooth equipment for playing. And if the current state of the Bluetooth equipment is not the activated state, sending an activation instruction to the Bluetooth equipment, wherein the activation instruction is used for indicating the Bluetooth equipment to enter the activated state. Through judging the target application program and judging the state of the Bluetooth device, activating operation is carried out on the Bluetooth device, so that play delay caused by activating the Bluetooth device when the Bluetooth device plays the audio data is reduced, and the use experience of a user is improved.
Referring to fig. 3, still another embodiment of the present application provides a control method for a bluetooth device, where, based on the foregoing embodiment, a process of determining whether a current state of the bluetooth device is an active state is mainly described, and the method may include:
step S310, the current state of the Bluetooth device is obtained when the starting of the target application program is detected.
Step S310 may refer to the corresponding parts of the foregoing embodiments, and will not be described herein.
Step S320, determining whether activation feedback information sent by the bluetooth device is received, if yes, executing step S330, and if not, executing step S350.
The state of the bluetooth device may be an active state or a dormant state. Before the Bluetooth device enters an activated state, the electronic device sends an activation instruction to the Bluetooth device, the Bluetooth device enters the activated state after receiving the activation instruction, and activation feedback information is sent to the electronic device so as to feed back that the Bluetooth device of the electronic device has entered the activated state. Similarly, before entering the sleep state, the bluetooth device may send a sleep instruction to the bluetooth device, where after receiving the sleep instruction, the bluetooth device sends sleep feedback information to the electronic device and enters the sleep state. The Bluetooth device feeds back to the electronic device that the Bluetooth device has entered the sleep state through the sleep feedback information.
Therefore, whether the electronic equipment receives the activation feedback information after being connected with the Bluetooth equipment in Bluetooth mode can be judged, and the current state of the Bluetooth equipment is determined. If the electronic device receives the activation feedback information sent by the bluetooth device, which indicates that the bluetooth device may still be in an activated state, step S330 is executed, and if the electronic device does not receive the activation feedback information sent by the bluetooth device, which indicates that no operation is performed to activate the bluetooth device, step S350 is executed.
Step S330, it is determined whether the sleep feedback information sent by the bluetooth device is received after the last activation feedback information is received, if yes, step S350 is executed, and if not, step S340 is executed.
After the electronic device receives the activation feedback information sent by the bluetooth device, a sleep feedback instruction may be received, and then the bluetooth device may enter a sleep state. Therefore, whether the electronic equipment receives the dormancy feedback information sent by the Bluetooth equipment after receiving the activation feedback information last time can be judged. For example, the time for the electronic device to make a bluetooth connection with a bluetooth device is 9:00, the current time is 10:00, the electronic device receives the two activation feedback instructions, and the two activation feedback instructions are respectively 9:10 and 9:40, thereby, it can be judged at 9: and after receiving the activation feedback information sent by the Bluetooth device, judging whether sleep feedback information is received, if the sleep feedback information is received, the step S350 is executed, if the sleep feedback information sent by the Bluetooth device is not received, the current state of the Bluetooth device is still in an activated state, and the step S340 is executed.
Step S340, determining that the current state of the bluetooth device is an active state.
When the electronic device receives the activation feedback information sent by the Bluetooth device, the electronic device can be considered to perform activation operation on the Bluetooth device, but it is not determined whether a sleep instruction is received after the Bluetooth device enters an activated state, and the Bluetooth device enters a sleep state. Therefore, whether the sleep feedback information sent by the Bluetooth device is received after the activation feedback information is received last time can be further judged, if the sleep feedback information sent by the Bluetooth device is not received, the Bluetooth device can be considered to be in an activated state all the time after being in the activated state, and then the current state of the Bluetooth device can be judged to be the activated state.
Step S350, determining that the current state of the bluetooth device is not an active state, and sending an activation instruction to the bluetooth device.
When the electronic device does not receive the activation feedback information sent by the Bluetooth device, the Bluetooth device can be considered to be not activated, the current state of the Bluetooth device can be judged to be not an activated state, and an activation instruction can be sent to the Bluetooth device to instruct the Bluetooth device to enter the activated state.
If the electronic device receives the activation feedback information sent by the bluetooth device, it further determines whether the sleep feedback information sent by the bluetooth device is received after the activation feedback information is received last time, if the sleep feedback information sent by the bluetooth device is received, it can be considered that the bluetooth device enters the sleep state after entering the activation state, it can be determined that the current state of the bluetooth device is not the activation state, and an activation instruction can be sent to the bluetooth device to instruct the bluetooth device to enter the activation state.
According to the Bluetooth equipment control method, whether the activation feedback information sent by the Bluetooth equipment is received is judged by acquiring the current state of the Bluetooth equipment when the target application program is detected to be started. And if the activation feedback information is not received, judging that the current state of the Bluetooth equipment is not an activation state, and sending an activation instruction to the Bluetooth equipment. If the activation feedback information sent by the Bluetooth equipment is received, judging whether dormancy feedback information sent by the Bluetooth equipment is received after the activation feedback information is received last time; if the dormancy feedback information is received, judging that the current state of the Bluetooth equipment is not an activation state, and sending an activation instruction to the Bluetooth equipment; and if the dormancy feedback information is not received, judging that the current state of the Bluetooth equipment is an activated state. And comprehensively determining the current state of the Bluetooth device by whether the activation feedback information and the dormancy feedback information sent by the Bluetooth device are received, and sending an activation instruction to the Bluetooth device to activate the Bluetooth device when the current state of the Bluetooth device is not the activation state, so that delay is reduced and the use experience of a user is improved when audio data is played.
Referring to fig. 4, still another embodiment of the present application provides a control method of a bluetooth device, where, based on the foregoing embodiment, a process of sending an activation instruction to the bluetooth device is described with emphasis, and the method may include:
step S410, acquiring the current state of the bluetooth device when the start of the target application is detected.
Step S420, determining whether the current state of the bluetooth device is an active state, where the active state indicates that audio data can be directly sent to the bluetooth device for playing.
The steps S410 to S420 may refer to the corresponding parts of the foregoing embodiments, and are not repeated here.
Step S430, if not, the audio data processing module sends mute data to the Bluetooth module.
If the current state of the Bluetooth device is not an active state, the Bluetooth device needs to be activated. The electronic device is provided with an audio data processing module which is used for sending audio data to a Bluetooth module of the electronic device. When the Bluetooth device is activated, the Bluetooth module of the electronic device is required to send an activation instruction to the Bluetooth device, the Bluetooth device receives the activation instruction and responds to the activation instruction, and activation feedback information is sent to the Bluetooth module of the electronic device, so that the Bluetooth device enters an activation state. Because the Bluetooth architecture automatically sends an activation instruction to the Bluetooth equipment after receiving the audio data so as to activate the Bluetooth equipment, and then the mute data is sent to the Bluetooth equipment after the activation, the mute data can be sent to the Bluetooth equipment, and the Bluetooth equipment is activated in advance through the mute data. The mute data is audio data with the volume of 0, so that the Bluetooth equipment is activated, and noise playing is not generated in the Bluetooth equipment.
Step S440, the Bluetooth module receives the mute data and sends an activation instruction to the Bluetooth device according to the mute data.
When receiving the mute data, the Bluetooth module of the electronic device can send an activation instruction to the Bluetooth device according to the mute data so as to activate the Bluetooth device, and the Bluetooth device is prevented from being activated when an application program plays audio data, so that the delay of playing the audio data through the Bluetooth device is reduced.
When the Bluetooth device is in an activated state, if audio data transmission is not performed within a preset time, the Bluetooth device enters a dormant state. The time that the bluetooth device is in the active state may be prolonged by transmitting the mute data. Specifically, if audio data of an application program is not transmitted to the Bluetooth equipment within a first preset time, transmitting mute data to the Bluetooth equipment every other first preset time; and if the audio data of the application program is not transmitted to the Bluetooth equipment within a second preset time, stopping transmitting the mute data, wherein the second preset time is longer than the first preset time. Therefore, the time delay generated by the Bluetooth device when playing the audio data can be reduced by prolonging the time that the Bluetooth device is in the active state.
The first preset time may be a time required for the bluetooth device to enter the sleep state from the active state under the condition that no data is transmitted, that is, if the bluetooth device is in the active state but no data is transmitted, the bluetooth device enters the sleep state from the active state after the first preset time. If the audio data of the target application program is not transmitted to the Bluetooth equipment within the first preset time, the Bluetooth equipment enters a dormant state, so that the mute data can be transmitted to the Bluetooth equipment to prolong the time that the Bluetooth equipment is in an activated state; the mute data may be transmitted once every first predetermined time interval. If the audio data of the target application program is still not transmitted to the Bluetooth device within the second preset time, the Bluetooth device is indicated to have no audio data to be played temporarily, and the mute data can be stopped to be sent, so that the Bluetooth device is instructed to enter a dormant state, and the power consumption of the Bluetooth device is saved. It is to be appreciated that the second preset time is greater than the first preset time, and in some embodiments, the second preset time may be a positive integer multiple of the first preset time, and the second preset time may also be set according to actual requirements, which is not limited herein specifically.
For example, the first preset time is 1s, which means that if the bluetooth device does not transmit data with the electronic device within 1s, the bluetooth device will enter a sleep state, and the second preset time may be 3s. If the electronic device does not send the audio data of the target application program to the bluetooth device within 1s, the mute data is sent to the bluetooth device once every 1s to maintain the active state of the bluetooth device, if the audio data of the target application program is not sent to the bluetooth device within 3s, the mute data is stopped being sent, and if the audio data of the target application program is not sent to the bluetooth device within 1s, the bluetooth device enters the sleep state. Therefore, the time of the Bluetooth device in the activated state is prolonged by 3s, namely, the second preset time is prolonged, so that the time delay generated when the Bluetooth device plays the audio data is reduced.
According to the Bluetooth equipment control method, the current state of the Bluetooth equipment is obtained when the starting of the target application program is detected; judging whether the current state of the Bluetooth equipment is an activated state or not, wherein the activated state indicates that audio data can be directly sent to the Bluetooth equipment for playing; if not, the audio data processing module sends mute data to the Bluetooth module; and the Bluetooth module receives the mute data and sends an activation instruction to the Bluetooth device according to the mute data. And the Bluetooth module sends an activation instruction to the Bluetooth device according to the mute data, so as to activate the Bluetooth device, thereby reducing play delay generated by activating the Bluetooth device when the Bluetooth device plays the audio data, and improving the use experience of a user.
Referring to fig. 5, a bluetooth device control apparatus 500 provided in an embodiment of the present application is shown, where the apparatus 500 includes an obtaining module 510, a judging module 520, and a control module 530.
The obtaining module 510 is configured to obtain a current state of the bluetooth device when the target application is detected to be started; the judging module 520 is configured to determine whether the current state of the bluetooth device is an active state, where the active state indicates that audio data can be directly sent to the bluetooth device for playing; the control module 530 is configured to send an activation instruction to the bluetooth device, where the activation instruction is configured to instruct the bluetooth device to enter an active state.
Further, before the obtaining module 510 detects that the target application is started to obtain the current state of the bluetooth device, the determining module 520 is further configured to determine, when the application is detected to be started, whether the application is an application for performing audio playing; if yes, judging that the starting of the target application program is detected.
Further, the correspondence between each application program and the delay time is prestored, and before the judgment detects that the target application program is started, the judgment module 520 is further configured to obtain the delay time corresponding to the starting application program; judging whether the acquired delay time is smaller than a preset delay time or not, wherein the preset delay time is prestored to represent the time required for activating the Bluetooth equipment; if yes, judging the application program as a target application program.
Further, the determining module 520 is further configured to determine whether activation feedback information sent by the bluetooth device is received; if the activation feedback information is not received, judging that the current state of the Bluetooth equipment is not an activation state; if the activation feedback information is received, judging whether dormancy feedback information sent by Bluetooth equipment is received after the activation feedback information is received last time; if the dormancy feedback information is not received, judging that the current state of the Bluetooth equipment is an activated state; and if the dormancy feedback information is received, judging that the current state of the Bluetooth equipment is not an activated state.
Further, the electronic device includes an audio processing module and a bluetooth module, and the control module 530 is further configured to control the audio processing module to send mute data to the bluetooth module; and the Bluetooth module receives the mute data and sends an activation instruction to the Bluetooth device according to the mute data.
Further, the activation instruction is a start command of the advanced audio distribution configuration file.
Further, if the bluetooth device is in an active state, the control module 530 is further configured to send mute data to the bluetooth device every a first preset time if audio data of the target application is not transmitted to the bluetooth device within the first preset time; and if the audio data of the target application program are not transmitted to the Bluetooth equipment within a second preset time, stopping transmitting the mute data, wherein the second preset time is longer than the first preset time.
It should be noted that, for convenience and brevity of description, specific working processes of the apparatus and modules described above may refer to corresponding processes in the foregoing method embodiments, which are not described herein again.
In summary, in the bluetooth device control method provided by the present application, the current state of the bluetooth device is obtained when the start of the target application is detected; judging whether the current state of the Bluetooth equipment is an activated state or not, wherein the activated state indicates that audio data can be directly sent to the Bluetooth equipment for playing; if not, sending an activation instruction to the Bluetooth equipment, wherein the activation instruction is used for indicating the Bluetooth equipment to perform activation state. Through detection of the target application program and judgment of the state of the Bluetooth device, the Bluetooth device is activated, so that play delay caused by activating the Bluetooth device when the Bluetooth device plays the audio data is reduced, and the use experience of a user is improved.
In the several embodiments provided herein, the illustrated or discussed coupling or direct coupling or communication connection of the modules to each other may be through some interfaces, indirect coupling or communication connection of devices or modules, electrical, mechanical, or other forms.
In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module. The integrated modules may be implemented in hardware or in software functional modules.
Referring to fig. 6, a block diagram of an electronic device according to an embodiment of the present application is shown. The electronic device 600 may be a smart phone, tablet, electronic book, or other electronic device capable of running applications. The electronic device 600 in the present application may include one or more of the following components: a processor 610, a memory 620, and one or more application programs, wherein the one or more application programs may be stored in the memory 620 and configured to be executed by the one or more processors 610, the one or more program(s) configured to perform the method as described in the foregoing method embodiments.
Processor 610 may include one or more processing cores. The processor 610 utilizes various interfaces and lines to connect various portions of the overall electronic device 600, perform various functions of the electronic device 600, and process data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 620, and invoking data stored in the memory 620. Alternatively, the processor 610 may be implemented in hardware in at least one of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), programmable logic array (Programmable Logic Array, PLA). The processor 610 may integrate one or a combination of several of a central processing unit (Central Processing Unit, CPU), an image processor (Graphics Processing Unit, GPU), and a modem, etc. The CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for being responsible for rendering and drawing of display content; the modem is used to handle wireless communications. It will be appreciated that the modem may not be integrated into the processor 610 and may be implemented solely by a single communication chip.
The Memory 620 may include a random access Memory (Random Access Memory, RAM) or a Read-Only Memory (Read-Only Memory). Memory 620 may be used to store instructions, programs, code sets, or instruction sets. The memory 620 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the various method embodiments described below, etc. The storage data area may also store data created by the electronic device 600 in use (e.g., phonebook, audiovisual data, chat log data), and the like.
Referring to fig. 7, a block diagram of a computer readable storage medium according to an embodiment of the present application is shown. The computer readable storage medium 700 has stored therein program code that can be invoked by a processor to perform the methods described in the method embodiments described above.
The computer readable storage medium 700 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 700 comprises a non-transitory computer readable medium (non-transitory computer-readable storage medium). The computer readable storage medium 700 has memory space for program code 710 that performs any of the method steps described above. The program code can be read from or written to one or more computer program products. Program code 710 may be compressed, for example, in a suitable form.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting thereof; although the present application has been described in detail with reference to the foregoing embodiments, one of ordinary skill in the art will appreciate that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not drive the essence of the corresponding technical solutions to depart from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (10)

1. A bluetooth device control method, applied to an electronic device, where the electronic device is connected with bluetooth device by bluetooth, the method comprising:
acquiring the current state of the Bluetooth device when a target application program is detected to be started, wherein the target application program characterizes an application program needing to reduce delay;
judging whether the current state of the Bluetooth equipment is an activated state or not, wherein the activated state indicates that audio data can be directly sent to the Bluetooth equipment for playing;
if not, sending an activation instruction to the Bluetooth equipment, wherein the activation instruction is used for indicating the Bluetooth equipment to enter an activation state.
2. The method of claim 1, wherein prior to the acquiring the current state of the bluetooth device upon detecting the start of the target application, further comprising:
when the starting of the application program is detected, judging whether the application program is an application program for playing audio;
if yes, judging that the starting of the target application program is detected.
3. The method according to claim 2, wherein the correspondence between each application program and the delay time is prestored, and the determining further comprises, before the target application program is detected to be started:
acquiring delay time corresponding to a started application program;
judging whether the acquired delay time is smaller than a preset delay time or not, wherein the preset delay time is prestored to represent the time required for activating the Bluetooth equipment;
if yes, judging the application program as a target application program.
4. The method of claim 1, wherein said determining whether the current state of the bluetooth device is an active state comprises:
judging whether activation feedback information sent by the Bluetooth equipment is received or not;
if the activation feedback information is not received, judging that the current state of the Bluetooth equipment is not an activation state;
if the activation feedback information is received, judging whether dormancy feedback information sent by Bluetooth equipment is received after the activation feedback information is received last time;
if the dormancy feedback information is not received, judging that the current state of the Bluetooth equipment is an activated state;
and if the dormancy feedback information is received, judging that the current state of the Bluetooth equipment is not an activated state.
5. The method of claim 1, wherein the electronic device comprises an audio processing module and a bluetooth module, and wherein the sending the activation instruction to the bluetooth device comprises:
the audio processing module sends mute data to the Bluetooth module;
and the Bluetooth module receives the mute data and sends an activation instruction to the Bluetooth device according to the mute data.
6. The method of claim 5, wherein the activate instruction is a start command of an advanced audio distribution profile.
7. The method of any of claims 1-6, wherein if the bluetooth device is active, the method further comprises:
if the audio data of the target application program are not transmitted to the Bluetooth equipment within the first preset time, transmitting mute data to the Bluetooth equipment every other first preset time;
and if the audio data of the target application program are not transmitted to the Bluetooth equipment within a second preset time, stopping transmitting the mute data, wherein the second preset time is longer than the first preset time.
8. A bluetooth audio playback apparatus, characterized in that it is applied to an electronic device, said electronic device being bluetooth-connected with a bluetooth device, said apparatus comprising:
the acquisition module is used for acquiring the current state of the Bluetooth device when the starting of a target application program is detected, wherein the target application program characterizes the application program needing to reduce the delay;
the judging module is used for judging whether the current state of the Bluetooth device is an activated state or not, wherein the activated state indicates that audio data can be directly sent to the Bluetooth device for playing;
and the control module is used for sending an activation instruction to the Bluetooth equipment, wherein the activation instruction is used for indicating the Bluetooth equipment to enter an activated state.
9. An electronic device, the electronic device comprising:
one or more processors;
a memory electrically connected to the one or more processors;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to perform the method of any of claims 1-7.
10. A computer readable storage medium having stored therein program code which is callable by a processor to perform the method of any one of claims 1 to 7.
CN201910980889.7A 2019-10-10 2019-10-10 Bluetooth device control method and device, electronic device and storage medium Active CN110784858B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910980889.7A CN110784858B (en) 2019-10-10 2019-10-10 Bluetooth device control method and device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910980889.7A CN110784858B (en) 2019-10-10 2019-10-10 Bluetooth device control method and device, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN110784858A CN110784858A (en) 2020-02-11
CN110784858B true CN110784858B (en) 2023-05-09

Family

ID=69385600

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910980889.7A Active CN110784858B (en) 2019-10-10 2019-10-10 Bluetooth device control method and device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN110784858B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111385781B (en) * 2020-03-03 2023-02-24 广东小天才科技有限公司 File sharing method, smart watch, storage medium and electronic device
CN111432304B (en) * 2020-03-20 2022-06-17 江苏紫米电子技术有限公司 Earphone control method, earphone control device, electronic equipment, earphone control system and storage medium
WO2022057322A1 (en) * 2020-09-16 2022-03-24 海信视像科技股份有限公司 Display method and display device
CN112135280A (en) * 2020-09-22 2020-12-25 海信视像科技股份有限公司 Bluetooth device playing control method and display device
CN113542852B (en) * 2021-07-13 2023-03-24 海信视像科技股份有限公司 Display device and control method for fast pairing with external device
CN112286483A (en) * 2020-10-29 2021-01-29 维沃移动通信有限公司 Audio playing control method and device and electronic equipment
CN113099428A (en) * 2021-03-02 2021-07-09 北京小米移动软件有限公司 Audio information transmission method, audio information transmission device, and storage medium
CN115474238A (en) * 2021-06-10 2022-12-13 华为技术有限公司 Data stream transmission method, device, communication device and storage medium
CN113692091B (en) * 2021-08-11 2024-04-02 深圳市智岩科技有限公司 Equipment control method, device, terminal equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002271341A (en) * 2001-03-07 2002-09-20 Toshiba Corp Bluetooth network communication method and bluetooth apparatus for use in bluetooth network
CN105430547A (en) * 2015-10-23 2016-03-23 小米科技有限责任公司 Dormancy method and apparatus of bluetooth earphones
CN105706379A (en) * 2013-11-11 2016-06-22 Lg电子株式会社 Method and apparatus for bluetooth connection
CN109151194A (en) * 2018-08-14 2019-01-04 Oppo广东移动通信有限公司 Data transmission method, device, electronic equipment and storage medium
CN110166967A (en) * 2019-05-30 2019-08-23 深圳云里物里科技股份有限公司 A kind of data communications method of electronic shelf label, system and associated component

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090233590A1 (en) * 2008-03-13 2009-09-17 Nokia Corporation Methods and devices for controlling receivers
KR102097987B1 (en) * 2013-01-31 2020-04-07 삼성전자주식회사 Apparatus and method for processing data of bluetooth in a portable terminal

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002271341A (en) * 2001-03-07 2002-09-20 Toshiba Corp Bluetooth network communication method and bluetooth apparatus for use in bluetooth network
CN105706379A (en) * 2013-11-11 2016-06-22 Lg电子株式会社 Method and apparatus for bluetooth connection
CN105430547A (en) * 2015-10-23 2016-03-23 小米科技有限责任公司 Dormancy method and apparatus of bluetooth earphones
CN109151194A (en) * 2018-08-14 2019-01-04 Oppo广东移动通信有限公司 Data transmission method, device, electronic equipment and storage medium
CN110166967A (en) * 2019-05-30 2019-08-23 深圳云里物里科技股份有限公司 A kind of data communications method of electronic shelf label, system and associated component

Also Published As

Publication number Publication date
CN110784858A (en) 2020-02-11

Similar Documents

Publication Publication Date Title
CN110784858B (en) Bluetooth device control method and device, electronic device and storage medium
CN108683798B (en) Sound output control method and mobile terminal
CN109388367B (en) Sound effect adjusting method and device, electronic equipment and storage medium
CN107992282B (en) Audio data processing method and device, computer device and readable storage device
JP6742465B2 (en) Method, device and bluetooth speaker for continuous wakeup delay reduction in bluetooth speaker
CN109284080B (en) Sound effect adjusting method and device, electronic equipment and storage medium
CN109151194B (en) Data transmission method, device, electronic equipment and storage medium
CN109275129B (en) Communication processing method, communication processing device, electronic equipment and storage medium
CN109343902B (en) Audio processing assembly operation method and device, terminal and storage medium
CN110876180B (en) Power consumption processing method and device, electronic equipment and computer readable medium
CN109005582B (en) Transmission power adjusting method, device, electronic equipment and storage medium
CN108509176A (en) A kind of method, apparatus of playing audio-fequency data, storage medium and intelligent terminal
CN109271131B (en) Earphone control method and device, electronic equipment and storage medium
EP4047471A1 (en) Audio data processing method, server, and storage medium
CN109271129B (en) Sound effect adjusting method and device, electronic equipment and storage medium
JP6430527B6 (en) Data processing method, data processing system, and server
CN107483734B (en) Volume adjusting method and device, terminal equipment and storage medium
CN110989816B (en) Application processing method and device and storage medium
CN107483855B (en) Television audio control method, television and computer readable storage medium
CN115665671A (en) Audio data sharing method and device, electronic equipment and storage medium
CN113660599B (en) Speaker control method and device, mobile terminal and storage medium
CN113038317B (en) Earphone control method and device, bluetooth earphone and storage medium
WO2021072760A1 (en) Touch screen reporting method and apparatus, electronic device, and storage medium
CN114422965B (en) Information interaction method and device, storage medium and electronic equipment
CN109831714B (en) Method and device for identifying earphone keys and electronic equipment

Legal Events

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