CN109151212B - Equipment control method and device and electronic equipment - Google Patents

Equipment control method and device and electronic equipment Download PDF

Info

Publication number
CN109151212B
CN109151212B CN201811163050.6A CN201811163050A CN109151212B CN 109151212 B CN109151212 B CN 109151212B CN 201811163050 A CN201811163050 A CN 201811163050A CN 109151212 B CN109151212 B CN 109151212B
Authority
CN
China
Prior art keywords
earphone
state
wireless
complexity
electronic device
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
CN201811163050.6A
Other languages
Chinese (zh)
Other versions
CN109151212A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201811163050.6A priority Critical patent/CN109151212B/en
Publication of CN109151212A publication Critical patent/CN109151212A/en
Application granted granted Critical
Publication of CN109151212B publication Critical patent/CN109151212B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72448User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
    • H04M1/72454User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions according to context-related or environment-related conditions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72448User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/30Connection release
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M2250/00Details of telephonic subscriber devices
    • H04M2250/12Details of telephonic subscriber devices including a sensor for measuring a physical value, e.g. temperature or motion

Abstract

The embodiment of the application discloses a device control method and device and electronic equipment. The method comprises the following steps: when the electronic equipment is in a call state, detecting an output mode of downlink voice of the call; if the output mode is an earphone output mode, detecting the wearing states of a first earphone and a second earphone which output the downlink voice; and if the earphone in the unworn state is detected in the first earphone and the second earphone, disconnecting the earphone from the earphone in the unworn state. According to the method, under the condition that the electronic equipment simultaneously outputs the downlink voice to the first earphone and the second earphone in parallel, after the earphones are taken down and are in the unworn state, the electronic equipment can be disconnected from the earphones in the unworn state, so that the earphones in the unworn state still occupy wireless resources, wireless resources which can be utilized by the earphones in the worn state can be improved to a certain extent, the overall call quality is improved, and further the user experience is improved.

Description

