Hardware fault detection method and device, electronic equipment and storage medium

By obtaining the impedance value of the audio output device when the terminal plays an audio file, determining whether the device has a fault, solving the problems of low manual detection efficiency and high technical difficulty, and achieving automated detection, improving efficiency and accuracy.

CN120075717APending Publication Date: 2025-05-30BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311619313.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-29
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

In the prior art, it is easy to cause confusion and misjudgment when manually detecting whether the audio output module has problems such as low efficiency and high technical difficulty, especially when the terminal is equipped with multiple audio output devices.

Method used

By obtaining the impedance value of the audio output device when the terminal plays the audio file, and determining whether the device has a fault based on whether the impedance value is within the preset value range. The method includes controlling the terminal to play an audio file, collecting feedback signals of the audio output device, calculating impedance values, and judging the fault type based on the preset range.

Benefits of technology

It realizes that the terminal automatically and quickly detects whether there is hardware failure in the audio output device, reduces the user's technical level requirements, improves detection efficiency, reduces time and labor costs, and improves the accuracy of the detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120075717A_ABST
    Figure CN120075717A_ABST
Patent Text Reader

Abstract

The invention relates to a hardware fault detection method and device, electronic equipment and a storage medium. The method comprises the following steps: acquiring an impedance value of an audio output device when the terminal plays an audio file in response to a detection operation for the audio output device carried by the terminal; and if the impedance value of the audio output equipment is out of a preset value range, determining that the audio output equipment has a fault. Therefore, the terminal can quickly and automatically detect whether each piece of audio output equipment carried by the terminal has the hardware fault or not, and the requirement on the technical level of a user is reduced, so that the hardware fault detection efficiency of the audio output equipment carried by the terminal is improved, and the hardware fault detection efficiency is improved in the scenes of equipment production, after-sales maintenance and the like. And the time cost and the labor cost can be saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of fault detection, and particularly to a hardware fault detection method and apparatus, an electronic device, and a storage medium. Background Art

[0002] In scenarios such as device production and after-sales maintenance, it is necessary to detect faults in each hardware module carried by a terminal. Among them, the hardware modules to be detected may include, but are not limited to, an audio output module, an image display module, a camera module, a storage module, a communication module, and so on.

[0003] In some embodiments, it is possible to manually detect whether there is a fault in the audio output module, which has problems of low detection efficiency and high technical difficulty. Summary of the Invention

[0004] The present disclosure provides a hardware fault detection method and apparatus, an electronic device, and a storage medium to solve the deficiencies in the related art.

[0005] According to a first aspect of an embodiment of the present disclosure, a hardware fault detection method is provided. The method includes:

[0006] In response to a detection operation on an audio output device carried by a terminal, obtaining an impedance value of the audio output device when the terminal plays an audio file;

[0007] If the impedance value of the audio output device is outside a preset value range, determining that the audio output device has a fault.

[0008] Optionally, the step of, in response to a detection operation on an audio output device carried by a terminal, obtaining an impedance value of the audio output device when the terminal plays an audio file includes:

[0009] In response to a detection operation on the audio output device carried by the terminal, controlling the terminal to play the audio file;

[0010] When the terminal plays the audio file, collecting a feedback signal of the audio output device;

[0011] Calculating an impedance value of the audio output device according to the feedback signal of the audio output device.

[0012] Optionally, the step of collecting a feedback signal of the audio output device includes:

[0013] Continuously sampling the feedback signal of the audio output device to obtain feedback signals of the audio output device at multiple moments;

[0014] Calculating the impedance value of the audio output device according to the feedback signal of the audio output device includes:

[0015] Calculating the real-time impedance value of the audio output device at the multiple moments according to the feedback signals of the audio output device at the multiple moments;

[0016] Determining the average value of the real-time impedance values of the audio output device at the multiple moments as the impedance value of the audio output device.

[0017] Optionally, the loudness of the audio file when being played is fixed.

[0018] Optionally, the audio file is a silent audio file.

[0019] Optionally, the preset value range is greater than or equal to a first value and less than or equal to a second value;

[0020] If the impedance value of the audio output device is outside the preset value range, determining that the audio output device has a fault includes:

[0021] If the impedance value of the audio output device is less than the first value, determining that the audio output device is short-circuited;

