Earphone fitting degree detection method and earphone

CN119586161APending Publication Date: 2025-03-07HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380055873.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-12-09
Filing Date
2023-09-06
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

In the existing technology, during the earphone fit detection process, when the earphones play other sounds or change the noise reduction parameters, the detection accuracy will be affected, resulting in inconsistent detection results in mutually exclusive scenarios, especially when electronic devices with different operating systems have different processing methods. , causing trouble to users.

Method used

By executing control logic in the headset, the priority of fit detection is reduced, and detection is prohibited or interrupted. When detection is mutually exclusive with other services, conflicts are avoided and the compatibility of detection is improved without relying on permissions provided by the operating system.

Benefits of technology

It achieves the compatibility of headphone fit detection under different operating systems, avoids the reduction of detection accuracy and the impact on user experience, and ensures the consistency and accuracy of detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119586161A_ABST
    Figure CN119586161A_ABST
Patent Text Reader

Abstract

The invention discloses an earphone fitting degree detection method and an earphone, relates to the technical field of electronics, and is used for processing a mutual exclusion scene of earphone fitting degree detection by the earphone so as to improve the compatibility of an earphone fitting degree detection function. The earphone fitting degree detection method applied to the earphone comprises the following steps: starting a first service; the first service refers to a service for changing a noise reduction parameter of the earphone or a service for playing other audios except the audio required by earphone fitting degree detection; receiving a fitting degree detection command from the electronic equipment, wherein the fitting degree detection command is used for indicating the earphone to carry out earphone fitting degree detection; determining that the on-going first service and the earphone fitting degree detection are mutually exclusive; and prohibiting earphone fitting degree detection.
Need to check novelty before this filing date? Find Prior Art

Description

Earphone fit testing method and earphone

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on December 9, 2022, with application number 202211580027.3 and invention name “Earphone Fit Detection Method and Earphone”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of electronic technology, and in particular to a method for detecting the fit of an earphone and an earphone. Background Art

[0003] In-ear true wireless stereo (TWS) headphones can use the headphone fit detection function to determine whether the user's ear canal and the headphone fit. The basic principle of headphone fit detection is: after the speaker part of the headphone is inserted into the user's ear canal, the speaker in the headphone plays a preset audio according to the preset headphone fit detection parameters (such as noise reduction parameters), and the microphone in the headphone (located outside the ear canal) collects the ambient sound (including the preset audio leaked from the gap between the ear canal and the headphone). The headphone determines the leakage value of the preset audio by analyzing the played preset audio and the received leaked preset audio. The smaller the leakage value, the closer the user's ear canal and the headphone fit. In some scenarios, during the headphone fit detection, if the headphone plays other sounds or changes the noise reduction parameters, it will affect the accuracy of the headphone fit detection. This scenario is referred to as the mutually exclusive scenario of headphone fit detection.

[0004] In the existing technology, the headphone application on the electronic device side handles this mutually exclusive scenario. However, for some operating systems of electronic devices, the headphone application has limited permissions. As a result, when the same headphone is connected to electronic devices with different operating systems, the same mutually exclusive scenario is handled differently when performing headphone fit testing, causing trouble for users.

[0005] Summary of the Invention

[0006] An embodiment of the present application provides an earphone fit detection method and an earphone, which are used to enable the earphone to process mutually exclusive scenarios of earphone fit detection, so as to improve the compatibility of the earphone fit detection function.

[0007] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:

[0008] In a first aspect, a method for detecting the fit of an earphone is provided, which is applied to an earphone, and the method includes: receiving a service startup command from an electronic device, the service startup command being used to instruct the earphone to start a first service, the first service being a service for changing the noise reduction parameters of the earphone, or a service for playing audio other than the audio required for the earphone fit detection; starting the first service; receiving a fit detection command from the electronic device, the fit detection command being used to instruct the earphone to perform an earphone fit detection; if it is determined that the ongoing first service and the earphone fit detection are mutually exclusive, prohibiting the earphone fit detection.

[0009] In the headphone fit detection method provided in the embodiment of the present application, the headphone is already performing a first service, and the first service can change the noise reduction parameters of the headphone, or play other audio besides the audio required for the headphone fit detection, which will cause the accuracy of the headphone fit detection to be reduced. At this time, if the headphone receives a fit detection command (the fit detection command is used to instruct the headphone to perform the headphone fit detection), the headphone prohibits the headphone fit detection (that is, the headphone fit detection is not started). Therefore, the control logic is executed by the headphone to avoid conflicts with the first service by lowering the priority of the headphone fit detection, and does not rely on the permissions opened to the headphone application by the operating system in the electronic device. For electronic devices using different operating systems, the headphone handles mutually exclusive scenarios in a consistent manner, thereby improving the compatibility of the headphone fit detection.

[0010] In a possible implementation, the first service includes at least one of the following services: a media playback service, a call service, a long prompt tone playback service, and a voice assistant wake-up service.

[0011] Since media playback services, long prompt tone playback services, etc. will play audio, and call services and voice assistant wake-up services will change the noise reduction parameters of the headphones because they need to collect voice and reduce noise, the accuracy of headphone fit detection will be reduced.

[0012] In a possible implementation, the first service is a call service or a voice assistant wake-up service, and determining that the ongoing first service and the earphone fit detection are mutually exclusive includes: determining that the voice transmission channel of the earphone is in a connected state.

[0013] When the voice transmission channel of the headset is in a connected state, it indicates that the electronic device is transmitting audio data of a call service or a voice assistant wake-up service to the headset through the voice transmission channel of the headset.

[0014] In a possible implementation, the voice transmission channel is a synchronous connection oriented (SCO) channel.

[0015] This application does not limit the specific type of voice transmission channel, and it can also be other types of channels as the protocol evolves.

[0016] In a possible implementation, the first service is a media playback service or a long prompt tone playback service, and determining that the ongoing first service and the earphone fit detection are mutually exclusive includes: determining that the audio transmission channel of the earphone is in a playback state or a paused state.

[0017] When the audio transmission channel of the headset is in the playing state or the paused state, it indicates that the electronic device is transmitting audio data of a media playback service or a long prompt tone playback service to the headset through the audio transmission channel of the headset.

[0018] In a possible implementation, the audio transmission channel is an advanced audio distribution profile (A2DP) channel.

[0019] This application does not limit the specific type of audio transmission channel, and it can also be other types of channels as the protocol evolves.

[0020] In a possible implementation, after determining that the ongoing first service and the earphone fit detection are mutually exclusive, the method further includes: sending first error indication information to the electronic device, where the first error indication information is used to instruct the earphone to prohibit the earphone fit detection.

[0021] This allows the electronic device to prompt the user that if an earphone fit test is to be performed, the ongoing first service that is mutually exclusive with the earphone fit test needs to be stopped to avoid reducing the accuracy of the earphone fit test.

[0022] In a second aspect, a headphone fit detection method is provided, which is applied to a headphone, and the method includes: receiving a fit detection command from an electronic device, the fit detection command being used to instruct the headphone to perform a headphone fit detection; if it is determined that a first service that is mutually exclusive with the headphone fit detection is not being performed, starting the headphone fit detection, the first service referring to: a service that changes the noise reduction parameters of the headphone, or a service that plays audio other than the audio required for the headphone fit detection; before completing the headphone fit detection, if a service start command is received from the electronic device, interrupting the headphone fit detection and starting the first service, the service start command being used to instruct the headphone to start the first service.

