CN110784858A - 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
CN110784858A
CN110784858A CN201910980889.7A CN201910980889A CN110784858A CN 110784858 A CN110784858 A CN 110784858A CN 201910980889 A CN201910980889 A CN 201910980889A CN 110784858 A CN110784858 A CN 110784858A
Authority
CN
China
Prior art keywords
bluetooth
bluetooth equipment
application program
activation
state
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.)
Granted
Application number
CN201910980889.7A
Other languages
Chinese (zh)
Other versions
CN110784858B (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 and 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, wherein the activated state represents that audio data can be directly sent to the Bluetooth equipment for playing; and if not, sending an activation instruction to the Bluetooth equipment, wherein the activation instruction is used for indicating the Bluetooth equipment to carry out an activation state. Through the detection to target application program to and the judgement of bluetooth equipment's state, activate the operation to bluetooth equipment when target application program starts, because of the broadcast delay that the broadcast produced of activation bluetooth equipment when reducing bluetooth equipment and playing audio data, thereby promote user's use and experience.

Description

Bluetooth device control method and device, electronic device and storage medium
Technical Field
The present application relates to the field of electronic device technologies, and in particular, to a bluetooth device control method and apparatus, an electronic device, and a storage medium.
Background
With the development of electronic equipment technology and wireless connection technology, the technology development of the bluetooth headset is more mature and the application is more and more extensive. Wherein, bluetooth headset passes through bluetooth wireless connection to electronic equipment, alright receive the audio data of electronic equipment transmission and carry out the audio playback, and data transmission between earphone and the electronic equipment no longer relies on wired connection, has greatly improved the convenience of using. However, in the use process of the existing bluetooth headset, high 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 higher 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, including: acquiring the current state of the Bluetooth equipment when the target application program is detected to be started; judging whether the current state of the Bluetooth equipment is an activated state, wherein the activated state represents that audio data can be directly sent to the Bluetooth equipment for playing; and 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 controlled by a bluetooth device, which is applied to an electronic device, where the electronic device is bluetooth-connected to the bluetooth device, and the apparatus includes: the acquisition module is used for acquiring the current state of the Bluetooth equipment when the starting of a target application program is detected; the judging module is used for judging whether the current state of the Bluetooth equipment is an activated state, wherein the activated state represents that audio data can be directly sent to the Bluetooth equipment for playing; and the control module is used for sending an activation instruction to the Bluetooth equipment, and the activation instruction is used for indicating the Bluetooth equipment to enter an activation state.
In a third aspect, an embodiment of the present application provides an electronic device, which includes 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 programs configured to perform the method as applied to an electronic device, as described above.
In a fourth aspect, the present application provides a computer-readable storage medium having a program code stored therein, wherein the program code performs the above method when running.
Compared with the prior art, the Bluetooth device control method, the device, the electronic device and the storage medium provided by the embodiment of the application acquire 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, wherein the activated state represents that audio data can be directly sent to the Bluetooth equipment for playing; and if not, sending an activation instruction to the Bluetooth equipment, wherein the activation instruction is used for indicating the Bluetooth equipment to carry out an activation state. Through the detection to target application program to and the judgement of bluetooth equipment's state, activate the operation to bluetooth equipment, because of the broadcast delay that the broadcast produced of activation bluetooth equipment when reducing bluetooth equipment and playing audio data, thereby promote user's use and experience.
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 in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart illustrating a method for controlling a bluetooth device according to an embodiment of the present application.
Fig. 2 is a flowchart illustrating a method for controlling a bluetooth device according to another embodiment of the present application.
Fig. 3 is a flowchart illustrating a method for controlling a bluetooth device according to another embodiment of the present application.
Fig. 4 is a flowchart illustrating a method for controlling a bluetooth device according to still another embodiment of the present application.
Fig. 5 is a functional block diagram of an apparatus controlled by 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 controlling a bluetooth device according to an embodiment of the present application.
Fig. 7 illustrates a storage medium 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 make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
The Bluetooth device can be connected with the electronic device through Bluetooth to transmit data. Wherein, common bluetooth equipment has bluetooth speaker or bluetooth headset etc. and wherein, the bluetooth headset passes through the bluetooth and is connected the back with electronic equipment, and electronic equipment can broadcast for bluetooth headset with audio data transmission. However, when the bluetooth headset plays audio data, some delay is easy to occur, and if a user watches video or plays games, the phenomenon that sound and pictures are not synchronous occurs, which affects the use experience of the user.
An important factor for the delay is the time required for the bluetooth device to activate, and thus the delay occurs when the bluetooth device plays audio data. Generally, when the bluetooth device is used for playing 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 can send audio data to the bluetooth device only when the electronic device is in an activated state. The activation process takes a long time, which is about 200 to 600ms, and thus, a phenomenon of delay in playing audio data by using the bluetooth device occurs. If can activate bluetooth equipment in advance, then when carrying out audio data's broadcast through bluetooth equipment, then can reduce because of the produced broadcast delay of activation bluetooth equipment to can promote user's experience of using.
Therefore, the inventor proposes a bluetooth device control method, apparatus, electronic device and storage medium in the present application, and obtains a current state of the bluetooth device when detecting that a target application is started; judging whether the current state of the Bluetooth equipment is an activated state, wherein the activated state represents that audio data can be directly sent to the Bluetooth equipment for playing; and if not, sending an activation instruction to the Bluetooth equipment, wherein the activation instruction is used for indicating the Bluetooth equipment to carry out an activation state. Through the detection to target application program to and the judgement of bluetooth equipment's state, activate the operation to bluetooth equipment promptly when target application program starts, because of the broadcast delay that the broadcast that the bluetooth equipment produced when reducing bluetooth equipment and playing audio data, thereby promote user's use and experience.
The following will describe embodiments of the present application in detail.
Referring to fig. 1, an embodiment of the present application provides a bluetooth device control method, and an execution main body of a processing flow described in this embodiment may be an electronic device. The method comprises the following steps:
and step S110, acquiring the current state of the Bluetooth device when the starting of the target application program is detected.
Generally, an electronic device and a bluetooth device are connected through bluetooth to realize data transmission, wherein the electronic device may be installed with various applications to realize various functions. The electronic equipment detects the started application program, and if the target application program is detected to be started, the state of the Bluetooth equipment connected with the electronic equipment can be acquired. The target application program may be some application programs selected by the user according to the user's own needs, or some application programs sensitive to delay. For example, since the application programs such as video and game are sensitive to the delay, when the audio is played, if the time for the bluetooth device to start playing is delayed relative to the time for the electronic device to actually start playing, the audio played by the bluetooth device and the video displayed by the application program cannot correspond to each other, and the user feels the delay significantly, so the target application program may be the application programs such as video and game. Then when the electronic device detects that these applications are started, i.e., the target application is started, the current status of the connected bluetooth device may be obtained to determine whether to activate the bluetooth device in advance to reduce the 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 acquired, whether the current state of the Bluetooth device is an activated state or not is judged, wherein if the Bluetooth device is in the activated state, the audio data can be directly sent to the Bluetooth device for playing, namely, the Bluetooth device does not need to be activated. If the bluetooth device is not in the activated state, the electronic device cannot directly send the audio data to the bluetooth device, and only the audio data is temporarily stored in the buffer area, and an activation instruction needs to be sent to activate the bluetooth device and then send the audio data to the bluetooth device, so that the audio data cannot be played in time due to the activation of the bluetooth device, and therefore playing delay is generated.
Step S130, if not, sending an activation instruction 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 indicate the bluetooth device to enter the active state. When the Bluetooth equipment is in an activated state, the audio data can be directly sent to the Bluetooth equipment to be played, the Bluetooth equipment does not need to be activated again, and therefore time delay can be reduced.
The activation instruction may be a start command of an advanced audio distribution configuration file, and the bluetooth device may be activated by sending audio data carrying the start command of the advanced audio distribution configuration file to the bluetooth device in advance, so as to directly play the audio data, and reduce the play delay of the bluetooth device.
According to the control method of the Bluetooth equipment, the current state of the Bluetooth equipment is obtained when the starting of a target application program is detected; judging whether the current state of the Bluetooth equipment is an activated state, wherein the activated state represents that audio data can be directly sent to the Bluetooth equipment for playing; and 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 to target application program to and the judgement of bluetooth equipment's state, activate the operation to bluetooth equipment promptly when detecting target application program and start, when reducing target application program and need carry out the audio playback through bluetooth equipment, the delay during bluetooth equipment and electronic equipment audio data transmission promotes user's use and experiences.
Referring to fig. 2, another embodiment of the present application provides a bluetooth device control method, where the present embodiment focuses on the process of determining a target application on the basis of the foregoing embodiment, and the method may include:
step S210, detecting the application program starting, and determining whether the application program is a target application program.
The electronic device detects an application installed on the electronic device in real time, and when detecting that the application is started, can determine whether the started application is a target application, where the target application may be an application sensitive to delay, for example, an application 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 is an application for playing audio data, such as a music application, a video application, a game application, etc., the audio data may be transmitted and played with a connected bluetooth device, and at this time, a sound delay of the bluetooth device may occur, which may cause a poor user experience for the user. Therefore, whether the started application program is the application program for playing the audio can be judged to determine whether the application program is the target application program.
Specifically, the application program for playing the audio data may be stored in advance as an information table, and 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, and the application program with the music playing function, such as internet music, and QQ music, may be set in the information table, and the application program with the video playing function, such as an arcade video, a Tencent video, and the like, may also be set in the information table.
Or a setting option on the electronic device, the user can select the installed application program according to the own requirement, and the application program selected by the user is stored as the information table. The application selected by the user may be considered as an application for playing the audio data. Then, upon detecting the application startup, it may be determined whether the application is in the information table to determine whether the application is a target application; if the application program is in the information table, it may be determined that the application program is a target application program.
In some embodiments, some applications performing audio playing may not have high requirements for delay, while some applications for social interaction may have high requirements for delay, for example, voice information is usually received in WeChat, and if the delay of the Bluetooth device in playing voice is high while listening to voice, the user experience may be affected. Then determining whether the application is a target application may also be determining whether the application is a delay sensitive application. Specifically, when detecting that an application program is started, obtaining a delay time corresponding to the application program; judging whether the acquired delay time is less than a preset delay, wherein the preset delay is prestored time required for activating the Bluetooth device; and if the acquired delay time is less than the preset delay time, judging that the application program is a target application program.
The method includes that a corresponding relationship between each application program and delay time is prestored in the electronic device, specifically, a corresponding relationship between an application program installed on the electronic device and delay time may be prestored, and the corresponding relationship between an application program and delay time may be stored every time an application program is newly added to the electronic device, which is detected in real time. Wherein the delay time represents the maximum delay time period that the application program can accept. For example, the delay time corresponding to the application a is 5ms, and if the delay time is longer than 5ms, the user may have obvious feeling when using the application a, which affects the user experience. When the starting of the application program 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 a preset delay, the preset delay is pre-stored time required for activating the Bluetooth equipment, if the delay time is smaller than the preset delay, the time required for activating the Bluetooth equipment is larger than the maximum delay accepted by the application program, and therefore the application program can be judged to be a target application program, and the started application program can be judged to be the target application program.
And step S220, if yes, acquiring the current state of the Bluetooth equipment.
When the target application program is detected to be started, the current state of the Bluetooth device can be acquired, and the next operation is determined according to the current state of the Bluetooth device. The states of the bluetooth device may be an active state and a dormant state. If the Bluetooth equipment is in an activated state, the electronic equipment can directly send the audio data of the application program to the Bluetooth equipment for playing, and delay is avoided; if the state of the Bluetooth device is a dormant state, it indicates that the Bluetooth device needs to be activated when the audio data of the application program is sent to the Bluetooth device, the audio data cannot be played in time, and the audio data can be played only after the Bluetooth device is successfully activated. Therefore, 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, wherein the activation instruction is used for indicating the Bluetooth device to enter an activation state.
The steps S230 to S240 refer to corresponding parts of the foregoing embodiments, and are not described herein again.
According to the Bluetooth device control method, whether the application program is the target application program or not 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 equipment; and judging whether the current state of the Bluetooth equipment is an activated state, wherein the activated state represents 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 the judgment to the target application program to and the judgment of bluetooth equipment's state, activate the operation to bluetooth equipment, because of the broadcast delay that the broadcast that the bluetooth equipment produced when reducing bluetooth equipment and playing audio data, thereby promote user's use and experience.
Referring to fig. 3, another embodiment of the present application provides a bluetooth device control method, where on the basis of the foregoing embodiment, the present embodiment mainly describes a process of determining whether a current state of a bluetooth device is an active state, and the method may include:
and step S310, acquiring the current state of the Bluetooth device when the starting of the target application program is detected.
Step S310 may refer to corresponding parts of the foregoing embodiments, and will not be described herein again.
Step S320, determining whether activation feedback information sent by the bluetooth device is received, if yes, performing step S330, and if not, performing step S350.
The state of the bluetooth device may be an active state or a dormant state. Before the Bluetooth device enters the activation state, the electronic device sends an activation instruction to the Bluetooth device, and after receiving the activation instruction, the Bluetooth device enters the activation state and sends activation feedback information to the electronic device so as to feed back that the Bluetooth device of the electronic device enters the activation state. Similarly, before the bluetooth device enters the sleep state, the electronic device may send a sleep instruction to the bluetooth device, and 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 that the Bluetooth device enters the dormant state to the electronic device through the dormant feedback information.
Therefore, whether the electronic equipment receives the activation feedback information after the electronic equipment is in Bluetooth connection with the Bluetooth equipment or not can be judged to determine the current state of the Bluetooth equipment. If the electronic device receives the activation feedback information sent by the bluetooth device, indicating that the bluetooth device may still be in the activated state, step S330 is executed, and if the activation feedback information sent by the bluetooth device is not received, indicating that the bluetooth device is not activated, step S350 is executed.
Step S330, determining whether the sleep feedback information sent by the bluetooth device is received after the activation feedback information is received last time, if so, executing step S350, and if not, executing step S340.
After the electronic device receives the activation feedback information sent by the bluetooth device, a sleep feedback instruction may also be received, and then the bluetooth device enters a sleep state. Therefore, whether the electronic equipment receives the dormancy feedback information sent by the Bluetooth equipment after receiving the activation feedback information for the last time can be judged. For example, the time when the electronic device performs bluetooth connection with the bluetooth device is 9: 00, current time is 10: 00, the electronic device receives two activation feedback instructions, which are respectively set at 9: 10 and 9: 40, from this, it can be determined that at 9: 40, after receiving the activation feedback information sent by the bluetooth device, determining whether to receive the dormancy feedback information, if receiving the dormancy feedback information, indicating that the bluetooth device has entered the dormancy state, executing step S350, and if not receiving the dormancy feedback information sent by the bluetooth device, indicating that the current state of the bluetooth device is still the activation state, executing step S340.
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, it may be considered that the bluetooth device is over-activated, but it is not determined whether a sleep instruction is received or not after the bluetooth device enters the activated state, and the electronic device enters the sleep state. Therefore, whether the dormancy feedback information sent by the Bluetooth device is received or not after the activation feedback information is received last time can be further judged, if the dormancy feedback information sent by the Bluetooth device is not received, the Bluetooth device can be considered to be in the activation state and maintain the activation state all the time, and the current state of the Bluetooth device can be judged to be the activation state.
Step S350, judging that the current state of the Bluetooth device is not an active state, and sending an active instruction to the Bluetooth device.
If the electronic device does not receive the activation feedback information sent by the bluetooth device, it may be determined that the bluetooth device is not activated, it may be determined that the current state of the bluetooth device is not an activation state, and an activation instruction may be sent to the bluetooth device to indicate that the bluetooth device enters the activation state.
If the electronic device receives the activation feedback information sent by the bluetooth device, whether the dormancy feedback information sent by the bluetooth device is received or not after the activation feedback information is received last time is further judged, if the dormancy feedback information sent by the bluetooth device is received, the bluetooth device can be considered to enter the dormancy state after entering the activation state, the current state of the bluetooth device can be judged not to be the activation state, and an activation instruction can be sent to the bluetooth device to indicate the bluetooth device to enter the activation state.
According to the Bluetooth device control method, the current state of the Bluetooth device is obtained when the target application program is detected to be started, and whether the activation feedback information sent by the Bluetooth device is received or not is judged. And if the activation feedback information is not received, judging that the current state of the Bluetooth equipment is not the 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 or not 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 activated 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. The current state of the Bluetooth equipment is comprehensively determined through whether the activation feedback information and the dormancy feedback information sent by the Bluetooth equipment are received or not, and when the current state of the Bluetooth equipment is not the activation state, an activation instruction is sent to the Bluetooth equipment so as to activate the Bluetooth equipment, and the use experience of a user is improved by reducing the delay when audio data is played.
Referring to fig. 4, a further embodiment of the present application provides a bluetooth device control method, where on the basis of the foregoing embodiment, this embodiment mainly describes a process of sending an activation instruction to a bluetooth device, and the method may include:
and step S410, acquiring the current state of the Bluetooth equipment when the starting of the target application program 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 can refer to the corresponding parts of the foregoing embodiments, and are not described herein again.
Step S430, if not, the audio data processing module sends mute data to the Bluetooth module.
And if the current state of the Bluetooth equipment is not the activated state, the Bluetooth equipment needs to be activated. The electronic equipment is provided with an audio data processing module which is used for sending audio data to a Bluetooth module of the electronic equipment. 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, responds to the activation instruction, and sends activation feedback information to the Bluetooth module of the electronic device, so that the Bluetooth device enters an activation state. The Bluetooth structure is that after receiving audio data, an activation instruction is automatically sent to the Bluetooth device to activate the Bluetooth device, and after activation, the mute data is sent to the Bluetooth device, so that the mute data can be sent to the Bluetooth device, and the Bluetooth device is activated in advance through the mute data. The mute data is audio data with volume of 0, so that the Bluetooth equipment is activated, and noise playing cannot be 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 to activate the bluetooth device, so that the bluetooth device is prevented from being activated when an application program plays audio data, and delay of playing the audio data through the bluetooth device is reduced.
When the bluetooth device is in an active state, if the audio data is not transmitted within a preset time, the bluetooth device enters a sleep state. The time that the bluetooth device is in the active state may be extended by transmitting the mute data. Specifically, if the audio data of the application program is not transmitted to the bluetooth device within a first preset time, transmitting mute data to the bluetooth device once every first preset time; and if the audio data of the application program is not transmitted to the Bluetooth equipment within 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 when the Bluetooth device plays the audio data can be reduced by prolonging the time when the Bluetooth device is in the activated state.
The first preset time may be a time required for the bluetooth device to enter the sleep state from the active state without data transmission, that is, if the bluetooth device is in the active state but does not perform data transmission, the bluetooth device will enter the sleep state from the active state after the first preset time elapses. If the audio data of the target application program is not transmitted to the Bluetooth device within the first preset time, the Bluetooth device enters a dormant state, and therefore the mute data can be transmitted to the Bluetooth device to prolong the time of the Bluetooth device in an activated state; the mute data may be transmitted once every first preset time. If the audio data of the target application program is still not transmitted to the bluetooth device within the second preset time, indicating that the bluetooth device has no audio data to be played temporarily, the sending of the mute data may be stopped, and the bluetooth device may be instructed to enter a sleep state, so as to save the power consumption of the bluetooth device. It is to be understood 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 an actual requirement, which is not limited herein.
For example, the first preset time is 1s, which indicates that the bluetooth device enters the sleep state if the bluetooth device does not perform data transmission with the electronic device within 1s, and the second preset time may be 3 s. Then, the process of prolonging the time that the bluetooth device is in the active state may be that if the electronic device does not send the audio data of the target application program to the bluetooth device within 1s, 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 sending of the mute data is stopped, and 1s after the sending of the mute data is stopped, if the audio data of the target application program is not sent to the bluetooth device, 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 control method of the Bluetooth equipment, the current state of the Bluetooth equipment is obtained when the starting of a target application program is detected; judging whether the current state of the Bluetooth equipment is an activated state, wherein the activated state represents 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 equipment according to the mute data. Through to bluetooth module sends silence data, bluetooth module according to silence data to bluetooth equipment sends the activation instruction, activates bluetooth equipment to reduce the broadcast delay that bluetooth equipment produced because of activating bluetooth equipment when playing audio data, thereby promote user's use and experience.
Referring to fig. 5, a bluetooth device control apparatus 500 according to an embodiment of the present application is shown, where the apparatus 500 includes an obtaining module 510, a determining module 520, and a control module 530.
The obtaining module 510 is configured to obtain a current state of the bluetooth device when it is detected that a target application is started; the determining module 520 is configured to determine whether a 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 used to instruct the bluetooth device to enter an active state.
Further, before the obtaining module 510 obtains the current state of the bluetooth device when detecting that the target application program is started, the determining module 520 is further configured to determine whether the application program is an application program for playing audio when detecting that the application program is started; and if so, judging that the target application program is detected to be started.
Further, the corresponding relationship between each application program and the delay time is prestored, and before the target application program is determined to be started, the determining module 520 is further configured to obtain the delay time corresponding to the application program to be started; judging whether the acquired delay time is less than a preset delay, wherein the preset delay is prestored time required for activating the Bluetooth device; and if so, judging that the application program is the 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 the activation state; if the activation feedback information is received, judging whether dormancy feedback information sent by the Bluetooth equipment is received or not after the activation feedback information is received for the 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 equipment according to the mute data.
Further, the activation instruction is a start command of the advanced audio distribution profile.
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 first preset time if the audio data of the target application program is not transmitted to the bluetooth device within the first preset time; and if the audio data of the target application program is not transmitted to the Bluetooth equipment within 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, as will be clear to those skilled in the art, for convenience and brevity of description, the specific working processes of the above-described apparatuses and modules may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In summary, the bluetooth device control method provided by the present application obtains the current state of the bluetooth device when detecting that a target application program is started; judging whether the current state of the Bluetooth equipment is an activated state, wherein the activated state represents that audio data can be directly sent to the Bluetooth equipment for playing; and if not, sending an activation instruction to the Bluetooth equipment, wherein the activation instruction is used for indicating the Bluetooth equipment to carry out an activation state. Through the detection to target application program to and the judgement of bluetooth equipment's state, activate the operation to bluetooth equipment, because of the broadcast delay that the broadcast produced of activation bluetooth equipment when reducing bluetooth equipment and playing audio data, thereby promote user's use and experience.
In the several embodiments provided in the present application, the coupling or direct coupling or communication connection between the modules shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or modules may be in an electrical, mechanical or other form.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
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, a tablet computer, an electronic book, or other electronic devices capable of running an application. 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 applications, wherein the one or more applications may be stored in the memory 620 and configured to be executed by the one or more processors 610, the one or more programs configured to perform the methods as described in the aforementioned method embodiments.
The processor 610 may include one or more processing cores. The processor 610 interfaces with various components throughout the electronic device 600 using various interfaces and circuitry to 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 using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 610 may integrate one or a combination of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing display content; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 610, but may be implemented by a communication chip.
The Memory 620 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The 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 various method embodiments described below, and the like. The data storage area may also store data created during use by the electronic device 600 (e.g., phone books, audio-visual data, chat log data), and so forth.
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 called by a processor to execute the methods described in the above-described method embodiments.
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 includes a non-transitory computer-readable storage medium. The computer readable storage medium 700 has storage space for program code 710 to perform any of the method steps of the method described above. The program code can be read from or written to one or more computer program products. The program code 710 may be compressed, for example, in a suitable form.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not necessarily depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (10)

1. A Bluetooth device control method is applied to an electronic device, wherein the electronic device is connected with a Bluetooth device in a Bluetooth mode, and 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, wherein the activated state represents 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 obtaining the current state of the bluetooth device upon detecting the start of the target application, further comprising:
when detecting that an application program is started, judging whether the application program is the application program for playing audio;
and if so, judging that the target application program is detected to be started.
3. The method according to claim 2, wherein a correspondence between each application program and a delay time is prestored, and before the determining that the target application program is detected to be started, the method further comprises:
obtaining the delay time corresponding to the started application program;
judging whether the acquired delay time is less than a preset delay, wherein the preset delay is prestored time required for activating the Bluetooth device;
and if so, judging that the application program is the target application program.
4. The method of claim 1, wherein the determining whether the current status of the bluetooth device is active 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 the activation state;
if the activation feedback information is received, judging whether dormancy feedback information sent by the Bluetooth equipment is received or not after the activation feedback information is received for the 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 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 equipment according to the mute data.
6. The method of claim 5, wherein the activation 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 is not transmitted to the Bluetooth equipment within first preset time, transmitting mute data to the Bluetooth equipment once every first preset time;
and if the audio data of the target application program is not transmitted to the Bluetooth equipment within second preset time, stopping transmitting the mute data, wherein the second preset time is longer than the first preset time.
8. The utility model provides a bluetooth audio playback device which characterized in that is applied to electronic equipment, electronic equipment and bluetooth equipment bluetooth are connected, the device includes:
the acquisition module is used for acquiring the current state of the Bluetooth equipment when detecting that a target application program is started;
the judging module is used for judging whether the current state of the Bluetooth equipment is an activated state, wherein the activated state represents that audio data can be directly sent to the Bluetooth equipment for playing;
and the control module is used for sending an activation instruction to the Bluetooth equipment, and the activation instruction is used for indicating the Bluetooth equipment to enter an activation state.
9. An electronic device, characterized in that the electronic device comprises:
one or more processors;
a memory electrically connected with 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 programs configured to perform the method of any of claims 1-7.
10. A computer-readable storage medium, having stored thereon program code that can be invoked by a processor to perform the method according to 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 true CN110784858A (en) 2020-02-11
CN110784858B 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)

