WO2020063045A1 - 耳机解锁方法、装置、电子设备以及存储介质 - Google Patents

耳机解锁方法、装置、电子设备以及存储介质 Download PDF

Info

Publication number
WO2020063045A1
WO2020063045A1 PCT/CN2019/096214 CN2019096214W WO2020063045A1 WO 2020063045 A1 WO2020063045 A1 WO 2020063045A1 CN 2019096214 W CN2019096214 W CN 2019096214W WO 2020063045 A1 WO2020063045 A1 WO 2020063045A1
Authority
WO
WIPO (PCT)
Prior art keywords
bluetooth headset
electronic device
bluetooth
posture
preset condition
Prior art date
Application number
PCT/CN2019/096214
Other languages
English (en)
French (fr)
Inventor
龚金华
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2020063045A1 publication Critical patent/WO2020063045A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R1/00Details of transducers, loudspeakers or microphones
    • H04R1/10Earpieces; Attachments therefor ; Earphones; Monophonic headphones
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/033Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor
    • G06F3/0346Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor with detection of the device orientation or free movement in a 3D space, e.g. 3D mice, 6-DOF [six degrees of freedom] pointers using gyroscopes, accelerometers or tilt-sensors

Definitions

  • the present application relates to the technical field of electronic devices, and more particularly, to a method, an apparatus, an electronic device, and a storage medium for unlocking a headset.
  • the present application proposes a headphone control method, device, electronic device, and storage medium to solve the above problems.
  • an embodiment of the present application provides a method for unlocking a headset, which is applied to an electronic device.
  • the method includes: when a Bluetooth headset is in a locked state, acquiring first posture data of the Bluetooth headset; When the posture of the headset changes, detecting the second posture data and contact parameters of the Bluetooth headset; determining whether the relationship between the first posture data and the second posture data meets a first preset condition, and Whether the contact parameter satisfies a second preset condition; when the relationship between the first posture data and the second posture data satisfies the first preset condition, and the contact parameter satisfies the second preset condition When conditions are met, the Bluetooth headset is unlocked.
  • an embodiment of the present application provides a device for unlocking a headset, which is applied to an electronic device.
  • the device includes: an obtaining module configured to obtain first posture data of the Bluetooth headset when the Bluetooth headset is in a locked state.
  • a detection module for detecting a second posture data and a contact parameter of the Bluetooth headset when the posture of the Bluetooth headset changes; a determination module for determining the first posture data and the second posture data Whether the relationship between them satisfies a first preset condition, and determines whether the contact parameter satisfies a second preset condition; an unlocking module, configured to: when the relationship between the first posture data and the second posture data satisfies When the first preset condition and the contact parameter satisfy the second preset condition, unlock the Bluetooth headset.
  • an embodiment of the present application provides an electronic device including a Bluetooth module; a memory; one or more processors coupled to the Bluetooth module and the memory, respectively; and one or more programs, wherein The one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to perform the above method.
  • an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores program code, and the program code can be called by a processor to execute the foregoing method.
  • FIG. 1 is a schematic diagram of an application environment provided by an embodiment of the present application.
  • FIG. 2 is a schematic diagram of another application environment provided by an embodiment of the present application.
  • FIG. 3 is a schematic flowchart of a method for unlocking a headset provided by an embodiment of the present application
  • FIG. 4 is a schematic flowchart of a method for unlocking a headset provided by another embodiment of the present application.
  • FIG. 5 is a schematic flowchart of a method for unlocking a headset provided by another embodiment of the present application.
  • FIG. 6 shows a module block diagram of an earphone unlocking device provided by an embodiment of the present application
  • FIG. 7 shows a block diagram of an electronic device according to an embodiment of the present application for performing a method for unlocking a headset according to an embodiment of the present application
  • FIG. 8 illustrates a storage unit for saving or carrying a program code for implementing a method for unlocking a headset according to an embodiment of the present application.
  • the audio architecture of an electronic device is similar to that of a computer, and is mainly completed by a processor and a built-in audio CODEC (codec). Specifically, after receiving the input of audio data, the processor converts it into an I2S signal, transmits it to a CODEC, converts it into an analog signal, and then plays it.
  • the electronic device may be connected to an external audio playback device and play audio data through the audio playback device.
  • the audio playback device may receive audio data transmitted from the electronic device and play the audio data.
  • Audio playback devices may include headphones, speakers, and on-board equipment.
  • electronic devices and external audio playback devices need to use a network to perform data transmission.
  • electronic devices and audio playback devices need to use a wireless fidelity (WiFi) connection for data transmission, or electronic devices and The audio playback device needs to use Bluetooth (BT) connection for data transmission, etc.
  • WiFi wireless fidelity
  • BT Bluetooth
  • the electronic device can be connected to the audio playback device via Bluetooth, and the audio data is transmitted to the audio playback device via Bluetooth for playback. .
  • the current electronic device 100 generally has a Bluetooth (BT) module.
  • the Bluetooth module may refer to a chip basic circuit set with integrated Bluetooth function, and is used for wireless network communication.
  • the electronic device 100 can perform a Bluetooth connection with a Bluetooth device (such as an audio playback device such as a Bluetooth headset, a Bluetooth speaker, and a video playback device such as a projector or a television) through a Bluetooth module.
  • a Bluetooth headset is used as an example, as shown in FIG. 1
  • the Bluetooth headset includes a first Bluetooth headset 510 and a second Bluetooth headset 520, and the electronic device 100 establishes a communication link with the first Bluetooth headset 510 and the second Bluetooth headset 520 based on the aforementioned wireless communication protocol, respectively. .
  • FIG. 1 the Bluetooth headset includes a first Bluetooth headset 510 and a second Bluetooth headset 520, and the electronic device 100 establishes a communication link with the first Bluetooth headset 510 and the second Bluetooth headset 520 based on the aforementioned wireless communication protocol, respectively. .
  • the electronic device 100 may directly propose a communication link with the first Bluetooth headset 510 based on the foregoing wireless communication protocol, and then the first Bluetooth headset 510 and the second Bluetooth headset 520 may be based on the foregoing wireless communication.
  • the communication protocol suggests a communication link.
  • the wireless communication protocol may include a Wlan protocol, a Bluetooth protocol, or a ZigBee protocol.
  • the inventor has discovered through long-term research and proposed the method, device, electronic device and storage medium for unlocking the earphones provided in the embodiments of the present application.
  • the method, device, electronic device and storage medium for unlocking the earphones provided in the embodiments of the present application.
  • FIG. 3 is a schematic flowchart of a method for unlocking a headset provided by an embodiment of the present application.
  • the headset control method is used to detect the attitude data and contact parameters of the Bluetooth headset separately, and unlock the Bluetooth headset when both the attitude data and the contact parameters meet preset conditions, so as to realize automatic unlocking of the Bluetooth headset, simplify the unlocking process, and improve user experience.
  • the earphone unlocking method is applied to the earphone unlocking device 200 shown in FIG. 6 and the electronic device 100 (FIG. 7) configured with the earphone unlocking device 200.
  • an electronic device is taken as an example to describe the specific process of this embodiment.
  • the electronic device applied in this embodiment may be a smart phone, a tablet computer, a wearable electronic device, a vehicle-mounted device, a gateway, etc. This is not specifically limited.
  • the process shown in FIG. 3 will be described in detail below.
  • the earphone unlocking method may specifically include the following steps:
  • Step S110 When the Bluetooth headset is in a locked state, obtain first posture data of the Bluetooth headset.
  • the state of the Bluetooth headset may include at least a locked state, an unlocked state, a powered off state, a powered on state, a hibernated state, or a combination of several states, such as a locked and powered on state, a locked and powered off state, Unlocked and turned on, unlocked and turned off, etc. are not limited here.
  • a plurality of function keys or function buttons of the Bluetooth headset are inoperable to prevent the user from accidentally touching and preventing the Bluetooth headset from being used by others without the user's permission;
  • multiple function keys or function buttons of the Bluetooth headset can be operated to facilitate the user to adjust the functions of the Bluetooth headset, such as turning up the volume, turning down the volume, etc .;
  • the Bluetooth headset is on it means Bluetooth The headset can be used currently; when the Bluetooth headset is in the off state, it means that the Bluetooth headset cannot be used currently; when the Bluetooth headset is in the dormant state, it means that the Bluetooth headset is currently in a standby state.
  • the state of the Bluetooth headset can be detected.
  • the electronic device obtains the first posture data of the Bluetooth headset in response.
  • the Bluetooth headset may include a headset body and a posture detection module.
  • the posture detection module is disposed in the headset body. Therefore, the first posture data may be detected and acquired through the posture detection module disposed in the Bluetooth headset.
  • the attitude detection module may include an acceleration sensor and / or a gyroscope and other sensors that can perform attitude detection.
  • the Bluetooth headset is detected If the angular relationship with respect to the rotation axis and the angular relationship between the preset attitude and the rotation axis change, the attitude change of the Bluetooth headset can be determined, the current attitude of the Bluetooth headset can be determined, and the first attitude of the Bluetooth headset can be obtained and the first attitude corresponding to the first attitude can be obtained. -Attitude data.
  • Step S120 When the posture of the Bluetooth headset changes, detect the second posture data and contact parameters of the Bluetooth headset.
  • the posture of the Bluetooth headset is continuously detected to determine whether the posture of the Bluetooth headset has changed.
  • the posture of the Bluetooth headset can be detected by the posture detection module provided in the Bluetooth headset body.
  • the posture of the Bluetooth headset can be detected in real time, and the posture of the Bluetooth headset can be detected at preset intervals.
  • the attitude of the Bluetooth headset can also be detected according to the rules set by the user. For example, the attitude of the Bluetooth headset is detected according to the interval time manually configured by the user.
  • the posture of the Bluetooth headset can be detected in real time.
  • the electronic device detects the Bluetooth headset in response.
  • the second attitude data can be detected and acquired through an attitude detection module provided in the Bluetooth headset. Taking a gyroscope as an example, according to the gyroscope's axiality and the Bluetooth headset's relative to the gyroscope's rotation axis direction.
  • the Bluetooth headset may further include a contact sensor disposed on the headset body, wherein the contact sensor may be disposed on an outer surface of the headset body.
  • the contact sensor When the Bluetooth headset is placed on a user's ear, the contact sensor and A contact signal is generated by the user's ear contact.
  • the contact parameter can be detected by a contact sensor provided on the headset body. It can be understood that the contact parameter can be generated by contact between the contact sensor and the user's hand, and can be determined by the contact sensor and The user's ear contact is generated, and may be generated by the contact sensor and the user's face contact, etc., which is not limited herein.
  • the contact parameter may include at least a contact area and a contact point, that is, the contact parameter may be a contact area, a contact point, or both a contact area and a contact point.
  • the contact point is used to characterize a contact. The contact position of the sensor. Therefore, the contact area and / or contact point between the Bluetooth headset and the user can be detected by the touch sensor.
  • Step S130 determine whether the relationship between the first posture data and the second posture data satisfies a first preset condition, and determine whether the contact parameter satisfies a second preset condition.
  • the electronic device sets and stores a first preset condition in advance, and the first preset condition is used as a basis for judging the relationship between the first posture data and the second posture data. After the first pose data and the second pose data, further obtain the relationship between the first pose data and the second pose data, and compare the relationship between the first pose data and the second pose data with a first preset condition To determine whether the relationship between the first pose data and the second pose data meets a first preset condition.
  • the first preset condition may include a posture change when the Bluetooth headset is moved from being held to a user's ear, and the posture change may include an offset angle change, for example, the first posture data and the second posture
  • the relationship between the data may include an offset angle difference between the Bluetooth headset in the first posture and the second posture, and the offset angle difference may be compared with a first preset condition to determine the first posture data and Whether the relationship between the second posture data satisfies the first preset condition.
  • the electronic device sets and stores a second preset condition in advance, and the second preset condition is used as a basis for judging the contact parameter. Therefore, after obtaining the contact parameter, the contact parameter and the second preset condition are used. A comparison is performed to determine whether the contact parameter satisfies a second preset condition.
  • the second preset condition may include a contact area detected by the contact sensor when the Bluetooth headset is placed on the user's ear, or may include a contact detected by the contact sensor when the Bluetooth headset is placed on the user's ear. Position point, therefore, after obtaining the contact parameter, obtain the contact area and / or contact point in the contact parameter, and then compare the contact area and / or contact point with a second preset condition to determine the contact parameter Whether the second preset condition is satisfied.
  • Step S140 When the relationship between the first posture data and the second posture data satisfies the first preset condition, and the contact parameter satisfies the second preset condition, turn the Bluetooth headset Unlock.
  • the relationship between the first posture data and the second posture data satisfies the first preset condition, it at least indicates that the Bluetooth headset moves from the holding height to the height of the user's ear, or changes from the holding angle to being placed on the user's ear. It can be considered that the Bluetooth headset is currently placed on the user's ear; if the contact parameter meets the second preset condition, at least the detected contact parameter is consistent with the contact parameter when the Bluetooth headset is placed on the user's ear, That is, it can be considered that the Bluetooth headset is currently placed on the user's ear.
  • Unlocking the Bluetooth headset can realize the automatic unlocking of the Bluetooth headset, simplifying the unlocking process and improving the user experience.
  • first attitude data of the Bluetooth headset is acquired, and when the attitude of the Bluetooth headset changes, the second attitude data and contact parameters of the Bluetooth headset are detected.
  • the Bluetooth headset is unlocked, so that the posture data and contact parameters of the Bluetooth headset are detected separately, and when the posture data and the contact parameters both meet the preset conditions, The Bluetooth headset is unlocked to automatically unlock the Bluetooth headset, simplifying the unlocking process and improving the user experience.
  • FIG. 4 is a schematic flowchart of a method for unlocking a headset provided by another embodiment of the present application.
  • the earphone unlocking method is applied to the above-mentioned electronic device.
  • the first posture data includes a first offset angle
  • the second posture data includes a second offset angle.
  • the process shown in FIG. 4 will be described in detail below.
  • the earphone unlocking method may specifically include the following steps:
  • Step S210 When the Bluetooth headset is in the locked state, it is detected whether the Bluetooth headset is in a connected state with the electronic device.
  • the Bluetooth headset when it is determined that the Bluetooth headset is in a locked state, it is first detected whether the Bluetooth headset is in a connected state with an electronic device.
  • the connection state between the electronic device and the Bluetooth headset may include being in a connected state. And not in a connected state, where not in a connected state includes a non-connected state and a connected state.
  • the second state value is returned, so that it can be determined whether the electronic device is in a connected state with the Bluetooth headset by detecting the first state value and the second state value.
  • the Android system sends a broadcast when the Bluetooth headset is connected or disconnected. Therefore, the electronic device can monitor the broadcast to determine whether the electronic device is connected to the Bluetooth headset.
  • Step S220 When the Bluetooth headset is connected to the electronic device, obtain a first offset angle of the Bluetooth headset.
  • the first posture data may include at least a first offset angle, where the first offset angle may be an angle between an axis and a horizontal line of the Bluetooth headset in a holding state, and the first The offset angle may also be the angle between the axis of the Bluetooth headset in the holding state and the vertical line, and is not limited herein.
  • Step S230 When the attitude of the Bluetooth headset changes, detect a second offset angle and a contact parameter of the Bluetooth headset.
  • the second attitude data may include at least a second offset angle, where the second offset angle may be an angle between an axis of the Bluetooth headset and a horizontal line when the Bluetooth headset is placed on a user's ear, and the second offset
  • the shifting angle may also be the angle between the axis and the vertical line of the Bluetooth headset when it is placed on the user's ear. It can be understood that both the first offset angle and the second offset angle are offset angles of the Bluetooth headset compared to the same fixed reference object.
  • Step S240 Determine whether a difference between the first offset angle and the second offset angle is greater than a preset angle.
  • the electronic device presets and stores a preset angle, wherein the preset angle is used as a basis for judging a difference between the first offset angle and the second offset angle. After the difference between the offset angle and the second offset angle, the difference is compared with a preset angle to determine whether the difference is greater than the preset angle.
  • the preset angle may be 30 °, and when the difference between the first offset angle and the second offset angle exceeds the preset angle by 30 °, the characteristic of the Bluetooth headset is characterized.
  • the user picks up the Bluetooth headset and places it on the user's ear; when the difference between the first offset angle and the second offset angle does not exceed the preset angle of 30 °, the characterization amplitude is small If the user does not pick up and place the Bluetooth headset on the user's ear, the user continues to acquire the second offset angle and detect the posture data of the Bluetooth headset.
  • Step S250 When the difference between the first offset angle and the second offset angle is greater than the preset angle, it is determined that the relationship between the first posture data and the second posture data satisfies all requirements.
  • the first preset condition is described.
  • Step S260 Obtain a contact area based on the contact parameters.
  • the contact parameter may include at least a contact area and a contact point. Therefore, the contact area may be obtained from the contact parameter.
  • Step S270 Determine whether the contact area is consistent with a preset area, where the preset area is a contact area between the Bluetooth headset and the user's ear when the Bluetooth headset is placed on a user's ear.
  • the electronic device is preset with a contact area between the Bluetooth headset and the user's ear when the Bluetooth headset is placed on the user's ear, and the contact area is stored as a preset area.
  • the preset area is used for As the basis for judging the detected contact area, when obtaining the contact area between the Bluetooth headset and the user, the contact area is compared with a preset area to determine whether the contact area is consistent with the preset area.
  • the consistency of the contact area and the preset area is not limited to the fact that the contact area and the preset area are completely consistent. It may also include that the error between the contact area and the preset area is within a preset range, which is not limited herein.
  • Step S280 When the contact area is consistent with the preset area, determine that the contact parameter satisfies the second preset condition.
  • Step S290 when the relationship between the first posture data and the second posture data satisfies the first preset condition, and the contact parameter satisfies the second preset condition, the Bluetooth headset Unlock.
  • the earphone unlocking method detects whether the Bluetooth earphone is connected to an electronic device when the Bluetooth earphone is in a locked state.
  • the first attitude data of the Bluetooth headset is acquired.
  • the second attitude data and contact parameters of the Bluetooth headset are detected to determine the difference between the first offset angle and the second offset angle.
  • the contact area is obtained, and it is determined whether the contact area is consistent with the preset area.
  • the contact parameter satisfies a second preset condition.
  • the difference between the first offset angle and the second offset angle is used to determine whether the attitude change of the Bluetooth headset satisfies the first preset condition and the Bluetooth headset is determined by the contact area. Whether or not the contact parameters satisfy the second preset condition, thereby improving the accuracy of judgment.
  • FIG. 5 is a schematic flowchart of a method for unlocking a headset provided by another embodiment of the present application.
  • the method is applied to the above electronic device, wherein the Bluetooth headset includes a first Bluetooth headset and a second Bluetooth headset.
  • the process shown in FIG. 5 will be described in detail below.
  • the headset unlocking method may specifically include the following steps:
  • Step S310 When the Bluetooth headset is in a locked state, acquire first posture data of the Bluetooth headset.
  • Step S320 When the posture of the Bluetooth headset changes, detect the second posture data and contact parameters of the Bluetooth headset.
  • Step S330 Determine whether the relationship between the first posture data and the second posture data satisfies a first preset condition, and determine whether the contact parameter satisfies a second preset condition.
  • steps S310 to S330 please refer to steps S110 to S130, and details are not described herein again.
  • Step S340 when the first Bluetooth headset meets the first preset condition and the second preset condition, and the second Bluetooth headset does not satisfy the first preset condition and / or the second When the conditions are preset, it is detected whether the electronic device is connected to the first Bluetooth headset and the second Bluetooth headset, respectively.
  • the Bluetooth headset includes a first Bluetooth headset and a second Bluetooth headset.
  • the first Bluetooth headset and the second Bluetooth headset can be regarded as a pair of Bluetooth headsets, that is, the first Bluetooth headset and the second Bluetooth headset.
  • the headset may be used as a left headset and a right headset, for example, the first Bluetooth headset is used as a left headset and the second Bluetooth headset is used as a right headset, or the second Bluetooth headset is used as a left headset and the first Bluetooth headset is used as a right headset.
  • detecting the first Bluetooth headset and the second Bluetooth headset, and determining whether the first Bluetooth headset meets the first preset condition and the second preset condition, and determining whether the second Bluetooth headset meets the first preset condition Set a condition and a second preset condition, that is, detect the first posture data and the second posture data of the first Bluetooth headset, and determine whether the relationship between the first posture data and the second posture data of the first Bluetooth headset meets A first preset condition, and detecting a contact parameter of a first Bluetooth headset to determine whether the contact parameter of the first Bluetooth headset meets a second preset condition; and simultaneously detecting first posture data and a second posture of the second Bluetooth headset Data, to determine whether the relationship between the first posture data and the second posture data of the second Bluetooth headset satisfies the first preset condition, and to detect the contact parameters of the second Bluetooth headset, and determine whether the contact parameters of the second Bluetooth headset meet the first Two preset conditions.
  • the first Bluetooth headset satisfies the first preset condition and the second preset condition at the same time, it indicates that the first Bluetooth headset is placed in the user's ear, and it can be considered that the user desires to use the first Bluetooth headset.
  • the first Bluetooth headset does not meet the first preset condition and / or the second preset condition, it indicates that the first Bluetooth headset is not placed on the user's ear, and it can be considered that the user does not expect to use the first Bluetooth headset; similarly, when When the second Bluetooth headset satisfies both the first preset condition and the second preset condition, it indicates that the second Bluetooth headset is placed on the user's ear. It can be considered that the user desires to use the second Bluetooth headset.
  • the first preset condition and / or the second preset condition are satisfied, it indicates that the second Bluetooth headset is not placed on the user's ear, and it can be considered that the user does not expect to use the second Bluetooth headset.
  • the detection result indicates that the first Bluetooth headset meets both the first preset condition and the second preset condition, and the second Bluetooth headset does not satisfy the first preset condition and / or the second preset condition
  • the first Bluetooth headset is placed on the user's ear and the second Bluetooth headset is not placed on the user's ear.
  • detecting whether the electronic device is in a connected state with the first Bluetooth headset and detecting whether the electronic device is in a connected state with the second Bluetooth headset wherein the electronic device and the first can be detected by detecting the status value or monitoring the broadcast.
  • the connection status of the Bluetooth headset and the second Bluetooth headset is detected, and details are not described herein again.
  • Step S350 When the electronic device is connected to the first Bluetooth headset and the second Bluetooth headset at the same time, unlock the first Bluetooth headset and the second Bluetooth headset.
  • the electronic device When it is detected that the electronic device is connected to the first Bluetooth headset and the second Bluetooth headset at the same time, that is, the electronic device is performing data interaction with the first Bluetooth headset or is to perform data interaction, and is in communication with the second Bluetooth headset.
  • the headset When the headset is performing data interaction or data interaction is to be performed, it can be considered that the user desires to use the first Bluetooth headset and the second Bluetooth headset. Therefore, the first Bluetooth ear is unlocked and the second Bluetooth headset is unlocked.
  • Step S360 when the electronic device is in a connected state with the first Bluetooth headset and in a non-connected state with the second Bluetooth headset, unlock the first Bluetooth headset and keep the second Bluetooth headset at all The locked state is described.
  • the electronic device when it is detected that the electronic device is in a connected state with the first Bluetooth headset and is in a non-connected state with the second Bluetooth headset, that is, the electronic device is performing data interaction with the first Bluetooth headset or is about to perform data interaction, and There is no data interaction with the second Bluetooth headset. Therefore, it can be considered that the user is using the first Bluetooth headset and the second Bluetooth headset is not used.
  • the first Bluetooth headset is placed on the user's headset and the second Bluetooth headset is not placed on the user's ear. Therefore, the first Bluetooth headset can be unlocked for user operation, and the second Bluetooth headset can be kept in a locked state.
  • Step S370 When the electronic device is in a connected state with the second Bluetooth headset and is in a non-connected state with the first Bluetooth headset, the electronic device initiates a connection request to the first Bluetooth headset.
  • the electronic device When it is detected that the electronic device is in a connected state with the second Bluetooth headset and is in a non-connected state with the first Bluetooth headset, that is, the electronic device and the second Bluetooth headset are performing data interaction or to perform data interaction, and There is no data interaction with the first Bluetooth headset.
  • the first Bluetooth headset is placed in the user's ear and the second Bluetooth headset is not placed in the user's ear. This indicates that the user expects to use the first Bluetooth headset to receive audio data.
  • the electronic device sends a connection request to the first Bluetooth headset to try to establish a connection with the first Bluetooth headset.
  • the electronic device sends a Bluetooth low energy link connection request to the first Bluetooth headset.
  • the electronic device queries the application protocol and UUID supported by the first Bluetooth headset through the SDP service query protocol, Understandably, different Bluetooth headsets support different application protocols. Some Bluetooth headsets only support traditional Bluetooth protocols, some Bluetooth headsets only support Bluetooth low energy protocols, and some Bluetooth headsets support both Bluetooth low energy protocols and traditional Bluetooth. Therefore, the electronic device needs to determine an application protocol supported by the first Bluetooth headset. When the first Bluetooth headset supports the Bluetooth low energy protocol, or when the first Bluetooth headset supports both the traditional Bluetooth protocol and the Bluetooth low energy protocol, it is determined that the first Bluetooth headset supports the Bluetooth low energy protocol, and the electronic The device sends a Bluetooth low-power link connection request to the first Bluetooth headset. When the first Bluetooth headset only supports a conventional Bluetooth protocol, the electronic device sends a traditional Bluetooth connection request to the first Bluetooth headset.
  • Step S380 When the electronic device successfully establishes a connection with the first Bluetooth headset, unlock the first Bluetooth headset and keep the second Bluetooth headset in the locked state.
  • the electronic device when the electronic device successfully establishes a connection with the first Bluetooth headset, it means that the electronic device can transmit audio data to the first Bluetooth headset, and because the first Bluetooth headset is placed in the user's ear and the first The two Bluetooth headsets are not placed on the user's ears. Therefore, the first Bluetooth headset can be unlocked for user operation while keeping the second Bluetooth headset in a locked state.
  • Step S390 When the electronic device fails to establish a connection with the first Bluetooth headset, unlock the second Bluetooth headset and keep the first Bluetooth headset in the locked state.
  • the electronic device when the electronic device fails to establish a connection with the first Bluetooth headset, it indicates that the electronic device cannot transmit audio data to the first Bluetooth headset. Therefore, although the first Bluetooth headset is placed in the user's ear and the second Bluetooth The headset is not placed on the user's ear. However, in order to ensure the user's listening experience and operability, the second Bluetooth headset is unlocked for user operation, and the first Bluetooth headset is kept in a locked state.
  • the earphone unlocking method provided by another embodiment of the present application also satisfies the first preset condition and the second preset condition in the first Bluetooth headset, and the second Bluetooth headset does not meet
  • the first preset condition and / or the second preset condition it is detected whether the electronic device is connected to the first Bluetooth headset and the second Bluetooth headset, respectively.
  • the electronic device is connected to the first Bluetooth headset and the second Bluetooth headset at the same time, In the state, the first Bluetooth headset and the second Bluetooth headset are unlocked.
  • the first Bluetooth headset is unlocked and maintained with the second Bluetooth The headset is in a locked state.
  • the electronic device When the electronic device is connected to the second Bluetooth headset and is not connected to the first Bluetooth headset, the electronic device initiates a connection request to the first Bluetooth headset.
  • the connection When the connection is successful, the first Bluetooth headset is connected. Unlock and keep the second Bluetooth headset in a locked state.
  • the connection fails, unlock the second Bluetooth headset and keep the first Bluetooth headset Locked state.
  • the first Bluetooth headset and the second Bluetooth The connection status of the headset controls unlocking of the first Bluetooth headset or the second Bluetooth headset, thereby further improving the accuracy of unlocking the headset.
  • FIG. 6 illustrates a block diagram of a headset unlocking device 200 provided by an embodiment of the present application.
  • the headset unlocking device 200 is applied to the above-mentioned electronic device.
  • the headset unlocking device 200 includes: an obtaining module 210, a detecting module 220, a determining module 230, and an unlocking module 240, of which:
  • the obtaining module 210 is configured to obtain first posture data of the Bluetooth headset when the Bluetooth headset is in a locked state. Further, the obtaining module 210 includes:
  • a detection sub-module is configured to detect whether the Bluetooth headset is in a connected state with the electronic device when the Bluetooth headset is in the locked state.
  • An acquisition sub-module is configured to acquire first posture data of the Bluetooth headset when the Bluetooth headset is in a connected state with the electronic device.
  • a detection module 220 is configured to detect second posture data and contact parameters of the Bluetooth headset when the posture of the Bluetooth headset changes.
  • the determining module 230 is configured to determine whether a relationship between the first posture data and the second posture data meets a first preset condition, and determine whether the contact parameter satisfies a second preset condition. Further, the first posture data includes a first offset angle, the second posture data includes a second offset angle, and the determination module 230 includes a difference determination sub-module, a first determination sub-module, and a contact area. Obtaining a sub-module, a contact area judgment sub-module, and a second determination sub-module, wherein:
  • the difference judgment sub-module is configured to determine whether a difference between the first offset angle and the second offset angle is greater than a preset angle.
  • a first determining submodule configured to determine the first posture data and the second posture when a difference between the first offset angle and the second offset angle is greater than the preset angle The relationship of the data satisfies the first preset condition.
  • the contact area acquisition submodule is configured to acquire a contact area based on the contact parameters.
  • a contact area determination sub-module is used to determine whether the contact area is consistent with a preset area, where the preset area is the distance between the Bluetooth headset and the user's ear when the Bluetooth headset is placed on a user's ear Contact area.
  • a second determining submodule is configured to determine that the contact parameter satisfies the second preset condition when the contact area is consistent with the preset area.
  • An unlocking module 240 is configured to unlock all data when a relationship between the first posture data and the second posture data satisfies the first preset condition and the contact parameter satisfies the second preset condition.
  • the Bluetooth headset includes a first Bluetooth headset and a second Bluetooth headset, and the unlocking module 240 includes a connection state detection submodule, a first unlocking submodule, a second unlocking submodule, a connection request sending submodule, a first Three unlocked sub-modules and fourth unlocked sub-module, of which:
  • a connection state detection submodule configured to: when the first Bluetooth headset meets the first preset condition and the second preset condition, and the second Bluetooth headset does not meet the first preset condition and / Or when the second preset condition is detected, whether the electronic device is in a connected state with the first Bluetooth headset and the second Bluetooth headset, respectively.
  • a first unlocking sub-module is configured to unlock the first Bluetooth headset and the second Bluetooth headset when the electronic device is in a connected state with the first Bluetooth headset and the second Bluetooth headset at the same time.
  • a connection request sending submodule configured to initiate a connection to the first Bluetooth headset when the electronic device is in a connected state with the second Bluetooth headset and in a non-connected state with the first Bluetooth headset request.
  • a third unlocking submodule is configured to unlock the first Bluetooth headset and keep the second Bluetooth headset in the locked state when the electronic device successfully establishes a connection with the first Bluetooth headset.
  • a fourth unlocking submodule is configured to unlock the second Bluetooth headset and keep the first Bluetooth headset in the locked state when the electronic device fails to establish a connection with the first Bluetooth headset.
  • the headset unlocking device includes an acquisition module, a detection module, a judgment module, and an unlocking module, wherein the acquisition module is configured to acquire the first posture data of the Bluetooth headset when the Bluetooth headset is in a locked state, and the detection module When the posture of the Bluetooth headset changes, the second posture data and the contact parameters of the Bluetooth headset are detected, and the judgment module is configured to determine whether the relationship between the first posture data and the second posture data is Satisfying the first preset condition, and determining whether the contact parameter satisfies the second preset condition, the unlocking module is configured to: when the relationship between the first posture data and the second posture data satisfies the first preset condition Condition, and the contact parameter satisfies the second preset condition, unlock the Bluetooth headset, thereby detecting the posture data and contact parameters of the Bluetooth headset separately, and when the posture data and contact parameters meet the preset conditions, The Bluetooth headset is unlocked to automatically unlock the Bluetooth headset, simplifying the unlocking process and improving the user experience.
  • the coupling between the modules may be electrical, mechanical, or other forms of coupling.
  • each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist separately physically, or two or more modules may be integrated into one module.
  • the above integrated modules may be implemented in the form of hardware or software functional modules.
  • FIG. 7 is a structural block diagram of an electronic device 100 according to an embodiment of the present application.
  • the electronic device 100 may be an electronic device capable of running an application program, such as a smart phone, a tablet computer, or an e-book.
  • the electronic device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, a Bluetooth module 130, and one or more application programs, where one or more application programs may be stored in the memory 120 and stored by It is configured to be executed by one or more processors 110, and one or more programs are configured to execute the method as described in the foregoing method embodiment.
  • the processor 110 may include one or more processing cores.
  • the processor 110 uses various interfaces and lines to connect various parts in the entire electronic device 100, and executes or executes instructions, programs, code sets, or instruction sets stored in the memory 120 by calling or executing data stored in the memory 120 to execute Various functions and processing data of the electronic device 100.
  • the processor 110 may use at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). To implement a hardware form.
  • the processor 110 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), an image processor (Graphics Processing Unit, GPU), and a modem.
  • CPU Central Processing Unit
  • GPU Graphics Processing Unit
  • modem modem
  • the CPU mainly handles the operating system, user interface, and application programs; the GPU is responsible for rendering and rendering of the displayed content; the modem is used for wireless communication. It can be understood that the modem may not be integrated into the processor 110, and may be implemented by a single communication chip.
  • the memory 120 may include Random Access Memory (RAM), and may also include Read-Only Memory.
  • the memory 120 may be used to store instructions, programs, codes, code sets, or instruction sets.
  • the memory 120 may include a storage program area and a storage data area, where the storage program area may store instructions for implementing an operating system and instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , Instructions for implementing the following method embodiments, and the like.
  • the storage data area may also store data (such as phone book, audio and video data, chat record data) and the like created by the electronic device 100 during use.
  • the Bluetooth module 130 is used to realize the Bluetooth connection between the electronic device and the two Bluetooth headsets, as well as the data interaction with the two Bluetooth headsets.
  • the number of the Bluetooth modules 130 may be one or may be integrated together. It is not limited here. Specifically, it can communicate with Bluetooth devices through the Bluetooth protocol 5.0 / 4.2 / 4.1 / 2.1 / 2.0, or through Bluetooth Low Energy (BLE), Enhanced Data Rate (EDR), or Bluetooth basic rate. (Base, Rate, BR) and so on.
  • BLE Bluetooth Low Energy
  • EDR Enhanced Data Rate
  • BR Bluetooth basic rate.
  • Its basic circuit structure is similar to the WiFi module, and it can also be composed of a power amplifier, a wireless transceiver, a transceiver switch, a low-noise amplifier, and an antenna.
  • the Bluetooth module 130 may use a first communication frequency band, wherein the first communication frequency band may be 2.4 GHz.
  • FIG. 8 shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application.
  • the computer-readable medium 300 stores program code, which can be called by a processor to execute the method described in the foregoing method embodiment.
  • the computer-readable storage medium 300 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.
  • the computer-readable storage medium 300 includes a non-transitory computer-readable storage medium.
  • the computer-readable storage medium 300 has a storage space of a program code 310 that executes any of the method steps in the above method. These program codes can be read from or written into one or more computer program products.
  • the program code 310 may be compressed, for example, in a suitable form.
  • the earphone unlocking method, device, electronic device and storage medium obtained the first attitude data of the Bluetooth headset when the Bluetooth headset is in a locked state, and when the attitude of the Bluetooth headset changes , Detecting the second posture data and the contact parameter of the Bluetooth headset, judging whether the relationship between the first posture data and the second posture data satisfies the first preset condition, and judging whether the contact parameter satisfies the second preset condition, when the first When the relationship between a gesture data and a second gesture data satisfies a first preset condition and the contact parameter satisfies the second preset condition, the Bluetooth headset is unlocked, thereby detecting the posture data and the contact parameters of the Bluetooth headset respectively, and When the attitude data and contact parameters meet the preset conditions, the Bluetooth headset is unlocked to automatically unlock the Bluetooth headset, simplifying the unlocking process, and improving the user experience.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Acoustics & Sound (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)