Equipment control method and device and electronic equipment
Technical Field
The present application relates to the field of electronic device technologies, and in particular, to a device control method and apparatus, and an electronic device.
Background
With the popularization of more external audio output devices, users of electronic devices have more choices to transmit audio to be played to the external audio output devices for playing. For example, when the electronic device can transmit audio to a headset, the audio is played by using the headset. However, the user experience of the headset in playing the audio transmitted from the electronic device is still to be improved.
Disclosure of Invention
In view of the above problems, the present application provides a device control method, apparatus, and electronic device to achieve improvement of the above problems.
In a first aspect, the present application provides a device control method applied to an electronic device, the method including: when the electronic equipment is in a call state, detecting an output mode of downlink voice of the call; if the output mode is an earphone output mode, detecting the wearing states of a first earphone and a second earphone which output the downlink voice; and if the earphone in the unworn state is detected in the first earphone and the second earphone, disconnecting the earphone from the earphone in the unworn state.
In a second aspect, the present application provides a device control apparatus, operable on an electronic device, the apparatus comprising: the audio output detection unit is used for detecting the output mode of the downlink voice of the call when the electronic equipment is in a call state; the device detection unit is used for detecting the wearing states of a first earphone and a second earphone which output the downlink voice if the audio output detection unit detects that the output mode is an earphone output mode; and the equipment control unit is used for disconnecting the connection with the earphone in the unworn state if the equipment detection unit detects that the earphone in the unworn state exists in the first earphone and the second earphone.
In a third aspect, the present application provides an electronic device comprising one or more processors and a memory; one or more programs 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 methods 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.
According to the device control method and device and the electronic device, when the electronic device is in a call state, the output mode of downlink voice of the call is detected, if the output mode is an earphone output mode, the wearing states of a first earphone and a second earphone which output the downlink voice are detected, and under the condition that the earphone which is not worn is detected in the first earphone and the second earphone, the connection with the earphone which is not worn is disconnected. Therefore, under the condition that the electronic equipment outputs downlink voice to the first earphone and the second earphone simultaneously and parallelly, after the earphones are taken down and are in the unworn state, the electronic equipment can be disconnected from the earphones in the unworn state, so that the earphones in the unworn state still occupy wireless resources, the wireless resources which can be utilized by the earphones in the unworn state can be improved to a certain extent, the overall call quality is improved, and the user experience is further improved.
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 shows a schematic diagram of an electronic device interacting with a headset according to the present application;
FIG. 2 illustrates a schematic diagram of another electronic device and headset interaction presented herein;
fig. 3 is a flowchart illustrating a device control method applied to an electronic device according to the present application;
fig. 4 is a flowchart illustrating another apparatus control method applied to an electronic apparatus according to the present application;
fig. 5 is a flowchart illustrating a further apparatus control method applied to an electronic apparatus according to the present application;
fig. 6 is a block diagram illustrating an audio output apparatus operating in an electronic device according to the present disclosure;
fig. 7 is a block diagram illustrating another audio output device operating in an electronic apparatus according to the present application;
fig. 8 is a block diagram illustrating an audio output device of an electronic apparatus according to the present invention;
fig. 9 shows a block diagram of an electronic device proposed in the present application;
fig. 10 is a storage unit according to an embodiment of the present application, configured to store or carry program code for implementing a device control method according to an embodiment of the present application.
Detailed Description
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. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
With the increase of the types of audio playing devices and the improvement of playing sound effects, more users can select to output audio played by electronic devices such as mobile phones and tablet computers to the audio playing devices for playing. Common audio playing devices include a vehicle-mounted music player, a sound box, an earphone, and the like. Wherein, the earphone comprises a wired earphone or a wireless earphone.
Take an earphone as an example. If the earphone is a wired earphone, after the wired earphone is connected with the electronic device, the electronic device can transmit the audio to the wired earphone through a physical line of the wired earphone, so that the wired earphone can play the audio conveniently. Furthermore, if the earphone is a wireless earphone, the wireless earphone proposes a communication link according to a wireless communication protocol supported by the wireless earphone and the electronic device in advance, and then the electronic device transmits the audio to the wireless earphone through the communication link so that the wireless earphone can play the audio. For example, as shown in fig. 1, in one case, the wireless headset includes a first headset 110 and a second headset 120, the electronic device 100 suggests a communication link with the first headset 110 and the second headset 120, respectively, based on the aforementioned wireless communication protocol. Furthermore, as shown in fig. 2, the electronic device 100 may directly suggest a communication link based on the aforementioned wireless communication protocol for the first earphone 100, and then suggest a communication link based on the aforementioned wireless communication protocol for the first earphone 110 and the second earphone 120. The wireless communication protocol may include a Wlan protocol, a bluetooth protocol, a ZigBee protocol, or the like.
However, in the research of the inventor, taking the bluetooth protocol as an example, if the electronic device is connected to the headset through the bluetooth protocol, in a case that the headset includes a first headset and a second headset, the electronic device performs data interaction with the first headset and the second headset in a tdd (time Division duplex) manner based on the established connection, and if in some cases, for example, one of the first headset and the second headset is removed to be in an unworn state, but the removed headset and the electronic device still maintain a connection based on the bluetooth protocol, resources of a communication frequency band required for bluetooth communication are wasted, and meanwhile, the electronic device still maintains a connection state with the headset in the unworn state, and further, the electronic device consumes computing resources and power, and if in an environment with a complicated wireless environment, the communication quality between the electronic device and the headset in a wearing state is poor, and the user experience is reduced. Therefore, the inventors propose a device control method, an apparatus, and an electronic device in the present application that can improve the above-described problems.
Embodiments of the present application will be described in detail below with reference to the accompanying drawings.
Referring to fig. 3, an apparatus control method provided in the present application is applied to an electronic apparatus, and the method includes:
step S110: and when the electronic equipment is in a call state, detecting an output mode of downlink voice of the call.
It can be understood that, the electronic device determines whether the current mode is the earphone output mode by detecting the output mode of the downlink voice, so as to detect whether the current mode is the downlink voice playing through the earphone.
In this application, the electronic device may determine whether to play the downlink voice through the earphone in various ways. As one way, if the electronic device is connected to an external audio output device through bluetooth, it may be determined whether to play the downlink voice through the headset by detecting the type of the connected bluetooth device. For example, in an Android operating system based electronic device, the device type currently connected through bluetooth may be determined by a return value based on instantiating a bluetooth class. If the returned value is AUDIO _ VIDEO _ CAMCORDER, the image acquisition device is characterized. If the returned value is AUDIO _ VIDEO _ CAR _ AUDIO, the vehicle-mounted device is characterized. If the returned value is AUDIO _ VIDEO _ HIFI _ AUDIO, the AUDIO playback device or the VIDEO playback device is characterized. If the returned value is AUDIO _ VIDEO _ MICROPHONE, then the MICROPHONE is characterized. If the return value is AUDIO _ VIDEO _ hearing, then the earphone is characterized. Then in this case, if the return value is detected as AUDIO _ VIDEO _ available _ speech _ repair, then the characterization is the playback of the downstream speech through the headphones.
Alternatively, the electronic device may determine whether a headset is connected to the electronic device by detecting a return value of an isWired HeadseOn () method of the AudioManager class, or determine whether to communicate with the headset by a setBuluethoScoOn (bootean) method of the AudioManager class.
Furthermore, the electronic device can also combine the two manners to determine whether to play audio through the earphone. For example, when the electronic device detects that the return value obtained by instantiating the bluetooth class device class is AUDIO _ VIDEO _ hearing _ repair, and the return value of the iswiredfeedseton () method of the AudioManager class indicates that an earphone is inserted, it determines that playback is performed by the earphone. If the electronic device detects that the return value obtained by instantiating the bluetooth class device class is AUDIO _ VIDEO _ powered _ repair, and the return value representation of the setbackup scene on (bootean on) method of the AudioManager class is communicated with the bluetooth HEADSET, it is determined that the downlink voice is played through the HEADSET.
Step S120: and if the output mode is an earphone output mode, detecting the wearing states of the first earphone and the second earphone which output the downlink voice.
As one mode, whether the earphone is in a wearing state may be detected by an infrared sensor provided to the earphone. It should be noted that, when the earphone is worn on the ear of a person, some areas may be blocked, and in this case, in a manner that the infrared sensor is disposed in the area that is blocked after the earphone is in the wearing state, whether the infrared signal emitted by the infrared sensor is blocked is determined by detecting the returned state value of the infrared sensor, so as to determine whether the earphone is in the wearing state or the non-wearing state. It will be appreciated that the headset is determined to be in a worn state when the returned state value indicates that the infrared signal is occluded and in an unworn state when the returned state value indicates that the infrared signal is not occluded.
Then, as one way, the headset may detect the content represented by the state value returned by the infrared sensor at a set period, and transmit the content represented by the acquired state value returned by the infrared sensor to the electronic device at the set period, so that the electronic device records whether the headset is in a wearing state in real time. Alternatively, the electronic device may be configured by building locally a text file in which a variable, e.g., headset _ status, is configured. If the electronic device recognizes that the content representation earphone returned by the earphone is in a wearing state, 1 may be assigned to the variable headset _ status, and when the electronic device recognizes that the content representation earphone returned by the earphone is in an unworn state, 0 may be assigned to the variable headset _ status. It is possible to determine whether the headset is in a wearing state by detecting the value of the variable headset _ status in the text file after the electronic device detects that the audio playback is performed through the headset.
It should be noted that, in addition to the aforesaid detection of whether the earphone is in the wearing state by the infrared sensor, other elements may be provided to determine whether the earphone is in the wearing state. For example, a component may be disposed at a portion of the earphone that contacts with the skin of the human body after the earphone is worn, and a resistance value of the component may change after the component contacts with the skin of the human body (for example, a thermistor). Accordingly, in this manner, after the earphone determines whether the earphone is in the wearing state through the current change of the path, the result of the detection can be transmitted to the electronic device.
Step S130: and if the earphone in the unworn state is detected in the first earphone and the second earphone, disconnecting the earphone from the earphone in the unworn state.
It can be understood that, if the electronic device needs to send audio to the headset, the electronic device needs to establish a connection with the headset to construct a data transmission channel, and then output the audio to the headset based on the data transmission channel. For example, a connection established between the electronic device and the headset based on the bluetooth protocol is taken as an example. In the process of establishing the connection, a link connection, that is, a connection of the ACL link, is first established between the electronic device and the headset. After the ACL link connection is established, the electronic device initiates a request for establishing a channel connection, that is, the connection of the L2CAP, and completes all connection procedures in the connection mode after the connection of the L2CAP is established. Then after the channel connection is established, audio transmission can begin. For example, downstream voice during a call is transmitted.
In this case, when detecting that there is an unworn earphone of the first earphone and the second earphone, the connection with the earphone in the unworn state may be directly disconnected, so that the earphone in the unworn state may be detected in the following, and after switching to the wearing state, the connection with the electronic device may be established more quickly.
In particular, only the second portion may be disconnected, leaving the remaining first portion connected. For example, the link connection and the channel connection are successively performed in the process based on the bluetooth connection. The headset may either disconnect only the channel connection (the connection of the second part) while maintaining the link connection (the connection of the first part) or disconnect both the link connection and the channel connection.
It should be noted that, generally, for a connection including a first partial connection and a second partial connection in the whole process, after the first partial connection is completed, a request for sending the second partial connection is started, and in a case that no response is received in relation to the request for the second partial connection within a set time period, it is determined that the connection fails, and the request for resending the second partial connection is continued, and if the number of failures exceeds a set number, the connection is abandoned, and at the same time, the already established first partial connection is disconnected. In order to avoid the influence of this situation on the disconnection of only a part of the connection between the electronic device and the headset in the present solution, the length of the aforementioned set time period may be adaptively modified to be longer, or set to be infinitely long, so that the part of the connection that has not been disconnected may be continuously maintained without being disconnected for the aforementioned reason.
As a mode, if it is detected that there is an earphone in an unworn state in the first earphone and the second earphone, acquiring complexity of a wireless environment, where the complexity of the wireless environment is used to represent a probability that the electronic device is interfered in the earphone output mode, and the higher the complexity of the wireless environment, the higher the probability of being interfered; and if the complexity of the wireless environment is greater than a set value, disconnecting the earphone which is not worn.
In the present application, the electronic device may determine the wireless environment complexity in a number of ways.
It can be understood that, when the electronic device is in the earphone output mode, and transmits data such as downlink voice or audio in a call process to the earphone, the electronic device needs to establish a wireless connection with the earphone first. In this case, the wireless signal transmitted by other electronic devices using the same wireless frequency band may interfere with the data transmission process from the electronic device to the headset.
Then, based on the above situation, the method for determining the complexity of the wireless environment includes: acquiring the number of wireless connection points which can be detected by the electronic equipment, wherein the wireless connection points broadcast wireless signals by using a wlan protocol or a Bluetooth protocol; acquiring the number of the wireless connection points to which the electronic equipment is connected; calculating a wireless environment complexity based on the number of detectable wireless connection points and the number of connected wireless connection points. The wireless access point may be other user terminals or devices such as an AP.
Optionally, in the process of calculating the complexity of the wireless environment, the electronic device may configure a weight for the number of detectable wireless connection points, and configure a weight for the number of the wireless connection points to which the electronic device has been connected, then calculate a score according to the number of the detectable wireless connection points, and simultaneously calculate a score according to the number of the wireless connection points to which the electronic device has been connected, and sum a value obtained by multiplying the score by the respective weights, that is, the score representing the complexity of the wireless environment.
For example, if a data table of correspondence between the number of detectable wireless connection points and the fraction is stored in the electronic device, and a data table of correspondence between the number of already connected wireless connection points and the fraction is configured at the same time, the electronic device obtains, by means of a table lookup, that the fraction corresponding to the number of detectable wireless connection points is a, the fraction corresponding to the number of already connected wireless connection points is b, the weight of the number of already connected wireless connection points is 70%, and the weight of the number of already connected wireless connection points is 30%, then the calculated complexity of the wireless environment is a + 30% + b + 70%.
Furthermore, in addition to determining the wireless complexity by detecting the number of wireless access points as described above, the wireless complexity may also be determined by the signal strengths of the detected wireless access points. For example, the electronic device may configure a corresponding relationship between the signal strength and the score, and query corresponding scores for detectable wireless access points and connected wireless access points according to the corresponding relationship, and the electronic device may still configure weights for the detectable wireless access points and the connected wireless access points respectively, and then sum values obtained by multiplying the scores by the corresponding weights respectively, i.e. the obtained score representing the complexity of the wireless environment. For example, if the fraction of wireless access points that can be detected by the electronic device is c and the fraction of the number of wireless access points that the electronic device is connected to is d, the calculated complexity of the wireless environment is c × 20% + d × 80% if the weight of the number of wireless access points that have been connected is 80% and the weight of the number of wireless access points that can be detected is 20%.
It should be noted that the foregoing detectable wireless access points do not include a wireless access point to which the electronic device has been connected, and the wireless access point to which the electronic device has been connected does not include a connection with the headset.
According to the device control method, when the electronic device is in a call state, the output mode of downlink voice of the call is detected, if the output mode is an earphone output mode, the wearing states of a first earphone and a second earphone which output the downlink voice are detected, and under the condition that the earphone which is not worn is detected in the first earphone and the second earphone, the connection with the earphone which is not worn is disconnected. Therefore, under the condition that the electronic equipment outputs downlink voice to the first earphone and the second earphone simultaneously and parallelly, after the earphones are taken down and are in the unworn state, the electronic equipment can be disconnected from the earphones in the unworn state, so that the earphones in the unworn state still occupy wireless resources, the wireless resources which can be utilized by the earphones in the unworn state can be improved to a certain extent, the overall call quality is improved, and the user experience is further improved.
Referring to fig. 4, an apparatus control method provided by the present application is applied to an electronic apparatus, and the method includes:
step S210: and when the electronic equipment is in a call state, detecting an output mode of downlink voice of the call.
Step S220: and if the output mode is an earphone output mode, detecting the wearing states of the first earphone and the second earphone which output the downlink voice.
Step S230: and if the headset in the unworn state is detected to exist in the first headset and the second headset, judging whether the headset in the unworn state has an acceleration which is vertically downward and the acceleration value of which meets the preset condition.
It should be noted that in some cases, the earphone may accidentally fall off the user's ear, and in such cases, the earphone makes an approximate free-fall movement, and then the earphone may have an acceleration similar to the acceleration of gravity, and the acceleration may be directed vertically downward. In this case, the electronic device obtains the acceleration of the earphone in the unworn state in real time when detecting that there is an earphone in the unworn state in the first earphone and the second earphone, and then determines whether the earphone in the unworn state has an acceleration that is vertically downward and whose acceleration value meets a preset condition.
Step S240: if not, the earphone is disconnected with the earphone which is not worn.
Step S250: if yes, judging that the earphone in the unworn state is accidentally dropped, and keeping the connection with the earphone in the unworn state.
Optionally, after the electronic device executes step S250, the electronic device may further continuously detect whether the earphone accidentally dropped is switched to the wearing state within a set time period, and if not, disconnect the earphone accidentally dropped.
According to the equipment control method, when the electronic equipment is in a conversation state, the output mode of downlink voice of the conversation is detected, if the output mode is an earphone output mode, the wearing states of the first earphone and the second earphone of the downlink voice are detected and output, and whether the earphone in the unworn state is accidentally dropped or not is detected under the condition that the earphone in the unworn state is arranged in the first earphone and the second earphone is detected, and if not, the connection with the earphone in the unworn state is disconnected. Therefore, under the condition that the electronic equipment outputs downlink voice to the first earphone and the second earphone simultaneously and parallelly, after the earphones are taken down and are in the unworn state, the electronic equipment can be disconnected from the earphones in the unworn state, so that the earphones in the unworn state still occupy wireless resources, the wireless resources which can be utilized by the earphones in the unworn state can be improved to a certain extent, the overall call quality is improved, and the user experience is further improved.
Referring to fig. 5, an apparatus control method provided by the present application is applied to an electronic apparatus, and the method includes:
step S310: and when the electronic equipment is in a call state, detecting an output mode of downlink voice of the call.
Step S320: and if the output mode is an earphone output mode, detecting the wearing states of the first earphone and the second earphone which output the downlink voice.
Step S330: and if the earphone in the unworn state is detected in the first earphone and the second earphone, disconnecting the earphone from the earphone in the unworn state.
Step S340: and if the earphone in the unworn state is detected to be switched to a wearing state, establishing connection with the earphone switched to the wearing state.
It should be noted that, if the electronic device is interfered by other wireless signals in the process of transmitting the downlink voice to the earphone, the content of the transmitted downlink voice is easily lost or suddenly changed, so that the user cannot clearly hear the content of the downlink voice. The point electronic device has more link establishment or signaling interaction in the process of establishing wireless connection with other devices, which means that wireless signals are more active in the process of establishing wireless connection.
Based on the foregoing situation, as a manner, after receiving information that the headset in the unworn state is switched to the worn state and sent by the headset in the worn state of the first headset and the second headset, identifying an idle time period for transmitting downlink voice in the call process; and establishing connection with the earphone switched to the wearing state in the idle time period.
The idle period may be determined in a number of ways in the present application.
Optionally, the step of identifying an idle time period for transmitting the downlink voice in the call process includes: detecting the time when the electronic equipment sends uplink voice; and taking the time period between the moment when the uplink voice is started to be transmitted and the moment when the downlink voice is received as an idle time period. It should be understood that the sending of the uplink voice is sending the uplink voice to the base station or the wireless access point, and the receiving of the downlink voice is receiving the downlink voice from the base station or the wireless access point.
Further, optionally, the electronic device determines the idle period by recognizing upstream speech content. For example, when the electronic device recognizes that there is a setting content for the opposite user to wait, such as "wait" or "wait", in the upstream speech content, the setting time period from the detection of the setting content is determined as the idle time period. The setting time period after the start of the setting content is detected can be configured by the electronic device or determined according to the detected setting content in the uplink voice. For example, when it is detected that the content of the waiting time period, such as "wait for 5 minutes" is included in the upstream audio content, the length of the identified waiting time period is taken as the length of the idle time period, and when it is recognized that the content of the waiting time period is not detected in the upstream audio content, the length of the idle time period after the start of the setting content is detected is taken as the length of the time period configured by the electronic device in default.
It should be noted that, if the electronic device is connected to the base station or the wireless access point, the voice sent by the electronic device to the base station or the wireless access point is uplink voice, and the voice sent by the base station or the wireless access point to the electronic device is downlink voice.
The application provides an equipment control method, when the electronic equipment is in a conversation state, the output mode of the downlink voice of the conversation is detected, if the output mode is an earphone output mode, the wearing states of a first earphone and a second earphone which output the downlink voice are detected, and when the situation that the earphone which is not in the wearing state is arranged in the first earphone and the second earphone is detected, whether the earphone which is not in the wearing state is accidentally dropped is detected, if not, the connection with the earphone which is not in the wearing state is disconnected, and the idle time period for transmitting the downlink voice by the electronic equipment and the earphone which is in the wearing state are connected again can be recovered, so that the communication between the electronic equipment and the earphone which is in the wearing state is prevented from being influenced.
Therefore, under the condition that the electronic equipment outputs downlink voice to the first earphone and the second earphone simultaneously and parallelly, after the earphones are taken down and are in the unworn state, the electronic equipment can be disconnected from the earphones in the unworn state, so that the earphones in the unworn state still occupy wireless resources, the wireless resources which can be utilized by the earphones in the unworn state can be improved to a certain extent, the overall call quality is improved, and the user experience is further improved.
Referring to fig. 6, the present application provides an apparatus 400 for controlling a device, which is operated in an electronic device, where the apparatus 400 includes: an audio output detection unit 410, a device detection unit 420, and a device control unit 430.
An audio output detection unit 410, configured to detect an output manner of a downlink voice of a call when the electronic device is in a call state.
The device detection unit 420 is configured to detect a wearing state of the first earphone and the second earphone outputting the downlink voice if the audio output detection unit detects that the output mode is an earphone output mode.
And the device control unit 430 is configured to disconnect the headset in the unworn state if the device detection unit detects that there is a headset in the unworn state in the first headset and the second headset.
As a manner, the device control unit 430 is specifically configured to, if it is detected that there is an earphone in an unworn state in the first earphone and the second earphone, obtain a complexity of a wireless environment, where the complexity of the wireless environment is used to represent a probability that the electronic device is interfered in the earphone output mode, and the higher the complexity of the wireless environment, the higher the probability of being interfered is; and if the complexity of the wireless environment is greater than a set value, disconnecting the earphone which is not worn.
The device control unit 430 is specifically configured to acquire the number of wireless connection points that can be detected by the electronic device, where the wireless connection points broadcast wireless signals according to a wlan protocol or a bluetooth protocol; acquiring the number of the wireless connection points to which the electronic equipment is connected; calculating a wireless environment complexity based on the number of detectable wireless connection points and the number of connected wireless connection points.
As another way, the device control unit 430 is specifically configured to, if it is detected that there is an unworn earphone in the first earphone and the second earphone, determine whether the unworn earphone has an acceleration that is vertically downward and whose acceleration value meets a preset condition; if not, the earphone is disconnected with the earphone which is not worn.
Referring to fig. 7, the present application provides an apparatus 500 for controlling a device, which is operated in an electronic device, where the apparatus 500 includes: an audio output detection unit 510, a device detection unit 520, a gesture detection unit 530, and a device control unit 540.
An audio output detection unit 510, configured to detect an output manner of a downlink voice of a call when the electronic device is in a call state.
And an apparatus detecting unit 520, configured to detect a wearing state of the first earphone and the second earphone outputting the downlink voice if the audio output detecting unit detects that the output mode is an earphone output mode.
And the posture detection unit 530 is configured to, if the device detection unit 520 detects that there is an unworn earphone in the first earphone and the second earphone, determine whether the unworn earphone has an acceleration that is vertically downward and an acceleration value of which meets a preset condition.
And the device control unit 540 is configured to disconnect the headset in the unworn state if the posture detection unit 530 determines that the headset in the unworn state does not have an acceleration that is vertically downward and the acceleration value meets a preset condition.
Referring to fig. 8, an apparatus 600 for controlling a device provided by the present application, operating on an electronic device, includes:
the audio output detection unit 610 is configured to detect an output mode of a downlink voice of the call when the electronic device is in a call state.
And the device detection unit 620 is configured to detect a wearing state of the first earphone and the second earphone outputting the downlink voice if the audio output detection unit detects that the output mode is the earphone output mode.
And the device control unit 630 is configured to disconnect the headset in the unworn state if the device detection unit detects that there is a headset in the unworn state in the first headset and the second headset.
The device control unit 630 is further configured to establish a connection with the headset switched to the wearing state if it is detected that the headset in the unworn state is switched to the wearing state.
As one way, the device control unit 630 includes:
the idle time period acquiring subunit 631 is configured to identify an idle time period for transmitting downlink voice in the call process after receiving information that the headset in the unworn state is switched to the worn state and is sent by the headset in the worn state of the first headset and the second headset.
Optionally, the idle period acquiring subunit 631 is specifically configured to detect a time when the electronic device sends the uplink voice; and taking the time period between the moment when the uplink voice is started to be transmitted and the moment when the downlink voice is received as an idle time period.
A connection control subunit 632, configured to establish a connection with the earphone switched to the wearing state in the idle time period.
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 units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. In the several embodiments provided in the present application, the coupling between the modules may be electrical, mechanical or other type of coupling. 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.
To sum up, the device control method, the device and the electronic device provided by the application detect the downlink voice output mode of the call when the electronic device is in the call state, detect and output the wearing states of the first earphone and the second earphone of the downlink voice if the output mode is the earphone output mode, and disconnect the connection with the earphone in the non-wearing state when detecting that the earphone in the non-wearing state exists in the first earphone and the second earphone. Therefore, under the condition that the electronic equipment outputs downlink voice to the first earphone and the second earphone simultaneously and parallelly, after the earphones are taken down and are in the unworn state, the electronic equipment can be disconnected from the earphones in the unworn state, so that the earphones in the unworn state still occupy wireless resources, the wireless resources which can be utilized by the earphones in the unworn state can be improved to a certain extent, the overall call quality is improved, and the user experience is further improved.
An electronic device provided by the present application will be described below with reference to fig. 9.
Referring to fig. 9, based on the device control method and apparatus, another electronic device 200 capable of executing the device control method is further provided in the embodiment of the present application. The electronic device 200 includes one or more processors 102 (only one shown), a memory 104, a wireless module 106, an audio module 108, a gesture detection module 110, and a sound collection module 112 coupled to one another. The memory 104 stores programs that can execute the content of the foregoing embodiments, and the processor 102 can execute the programs stored in the memory 104.
Processor 102 may include one or more processing cores, among other things. The processor 102 interfaces with various components throughout the electronic device 100 using various interfaces and circuitry to perform various functions of the electronic device 100 and process data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 104 and invoking data stored in the memory 104. Alternatively, the processor 102 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 102 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. The CPU mainly processes an operating system, a user interface, a target 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 102, but may be implemented by a communication chip.
The Memory 104 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 104 may be used to store instructions, programs, code sets, or instruction sets. The memory 104 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 storage data area may also store data created by the electronic device 200 in use (such as the aforementioned text documents), and the like.
The wireless module 106 is configured to receive and transmit electromagnetic waves, and achieve interconversion between the electromagnetic waves and the electrical signals, so as to communicate with a communication network or other devices, for example, an audio playing device. The wireless module 106 may include various existing circuit elements for performing these functions, such as an antenna, a radio frequency transceiver, a digital signal processor, an encryption/decryption chip, a Subscriber Identity Module (SIM) card, memory, and so forth. The wireless module 106 may communicate with various networks, such as the internet, an intranet, a wireless network, or with other electronic devices via a wireless network. The wireless network may comprise a cellular telephone network, a wireless local area network, or a metropolitan area network. The wireless network described above may use various communication standards, protocols, and technologies, including but not limited to WLAN protocols and bluetooth protocols, and may even include those that are not currently under development.
Further, the audio module 108 may be used to process audio output or received in the electronic device 200. The gesture detection module 110 may include an acceleration sensor, a gyroscope, and the like to detect a gesture or acceleration of the electronic device 200.
The sound collection module 112 can collect voice signals and transmit the voice signals to other electronic devices through the wireless module 106.
The electronic device 200 may be the electronic device 100 described above. The first earphone 110 or the second earphone 120 may be the same as described above.
Referring to fig. 10, a block diagram of a computer-readable storage medium according to an embodiment of the present application is shown. The computer-readable medium 800 has stored therein a program code that can be called by a processor to execute the method described in the above-described method embodiments.
The computer-readable storage medium 800 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. Alternatively, the computer-readable storage medium 800 includes a non-volatile computer-readable storage medium. The computer readable storage medium 800 has storage space for program code 810 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 810 may be compressed, for example, in a suitable form.
For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
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 (8)