Cited By (9)

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

Citations (7)

* 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
US20090233590A1 (en) * 2008-03-13 2009-09-17 Nokia Corporation Methods and devices for controlling receivers
US20140213189A1 (en) * 2013-01-31 2014-07-31 Samsung Electronics Co., Ltd. Apparatus and method for processing bluetooth data in portable terminal
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

Patent Citations (7)

* 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
US20090233590A1 (en) * 2008-03-13 2009-09-17 Nokia Corporation Methods and devices for controlling receivers
US20140213189A1 (en) * 2013-01-31 2014-07-31 Samsung Electronics Co., Ltd. Apparatus and method for processing bluetooth data in portable terminal
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

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111385781A (en) * 2020-03-03 2020-07-07 广东小天才科技有限公司 File sharing method, smart watch, storage medium and electronic device
CN111432304A (en) * 2020-03-20 2020-07-17 江苏紫米电子技术有限公司 Earphone control method, earphone control device, electronic equipment, earphone control system and storage medium
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
WO2022089483A1 (en) * 2020-10-29 2022-05-05 维沃移动通信有限公司 Audio playback control method and apparatus, and electronic device
CN113099428A (en) * 2021-03-02 2021-07-09 北京小米移动软件有限公司 Audio information transmission method, audio information transmission device, and storage medium
WO2022258016A1 (en) * 2021-06-10 2022-12-15 华为技术有限公司 Data stream transmission method and device, communication apparatus, and storage medium
CN113542852A (en) * 2021-07-13 2021-10-22 海信视像科技股份有限公司 Display device and control method for fast pairing with external device
CN113692091A (en) * 2021-08-11 2021-11-23 深圳市智岩科技有限公司 Device control method, device, terminal device and storage medium
CN113692091B (en) * 2021-08-11 2024-04-02 深圳市智岩科技有限公司 Equipment control method, device, terminal equipment and storage medium