Abstract

本申请公开了一种耳机解锁方法、装置、电子设备以及存储介质,涉及电子设备技术领域。该方法应用于电子设备,所述方法包括:当蓝牙耳机处于加锁状态时,获取该蓝牙耳机的第一姿态数据,当蓝牙耳机的姿态发生变化时,检测蓝牙耳机的第二姿态数据和接触参数,判断该第一姿态数据和第二姿态数据之间的关系是否满足第一预设条件,以及判断接触参数是否满足第二预设条件,当第一姿态数据和第二姿态数据之间的关系满足第一预设条件,且接触参数满足第二预设条件时,将蓝牙耳机解锁。本申请通过分别检测蓝牙耳机的姿态数据和接触参数,并在姿态数据和接触参数均满足预设条件时将蓝牙耳机解锁,以实现蓝牙耳机的自动解锁,简化解锁过程,提升用户体验。

Description

耳机解锁方法、装置、电子设备以及存储介质
相关申请的交叉引用
本申请要求于2018年9月30日提交的申请号为201811161415.1的中国申请的优先权,其在此出于所有目的通过引用将其全部内容并入本文。
技术领域
本申请涉及电子设备技术领域,更具体地,涉及一种耳机解锁方法、装置、电子设备以及存储介质。
背景技术
随着科学技术的发展,电子设备已经成为人们日常生活中最常用的电子产品之一。并且,用户经常会通过与电子设备建立连接的耳机听音乐、看视频或玩游戏等。
发明内容
鉴于上述问题,本申请提出了一种耳机控制方法、装置、电子设备以及存储介质,以解决上述问题。
第一方面,本申请实施例提供了一种耳机解锁方法,应用于电子设备,所述方法包括:当蓝牙耳机处于加锁状态时,获取所述蓝牙耳机的第一姿态数据;当所述蓝牙耳机的姿态发生变化时,检测所述蓝牙耳机的第二姿态数据和接触参数;判断所述第一姿态数据和所述第二姿态数据之间的关系是否满足第一预设条件,以及判断所述接触参数是否满足第二预设条件;当所述第一姿态数据和所述第二姿态数据之间的关系满足所述第一预设条件,且所述接触参数满足所述第二预设条件时,将所述蓝牙耳机解锁。
第二方面,本申请实施例提供了一种耳机解锁装置,应用于电子设备,所述装置包括:获取模块,用于当蓝牙耳机处于加锁状态时,获取所述蓝牙耳机的第一姿态数据;检测模块,用于当所述蓝牙耳机的姿态发生变化时,检测所述蓝牙耳机的第二姿态数据和接触参数;判断模块,用于判断所述第一姿态数据和所述第二姿态数据之间的关系是否满足第一预设条件,以及判断所述接触参数是否满足第二预设条件;解锁模块,用于当所述第一姿态数据和所述第二姿态数据之间的关系满足所述第一预设条件,且所述接触参数满足所述第二预设条件时,解锁所述蓝牙耳机。
第三方面,本申请实施例提供了一种电子设备,包括蓝牙模块;存储器;一个或多个处理器,分别与所述蓝牙模块和所述存储器耦接;一个或多个程序,其中,所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于执行上述方法。
第四方面,本申请实施例提供了一种计算机可读取存储介质,所述计算机可读取存储介质中存储有程序代码,所述程序代码可被处理器调用执行上述方法。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1示出了本申请实施例提供的一种应用环境的示意图;
图2示出了本申请实施例提供的另一种应用环境的示意图;
图3示出了本申请一个实施例提供的耳机解锁方法的流程示意图;
图4示出了本申请又一个实施例提供的耳机解锁方法的流程示意图;
图5示出了本申请再一个实施例提供的耳机解锁方法的流程示意图;
图6示出了本申请实施例提供的耳机解锁装置的模块框图;
图7示出了本申请实施例用于执行根据本申请实施例的耳机解锁方法的电子设备的 框图;
图8示出了本申请实施例的用于保存或者携带实现根据本申请实施例的耳机解锁方法的程序代码的存储单元。
具体实施方式
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。
随着用户对电子设备的要求越来越高,因此,电子设备为了满足用户的需求以及为用户提供方便,开始支持播放音频数据,例如,播放音频、播放视频、语音聊天、视频聊天等。其中,电子设备的音频架构和计算机的音频架构类似,主要是由处理器和内置音频CODEC(编解码器)来完成。具体地,处理器接收音频数据的输入后,转化成I2S信号,并传输至CODEC转换成模拟信号,然后进行播放。
进一步地,电子设备可以与外接音频播放设备连接,通过所述音频播放设备播放音频数据,具体地,该音频播放设备可以接收电子设备传输过来的音频数据,并将音频数据进行播放,其中,该音频播放设备可以包括耳机、音箱以及车载设备等。而在诸多情况下,电子设备与外接的音频播放设备需要使用网络才能进行数据传输,例如,电子设备与音频播放设备需要使用无线保真(Wireless Fidelity,WiFi)连接进行数据传输,或电子设备与音频播放设备需要使用蓝牙(Bluetooth,BT)连接进行数据传输等,可选的,在通常情况下,电子设备可以通过蓝牙与音频播放设备连接,并通过蓝牙将音频数据传输至音频播放设备进行播放。
具体地,目前的电子设备100一般都有蓝牙(Bluetooth,BT)模块,其中,蓝牙模块可以是指集成蓝牙功能的芯片基本电路集合,用于无线网络通讯。进一步地,电子设备100可以通过蓝牙模块与蓝牙设备(如蓝牙耳机、蓝牙音箱等音频播放设备,投影仪、电视机等视频播放设备)进行蓝牙连接,其中,以蓝牙耳机为例,如图1所述,在一种情况下,蓝牙耳机包括第一蓝牙耳机510以及第二蓝牙耳机520,电子设备100分别与第一蓝牙耳机510和第二蓝牙耳机520基于前述的无线通信协议建立通信链路。再者,还可以如图2所示,电子设备100可以直接与第一蓝牙耳机510基于前述的无线通信协议建议通信链路,然后第一蓝牙耳机510再和第二蓝牙耳机520基于前述的无线通信协议建议通信链路。其中,无线通信协议可以包括Wlan协议、蓝牙协议或者ZigBee协议等。
但是,目前的蓝牙耳机,在加锁状态下解锁使用时,需要用户手动进行解锁,解锁过程中繁琐,用户体验不佳。针对上述问题,发明人经过长期的研究发现,并提出了本申请实施例提供的耳机解锁方法、装置、电子设备以及存储介质,通过分别检测蓝牙耳机的姿态数据和接触参数,并在姿态数据和接触参数均满足预设条件时将蓝牙耳机解锁,以实现蓝牙耳机的自动解锁,简化解锁过程,提升用户体验。其中,具体的耳机解锁方法在后续的实施例中进行详细的说明。
实施例
请参阅图3,图3示出了本申请一个实施例提供的耳机解锁方法的流程示意图。所述耳机控制方法用于通过分别检测蓝牙耳机的姿态数据和接触参数,并在姿态数据和接触参数均满足预设条件时将蓝牙耳机解锁,以实现蓝牙耳机的自动解锁,简化解锁过程,提升用户体验。在具体的实施例中,所述耳机解锁方法应用于如图6所示的耳机解锁装置200以及配置有所述耳机解锁装置200的电子设备100(图7)。下面将以电子设备为例,说明本实施例的具体流程,当然,可以理解的,本实施例所应用的电子设备可以为智能手机、平板电脑、穿戴式电子设备、车载设备、网关等,在此不做具体的限定。下面将针对图3所示的流程进行详细的阐述,所述耳机解锁方法具体可以包括以下步骤:
步骤S110:当蓝牙耳机处于加锁状态时,获取所述蓝牙耳机的第一姿态数据。
在本实施例中,蓝牙耳机的状态至少可以包括加锁状态、解锁状态、关机状态、开机状 态、休眠状态或者其中几种状态的组合,例如,加锁且开机状态、加锁且关机状态、解锁且开机状态、解锁且关机状态等,在此不做限定。具体地,当该蓝牙耳机处于加锁状态时,表示蓝牙耳机的多个功能按键或功能按钮不可操作,以防止用户误触以及防止蓝牙耳机未经用户允许被他人使用;当该蓝牙耳机处于解锁状态时,表示蓝牙耳机的多个功能按键或功能按钮可操作,以方便用户对蓝牙耳机的功能进行调节,例如,调高音量、调低音量等;当该蓝牙耳机处于开机状态时,表示蓝牙耳机当前可以被使用;当该蓝牙耳机处于关机状态时,表示蓝牙耳机当前不可被使用;当该蓝牙耳机处于休眠状态时,表示蓝牙耳机当前处于待工作状态。
作为一种方式,可以对蓝牙耳机的状态进行检测,当检测到该蓝牙耳机处于加锁状态时,电子设备作为响应获取该蓝牙耳机的第一姿态数据。具体地,该蓝牙耳机可以包括耳机本体和姿态检测模块,该姿态检测模块设置于该耳机本体内,因此,可以通过设置于该蓝牙耳机内的姿态检测模块进行第一姿态数据的检测获取。其中,该姿态检测模块可以包括加速度传感器和/或陀螺仪等可以进行姿态检测的传感器,以陀螺仪为例,根据所述陀螺仪的定轴性以及蓝牙耳机相对于陀螺仪转轴方向的已知的预设姿态,当蓝牙耳机的姿态与预设姿态之间出现差别,产生俯仰、偏航或横滚的某一方向的运动时,因为该陀螺仪的转轴保持方向不变,检测到蓝牙耳机相对于转轴的角度关系与预设姿态相对于转轴的角度关系发生变化,则可以确定蓝牙耳机的姿态变化,确定蓝牙耳机当前姿态,作为蓝牙耳机的第一姿态并获取该第一姿态对应的第一姿态数据。
步骤S120:当所述蓝牙耳机的姿态发生变化时,检测所述蓝牙耳机的第二姿态数据和接触参数。
进一步地,在获取蓝牙耳机的第一姿态数据后,继续对蓝牙耳机的姿态进行检测,以判断该蓝牙耳机的姿态是否发生变化。同样的,可以通过设置于蓝牙耳机本体内的姿态检测模块对蓝牙耳机的姿态进行检测,作为一种方式,可以实时对蓝牙耳机的姿态进行检测,可以间隔预设时长对蓝牙耳机的姿态进行检测,也可以根据用户设定的规则对蓝牙耳机的姿态进行检测,例如,根据用户手动配置的间隔时长等对蓝牙耳机的姿态进行检测,可选的,为了保证蓝牙耳机的快速反应,在本实施例中,可以实时对蓝牙耳机的姿态进行检测。
其中,当检测的结果表征该蓝牙耳机的姿态发生变化时,也就是说,当检测的结果表征该蓝牙耳机的姿态与第一姿态数据对应的姿态不同时,则电子设备作为响应检测该蓝牙耳机的第二姿态数据和接触参数。具体地,该第二姿态数据可以通过设置于该蓝牙耳机内的姿态检测模块进行检测获取,以陀螺仪为例,根据所述陀螺仪的定轴性以及蓝牙耳机相对于陀螺仪转轴方向的已知的预设姿态,当蓝牙耳机的姿态与预设姿态之间出现差别,产生俯仰、偏航或横滚的某一方向的运动时,因为该陀螺仪的转轴保持方向不变,检测到蓝牙耳机相对于转轴的角度关系与预设姿态相对于转轴的角度关系发生变化,则可以确定蓝牙耳机的姿态变化,确定蓝牙耳机当前姿态,作为蓝牙耳机的第二姿态并获取该第二姿态对应的第二姿态数据。
另外,该蓝牙耳机还可以包括接触传感器,该接触传感器设置于该耳机本体上,其中,所述接触传感器可以设置于耳机本体的外表面,当蓝牙耳机安放于用户耳部时,该接触传感器与用户耳部接触产生接触信号。具体地,当蓝牙耳机的姿态发生变化时,可以通过设置于耳机本体上的接触传感器检测接触参数,可以理解的,该接触参数可以由接触传感器和用户的手部接触产生、可以由接触传感器和用户耳部接触产生、可以由接触传感器和用户脸部接触产生等,在此不做限定。
其中,该接触参数至少可以包括接触面积和接触点,也就是说,该接触参数可以为接触面积、可以为接触点、也可以同时包括接触面积和接触点,其中,该接触点用于表征接触传感器的接触位置。因此,可以通过接触传感器检测蓝牙耳机与用户之间的接触面积和/或接触点。
步骤S130:判断所述第一姿态数据和所述第二姿态数据之间的关系是否满足第一预设 条件,以及判断所述接触参数是否满足第二预设条件。
在本实施例中,电子设备预先设置并存储有第一预设条件,该第一预设条件用于作为第一姿态数据和第二姿态数据之间的关系的判断依据,因此,在获取该第一姿态数据和第二姿态数据后,进一步获取该第一姿态数据和第二姿态数据之间的关系,将第一姿态数据和第二姿态数据之间的关系与第一预设条件进行比较,以判断该第一姿态数据和第二姿态数据之间的关系是否满足第一预设条件。作为一种方式,该第一预设条件可以包括当蓝牙耳机从被握持移动到用户耳部时的姿态变化,该姿态变化可以包括偏移角度变化,例如,第一姿态数据和第二姿态数据之间的关系可以包括蓝牙耳机在第一姿态和第二姿态下的偏移角度差值,可以将该偏移角度差值与第一预设条件进行比较,以判断该第一姿态数据和第二姿态数据之间的关系是否满足第一预设条件。
进一步地,电子设备预先设置并存储有第二预设条件,该第二预设条件用于作为接触参数的判断依据,因此,在获取该接触参数后,将该接触参数与第二预设条件进行比较,以判断该接触参数是否满足第二预设条件。作为一种方式,该第二预设条件可以包括当蓝牙耳机安放于用户耳部时,接触传感器检测到的接触面积,也可以包括当蓝牙耳机安放于用户耳部时,接触传感器检测到的接触位置点,因此,在获取该接触参数后,获取该接触参数中的接触面积和/或接触点,再将该接触面积和/或接触点与第二预设条件进行比较,以判断该接触参数是否满足第二预设条件。
步骤S140:当所述第一姿态数据和所述第二姿态数据之间的关系满足所述第一预设条件,且所述接触参数满足所述第二预设条件时,将所述蓝牙耳机解锁。
其中,若第一姿态数据和第二姿态数据之间的关系满足第一预设条件,至少表征该蓝牙耳机从握持高度移动到用户耳部高度,或从握持角度变化到安放于用户耳部时的角度,即可以认为该蓝牙耳机当前安放于用户耳部;若接触参数满足第二预设条件,至少表征该检测到的接触参数与蓝牙耳机安放于用户耳部时的接触参数一致,即可以认为该蓝牙耳机当前安放于用户耳部。可以理解的,通过姿态数据和接触参数两个不同的方面,均表征该蓝牙耳机安放于用户耳部时,可以确定该蓝牙耳机当前安放于用户耳部,即该用户期望使用该蓝牙耳机,因此,将蓝牙耳机解锁,可以实现蓝牙耳机的自动解锁,简化解锁过程,提升用户体验。
本申请一个实施例提供的耳机解锁方法,当蓝牙耳机处于加锁状态时,获取该蓝牙耳机的第一姿态数据,当蓝牙耳机的姿态发生变化时,检测蓝牙耳机的第二姿态数据和接触参数,判断该第一姿态数据和第二姿态数据之间的关系是否满足第一预设条件,以及判断接触参数是否满足第二预设条件,当第一姿态数据和第二姿态数据之间的关系满足第一预设条件,且接触参数满足第二预设条件时,将蓝牙耳机解锁,从而通过分别检测蓝牙耳机的姿态数据和接触参数,并在姿态数据和接触参数均满足预设条件时将蓝牙耳机解锁,以实现蓝牙耳机的自动解锁,简化解锁过程,提升用户体验。
请参阅图4,图4示出了本申请又一个实施例提供的耳机解锁方法的流程示意图。所述耳机解锁方法应用于上述电子设备,在本实施例中,该第一姿态数据包括第一偏移角度,第二姿态数据包括第二偏移角度。下面将针对图4所示的流程进行详细的阐述,所述耳机解锁方法具体可以包括以下步骤:
步骤S210:当所述蓝牙耳机处于所述加锁状态时,检测所述蓝牙耳机是否与所述电子设备处于连接状态。
在本实施例中,在确定蓝牙耳机处于加锁状态时,首先对该蓝牙耳机是否与电子设备处于连接状态进行检测,可以理解的,电子设备与蓝牙耳机之间的连接状态可以包括处于连接状态和没有处于连接状态,其中,没有处于连接状态包括非连接状态和连接中状态。作为一种方式,可以通过查看电子设备的状态值的方式来判断电子设备和蓝牙耳机之间是否处于连接状态,具体地,当电子设备连接蓝牙耳机时,返回第一状态值,当电子设备断开蓝牙耳机的连接时,返回第二状态值,从而可以通过检测第一状态值和第二状态值的方式确定电子设备是否与蓝牙耳机处于连接状态。作为另一种方式,Android系 统在连接蓝牙耳机或断开蓝牙耳机的时候都会发送广播,所以,电子设备可以通过监听广播的方式,确定电子设备是否与蓝牙耳机处于连接状态。
步骤S220:当所述蓝牙耳机与所述电子设备处于连接状态时,获取所述蓝牙耳机的第一偏移角度。
作为一种可实施方式,该第一姿态数据至少可以包括第一偏移角度,其中,该第一偏移角度可以为蓝牙耳机在握持状态时的轴线与水平线之间的夹角,该第一偏移角度也可以为蓝牙耳机在握持状态时的轴线与竖直线之间的夹角等,在此不做限定。
步骤S230:当所述蓝牙耳机的姿态发生变化时,检测所述蓝牙耳机的第二偏移角度和接触参数。
同样的,该第二姿态数据至少可以包括第二偏移角度,其中,该第二偏移角度可以为蓝牙耳机在安放于用户耳部时的轴线与水平线之间的夹角,该第二偏移角度也可以为蓝牙耳机在安放于用户耳部时的轴线与竖直线之间的角度等。可以理解的,第一偏移角度和第二偏移角度均为蓝牙耳机相较于同一固定参照物的偏移角度。
步骤S240:判断所述第一偏移角度和所述第二偏移角度之间的差值是否大于预设角度。
进一步地,所述电子设备预先设置并存储有预设角度,其中,该预设角度用于作为该第一偏移角度和第二偏移角度的差值的判断依据,因此,在获取第一偏移角度和第二偏移角度之间的差值后,将该差值与预设角度进行比较,以判断该差值是否大于该预设角度。可选的,在本实施例中,该预设角度可以为30°,当第一偏移角度和第二偏移角度之间的差值超过该预设角度30°时,则表征蓝牙耳机的角度有变化,可认为是用户拿起蓝牙耳机安放于用户耳部;当第一偏移角度和第二偏移角度之间的差值没超过该预设角度30°时,则表征幅度较小,用户没有将蓝牙耳机拿起安放于用户耳部,则继续对所述第二偏移角度进行获取以及对蓝牙耳机的姿态数据进行检测。
步骤S250:当所述第一偏移角度和所述第二偏移角度之间的差值大于所述预设角度时,确定所述第一姿态数据和所述第二姿态数据的关系满足所述第一预设条件。
步骤S260:基于所述接触参数获取接触面积。
其中,该接触参数至少可以包括接触面积和接触点,因此,可以从接触参数中获取该接触面积。
步骤S270:判断所述接触面积是否与预设面积一致,其中,所述预设面积为所述蓝牙耳机安放于用户耳部时,所述蓝牙耳机与所述用户耳部之间的接触面积。
在本实施例中,电子设备预先设置有蓝牙耳机安放于用户耳部时,与用户耳部之间的接触面积,将该接触面积存储作为预设面积,可以理解的,该预设面积用于作为检测到的接触面积的判断依据,因此,在获取蓝牙耳机与用户之间的接触面积时,将该接触面积与预设面积进行比较,以判断该接触面积是否与预设面积一致,其中,接触面积和预设面积一致并不仅限于接触面积和预设面积完全一致,还可以包括该接触面积和预设面积的误差在预设范围内,在此不做限定。
步骤S280:当所述接触面积与所述预设面积一致时,确定所述接触参数满足所述第二预设条件。
步骤S290:当所述第一姿态数据和所述第二姿态数据之间的关系满足所述第一预设条件,且所述接触参数满足所述第二预设条件时,将所述蓝牙耳机解锁。
本申请又一个实施例提供的耳机解锁方法,相较于图3所示的耳机解锁方法,还在蓝牙耳机处于加锁状态时,检测蓝牙耳机是否与电子设备处于连接状态,当蓝牙耳机与电子设备处于连接状态时,获取蓝牙耳机的第一姿态数据,当蓝牙耳机的姿态发生变化时,检测蓝牙耳机的第二姿态数据和接触参数,判断第一偏移角度和第二偏移角度之间的差值是否大于预设角度,当第一偏移角度和第二偏移角度之间的差值大于预设角度时,确定第一姿态数据和第二姿态数据的关系满足第一预设条件,基于接触参数获取接触面 积,判断接触面积是否与预设面积一致,当接触面积与预设面积一致时,确定接触参数满足第二预设条件,当第一姿态数据和第二姿态数据之间的关系满足第一预设条件且接触参数满足第二预设条件时,将蓝牙耳机解锁。相较于图3所述的耳机解锁方法,本实施例通过第一偏移角度和第二偏移角度的差值判断蓝牙耳机的姿态变化是否满足第一预设条件以及通过接触面积判断蓝牙耳机的接触参数是否满足第二预设条件,从而提高判断的准确性。
请参阅图5,图5示出了本申请再一个实施例提供的耳机解锁方法的流程示意图。该方法应用于上述电子设备,其中,蓝牙耳机包括第一蓝牙耳机和第二蓝牙耳机。下面将针对图5所示的流程进行详细的阐述,所述耳机解锁方法具体可以包括以下步骤:
步骤S310:当蓝牙耳机处于加锁状态时,获取所述蓝牙耳机的第一姿态数据。
步骤S320:当所述蓝牙耳机的姿态发生变化时,检测所述蓝牙耳机的第二姿态数据和接触参数。
步骤S330:判断所述第一姿态数据和所述第二姿态数据之间的关系是否满足第一预设条件,以及判断所述接触参数是否满足第二预设条件。
其中,步骤S310-步骤S330的具体描述请参阅步骤S110-步骤S130,在此不再赘述。
步骤S340:当所述第一蓝牙耳机满足所述第一预设条件和所述第二预设条件,且所述第二蓝牙耳机不满足所述第一预设条件和/或所述第二预设条件时,分别检测所述电子设备是否与所述第一蓝牙耳机和所述第二蓝牙耳机处于连接状态。
在本实施例中,该蓝牙耳机包括第一蓝牙耳机和第二蓝牙耳机,其中,该第一蓝牙耳机和第二蓝牙耳机可以视作一对蓝牙耳机,即该第一蓝牙耳机和第二蓝牙耳机可以分别作为左耳机和右耳机,例如,该第一蓝牙耳机作为左耳机且第二蓝牙耳机作为右耳机,或者该第二蓝牙耳机作为左耳机且第一蓝牙耳机作为右耳机等。
其中,分别对该第一蓝牙耳机和第二蓝牙耳机进行检测,并判断该第一蓝牙耳机是否满足第一预设条件和第二预设条件,以及判断该第二蓝牙耳机是否满足第一预设条件和第二预设条件,也就是说,检测该第一蓝牙耳机的第一姿态数据和第二姿态数据,判断该第一蓝牙耳机的第一姿态数据和第二姿态数据的关系是否满足第一预设条件,以及检测第一蓝牙耳机的接触参数,判断该第一蓝牙耳机的接触参数是否满足第二预设条件;同时,检测该第二蓝牙耳机的第一姿态数据和第二姿态数据,判断该第二蓝牙耳机的第一姿态数据和第二姿态数据的关系是否满足第一预设条件,以及检测第二蓝牙耳机的接触参数,判断该第二蓝牙耳机的接触参数是否满足第二预设条件。
可以理解的,当该第一蓝牙耳机同时满足第一预设条件和第二预设条件时,表征该第一蓝牙耳机安放于用户耳部,可以认为用户期望使用该第一蓝牙耳机,当该第一蓝牙耳机不满足第一预设条件和/或第二预设条件时,表征该第一蓝牙耳机没有安放于用户耳部,可以认为用户没有期望使用该第一蓝牙耳机;同样的,当该第二蓝牙耳机同时满足第一预设条件和第二预设条件时,表征该第二蓝牙耳机安放于用户耳部,可以认为用户期望使用该第二蓝牙耳机,当该第二蓝牙耳机不满足第一预设条件和/或第二预设条件时,表征该第二蓝牙耳机没有安放于用户耳部,可以认为用户没有期望使用该第二蓝牙耳机。
在本实施例中,当检测结果表征第一蓝牙耳机同时满足第一预设条件和第二预设条件,且第二蓝牙耳机不满足第一预设条件和/或第二预设条件时,可以认为第一蓝牙耳机安放于用户耳部且第二蓝牙耳机没有安放于用户耳部。作为一种方式,检测电子设备是否与第一蓝牙耳机处于连接状态,以及检测电子设备是否与第二蓝牙耳机处于连接状态,其中,可以通过检测状态值或监听广播的方式对电子设备与第一蓝牙耳机和第二蓝牙耳机的连接状态进行检测,在此不再赘述。
步骤S350:当所述电子设备同时与所述第一蓝牙耳机和所述第二蓝牙耳机处于连接状态时,将所述第一蓝牙耳机和所述第二蓝牙耳机解锁。
其中,当检测到该电子设备同时与第一蓝牙耳机和第二蓝牙耳机处于连接状态时,也就 是说,电子设备与第一蓝牙耳机在进行数据交互或待进行数据交互,且与第二蓝牙耳机在进行数据交互或待进行数据交互,可以认为用户期望使用第一蓝牙耳机和第二蓝牙耳机,因此,将第一蓝牙耳解锁以及将第二蓝牙耳机解锁。
步骤S360:当所述电子设备与所述第一蓝牙耳机处于连接状态且与所述第二蓝牙耳机处于非连接状态时,将所述第一蓝牙耳机解锁且保持所述第二蓝牙耳机处于所述加锁状态。
其中,当检测到电子设备与第一蓝牙耳机处于连接状态,且与第二蓝牙耳机处于非连接状态时,也就是说,电子设备与第一蓝牙耳机在进行数据交互或待进行数据交互,且与第二蓝牙耳机没有进行数据交互,因此,可以认为用户在使用第一蓝牙耳机且没有使用第二蓝牙耳机,同时,该第一蓝牙耳机安放于用户耳机且第二蓝牙耳机没有安放于用户耳部,因此,可以解锁第一蓝牙耳机以供用户操作,并且保持第二蓝牙耳机处于加锁状态。
步骤S370:当所述电子设备与所述第二蓝牙耳机处于连接状态且与所述第一蓝牙耳机处于非连接状态时,所述电子设备向所述第一蓝牙耳机发起连接请求。
其中,当检测到电子设备与第二蓝牙耳机处于连接状态,且与第一蓝牙耳机处于非连接状态时,也就是说,电子设备与第二蓝牙耳机在进行数据交互或待进行数据交互,且与第一蓝牙耳机没有进行数据交互,同时,该第一蓝牙耳机安放于用户耳部且第二蓝牙耳机没有安放于用户耳部,表征用户期望使用第一蓝牙耳机接收音频数据,因此,在本实施例中,电子设备向第一蓝牙耳机发送连接请求,以尝试建立与第一蓝牙耳机之间的连接。
作为一种方式,该电子设备向第一蓝牙耳机发送蓝牙低功耗链路连接请求,作为一种方式,该电子设备通过SDP服务查询协议,查询该第一蓝牙耳机支持的应用协议和UUID,可以理解的,不同的蓝牙耳机支持的应用协议不同,有的蓝牙耳机只支持传统蓝牙协议,有的蓝牙耳机只支持蓝牙低功耗协议,有的蓝牙耳机同时支持蓝牙低功耗协议和传统蓝牙协议,因此,电子设备需要判断该第一蓝牙耳机支持的应用协议。当第一蓝牙耳机支持蓝牙低功耗协议时,或者该第一蓝牙耳机既支持传统蓝牙协议又支持蓝牙低功耗协议时,则确定为该第一蓝牙耳机支持蓝牙低功耗协议,该电子设备向所述第一蓝牙耳机发送蓝牙低功耗链路连接请求;当第一蓝牙耳机只支持传统蓝牙协议时,电子设备向第一蓝牙耳机发送传统蓝牙连接请求。
步骤S380:当所述电子设备与所述第一蓝牙耳机建立连接成功时,将所述第一蓝牙耳机解锁且保持所述第二蓝牙耳机处于所述加锁状态。
进一步地,作为一种方式,当电子设备与第一蓝牙耳机建立连接成功时,表征该电子设备可以将音频数据传输至第一蓝牙耳机,并且,由于第一蓝牙耳机安放于用户耳部且第二蓝牙耳机没有安放于用户耳部,因此,可以将第一蓝牙耳机解锁以供用户操作,同时保持第二蓝牙耳机处于加锁状态。
步骤S390:当所述电子设备与所述第一蓝牙耳机建立连接失败时,将所述第二蓝牙耳机解锁且保持所述第一蓝牙耳机处于所述加锁状态。
作为另一种方式,当电子设备与第一蓝牙耳机建立连接失败时,表征电子设备不可以将音频数据传输至第一蓝牙耳机,因此,虽然第一蓝牙耳机安放于用户耳部且第二蓝牙耳机没有安放于用户耳部,但是,为了保证用户的听音体验和可操作性,将第二蓝牙耳机解锁以供用户操作,且保持第一蓝牙耳机处于加锁状态。
本申请再一个实施例提供的耳机解锁方法,相较于图3所示的耳机解锁方法,还在第一蓝牙耳机满足第一预设条件和第二预设条件,且第二蓝牙耳机不满足第一预设条件和/或第二预设条件时,分别检测电子设备是否与第一蓝牙耳机和第二蓝牙耳机处于连接状态,当电子设备同时与第一蓝牙耳机和第二蓝牙耳机处于连接状态时,将第一蓝牙耳机和第二蓝牙耳机解锁,当电子设备与第一蓝牙耳机处于连接状态且与第二蓝牙耳机处于非连接状态时,将第一蓝牙耳机解锁且保持与第二蓝牙耳机处于加锁状态,当电子设备与第二蓝牙耳机处于连接状态且与第一蓝牙耳机处于非连接状态时,电子设备向第一蓝牙耳机发起连接请求,当连接成功时,将第一蓝牙耳机解锁且保持第二蓝牙耳机处于加锁状态,当连接失败时,将第二蓝 牙耳机解锁且保持第一蓝牙耳机处于加锁状态。相较于图3所示的耳机解锁方法,本实施例在第一蓝牙耳机均满足预设条件且第二蓝牙耳机没有均满足预设条件时,根据电子设备与第一蓝牙耳机和第二蓝牙耳机的连接状态,控制第一蓝牙耳机/或第二蓝牙耳机解锁,从而可以进一步提升耳机解锁的准确性。
请参阅图6,图6示出了本申请实施例提供的耳机解锁装置200的模块框图。耳机解锁装置200应用于上述电子设备。下面将针对图6所示的框图进行阐述,所述耳机解锁装置200包括:获取模块210、检测模块220、判断模块230以及解锁模块240,其中:
获取模块210,用于当蓝牙耳机处于加锁状态时,获取所述蓝牙耳机的第一姿态数据。进一步地,所述获取模块210包括:
检测子模块,用于当所述蓝牙耳机处于所述加锁状态时,检测所述蓝牙耳机是否与所述电子设备处于连接状态。
获取子模块,用于当所述蓝牙耳机与所述电子设备处于连接状态时,获取所述蓝牙耳机的第一姿态数据。
检测模块220,用于当所述蓝牙耳机的姿态发生变化时,检测所述蓝牙耳机的第二姿态数据和接触参数。
判断模块230,用于判断所述第一姿态数据和所述第二姿态数据之间的关系是否满足第一预设条件,以及判断所述接触参数是否满足第二预设条件。进一步地,所述第一姿态数据包括第一偏移角度,所述第二姿态数据包括第二偏移角度,所述判断模块230包括:差值判断子模块、第一确定子模块、接触面积获取子模块、接触面积判断子模块以及第二确定子模块,其中:
差值判断子模块,用于判断所述第一偏移角度和所述第二偏移角度之间的差值是否大于预设角度。
第一确定子模块,用于当所述第一偏移角度和所述第二偏移角度之间的差值大于所述预设角度时,确定所述第一姿态数据和所述第二姿态数据的关系满足所述第一预设条件。
接触面积获取子模块,用于基于所述接触参数获取接触面积。
接触面积判断子模块,用于判断所述接触面积是否与预设面积一致,其中,所述预设面积为所述蓝牙耳机安放于用户耳部时,所述蓝牙耳机与所述用户耳部之间的接触面积。
第二确定子模块,用于当所述接触面积与所述预设面积一致时,确定所述接触参数满足所述第二预设条件。
解锁模块240,用于当所述第一姿态数据和所述第二姿态数据之间的关系满足所述第一预设条件,且所述接触参数满足所述第二预设条件时,解锁所述蓝牙耳机。进一步地,所述蓝牙耳机包括第一蓝牙耳机和第二蓝牙耳机,所述解锁模块240包括:连接状态检测子模块、第一解锁子模块、第二解锁子模块、连接请求发送子模块、第三解锁子模块以及第四解锁子模块,其中:
连接状态检测子模块,用于当所述第一蓝牙耳机满足所述第一预设条件和所述第二预设条件,且所述第二蓝牙耳机不满足所述第一预设条件和/或所述第二预设条件时,分别检测所述电子设备是否与所述第一蓝牙耳机和所述第二蓝牙耳机处于连接状态。
第一解锁子模块,用于当所述电子设备同时与所述第一蓝牙耳机和所述第二蓝牙耳机处于连接状态时,将所述第一蓝牙耳机和所述第二蓝牙耳机解锁。
第二解锁子模块,用于当所述电子设备与所述第一蓝牙耳机处于连接状态且与所述第二蓝牙耳机处于非连接状态时,将所述第一蓝牙耳机解锁且保持所述第二蓝牙耳机处于所述加锁状态。
连接请求发送子模块,用于当所述电子设备与所述第二蓝牙耳机处于连接状态且与所述第一蓝牙耳机处于非连接状态时,所述电子设备向所述第一蓝牙耳机发起连接请求。
第三解锁子模块,用于当所述电子设备与所述第一蓝牙耳机建立连接成功时,将所述第一蓝牙耳机解锁且保持所述第二蓝牙耳机处于所述加锁状态。
第四解锁子模块,用于当所述电子设备与所述第一蓝牙耳机建立连接失败时,将所述第二蓝牙耳机解锁且保持所述第一蓝牙耳机处于所述加锁状态。
本申请实施例提供的耳机解锁装置包括获取模块、检测模块、判断模块以及解锁模块,其中,获取模块用于当蓝牙耳机处于加锁状态时,获取所述蓝牙耳机的第一姿态数据,检测模块用于当所述蓝牙耳机的姿态发生变化时,检测所述蓝牙耳机的第二姿态数据和接触参数,判断模块用于判断所述第一姿态数据和所述第二姿态数据之间的关系是否满足第一预设条件,以及判断所述接触参数是否满足第二预设条件,解锁模块用于当所述第一姿态数据和所述第二姿态数据之间的关系满足所述第一预设条件,且所述接触参数满足所述第二预设条件时,解锁所述蓝牙耳机,从而通过分别检测蓝牙耳机的姿态数据和接触参数,并在姿态数据和接触参数均满足预设条件时将蓝牙耳机解锁,以实现蓝牙耳机的自动解锁,简化解锁过程,提升用户体验。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述装置和模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,模块相互之间的耦合可以是电性,机械或其它形式的耦合。
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
请参阅图7,其示出了本申请实施例提供的一种电子设备100的结构框图。该电子设备100可以是智能手机、平板电脑、电子书等能够运行应用程序的电子设备。本申请中的电子设备100可以包括一个或多个如下部件:处理器110、存储器120、蓝牙模块130以及一个或多个应用程序,其中一个或多个应用程序可以被存储在存储器120中并被配置为由一个或多个处理器110执行,一个或多个程序配置用于执行如前述方法实施例所描述的方法。
处理器110可以包括一个或者多个处理核。处理器110利用各种接口和线路连接整个电子设备100内的各个部分,通过运行或执行存储在存储器120内的指令、程序、代码集或指令集,以及调用存储在存储器120内的数据,执行电子设备100的各种功能和处理数据。可选地,处理器110可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器110可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器110中,单独通过一块通信芯片进行实现。
存储器120可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory)。存储器120可用于存储指令、程序、代码、代码集或指令集。存储器120可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等。存储数据区还可以存储电子设备100在使用中所创建的数据(比如电话本、音视频数据、聊天记录数据)等。
蓝牙模块130用于实现电子设备与两个蓝牙耳机之间的蓝牙连接,以及与两个蓝牙耳机之间的数据交互,其中,蓝牙模块130的数量可以为一个,也可以为多个集成在一起,在此不做限定。具体地,可以与蓝牙设备通过蓝牙协议5.0/4.2/4.1/2.1/2.0,也可以通过蓝牙低能耗技术(Bluetooh Low Energy,BLE)、蓝牙增强速率技术(Enhanced Data Rate,EDR)或者蓝牙基本速率(Base Rate,BR)等。其基本电路构成与WiFi模块类似,也可 以由功率放大器、无线收发器、收发切换器、低噪声放大器以及天线等组成。该蓝牙模块130可以使用第一通信频段,其中,该第一通信频段可以是2.4GHZ。
请参阅图8,其示出了本申请实施例提供的一种计算机可读存储介质的结构框图。该计算机可读介质300中存储有程序代码,所述程序代码可被处理器调用执行上述方法实施例中所描述的方法。
计算机可读存储介质300可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。可选地,计算机可读存储介质300包括非易失性计算机可读介质(non-transitory computer-readable storage medium)。计算机可读存储介质300具有执行上述方法中的任何方法步骤的程序代码310的存储空间。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。程序代码310可以例如以适当形式进行压缩。
综上所述,本申请实施例提供的耳机解锁方法、装置、电子设备以及存储介质,当蓝牙耳机处于加锁状态时,获取该蓝牙耳机的第一姿态数据,当蓝牙耳机的姿态发生变化时,检测蓝牙耳机的第二姿态数据和接触参数,判断该第一姿态数据和第二姿态数据之间的关系是否满足第一预设条件,以及判断接触参数是否满足第二预设条件,当第一姿态数据和第二姿态数据之间的关系满足第一预设条件,且接触参数满足第二预设条件时,将蓝牙耳机解锁,从而通过分别检测蓝牙耳机的姿态数据和接触参数,并在姿态数据和接触参数均满足预设条件时将蓝牙耳机解锁,以实现蓝牙耳机的自动解锁,简化解锁过程,提升用户体验。
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不驱使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。