[0023] The earphone fit detection method provided in the embodiment of the present application, when the earphone is already performing the earphone fit detection, if a command is received to instruct the earphone to perform a first service that is mutually exclusive with the earphone fit detection, the earphone interrupts the earphone fit detection. The first service that is mutually exclusive with the earphone fit detection may change the noise reduction parameters of the earphone, or play audio other than the audio required for the earphone fit detection, resulting in reduced accuracy of the earphone fit detection. Therefore, the earphone executes the control logic to avoid conflict with the first service by lowering the priority of the earphone fit detection, and does not rely on the permissions opened to the earphone application by the operating system in the electronic device. For electronic devices using different operating systems, the earphone handles mutually exclusive scenarios in a consistent manner, thereby improving the compatibility of the earphone fit detection.

[0024] In a possible implementation, the first service includes at least one of the following services: a media playback service, a call service, a long prompt tone playback service, and a voice assistant wake-up service.

[0025] Since media playback services, long prompt tone playback services, etc. will play audio, and call services and voice assistant wake-up services will change the noise reduction parameters of the headphones because they need to collect voice and reduce noise, the accuracy of headphone fit detection will be reduced.

[0026] In one possible implementation, the first service is a call service or a wake-up voice assistant service, and determining that the first service that is mutually exclusive with the earphone fit detection is not being performed includes: determining that the voice transmission channel of the earphone is in a disconnected state, and determining that the audio transmission channel of the earphone is in an idle state.

[0027] When the headset's voice transmission channel is disconnected, it indicates that the electronic device is not transmitting audio data for call services or waking up the voice assistant service to the headset through the headset's voice transmission channel. When the headset's audio transmission channel is idle, it indicates that the electronic device is not transmitting audio data for playing media services or playing long prompt tones to the headset through the headset's audio transmission channel. Therefore, the accuracy of the headset fit detection will not be reduced.

[0028] In a possible implementation, the voice transmission channel is an SCO channel. This application does not limit the specific type of the voice transmission channel, and other types of channels may be used as the protocol evolves.

[0029] In one possible implementation, the audio transmission channel is an A2DP channel. This application does not limit the specific type of the audio transmission channel, and other types of channels may also be used as the protocol evolves.

[0030] In a possible implementation, the first service is a media playback service or a long prompt tone playback service, and the service startup command is a state switching command of the audio transmission channel, which is used to instruct the headset to switch the audio transmission channel from an idle state to a playback state or a pause state.

[0031] That is, the electronic device instructs the headset to transmit audio data of a media service or a long prompt tone service through the audio transmission channel of the headset, which will reduce the accuracy of the headset fit detection.

[0032] In a possible implementation, the first service is a call service or a voice assistant wake-up service, and the service startup command is a state switching command of the voice transmission channel, which is used to instruct the headset to switch the voice transmission channel from an idle state to a connected state.

[0033] That is, the electronic device instructs the headset to transmit audio data for call services or wake-up voice assistant services through the headset's voice transmission channel, which will reduce the accuracy of headset fit detection.

[0034] In a possible implementation, after receiving the service start command from the electronic device, the method further includes: sending second error indication information to the electronic device, where the second error indication information is used to instruct the earphone to interrupt the earphone fit detection.

[0035] This allows the electronic device to prompt the user that the earphone has interrupted the earphone fit detection due to the ongoing first business.

[0036] In a third aspect, a headset is provided, comprising a processor and a memory, wherein instructions are stored in the memory. When the processor executes the instructions, the method described in the first aspect to the second aspect and any embodiment thereof is executed.

[0037] In a fourth aspect, a computer-readable storage medium is provided, comprising instructions, which, when executed on a headset, cause the headset to execute the method as described in the first aspect to the second aspect and any embodiment thereof.

[0038] In a fifth aspect, a computer program product comprising instructions is provided. When the instructions are executed on the above-mentioned earphones, the earphones are caused to execute the method as described in the first aspect to the second aspect and any embodiment thereof.

[0039] In a sixth aspect, a chip system is provided, comprising a processor configured to support the headset in implementing the functions described in aspects 1 through 2 above. In one possible design, the device further comprises an interface circuit configured to receive signals from other devices (e.g., a memory) or transmit signals to other devices (e.g., a communication interface). The chip system may include a chip and other discrete components.

[0040] The technical effects of the third to sixth aspects refer to the technical effects of the first to second aspects and any of their embodiments, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] FIG1 is a schematic diagram of the architecture of a communication system provided in an embodiment of the present application;

[0042] FIG2 is a schematic structural diagram of an earphone provided in an embodiment of the present application;

[0043] FIG3 is a schematic diagram of a flow chart of a headphone fit detection method provided in an embodiment of the present application;

[0044] FIG4 is a schematic diagram of a mutually exclusive scenario for earphone fit detection provided in an embodiment of the present application;

[0045] FIG5 is a flow chart of a method for detecting earphone fit provided in an embodiment of the present application;

[0046] FIG6 is a second flow chart of a headphone fit detection method provided in an embodiment of the present application;

[0047] FIG7 is a schematic diagram of a display interface of a music player on an electronic device provided in an embodiment of the present application;

[0048] FIG8 is a schematic diagram of a display interface for earphone fit detection on an electronic device provided in an embodiment of the present application;

[0049] FIG9 is a schematic diagram of a display interface for detecting the fit between a music player and earphones on an electronic device according to an embodiment of the present application;

[0050] FIG10 is a third flow chart of a method for detecting earphone fit provided in an embodiment of the present application;

[0051] FIG11 is a fourth flow chart of a method for detecting earphone fit provided in an embodiment of the present application;

[0052] FIG12 is a second schematic diagram of a display interface for detecting the fit between a music player and earphones on an electronic device according to an embodiment of the present application;

[0053] FIG13 is a schematic structural diagram of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0054] First, some concepts involved in this application are described.

[0055] The terms "first", "second", etc. involved in the embodiments of the present application are only used to distinguish features of the same type and cannot be understood as indicating relative importance, quantity, order, etc.

[0056] The terms "exemplary" or "for example" in the embodiments of this application are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0057] The terms "coupling" and "connection" involved in the embodiments of this application should be understood in a broad sense. For example, they may refer to a physical direct connection, or an indirect connection achieved through electronic devices, such as a connection achieved through resistors, inductors, capacitors or other electronic devices.

[0058] First, an embodiment of the present application introduces a communication system including an electronic device and a headset, wherein the electronic device can transmit audio data to the headset (e.g., play music) or transmit voice data to and from the headset (e.g., make a call). Then, the process of performing headset fit detection by an electronic device and a headset in the prior art is introduced. In some scenarios, during the headset fit detection, if the headset is still playing other sounds or changing the noise reduction parameters (i.e., mutually exclusive services for headset fit detection), the accuracy of the headset fit detection will be affected. Several scenarios that affect the accuracy of the headset fit detection are specifically introduced. This application collectively refers to these scenarios as mutually exclusive scenarios for headset fit detection. Then, the headset fit detection method provided by an embodiment of the present application is introduced. When the headset detects that the ongoing service is mutually exclusive with the headset fit detection, the headset fit detection is prohibited. Alternatively, when the headset is already performing headset fit detection and is also performing a service that is mutually exclusive with the headset fit detection, the headset fit detection is interrupted. This allows the processing of mutually exclusive scenarios for headset fit detection to improve the compatibility of the headset fit detection function.