1. An apparatus control method applied to an electronic apparatus, the method comprising:
when the electronic equipment is in a call state, detecting an output mode of downlink voice of the call;
if the output mode is an earphone output mode, detecting the wearing states of a first earphone and a second earphone which output the downlink voice;
if the first earphone and the second earphone are detected to have the earphone which is not worn, acquiring the complexity of a wireless environment, wherein the complexity of the wireless environment is used for representing the probability that the electronic equipment is interfered in the earphone output mode, and the higher the complexity of the wireless environment, the higher the probability of interference is; wherein the step of obtaining the complexity of the current wireless environment comprises: acquiring the number of wireless connection points which can be detected by the electronic equipment, wherein the wireless connection points broadcast wireless signals by using a wlan protocol or a Bluetooth protocol; acquiring the number of the wireless connection points to which the electronic equipment is connected; calculating a wireless environment complexity based on the number of detectable wireless connection points and the number of connected wireless connection points;
and if the complexity of the wireless environment is greater than a set value, disconnecting the earphone which is not worn.
2. The method of claim 1, wherein the step of disconnecting the headset from the unworn state if the complexity of the wireless environment is greater than a set value comprises:
if the complexity of the wireless environment is greater than a set value, starting timing of a set time length;
if the earphone is in the set time length, the earphone in the unworn state is in the current wearing state;
and if the current wearing state is the non-wearing state, disconnecting the earphone from the earphone in the non-wearing state.
3. The method of claim 1, further comprising:
and if the earphone in the unworn state is detected to be switched to a wearing state, establishing connection with the earphone switched to the wearing state.
4. The method according to claim 3, wherein the step of establishing a connection with the headset switched to the wearing state if it is detected that the headset in the unworn state is switched to the wearing state comprises:
if receiving information that the earphone in the unworn state is switched to the wearing state, which is sent by the earphone in the wearing state of the first earphone and the second earphone, identifying an idle time period for transmitting downlink voice in the communication process;
and establishing connection with the earphone switched to the wearing state in the idle time period.
5. The method of claim 4, wherein the step of identifying idle periods during which downstream voice is transmitted during the call comprises:
detecting the time when the electronic equipment sends uplink voice;
and taking the time period between the moment when the uplink voice is started to be transmitted and the moment when the downlink voice is received as an idle time period.
6. An apparatus control device, operable with an electronic device, the device comprising:
the audio output detection unit is used for detecting the output mode of the downlink voice of the call when the electronic equipment is in a call state;
the device detection unit is used for detecting the wearing states of a first earphone and a second earphone which output the downlink voice if the audio output detection unit detects that the output mode is an earphone output mode;
the device control unit is used for acquiring wireless environment complexity if detecting that an earphone in an unworn state exists in the first earphone and the second earphone, wherein the wireless environment complexity is used for representing the probability that the electronic device is interfered in the earphone output mode, and the higher the wireless environment complexity is, the higher the interfered probability is; wherein the step of obtaining the complexity of the current wireless environment comprises: acquiring the number of wireless connection points which can be detected by the electronic equipment, wherein the wireless connection points broadcast wireless signals by using a wlan protocol or a Bluetooth protocol; acquiring the number of the wireless connection points to which the electronic equipment is connected; calculating a wireless environment complexity based on the number of detectable wireless connection points and the number of connected wireless connection points;
and if the complexity of the wireless environment is greater than a set value, disconnecting the earphone which is not worn.
7. An electronic device comprising one or more processors and memory;
one or more programs 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-5.
8. A computer-readable storage medium, having program code stored therein, wherein the program code when executed by a processor performs the method of any of claims 1-5.
CN201811163050.6A 2018-09-30 2018-09-30 Equipment control method and device and electronic equipment Active CN109151212B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811163050.6A CN109151212B (en) 2018-09-30 2018-09-30 Equipment control method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811163050.6A CN109151212B (en) 2018-09-30 2018-09-30 Equipment control method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN109151212A CN109151212A (en) 2019-01-04
CN109151212B true CN109151212B (en) 2021-03-12