Claims (20)

  1. 一种耳机解锁方法,其特征在于,应用于电子设备,所述方法包括:
    当蓝牙耳机处于加锁状态时,获取所述蓝牙耳机的第一姿态数据;
    当所述蓝牙耳机的姿态发生变化时,检测所述蓝牙耳机的第二姿态数据和接触参数;
    判断所述第一姿态数据和所述第二姿态数据之间的关系是否满足第一预设条件,以及判断所述接触参数是否满足第二预设条件;
    当所述第一姿态数据和所述第二姿态数据之间的关系满足所述第一预设条件,且所述接触参数满足所述第二预设条件时,将所述蓝牙耳机解锁。
  2. 根据权利要求1所述的方法,其特征在于,所述第一姿态数据包括第一偏移角度,所述第二姿态数据包括第二偏移角度,所述判断所述第一姿态数据和所述第二姿态数据的关系是否满足第一预设条件,包括:
    判断所述第一偏移角度和所述第二偏移角度之间的差值是否大于预设角度;
    当所述第一偏移角度和所述第二偏移角度之间的差值大于所述预设角度时,确定所述第一姿态数据和所述第二姿态数据的关系满足所述第一预设条件。
  3. 根据权利要求1或2所述的方法,其特征在于,所述判断所述接触参数是否满足第二预设条件,包括:
    基于所述接触参数获取接触面积;
    判断所述接触面积是否与预设面积一致,其中,所述预设面积为所述蓝牙耳机安放于用户耳部时,所述蓝牙耳机与所述用户耳部之间的接触面积;
    当所述接触面积与所述预设面积一致时,确定所述接触参数满足所述第二预设条件。
  4. 根据权利要求1所述的方法,其特征在于,所述当所述蓝牙耳机处于加锁状态时,获取所述蓝牙耳机的第一姿态数据,包括:
    当所述蓝牙耳机处于所述加锁状态时,检测所述蓝牙耳机是否与所述电子设备处于连接状态;
    当所述蓝牙耳机与所述电子设备处于连接状态时,获取所述蓝牙耳机的第一姿态数据。
  5. 根据权利要求4所述的方法,其特征在于,所述检测所述蓝牙耳机是否与所述电子设备处于连接状态,包括:
    查看所述电子设备的状态值;
    基于所述状态值判断所述蓝牙耳机是否与所述电子设备处于连接状态。
  6. 根据权利要求4所述的方法,其特征在于,所述检测所述蓝牙耳机是否与所述电子设备处于连接状态,包括:
    所述电子设备监听广播;
    根据监听到的广播,确定所述电子设备与所述两个蓝牙耳机是否处于连接状态。
  7. 根据权利要求4-6任一项所述的方法,其特征在于,所述当所述蓝牙耳机与所述电子设备处于连接状态时,获取所述蓝牙耳机的第一姿态数据,包括:
    当所述蓝牙耳机与所述电子设备处于连接状态时,获取所述蓝牙耳机的第一偏移角度。
  8. 根据权利要求7所述的方法,其特征在于,所述方法还包括:
    当所述蓝牙耳机的姿态发生变化时,检测所述蓝牙耳机的第二偏移角度和接触参数。
  9. 根据权利要求1所述的方法,其特征在于,所述蓝牙耳机包括第一蓝牙耳机和第二蓝牙耳机,所述方法还包括:
    当所述第一蓝牙耳机满足所述第一预设条件和所述第二预设条件,且所述第二蓝牙耳机不满足所述第一预设条件和/或所述第二预设条件时,分别检测所述电子设备是否与所述第一蓝牙耳机和所述第二蓝牙耳机处于连接状态;
    当所述电子设备同时与所述第一蓝牙耳机和所述第二蓝牙耳机处于连接状态时,将所述第一蓝牙耳机和所述第二蓝牙耳机解锁。
  10. 根据权利要求9所述的方法,其特征在于,所述方法还包括:
    当所述电子设备与所述第一蓝牙耳机处于连接状态且与所述第二蓝牙耳机处于非连接状态时,将所述第一蓝牙耳机解锁且保持所述第二蓝牙耳机处于所述加锁状态。
  11. 根据权利要求9或10所述的方法,其特征在于,所述方法还包括:
    当所述电子设备与所述第二蓝牙耳机处于连接状态且与所述第一蓝牙耳机处于非连接状态时,所述电子设备向所述第一蓝牙耳机发起连接请求;
    当所述电子设备与所述第一蓝牙耳机建立连接成功时,将所述第一蓝牙耳机解锁且保持所述第二蓝牙耳机处于所述加锁状态;
    当所述电子设备与所述第一蓝牙耳机建立连接失败时,将所述第二蓝牙耳机解锁且保持所述第一蓝牙耳机处于所述加锁状态。
  12. 根据权利要求11所述的方法,其特征在于,所述电子设备向所述第一蓝牙耳机发起连接请求,包括:
    查询所述第一蓝牙耳机支持的应用协议;
    基于所述应用协议向所述第一蓝牙耳机发送对应的连接请求。
  13. 根据权利要求1-12任一项所述的方法,其特征在于,所述蓝牙耳机内设置有姿态检测模块,所述获取所述蓝牙耳机的第一姿态数据,包括:
    获取通过所述姿态检测模块检测到的所述蓝牙耳机的第一姿态数据。
  14. 根据权利要求13所述的方法,其特征在于,所述姿态检测模块包括陀螺仪,所述获取通过所述姿态检测模块检测到的所述蓝牙耳机的第一姿态数据,包括:
    获取所述陀螺仪检测的所述蓝牙耳机相对于所述陀螺仪的转轴的角度关系;
    根据所述角度关系和预设姿态相对于所述陀螺仪的转轴的角度关系,确定所述蓝牙耳机的第一姿态;
    基于所述第一姿态获取所述第一姿态对应的第一姿态数据。
  15. 根据权利要求1-14任一项所述的方法,其特征在于,所述当所述蓝牙耳机的姿态发生变化时,检测所述蓝牙耳机的第二姿态数据和接触参数,包括:
    当检测到所述蓝牙耳机的姿态与所述第一姿态数据对应的姿态不同时,检测所述蓝牙耳机的第二姿态数据和接触参数。
  16. 根据权利要求1-15所述的方法,其特征在于,所述判断所述接触参数是否满足第二预设条件,包括:
    获取所述接触参数中的接触面积和/或接触点;
    判断所述接触面积和/或接触点是否满足所述第二预设条件。
  17. 一种耳机解锁装置,其特征在于,应用于电子设备,所述装置包括:
    获取模块,用于当蓝牙耳机处于加锁状态时,获取所述蓝牙耳机的第一姿态数据;
    检测模块,用于当所述蓝牙耳机的姿态发生变化时,检测所述蓝牙耳机的第二姿态数据和接触参数;
    判断模块,用于判断所述第一姿态数据和所述第二姿态数据之间的关系是否满足第一预设条件,以及判断所述接触参数是否满足第二预设条件;
    解锁模块,用于当所述第一姿态数据和所述第二姿态数据之间的关系满足所述第一预设条件,且所述接触参数满足所述第二预设条件时,解锁所述蓝牙耳机。
  18. 根据权利要求17所述的装置,其特征在于,所述判断模块,包括:
    差值判断子模块,用于判断所述第一偏移角度和所述第二偏移角度之间的差值是否大于预设角度;
    确定子模块,用于当所述第一偏移角度和所述第二偏移角度之间的差值大于所述预设角度时,确定所述第一姿态数据和所述第二姿态数据的关系满足所述第一预设条件。
  19. 一种电子设备,其特征在于,包括:
    蓝牙模块;
    存储器;
    一个或多个处理器,分别与所述蓝牙模块和所述存储器耦接;
    一个或多个程序,其中,所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于执行如权利要求1-16任一项所述的方法。
  20. 一种计算机可读取存储介质,其特征在于,所述计算机可读取存储介质中存储有程序代码,所述程序代码可被处理器调用执行如权利要求1-16任一项所述的方法。