[0059] As shown in FIG1 , an embodiment of the present application provides a communication system, including an electronic device 20 and a headset 10. The electronic device 20 can transmit audio data to the headset 10 in a wired communication manner or a wireless communication manner, or transmit voice data to and from the headset 10. The wireless communication manner can be a Bluetooth (BT) communication manner, for example, a traditional Bluetooth communication manner or a low-power Bluetooth (e.g., Bluetooth low energy (BLE)) communication manner.

[0060] The electronic device 20 can be a mobile phone, a multimedia player, a tablet computer, a laptop computer, an augmented reality (AR) device, a virtual reality (VR) device, an ultra-mobile personal computer (UMPC), a personal digital assistant (PDA), a television or a smart watch. The headset 10 can be a Bluetooth headset, for example, an in-ear TWS headset. The Bluetooth headset can be of various types, for example, an earbud type, an in-ear type, a head-mounted type, an earmuff type or an ear-hanging type Bluetooth headset. The embodiment of the present application does not impose any special restrictions on the specific forms of the electronic device 20 and the headset 10.

[0061] For example, as shown in FIG2 , an embodiment of the present application provides a headset 10 , which may be a Bluetooth headset. The headset 10 may include at least one processor 101 , at least one memory 102 , a wireless communication module 103 , an audio module 104 , a power module 105 , a sensor 106 , and the like. The processor 101 may include one or more interfaces for connecting to other components of the headset 10 . The components of the headset 10 are described in detail below with reference to FIG2 .

[0062] The memory 102 can be used to store computer program instructions, which can be used to execute the earphone fit detection method involved in the present application. The memory can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus RAM (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0063] The processor 101 may include one or more processing units, and different processing units may be independent devices or integrated into one or more processors 101. The processor 101 may specifically be an integrated control chip. The processor 101 may be used to execute the above instructions and call relevant modules to execute the earphone fit detection method involved in the embodiment of the present application. The processor may be a chip. For example, it may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a micro controller unit (MCU), a programmable logic device (PLD), or other integrated chips.

[0064] The wireless communication module 103 can be used to support data transmission between the headset 10 and the electronic device through wireless communication technology (such as the Bluetooth communication technology described above). Exemplarily, the wireless communication module 103 may include a Bluetooth chip, and the headset 10 can be paired with the Bluetooth chip of the electronic device through the Bluetooth chip and establish a wireless connection to achieve wireless communication between the headset 10 and the electronic device through the wireless connection. Generally, the Bluetooth chip can support basic rate (BR) Bluetooth, enhanced data rate (EDR) Bluetooth and BLE, etc. In addition, the wireless communication module 103 may also include an antenna, and the wireless communication module 103 receives electromagnetic waves via the antenna, modulates the electromagnetic wave signal and filters it, and sends the processed signal to the processor 101. The wireless communication module 103 can also receive the signal to be sent from the processor 101, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna.

[0065] The audio module 104 can be used to manage audio data and implement the input and output of audio streams by the headset 10. For example, the audio module 104 can obtain an audio stream from the wireless communication module 103, or transmit an audio stream to the wireless communication module 103, to implement functions such as making calls, playing music, waking up or turning off the voice assistant of the electronic device connected to the headset 10, receiving or sending the user's voice data, etc. through a Bluetooth headset. The audio module 104 may include a speaker (or earpiece, receiver) component for outputting an audio stream, a microphone (or microphone, microphone), a microphone receiving circuit that cooperates with the microphone, etc. The speaker can convert an audio electrical signal into a sound signal and play it. The microphone can convert a sound signal into an audio electrical signal.

[0066] The various components shown in Figure 2 can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing or application-specific integrated circuits. Exemplarily, when the Bluetooth headset is a TWS headset, the headset 10 may include an earphone body worn on the left ear (also called the left earphone) and an earphone body worn on the right ear (also called the right earphone). The earphone body may include a shell and internal components. The internal components are arranged in a cavity formed by the shell. The internal components may include devices in modules such as the above-mentioned audio module, power module, and wireless communication module.

[0067] When the Bluetooth headset is a TWS headset, the user can use the TWS headset in binaural mode or monaural mode. In monaural mode, the user wears the left earphone or the right earphone to listen to music or make calls and other audio services. In binaural mode, the user can wear two earphones to enjoy music or perform other audio services. In binaural mode, the two earphones are divided into main earphones and auxiliary earphones. Moreover, during the use of TWS headsets, the main and auxiliary roles of the two earphones can also be switched based on different conditions. For example, the earphone with higher battery can be switched to the main earphone, and the earphone with lower battery can be switched to the auxiliary earphone.

[0068] The power module 105 can be used to provide system power to the headset 10, power the various modules of the headset 10, and support the headset 10 to receive charging input, etc. The power module 105 may include a power management unit (PMU) and a battery. The power management unit can receive external charging input, transform the electrical signal input from the charging circuit and provide it to the battery for charging, and can also transform the electrical signal provided by the battery and provide it to other modules such as the audio module 104 and the wireless communication module 103, and prevent the battery from being overcharged, over-discharged, short-circuited, or overcurrent, etc. In some embodiments, the power module 105 may also include a wireless charging coil for wirelessly charging the headset 10. In addition, the power management unit can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance).

[0069] The sensor 106 may include a distance sensor or a proximity light sensor for determining whether the user is wearing the headset 10. For example, the headset 10 may use the distance sensor to detect whether there is an object near the headset 10, thereby determining whether the headset 10 is worn by the user. When it is determined that the headset 10 is worn, the headset 10 may turn on the speaker.

[0070] For another example, the sensor 106 may also include a bone conduction sensor. Using this bone conduction sensor, the earphones 10 can capture vibration signals from the human vocal bones, parse the signals into voice signals, implement voice functionality, and thus receive user voice commands. The earphones 10 can also perform voice authentication based on the user voice signals captured by the bone conduction earphones, thereby verifying the user's identity in business scenarios such as payment transactions.

[0071] For another example, the sensor 106 may also include a touch sensor for detecting a user's touch operation; a fingerprint sensor for detecting a user's fingerprint and identifying the user's identity; an ambient light sensor that can adaptively adjust some parameters (such as volume) according to the brightness of the perceived ambient light; and other possible sensors.

[0072] In some embodiments, the touch sensor can detect user touch operations such as single click, double click, multiple clicks, long press, and heavy press, and can also perform user fingerprint recognition to authenticate the user's identity in business scenarios such as payment transactions.

[0073] It is understood that the components shown in FIG2 do not constitute a specific limitation on the earphone 10 , and the earphone 10 may also include more or fewer components than shown, or combine or separate certain components, or arrange the components differently.

[0074] As shown in FIG3 , the process of earphone fit detection in the prior art is as follows:

[0075] S101. Connect the earphones to the electronic device.

