CN111787513B - Method and apparatus for playing audio - Google Patents

Method and apparatus for playing audio Download PDF

Info

Publication number
CN111787513B
CN111787513B CN202010530958.7A CN202010530958A CN111787513B CN 111787513 B CN111787513 B CN 111787513B CN 202010530958 A CN202010530958 A CN 202010530958A CN 111787513 B CN111787513 B CN 111787513B
Authority
CN
China
Prior art keywords
disconnection
historical
bluetooth
bluetooth headset
transmission power
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
CN202010530958.7A
Other languages
Chinese (zh)
Other versions
CN111787513A (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.)
Samsung Electronics China R&D Center
Samsung Electronics Co Ltd
Original Assignee
Samsung Electronics China R&D Center
Samsung Electronics 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 Samsung Electronics China R&D Center, Samsung Electronics Co Ltd filed Critical Samsung Electronics China R&D Center
Priority to CN202010530958.7A priority Critical patent/CN111787513B/en
Publication of CN111787513A publication Critical patent/CN111787513A/en
Application granted granted Critical
Publication of CN111787513B publication Critical patent/CN111787513B/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
    • H04BTRANSMISSION
    • H04B5/00Near-field transmission systems, e.g. inductive loop type
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R3/00Circuits for transducers, loudspeakers or microphones
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/04TPC
    • H04W52/18TPC being performed according to specific parameters
    • H04W52/22TPC being performed according to specific parameters taking into account previous information or commands
    • H04W52/228TPC being performed according to specific parameters taking into account previous information or commands using past power values or information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/04TPC
    • H04W52/18TPC being performed according to specific parameters
    • H04W52/28TPC being performed according to specific parameters using user profile, e.g. mobile speed, priority or network state, e.g. standby, idle or non transmission
    • H04W52/288TPC being performed according to specific parameters using user profile, e.g. mobile speed, priority or network state, e.g. standby, idle or non transmission taking into account the usage mode, e.g. hands-free, data transmission, telephone
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/04TPC
    • H04W52/38TPC being performed in particular situations
    • H04W52/383TPC being performed in particular situations power control in peer-to-peer links
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/19Connection re-establishment
    • 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

Embodiments of the present disclosure disclose methods and apparatus for playing audio. One embodiment of the method comprises: in response to detecting disconnection of a previously connected Bluetooth headset, extracting reason information for characterizing a reason for disconnection of the Bluetooth headset; in response to detecting a play request for the target audio, determining whether a reason for disconnection of the bluetooth headset is a user operation based on the reason information; in response to determining that the reason for disconnecting the Bluetooth headset is not user operation, adjusting the current first Bluetooth transmission power to a second Bluetooth transmission power to reconnect with the Bluetooth headset, wherein the second Bluetooth transmission power is greater than the first Bluetooth transmission power; and playing the target audio by using the reconnected Bluetooth headset. The implementation method improves the diversity of audio playing, is favorable for reducing the possibility that the user misses the target audio, and is favorable for improving the user experience.

Description