[0022] If the impedance value of the audio output device is greater than the second value, determining that the audio output device is open-circuited.

[0023] Optionally, the method further includes:

[0024] Showing the detection result for the audio output device carried by the terminal to the user, where the detection result includes at least one of the following:

[0025] The impedance value of the audio output device;

[0026] Whether the audio output device has a fault;

[0027] The fault type of the audio output device.

[0028] According to a second aspect of the embodiments of the present disclosure, a hardware fault detection device is provided, and the device includes:

[0029] An acquisition module, configured to acquire the impedance value of the audio output device when the terminal plays an audio file in response to a detection operation for the audio output device carried by the terminal;

[0030] A determination module, configured to determine that the audio output device has a fault if the impedance value of the audio output device is outside the preset value range.

[0031] According to a third aspect of the embodiments of the present disclosure, an electronic device is provided, including:

[0032] A processor;

[0033] A memory for storing instructions executable by the processor;

[0034] Wherein, the processor is configured to implement the hardware fault detection method of the above first aspect.

[0035] According to a fourth aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the steps in the hardware fault detection method of the above first aspect are implemented.

[0036] The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects:

[0037] According to the embodiments of the present disclosure, in response to a detection operation on the audio output device carried by the terminal, the impedance value of the audio output device when the terminal plays an audio file can be obtained, and whether the audio output device has a fault can be determined according to whether the impedance value of the audio output device is within a preset value range. Accordingly, the terminal can quickly and automatically detect whether there are hardware faults in each audio output device carried by itself, and also reduces the technical level requirements for users (such as obtaining the hardware fault detection result by one-key trigger), thereby improving the efficiency of hardware fault detection for the audio output devices carried by the terminal. In scenarios such as device production and after-sales maintenance, it is beneficial to save time and labor costs. And, compared with the manual detection method, if there are multiple audio output devices on the terminal, it is beneficial to improve the accuracy of the detection result and avoid confusion and misjudgment.

[0038] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure and used together with the specification to explain the principles of the present disclosure.

[0040] Figure 1 is a flowchart of a hardware fault detection method shown according to an exemplary embodiment.

[0041] Figure 2 is a flowchart of another hardware fault detection method shown according to an exemplary embodiment.

[0042] Figure 3 is a schematic block diagram of a hardware fault detection device shown according to an embodiment of the present disclosure.

[0043] Figure 4 It is a schematic block diagram of a device for hardware fault detection shown according to an exemplary embodiment. Detailed implementation manners

[0044] Here, the exemplary embodiments will be described in detail, and examples thereof are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0045] In scenarios such as device production and after-sales maintenance, it is necessary to perform fault detection on each hardware module carried by the terminal. Among them, the hardware modules to be detected may include, but are not limited to, an audio output module, an image display module, a camera module, a storage module, a communication module, and the like.

[0046] It should be noted that the audio output module involved in the present disclosure may also be referred to as an audio output device, audio output hardware, a speaker, a horn, a combined module including a power amplifier device and a speaker, etc., and the present disclosure does not make any limitation thereto.

[0047] In addition, since there is a mapping relationship between different audio output devices carried by the terminal and audio signals transmitted through different time slots (slots), and a slot in audio TDM (Time-Division Multiplexing) can represent the number of bits occupied by transmitting a single channel, therefore, the "audio output device" involved in the embodiments of the present disclosure may also be replaced by a "slot" or a "channel", and the present disclosure does not make any limitation thereto. It should be noted that the "channel" involved in the embodiments of the present disclosure refers to the channel of the backend device, rather than the channel of the sound source.

[0048] Among them, the audio TDM protocol is a communication protocol for combining multiple audio signals into one signal. It can slice multiple audio signals by time and combine them into a continuous digital stream, so as to simultaneously transmit multiple audio signals. Among them, each audio signal is assigned a fixed slot, and these slots are arranged in sequence to form a frame. For example, a 4-speaker tablet can be equipped with speaker #1, speaker #2, speaker #3, and speaker #4, and each frame of audio signal played by it can include data of 4 slots, namely slot1, slot2, slot3, and slot4, where the speaker and the slot are in one-to-one correspondence.