[0076] The user wears headphones. The user can use the headphones in binaural mode or monaural mode. In monaural mode, the user wears either the left or right earphone to listen to music or make calls. In binaural mode, the user wears both earphones to listen to music or perform other audio services. In binaural mode, the two earphones are divided into a primary earphone and a secondary earphone.

[0077] S102: The user clicks the earphone fit detection button on the electronic device.

[0078] During this time, the user cannot take off the earphones. After the user clicks the earphone fit detection button on the electronic device, the electronic device sends a fit detection command to the earphones, instructing the earphones to perform a headphone fit detection. In binaural mode, the electronic device sends the fit detection command to the primary earphone, which forwards it to the secondary earphone.

[0079] S103: The earphones are configured with earphone fit detection parameters.

[0080] Exemplarily, the earphone fit detection parameters include noise reduction parameters, etc. In binaural mode, the primary earphone and the secondary earphone are respectively configured with their own earphone fit detection parameters.

[0081] S104: After completing the configuration of the earphone fit detection parameters, the primary earphone and the secondary earphone synchronize preset audio.

[0082] S105: The earphone performs an earphone fit detection according to an earphone fit detection parameter (eg, a noise reduction parameter).

[0083] In binaural mode, the main earphone and the secondary earphone are respectively tested for earphone fit according to the earphone fit test parameters.

[0084] The basic principle of headphone fit detection is: after the speaker part of the headphone is inserted into the user's ear canal, the speaker in the headphone plays a preset audio according to the preset noise reduction parameters, and the microphone in the headphone (located outside the ear canal) collects the ambient sound (including the preset audio leaked from the gap between the ear canal and the headphone). The headphone determines the leakage value of the preset audio by analyzing the played preset audio and the received leaked preset audio. The smaller the leakage value, the closer the user's ear canal and the headphone fit.

[0085] S106: The earphone sends the detection result to the electronic device.

[0086] In binaural mode, the secondary earphone sends the detection result of the secondary earphone to the electronic device through forwarding by the primary earphone.

[0087] Therefore, if the headphones play other sounds or change the noise reduction parameters during the headphone fit test, the accuracy of the headphone fit test will be affected. The following describes the mutually exclusive scenarios of the headphone fit test with reference to Figure 4.

[0088] As shown in Figure 4, in the first scenario, assume that the headset is performing one of the following services (referred to as services mutually exclusive with headset fit detection): playing music (i.e., playing a media service), playing a long prompt tone (i.e., playing a long prompt tone service), making a call (i.e., performing a call service), waking up a voice assistant (i.e., performing a voice assistant wake-up service), etc. If the headset fit detection function is enabled at this time, the accuracy of the headset fit detection will be reduced because media services such as playing a long prompt tone will play audio, and calls and waking up a voice assistant will change the headset's noise reduction parameters due to the need to collect voice and reduce noise.

[0089] As shown in Figure 4, in the second scenario, assuming that the headset is performing a headphone fit test, if the headset starts one of the following services (hereinafter referred to as services that are mutually exclusive with the headphone fit test): playing music (i.e., playing a media service), playing a long prompt tone (i.e., playing a long prompt tone service), making a call (i.e., making a call), waking up the voice assistant (i.e., waking up the voice assistant service), etc., the accuracy of the headphone fit test will be reduced because the media service, long prompt tone service, etc., will play audio, and the call service, voice assistant service, etc. will change the noise reduction parameters of the headset due to the need to collect voice and reduce noise.

[0090] It should be noted that the long prompt tone played in this application includes but is not limited to playing incoming call prompt tone, playing outgoing call prompt tone, playing text-to-speech (TTS) audio (such as TTS audio for reporting body temperature), playing custom audio, etc.

[0091] To address the above problem, one way to deal with it is that when performing services that are mutually exclusive with headphone fit detection, the headphone application (APP) in the electronic device (such as a mobile phone) makes the decision. For example, when the music application in the electronic device controls the headphone to play music, the user operates the headphone application to perform headphone fit detection. The headphone application then controls the music application to pause music, lower the music volume, or adjust the music volume to silent. The headphone application transmits audio for headphone fit detection to the headphone. After the headphone completes the headphone fit detection, the headphone application controls the music application to resume playing music or restore the music volume to the original volume.

[0092] The above processing method has the following disadvantages:

[0093] On the one hand, for some operating systems of electronic devices, the permissions opened to headphone applications are relatively large, and music applications can be controlled in the above-mentioned manner to handle the above-mentioned mutually exclusive scenarios; while for other operating systems, the permissions opened to headphone applications are limited, and headphone applications are not supported to control music applications, and the above-mentioned mutually exclusive scenarios cannot be handled. As a result, when the same type of headphones are connected to electronic devices with different operating systems, the same mutually exclusive scenarios are handled differently, causing trouble to users.

[0094] On the other hand, as for lowering the music volume, although the music volume is lowered, it still interferes with the audio required for the headphone fit test, and there may be a problem of inaccurate test results; there may also be a problem of mixing when the music audio and the preset audio for the headphone fit test are played at the same time; pausing the music or adjusting the music volume to silent mode until the music volume headphone completes the headphone fit test, and then resuming the music to the original volume, may also cause the music to be intermittent, affecting the user experience; lowering the music volume until the music volume headphone completes the headphone fit test, and then resuming the music to the original volume may also cause the music to be loud and soft, which also affects the user experience.

[0095] In the headphone fit detection method provided in the embodiment of the present application, the headphone is used to process mutually exclusive scenarios of the headphone fit detection, lowering the priority of the headphone fit detection. When the headphone detects that the ongoing business is mutually exclusive with the headphone fit detection, the headphone fit detection is prohibited. Alternatively, when the headphone is performing headphone fit detection and also performing business that is mutually exclusive with the headphone fit detection, the headphone fit detection is interrupted. Since the headphone processes the mutually exclusive scenarios of the headphone fit detection and does not rely on the permissions opened by the operating system to the headphone application, it is compatible with multiple operating systems, thereby improving the compatibility of the headphone fit detection function. Moreover, since it will not interrupt or affect the currently being processed business that is mutually exclusive with the headphone fit detection, it will not affect the user experience.

[0096] For the first type of scenario shown in Figure 4, that is, the headset is already performing a first service (for the first service, see the description in step S201), and then the electronic device instructs the headset to perform a headset fit detection. The headset determines that the ongoing first service and the headset fit detection are mutually exclusive, then the headset prohibits the headset fit detection (that is, does not start the headset fit detection) and sends a first error indication message to the electronic device to instruct the headset to prohibit the headset fit detection. Specifically, as shown in Figure 5, the headset fit detection method includes:

[0097] S201: The electronic device sends a service start command to the headset.

[0098] A first application in the electronic device sends a service startup command to the earphone, and the earphone receives the service startup command from the first application in the electronic device. In binaural mode, the first application in the electronic device can send the service startup command to both the primary earphone and the secondary earphone, i.e., the earphone in FIG. 5 can be the primary earphone or the secondary earphone. Alternatively, as shown in S201a and S201b in FIG. 6 , in binaural mode, the first application in the electronic device sends the service startup command to the primary earphone, and the primary earphone forwards the received service startup command to the secondary earphone.