Method and apparatus for playing audio
Technical Field
Embodiments of the present disclosure relate to the field of communications technologies, and in particular, to a method and an apparatus for playing audio.
Background
Bluetooth is a radio technology that supports short-range communication of devices, and enables wireless information exchange between many devices including mobile phones, headsets, speakers, notebook computers, and the like.
In practice, when a user uses a bluetooth headset to receive audio output by a user terminal, the user needs to be within the range of a bluetooth signal transmitted by the user terminal.
Generally, the range of the bluetooth signal is positively correlated with the transmission power, and the larger the transmission power of the bluetooth signal is, the larger the range of the bluetooth signal is.
Disclosure of Invention
Embodiments of the present disclosure propose methods and apparatuses for playing audio.
In a first aspect, an embodiment of the present disclosure provides a method for playing audio, the method including: in response to detecting disconnection of a previously connected Bluetooth headset, extracting reason information for characterizing a reason for disconnection of the Bluetooth headset; in response to detecting a play request for the target audio, determining whether a reason for disconnection of the bluetooth headset is a user operation based on the reason information; in response to determining that the reason for the disconnection of the bluetooth headset is not a user operation, adjusting the current first bluetooth transmission power to a second bluetooth transmission power to reconnect with the bluetooth headset, wherein the second bluetooth transmission power is greater than the first bluetooth transmission power; and playing the target audio by using the reconnected Bluetooth headset.
In some embodiments, in response to determining that the reason for the disconnection of the bluetooth headset is not a user action, adjusting the current first bluetooth transmit power to the second bluetooth transmit power to reconnect with the bluetooth headset comprises: in response to determining that the reason for the disconnection of the bluetooth headset is not a user operation, acquiring a time at which the bluetooth headset is disconnected as a first time and acquiring a time at which the play request is detected as a second time; calculating the difference between the second time and the first time to obtain the disconnection duration; determining whether the disconnection duration is less than or equal to a target threshold; and in response to the disconnection duration being less than or equal to the target threshold, adjusting the current first Bluetooth transmission power to a second Bluetooth transmission power to reconnect with the Bluetooth headset.
In some embodiments, the target threshold is determined by: acquiring a plurality of historical disconnection data of the Bluetooth headset in a target historical time period, wherein one historical disconnection data corresponds to one disconnection of the Bluetooth headset; for historical disconnection data in a plurality of historical disconnection data, extracting historical disconnection duration from the historical disconnection data; based on the extracted plurality of historical disconnection time periods, a target threshold is generated.
In some embodiments, generating the target threshold based on the extracted plurality of historical disconnect periods comprises: selecting an effective historical disconnection time length from the extracted multiple historical disconnection time lengths; and generating a target threshold value based on the selected effective historical disconnection duration.
In some embodiments, selecting the valid historical disconnection time period from the extracted plurality of historical disconnection time periods comprises: and selecting a history disconnection time length which is less than or equal to a preset effective time length from the extracted plurality of history disconnection time lengths as an effective history disconnection time length.
In some embodiments, generating the target threshold based on the selected valid historical disconnect time period comprises: distributing weights to the selected effective historical disconnection duration; and performing weighted average operation on the selected effective historical disconnection duration by using the distributed weight, and obtaining an operation result as a target threshold.
In some embodiments, assigning a weight to the selected effective historical disconnection period comprises: acquiring a preset time range set; for historical disconnection data in a plurality of historical disconnection data, determining a preset time range to which the historical disconnection time corresponding to the historical disconnection data belongs from a preset time range set as a preset time range corresponding to the historical disconnection data; determining the quantity of historical disconnection data corresponding to a preset time range in a preset time range set; distributing weights to preset time ranges in a preset time range set based on the number of the corresponding historical disconnection data; for the effective historical disconnection duration in the selected effective historical disconnection duration, executing the following steps: determining a preset time range corresponding to historical disconnection data corresponding to the effective historical disconnection duration as a target time range; and determining the weight distributed to the target time range as the weight corresponding to the effective historical disconnection time.
In some embodiments, the method further comprises: and adjusting the current second Bluetooth transmitting power to the first Bluetooth transmitting power in response to the detection that the target audio is played completely.
In a second aspect, an embodiment of the present disclosure provides an apparatus for playing audio, the apparatus including: an extraction unit configured to extract cause information for characterizing a cause of disconnection of the bluetooth headset in response to detection of disconnection of the previously connected bluetooth headset; a determination unit configured to determine whether a cause of disconnection of the bluetooth headset is a user operation based on the cause information in response to detection of a play request for the target audio; a first adjusting unit configured to adjust a current first bluetooth transmission power to a second bluetooth transmission power to reconnect with the bluetooth headset in response to determining that the reason for disconnection of the bluetooth headset is not a user operation, wherein the second bluetooth transmission power is greater than the first bluetooth transmission power; a playing unit configured to play the target audio using the reconnected Bluetooth headset.
In a third aspect, an embodiment of the present disclosure provides a terminal device, including: one or more processors; a storage device having one or more programs stored thereon, which when executed by one or more processors, cause the one or more processors to implement the method of any of the embodiments of the method for playing audio described above.
In a fourth aspect, embodiments of the present disclosure provide a computer-readable medium on which a computer program is stored, which program, when executed by a processor, implements the method of any of the embodiments of the method for playing audio described above.
The method and apparatus for playing audio provided by the embodiments of the present disclosure extract reason information for characterizing a reason for disconnection of a bluetooth headset in response to detection of disconnection of a previously connected bluetooth headset, then determine whether the reason for disconnection of the bluetooth headset is a user operation based on the reason information in response to detection of a play request for a target audio, then adjust a current first bluetooth transmission power to a second bluetooth transmission power in response to determination that the reason for disconnection of the bluetooth headset is not the user operation to reconnect with the bluetooth headset, wherein the second bluetooth transmission power is greater than the first bluetooth transmission power, and finally play the target audio using the reconnected bluetooth headset, thereby determining whether the disconnection is instructed by the user operation when the bluetooth headset is disconnected, and if not, the disconnection is instructed by the user operation, at this time, if a play request for a target audio (e.g., a ring tone, an alarm clock, etc.) is detected, the range of the bluetooth signal may be increased by increasing the bluetooth transmission power, so that the bluetooth headset is reconnected, and then the target audio may be played through the reconnected bluetooth headset, thereby improving the diversity of audio playing, and being helpful for reducing the possibility that the user misses the target audio, and improving the user experience.
Drawings
Other features, objects and advantages of the disclosure will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present disclosure may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for playing audio according to the present disclosure;
FIG. 3 is a schematic diagram of one application scenario of a method for playing audio in accordance with an embodiment of the present disclosure;
FIG. 4 is a flow diagram of yet another embodiment of a method for playing audio according to the present disclosure;
FIG. 5 is a schematic block diagram illustrating one embodiment of an apparatus for playing audio according to the present disclosure;
FIG. 6 is a block diagram of a computer system suitable for use with a terminal device implementing embodiments of the present disclosure.
Detailed Description
The present disclosure is described in further detail below with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not to be construed as limiting the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that, in the present disclosure, the embodiments and features of the embodiments may be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates an exemplary system architecture 100 to which embodiments of the disclosed method for playing audio or apparatus for playing audio may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a bluetooth headset 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the bluetooth headset 105. In particular, the network 104 may be a wireless communication link.
The user can receive audio transmitted by the terminal devices 101, 102, 103 through the network 104 using the bluetooth headset 105. The terminal devices 101, 102, 103 may have various client applications installed thereon, such as an audio playing type application, a telephone application, a calendar type application, an instant messaging tool, and the like.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices having bluetooth function and Audio transmission function, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, motion Picture Experts compression standard Audio Layer 3), MP4(Moving Picture Experts Group Audio Layer IV, motion Picture Experts compression standard Audio Layer 4) players, laptop computers, and so on. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented as multiple pieces of software or software modules (e.g., multiple pieces of software or software modules to provide a distributed service), or as a single piece of software or software module. And is not particularly limited herein.
In practice, the terminal devices 101, 102, and 103 may be pre-installed with a bluetooth protocol, and the terminal devices 101, 102, and 103 may control the bluetooth signal through the bluetooth protocol.
It should be noted that the method for playing audio provided by the embodiments of the present disclosure is generally performed by the terminal devices 101, 102, 103, and accordingly, the apparatus for playing audio is generally disposed in the terminal devices 101, 102, 103.
It should be understood that the number of terminal devices, networks and bluetooth headsets in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and bluetooth headsets, as desired for implementation.
With continued reference to fig. 2, a flow 200 of one embodiment of a method for playing audio in accordance with the present disclosure is shown. The method for playing audio comprises the following steps:
in step 201, in response to detecting disconnection of a previously connected bluetooth headset, reason information for characterizing the reason for disconnection of the bluetooth headset is extracted.
In the present embodiment, an execution subject of the method for playing audio (e.g., terminal apparatuses 101, 102, 103 shown in fig. 1) may extract cause information for characterizing a cause of disconnection of a previously connected bluetooth headset in response to disconnection from the bluetooth headset detected by a wired connection manner or a wireless connection manner. Wherein, the reason information may include but is not limited to at least one of the following: text, numbers, symbols, images, audio, video. As an example, the reason information may include a number "1" or a number "2", wherein the number "1" may be used to characterize that the reason for the disconnection of the bluetooth headset is a user operation; the number "2" may be used to characterize the disconnection of the bluetooth headset because the distance between the bluetooth headset and the executing body is beyond the range of the bluetooth signal.
It will be appreciated that in practice, the user may operate (e.g. click a bluetooth function activation button) to communicatively couple the bluetooth headset and the execution body. The user can also disconnect the communication connection between the bluetooth headset and the execution main body by operating (for example, clicking a bluetooth function off button). In addition, when the user wears the bluetooth headset to leave the execution main body and moves to the outside of the range of the bluetooth signal sent by the execution main body, the execution main body cannot find the bluetooth headset, and then the execution main body is disconnected with the bluetooth headset.
In this embodiment, when the execution main body detects disconnection of the bluetooth headset, the execution main body may extract reason information for characterizing a reason for disconnection of the bluetooth headset. Specifically, the executing entity may extract the reason information by various methods, for example, the executing entity may continuously detect a user operation, and further, when a disconnection operation of the user is detected (for example, a bluetooth function close button is clicked), disconnect the communication connection with the bluetooth headset, and generate the reason information for representing that the reason for disconnecting the bluetooth headset is the user operation; or, the execution main body may also search a replay parameter recorded in a pre-installed bluetooth protocol and used for indicating a disconnection reason when detecting that the connection with the bluetooth headset is disconnected, and generate reason information based on the replay parameter (for example, the replay parameter may be directly used as the reason information; or the replay parameter may be converted into characters, and the converted characters may be used as the reason information).
In response to detecting the play request for the target audio, it is determined whether the reason for disconnecting the bluetooth headset is a user operation based on the reason information, step 202.
In this embodiment, in the case that the bluetooth headset is disconnected from the execution main body, the execution main body may determine whether the reason why the bluetooth headset is disconnected is a user operation based on the reason information obtained in step 201 in response to detecting the play request for the target audio. Wherein the target audio may be audio to be played.
In particular, the target audio may be an audio for alerting the user, and may be, for example, an incoming call ring tone, an alarm ring tone, or the like. It can be appreciated that there is a need for timely retrieval by a user for audio for alerting the user.
The play request may be for requesting to play the target audio. In practice, the play request may be a request initiated by an application installed in advance on the execution main body, for example, the play request may be a play request initiated by an alarm clock application for an alarm clock ringtone, and specifically, when the current time reaches a time corresponding to a preset alarm clock, the alarm clock application may initiate a play request for the alarm clock ringtone to the execution main body; or, the playing request may be a playing request initiated by the phone application for the incoming call ringtone, and specifically, when receiving the phone call of another user, the phone application may initiate a playing request for the incoming ringtone to the execution main body.
Here, the user operation refers to an operation in which the user actively disconnects the communication connection between the bluetooth headset and the execution main body, for example, clicking a bluetooth function off button. When the user actively disconnects, it can be stated that the user does not have a need to receive audio through the bluetooth headset.
And step 203, in response to determining that the reason for disconnecting the Bluetooth headset is not the user operation, adjusting the current first Bluetooth transmission power to a second Bluetooth transmission power so as to be reconnected with the Bluetooth headset.
In this embodiment, the executing body may determine, in response to determining that the reason for disconnection of the bluetooth headset is not a user operation, a current bluetooth transmission power as the first bluetooth transmission power, and adjust the current first bluetooth transmission power to the second bluetooth transmission power to reconnect with the bluetooth headset. And the second Bluetooth transmitting power is greater than the first Bluetooth transmitting power.
It is understood that when it is determined that the disconnection of the bluetooth headset is not the disconnection instructed by the user through the reason information, it may be determined that the reason for the disconnection is that the distance between the bluetooth headset and the execution main body exceeds the range of the bluetooth signal, and at this time, the user may still have a need to receive the target audio through the bluetooth headset. In order to meet the requirements of users, the embodiment adopts a mode of increasing the range of the bluetooth signal.
Specifically, the range of the bluetooth signal is in direct proportion to the transmission power of the bluetooth signal, and the greater the transmission power, the greater the range. Furthermore, in order to increase the range of the bluetooth signal, the present first bluetooth transmission power may be increased to be the second bluetooth transmission power, so that the distance between the bluetooth headset and the execution main body may be included in the increased range, and the execution main body and the bluetooth headset may reestablish the connection relationship.
It should be noted that, the executing main body may increase the first bluetooth transmission power in various ways, for example, the executing main body may increase the first bluetooth transmission power by a preset multiple, and then use the bluetooth transmission power obtained after the preset multiple is increased as the second bluetooth transmission power; or, a technician may preset a plurality of power levels, each level corresponding to a power value and a range of the bluetooth transmission power, and the higher the level is, the larger the bluetooth transmission power is, the larger the range is. Furthermore, the execution main body may obtain a target level from a plurality of power levels, where the target level is any one level higher than a level corresponding to the first bluetooth transmission power, and the execution main body may use the bluetooth transmission power corresponding to the target level as the second bluetooth transmission power.
And step 204, playing the target audio by using the reconnected Bluetooth headset.
In this embodiment, after the connection relationship is reestablished with the bluetooth headset through step 203, the execution main body may send the target audio to the bluetooth headset, so as to play the target audio by using the bluetooth headset. Further, although the user leaves the execution main body, the user can still receive the target audio through the bluetooth headset.
In some optional implementations of this embodiment, the executing body may adjust the current second bluetooth transmission power to the first bluetooth transmission power in response to detecting that the target audio playing is completed.
It can be understood that, after the target audio is played, the user will not have a need to receive the target audio, and the execution main body does not transmit the target audio to the bluetooth headset any more, and at this time, the execution main body may adjust the second bluetooth transmission power back to the initial first bluetooth transmission power, thereby contributing to reducing power consumption.
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of the method for playing audio according to the present embodiment. In the application scenario of fig. 3, a handset 301 used by a user may establish a communication connection with a bluetooth headset 302 worn by the user. At a certain moment, the user is away from the mobile phone 301 wearing the bluetooth headset 302, and at this moment, the distance between the bluetooth headset 302 and the mobile phone 301 exceeds the range of the bluetooth signal, which causes the bluetooth headset 302 to be disconnected from the mobile phone 301, and the mobile phone 301 may perform the following steps in response to detecting the disconnection of the bluetooth headset 302:
first, the handset 301 can extract cause information 303 (e.g., "out of range") that characterizes the reason why the bluetooth headset 302 was disconnected. Then, the handset 301 may determine whether the reason why the bluetooth headset 302 is disconnected is a user operation based on the reason information 303 in response to detecting the play request 305 for the target audio 304 (e.g., incoming ringtone). Next, the handset 301 may, in response to determining that the reason for the disconnection of the bluetooth headset 302 is not a user operation, obtain the current bluetooth transmission power as a first bluetooth transmission power 306, and adjust the current first bluetooth transmission power 306 to a second bluetooth transmission power 307 to reconnect with the bluetooth headset 302, wherein the second bluetooth transmission power 307 is greater than the first bluetooth transmission power 306. Finally, the handset 301 can send the target audio 304 to the reconnected bluetooth headset 302 to play the target audio 304 with the reconnected bluetooth headset 302. At this time, even if the user leaves the cellular phone 301, the target audio 304 can be acquired through the bluetooth headset 302.
The method provided by the above embodiment of the present disclosure may determine whether the bluetooth headset is disconnected according to the user operation instruction, and if not, may determine that the bluetooth headset is disconnected according to the user operation instruction, and if a play request for the target audio is detected, the bluetooth headset may increase the range of the bluetooth signal by increasing the bluetooth transmission power, so as to reconnect the bluetooth headset.
With further reference to fig. 4, a flow 400 of yet another embodiment of a method for playing audio is shown. The process 400 of the method for playing audio includes the following steps:
in step 401, in response to detecting disconnection of a previously connected bluetooth headset, reason information for characterizing a reason for disconnection of the bluetooth headset is extracted.
In the present embodiment, an execution subject of the method for playing audio (e.g., terminal apparatuses 101, 102, 103 shown in fig. 1) may extract cause information for characterizing a cause of disconnection of a previously connected bluetooth headset in response to disconnection from the bluetooth headset detected by a wired connection manner or a wireless connection manner. Wherein, the reason information may include but is not limited to at least one of the following: text, numbers, symbols, images, audio, video.
In response to detecting the play request for the target audio, whether the reason for disconnecting the bluetooth headset is a user operation is determined based on the reason information, step 402.
In this embodiment, in the case where the bluetooth headset is disconnected from the execution main body, the execution main body may determine whether the reason why the bluetooth headset is disconnected is a user operation based on the reason information obtained in step 401 in response to the detection of the play request for the target audio. Wherein the target audio may be audio to be played. The play request may be for requesting to play the target audio.
In step 403, in response to determining that the reason for disconnection of the bluetooth headset is not a user operation, acquiring a time at which the bluetooth headset is disconnected as a first time, and acquiring a time at which the play request is detected as a second time.
In this embodiment, the execution main body may acquire, as the first time, a time at which the bluetooth headset is disconnected and acquire, as the second time, a time at which the playback request is detected, in response to determining that the reason for the disconnection of the bluetooth headset is not the user operation.
Specifically, the execution main body may record a time when the bluetooth headset is disconnected when the disconnection of the bluetooth headset is detected, and record a time when the playback request is detected. Further, when it is determined that the disconnection of the bluetooth headset is not the disconnection instructed by the user, the execution main body may acquire the recorded time when the bluetooth headset is disconnected as the first time, and acquire the recorded time when the playback request is detected as the second time.
And step 404, calculating the difference between the second time and the first time to obtain the disconnection duration.
In this embodiment, based on the first time and the second time obtained in step 403, the executing entity may perform difference calculation on the second time and the first time, and obtain a difference calculation result as the off-duration.
It is to be understood that the disconnection period may represent a period of time that the user leaves the execution subject until the play request is detected.
At step 405, it is determined whether the disconnect time period is less than or equal to a target threshold.
In this embodiment, based on the disconnection period obtained in step 404, the execution subject may determine whether the disconnection period is less than or equal to the target threshold. The target threshold may be a value used to measure whether the user is away temporarily. Specifically, when the disconnection period is less than or equal to the target threshold, it may be considered that the user temporarily leaves the execution subject.
In the present embodiment, the target threshold may be obtained in various ways. As an example, the target threshold may be preset by a technician. For example, the technician may predetermine an exit of less than or equal to 15 minutes as a temporary exit, and further, the technician may set the target threshold to 15 (in minutes).
In some optional implementations of this embodiment, the target threshold may be determined by the execution subject by:
first, a plurality of historical disconnection data of the Bluetooth headset in a target historical time period are acquired.
The target historical time period may be a preset historical time period (for example, 3 months in 2020), or may be a historical time period (for example, three days in the past) with the current time as an end point and the duration of a preset duration. The historical disconnection data may be data generated when the bluetooth headset is disconnected within a target historical time period, and specifically, the historical disconnection data may be used to determine a time length for disconnecting the bluetooth headset. Each historical disconnection data of the plurality of historical disconnection data may correspond to a disconnection of the bluetooth headset.
Then, for the historical disconnection data among the plurality of historical disconnection data, the historical disconnection time period is extracted from the historical disconnection data.
Specifically, the execution main body may extract the historical disconnection time period from the historical disconnection data in various ways. For example, the historical disconnection data may directly record the disconnection duration of the bluetooth headset, and the execution main body may directly determine the recorded duration of the historical disconnection data as the historical disconnection duration; or, the historical disconnection data may record disconnection time and reconnection time, and the execution main body may further perform difference calculation on the reconnection time and the disconnection time recorded in the historical disconnection data, and obtain a difference calculation result as the historical disconnection duration.
Finally, a target threshold is generated based on the extracted plurality of historical disconnection time lengths.
It is to be understood that the execution main body may extract one history disconnection time period for each history disconnection data, and further, may extract a plurality of history disconnection time periods for a plurality of history disconnection data.
Specifically, the execution body may generate the target threshold in various ways based on a plurality of historical disconnection time periods. For example, the execution subject described above may perform an average calculation of a plurality of historical opening time periods, obtaining the calculation result as the target threshold.
In some optional implementations of the embodiment, the execution main body may first select an effective historical disconnection time length from the extracted multiple historical disconnection time lengths, and then generate the target threshold based on the selected effective historical disconnection time length.
Specifically, the execution main body may select the valid history disconnection time length from the plurality of history disconnection time lengths by various methods, for example, the execution main body may determine, as the valid history disconnection time length, a history disconnection time length excluding the longest history disconnection time length and the shortest history disconnection time length from the plurality of history disconnection time lengths.
In some optional implementations of the embodiment, the execution main body may further select, as the valid history disconnection time length, a history disconnection time length that is less than or equal to a preset valid time length from the extracted plurality of history disconnection time lengths.
The preset effective time period may be a time period predetermined by a technician. The historical disconnection corresponding to the historical disconnection period less than or equal to the preset effective period may be regarded as disconnection caused by the user temporarily leaving the execution main body. Furthermore, the target threshold can be used for measuring whether the current leaving of the user is temporary leaving, and the implementation mode can determine the target threshold by using the effective historical disconnection duration corresponding to the temporary leaving of the user, so that the more accurate and reliable target threshold can be determined, and the more accurate and reliable Bluetooth transmission power control can be realized.
Specifically, based on the effective historical disconnection time, the execution subject may generate the target threshold value by using various methods. For example, the execution subject may directly perform an average calculation on the effective historical disconnection time period, and determine the calculation result as the target threshold.
In some optional implementations of this embodiment, the executing entity may generate the target threshold by:
the first step is to distribute the weight to the effective historical disconnection duration.
Specifically, the execution main body may assign a weight to each of the selected effective history disconnection time periods by using various methods.
As an example, for a certain effective history disconnection time length, the execution subject may assign a weight to the effective history disconnection time length based on the number of the effective history disconnection time lengths included in the selected effective history disconnection time length.
For example, the selected valid history disconnect duration includes: 14 minutes, 15 minutes. Then the execution master may determine that one of the three selected valid history disconnection periods is included in the valid history disconnection period of 14 minutes, and then the execution master may assign a weight of 0.333 to the valid history disconnection period (0.333-1/3); for the valid history disconnection period of 15 minutes, if the execution subject determines that two valid history disconnection periods are included in the three selected valid history disconnection periods, the execution subject may assign a weight of 0.667(0.4 — 2/3) to the valid history disconnection period.
In some optional implementations of this embodiment, the executing body may further assign a weight to the selected valid history disconnection duration by:
first, a preset time range set is obtained.
The preset time range set may be a time range set obtained by dividing a preset time period. And the time intervals corresponding to all the preset time ranges in the preset time range set are the same. The preset time period may be a time period predetermined by a technician.
As an example, the preset time period is one day. The execution main body may divide one day by taking two hours as a time interval to obtain twelve preset time ranges, and then the twelve preset time ranges may form a preset time range set.
Then, for historical disconnection data in the plurality of historical disconnection data, determining a preset time range to which the historical disconnection time corresponding to the historical disconnection data belongs from a preset time range set as a preset time range corresponding to the historical disconnection data.
Here, the historical disconnection data may record a time at which the bluetooth headset is disconnected, and the execution main body may determine the time at which the bluetooth headset is disconnected, which is recorded in the historical disconnection data, as the historical disconnection time corresponding to the historical disconnection data.
Specifically, the execution main body may determine the preset time range to which the historical disconnection time corresponding to the historical disconnection data belongs by using various methods.
As an example, the set of preset time ranges includes twelve preset time ranges obtained by dividing one day at intervals of two hours: 0: 00-2: 00), [2: 00-4: 00), [4: 00-6: 00), [6: 00-8: 00), [8: 00-10: 00), [10: 00-12: 00), [12: 00-14: 00), [14: 00-16: 00), [16: 00-18: 00), [18: 00-20: 00), [20: 00-22: 00, and [22: 00-24: 00. And the historical disconnection time corresponding to the historical disconnection data is 12:01, and 12:01 is before 12:00 to 14:00, so that the execution body can determine that the historical disconnection time corresponding to the historical disconnection data belongs to the preset time range of [12: 00-14: 00 ].
Then, the quantity of historical disconnection data corresponding to the preset time range in the preset time range set is determined.
After the preset time range corresponding to each historical disconnection data is determined, the execution main body may count the number of the historical disconnection data corresponding to each preset time range.
Continuing with the example, the execution subject acquires historical disconnection data a, historical disconnection data B, historical disconnection data C, and historical disconnection data D, which correspond to historical disconnection times of 12:01, 12:30, 15:40, and 21:15, respectively. Determining that the historical disconnection data A corresponds to a preset time range [12: 00-14: 00 ] through the steps; historical disconnection data B correspond to a preset time range of 12: 00-14: 00; the historical disconnection data C correspond to a preset time range of (14: 00-16: 00); the historical disconnection data D correspond to a preset time range [20: 00-22: 00 ]. In this step, the execution subject may determine that the amount of historical disconnection data corresponding to a preset time range [12: 00-14: 00) is 2; the number of historical disconnection data corresponding to a preset time range [14: 00-16: 00) is 1; the number of historical disconnection data corresponding to a preset time range [20: 00-22: 00) is 1; the number of historical disconnection data corresponding to other preset time ranges is 0.
Then, based on the number of the corresponding historical disconnection data, a weight is assigned to a preset time range in the preset time range set.
Specifically, the executing agent may assign a weight to the preset time range based on the number of the historical disconnection data, so that the weight of the preset time range with a large number of the corresponding historical disconnection data is large.
Continuing with the above example, the execution subject may assign a weight of 0.5(0.5 is 2/4, where 2 is the number of historical disconnection data corresponding to the preset time range, and 4 is the total number of acquired historical disconnection data) to a preset time range [12: 00-14: 00); distributing a weight of 0.25 to a preset time range of [14: 00-16: 00 ]; distributing a weight of 0.25 to a preset time range of [20: 00-22: 00 ]; and assigning a weight of 0 to the other preset time ranges.
Finally, for the effective historical disconnection duration in the selected effective historical disconnection durations, executing the following steps: determining a preset time range corresponding to historical disconnection data corresponding to the effective historical disconnection duration as a target time range; and determining the weight distributed to the target time range as the weight corresponding to the effective historical disconnection time.
Continuing with the example, for the valid historical open time "14 minutes", the execution subject may take the preset time range [14: 00-16: 00) corresponding to the historical open data a corresponding to the valid historical open time "14 minutes" as the target time range corresponding to the valid historical open time, and further determine the weight 0.25 of the target time range [14: 00-16: 00) as the weight corresponding to the valid historical open time.
After assigning weights to the respective effective history disconnection periods, the execution main body may continue to execute the following second step to obtain the target threshold.
And secondly, performing weighted average operation on the selected effective historical disconnection duration by using the distributed weight to obtain an operation result as a target threshold.
The executing body may determine the target threshold value during the process of processing the current disconnection, or may determine the target threshold value in advance based on the historical disconnection data, and directly acquire the predetermined target threshold value during the process of processing the current disconnection.
And step 406, in response to the disconnection duration being less than or equal to the target threshold, adjusting the current first bluetooth transmission power to a second bluetooth transmission power, so as to reconnect with the bluetooth headset.
In this embodiment, the executing entity may determine, in response to determining that the disconnection duration is less than or equal to the target threshold, a current bluetooth transmission power as a first bluetooth transmission power, and adjust the current first bluetooth transmission power to a second bluetooth transmission power for reconnection with the bluetooth headset. And the second Bluetooth transmitting power is greater than the first Bluetooth transmitting power.
It is understood that when it is determined that the disconnection of the bluetooth headset is not the disconnection instructed by the user through the reason information and the user is just temporarily away from the execution main body as described above, it may be considered that the user still has a need to receive the target audio through the bluetooth headset. And in order to satisfy user's demand, above-mentioned execution main part can be with first bluetooth transmit power adjustment for bigger second bluetooth transmit power to this, can increase the range scope of bluetooth signal, and then can realize above-mentioned execution main part and bluetooth headset's communication connection.
Step 407, playing the target audio by using the reconnected bluetooth headset.
In this embodiment, after the connection relationship is reestablished with the bluetooth headset through step 406, the execution main body may send the target audio to the bluetooth headset, so as to play the target audio by using the bluetooth headset.
Step 401, step 402, and step 407 may be performed in a manner similar to that of step 201, step 202, and step 204 in the foregoing embodiment, respectively, and the above description for step 201, step 202, and step 204 also applies to step 401, step 402, and step 407, and is not repeated here.
As can be seen from fig. 4, compared with the embodiment corresponding to fig. 2, the flow 400 of the method for playing audio in the present embodiment highlights the steps of determining whether the disconnection duration of the bluetooth headset is less than or equal to the target threshold in response to determining that the reason for the disconnection of the bluetooth headset is not the user operation, and adjusting the current first bluetooth transmission power to the second bluetooth transmission power in response to the disconnection duration being less than or equal to the target threshold to reconnect with the bluetooth headset. Therefore, the scheme described in the embodiment can increase the Bluetooth transmitting power to reconnect the Bluetooth headset when the disconnection of the Bluetooth headset is determined not to be the disconnection instructed by the user operation and the disconnection duration does not exceed the target threshold, so that the reconnection operation can be performed on the disconnection of which the disconnection duration is less than or equal to the target threshold in a targeted manner, the pertinence of reconnection is improved, and the reduction of power consumption is facilitated; moreover, the disconnection duration is less than or equal to the target threshold, which may correspond to a user temporarily being out of range (e.g., going to the toilet), at which time the user generally has a need to receive audio, and therefore, performing the reconnection operation when the disconnection duration is less than or equal to the target threshold may meet the user's need. Furthermore, the solution described in this embodiment can reduce power consumption while satisfying the user requirements.
With further reference to fig. 5, as an implementation of the methods shown in the above-mentioned figures, the present disclosure provides an embodiment of an apparatus for playing audio, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 5, the apparatus 500 for playing audio of the present embodiment includes: an extraction unit 501, a determination unit 502, a first adjustment unit 503, and a playback unit 504. Wherein the extracting unit 501 is configured to extract cause information for characterizing a cause of disconnection of the bluetooth headset in response to detection of disconnection of the previously connected bluetooth headset; the determination unit 502 is configured to determine whether a reason why the bluetooth headset is disconnected is a user operation based on the reason information in response to detection of a play request for the target audio; the first adjusting unit 503 is configured to adjust the current first bluetooth transmission power to a second bluetooth transmission power to reconnect with the bluetooth headset in response to determining that the reason for disconnection of the bluetooth headset is not a user operation, wherein the second bluetooth transmission power is greater than the first bluetooth transmission power; the playing unit 504 is configured to play the target audio using the reconnected bluetooth headset.
In this embodiment, the extracting unit 501 of the apparatus 500 for playing audio may extract reason information for characterizing a reason for disconnection of a previously connected bluetooth headset in response to disconnection from the bluetooth headset detected by a wired connection manner or a wireless connection manner. Wherein, the reason information may include but is not limited to at least one of the following: text, numbers, symbols, images, audio, video.
In this embodiment, in the case where the bluetooth headset is disconnected from the apparatus 500, the determination unit 502 may determine whether the reason for the disconnection of the bluetooth headset is a user operation based on the reason information obtained by the extraction unit 501 in response to the detection of the play request for the target audio. Wherein the target audio may be audio to be played. The play request may be for requesting to play the target audio.
In this embodiment, the first adjusting unit 503 may determine the current bluetooth transmission power as the first bluetooth transmission power and adjust the current first bluetooth transmission power to the second bluetooth transmission power to reconnect with the bluetooth headset in response to determining that the reason for disconnecting the bluetooth headset is not the user operation. And the second Bluetooth transmitting power is greater than the first Bluetooth transmitting power.
In this embodiment, after the apparatus 500 and the bluetooth headset reestablish the connection relationship, the playing unit 504 may send the target audio to the bluetooth headset, so as to play the target audio by using the bluetooth headset.
In some optional implementations of this embodiment, the first adjusting unit 503 includes: an acquisition module (not shown in the figure) configured to acquire, as a first time, a time at which the bluetooth headset is disconnected and acquire, as a second time, a time at which the play request is detected, in response to a determination that the reason for the disconnection of the bluetooth headset is not a user operation; a difference module (not shown in the figure) configured to perform difference between the second time and the first time to obtain a disconnection duration; a determination module (not shown in the figures) configured to determine whether the disconnection period is less than or equal to a target threshold; and an adjusting module (not shown in the figure) configured to adjust the current first bluetooth transmission power to a second bluetooth transmission power to reconnect with the bluetooth headset in response to the disconnection duration being less than or equal to the target threshold.
In some optional implementations of this embodiment, the target threshold is determined by: acquiring a plurality of historical disconnection data of the Bluetooth headset in a target historical time period, wherein one historical disconnection data corresponds to one disconnection of the Bluetooth headset; for historical disconnection data in a plurality of historical disconnection data, extracting historical disconnection duration from the historical disconnection data; based on the extracted plurality of historical disconnection time periods, a target threshold is generated.
In some optional implementations of the present embodiment, the generating the target threshold based on the extracted plurality of historical disconnection time lengths includes: selecting an effective historical disconnection time length from the extracted multiple historical disconnection time lengths; and generating a target threshold value based on the selected effective historical disconnection time length.
In some optional implementations of the embodiment, the selecting the valid historical disconnection time period from the extracted plurality of historical disconnection time periods includes: and selecting a history disconnection time length which is less than or equal to a preset effective time length from the extracted plurality of history disconnection time lengths as an effective history disconnection time length.
In some optional implementations of this embodiment, generating the target threshold based on the selected valid historical disconnection time period includes: distributing weights to the selected effective historical disconnection duration; and carrying out weighted average operation on the selected effective historical disconnection duration by using the distributed weight, and obtaining an operation result as a target threshold value.
In some optional implementations of this embodiment, the assigning a weight to the selected valid historical disconnection period includes: acquiring a preset time range set; for historical disconnection data in a plurality of historical disconnection data, determining a preset time range to which historical disconnection time corresponding to the historical disconnection data belongs from a preset time range set as a preset time range corresponding to the historical disconnection data; determining the quantity of historical disconnection data corresponding to a preset time range in a preset time range set; distributing weights to preset time ranges in a preset time range set based on the number of the corresponding historical disconnection data; for the effective historical disconnection duration in the selected effective historical disconnection duration, executing the following steps: determining a preset time range corresponding to historical disconnection data corresponding to the effective historical disconnection duration as a target time range; and determining the weight distributed to the target time range as the weight corresponding to the effective historical disconnection duration.
In some optional implementations of this embodiment, the apparatus 500 further includes: and a second adjusting unit (not shown in the figure) configured to adjust the current second bluetooth transmission power to the first bluetooth transmission power in response to detecting that the target audio playback is completed.
It will be understood that the elements described in the apparatus 500 correspond to various steps in the method described with reference to fig. 2. Thus, the operations, features and resulting advantages described above with respect to the method are also applicable to the apparatus 500 and the units included therein, and are not described herein again.
The apparatus 500 provided in the foregoing embodiment of the present disclosure may determine whether the bluetooth headset is disconnected according to the user operation instruction, and if not, may determine that the bluetooth headset is disconnected according to the user operation instruction, and if a play request for the target audio is detected, increase the range of the bluetooth signal by increasing the bluetooth transmission power, so as to reconnect the bluetooth headset, and then play the target audio through the reconnected bluetooth headset, thereby improving the diversity of audio playing, and helping to reduce the possibility that the user misses the target audio, and helping to improve the user experience.
Referring now to fig. 6, a block diagram of a terminal device (e.g., terminal devices 101, 102, 103 in fig. 1) 600 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The terminal device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, the terminal device 600 may include a processing means (e.g., a central processing unit, a graphic processor, etc.) 601 that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the terminal apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, or the like; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the terminal device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates the apparatus 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may be alternatively implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or installed from the storage means 608, or installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of embodiments of the present disclosure.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be included in the terminal device; or may exist separately without being assembled into the terminal device. The computer readable medium carries one or more programs which, when executed by the terminal device, cause the terminal device to: in response to detecting disconnection of a previously connected Bluetooth headset, extracting reason information for characterizing a reason for disconnection of the Bluetooth headset; in response to detecting a play request for the target audio, determining whether a reason for disconnection of the Bluetooth headset is a user operation based on the reason information; in response to determining that the reason for the disconnection of the bluetooth headset is not a user operation, adjusting the current first bluetooth transmission power to a second bluetooth transmission power to reconnect with the bluetooth headset, wherein the second bluetooth transmission power is greater than the first bluetooth transmission power; and playing the target audio by using the reconnected Bluetooth headset.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes an extraction unit, a determination unit, a first adjustment unit, and a playback unit. Where the names of these units do not in some cases constitute a limitation on the unit itself, for example, a playback unit may also be described as a "unit playing back target audio".
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.

Claims (11)

1. A method for playing audio, comprising:
in response to detecting disconnection of a pre-connected Bluetooth headset, extracting reason information for representing reasons of disconnection of the Bluetooth headset;
in response to detecting a play request for target audio, determining whether a reason for disconnection of the Bluetooth headset is a user operation based on the reason information;
in response to determining that the reason for disconnecting the Bluetooth headset is not user operation, adjusting the current first Bluetooth transmission power to a second Bluetooth transmission power to reconnect with the Bluetooth headset, wherein the second Bluetooth transmission power is greater than the first Bluetooth transmission power;
and playing the target audio by using the reconnected Bluetooth headset.
2. The method of claim 1, wherein the adjusting a current first bluetooth transmit power to a second bluetooth transmit power to reconnect with the bluetooth headset in response to determining that the reason for the disconnection of the bluetooth headset was not a user action comprises:
in response to determining that the reason for the disconnection of the bluetooth headset is not a user operation, acquiring a time at which the bluetooth headset is disconnected as a first time, and acquiring a time at which the play request is detected as a second time;
calculating the difference between the second time and the first time to obtain the disconnection duration;
determining whether the disconnect duration is less than or equal to a target threshold;
and responding to the disconnection duration being less than or equal to a target threshold, and adjusting the current first Bluetooth transmission power to be a second Bluetooth transmission power so as to be reconnected with the Bluetooth headset.
3. The method of claim 2, wherein the target threshold is determined by:
acquiring a plurality of historical disconnection data of the Bluetooth headset in a target historical time period, wherein one piece of historical disconnection data corresponds to one disconnection of the Bluetooth headset;
for historical disconnection data in the plurality of historical disconnection data, extracting historical disconnection duration from the historical disconnection data;
generating the target threshold based on the extracted plurality of historical disconnection time periods.
4. The method of claim 3, wherein the generating the target threshold based on the extracted plurality of historical disconnect durations comprises:
selecting an effective historical disconnection time length from the extracted multiple historical disconnection time lengths;
and generating the target threshold value based on the selected effective historical disconnection duration.
5. The method of claim 4, wherein said selecting a valid historical disconnect time period from the extracted plurality of historical disconnect time periods comprises:
and selecting a history disconnection time length which is less than or equal to a preset effective time length from the extracted plurality of history disconnection time lengths as an effective history disconnection time length.
6. The method of claim 4, wherein the generating the target threshold based on the selected valid historical disconnect duration comprises:
distributing weights to the selected effective historical disconnection duration;
and performing weighted average operation on the selected effective historical disconnection duration by using the distributed weight, and obtaining an operation result as the target threshold.
7. The method of claim 6, wherein the assigning a weight to the selected effective historical disconnection period comprises:
acquiring a preset time range set;
for historical disconnection data in the plurality of historical disconnection data, determining a preset time range to which the historical disconnection time corresponding to the historical disconnection data belongs from the preset time range set as a preset time range corresponding to the historical disconnection data;
determining the quantity of historical disconnection data corresponding to a preset time range in the preset time range set;
distributing weights to preset time ranges in a preset time range set based on the number of the corresponding historical disconnection data;
for the effective historical disconnection duration in the selected effective historical disconnection duration, executing the following steps:
determining a preset time range corresponding to historical disconnection data corresponding to the effective historical disconnection duration as a target time range;
and determining the weight distributed to the target time range as the weight corresponding to the effective historical disconnection time.
8. The method according to one of claims 1 to 7, wherein the method further comprises:
and adjusting the current second Bluetooth transmitting power to the first Bluetooth transmitting power in response to the detection that the target audio playing is completed.
9. An apparatus for playing audio, comprising:
an extraction unit configured to extract cause information for characterizing a cause of disconnection of a previously connected bluetooth headset in response to detection of disconnection of the bluetooth headset;
a determination unit configured to determine, in response to detection of a play request for a target audio, whether a cause of disconnection of the bluetooth headset is a user operation based on the cause information;
a first adjusting unit configured to adjust a current first Bluetooth transmission power to a second Bluetooth transmission power to reconnect with the Bluetooth headset in response to determining that the reason for disconnection of the Bluetooth headset is not a user operation, wherein the second Bluetooth transmission power is greater than the first Bluetooth transmission power;
a playing unit configured to play the target audio using the reconnected Bluetooth headset.
10. A terminal device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method recited in any of claims 1-8.
11. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-8.
CN202010530958.7A 2020-06-11 2020-06-11 Method and apparatus for playing audio Active CN111787513B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010530958.7A CN111787513B (en) 2020-06-11 2020-06-11 Method and apparatus for playing audio

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010530958.7A CN111787513B (en) 2020-06-11 2020-06-11 Method and apparatus for playing audio

Publications (2)

Publication Number Publication Date
CN111787513A CN111787513A (en) 2020-10-16
CN111787513B true CN111787513B (en) 2022-08-19

Family

ID=72756166

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010530958.7A Active CN111787513B (en) 2020-06-11 2020-06-11 Method and apparatus for playing audio

Country Status (1)

Country Link
CN (1) CN111787513B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113179505B (en) * 2021-03-10 2023-04-28 歌尔科技有限公司 Bluetooth playing device restarting and reconnecting method, bluetooth playing device and electronic equipment
CN113115153B (en) * 2021-03-30 2022-09-23 联想(北京)有限公司 Processing method, Bluetooth headset and management platform
CN117098081A (en) * 2023-10-08 2023-11-21 荣耀终端有限公司 Cross-equipment call service transfer method, electronic equipment and system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014047853A1 (en) * 2012-09-27 2014-04-03 华为终端有限公司 Bluetooth device connection method and device
CN103037493B (en) * 2012-12-14 2016-08-03 中兴通讯股份有限公司 Dynamically adjust and launch the method and device of power, intelligent terminal
CN103684550B (en) * 2013-12-20 2018-01-02 上海斐讯数据通信技术有限公司 A kind of Bluetooth signal transmission power adjustment system and mobile terminal
CN106332132B (en) * 2015-07-03 2021-05-04 中兴通讯股份有限公司 Communication terminal and method for self-adaptive Bluetooth performance adjustment
CN106303933B (en) * 2016-09-30 2017-11-17 广东欧珀移动通信有限公司 The power regulating method and device of a kind of bluetooth

Also Published As

Publication number Publication date
CN111787513A (en) 2020-10-16

Similar Documents

Publication Publication Date Title
CN111787513B (en) Method and apparatus for playing audio
US11606669B2 (en) System and method for locating wireless accessories
US9456265B2 (en) Electronic device and control method thereof
CN109274405B (en) Data transmission method and device, electronic equipment and computer readable medium
RU2564247C2 (en) System, method and device for providing adaptive user notifications
US11356523B2 (en) Method and apparatus for selecting information pushed-to terminal
US10681200B2 (en) Message processing method and system, and related device
KR102043641B1 (en) Operating Method For Nearby Function and Electronic Device supporting the same
KR20150028588A (en) Electronic device and method for providing streaming service
CN109194998B (en) Data transmission method and device, electronic equipment and computer readable medium
CN108449787B (en) Connection control method and device and electronic equipment
KR101649203B1 (en) Peer setup of predefined modulation transmission
CN111093148A (en) Signal frequency adjusting method and device, storage medium and terminal
CN111142740A (en) Data updating method, device and storage medium
US20160155280A1 (en) Information processing methods, electronic devices and wearable electronic devices
WO2018072463A1 (en) Information sharing method, apparatus, and storage medium
CN115243322A (en) Cache capacity determination method and device, bluetooth playing equipment and storage medium
CN115174730A (en) Ring control method, device, equipment and computer readable storage medium
KR20150014813A (en) Watch phone
WO2022256009A1 (en) Resolving call-quality issues
CN116112352A (en) Data transmission parameter determining method and device, terminal and storage medium
CN115695929A (en) Multimedia resource downloading method and device, electronic equipment and storage medium
CN114257754A (en) Video synthesis method, device, terminal and storage medium
CN117938769A (en) Congestion window adjusting method and device, electronic equipment and medium
CN117858057A (en) Bluetooth audio playing method, audio playing control method and system

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