[0049] In some embodiments, it is possible to manually detect whether there is a fault in the speaker. For example, in the scenario of after-sales repair, the user can control the terminal to play music and manually determine whether the speaker installed in the terminal can emit sound normally by listening with ears. In addition, the user can also disassemble the device to measure components, or capture logs and submit them to the R & D personnel to further locate and analyze whether it is a hardware fault or a software fault. Another example is in the scenario of device factory shipment. The user can also perform a similar process to manually detect whether the speaker is missing or faulty, etc., which will not be elaborated here.

[0050] It can be seen that in the above-described embodiments, on the one hand, the manual detection method cannot quickly detect whether there is a hardware fault in the speaker, and it also has relatively high requirements for the user's technical level (such as skills like disassembling and repairing the device, analyzing logs, etc.), resulting in problems of low detection efficiency and high technical difficulty. On the other hand, if there are multiple speakers installed in the terminal, it is easy to get confused and misjudge when determining whether each speaker can emit sound normally by listening with ears.

[0051] The following introduces the hardware fault detection method provided by the present disclosure through specific embodiments in combination with specific application scenarios. Please refer to Figure 1 , Figure 1 which is a flowchart of a hardware fault detection method shown according to an exemplary embodiment.

[0052] In some embodiments, the hardware fault detection method provided by the present disclosure can be executed by a terminal.

[0053] In some embodiments, the terminal includes, for example, at least one of a mobile phone, a wearable device, an Internet of Things device, an automobile with communication function, a smart automobile, a tablet computer (Pad), a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal device in industrial control, a wireless terminal device in self-driving, a wireless terminal device in remote medical surgery, a wireless terminal device in smart grid, a wireless terminal device in transportation safety, a wireless terminal device in smart city, and a wireless terminal device in smart home, but is not limited thereto.

[0054] For example, the hardware fault detection method provided by the present disclosure can be used to detect faults in the audio output devices carried by terminals with the Android Operating System. For another example, the hardware fault detection method provided by the present disclosure can be used to detect faults in the audio output devices carried by embedded devices with other Linux systems that are not Android.

[0055] In some embodiments, the hardware fault detection method provided by the present disclosure can be executed by an application for detecting hardware faults running on a terminal.

[0056] For example, the application can be a CIT (Continuous Integration Testing) tool for testing each hardware module carried by the terminal, or the application can also be a third-party application for automatically detecting speaker faults, etc., which will not be listed one by one here.

[0057] In some embodiments, a terminal can carry one or more audio output devices. When the terminal carries multiple audio output devices, the hardware fault detection method provided by the present disclosure can be used to detect at least some of the audio output devices specified by the user, or can detect all the audio output devices carried by the terminal in response to a single detection operation.

[0058] To enable those skilled in the art to better understand the technical solution provided by the present disclosure, first, taking the hardware fault detection of one audio output device as an example, the present disclosure will be described exemplarily in combination with Figure 1 Then, taking the hardware fault detection of multiple audio output devices as an example, the present disclosure will be described exemplarily in combination with Figure 2 the present disclosure.

[0059] As Figure 1 shown, the hardware fault detection method can include the following steps.

[0060] In step 102, in response to a detection operation on the audio output device carried by the terminal, obtain the impedance value of the audio output device when the terminal plays an audio file.

[0061] In step 104, if the impedance value of the audio output device is outside the preset value range, determine that the audio output device has a fault.

[0062] For example, an application for hardware fault detection of an audio output device is running on a terminal. The user interface (UI) of the application may include a confirmation detection option. In response to a click operation by the user on the confirmation detection option in the user interface, a detection operation for the audio output device #1 installed on the terminal can be detected, and then the impedance value Re[0] of the audio output device #1 when the terminal plays a preset audio file can be obtained. The preset value range is [Re min , Re max . If Re[0] < Re min or Re[0] > Re max , it can be determined that there is a hardware fault in the audio output device #1.