[0099] First applications refer to applications other than headset applications, such as music players, phone software, voice assistants, video software, etc. Headphone applications refer to applications used with headsets that can configure the headsets (for example, configuring headset fit test parameters (such as noise reduction parameters), performing headset fit tests, etc.) and perform online headset upgrades.

[0100] The service activation command instructs the headset to activate a first service, where the first service refers to a service that changes the headset's noise reduction parameters or a service that plays audio other than the audio required for the headset fit test. The audio required for the headset fit test refers to the preset audio mentioned above, which is pre-stored in the headset when it leaves the factory.

[0101] As mentioned above, the service of changing the noise reduction parameters of the headset may include at least one of the following services: waking up the voice assistant service, calling service, etc. The electronic device transmits the audio data of these services to the headset through a voice transmission channel. Exemplarily, the voice transmission channel may be an SCO channel. These services require voice collection and noise reduction, and therefore will change the noise reduction parameters of the headset. According to the principle of the headset fit detection mentioned above, when performing the headset fit detection, the headset will play the preset audio according to the preset headset fit detection parameters (such as noise reduction parameters), so these services will cause the accuracy of the headset fit detection to be reduced.

[0102] The services of playing audio other than the audio required for earphone fit detection may include at least one of the following services: playing media services (such as playing music), playing long prompt tone services (such as playing incoming call prompt tone, outgoing call prompt tone, TTS audio, custom audio, etc.). The electronic device transmits the audio data of these services to the earphone through the audio transmission channel. Exemplarily, the audio transmission channel may be an A2DP channel. These services will play audio other than the preset audio. According to the principle of earphone fit detection described above, when performing earphone fit detection, the earphone will play the preset audio according to the preset earphone fit detection parameters (such as noise reduction parameters). Therefore, the audio played by these services will be mixed with the preset audio, thereby reducing the accuracy of the earphone fit detection.

[0103] Specifically, the service startup command may be a state switching command for a voice transmission channel (e.g., a SCO channel). The state switching command for a voice transmission channel (e.g., a SCO channel) instructs the headset to switch the voice transmission channel (e.g., a SCO channel) from an idle state to a connected state, thereby instructing the headset to start a first service (e.g., a wake-up voice assistant service, a call service). The voice transmission channel is occupied in the connected state and is not occupied in the idle state. Alternatively, the service startup command may be a state switching command for an audio transmission channel (e.g., an A2DP channel). The state switching command for an audio transmission channel (e.g., an A2DP channel) instructs the headset to switch the audio transmission channel (e.g., an A2DP channel) from an idle state to a play state or a pause state, thereby instructing the headset to start a first service (e.g., a play media service, a play long prompt tone service). The audio transmission channel of the headset stops playing audio in the idle state, plays audio in the play state, and pauses playing audio in the pause state. The audio transmission channel is occupied in the play state or the pause state, and is not occupied in the idle state.

[0104] Taking the electronic device as a mobile phone as an example, the triggering conditions for the electronic device to send a service start command to the headset include but are not limited to: for example, as shown in A in Figure 7, the user clicks the music play button S in the music player (i.e., the first application mentioned above), which will trigger the music player to play music through the headset (i.e., trigger the media playback service); the user triggers the headset to play the temperature measurement TTS audio through the temperature measurement application in the electronic device (i.e., trigger the long prompt tone playback service); the user clicks the dial button to make a call, which will trigger the headset to play the outgoing call prompt tone (i.e., trigger the long prompt tone playback service); the electronic device is called, which will trigger the headset to play the incoming call prompt tone (i.e., trigger the long prompt tone playback service); the user clicks the answer button to make a call, which will trigger the headset to transmit voice (i.e., trigger the call service); the user speaks a keyword to the electronic device to wake up the voice assistant, which will trigger the headset to transmit voice assistant-related audio to the electronic device (i.e., trigger the voice assistant wake-up service), etc.

[0105] S202: The headset starts the first service.

[0106] As shown in S202a and S202b in Figure 6, in binaural mode, the primary earphone and the secondary earphone each activate the first service. Specifically, the primary earphone and the secondary earphone pass the service activation command received by the Bluetooth driver layer to their respective application layers, which then activate the first service. The earphone's Bluetooth driver layer is used to implement Bluetooth communication between the earphone and the electronic device, such as transmitting commands, audio data, and voice data; the application layer is used to activate the first service and perform earphone fit detection.

[0107] Assuming that the service startup command is a state switching command of a voice transmission channel (such as a SCO channel), the state switching command of the voice transmission channel (such as a SCO channel) instructs the headset to switch the voice transmission channel (such as a SCO channel) from an idle state to a connected state. Then, the application layer of the headset switches the voice transmission channel (such as a SCO channel) from an idle state to a connected state, and starts the first service. For example, for starting a wake-up voice assistant service or a call service, the speaker in the headset plays audio from the electronic device and sends the ambient sound collected by the microphone to the electronic device.

[0108] Alternatively, assuming that the service startup command is a state switching command of an audio transmission channel (e.g., an A2DP channel), and the state switching command of the audio transmission channel (e.g., an A2DP channel) instructs the headset to switch the audio transmission channel (e.g., an A2DP channel) from an idle state to a play state or a pause state, the application layer of the headset switches the audio transmission channel (e.g., an A2DP channel) from an idle state to a play state or a pause state, and starts the first service. For example, for starting a media playback service or a long prompt tone playback service, the speaker in the headset plays audio from the electronic device.

[0109] After the headset activates the first service, it can send a startup indication message to the first application in the electronic device to indicate that the first service has been activated. At this point, the first application can display a prompt message to inform the user that the headset is currently running the first service. For example, as shown in FIG7B , the music player in the electronic device can display the interface "Playing XXXXX" to prompt the user that music is playing through the headset.

[0110] S203: The electronic device sends a fit detection command to the earphone.

[0111] The headphone application in the electronic device sends a fit detection command to the headphone, and accordingly, the headphone receives the fit detection command from the headphone application in the electronic device. In binaural mode, the headphone application in the electronic device can send fit detection commands to the primary headphone and the secondary headphone respectively, that is, the headphone in Figure 5 can be the primary headphone or the secondary headphone; or, as shown in S203a and S203b in Figure 6, in binaural mode, the headphone application in the electronic device sends a fit detection command to the primary headphone, and the primary headphone forwards the received fit detection command to the secondary headphone. The fit detection command is used to instruct the headphone to perform a headphone fit detection.

[0112] Exemplarily, as shown in A of FIG8 , taking the electronic device as a mobile phone as an example, the triggering conditions for the electronic device to send a fit detection command to the earphone may include but are not limited to: the earphone application in the electronic device displays the "earphone fit detection" interface, and the user clicks the earphone fit detection button T. As shown in B of FIG8 , in a non-mutually exclusive scenario, during the earphone fit detection process, the earphone application in the electronic device displays "Earphone fit detection in progress, please wait...", and if the user clicks the earphone fit detection button T at this time, the earphone fit detection can be stopped. After completing the earphone fit detection, the earphone can send the detection result to the earphone application in the electronic device to indicate that the earphone fit detection and the fit of each earphone have been completed. At this time, the earphone application can display a prompt message to indicate that the user has completed the earphone fit detection and the fit of each earphone. For example, as shown in C in Figure 8, after the earphones complete the earphone fit test, if the fit of a certain earphone is good, the earphone application in the electronic device can display "Good fit" (for example, the right earphone R in Figure 8); if the fit of a certain earphone is poor, the earphone application in the electronic device can display "Please readjust" (for example, the left earphone L in Figure 8); if the user readjusts the earphones, he can click the earphone fit test button T to re-perform the earphone fit test.

