A closed-loop self-test method for hardware devices of intelligent equipment
The closed-loop self-test method of speaker playback audio, microphone recording and camera similarity comparison solves the problem that smart device hardware device detection relies on manual operation, realizes local automated detection and abnormal judgment of the device, reduces costs and improves detection reliability.
Patent Information
- Application Number
- CN202111090042.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-17
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2041-09-17
AI Technical Summary
The hardware device detection of existing smart devices requires manual operation and judgment, and closed-loop self-test cannot be achieved. The speaker self-test technology relies on hardware modules and servers to upload data, so it cannot implement self-test locally on the device.
Audio is played through speakers, microphone recording, cycle sampling and analysis of decibel values, combined with camera photo similarity comparison, realize closed-loop self-test of hardware devices and automatically determine device status.
It realizes closed-loop self-test of intelligent equipment without manual intervention, reduces operation and maintenance costs, can detect abnormal states of hardware devices, and has a wider range of application scenarios and reliability.
Smart Images

Figure CN113891227B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of hardware component detection of intelligent devices, and in particular to a closed-loop self-detection method for hardware components of intelligent devices. Background Art
[0002] Currently, smart devices (such as Android devices) use a built-in factory test application to check whether their hardware components, such as cameras, microphones, and speakers, are available and in normal working order. This is done manually through a built-in factory test application. The camera test typically involves the operator using the application to open the camera preview and visually observe the camera imaging effect. The microphone test involves the operator using the application's recording function to record an audio clip, then playing the audio back and manually judging whether it is normal. The speaker test involves the operator playing an audio clip and manually judging the audio playback effect to confirm whether it is normal. The above test method has at least two shortcomings: first, it requires interface operation, otherwise the operator cannot initiate the corresponding inspection work; second, it requires manual confirmation of the output and manual judgment to conclude whether the hardware components are normal.
[0003] Existing speaker self-testing technologies, such as Chinese patent CN107454539A, disclose a large speaker self-testing system and method. This system uses a hardware module to collect audio signals, convert them into analog electrical signals, and then compare the analog electrical signals with baseline values to output the results. This technology is highly hardware-dependent and requires the coordination of different modules. Otherwise, the self-test function cannot be realized. Furthermore, the collected data must be uploaded to a server for testing, making it impossible to perform self-testing and outputting results locally on the device. This does not truly achieve closed-loop self-testing for smart devices. Summary of the Invention
[0004] To overcome the aforementioned shortcomings of the prior art, the present invention provides a closed-loop self-test method for hardware components of an intelligent device, which is used to automatically detect and determine whether a microphone and a speaker are operating abnormally, comprising the following steps:
[0005] Sampling, the speaker starts playing audio, and at the same time, the microphone starts recording;
[0006] Cycle sampling and save sampling data;
[0007] End audio playback, recording and loop sampling operations;
[0008] Data processing, obtaining the maximum decibel value and the median decibel value;
[0009] Abnormal judgment and output judgment results.
[0010] The abnormality judgment is: if the maximum decibel value is greater than a preset expected normal minimum maximum value, and the median decibel value is greater than a preset expected normal minimum median value, then it is judged that the microphone and the speaker are normal; otherwise, it is judged that the microphone and / or the speaker are abnormal;
[0011] When the judgment result is that the microphone and the speaker are abnormal, further comparison and judgment are performed as follows: if the maximum decibel value is less than the preset expected abnormal minimum maximum value and / or the median decibel value is less than the preset expected abnormal minimum median value, then it is judged that the speaker is abnormal; otherwise, it is judged that the microphone is abnormal.
[0012] The present invention may also adopt the following optional / preferred solutions:
[0013] The storing of the sampled data is to convert the maximum amplitude value in each sample into a decibel value and store the converted value.
[0014] The cyclic sampling is performed at a predetermined time interval and a predetermined number of times.
[0015] The lower limit of the range of the expected median and maximum decibel values is obtained by: playing audio through a speaker while recording it with a microphone, then cyclically sampling the recording and converting the maximum amplitude value in each sample into a decibel value; a list of decibel values in each time period is obtained based on a preset number of cyclic samplings, and then the maximum decibel value and the median decibel value are further calculated; the above steps are repeated in different set scenarios to obtain the maximum decibel value and the median decibel value in each scenario, and then the lower limit of the expected maximum decibel value range and the lower limit of the expected median decibel value range are set based on this.
[0016] The automatic execution mode of the closed-loop self-test method includes at least: automatic startup each time the smart device is powered on, automatic startup at predetermined time intervals when the smart device is powered on, and startup through remote control.
[0017] It also includes determining whether the camera is working abnormally, including the following steps:
[0018] Confirm whether the camera is mounted. If not, it is judged as abnormal. If yes, continue with the subsequent judgment;
[0019] Open the camera and initialize the parameters;
[0020] Open the camera preview and take a photo to generate a photo, and release the camera after taking the photo;
[0021] The photo generated by taking the photo is compared with the preset abnormal picture template for similarity. If the similarity is greater than the preset similarity expected value, it is determined that the camera is abnormal; otherwise, it is determined that the camera is normal.
[0022] The similarity comparison comprises:
[0023] The step of converting the photo into a binary fingerprint code;
[0024] The binary fingerprint code is compared with the binary fingerprint code of the preset abnormal image template to obtain a similarity comparison result.
[0025] The conversion of the photo into a binary fingerprint code is achieved using a perceptual hashing algorithm.
[0026] The abnormal picture template includes at least a completely black picture and a completely white picture.
[0027] The beneficial effects of the present invention include:
[0028] In the present invention, firstly, the speaker is used to play audio, while the microphone is used to pick up sound. In the application software, audio data is collected in a complementary form of playing and recording at the same time. And by analyzing the recorded sample data, it is possible to judge whether the working status of the relevant components is abnormal, completing the closed-loop self-test of the two hardware components, that is, truly realizing the closed-loop self-test of the smart device. Because the self-test process does not require manual intervention / judgment, the workload of operation and maintenance is reduced. Moreover, because it can be achieved through software, there is no need to increase hardware investment, the cost is low and it is easy to implement. In addition, the closed-loop self-test of the present invention uses the final output as the detection object, which can not only detect the abnormality of the speaker and / or microphone being completely unable to work, but also detect the abnormality of the sound of the audio played by the speaker becoming smaller, etc., with a more reliable and practical detection effect, and therefore has a wider range of application scenarios and value.
[0029] The method for determining whether a camera is working abnormally in the present invention can solve the following problem that cannot be determined in the prior art: after power-on, the device is mounted normally, but cannot work normally, such as the camera imaging is completely black or completely white, and such abnormal situations cannot be distinguished. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 It is a flow chart of the closed-loop self-test method of the present invention.
[0031] Figure 2 The figure is a flow chart of a closed-loop self-test method according to a specific embodiment.
[0032] Figure 3 The audio decibel value curve corresponding to the first sampling data.
[0033] Figure 4 It is the audio decibel value curve corresponding to the second sampling data.
[0034] Figure 5 is a flow chart of a closed-loop self-test method according to another specific embodiment. DETAILED DESCRIPTION
[0035] The following is combined with Figure 1-5 The present invention will be further described in the following sections and specific embodiments. It should be emphasized that the following description is merely illustrative and is not intended to limit the scope of the present invention or its application. The background section of the present invention may include background information about the problem or environment of the present invention, but does not necessarily describe the prior art. Therefore, the inclusion of content in the background section does not constitute an admission by the applicant of prior art.
[0036] Example 1
[0037] like Figure 1 As shown, the closed-loop self-test method for hardware components of the smart device of this embodiment is used to automatically detect and determine whether the microphone and speaker are working abnormally, including:
[0038] In the sampling step, the speaker starts playing audio and the microphone starts recording;
[0039] Cycle sampling and save sampling data;
[0040] End audio playback, recording and loop sampling operations;
[0041] Data processing, obtaining the maximum decibel value and the median decibel value;
[0042] Abnormal judgment and output judgment result step.
[0043] like Figure 2 The figure shows a flowchart of a closed-loop self-test method according to a specific embodiment. The decibel sampling step involves playing audio through a speaker while simultaneously recording it with a microphone. The recording is then sampled in a loop, and the maximum amplitude value in each sample is converted to a decibel value. Specifically, after the device is powered on, the software automatically starts, recognizes the power-on event, and initiates the closed-loop self-test. One delay thread prepares to play the audio, while another thread performs some initialization work to prepare for recording. Once preparations are complete, recording begins. Once recording begins, the previously delayed thread begins playing the recorded audio. During the recording process, the application will periodically repeat the operation of obtaining the maximum amplitude of the samples. Each obtained maximum amplitude value is converted to a decibel value and stored in a table, completing the decibel sampling step. The sampling cycle is performed at predetermined intervals and a predetermined number of times, which can be selected and set based on actual environmental conditions.
[0044] The maximum and median decibel values are obtained by sampling the decibel values for each time period over a preset number of cycles, and then calculating the maximum and median decibel values. Under normal circumstances, microphone recording will capture the audio played by the speaker, resulting in a distinct curve distribution of decibel values as the audio changes, with a clear range of decibel fluctuations. Figure 2 and Figure 3 The graphs are for the two data collection lists 1 and 2. They are just examples for easy understanding. The actual situation may vary, so it is not limited to this.
[0045] The lower limit of the range of the expected median and maximum decibel values is obtained by:
[0046] The audio is played through a speaker while being recorded by a microphone, and then the recording is sampled in a loop and the maximum amplitude value in each sample is converted to a decibel value.
[0047] Based on the list of decibel values in each time period obtained by the preset number of cyclic sampling, the maximum decibel value and the median decibel value are further calculated. At the same time, the judgment flag bit of the cyclic data acquisition operation is changed to end the loop.
[0048] Repeat the above steps in different set scenarios to obtain the maximum decibel value and the median decibel value in each scenario, and then use this to set the lower limit of the expected maximum decibel value range and the lower limit of the expected median decibel value range.
[0049] The following is a record of the sampling results of this embodiment.
[0050] The first data collection list is as follows:
[0051] 0.00, 0.00, 44.66, 47.42, 46.24, 42.54, 39.82, 39.08, 37.84, 38.06, 38.28, 43.52, 43.11, 42.80, 38.69, 38.06, 45.53, 43.05, 43.17, 37.84, 38.49, 36.40, 37.62, 39.65, 37.1 5, 38.59, 37.15, 39.37, 38.89, 37.62, 38.99, 37.73, 39.28, 40.83, 37.73, 59.03, 57.85, 60.34, 59.16, 71.07, 67.54, 53.40, 69.27, 69.12, 43.17, 60.54, 67.85, 58.62, 72.11.
[0052] The second data collection list is as follows:
[0053] 0.00, 0.00, 46.97, 47.12, 44.71, 40.51, 37.38, 36.26, 37.84, 37.38, 37.50, 37.62, 37.03, 36.52, 35.27, 38.28, 36.90, 36.78, 35.56, 36.12, 35.56, 36.12, 35.85, 37.62, 36.6 5, 35.56, 35.85, 36.12, 36.12, 37.95, 36.12, 36.78, 35.56, 36.39, 43.69, 59.79, 57.43, 57.38, 59.35, 71.30, 62.36, 52.00, 69.96, 66.04, 42.41, 36.90, 37.84, 36.90, 36.39.
[0054] It should be noted that: because the audio playback thread is affected by delayed execution, there are slight differences in the two playback times, which leads to certain differences in the curve graph of the interval time collection data, but it does not affect the acquisition of the main judgment features of the audio, that is, the median and maximum values we need, which have a fixed range. Based on this, through multiple test statistics in different scenarios, we can set the effective lower limit of the range of the expected normal decibel median and the lower limit of the range of the expected normal decibel maximum. The lower limit of the range of the expected normal decibel median and the lower limit of the range of the expected normal decibel maximum can be set each time, or can be set once and used multiple times.
[0055] Abnormality Judgment: If the maximum decibel value is greater than the preset expected normal minimum maximum value, and the median decibel value is greater than the preset expected normal minimum median value, then the microphone and speaker are judged to be normal; otherwise, the microphone and / or speaker are judged to be abnormal. If the judgment result is that the microphone and speaker are abnormal, a further judgment is made as follows: If the maximum decibel value is less than the preset expected abnormal minimum maximum value and / or the median decibel value is less than the preset expected abnormal minimum median value, then the speaker is judged to be abnormal; otherwise, the microphone is judged to be abnormal.
[0056] Finally, the judgment result of the closed-loop self-test is output.
[0057] It is worth noting that the automatic execution methods of the closed-loop self-test method include at least: automatically starting each time the smart device is turned on, automatically starting at a predetermined time interval when the smart device is turned on, and starting through remote control. The specific method or methods can be selected or combined as needed.
[0058] Example 2
[0059] like Figure 4 As shown, based on the first embodiment, this embodiment further includes determining whether the camera is working abnormally, including the following steps:
[0060] Confirm whether the camera is mounted. If not, it is judged as abnormal. If yes, continue with the subsequent judgment;
[0061] Open the camera and initialize the parameters;
[0062] Open the camera preview and take a photo to generate a photo, and release the camera after taking the photo;
[0063] The photo generated by taking the photo is compared with the preset abnormal picture template for similarity. If the similarity is greater than the preset similarity expected value, it is determined that the camera is abnormal; otherwise, it is determined that the camera is normal.
[0064] The performing similarity comparison includes:
[0065] The step of converting the photo into a binary fingerprint code is implemented by using a perceptual hash algorithm;
[0066] The binary fingerprint code is compared with the binary fingerprint code of the preset abnormal image template to obtain a similarity comparison result.
[0067] The abnormal picture template includes at least a completely black picture and a completely white picture.
[0068] Finally, the closed-loop self-test and the judgment results of whether the camera is working abnormally are output.
[0069] The above is a further detailed description of the present invention in conjunction with specific preferred embodiments, and the specific implementation of the present invention should not be considered to be limited to these descriptions. Those skilled in the art will recognize that several equivalent substitutions or obvious variations can be made without departing from the scope of the present invention, and that any equivalent performance or application should be considered to fall within the scope of protection of the present invention.
[0070] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "preferred embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in a suitable manner in any one or more embodiments or examples. Those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples without contradiction. Although the embodiments of the present invention and their advantages have been described in detail, it should be understood that various changes, substitutions and modifications can be made herein without departing from the scope of protection of the patent application.
Claims
1. A closed-loop self-test method for hardware components of intelligent devices, used for automatic detection and judgment of whether microphones and speakers are working abnormally, characterized by The steps include: Sampling, the speaker starts playing audio, and at the same time, the microphone starts recording; Cycle sampling and save sampling data; End audio playback, recording and loop sampling operations; Data processing, obtaining the maximum decibel value and the median decibel value; Abnormal judgment and output of judgment results; The said saving of sampling data is to convert the maximum amplitude value in each sampling into a decibel value for saving; the said abnormality judgment is: if the said maximum decibel value is greater than the preset expected normal minimum maximum value, and the said median decibel value is greater than the preset expected normal minimum median value, then it is judged that the said microphone and the said speaker are normal, otherwise, it is judged that the said microphone or the said speaker is abnormal; when the judgment result is that the said microphone or the said speaker is abnormal, further comparison and judgment are made as follows: if the said maximum decibel value is less than the preset expected abnormal minimum maximum value or the said median decibel value is less than the preset expected abnormal minimum median value, then it is judged that the said speaker is abnormal Otherwise, it is determined that the microphone is abnormal; the expected normal minimum median value and the expected normal minimum maximum value are obtained in the following manner: audio is played through a speaker while the microphone is recording, and then the recording is cyclically sampled, and the maximum amplitude value in each sample is converted into a decibel value; a list of decibel values in each time period is obtained based on a preset number of cyclic samplings, and then the maximum decibel value and the median decibel value are further calculated; the above steps are repeated under different set scenarios to obtain the maximum decibel value and the median decibel value under each scenario, and then the expected normal minimum maximum value and the expected normal minimum median value are set based on this.
2. The closed-loop self-test method according to claim 1, wherein: The cyclic sampling is performed at a predetermined time interval and a predetermined number of times.
3. The closed-loop self-test method according to any one of claims 1 to 2, characterized in that: The automatic execution mode of the closed-loop self-test method includes at least: automatic startup each time the smart device is powered on, automatic startup at predetermined time intervals when the smart device is powered on, and startup through remote control.
4. The closed-loop self-test method according to claim 1, wherein: It also includes determining whether the camera is working abnormally, including the following steps: Confirm whether the camera is mounted. If not, it is judged as abnormal. If yes, continue with the subsequent judgment; Open the camera and initialize the parameters; Open the camera preview and take a photo to generate a photo, and release the camera after taking the photo; The photo generated by taking the photo is compared with the preset abnormal picture template for similarity. If the similarity is greater than the preset similarity expected value, it is determined that the camera is abnormal; otherwise, it is determined that the camera is normal.
5. The closed-loop self-test method according to claim 4, wherein: The similarity comparison includes: The step of converting the photo into a binary fingerprint code; The binary fingerprint code is compared with the binary fingerprint code of the preset abnormal image template to obtain a similarity comparison result.
6. The closed-loop self-test method according to claim 5, wherein: The conversion of the photo into a binary fingerprint code is achieved using a perceptual hashing algorithm.
7. The closed-loop self-test method according to any one of claims 4 to 6, characterized in that: The abnormal picture template includes at least a completely black picture and a completely white picture.
Citation Information
Patent Citations
Big loudspeaker self-detection system and method
CN107454539A
Smart TV anomaly detection method and device
CN105306931A
Testing method for loudspeaker and microphone, intelligent terminal and storage medium
CN109168120A