PCT/CN2019/096214 2018-09-30 2019-07-16 耳机解锁方法、装置、电子设备以及存储介质 WO2020063045A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811161415.1A CN109391868B (zh) 2018-09-30 2018-09-30 耳机解锁方法、装置、电子设备以及存储介质
CN201811161415.1 2018-09-30

Publications (1)

Publication Number Publication Date
WO2020063045A1 true WO2020063045A1 (zh) 2020-04-02

Family

ID=65419262

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/096214 WO2020063045A1 (zh) 2018-09-30 2019-07-16 耳机解锁方法、装置、电子设备以及存储介质

Country Status (2)

Country Link
CN (1) CN109391868B (zh)
WO (1) WO2020063045A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109391868B (zh) * 2018-09-30 2020-01-14 Oppo广东移动通信有限公司 耳机解锁方法、装置、电子设备以及存储介质
CN113704717A (zh) * 2021-07-15 2021-11-26 安克创新科技股份有限公司 蓝牙耳机及其加锁方法和解锁方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106714018A (zh) * 2015-07-21 2017-05-24 杭州纳雄科技有限公司 一种耳机电路、耳机的控制方法及耳机的使用方法
CN106921803A (zh) * 2017-03-29 2017-07-04 联想(北京)有限公司 多媒体数据的播放方法及控制设备
CN107257409A (zh) * 2017-06-05 2017-10-17 努比亚技术有限公司 屏幕状态控制方法、移动终端及计算机可读存储介质
US20180014103A1 (en) * 2016-07-07 2018-01-11 Bragi GmbH Comparative analysis of sensors to control power status for wireless earpieces
CN109391868A (zh) * 2018-09-30 2019-02-26 Oppo广东移动通信有限公司 耳机解锁方法、装置、电子设备以及存储介质

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102830929B (zh) * 2012-08-15 2016-08-24 广东欧珀移动通信有限公司 一种解锁系统、方法及移动终端
KR20160076857A (ko) * 2014-12-23 2016-07-01 엘지전자 주식회사 이동 단말기 및 그의 컨텐츠 제어방법
CN106934262A (zh) * 2015-12-30 2017-07-07 阿里巴巴集团控股有限公司 一种可穿戴设备及其用户认证方法
EP3337181B1 (en) * 2016-12-15 2020-02-05 GN Audio A/S Earphone with earphone housing and speaker housing
CN107155005A (zh) * 2017-04-27 2017-09-12 上海斐讯数据通信技术有限公司 一种智能腕式可穿戴装置亮屏控制方法及系统
CN107563185A (zh) * 2017-08-15 2018-01-09 努比亚技术有限公司 一种防止错误解锁的方法、终端及计算机可读存储介质
CN107908350A (zh) * 2017-12-28 2018-04-13 努比亚技术有限公司 一种解锁方法、终端及计算机可读存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106714018A (zh) * 2015-07-21 2017-05-24 杭州纳雄科技有限公司 一种耳机电路、耳机的控制方法及耳机的使用方法
US20180014103A1 (en) * 2016-07-07 2018-01-11 Bragi GmbH Comparative analysis of sensors to control power status for wireless earpieces
CN106921803A (zh) * 2017-03-29 2017-07-04 联想(北京)有限公司 多媒体数据的播放方法及控制设备
CN107257409A (zh) * 2017-06-05 2017-10-17 努比亚技术有限公司 屏幕状态控制方法、移动终端及计算机可读存储介质
CN109391868A (zh) * 2018-09-30 2019-02-26 Oppo广东移动通信有限公司 耳机解锁方法、装置、电子设备以及存储介质