[0113] For example, as shown in A in Figure 9, in a mutually exclusive scenario, assume that the music player in the electronic device is playing music through headphones. At this time, as shown in B in Figure 9, the user switches to the headphone application, and the user clicks the headphone fit detection button T, then the electronic device sends a fit detection command to the headphones.

[0114] S204: The headset determines whether the ongoing first service and the headset fit detection are mutually exclusive.

[0115] In other words, the headset determines whether a service that is mutually exclusive with the headset fit detection is in progress. As shown in S204a and S204b in Figure 6, in binaural mode, both the primary headset and the secondary headset need to determine whether the first service they are currently performing is mutually exclusive with the headset fit detection. Specifically, the primary headset and the secondary headset pass the fit detection command received by the Bluetooth driver layer to their respective application layers, which then determine whether the first service being performed is mutually exclusive with the headset fit detection.

[0116] The headset application layer can determine that the ongoing first service (such as waking up the voice assistant service or calling service) and the headset fit detection are mutually exclusive by determining that the headset's voice transmission channel (such as the SCO channel) is in a connected state. Alternatively, the headset application layer can determine that the ongoing first service (such as playing media service or playing a long prompt tone service) and the headset fit detection are mutually exclusive by determining that the headset's audio transmission channel (such as the A2DP channel) is in a playing state or a paused state.

[0117] When the headset's voice transmission channel is in the connected state, it indicates that the electronic device is transmitting audio data for a call service or waking up a voice assistant service to the headset through the headset's voice transmission channel. When the headset's audio transmission channel is in the playing state or paused state, it indicates that the electronic device is transmitting audio data for a media playback service or a long reminder tone service to the headset through the headset's audio transmission channel.

[0118] The application layer of the headset can determine that the ongoing first service and the headset fit detection are not mutually exclusive by determining that the voice transmission channel of the headset (such as the SCO channel) is in a disconnected state and the audio transmission channel of the headset (such as the A2DP channel) is in an idle state.

[0119] S205: If the headset determines that the ongoing first service and the headset fit detection are mutually exclusive, the headset fit detection is prohibited.

[0120] As shown in S205a and S205b in Figure 6, in binaural mode, both the primary and secondary earphones need to disable themselves from performing earphone fit detection. At this time, the earphones will not play preset audio through the speakers, will not receive audio through the microphones, and will not perform earphone fit detection through the processor.

[0121] S206: The headset sends first error indication information to the electronic device.

[0122] The headset sends first error indication information to a headset application in the electronic device, and accordingly, the headset application in the electronic device receives the first error indication information from the headset. In binaural mode, the primary headset and the secondary headset can each send their own first error indication information to the electronic device, i.e., the headset in Figure 5 can be the primary headset or the secondary headset; or, as shown in S206a and S206b in Figure 6, in binaural mode, the secondary headset sends the secondary headset's first error indication information to the electronic device via the primary headset, i.e., the secondary headset sends the secondary headset's first error indication information to the primary headset, and the primary headset sends the primary headset's first error indication information and the secondary headset's first error indication information to the headset application in the electronic device. The primary headset's first error indication information and the secondary headset's first error indication information can be included in the same message or in different messages.

[0123] The first error indication information is used to instruct the headset to prohibit the headset fit test. The first error indication information of the master headset is used to instruct the master headset to prohibit the headset fit test, and the first error indication information of the slave headset is used to instruct the slave headset to prohibit the headset fit test. The first error indication information can be in the form of an error code, and the error codes used for the first error indication information of the master headset and the first error indication information of the slave headset are different. For example, the first error indication information of the master headset can be represented by the binary number 00, and the first error indication information of the slave headset can be represented by the binary number 01.

[0124] S207: The electronic device displays a first prompt message.

[0125] After the electronic device receives the first error indication information from the earphone, it can display the first prompt information on the display screen. In binaural mode, the electronic device can display the first prompt information on the display screen as long as it receives at least one of the first error indication information of the main earphone or the first error indication information of the auxiliary earphone. The first prompt information is used to remind the user that the earphone fit detection can only be started after the ongoing first service that is mutually exclusive with the earphone fit detection is stopped. For example, as shown in C in Figure 9, the earphone application of the electronic device can display "Unable to perform earphone fit detection, the current earphone is occupied" to remind the user that if the earphone fit detection is to be performed, it is necessary to stop the ongoing first service that is mutually exclusive with the earphone fit detection to avoid reducing the accuracy of the earphone fit detection.

[0126] In the above-mentioned earphone fit detection method provided in the embodiment of the present application, the earphone is already performing a first service, and the first service can change the noise reduction parameters of the earphone, or play other audio besides the audio required for the earphone fit detection, which will cause the accuracy of the earphone fit detection to be reduced. At this time, if the earphone receives a fit detection command (the fit detection command is used to instruct the earphone to perform the earphone fit detection), the earphone prohibits the earphone fit detection (that is, the earphone fit detection is not started). Therefore, the earphone executes the control logic to avoid conflicts with the first service by lowering the priority of the earphone fit detection, and does not rely on the permissions opened to the earphone application by the operating system in the electronic device. For electronic devices using different operating systems, the earphone handles mutually exclusive scenarios in a consistent manner, thereby improving the compatibility of the earphone fit detection. Optionally, the earphone can also send a first error indication message to the electronic device to instruct the earphone to prohibit the earphone fit detection, so that the electronic device can remind the user.

[0127] For the second scenario shown in FIG4 , that is, the earphone is already performing earphone fit detection, and then the electronic device instructs the earphone to perform a first service that is mutually exclusive with the earphone fit detection, the earphone interrupts the earphone fit detection and sends a second error indication message to the electronic device to instruct the interruption of the earphone fit detection. Specifically, as shown in FIG10 , the earphone fit detection method includes:

[0128] S301: The electronic device sends a fit detection command to the earphone.

[0129] The headphone application in the electronic device sends a fit detection command to the headphone, and accordingly, the headphone receives the fit detection command from the headphone application in the electronic device. In binaural mode, the headphone application in the electronic device can send fit detection commands to the primary headphone and the secondary headphone respectively, that is, the headphone in Figure 10 can be the primary headphone or the secondary headphone; or, as shown in S301a and S301b in Figure 11, in binaural mode, the headphone application in the electronic device sends a fit detection command to the primary headphone, and the primary headphone forwards the received fit detection command to the secondary headphone.

[0130] As shown in A in FIG12 , the earphone application in the electronic device displays the “earphone fit detection” interface. The user clicks the earphone fit detection button T, and the earphone application in the electronic device sends a fit detection command to the earphone.

[0131] The rest of the contents of step S301 refer to step S203 and will not be repeated here.

[0132] S302: The headset determines whether a first service that is mutually exclusive with the headset fit detection is being performed.