[0063] Optionally, in the above embodiment, if Re[0] ∈ [Re min , Re max , it can be determined that there is no hardware fault in the audio output device #1, which at least indicates that no hardware fault in the audio output device #1 is found through the fast automatic detection method.

[0064] It should be noted that regarding the specific triggering method of the detection operation, only an exemplary description is given in the above embodiment, and it does not make a special limitation on the present disclosure. For example, the confirmation detection option can be specifically configured as the "one - key speaker detection" button in the user interface, the "detection" button for one or more speakers installed on the terminal, the "one - key terminal hardware detection" button, and so on. Another example is that in response to the program startup event of the application for detecting the hardware fault of the speaker, a detection operation for the audio output device installed on the terminal can be detected, that is, it is default to automatically detect whether there is a fault in the audio output device installed on the terminal after the application is started.

[0065] Among them, in step 102, if the detection operation is for one audio output device installed on the terminal, it can be that the terminal only has one audio output device, or the user specifies to detect a certain audio output device among multiple audio output devices installed on the terminal, and no special limitation is made here.

[0066] Among them, in step 102, the impedance value of the audio output device can be obtained directly from the sysfs file node or memory, or can be calculated by the application itself. The impedance value of the audio output device stored in the sysfs file node or memory can be stored after being calculated by other applications installed on the terminal. For example, the speaker protection algorithm of the Audio Digital Signal Processor (ADSP) can collect the IV (voltage and current) feedback signals of each audio output device, and calculate information such as the impedance value and output power of each audio output device based on the collected IV feedback signals to protect the audio output device from overload damage. After calculating the impedance value of each audio output device, the ADSP can associate and store it with the corresponding audio output device identifier, and store it in the sysfs file node or memory.

[0067] It should be noted that the impedance value of the audio output device can represent the degree of obstruction of the audio output device to the electrical signal, and is used to describe the relative relationship between the current and voltage introduced through it. The impedance value is related to the resistance value and reactance value. The speaker impedance is a complex electrical property, and the specific calculation method will not be elaborated here. For related technologies, those skilled in the art can calculate the impedance value of the audio output device based on the obtained IV feedback signal of the audio output device.

[0068] Among them, in step 102, the audio file can be pre-configured or selected by the user himself. For example, the audio file can be a pre-configured silent audio file or an audio file selected by the user himself for hardware fault testing.

[0069] Among them, in step 104, the preset value range is related to the audio output device to be measured. The upper limit value and the lower limit value of the preset value range can be set by those skilled in the art as needed. The present disclosure does not make special limitations on the specific values of the preset value range. For example, the preset value range can be [5600, 8400], that is, the lower limit value Re min is 5600 mΩ, and the upper limit value Re max is 8400 mΩ.

[0070] As can be seen from the above embodiments, in response to a detection operation on the audio output device carried by the terminal, the impedance value of the audio output device when the terminal plays an audio file can be obtained, and based on whether the impedance value of the audio output device is within a preset value range, it can be determined whether the audio output device has a fault. Accordingly, the terminal can quickly and automatically detect whether there are hardware faults in each audio output device carried by itself, and also reduces the technical level requirements for users (such as obtaining the hardware fault detection result with one key trigger), thereby improving the efficiency of hardware fault detection for the audio output devices carried by the terminal. In scenarios such as device production and after-sales maintenance, it is beneficial to save time costs and labor costs. Moreover, compared with the manual detection method, if there are multiple audio output devices carried on the terminal, it is beneficial to improve the accuracy of the detection results and avoid confusion and misjudgment.

[0071] In a possible implementation manner, the preset value range is greater than or equal to a first value and less than or equal to a second value; in this case, in step 104, if the impedance value of the audio output device is outside the preset value range and it is determined that the audio output device has a fault, it may include: if the impedance value of the audio output device is less than the first value, it is determined that the audio output device is short-circuited; if the impedance value of the audio output device is greater than the second value, it is determined that the audio output device is open-circuited.

[0072] For example, the first value is Re min , and the second value is Re max , then the preset value range is [Re min , Re max ; in response to a detection operation on the audio output device #1 carried by the terminal, the impedance value Re[0] of the audio output device #1 when the terminal plays a preset audio file can be obtained; if Re[0] < Re min , then it can be determined that the audio output device #1 is short-circuited, that is, it can be determined that the audio output device #1 has a hardware fault and the fault type is short-circuit.

[0073] For another example, the first value is Re min , and the second value is Re max , then the preset value range is [Re min , Re max ; in response to a detection operation on the audio output device #1 carried by the terminal, the impedance value Re[0] of the audio output device #1 when the terminal plays a preset audio file can be obtained; if Re[0] > Re max , then it can be determined that the audio output device #1 is open-circuited, that is, it can be determined that the audio output device #1 has a hardware fault and the fault type is open-circuit.

[0074] As can be seen from the above embodiments, when the audio output device is short-circuited, the impedance value of the audio output device is significantly smaller than the normal impedance value, and when the audio output device is open-circuited, the impedance value of the audio output device is significantly larger than the normal impedance value. Therefore, by determining whether the impedance values of the audio output devices of the terminal during audio file playback are outside the preset range, it is possible to automatically determine whether there are hardware failures in the audio output devices, and it is also possible to automatically determine the types of failures of the audio output devices, thereby assisting the user to more accurately locate the failures.

[0075] In a possible implementation, in order to ensure that the impedance values of the audio output devices of the terminal during audio file playback are stable, the loudness of the audio file used in the process of hardware failure detection can be fixed when being played. If the abscissa is time and the ordinate is loudness, then the "time-loudness" curve of such an audio file when being played can be a straight line parallel to the x-axis.

[0076] In some possible implementations, the audio file can be a silent audio file, that is, an audio file with a fixed loudness of 0 dB when being played. It should be noted that the silent audio file involved in the present disclosure can also be referred to as a mute file, and there is no sound that can be heard by the user when such an audio file is played.

[0077] In a possible implementation, in step 102, the obtaining of the impedance value of the audio output device when the terminal plays an audio file in response to a detection operation on the audio output device carried by the terminal may include: in response to a detection operation on the audio output device carried by the terminal, controlling the terminal to play the audio file; when the terminal plays the audio file, collecting the feedback signal of the audio output device; and calculating the impedance value of the audio output device according to the feedback signal of the audio output device.

[0078] For example, in response to a detection operation on audio output device #1, the terminal can be controlled to play a pre-configured silent audio file to enable the power amplifier device to drive the speaker; when the terminal plays this silent audio file, the power amplifier device can transmit the IV feedback signal of the speaker in real time through the TDM / I2S (Time Division Multiplexing / Inter-IC Sound) bus interface, so that the application can collect the IV feedback signal of audio output device #1; further, the impedance value Re[0] of audio output device #1 can be calculated according to the collected IV feedback signal.

[0079] It should be noted that the TDM / I2S bus interface is a digital audio interface standard for transmitting audio data between audio devices. In the embodiments of the present disclosure, collecting the feedback signal of the audio output device through the TDM / I2S bus interface is merely an exemplary description and will not be elaborated herein.

[0080] As can be seen from the above embodiments, regardless of whether other application programs installed on the terminal collect the IV feedback signals of each audio output device and calculate the impedance values of each audio output device, in response to the detection operation for the audio output device, the application program for hardware fault detection can independently control the terminal to play an audio file to collect the feedback signals of each audio output device and calculate the impedance values of each audio output device, and then determine whether there are hardware faults in each audio output device according to the impedance values of each audio output device, thereby ensuring the reliability of hardware fault detection.

[0081] In the above implementation manner, collecting the feedback signal of the audio output device may include: continuously sampling the feedback signal of the audio output device to obtain the feedback signals of the audio output device at multiple moments. In this case, calculating the impedance value of the audio output device according to the feedback signal of the audio output device may include: calculating the real-time impedance values of the audio output device at the multiple moments according to the feedback signals of the audio output device at the multiple moments; determining the average value of the real-time impedance values of the audio output device at the multiple moments as the impedance value of the audio output device.

[0082] For example, when the terminal plays a silent audio file, the IV feedback signal of the audio output device #1 within n clock cycles can be continuously sampled to obtain the IV feedback signals of the audio output device #1 at moments t1, t2,..., tn, etc.; further, according to the IV feedback signal of the audio output device #1 at moment t1, the real-time impedance value R t1 [0] of the audio output device #1 at moment t1 can be calculated. Similarly, the real-time impedance values R t2 [0],..., R tn [0] of the audio output device #1 at other moments can also be calculated; further, according to Re[0] = (R t1 [0] + R t2 [0] +... + R tn [0]) ÷ n, the impedance value Re[0] of the audio output device #1 can be calculated.

[0083] As can be seen from the above embodiments, due to the influence of the alternating current signal, the real-time impedance values of each audio output device may not be fixed values. Therefore, by continuously sampling the feedback signal of the audio output device when playing an audio file on the terminal, first calculating the real-time impedance values of the audio output device at different times according to the feedback signals of the audio output device at different times, and then determining the impedance value of the audio output device by adding and averaging, and using this as the basis for judging whether there is a hardware failure in the audio output device is beneficial to improving the accuracy of hardware failure detection.

[0084] In a possible implementation manner, the method further includes: presenting to the user the detection result for the audio output device carried by the terminal, where the detection result includes at least one of the following: the impedance value of the audio output device; whether there is a failure in the audio output device; the type of failure of the audio output device. The type of failure may specifically include, but is not limited to, connection short circuit, connection open circuit, no failure, etc.

[0085] For example, in response to a detection operation for audio output device #1, the impedance value Re[0] of audio output device #1 when the terminal plays a preset audio file can be obtained; if Re[0]<Re min , it can be determined that audio output device #1 has a connection short circuit, and it can also output "Audio output device #1, Re[0], connection short circuit" in the user interface of the application to present the detection result for audio output device #1 to the user.

[0086] In a possible implementation manner, if it is necessary to detect multiple audio output devices carried by the terminal, the detection results for each audio output device can be presented to the user separately.

[0087] For example, in response to a detection operation for audio output device #1, audio output device #2, and audio output device #3 carried by the terminal, the impedance values of audio output device #1, audio output device #2, and audio output device #3 when the terminal plays an audio file can be obtained to determine whether there is a hardware failure in each audio output device in combination with a preset value range, and the detection results for each audio output device carried by the terminal as shown in Table 1 can be output in the user interface.

[0088] Hardware identifier Whether there is a hardware fault Fault type Audio output device #1 Yes Short circuit in connection Audio output device #2 Yes Open circuit in connection Audio output device #3 No /

[0089] Table 1

[0090] As can be seen from the above embodiments, in response to a detection operation on the audio output device carried by the terminal, the impedance value of the audio output device when the terminal plays an audio file can be obtained. According to whether the impedance value of the audio output device is within a preset value range, it can be determined whether the audio output device has a fault, and the detection result for the audio output device can be presented to the user. Accordingly, the terminal can quickly and automatically detect whether there are hardware faults in each audio output device carried by itself, and also reduces the technical level requirements for users (such as obtaining the hardware fault detection result by one-key triggering), thereby improving the efficiency of hardware fault detection for the audio output devices carried by the terminal. In scenarios such as device production and after-sales maintenance, it is beneficial to save time costs and labor costs.

[0091] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of another hardware fault detection method shown according to an exemplary embodiment. As Figure 2 shown, the method may include the following steps.

[0092] In step 201, control the terminal to play a silent audio file.

[0093] For example, if the terminal is equipped with M (M is a positive integer) audio output devices, in response to a detection operation on the M audio output devices carried by the terminal, the terminal can be controlled to play a pre-configured silent audio file.

[0094] In step 202, obtain the impedance values of each audio output device when the terminal plays the silent audio file.

[0095] In step 203, determine whether the impedance values of all audio output devices to be detected have been obtained; if so, continue to execute step 204; if not, continue to execute step 202.

[0096] For example, when the terminal plays the silent audio file, the impedance values Re[i] (i = 0, 1,..., M - 1) of the M audio output devices can be obtained. Among them, Re[i] can be directly obtained from the sysfs file node, or the fault detection application can collect the real-time impedance values R tn [i] of each audio output device at different times and calculate it by adding and averaging.

[0097] In step 204, determine whether the impedance values of each audio output device are within a preset value range; if so, continue to execute step 205, if not, continue to execute step 206.

[0098] In step 205, determine that the audio output device has no hardware fault.

[0099] In step 206, it is determined that there is a hardware failure in the audio output device.

[0100] For example, for each of the M audio output devices, if Re[i] ∈ [Re min , Re max , it can be determined that there is no hardware failure in the audio output device; if Re[i] < Re min or Re[i] > Re max , it can be determined that there is a hardware failure in the audio output hardware.

[0101] It should be noted that for the specific implementation manners of steps 201 - 206, reference can be made to the specific implementation manners of steps 102 - 104, which will not be elaborated here.

[0102] Corresponding to the foregoing embodiments of the hardware failure detection method, the present disclosure also provides embodiments of a hardware failure detection device.

[0103] Please refer to Figure 3 , Figure 3 which is a schematic block diagram of a hardware failure detection device shown according to an embodiment of the present disclosure. As Figure 3 shown, the hardware failure detection device 300 may include an acquisition module 302 and a determination module 304, where:

[0104] The acquisition module is configured to obtain the impedance value of the audio output device when the terminal plays an audio file in response to a detection operation on the audio output device carried by the terminal;

[0105] The determination module is configured to determine that there is a failure in the audio output device if the impedance value of the audio output device is outside a preset value range.

[0106] In some embodiments, the acquisition module includes:

[0107] A control sub-module, configured to control the terminal to play the audio file in response to a detection operation on the audio output device carried by the terminal;

[0108] An acquisition sub-module, configured to acquire the feedback signal of the audio output device when the terminal plays the audio file;

[0109] A calculation sub-module, configured to calculate the impedance value of the audio output device according to the feedback signal of the audio output device.

[0110] In some embodiments, the acquisition sub-module is configured to:

[0111] Continuously sample the feedback signal of the audio output device to obtain the feedback signals of the audio output device at multiple moments;

[0112] The calculation sub-module is used for:

[0113] Calculate the real-time impedance values of the audio output device at the multiple moments according to the feedback signals of the audio output device at the multiple moments;

[0114] Determine the average value of the real-time impedance values of the audio output device at the multiple moments as the impedance value of the audio output device.

[0115] In some embodiments, the loudness of the audio file when being played is fixed.

[0116] In some embodiments, the audio file is a silent audio file.

[0117] In some embodiments, the preset value range is greater than or equal to a first value and less than or equal to a second value;

[0118] The determination module includes:

[0119] The first determination sub-module is used for determining that the audio output device is short-circuited if the impedance value of the audio output device is less than the first value;

[0120] The second determination sub-module is used for determining that the audio output device is open-circuited if the impedance value of the audio output device is greater than the second value.

[0121] In some embodiments, the device further includes:

[0122] A display module for displaying to the user the detection results for the audio output device carried by the terminal, where the detection results include at least one of the following:

[0123] The impedance value of the audio output device;

[0124] Whether the audio output device has a fault;

[0125] The fault type of the audio output device.

[0126] Regarding the device 300 in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments of the related methods, and will not be elaborated here.

[0127] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the descriptions in the method embodiments. The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed to multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the present disclosure solution. Those of ordinary skill in the art can understand and implement it without creative efforts.

[0128] Embodiments of the present disclosure also propose an electronic device, including:

[0129] A processor;

[0130] A memory for storing processor-executable instructions;

[0131] Wherein, the processor is configured to implement the method described in any of the above embodiments.

[0132] Embodiments of the present disclosure also propose a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the steps in the method described in any of the above embodiments.

[0133] Figure 4 FIG. is a schematic block diagram of a device 400 for hardware fault detection shown according to an embodiment of the present disclosure. For example, the device 400 can be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0134] Referring to Figure 4 , the device 400 may include one or more of the following components: a processing component 402, a memory 404, a power supply component 406, a multimedia component 408, an audio component 410, an input / output (I / O) interface 412, a sensor component 414, and a communication component 416.

[0135] The processing component 402 generally controls the overall operation of the device 400, such as operations associated with display, telephone calls, data communication, camera operations, and recording operations. The processing component 402 may include one or more processors 420 to execute instructions to complete all or part of the steps of the above method. In addition, the processing component 402 may include one or more modules to facilitate the interaction between the processing component 402 and other components. For example, the processing component 402 may include a multimedia module to facilitate the interaction between the multimedia component 408 and the processing component 402.

[0136] The memory 404 is configured to store various types of data to support the operation of the device 400. Examples of such data include instructions for any application or method operating on the device 400, contact data, phone book data, messages, pictures, videos, and the like. The memory 404 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk, or an optical disk.

[0137] The power supply component 406 provides power to various components of the device 400. The power supply component 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 400.

[0138] The multimedia component 408 includes a screen that provides an output interface between the device 400 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can not only sense the boundaries of the touch or swipe actions but also detect the duration and pressure associated with the touch or swipe operation. In some embodiments, the multimedia component 408 includes a front camera and / or a rear camera. When the device 400 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have focal length and optical zoom capabilities.

[0139] The audio component 410 is configured to output and / or input audio signals. For example, the audio component 410 includes a microphone (MIC) that is configured to receive external audio signals when the device 400 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 404 or transmitted via the communication component 416. In some embodiments, the audio component 410 further includes a speaker for outputting audio signals.

[0140] The I / O interface 412 provides an interface between the processing component 402 and a peripheral interface module, which can be a keyboard, a click wheel, buttons, etc. These buttons can include, but are not limited to: a home button, a volume button, a power-on button, and a lock button.

[0141] The sensor assembly 414 includes one or more sensors for providing a status assessment of various aspects of the device 400. For example, the sensor assembly 414 can detect the on / off state of the device 400, the relative positioning of components, such as the display and keypad of the device 400. The sensor assembly 414 can also detect a change in the position of the device 400 or a component of the device 400, the presence or absence of user contact with the device 400, the orientation or acceleration / deceleration of the device 400, and the temperature change of the device 400. The sensor assembly 414 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 414 can also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 can also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0142] The communication component 416 is configured to facilitate communication between the device 400 and other devices in a wired or wireless manner. The device 400 can access a wireless network based on communication standards, such as WiFi, 2G or 3G, 4G LTE, 5G NR, or a combination thereof. In an exemplary embodiment, the communication component 416 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 416 further includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0143] In an exemplary embodiment, the device 400 can be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the methods described in any of the above embodiments.

[0144] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions, such as the memory 404 including instructions, is also provided. The above instructions can be executed by the processor 420 of the device 400 to complete the above methods. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.

[0145] Other embodiments of the present disclosure will be readily apparent to those skilled in the art upon consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include known common general knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and examples are only to be considered as exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.

[0146] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.

Claims

1. A hardware fault detection method, characterized in that, the method includes: responding to a detection operation on the audio output device carried by the terminal, and obtaining the impedance value of the audio output device when the terminal plays an audio file; if the impedance value of the audio output device is outside the preset value range, it is determined that the audio output device has a fault.

2. The method according to claim 1, characterized in that, the step of responding to a detection operation on the audio output device carried by the terminal and obtaining the impedance value of the audio output device when the terminal plays an audio file includes: responding to a detection operation on the audio output device carried by the terminal, and controlling the terminal to play the audio file; when the terminal plays the audio file, collecting the feedback signal of the audio output device; calculating the impedance value of the audio output device according to the feedback signal of the audio output device.

3. The method according to claim 2, characterized in that, the step of collecting the feedback signal of the audio output device includes: continuously sampling the feedback signal of the audio output device to obtain the feedback signals of the audio output device at multiple moments; the step of calculating the impedance value of the audio output device according to the feedback signal of the audio output device includes: calculating the real-time impedance values of the audio output device at the multiple moments according to the feedback signals of the audio output device at the multiple moments; determining the average value of the real-time impedance values of the audio output device at the multiple moments as the impedance value of the audio output device.

4. The method according to claim 1, characterized in that, the loudness of the audio file when being played is fixed.

5. The method according to claim 4, characterized in that, the audio file is a silent audio file.

6. The method according to claim 1, characterized in that, the preset value range is greater than or equal to a first value and less than or equal to a second value; the step of if the impedance value of the audio output device is outside the preset value range, it is determined that the audio output device has a fault includes: if the impedance value of the audio output device is less than the first value, it is determined that the audio output device is short-circuited; if the impedance value of the audio output device is greater than the second value, it is determined that the audio output device is open-circuited.

7. The method according to claim 1, characterized in that, the method further includes: displaying the detection result of the audio output device carried by the terminal to the user, where the detection result includes at least one of the following: the impedance value of the audio output device; whether the audio output device has a fault; the fault type of the audio output device.

8. A hardware fault detection device, characterized in that, the device includes: an acquisition module, configured to respond to a detection operation on the audio output device carried by the terminal, and obtain the impedance value of the audio output device when the terminal plays an audio file; a determination module, configured to determine that the audio output device has a fault if the impedance value of the audio output device is outside the preset value range.

9. An electronic device, characterized in that, comprising: a processor; a memory for storing processor-executable instructions; wherein, the processor is configured to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, when the program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.