Also Published As

Publication number Publication date
CN109391868B (zh) 2020-01-14
CN109391868A (zh) 2019-02-26

Similar Documents

Publication Publication Date Title
WO2021004350A1 (zh) 发射天线的切换方法及终端设备
WO2020063065A1 (zh) 音频传输方法、装置、电子设备以及存储介质
CN109361444B (zh) 一种发射天线的切换方法及终端设备
US9294869B2 (en) Methods, systems and apparatus to affect RF transmission from a non-linked wireless client
JP6376015B2 (ja) 情報処理装置、情報処理方法、およびプログラム
CN105872654B (zh) 音频播放系统中的蓝牙连接切换方法、装置及系统
US20190069287A1 (en) Media access control (mac) address identification
CN109413526B (zh) 耳机控制方法、装置、电子设备以及存储介质
US20140354441A1 (en) System and constituent media device components and media device-based ecosystem
WO2016018894A1 (en) Peer-to-peer group re-formation
CN109379490B (zh) 音频播放方法、装置、电子设备及计算机可读介质
KR102335903B1 (ko) 전자 장치들 간에 통신 방법 및 장치
WO2020063045A1 (zh) 耳机解锁方法、装置、电子设备以及存储介质
WO2021136141A1 (zh) 播放方法及电子设备
WO2022007944A1 (zh) 一种设备控制方法及相关装置
US20240056720A1 (en) Method for outputting audio signal, and electronic device for performing same
CN109257732B (zh) 设备控制方法、装置以及电子设备
US20230006711A1 (en) Audio transmission method and electronic device
US20140254818A1 (en) System and method for automatically switching operational modes in a bluetooth earphone
CN109151669B (zh) 耳机控制方法、装置、电子设备以及存储介质
WO2015078349A1 (zh) 麦克风收音状态的切换方法和装置
US20230337302A1 (en) Electronic device that carries out communication and operation method therefor
US20160119573A1 (en) User terminal apparatus and control method thereof
WO2020216331A1 (zh) 随机接入方法及终端
CN108696842A (zh) 一种设备及其组网方法、输出方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19866645

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19866645

Country of ref document: EP

Kind code of ref document: A1