[0133] As shown in S302a and S302b in Figure 11, in binaural mode, both the primary and secondary earphones need to determine whether they are performing a first service that is mutually exclusive with the earphone fit detection. Specifically, the primary and secondary earphones pass the fit detection command received by the Bluetooth driver layer to their respective application layers, which then determine whether the first service, which is mutually exclusive with the earphone fit detection, is being performed.

[0134] Regarding the first business, please refer to step S201 and will not be repeated here.

[0135] The application layer of the headset can determine that the first service that is mutually exclusive with the headset fit detection (such as the wake-up voice assistant service and the call service) is in progress by determining that the headset's voice transmission channel (such as the SCO channel) is in a connected state. Alternatively, the application layer of the headset can determine that the first service that is mutually exclusive with the headset fit detection (such as the media playback service and the long prompt tone playback service) is in progress by determining that the headset's audio transmission channel (such as the A2DP channel) is in a playing state or a paused state.

[0136] When the headset's voice transmission channel is connected, it indicates that the electronic device is transmitting audio data for a call or waking up a voice assistant. When the headset's audio transmission channel is in play or pause mode, it indicates that the electronic device is transmitting audio data for media playback or long tone playback. Both of these conditions can reduce the accuracy of headset fit detection.

[0137] The application layer of the headset can determine that the headset is not performing the first service that is mutually exclusive with the headset fit detection by determining that the voice transmission channel of the headset (such as the SCO channel) is in a disconnected state and the audio transmission channel of the headset (such as the A2DP channel) is in an idle state.

[0138] When the headset's voice transmission channel is disconnected, it indicates that the electronic device is not transmitting audio data for call services or waking up the voice assistant service to the headset through the headset's voice transmission channel. When the headset's audio transmission channel is idle, it indicates that the electronic device is not transmitting audio data for playing media services or playing long prompt tones to the headset through the headset's audio transmission channel. Therefore, the accuracy of the headset fit detection will not be reduced.

[0139] S303: If the headset determines that the first service that is mutually exclusive with the headset fit detection is not being performed, the headset fit detection is started.

[0140] As shown in S303a and S303b in FIG11 , in binaural mode, the primary earphone and the secondary earphone each determine that they are not performing a first service that is mutually exclusive with the earphone fit detection, and start the earphone fit detection.

[0141] As mentioned above, during the headphone fit detection process, the speaker in the headphone plays a preset audio according to the preset headphone fit detection parameters (such as noise reduction parameters), and the microphone in the headphone (located outside the ear canal) collects the ambient sound (including the preset audio leaked from the gap between the ear canal and the headphone). The headphone determines the leakage value of the preset audio by analyzing the played preset audio and the received leaked preset audio. The smaller the leakage value, the more closely the user's ear canal and the headphone fit.

[0142] For example, as shown in B in FIG12 , during the earphone fit detection process, the earphone application in the electronic device displays “Earphone fit detection in progress, please wait…”. If the user clicks the earphone fit detection button T at this time, the earphone fit detection can be stopped.

[0143] S304: The electronic device sends a service start command to the headset.

[0144] A first application in the electronic device sends a service startup command to the earphone, and the earphone receives the service startup command from the electronic device. In binaural mode, the first application in the electronic device can send a service startup command to both the primary earphone and the secondary earphone, i.e., the earphone in FIG10 can be the primary earphone or the secondary earphone. Alternatively, as shown in S304a and S304b in FIG11 , in binaural mode, the first application in the electronic device sends a service startup command to the primary earphone, and the primary earphone forwards the received service startup command to the secondary earphone.

[0145] Among them, the service start command is used to instruct the headset to start the first service. The service start command can be a state switching command of a voice transmission channel (such as a SCO channel). The state switching command of a voice transmission channel (such as a SCO channel) instructs the headset to switch the voice transmission channel (such as a SCO channel) from an idle state to a connected state, thereby instructing the headset to start the first service (such as a wake-up voice assistant service, a call service). Alternatively, the service start command can be a state switching command of an audio transmission channel (such as an A2DP channel). The state switching command of an audio transmission channel (such as an A2DP channel) instructs the headset to switch the audio transmission channel (such as an A2DP channel) from an idle state to a play state or a pause state, thereby instructing the headset to start the first service (such as a play media service, a play long prompt tone service).

[0146] For example, as shown in B and C in Figure 12, assuming that during the earphone fit detection process, the user switches to the music player (i.e., the first application mentioned above) and clicks the play button S, the music player sends a service start command to the earphone to instruct the earphone to play music.

[0147] The rest of the contents of step S304 refer to step S201 and are not repeated here.

[0148] S305: Before completing the earphone fit test, if the earphone receives a service start command from the electronic device, the earphone fit test is interrupted and the first service is started.

[0149] As shown in S305a and S305b in Figure 11, in binaural mode, the primary earphone and the secondary earphone each interrupt the earphone fit detection and start a first service that is mutually exclusive with the earphone fit detection. Specifically, the primary earphone and the secondary earphone pass the service start command received by the Bluetooth driver layer to their respective application layers, which interrupt the earphone fit detection and start the first service that is mutually exclusive with the earphone fit detection.

[0150] Before the headset completes the headphone fit test, it may mean that the headset is playing the preset audio through the speaker, playing the preset audio through the speaker, and performing the headphone fit test through the processor. The headset interrupting the headphone fit test may mean that the headset stops playing the preset audio through the speaker, stops receiving sound through the microphone, and stops performing the headphone fit test through the processor.

[0151] After the headset activates the first service, it can send a startup indication message to the first application in the electronic device to indicate that the first service has been activated. At this point, the first application can display a prompt message to inform the user that the headset is currently running the first service. For example, as shown in Figure 12D, the music player in the electronic device can display the interface "Playing XXXXX" to prompt the user that music is playing through the headset.

[0152] The rest of the contents of step S305 refer to step S202 and will not be repeated here.

[0153] S306: The headset sends second error indication information to the electronic device.

[0154] The headset sends second error indication information to a headset application in the electronic device, and accordingly, the headset application in the electronic device receives the second error indication information from the headset. In binaural mode, the primary headset and the secondary headset can each send their own second error indication information to the headset application in the electronic device, i.e., the headset in Figure 10 can be the primary headset or the secondary headset. Alternatively, as shown in S306a and S306b in Figure 11, in binaural mode, the secondary headset sends the secondary headset's second error indication information to the electronic device via the primary headset, i.e., the secondary headset sends the secondary headset's second error indication information to the primary headset, and the primary headset sends the primary headset's second error indication information and the secondary headset's second error indication information to the headset application in the electronic device. The primary headset's second error indication information and the secondary headset's second error indication information can be included in the same message or in different messages.

[0155] The second error indication information is used to instruct the earphone to interrupt the earphone fit test. The second error indication information of the primary earphone is used to instruct the primary earphone to interrupt the earphone fit test, and the second error indication information of the secondary earphone is used to instruct the secondary earphone to interrupt the earphone fit test. The second error indication information can be in the form of an error code, and the second error indication information of the primary earphone and the second error indication information of the secondary earphone use different error codes. For example, the second error indication information of the primary earphone can be represented by the binary number 10, and the second error indication information of the secondary earphone can be represented by the binary number 11.

[0156] S307: The electronic device displays a second prompt message.