Also Published As

Publication number Publication date
CN110784858B (en) 2023-05-09

Similar Documents

Publication Publication Date Title
CN110784858B (en) Bluetooth device control method and device, electronic device and storage medium
CN111240837B (en) Resource allocation method, device, terminal and storage medium
CN109388367B (en) Sound effect adjusting method and device, electronic equipment and storage medium
CN109445739B (en) Audio playing method and device, electronic equipment and computer readable medium
CN109151194B (en) Data transmission method, device, electronic equipment and storage medium
CN107360458B (en) Play control method, device, storage medium and terminal
JP6742465B2 (en) Method, device and bluetooth speaker for continuous wakeup delay reduction in bluetooth speaker
CN109343902B (en) Audio processing assembly operation method and device, terminal and storage medium
CN109275129B (en) Communication processing method, communication processing device, electronic equipment and storage medium
CN109284080B (en) Sound effect adjusting method and device, electronic equipment and storage medium
CN109271131B (en) Earphone control method and device, electronic equipment and storage medium
CN109005582B (en) Transmission power adjusting method, device, electronic equipment and storage medium
CN110876180B (en) Power consumption processing method and device, electronic equipment and computer readable medium
CN109348464B (en) Data transmission method for low-power-consumption Bluetooth receiving end equipment and receiving end equipment
CN106713653B (en) Audio and video playing control method and device and terminal
EP4047471A1 (en) Audio data processing method, server, and storage medium
CN110703944B (en) Touch data processing method and device, terminal and storage medium
CN107526570B (en) Volume adjusting method and device, terminal equipment and storage medium
CN112565876B (en) Screen projection method, device, equipment, system and storage medium
CN107483734B (en) Volume adjusting method and device, terminal equipment and storage medium
CN110989816B (en) Application processing method and device and storage medium
CN115665671A (en) Audio data sharing method and device, electronic equipment and storage medium
CN112188362B (en) Playing method, device and computer readable storage medium
CN113660599B (en) Speaker control method and device, mobile terminal and storage medium
CN115080126A (en) Switching method and device of shared hardware, electronic equipment and storage medium

Legal Events

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