Family

ID=64810634

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811163050.6A Active CN109151212B (en) 2018-09-30 2018-09-30 Equipment control method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN109151212B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110677758B (en) * 2019-09-09 2021-07-02 广东思派康电子科技有限公司 Head-wearing earphone
CN111436016B (en) * 2019-10-29 2021-07-30 珠海市杰理科技股份有限公司 Earphone ear-to-ear debugging method, device and system and wireless earphone
CN113973249B (en) * 2020-07-24 2023-04-07 华为技术有限公司 Earphone communication method and earphone
CN112118502B (en) * 2020-09-10 2022-08-05 北京小米移动软件有限公司 Earphone control method, device, equipment and storage medium
CN113645352A (en) * 2021-07-14 2021-11-12 西安Tcl软件开发有限公司 Bluetooth headset anti-loss method, device and system and computer readable storage medium
CN115052066A (en) * 2022-08-16 2022-09-13 荣耀终端有限公司 Communication method and related device
CN115119098B (en) * 2022-08-30 2022-12-27 荣耀终端有限公司 Audio playing control method, TWS earphone and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN207603865U (en) * 2017-12-20 2018-07-10 歌尔科技有限公司 A kind of wireless headset
CN108418945A (en) * 2017-02-10 2018-08-17 深圳市九州通机电设备有限公司 A kind of Bluetooth of mobile phone intelligent comprehensive processing system and method
CN108549529A (en) * 2018-04-08 2018-09-18 北京小米移动软件有限公司 Control the method and device of audio output

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102322030B1 (en) * 2015-02-13 2021-11-04 삼성전자주식회사 Method for reducing power consumption based on a user’s using pattern and apparatus thereof
CN105828253B (en) * 2016-03-22 2018-11-20 广东欧珀移动通信有限公司 Wireless connection control method and device in audio frequency broadcast system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108418945A (en) * 2017-02-10 2018-08-17 深圳市九州通机电设备有限公司 A kind of Bluetooth of mobile phone intelligent comprehensive processing system and method
CN207603865U (en) * 2017-12-20 2018-07-10 歌尔科技有限公司 A kind of wireless headset
CN108549529A (en) * 2018-04-08 2018-09-18 北京小米移动软件有限公司 Control the method and device of audio output