[0157] After the electronic device receives the second error indication information from the earphone, it can display the second prompt information on the display screen. In binaural mode, as long as the electronic device receives at least one of the second error indication information of the main earphone and the second error indication information of the auxiliary earphone, it can display the second prompt information on the display screen. The second prompt information is used to prompt the user that the earphone has interrupted the earphone fit detection. For example, as shown in E in Figure 12, if the user switches back to the earphone application from the music player, the earphone application of the electronic device can display "The earphone fit detection has been interrupted and the current earphone is occupied" to prompt the user that the earphone has interrupted the earphone fit detection due to the ongoing first business.

[0158] The above-mentioned earphone fit detection method provided in the embodiment of the present application, when the earphone is already performing the earphone fit detection, if a command is received to instruct the earphone to perform a first service that is mutually exclusive with the earphone fit detection, the earphone interrupts the earphone fit detection. The first service that is mutually exclusive with the earphone fit detection may change the noise reduction parameters of the earphone, or play audio other than the audio required for the earphone fit detection, resulting in a reduction in the accuracy of the earphone fit detection. Therefore, the earphone executes the control logic to avoid conflicts with the first service by lowering the priority of the earphone fit detection, and does not rely on the permissions opened to the earphone application by the operating system in the electronic device. For electronic devices using different operating systems, the earphone handles mutually exclusive scenarios in a consistent manner, thereby improving the compatibility of the earphone fit detection. Optionally, the earphone can also send a second error indication message to the electronic device to instruct the earphone to interrupt the earphone fit detection, so that the electronic device can remind the user.

[0159] As shown in Figure 13, an embodiment of the present application also provides a chip system. The chip system 60 includes at least one processor 601 and at least one interface circuit 602. The at least one processor 601 and the at least one interface circuit 602 can be interconnected via lines. The processor 601 is used to support the headset to implement the various steps in the above method embodiments, such as the methods shown in Figures 5, 6, 10, and 11. The at least one interface circuit 602 can be used to receive signals from other devices (such as a memory) or send signals to other devices (such as a communication interface). The chip system may include a chip and may also include other discrete devices.

[0160] An embodiment of the present application also provides a computer-readable storage medium, which includes instructions. When the instructions are executed on the above-mentioned earphones, the earphones execute the various steps in the above-mentioned method embodiments, such as executing the methods shown in Figures 5, 6, 10, and 11.

[0161] An embodiment of the present application also provides a computer program product including instructions. When the instructions are run on the above-mentioned headset, the headset executes the various steps in the above-mentioned method embodiment, for example, executes the methods shown in Figures 5, 6, 10, and 11.

[0162] Regarding the technical effects of the chip system, computer-readable storage medium, and computer program product, refer to the technical effects of the previous method embodiments.

[0163] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0164] Those skilled in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0165] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and modules described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0166] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is merely a logical function division. In actual implementation, there may be other division methods, such as multiple modules or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0167] The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, that is, they may be located on a single device or distributed across multiple devices. Some or all of the modules may be selected to achieve the purpose of this embodiment based on actual needs.

[0168] In addition, the functional modules in the various embodiments of the present application may be integrated into one device, or each module may exist physically separately, or two or more modules may be integrated into one device.

[0169] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented using a software program, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more media integrated therein. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).

[0170] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A method for detecting earphone fit, characterized in that: Applied to headphones, the method includes: Receiving a service start command from an electronic device, the service start command being used to instruct the headset to start a first service, where the first service is a service for changing a noise reduction parameter of the headset, or a service for playing other audio other than audio required for headset fit detection; Starting the first service; receiving a fit detection command from the electronic device, wherein the fit detection command is used to instruct the headset to perform a headset fit detection; If it is determined that the ongoing first service and the earphone fit detection are mutually exclusive, the earphone fit detection is prohibited.

2. The method according to claim 1, characterized in that The first service includes at least one of the following services: a media playback service, a call service, a long prompt tone playback service, and a voice assistant wake-up service.

3. The method according to claim 2, characterized in that The first service is a call service or a voice assistant wake-up service, and determining that the ongoing first service is mutually exclusive with the earphone fit detection includes: Determine whether the voice transmission channel of the headset is in a connected state.

4. The method according to claim 3, characterized in that The voice transmission channel is a synchronous connection (SCO) channel.

5. The method according to claim 2, characterized in that The first service is a media playback service or a long prompt tone playback service, and determining that the ongoing first service is mutually exclusive with the earphone fit detection includes: Determine whether the audio transmission channel of the headset is in a playing state or a paused state.

6. The method according to claim 5, characterized in that The audio transmission channel is an Advanced Audio Distribution Profile A2DP channel.

7. The method according to any one of claims 1 to 6, characterized in that After determining that the ongoing first service and the earphone fit detection are mutually exclusive, the method further includes: First error indication information is sent to the electronic device, where the first error indication information is used to instruct the earphone to prohibit earphone fit detection.

8. A method for detecting earphone fit, characterized in that: Applied to headphones, the method includes: receiving a fit detection command from an electronic device, wherein the fit detection command is used to instruct the headset to perform a headset fit detection; If it is determined that a first service mutually exclusive with the headphone fit test is not in progress, initiating the headphone fit test, the first service being a service of changing noise reduction parameters of the headphone or a service of playing audio other than audio required for the headphone fit test; Before completing the earphone fit detection, if a service start command is received from the electronic device, the earphone fit detection is interrupted and the first service is started, where the service start command is used to instruct the earphone to start the first service.

9. The method according to claim 8, characterized in that The first service includes at least one of the following services: a media playback service, a call service, a long prompt tone playback service, and a voice assistant wake-up service.

10. The method according to claim 9, characterized in that The first service is a call service or a voice assistant wake-up service, and determining that the first service that is mutually exclusive with the earphone fit detection is not being performed includes: It is determined that the voice transmission channel of the headset is in a disconnected state, and it is determined that the audio transmission channel of the headset is in an idle state.

11. The method according to claim 10, characterized in that The voice transmission channel is a synchronous connection (SCO) channel.

12. The method according to claim 10, characterized in that The audio transmission channel is an Advanced Audio Distribution Profile A2DP channel.

13. The method according to any one of claims 9 to 12, characterized in that: The first service is a media playback service or a long prompt tone playback service, and the service startup command is a state switching command of an audio transmission channel, which is used to instruct the headset to switch the audio transmission channel from an idle state to a playback state or a pause state.

14. The method according to any one of claims 9 to 12, characterized in that: The first service is a call service or a wake-up voice assistant service, and the service startup command is a state switching command of the voice transmission channel, which is used to instruct the headset to switch the voice transmission channel from an idle state to a connected state.

15. The method according to any one of claims 8 to 14, characterized in that: After receiving the service start command from the electronic device, the method further includes: Second error indication information is sent to the electronic device, where the second error indication information is used to instruct the earphone to interrupt the earphone fit detection.

16. A headset, characterized in that: The method comprises a processor and a memory, wherein the memory stores instructions, and when the processor executes the instructions, the method according to any one of claims 1 to 15 is performed.

17. A computer-readable storage medium, characterized in that The method comprises instructions, which, when executed on an earphone, cause the earphone to execute the method according to any one of claims 1 to 15.