Earphone exception processing method and device, earphone, electronic equipment and storage medium
By identifying abnormal units in TWS earphones and implementing corresponding processing strategies, the problem of users passively accepting function failures has been solved, achieving seamless replacement of earphone functions and continuity of audio experience, and improving the robustness and reliability of earphones.
Patent Information
- Application Number
- CN202511900348.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-16
- Publication Date
- 2026-04-03
AI Technical Summary
In existing technologies, when TWS earphones malfunction, users can only passively accept that the function fails or is interrupted, affecting the audio interaction experience.
By identifying abnormal units based on the original ultrasonic signals and the reflected signals collected by the headphone microphone, abnormal handling strategies are executed, such as enabling equivalent functional units or disabling abnormal units, to achieve seamless functional replacement.
Actively detect headphone malfunctions, improve fault response speed, ensure audio function continuity and headphone availability, enhance robustness, and improve user experience.
Smart Images

Figure CN121792933A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of audio equipment technology, and in particular to a method, apparatus, earphone, electronic device, and storage medium for handling headphone malfunctions. Background Technology
[0002] With the rapid development of wireless technology, Bluetooth earphones, especially true wireless stereo (TWS) earphones, have become essential accessories for daily listening and calls due to their portability and wireless experience. However, because TWS earphones have a highly integrated internal structure, key hardware components such as noise cancellation modules, microphones, and speakers are compactly arranged in a limited space. Over time, earphones inevitably encounter situations such as drops, moisture, or dust blockage. These factors can easily lead to hardware performance degradation or even failure, such as decreased microphone sensitivity, speaker distortion, and weakened noise cancellation.
[0003] Currently, in related technologies, when a component in the headphones malfunctions, users can only passively accept the failure or interruption of use, affecting the audio interaction experience. Summary of the Invention
[0004] To overcome the problems existing in related technologies, the present invention provides a headphone malfunction handling method, device, headphone, electronic device and storage medium to solve the problem that users can only passively accept function failure or interruption, which affects the audio interaction experience.
[0005] In a first aspect, the present invention provides a method for handling headphone malfunctions, the method comprising: Based on the original ultrasonic signal and the reflected signal collected by the first microphone in the earphone, the abnormal unit in the earphone is determined, or the unit indicated by the abnormal unit indication information sent by the earphone is determined as the abnormal unit. Based on the abnormal unit, execute the abnormal handling strategy corresponding to the abnormal unit; the abnormal handling strategy includes activating an equivalent functional unit in the electronic device that has the same function as the abnormal unit and / or controlling the earphone to disable the abnormal unit.
[0006] Secondly, the present invention provides another headphone malfunction handling method, applied to headphones, the method comprising: The test audio signal is acquired based on the ambient audio signal collected by the microphone under test in the earphone, and the test audio signal is acquired based on the microphone under test corresponding to the test audio played by the speaker in the earphone; the microphone under test includes a first microphone and a second microphone; For any of the microphones to be tested, the response difference of the microphone to be tested is calculated based on the ambient audio signal corresponding to the microphone to be tested and the test audio signal. Based on the test audio signal corresponding to the microphone under test and the test audio signals corresponding to other microphones under test, calculate the consistency difference degree corresponding to the microphone under test; Based on the response difference degree and the consistency difference degree, abnormal unit indication information is determined and sent to the electronic device.
[0007] Thirdly, the present invention provides an earphone malfunction handling device, applied to an electronic device, the device comprising: The first determining module is used to determine the abnormal unit in the earphone based on the original ultrasonic signal and the reflected signal collected by the first microphone in the earphone, or to determine the unit indicated by the abnormal unit indication information sent by the earphone as the abnormal unit. The first execution module is configured to execute the exception handling strategy corresponding to the exception unit according to the exception unit; the exception handling strategy includes activating an equivalent functional unit in the electronic device that has the same function as the exception unit and / or controlling the earphone to disable the exception unit.
[0008] Fourthly, the present invention provides an earphone, the earphone comprising: The first acquisition module is used to acquire ambient audio signals based on the microphone to be tested in the earphone, and to acquire test audio signals corresponding to the test audio played by the speaker in the earphone based on the microphone to be tested; the microphone to be tested includes a first microphone and a second microphone; The first calculation module is used to calculate the response difference degree of any microphone to be tested based on the ambient audio signal corresponding to the microphone to be tested and the test audio signal. The second calculation module is used to calculate the consistency difference degree of the microphone under test based on the test audio signal corresponding to the microphone under test and the test audio signals corresponding to other microphones under test. The fifth determining module is used to determine abnormal unit indication information based on the response difference degree and the consistency difference degree, and send the abnormal unit indication information to the electronic device.
[0009] Fifthly, the present invention provides an electronic device comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the headphone malfunction handling method described in any one of the first aspects above.
[0010] In a sixth aspect, the present invention provides a readable storage medium that, when the instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform the steps of the headphone malfunction handling method as described in any of the embodiments of the first aspect above.
[0011] In this embodiment of the invention, based on the original ultrasonic signal and the reflected signal collected by the first microphone in the earphone, an abnormal unit in the earphone is determined, or the unit indicated by the abnormal unit indication information sent by the earphone is determined as an abnormal unit. According to the abnormal unit, an abnormal handling strategy corresponding to the abnormal unit is executed. The abnormal handling strategy includes activating an equivalent functional unit in the electronic device that has the same function as the abnormal unit and / or controlling the earphone to disable the abnormal unit. In this way, through the collaboration of the electronic device and the earphone, the abnormal unit in the earphone is proactively detected and identified, avoiding the user passively discovering the earphone malfunction and improving the fault response speed. Furthermore, according to the abnormal unit, the corresponding handling strategy is executed, such as activating an equivalent functional unit or disabling the abnormal unit, to achieve seamless equivalent replacement of functions. While maintaining the continuity of audio functions, the availability of the earphone is maximized, enhancing the robustness of earphone use and ensuring the audio interaction experience. Attached Figure Description
[0012] Figure 1 This is a flowchart of the steps of a headphone malfunction handling method provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the audio hardware of an earphone provided in an embodiment of the present invention; Figure 3 This is a flowchart illustrating the specific steps of a headphone malfunction handling method provided in an embodiment of the present invention; Figure 4 This is a flowchart of another headphone malfunction handling method provided in an embodiment of the present invention; Figure 5 This is an interactive schematic diagram of an earphone detection method provided in an embodiment of the present invention; Figure 6 This is an interactive schematic diagram of another headphone detection method provided in an embodiment of the present invention; Figure 7 This is a structural diagram of an earphone malfunction handling device provided in an embodiment of the present invention; Figure 8 This is a structural diagram of an earphone provided in an embodiment of the present invention; Figure 9 This is a structural diagram of an electronic device provided in an embodiment of the present invention; Figure 10 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0013] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0014] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0015] The headphone malfunction handling method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0016] Figure 1 This is a flowchart of the steps of a headphone malfunction handling method provided in an embodiment of the present invention, which is applied to electronic devices.
[0017] like Figure 1 As shown, the method may include: Step 101: Based on the original ultrasonic signal and the reflected signal collected by the first microphone in the earphone, determine the abnormal unit in the earphone, or determine the unit indicated by the abnormal unit indication information sent by the earphone as the abnormal unit.
[0018] In this embodiment of the invention, the original ultrasonic signal is an ultrasonic signal with a specific frequency range emitted by an electronic device. This signal serves as a reference signal for detection, and its frequency, waveform, and other parameters can be preset according to actual detection requirements. For example, the original ultrasonic signal can be a linear frequency modulated pulse: a pulse signal whose frequency changes linearly with time, which has good time resolution and anti-dispersion capability; or a Barker code modulated pulse: formed by modulating a carrier based on a code with good autocorrelation characteristics (such as Barker code), which can effectively suppress noise and improve detection accuracy through correlation reception; or a single-frequency short pulse: a short sine wave pulse of a specific frequency, which is easy to generate and analyze.
[0019] Electronic devices can refer to external devices with signal transmission and processing capabilities that can establish a communication connection (such as a Bluetooth connection) with headphones, such as smartphones and tablets. Electronic devices may include a detection and control module and an audio routing switching module. The detection and control module is used to send the original ultrasonic signal to the headphones and receive the reflected signal sent by the headphones' first microphone, and based on the original ultrasonic signal and the reflected signal, determine the abnormal unit in the headphones. The audio routing switching module is used to adjust and execute the corresponding audio routing strategy according to the abnormal unit in the headphones. The reflected signal is received when the original ultrasonic signal is played by the speaker in the headphones. That is, the reflected signal can be the original ultrasonic signal sent to the headphones by the electronic device, played by the speaker in the headphones, and reflected during propagation when it encounters the internal structure of the headphones (such as the shell, hardware units, etc.) or the external environment (such as the ear canal wall), and finally collected by the first microphone in the headphones.
[0020] The electronic device analyzes the raw ultrasonic signal it transmits and the reflected signal received from the first microphone in the earphone to identify abnormal units within the earphone. For example, the presence, location, and type of abnormal units inside the earphone can be determined by comparing the characteristic parameters of both signals (such as signal strength).
[0021] The anomaly unit in the headset may include a first microphone, a second microphone, an anomaly detection module, and a speaker. The first microphone can be a sound-picking sensor, such as a microphone used for capturing audio during calls or voice commands. Figure 2 The first microphone is the talk microphone. The second microphone can be another sound sensor, such as a noise-canceling microphone that can collect ambient noise to cancel out noise within the headset. Figure 2 The headphones feature a feedforward microphone (FFMIC) and a feedback microphone (FBMIC). Specifically, the feedforward microphone picks up external noise, while the feedback microphone picks up noise within the ear canal. The speaker, as the sound-producing component of the headphones, converts electrical signals into sound. An anomaly detection module identifies abnormal units in the headphones based on the ambient audio signal collected by the microphone under test and the test audio signal.
[0022] Furthermore, anomaly detection can be implemented within the headphones themselves. When the headphones are idle or during each connection establishment, they can automatically enter a low-power detection mode to reduce power consumption during the detection process. The headphones are detected by collecting ambient audio signals and test audio signals. The microphone under test in the headphones can record ambient sound, using the current ambient noise as a baseline to obtain an ambient audio signal. A specified test audio is played through the speaker, and the corresponding audio signal is collected by the microphone under test to obtain the test audio signal. The microphone under test can include a first microphone and a second microphone. That is, for either the first or second microphone, it can be determined whether it is an abnormal unit based on the collected ambient audio signal and test audio signal. The headphones perform multi-dimensional feature extraction and difference calculation based on the ambient audio signal and test audio signal to determine the health probability values of the microphone under test and the speaker. Based on the health probability values, abnormal units in the headphones can be identified, and abnormal unit indication information can be determined and sent to the electronic device. The abnormal unit indication information can be determined based on the ambient audio signal and test audio signal collected by the microphone under test in the headphones, which includes a first microphone and a second microphone.
[0023] Step 102: Execute the exception handling strategy corresponding to the exception unit according to the exception unit; the exception handling strategy includes activating an equivalent functional unit in the electronic device that has the same function as the exception unit and / or controlling the earphone to disable the exception unit.
[0024] In this embodiment of the invention, when an electronic device identifies an abnormal unit based on the original ultrasonic signal and the reflected signal, the electronic device can directly execute the abnormal handling strategy corresponding to the abnormal unit to adjust the audio routing strategy of the electronic device. After the headphones determine the abnormal unit based on the ambient audio signal and the test audio signal, the headphones can directly send the abnormal unit indication information corresponding to the abnormal unit to the electronic device. After receiving the abnormal unit indication information, the electronic device executes the abnormal handling strategy corresponding to the abnormal unit according to the unit indicated by the abnormal unit indication information to adjust the audio routing strategy. The abnormal handling strategy may include activating an equivalent functional unit in the electronic device that has the same function as the abnormal unit and / or controlling the headphones to disable the abnormal unit. When the abnormal unit is a first microphone, the equivalent functional unit with the same function as the abnormal unit can be the built-in microphone of the electronic device; when the abnormal unit is a speaker in the headphones, the equivalent functional unit with the same function as the abnormal unit can be the built-in audio peripheral unit of the electronic device. Simultaneously, the electronic device can also prompt the user through pop-up windows or other means that the equivalent functional unit in the electronic device with the same function as the abnormal unit has been activated and / or the headphones have been controlled to disable the abnormal unit.
[0025] In summary, in this embodiment of the invention, based on the original ultrasonic signal and the reflected signal collected by the first microphone in the earphone, an abnormal unit in the earphone is determined, or the unit indicated by the abnormal unit indication information sent by the earphone is determined as an abnormal unit. According to the abnormal unit, an abnormal handling strategy corresponding to the abnormal unit is executed. The abnormal handling strategy includes activating an equivalent functional unit in the electronic device that has the same function as the abnormal unit and / or controlling the earphone to disable the abnormal unit. In this way, through the collaboration of the electronic device and the earphone, abnormal units in the earphone are proactively detected and identified, avoiding passive discovery of earphone malfunction by the user and improving fault response speed. Furthermore, according to the abnormal unit, the corresponding handling strategy is executed, such as activating an equivalent functional unit or disabling the abnormal unit, achieving seamless equivalent replacement of functions. While maintaining the continuity of audio functions, the availability of the earphone is maximized, enhancing the robustness of earphone use and ensuring the audio interaction experience.
[0026] In one possible implementation, different headphone detection methods can be selected based on the headphone's state. Specifically, when the headphone is in use, anomaly detection is performed by an electronic device based on the original ultrasonic signal and reflected signal. When the headphone is idle, anomaly detection is performed by the headphone based on the ambient audio signal collected by the microphone under test and the test audio signal. The headphone being in use can mean that it has established a connection and is playing audio or making a call. In this way, by using different headphone detection methods according to the headphone's state, when the headphone is in use, non-invasive, real-time state monitoring of the microphone and speaker based on ultrasonic signals is achieved, enabling synchronous anomaly detection without affecting normal headphone use, thus ensuring the comprehensiveness of the headphone detection scenarios. When the headphone is idle, anomaly detection can be achieved solely through the headphone itself, based on the audio signals collected from the microphone and speaker, reducing reliance on electronic devices and improving the versatility of the headphone detection method.
[0027] Optionally, prior to step 101, embodiments of the present invention may further include the following steps: Step 201: Send the original ultrasonic signal to the earphone; the original ultrasonic signal is used to instruct the earphone to play the original ultrasonic signal.
[0028] In this embodiment of the invention, when the earphone is in normal use (such as playing audio, making a call, etc.), the electronic device can send a raw ultrasonic signal to the earphone according to a preset program. The raw ultrasonic signal is used to instruct the earphone to play the raw ultrasonic signal. After receiving the raw ultrasonic signal, the speaker in the earphone is driven by the raw ultrasonic signal and plays the raw ultrasonic signal. The raw ultrasonic signal propagates through the earphone cavity or the external environment and is reflected. The reflected signal is received by the first microphone in the earphone to obtain the reflected signal.
[0029] Step 202: Receive the reflected signal sent by the first microphone.
[0030] In this embodiment of the invention, the first microphone converts the received reflected signal into an electrical signal and transmits it to the electronic device. The electronic device receives the reflected signal sent by the first microphone. For example, the first microphone can transmit the reflected signal back to the mobile phone via a Bluetooth link. In this embodiment of the invention, an original ultrasonic signal is sent to the earphone to instruct it to play the original ultrasonic signal. The played original ultrasonic signal is reflected and received by a first microphone in the earphone to obtain a reflected signal; the reflected signal sent by the first microphone is also received. In this way, the electronic device can detect the earphone based on the characteristics of the ultrasonic signal, using the reflected signal and the original ultrasonic signal.
[0031] Optionally, step 101 may include the following steps: Step 301: Based on the original ultrasonic signal and the reflected signal, perform signal intensity analysis, propagation time analysis and correlation analysis to obtain the signal intensity analysis results, propagation time analysis results and correlation analysis results.
[0032] In this embodiment of the invention, the electronic device performs signal strength analysis, propagation time analysis, and correlation analysis based on the original ultrasonic signal and the reflected signal.
[0033] For signal strength analysis, assuming the speaker is emitting ultrasonic signals normally, the microphone in the earphone should be able to receive a significantly powerful ultrasonic signal if the microphone is functioning properly. If the signal strength received by a particular microphone... signal strength below the preset threshold The preset signal strength threshold can be set to the system's noise floor level, indicating an anomaly in the first microphone, such as damage or poor connection. Therefore, signal strength analysis can be performed by calculating the average power or root mean square value of the received signal and comparing it to the preset signal strength threshold to determine if the signal strength meets the standard. If the reflected signal strength is lower than the preset threshold, the signal strength analysis result is abnormal; if the reflected signal strength is greater than or equal to the preset threshold, the signal strength analysis result is normal.
[0034] For propagation time analysis, the time difference Δt is measured between the signal transmission time of the original ultrasonic signal played by the speaker and the signal reception time of the reflected signal received by the first microphone. Given a fixed headphone cavity structure, Δt typically falls within a stable range because the propagation path of ultrasonic waves inside the headphone is relatively fixed. If Δt is abnormal or cannot be measured (no effective signal reception), it can help determine if the hardware connection status or the positional relationship between the microphone and speaker is normal. For example, Δt, i.e., the Time of Flight (ToF), can be calculated by finding the rising edges of the signal envelopes corresponding to the original ultrasonic signal and the reflected signal. The time difference is then compared to a preset time difference to perform propagation time analysis. If the time difference is greater than the preset time difference, the propagation time analysis result is abnormal; if the time difference is less than or equal to the preset time difference, the propagation time analysis result is normal.
[0035] For correlation analysis, hardware malfunctions (such as distortion of the frequency response characteristics of a speaker or microphone) can introduce nonlinear distortion, causing changes in the signal waveform. By comparing the similarity of two signals, the performance status of the hardware can be assessed. For example, the cross-correlation coefficient between the two signals can be calculated. Under normal conditions, since the original ultrasonic signal and the reflected signal should be highly similar in an ideal environment without hardware malfunctions or external interference, their correlation coefficient should be close to 1. If the correlation coefficient is lower than a preset coefficient, it indicates that the speaker and / or microphone may have performance degradation or malfunction. For example, the original ultrasonic signal and the reflected signal can be segmented according to a certain number of sampling points, and the sum of the products of corresponding points in each segment can be calculated. The mean of the sums for each segment is then calculated, and finally normalized to obtain the cross-correlation coefficient, which measures the similarity between the original ultrasonic signal and the reflected signal. The cross-correlation coefficient is compared with a preset coefficient to perform signal correlation or distortion analysis. If the cross-correlation coefficient is less than the preset coefficient, the correlation analysis result is abnormal; if the cross-correlation coefficient is greater than or equal to the preset coefficient, the correlation analysis result is normal.
[0036] Step 302: If at least one of the signal strength analysis result, the propagation time analysis result, and the correlation analysis result is abnormal, and the playback function of the speaker in the earphone is normal, the abnormal unit in the earphone is determined to be the first microphone.
[0037] Step 303: If the playback function of the speaker is abnormal, determine that the abnormal unit in the headphones is the speaker.
[0038] In this embodiment of the invention, signal strength analysis results, propagation time analysis results, and correlation analysis results are obtained. If at least one result is abnormal, the ultrasound detection result is abnormal; if the signal strength analysis results, propagation time analysis results, and correlation analysis results are all normal, the ultrasound detection result is normal.
[0039] If the ultrasonic test result is abnormal, it indicates a potential problem with the first microphone or speaker inside the headphones. Further assessment is needed to determine if the speaker's playback function is normal. This can be done by receiving feedback from the user. If the headphone speaker can play the required audio, the user can perform the first feedback operation, indicating normal playback. Since an abnormal ultrasonic test with a normal speaker often indicates a fault in the first microphone responsible for sound pickup, the faulty unit in the headphones can be identified as the first microphone. If the speaker cannot play audio, the user can perform the second feedback operation, indicating abnormal playback. This confirms that the faulty unit in the headphones is the speaker, meaning the abnormal ultrasonic test result was caused by a speaker malfunction.
[0040] In this embodiment of the invention, the detection results obtained through various analysis and processing of the original ultrasonic signals and reflected signals can accurately determine the hardware status of the headphones. Based on the detection results and the speaker playback function, the abnormal unit can be quickly located as the first microphone or the speaker, improving troubleshooting efficiency and ensuring a good headphone user experience.
[0041] Optionally, embodiments of the present invention may further include the following steps: Step 401: If at least one of the signal strength analysis result, the propagation time analysis result, and the correlation analysis result is abnormal, display a target prompt message; the target prompt message is used to instruct the user to confirm whether the playback function of the headphone's speaker is normal.
[0042] In this embodiment of the invention, if the ultrasonic detection result is abnormal, the abnormal unit can be further identified based on the playback function of the headphone speaker. Therefore, after the electronic device identifies the abnormal unit in the headphone or receives an abnormal unit indication message from the headphone, a target prompt message can be displayed. The target prompt message can be presented as a pop-up window, including two options: normal and abnormal, or it can include an information input box. The target prompt message can be used to instruct the user to confirm whether the playback function of the headphone speaker is normal.
[0043] Step 402: If the first feedback information corresponding to the target prompt information is received, it is determined that the speaker's playback function is normal.
[0044] In this embodiment of the invention, if a first feedback message is received regarding the target prompt information, it can be determined that the speaker's playback function is normal. The first feedback message can be generated through a first feedback operation, which can be a selection operation of the normal option for the target prompt information (e.g., clicking, long-pressing, etc.), or entering "normal" in the information input box of the target prompt information.
[0045] Step 403: If the second feedback information corresponding to the target prompt information is received, it is determined that the speaker's playback function is abnormal.
[0046] In this embodiment of the invention, if a second feedback message is received regarding the target prompt information, it can be determined that the speaker's playback function is malfunctioning. The second feedback message can be generated through a second feedback operation, which can be a selection operation of the abnormal option in the target prompt information (e.g., clicking, long-pressing, etc.), or entering "abnormal" in the information input box of the target prompt information.
[0047] In this embodiment of the invention, by displaying target prompt information and judging the abnormality of the speaker's playback function based on the first feedback information or the second feedback information, the speaker's playback function can be judged with user assistance, and the specific abnormal unit can be further located, thereby improving the accuracy of judging the abnormal unit.
[0048] Optionally, embodiments of the present invention may further include the following steps: Step 501: If the signal strength analysis result, the propagation time analysis result, and the correlation analysis result are all normal, configure the earphone to noise reduction mode and acquire the sound signal from the first microphone; the fact that the signal strength analysis result, the propagation time analysis result, and the correlation analysis result are all normal indicates that there are no abnormalities between the first microphone and the speaker.
[0049] Step 502: If the noise detection result of the received audio signal is abnormal, determine that the abnormal unit in the earphone is the second microphone.
[0050] In this embodiment of the invention, if the signal strength analysis result, propagation time analysis result, and correlation analysis result are all normal, that is, the ultrasonic detection result is normal, it indicates that the first microphone and the speaker are not abnormal. In this case, the second microphone is further monitored. A mode adjustment command is sent to the headphones via an electronic device to configure the headphones to noise reduction mode, so that the first microphone starts working to acquire its audio signal. Subsequently, noise detection is performed on the audio signal acquired by the first microphone. For example, the presence of noise can be determined by analyzing parameters such as the spectral characteristics and signal amplitude fluctuations of the audio signal. If the noise detection result of the audio signal is abnormal, that is, noise exists, then the abnormal unit in the headphones can be identified as the second microphone, indicating that the second microphone malfunctioned during the noise reduction process, causing noise in the acquired signal.
[0051] In this embodiment of the invention, normal ultrasonic testing indicates that the first microphone and speaker are not abnormal. By setting the headphones to noise reduction mode and acquiring the sound signal of the first microphone, and then locating the abnormality based on the noise detection results, the fault of the second microphone can be accurately diagnosed, avoiding misjudgment and improving the accuracy and comprehensiveness of headphone fault diagnosis.
[0052] For example, Figure 3 A flowchart illustrating the specific steps of a headphone malfunction handling method is shown, such as... Figure 3 As shown, if the ultrasonic test results are abnormal, it indicates that the first microphone and / or speaker are malfunctioning. Therefore, it is necessary to determine whether the headphone playback function is normal. If the headphone playback function is normal, the abnormal unit is identified as the first microphone (receiving microphone); if the headphone playback function is malfunctioning, the abnormal unit is identified as the speaker (loudspeaker unit). If the ultrasonic test results are normal, it indicates that the first microphone and speaker are not malfunctioning. In this case, the noise cancellation mode of the headphone can be turned on, recording can be performed through the first microphone, and noise detection can be performed. If abnormal noise is detected, the second microphone (noise cancellation microphone) is malfunctioning; if no abnormal noise is detected, the second microphone (noise cancellation microphone) is normal.
[0053] Optionally, step 103 may include the following steps: Step 601: If the abnormal unit is the first microphone, activate the built-in microphone of the electronic device and switch the audio input path of the headphones to the built-in microphone.
[0054] In this embodiment of the invention, when the abnormal unit is determined to be the first microphone, it indicates that the headset has malfunctioned in its recording function and cannot collect sound signals normally. At this time, the audio routing switching module of the electronic device can automatically adjust its audio routing strategy. Specifically, it can activate the built-in microphone of the electronic device and switch the audio input path of the headset from the headset microphone to the built-in microphone of the electronic device. For example, when the user is making a call, the electronic device originally obtains the user's voice signal collected by the headset microphone through Bluetooth connection. When the abnormality of the headset's first microphone is detected, the mobile phone automatically switches to using its own built-in microphone to collect the user's voice. At the same time, the audio output path remains unchanged, and the other party's voice is still output to the user through the headset speaker unit, realizing "using the mobile phone microphone to pick up the sound and using the headset to hear the sound", ensuring the basic normal use of the call function.
[0055] Furthermore, the phone will also remind the user that it has switched to the phone's built-in microphone through screen display, voice prompts, and other means, so that the user knows the current audio input status.
[0056] Step 602: If the abnormal unit is the second microphone, send a mode change command to the earphone; the mode change command is used to instruct the earphone to turn off the noise cancellation mode, and the second microphone is used when the noise cancellation mode is on.
[0057] In this embodiment of the invention, if the abnormal unit is determined to be the second microphone, that is, the microphone in the headphones used for active noise cancellation is malfunctioning. Since a malfunctioning second microphone may cause the headphones to output noise when active noise cancellation is enabled, affecting the user's listening experience, the electronic device can send a mode change command to the headphones via the Bluetooth communication module. After receiving the command, the headphones' internal control module will disable the noise cancellation mode and forcibly switch to normal mode. In normal mode, the second microphone is used when noise cancellation is enabled. In normal mode, the headphones are used only as a regular audio playback device and no longer perform active noise cancellation, thereby avoiding noise output caused by the malfunctioning second microphone and ensuring that the user can use the headphones' basic audio playback functions normally.
[0058] Step 603: If the abnormal unit is a speaker, activate the built-in audio peripheral unit of the electronic device and switch the audio output path of the headphones to the audio peripheral unit.
[0059] In this embodiment of the invention, when the abnormal unit is determined to be the speaker, it indicates that the headphones cannot play audio signals normally. At this time, the audio processing module of the electronic device (such as a mobile phone) will adjust its audio routing strategy to activate the built-in audio peripheral unit of the electronic device and switch the audio output path of the headphones to the built-in audio peripheral unit of the electronic device. For example, when a user is playing music with headphones, if an abnormality is detected in the headphone speaker, the electronic device can automatically stop sending audio signals to the headphones via Bluetooth and instead use its own built-in speaker to play music. At the same time, it can notify the user of the Bluetooth headphone hardware failure through screen display, voice prompts, etc., informing the user that the audio has been switched to the built-in audio peripheral unit of the mobile phone for playback, so that the user is aware of the change in audio output status.
[0060] In this embodiment of the invention, the audio routing strategy of the electronic device is adjusted according to the abnormal unit, which can maximize the continuity and availability of audio functions and improve the user experience in the event of hardware failure of the headphone.
[0061] Figure 4 This is a flowchart of another headphone malfunction handling method provided in an embodiment of the present invention, applied to headphones.
[0062] like Figure 4 As shown, the method may include: Step 701: Collect ambient audio signals based on the microphone under test in the earphone, and collect test audio signals corresponding to the test audio played by the speaker in the earphone based on the microphone under test; the microphone under test includes a first microphone and a second microphone.
[0063] In this embodiment of the invention, an anomaly detection module inside the earphone issues a recording command, causing all microphones under test to simultaneously begin recording, using the ambient audio signal corresponding to the ambient noise as a baseline. The microphones under test include a first microphone and a second microphone. During this stage, the speaker unit (i.e., the loudspeaker) in the earphone is inactive to prevent the sound emitted by the loudspeaker itself from interfering with the acquisition of ambient noise. For example, the recording duration can be set to a short period, such as 100-200ms. The ambient audio signals corresponding to each microphone are recorded as follows: , where i is the microphone index, used to distinguish different microphones. For example, if there are two microphones in the headphones, the index i can be 1 or 2, corresponding to the ambient audio signals collected by the two microphones respectively.
[0064] After completing the ambient sound baseline acquisition, the next step is to acquire the test sound excitation. The headphone speaker can play a specific test audio clip. The test audio can possess easily identifiable characteristics to facilitate accurate analysis of the acquired signals. For example, a single-frequency sine wave (e.g., 1kHz) can be used as the test audio. Its stable and singular frequency facilitates analysis of the energy level at that frequency and the presence of distortion. For instance, abnormally low energy or excessively high distortion at a certain frequency may indicate a problem with the internal hardware units of the headphones. When using a linear frequency modulated (LFM) signal as the test audio, its frequency changes linearly with time, allowing for comprehensive analysis of the headphones' response characteristics across the entire frequency range. For example, abnormal fluctuations or deviations from the normal range in the frequency response curve can indicate an abnormality in the headphone hardware units. When using pseudo-random white noise as the test audio, its energy is evenly distributed across the entire audio frequency band, exhibiting strong anti-interference capabilities. This can effectively stimulate the various hardware units within the headphones, allowing for comprehensive detection of the headphones' hardware unit operating status across the entire audio frequency band by analyzing the acquired signals. Simultaneously, all microphones under test record audio again while the speaker plays the test audio. The acquired test audio signals are denoted as follows: .
[0065] Step 702: For any of the microphones to be tested, calculate the response difference degree corresponding to the microphone based on the ambient audio signal corresponding to the microphone and the test audio signal.
[0066] In this embodiment of the invention, the abnormal detection module of the earphone analyzes and processes the collected environmental audio signal and test audio signal, and calculates the response difference corresponding to the microphone under test using a specific signal processing algorithm. Specifically, the test audio signal can be compared and analyzed with the ambient audio signal to calculate the difference between them. The response difference degree is used to characterize the degree of response of the microphone under test to the audio played by the speaker, reflecting the change in the microphone's signal acquisition when the test audio is played by the speaker and when it is not. Under normal wearing conditions, when the test audio is played, the microphone should be able to clearly pick up the sound from the speaker and the ambient sound; when it is not played, it should only pick up the ambient sound. Therefore, for a properly functioning microphone, the response difference degree value should be large. If the response difference degree value of a microphone is very small, it indicates that it has failed to effectively pick up the speaker sound, and the microphone or its path may be abnormal.
[0067] For example, the response difference of the microphone i to be detected can be calculated based on the following formula:
[0068] Step 703: Calculate the consistency difference degree of the microphone under test based on the test audio signal corresponding to the microphone under test and the test audio signals corresponding to other microphones under test.
[0069] In this embodiment of the invention, based on the ambient audio signal corresponding to the microphone under test and the ambient audio signals corresponding to other microphones under test, the consistency difference degree corresponding to the microphone under test can be calculated. In this context, the microphone to be tested is the first microphone, and the other microphones to be tested can be second microphones; conversely, if the microphone to be tested is a second microphone, the other microphones to be tested can be first microphones. It is understood that when the headset contains multiple first microphones and / or multiple second microphones, the consistency difference between the microphones to be tested and the corresponding test audio signals of the other microphones to be tested can be calculated.
[0070] The specific calculation principle is as follows: Under the same environment, the signals collected by the microphone under test, i.e., the test audio signals, including the mixture of ambient sound and speaker playback, should have a high degree of similarity. By comparing the differences between the test audio signals collected by the microphone under test and those collected by other microphones under test (which include the mixture of ambient sound and speaker playback during test audio playback), if the consistency difference value of the signals from two microphones in close physical locations is abnormally high, it indicates that at least one of the microphones is malfunctioning.
[0071] For example, the consistency difference between microphone i and microphone j can be calculated based on the following formula:
[0072] Step 704: Based on the response difference degree and the consistency difference degree, determine the abnormal unit indication information and send the abnormal unit indication information to the electronic device.
[0073] In this embodiment of the invention, based on the calculated response difference and consistency difference, a specific evaluation algorithm is used, such as comprehensively considering the influence weights of response difference and consistency difference on the microphone's health status, to calculate health probability values for the microphone and speaker under test. The health probability values reflect whether the performance of the microphone and speaker under test is normal. Based on the health probability values, abnormal units can be identified, and abnormal unit indication information can be determined. The abnormal unit indication information is then sent to the electronic device.
[0074] In this embodiment of the invention, by acquiring ambient audio and test audio signals, comprehensive data under the microphone's operating scenario can be obtained. Simultaneously, by calculating the response difference, the microphone's response to speaker playback can be accurately measured, thus determining its sound pickup function; calculating the consistency difference can assess the consistency of signals from different microphones. Combining the response difference and consistency difference to determine abnormal unit indication information allows for accurate multi-dimensional evaluation of the microphone's status, effectively improving the reliability and accuracy of headphone fault detection.
[0075] Optionally, step 704 may include the following steps: Step 801: For any of the microphones to be tested, determine the health probability value corresponding to the microphone to be tested based on the response difference degree and the consistency difference degree.
[0076] In this embodiment of the invention, for any microphone to be tested, based on the calculated response difference and consistency difference, a specific probability calculation model can be used to calculate an initial health probability value P(healthy) for the microphone to be tested. For example, if the response difference value corresponding to the microphone to be tested is large and all consistency differences are small, it indicates that the microphone can effectively pick up speaker sound and has good consistency with other microphone signals, and its health probability value will be high; conversely, if The value is small or there is a large value. The value indicates a lower probability of good health.
[0077] Step 802: If the health probability value is less than the first threshold, generate abnormal unit indication information to characterize the microphone to be detected.
[0078] In this embodiment of the invention, a confidence threshold is preset as the first threshold (e.g., 0.05). When the health probability value of the microphone to be detected is less than the first threshold, the system determines that the abnormal unit in the earphone is the microphone to be detected, and generates abnormal unit indication information to characterize the microphone to be detected based on this.
[0079] Step 803: For the loudspeaker, determine the health probability value corresponding to the loudspeaker based on the response difference between the loudspeaker and each of the microphones to be detected.
[0080] Step 804: If the health probability value is less than the second threshold, generate abnormal unit indication information to characterize the speaker.
[0081] In this embodiment of the invention, for the loudspeaker, based on its response difference with each microphone to be tested (i.e., the response difference of each microphone to be tested)... (Value), to determine the health probability value corresponding to the speaker. For example, if all microphones to be tested... If the values are all low, it indicates that the speaker is failing to play sound normally, and its health probability is low. Similarly, when the speaker's health probability value is less than the second threshold, the abnormal unit in the earphone is identified as the speaker, and abnormal unit indication information is generated to characterize the microphone to be detected. The second threshold can be set according to needs, for example, it can be equal to the first threshold, and this embodiment of the invention does not limit it.
[0082] For example, when determining the health probability value corresponding to the microphone to be tested, taking the microphone to be tested as an example, after calculating its response difference... and consistency difference Then, the health probability value P (healthy) can be calculated according to preset rules. For example, the weights of response difference and consistency difference in the calculation of the health probability value can be set, such as a weight of 0.6 for response difference and a weight of 0.4 for consistency difference. When a microphone to be tested... A higher value indicates that it effectively picked up speaker sound, resulting in a higher score in this category; at the same time, its performance compared to other microphones... The values are all relatively small, indicating good signal consistency, resulting in a high score in this category. Based on the weighted overall calculation, the microphone's initial health probability value will be high. Conversely, if... Small value and large existence The lower the initial health probability value, the lower the probability of a speaker's health. Similarly, taking a speaker as an example, based on the number of microphones... Assign values based on the condition of all microphones. Low values indicate a low probability of speaker health, and vice versa.
[0083] Furthermore, to improve the robustness of detection and prevent false positives, the system can repeatedly calculate the response difference, consistency difference, and health probability value. Using the results of multiple measurements, the health probability of each component is updated using algorithms such as Bayesian estimation. Finally, when the health probability of a component consistently falls below its corresponding threshold (either the first or second threshold), it is determined to be abnormal. For example, since the signal obtained from each measurement may contain some error, multiple measurements can reduce the impact of this error. For instance, in the first measurement, a microphone's health probability value might be slightly below the threshold but close to it due to environmental interference, and cannot be directly determined to be abnormal. After multiple measurements, using algorithms such as Bayesian estimation, the health probability value of the microphone is continuously updated based on the results of each measurement. As the number of measurements increases, if the health probability value remains below the threshold (either the first or second threshold), it is determined to be abnormal; if it gradually increases and stabilizes above the threshold (either the first or second threshold), it is determined to be normal, achieving iterative convergence and further improving diagnostic accuracy.
[0084] In this embodiment of the invention, the health probability value of the microphone under test is determined based on the response difference and consistency difference. This comprehensively considers the microphone's pickup capability and signal consistency, fully assesses the microphone's status, and improves the accuracy of the judgment. Simultaneously, determining the health probability value of the speaker based on the response difference between the speaker and each microphone under test allows for a holistic assessment of the speaker's operation. An abnormality is identified when the value is below a second threshold, enabling rapid determination of speaker malfunction and effectively improving the efficiency and accuracy of headphone fault diagnosis.
[0085] Optionally, embodiments of the present invention may further include the following steps: Step 901: After receiving the original ultrasound signal sent by the electronic device, play the original ultrasound signal.
[0086] Step 902: The first microphone receives the original ultrasonic signal transmitted via reflection to obtain the reflected signal.
[0087] Step 903: The reflected signal is sent to the electronic device by the first microphone.
[0088] In this embodiment of the invention, after receiving the original ultrasonic signal sent by the electronic device, the original ultrasonic signal instructs the earphones to play the original ultrasonic signal. Upon receiving the original ultrasonic signal, the speaker in the earphones is driven by the original ultrasonic signal and plays the original ultrasonic signal. The original ultrasonic signal propagates through the earphone cavity or the external environment and is reflected. The reflected signal is received by the first microphone in the earphones, obtaining the reflected signal. The first microphone sends the reflected signal to the electronic device, which performs signal strength analysis, propagation time analysis, and correlation analysis based on the reflected signal and the original ultrasonic signal.
[0089] In this embodiment of the invention, the original ultrasonic signal sent by the electronic device is played through the headphone speaker, and the reflected signal is received by the first microphone and transmitted back to the electronic device. By utilizing the phenomenon of ultrasonic waves reflecting off the ear canal, detection can be completed using the headphone's own speaker and microphone, thus identifying hardware abnormalities and improving detection efficiency and accuracy.
[0090] For example, Figure 5 An interactive schematic diagram of an earphone detection method is shown, such as... Figure 5 As shown, the detection and control module in the electronic device sends the original ultrasonic signal to the headphones. After receiving the original ultrasonic signal, the speaker in the headphones reflects the original ultrasonic signal and receives it through the first microphone in the headphones, obtaining a reflected signal. The first microphone sends the reflected signal back to the electronic device. Based on the original ultrasonic signal and the reflected signal, the detection and control module in the electronic device determines the ultrasonic detection result and thus identifies the abnormal unit in the headphones. If the ultrasonic detection result is abnormal, and the playback function of the speaker in the headphones is normal, the abnormal unit in the headphones is identified as the first microphone; if the playback function of the speaker is abnormal, the abnormal unit in the headphones is identified as the speaker. If the ultrasonic detection result is normal, the headphones are configured to noise reduction mode and the sound signal from the first microphone is acquired. If the noise detection result of the sound signal is abnormal, the abnormal unit in the headphones is identified as the second microphone. The audio routing switching module in the electronic device executes the abnormal handling strategy corresponding to the abnormal unit.
[0091] For example, Figure 6 An interactive schematic diagram of another headphone detection method is shown, such as... Figure 6 As shown, the microphones under test (including the first and second microphones) in the headphones collect ambient audio signals and collect test audio signals when the speaker plays test audio. Based on the ambient audio signals and the test audio signals, the anomaly detection module in the headphones determines anomaly unit indication information. This information is then sent to the electronic device, where the audio routing switching module executes the corresponding anomaly handling strategy.
[0092] Figure 7 This is a schematic diagram of the structure of an earphone malfunction detection device provided in an embodiment of the present invention, which is applied to electronic devices, such as... Figure 7 As shown, the device includes: The first determining module 1001 is used to determine the abnormal unit in the earphone based on the original ultrasonic signal and the reflected signal collected by the first microphone in the earphone, or to determine the unit indicated by the abnormal unit indication information sent by the earphone as the abnormal unit. The first execution module 1002 is used to execute the exception handling strategy corresponding to the exception unit according to the exception unit; the exception handling strategy includes activating an equivalent functional unit in the electronic device that has the same function as the exception unit and / or controlling the earphone to disable the exception unit.
[0093] This invention provides a headphone anomaly detection device. Based on the original ultrasonic signal and the reflected signal collected by the first microphone in the headphone, it identifies an abnormal unit in the headphone, or identifies the unit indicated by the abnormal unit indication information sent by the headphone as an abnormal unit. According to the abnormal unit, it executes the corresponding anomaly handling strategy. The anomaly handling strategy includes activating an equivalent functional unit in the electronic device that has the same function as the abnormal unit and / or controlling the headphone to disable the abnormal unit. In this way, through the collaboration of the electronic device and the headphone, the abnormal unit in the headphone is proactively detected and identified, avoiding the user passively discovering the headphone malfunction and improving fault response speed. Furthermore, according to the abnormal unit, the corresponding handling strategy is executed, such as activating the equivalent functional unit or disabling the abnormal unit, to achieve seamless equivalent replacement of functions. While maintaining the continuity of audio functions, it maximizes the availability of the headphone, enhances the robustness of headphone use, and ensures a good audio interaction experience.
[0094] Optionally, the device further includes: A first transmitting module is used to transmit the original ultrasonic signal to the earphone; the original ultrasonic signal is used to instruct the earphone to play the original ultrasonic signal. A first receiving module is used to receive the reflected signal sent by the first microphone.
[0095] Optionally, the first determining module 1001 includes: The first analysis module is used to perform signal intensity analysis, propagation time analysis, and correlation analysis based on the original ultrasonic signal and the reflected signal, and to obtain the signal intensity analysis results, propagation time analysis results, and correlation analysis results. The first determining submodule is configured to determine the abnormal unit in the headphones as the first microphone if the playback function of the speaker in the headphones is normal, provided that at least one of the signal strength analysis result, the propagation time analysis result, and the correlation analysis result is abnormal. The second determining submodule is used to determine that the abnormal unit in the headphones is the speaker if the playback function of the speaker is abnormal.
[0096] Optionally, the device further includes: The first display module is configured to display a target prompt message when at least one of the signal strength analysis result, the propagation time analysis result, and the correlation analysis result is abnormal; the target prompt message is used to instruct the user to confirm whether the playback function of the headphone's speaker is normal. The second determining module is used to determine that the speaker's playback function is normal if it receives the first feedback information corresponding to the target prompt information; The third determining module is used to determine that the speaker's playback function is abnormal if it receives the second feedback information corresponding to the target prompt information.
[0097] Optionally, the device further includes: The first acquisition module is configured to configure the earphones to noise reduction mode and acquire the sound signal received by the first microphone when the signal strength analysis result, the propagation time analysis result, and the correlation analysis result are all normal; the normal signal strength analysis result, the propagation time analysis result, and the correlation analysis result are used to indicate that there are no abnormalities in the first microphone and the speaker; The fourth determining module is used to determine the abnormal unit in the earphone as the second microphone when the noise detection result of the received audio signal is abnormal.
[0098] Optionally, the first execution module 1002 includes: The first startup module is used to activate the built-in microphone of the electronic device and switch the audio input path of the headphones to the built-in microphone when the abnormal unit is the first microphone. The second transmitting module is used to send a mode change command to the headset when the abnormal unit is the second microphone; the mode change command is used to instruct the headset to turn off the noise cancellation mode, and the second microphone is used when the noise cancellation mode is turned on; The second startup module is used to activate the built-in audio peripheral unit of the electronic device and switch the audio output path of the headphones to the audio peripheral unit when the abnormal unit is a speaker.
[0099] Figure 8 This is an example of an earphone provided in an embodiment of the present invention, such as... Figure 8 As shown, the headphones include: The first acquisition module 1101 is used to acquire ambient audio signals based on the microphone to be tested in the earphone, and to acquire test audio signals corresponding to the test audio played by the speaker in the earphone based on the microphone to be tested; the microphone to be tested includes a first microphone and a second microphone; The first calculation module 1102 is used to calculate the response difference degree of any microphone to be tested based on the ambient audio signal corresponding to the microphone to be tested and the test audio signal. The second calculation module 1103 is used to calculate the consistency difference degree of the microphone under test based on the test audio signal corresponding to the microphone under test and the test audio signals corresponding to other microphones under test. The fifth determining module 1104 is used to determine abnormal unit indication information based on the response difference degree and the consistency difference degree, and send the abnormal unit indication information to the electronic device.
[0100] Optionally, the fifth determining module includes: The third determining submodule is used to determine the health probability value of any microphone to be tested based on the response difference degree and the consistency difference degree. The first generation module is used to generate abnormal unit indication information to characterize the microphone to be detected when the health probability value is less than a first threshold. The fourth determining submodule is used to determine the health probability value of the loudspeaker based on the response difference between the loudspeaker and each of the microphones to be detected. The second generation module is used to generate abnormal unit indication information to characterize the speaker when the health probability value is less than the second threshold.
[0101] Optionally, the headphones further include: A speaker for playing the original ultrasonic signal after receiving it from the electronic device; The first microphone is used to receive the original ultrasonic signal transmitted via reflection, obtain the reflected signal, and send the reflected signal to the electronic device.
[0102] Optional, such as Figure 9 As shown, this application embodiment also provides an electronic device, including a processor 1210, a memory 1209, and a program or instructions stored in the memory 1209 and executable on the processor 1210. When the program or instructions are executed by the processor 1210, they implement the various processes of the above-described headphone abnormality handling method embodiment and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0103] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0104] Figure 10 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application. The electronic device 1300 includes, but is not limited to, components such as: radio frequency unit 1301, network module 1302, audio output unit 1303, input unit 1304, sensor 1305, display unit 1306, user input unit 1307, interface unit 1308, memory 1309, and processor 1310.
[0105] Those skilled in the art will understand that the electronic device 1300 may also include a power supply (such as a battery) for powering various components. The power supply may be logically connected to the processor 1310 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. The electronic device structure shown in Figure x does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here. It should be understood that, in this embodiment, the input unit 1304 may include a graphics processing unit (GPU) 13041 and a microphone 13042. The GPU 13041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 1306 may include a display panel 13061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 1307 includes a touch panel 13071 and at least one of other input devices 13072. The touch panel 13071 is also called a touch screen. The touch panel 13071 may include a touch detection device and a touch controller. Other input devices 13072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.
[0106] The memory 1309 can be used to store software programs and various data. The memory 1309 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 1309 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 1309 in this embodiment includes, but is not limited to, these and any other suitable types of memory.
[0107] Processor 1310 may include one or more processing units; optionally, processor 1310 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 1310.
[0108] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described headphone abnormality handling method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0109] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0110] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described headphone abnormality handling method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0111] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0112] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the above-described headphone malfunction handling method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0113] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0114] The algorithms and displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used in conjunction with the teachings herein. The required structure for constructing such systems is apparent from the above description. Furthermore, this invention is not directed to any particular programming language. It should be understood that the contents of the invention described herein can be implemented using various programming languages, and the above description of specific languages is for the purpose of disclosing the best mode of implementation of the invention.
[0115] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0116] Similarly, it should be understood that, in order to simplify the invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof. However, this disclosure should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as reflected in the following claims, inventive aspects lie in fewer than all features of a single foregoing disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into this detailed description, wherein each claim itself is a separate embodiment of the invention.
[0117] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.
[0118] The various component embodiments of the present invention can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some or all of the components in the sorting device according to the present invention. The present invention can also be implemented as a device or apparatus program for performing part or all of the methods described herein. Such a program implementing the present invention can be stored on a computer-readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
[0119] It should be noted that the above embodiments are illustrative of the invention and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.
[0120] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0121] It should be noted that all actions involving the acquisition of signals, information, or data in this application are carried out in compliance with the relevant data protection laws and policies of the country where the application is located, and with the authorization granted by the owner of the relevant device.
[0122] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
[0123] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for handling headphone malfunctions, characterized in that, Applied to electronic devices, the method includes: Based on the original ultrasonic signal and the reflected signal collected by the first microphone in the earphone, the abnormal unit in the earphone is determined, or the unit indicated by the abnormal unit indication information sent by the earphone is determined as the abnormal unit. Based on the abnormal unit, execute the abnormal handling strategy corresponding to the abnormal unit; the abnormal handling strategy includes activating an equivalent functional unit in the electronic device that has the same function as the abnormal unit and / or controlling the earphone to disable the abnormal unit.
2. The method according to claim 1, characterized in that, Before determining the abnormal unit in the earphone based on the original ultrasonic signal and the reflected signal acquired by the first microphone in the earphone, the method includes: The original ultrasonic signal is sent to the earphones; the original ultrasonic signal is used to instruct the earphones to play the original ultrasonic signal. Receive the reflected signal sent by the first microphone.
3. The method according to claim 1, characterized in that, The method of determining the abnormal unit in the earphone based on the original ultrasonic signal and the reflected signal collected by the first microphone in the earphone includes: Based on the original ultrasonic signal and the reflected signal, signal intensity analysis, propagation time analysis and correlation analysis are performed to obtain the signal intensity analysis results, propagation time analysis results and correlation analysis results; If at least one of the signal strength analysis results, the propagation time analysis results, and the correlation analysis results is abnormal, and the playback function of the speaker in the earphone is normal, the abnormal unit in the earphone is determined to be the first microphone. If the speaker's playback function malfunctions, the faulty unit in the headphones is identified as the speaker.
4. The method according to claim 3, characterized in that, The method further includes: If at least one of the signal strength analysis result, the propagation time analysis result, and the correlation analysis result is abnormal, a target prompt message will be displayed; the target prompt message is used to instruct the user to confirm whether the playback function of the headphone's speaker is normal. If the first feedback information corresponding to the target prompt information is received, it is determined that the speaker's playback function is normal; If the second feedback information corresponding to the target prompt information is received, it is determined that the speaker's playback function is abnormal.
5. The method according to claim 3, characterized in that, The method further includes: If the signal strength analysis result, the propagation time analysis result, and the correlation analysis result are all normal, the earphone is configured to noise reduction mode and the sound signal received by the first microphone is acquired; the fact that the signal strength analysis result, the propagation time analysis result, and the correlation analysis result are all normal indicates that there are no abnormalities in the first microphone and the speaker; If the noise detection result of the received audio signal is abnormal, the abnormal unit in the earphone is determined to be the second microphone.
6. The method according to claim 1, characterized in that, The step of executing the exception handling strategy corresponding to the exception unit includes: In the case where the abnormal unit is the first microphone, the built-in microphone of the electronic device is activated, and the audio input path of the headphones is switched to the built-in microphone; In the case where the abnormal unit is the second microphone, a mode change command is sent to the earphone; the mode change command is used to instruct the earphone to turn off the noise cancellation mode, and the second microphone is used when the noise cancellation mode is on. In the case where the abnormal unit is a speaker, the built-in audio peripheral unit of the electronic device is activated, and the audio output path of the headphones is switched to the audio peripheral unit.
7. A method for handling headphone malfunctions, characterized in that, Applied to headphones, the method includes: The test audio signal is acquired based on the ambient audio signal collected by the microphone under test in the earphone, and the test audio signal is acquired based on the microphone under test corresponding to the test audio played by the speaker in the earphone; the microphone under test includes a first microphone and a second microphone; For any of the microphones to be tested, the response difference of the microphone to be tested is calculated based on the ambient audio signal corresponding to the microphone to be tested and the test audio signal. Based on the test audio signal corresponding to the microphone under test and the test audio signals corresponding to other microphones under test, calculate the consistency difference degree corresponding to the microphone under test; Based on the response difference degree and the consistency difference degree, abnormal unit indication information is determined and sent to the electronic device.
8. The method according to claim 7, characterized in that, The step of determining the abnormal unit indication information based on the response difference degree and the consistency difference degree includes: For any of the microphones to be tested, a health probability value corresponding to the microphone to be tested is determined based on the response difference and the consistency difference. If the health probability value is less than a first threshold, an abnormal unit indication information is generated to characterize the microphone to be detected; For the loudspeaker, a health probability value corresponding to the loudspeaker is determined based on the response difference between the loudspeaker and each of the microphones to be detected; If the health probability value is less than the second threshold, abnormal unit indication information is generated to characterize the speaker.
9. The method according to claim 7, characterized in that, The method further includes: Upon receiving the original ultrasonic signal sent by the electronic device, the original ultrasonic signal is played back. The first microphone receives the original ultrasonic signal transmitted via reflection to obtain the reflected signal; The reflected signal is transmitted to the electronic device by the first microphone.
10. A headphone malfunction handling device, characterized in that, Applied to electronic devices, the device includes: The first determining module is used to determine the abnormal unit in the earphone based on the original ultrasonic signal and the reflected signal collected by the first microphone in the earphone, or to determine the unit indicated by the abnormal unit indication information sent by the earphone as the abnormal unit. The first execution module is configured to execute the exception handling strategy corresponding to the exception unit according to the exception unit; the exception handling strategy includes activating an equivalent functional unit in the electronic device that has the same function as the exception unit and / or controlling the earphone to disable the exception unit.
11. An earphone, characterized in that, The headphones include: The first acquisition module is used to acquire ambient audio signals based on the microphone to be tested in the earphone, and to acquire test audio signals corresponding to the test audio played by the speaker in the earphone based on the microphone to be tested; the microphone to be tested includes a first microphone and a second microphone; The first calculation module is used to calculate the response difference degree of any microphone to be tested based on the ambient audio signal corresponding to the microphone to be tested and the test audio signal. The second calculation module is used to calculate the consistency difference degree of the microphone under test based on the test audio signal corresponding to the microphone under test and the test audio signals corresponding to other microphones under test. The fifth determining module is used to determine abnormal unit indication information based on the response difference degree and the consistency difference degree, and send the abnormal unit indication information to the electronic device.
12. An electronic device, characterized in that, include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the headphone malfunction handling method as described in any one of claims 1-9.
13. A readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is able to perform the headphone malfunction handling method according to any one of claims 1-9.