Also Published As

Publication number Publication date
CN109151212A (en) 2019-01-04

Similar Documents

Publication Publication Date Title
CN109151212B (en) Equipment control method and device and electronic equipment
CN112789866B (en) Audio data transmission method and equipment applied to TWS earphone single-ear and double-ear switching
CN109413555B (en) Audio output method and device, earphone and electronic equipment
US10785361B2 (en) Method for call processing and electronic device
CN109107158B (en) Sound effect processing method and device, electronic equipment and computer readable storage medium
CN109151211B (en) Voice processing method and device and electronic equipment
CN109104684B (en) Microphone hole blockage detection method and related product
US20180091637A1 (en) Information processing device
CN108886653A (en) A kind of earphone sound channel control method, relevant device and system
CN109257732B (en) Equipment control method and device and electronic equipment
US10827455B1 (en) Method and apparatus for sending a notification to a short-range wireless communication audio output device
WO2020192547A1 (en) Information transmission and reception method, terminal and network side device
CN110475312B (en) Access control method, message broadcasting method and related equipment
CN108600887B (en) Touch control method based on wireless earphone and related product
CN110602683B (en) Bluetooth control method, device, mobile terminal and storage medium
CN109151741B (en) Multimedia message receiving method and terminal
CN108449787B (en) Connection control method and device and electronic equipment
CN113784001A (en) Audio data playing method and device, electronic equipment and storage medium
CN108566221B (en) Call control method and related equipment
CN115022766B (en) Audio data playing method and equipment
CN108429854B (en) Communication control method and related product
CN110475367B (en) Transmission method, mobile communication terminal and network side equipment
CN114466099B (en) Control method and device of Bluetooth equipment and storage medium
CN109413527B (en) Audio device control method and device, earphone and electronic device
CN114501239A (en) Master-slave switching method and device of earphone, Bluetooth earphone 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