Bluetooth audio stability detection method and device, electronic equipment and storage medium
By simulating the audio control command generated by human-computer interaction, the audio output status of the audio playback device is automatically triggered, and stability analysis is performed based on the audio signal output by the device to be detected, solving the problem of low degree of Bluetooth audio detection in the prior art, and achieving efficient and accurate Bluetooth audio stability detection.
Patent Information
- Application Number
- CN202510053700.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-14
- Publication Date
- 2025-04-25
AI Technical Summary
In the prior art, the degree of automation of Bluetooth audio detection is low, resulting in low detection efficiency and cannot effectively solve problems such as Bluetooth audio lag and silence.
By simulating the audio control command generated by human-computer interaction, the audio output status of the audio playback device is automatically triggered, the audio signal outputted by the device to be detected is obtained, and stability analysis is performed based on the signal to realize fully automated Bluetooth audio stability detection.
It improves the automation and detection efficiency of Bluetooth audio detection, and the reliability and accuracy of detection results are higher. It can promptly capture related logs and trigger cloud alarms, and quickly locate and handle problems.
Smart Images

Figure CN119893416A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of detection technology, and in particular to a Bluetooth audio stability detection method, device, electronic device and storage medium. Background Art
[0002] With the development of wireless technology, the use of wireless technology to transmit data has become an indispensable data transmission method in daily life. At present, common wireless technologies include WiFi, Bluetooth, NFC, etc. Among them, Bluetooth technology does not rely on the network and can be connected contactlessly, so Bluetooth is widely used in various audio devices, such as car audio systems, Bluetooth speakers, Bluetooth headsets, home smart audio systems, etc. However, although Bluetooth technology has gradually matured, problems such as Bluetooth audio freezes and silence are still frequently encountered during use, which seriously affects the auditory experience and device satisfaction.
[0003] In the related art, the detection of Bluetooth audio freezes, silence and other problems is often carried out by combining manual detection with detection devices, which has a low degree of automation and leads to low detection efficiency. Summary of the invention
[0004] One of the purposes of the present invention is to provide a Bluetooth audio stability detection method to solve the problem of low automation level of Bluetooth audio detection in the prior art, resulting in low detection efficiency; the second purpose is to provide a Bluetooth audio stability detection device; the third purpose is to provide an electronic device.
[0005] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0006] A Bluetooth audio stability detection method is used to detect the audio output state of a device to be detected, wherein the device to be detected is connected to an audio playback device via Bluetooth, the audio playback device transmits audio to the device to be detected via Bluetooth, and the device to be detected plays the audio; the method comprises:
[0007] Transmitting the audio control instruction generated by simulating human-computer interaction to the audio playback device, wherein the audio control instruction is used to control the audio output state of the audio playback device;
[0008] Acquire a first audio signal output by the device to be detected, where the first audio signal reflects an audio output state of the device to be detected;
[0009] A stability analysis is performed based on the first audio signal to obtain a detection result of the device to be detected.
[0010] According to the above technical means, by simulating human-computer interaction, the audio playback device is automatically triggered to control the audio output state, for example, the audio playback device controls the audio output, and in the process of the audio playback device controlling the audio output, based on its connection with the device to be detected via Bluetooth, the audio playback device outputs the audio to the device to be detected; after the device to be detected receives the audio, it outputs an audio signal, and by detecting the first audio signal output by the device to be detected, the first audio signal is analyzed to obtain the audio stability result of the device to be detected, so as to realize the full automatic detection of the Bluetooth audio stability of the audio device to be detected and improve the detection efficiency. And triggering the audio playback device based on the audio control instruction simulating the interaction of people can make the test process more in line with the actual use scenario, so that the reliability and accuracy of the detection results are higher.
[0011] Further, when the audio control instruction is to play, play the previous song or play the next song, the stability analysis is performed based on the first audio signal to obtain the detection result of the device to be detected, including:
[0012] Obtaining a corresponding time domain signal according to the first audio signal;
[0013] According to the time domain signal, obtaining a corresponding frequency spectrum signal;
[0014] Determine the corresponding audio energy distribution according to the frequency spectrum signal;
[0015] If the audio energy distribution is not within the preset energy distribution range, the detection result of the device to be detected is obtained as abnormal;
[0016] If the audio energy distribution is within the preset energy distribution range, the detection result of the device to be detected is normal.
[0017] According to the above technical means, by analyzing the spectrum corresponding to the audio signal, the accuracy is higher and the analysis efficiency is high, and the analysis results can be obtained in time.
[0018] Further, when the audio control instruction is to pause, the stability analysis is performed based on the first audio signal to obtain the detection result of the device to be detected, including:
[0019] A weighted average is performed on the voltage values corresponding to the first audio signal within a preset time period to obtain a first voltage value in a silent state.
[0020] According to the above technical means, since there is a weak level in the silent state, the first voltage value is obtained. In subsequent detection, the first audio signal obtained can be corrected based on the first voltage value to improve the accuracy of the first audio signal analysis. In addition, for abnormal scenarios where the device to be detected is silent, the first voltage value can be used as a detection reference value to detect the reason why the device to be detected is silent.
[0021] Further, after performing stability analysis based on the first audio signal and obtaining the detection result of the device to be detected, the method further includes:
[0022] If the detection result is silence, and the duration of silence reaches a preset duration, a trigger instruction simulating a local sound generating component of the device to be detected is transmitted to the device to be detected;
[0023] Acquire a second audio signal output by the device to be detected;
[0024] Performing weighted averaging on the voltage values corresponding to the second audio signal to obtain a second voltage value;
[0025] Based on comparing the second voltage value with the first voltage value in the silent state;
[0026] If the second voltage value is greater than the first voltage value, it is determined that the device to be detected is normal;
[0027] If the second voltage value is less than or equal to the first voltage value, it is determined that the device to be detected is abnormal.
[0028] According to the above-mentioned technical means, when applied on the vehicle computer side, the silent abnormal situation of the whole vehicle on the vehicle computer side can be detected, and the test can be fully automated to enrich the application of detection functions and detection scenarios.
[0029] Further, performing stability analysis based on the first audio signal to obtain a detection result of the device to be detected includes:
[0030] If the detection result is abnormal, capture the test log and the log of the device to be detected, and / or generate abnormal alarm information according to the detection result, and upload the abnormal alarm information to the cloud server.
[0031] According to the above technical means, since the Bluetooth log is flushed quickly, it is difficult to capture the Bluetooth log at the time of detecting abnormalities. However, this embodiment is based on the way that the audio capture card collects audio signals (electrical signals) and judges whether the detected audio signals are abnormal by comparing them with the preset reference value (such as the preset energy distribution range). The detection results can be obtained in time, and then the Bluetooth log can be captured in time, providing more accurate and effective data for subsequent abnormal analysis. The cloud alarm can remind relevant personnel to deal with the abnormality in time.
[0032] Further, the invention is applied to a Bluetooth audio stability detection system, wherein the detection system comprises a differential signal converter, wherein the differential signal converter is connected in parallel to the audio output circuit of the device to be detected, wherein the differential signal converter is connected to an audio acquisition card, wherein the API of the audio acquisition card driver is encapsulated as an externally callable dynamic library, and wherein the first audio signal output by the device to be detected is obtained, comprising:
[0033] A first audio signal captured by the audio capture card is acquired based on the dynamic library.
[0034] According to the above technical means, the first audio signal can be collected in real time to achieve timely detection.
[0035] Furthermore, before acquiring the first audio signal output by the device to be detected, the method further includes:
[0036] The generated test audio is transmitted to the audio playback device, wherein when the audio playback device receives the audio control instruction, the output state of the test audio is controlled according to the audio control instruction.
[0037] According to the above technical means, on the one hand, a test audio with an adaptive frequency can be generated according to the current detection scenario for testing, so that the test result is closer to the actual application scenario of the device to be tested. On the other hand, according to the current test scenario, the actual output result of the test audio after being transmitted to the device to be tested via Bluetooth under the condition of stable Bluetooth transmission can be obtained, and the actual output result can be used as the judgment basis in the subsequent simulation scene detection process, which is more in line with the current environmental requirements and improves the detection accuracy.
[0038] Further, after performing stability analysis based on the first audio signal and obtaining the detection result of the device to be detected, the method further includes:
[0039] Adjusting the Bluetooth signal strength between the audio playback device and the device to be detected;
[0040] After adjusting the Bluetooth signal strength, the audio control instruction generated by simulating human-computer interaction continues to be transmitted to the audio playback device to detect the Bluetooth audio stability of the device to be detected.
[0041] According to the above technical means, if the detection result is abnormal, the Bluetooth signal strength can be adjusted to determine whether the cause of the Bluetooth instability of the device to be detected is related to the Bluetooth signal strength between the audio playback device and the device to be detected. Alternatively, by adjusting the Bluetooth signal strength, the Bluetooth signal strength corresponding to the strong connection stability between the device to be detected and the audio playback device can be detected for reference.
[0042] Further, the adjusting the Bluetooth signal strength between the audio playback device and the device to be detected includes:
[0043] Controlling a sliding device to move a preset distance, wherein the audio playback device is arranged on the sliding device;
[0044] Alternatively, adjust the shielding parameters of the signal shielding device.
[0045] A Bluetooth audio stability detection device is used to detect the audio output state of a device to be detected, wherein the device to be detected is connected to an audio playback device via Bluetooth, the audio playback device transmits audio to the device to be detected via Bluetooth, and the device to be detected plays the audio; the detection device comprises:
[0046] A sending module, used for sending the audio control instruction generated by simulating human-computer interaction to the audio playback device, wherein the audio control instruction is used for controlling the audio output state of the audio playback device;
[0047] An acquisition module, used for acquiring a first audio signal output by the device to be detected, where the first audio signal reflects an audio output state of the device to be detected;
[0048] A data processing module is used to perform stability analysis based on the first audio signal to obtain a detection result of the device to be detected.
[0049] An electronic device, comprising: a memory, a processor;
[0050] The memory is used to store computer programs / instructions; the processor is used to implement the above-mentioned method according to the computer programs / instructions stored in the memory.
[0051] A computer-readable storage medium stores a computer program / instruction, wherein the computer program / instruction is used to implement the method described above when executed by a processor.
[0052] A computer program product, comprising a computer program / instruction, wherein the computer program / instruction is used to implement the method as described above when executed by a processor.
[0053] Beneficial effects of the present invention:
[0054] (1) In this application, the real-time acquisition of Bluetooth audio signals by an audio capture card and the combination of spectrum analysis can improve the real-time performance of Bluetooth audio detection. Based on the real-time detection results, relevant logs can be captured and / or cloud alarms can be triggered in a timely manner, which is convenient for tracing back the problem of unstable audio Bluetooth transmission, and can quickly locate the problem and deal with it in a timely manner.
[0055] (2) Using DFT technology to perform high-precision spectrum analysis on audio signals can accurately detect freezes and silences in Bluetooth audio, thereby improving detection accuracy.
[0056] (3) In this application, the Bluetooth audio stability analysis adopts a fully automated test to automatically trigger audio playback and then trigger the audio detection process. In addition, during the test, the user's usage scenario is simulated to generate corresponding audio control instructions, so that the test process of the device to be tested and the audio playback device is based on the actual usage scenario, and the test results are more accurate and reliable. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 A schematic diagram of a scenario of a Bluetooth audio stability detection method provided in an embodiment of the present application;
[0058] Figure 2 A flowchart of a Bluetooth audio testing method provided in one embodiment of the present application;
[0059] Figure 3 A flowchart of a Bluetooth audio testing method provided by another embodiment of the present application;
[0060] Figure 4 A flowchart of a Bluetooth audio testing method provided by another embodiment of the present application;
[0061] Figure 5 A flowchart of a Bluetooth audio testing method provided by another embodiment of the present application;
[0062] Figure 6 This is a schematic diagram of a time domain signal and a frequency domain signal with a normal detection result in a detection example of the present application;
[0063] Figure 7 This is a schematic diagram of a time domain signal and a frequency domain signal showing an abnormal detection result in a detection example of the present application. DETAILED DESCRIPTION
[0064] The following will describe the embodiments of the present invention with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention, not for limiting the scope of protection of the present invention.
[0065] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0066] With the development of wireless technology, the use of wireless technology to transmit data has become an indispensable data transmission method in daily life. At present, common wireless technologies include WiFi, Bluetooth, NFC, etc. Among them, Bluetooth technology does not rely on the network and can be connected contactlessly, so Bluetooth is widely used in various audio devices, such as car audio systems, Bluetooth speakers, Bluetooth headsets, home smart audio systems, etc. However, although Bluetooth technology has gradually matured, problems such as Bluetooth audio freezes and silence are still frequently encountered during use, which seriously affects the auditory experience and device satisfaction.
[0067] Among them, Bluetooth audio transmission freezes mainly because Bluetooth audio transmission relies on wireless signals and is affected by multiple factors such as environmental interference, device distance, signal strength, etc., and audio freezes often occur. Therefore, when users use Bluetooth headphones or car audio systems, they often encounter problems such as audio signal interruption and intermittent sound. In some cases, audio silence is caused by device compatibility, unstable Bluetooth connection, device failure, etc. Users often need to reconnect the device during use, which causes great inconvenience.
[0068] In the related art, the detection of Bluetooth audio freezes, silence and other problems is often carried out by combining manual detection with detection devices, which has a low degree of automation and low detection efficiency.
[0069] Based on this, the embodiment of the present application provides a Bluetooth audio stability detection method, which is used to detect the audio output status of the device to be detected via Bluetooth. Based on the audio control instruction generated by simulating human-computer interaction, the audio playback device is automatically triggered to play audio. When the audio playback device plays audio, it is transmitted to the device to be detected via Bluetooth, and then the stability detection result of the device to be detected is obtained by obtaining the first audio signal output by the device to be detected and analyzing the first audio signal. The entire detection process is fully automated, without the need for manual intervention, and by simulating human-computer interaction, the device to be detected is tested in a simulated actual application scenario, so the reliability and accuracy of the detection results are higher, and the detection efficiency is improved.
[0070] Figure 1 A schematic diagram of a scenario of a Bluetooth audio stability detection method provided by an embodiment of the present application is shown. Figure 1As shown, it is applied to a Bluetooth audio stability detection device, which is used to detect the audio output state of the device to be detected. The device to be detected is connected to the audio playback device via Bluetooth, and the audio played by the audio playback device is transmitted to the device to be detected via Bluetooth. After the device to be detected receives the audio, it outputs the audio. The Bluetooth audio stability detection device detects the stability of the audio transmitted via Bluetooth between the audio playback device and the device to be detected by detecting the audio output state of the device to be detected.
[0071] In this example, the Bluetooth audio stability detection device is connected to the device to be detected and the audio playback device respectively. As an example, the Bluetooth audio stability detection device can simulate a human-computer interaction scenario, control the audio playback device, and the audio playback device transmits the audio to the device to be detected. The Bluetooth audio stability detection device collects the audio signal output by the device to be detected, analyzes the audio signal, and then automatically triggers the audio test process.
[0072] As an example, the Bluetooth audio stability detection solution can be applied to Bluetooth audio detection on the vehicle side. That is, in the vehicle side application, the device to be detected is the vehicle side, and the audio playback device is a mobile terminal.
[0073] The technical solution of the present application is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0074] Figure 2 A flowchart of a Bluetooth audio testing method provided by an embodiment of the present application is shown. Figure 1 Based on the embodiment shown, Figure 2 As shown, with the electronic device as the execution subject, the method of this embodiment may include the following steps:
[0075] S201, transmitting an audio control instruction generated by simulating human-computer interaction to an audio playback device, wherein the audio control instruction is used to control an audio output state of the audio playback device;
[0076] In this embodiment, the electronic device is used to detect the audio output stability of the device to be detected, specifically by detecting the audio output state of the device to be detected, wherein the audio output state of the device to be detected includes smoothness, freeze, delay, etc.
[0077] Specifically, the device to be detected and the audio playback device are connected via Bluetooth, the audio playback device plays audio, and transmits the audio to the device to be detected via Bluetooth. During the process of the device to be detected outputting audio, the electronic device detects the output audio of the device to be detected, and then analyzes the audio, thereby realizing the stability of Bluetooth audio transmission between the device to be detected and the audio playback device.
[0078] In this embodiment, the electronic device automatically detects the device to be detected without manual operation by the user, and simulates the actual use scenario of the device to be detected by simulating human-computer interaction, and tests the Bluetooth audio of the device to be detected in the actual use scenario, thereby improving the accuracy of the test results of the device to be detected. The following is a detailed description of the automated testing process:
[0079] When it is necessary to test the Bluetooth transmission stability of the device to be tested, the device to be tested and the audio player are connected to the electronic device respectively, and the electronic device is connected to the device to be tested and the audio player respectively. The electronic device simulates human-computer interaction to send audio control instructions to the audio player to control the audio output state of the audio player, such as controlling the audio player to start outputting, or controlling the audio player to stop outputting, or controlling the audio player to start outputting after responding to the previous song operation or the next song operation.
[0080] That is to say, based on the play, pause, previous song or next song operations often used by users when using audio playback devices, audio control instructions are simulated and generated. Taking the play instruction as an example, the electronic device sends the play instruction to the audio playback device, and the audio playback device plays the preset test audio. Based on the audio playback device and the device to be tested being connected via Bluetooth, the audio playback device transmits the test audio to the device to be tested, and the device to be tested plays the test audio. When the device to be tested plays the test audio, the audio signal of the test audio is reflected in the form of voltage, and the electronic device obtains the voltage value output by the device to be tested to obtain the audio signal, and the stability of the Bluetooth audio of the device to be tested is judged by analyzing the audio signal.
[0081] Taking the pause command as an example, the electronic device sends a pause command to the audio playback device, and the audio playback device pauses playing the preset test audio. There is no test audio transmission between the audio playback device and the device to be tested. The device to be tested still has a voltage output based on its internal voltage level. The electronic device obtains the voltage value output by the device to be tested, and determines whether the device to be tested is in the voltage level state by analyzing the voltage value.
[0082] It should be noted that when the audio control instruction is the previous song or the next song, the audio test process is similar to the test process of the above-mentioned play instruction, and will not be repeated here.
[0083] It is worth noting that there are many Bluetooth interaction protocols involved in the process of connecting two devices via Bluetooth and transmitting and controlling data via Bluetooth. Take the Bluetooth audio stability test on the car terminal as an example: the device to be tested is the car terminal, the audio playback device is the mobile terminal, the mobile terminal and the car terminal are connected via Bluetooth, the audio of the mobile terminal is transmitted to the car terminal, and the car terminal plays it, that is, multimedia interaction is achieved through Bluetooth. The multimedia interaction process includes the control of audio playback, the control of audio pause playback, the control of selecting to play the previous song or the control of selecting to play the next song, etc. In these touch controls, different Bluetooth interaction protocols are used between the car terminal and the mobile terminal. For example, the Bluetooth interaction protocols between the car terminal and the mobile terminal include HFP (Hands Free Profile), PBAP (Phonebook Access Profile), A2DP (Advanced Audio Distribution Profile) and AVRCP (A / V Remote Control Profile). Each protocol corresponds to different functions. Among them, HFP is used for Bluetooth connection and calls; PBAP is related to address book; A2DP is used for music playback, and audio is transmitted through this protocol during music playback; AVRCP is used for music control, including but not limited to pause, previous song, and next song control.
[0084] The realization of multimedia interaction needs to be completed through multiple protocols. Therefore, in the actual application scenarios, the mobile terminal and the car machine end actually use multiple interaction protocols to complete the interaction between the two devices. In the actual application scenarios, the performance between various interaction protocols will also have a certain impact on the stability of Bluetooth transmission. In the related art, when testing the Bluetooth audio of the car machine end, the test audio playback is generally manually controlled, and the stability test is only performed on the scene of playing the test audio, without considering the actual application scenarios of the car machine end and the mobile terminal, so the reliability of the test results is low. In this embodiment, the electronic device has an automated test program, which generates audio control instructions by simulating human-computer interaction, simulates the actual scene of interaction between the mobile terminal and the car machine end, and tests the audio of the car machine end. In the simulation control process, the corresponding protocol used in the actual application scenario is triggered, and then the stability of the Bluetooth audio of the car machine end is detected. The test results are closer to the actual application scenarios, and the stability and reliability of the test results are improved.
[0085] Optionally, in this step, the audio output by the audio playback device may be preset music in the audio playback device. Alternatively, in order to improve the accuracy and reliability of the test results, the audio output by the audio playback device may be a test audio with a fixed frequency. If a test audio with a fixed frequency is used for testing, and if an audio signal interruption occurs, it can be determined that the problem is caused by unstable Bluetooth transmission, and the frequency change of the test audio itself is excluded.
[0086] As an example, the test audio can be generated by an electronic device, and the test audio is generated based on the electronic device. After the electronic device generates the test audio, the test audio can be transmitted to the audio playback device when the device to be detected and the audio playback device are connected. After the audio playback device receives the audio control instruction, the output state of the test audio is controlled according to the audio control instruction. For example, if the audio control instruction is a play instruction, the test audio is played (the test audio is controlled to start output); if the audio control instruction is a stop instruction, the test audio is stopped from being played (the test audio is controlled to stop being output). If the audio control instruction is the previous song or the next song, the audio playback device responds to the previous song or the next song instruction and plays the test audio (that is, controls the test audio to start output).
[0087] In this example, the test audio is generated by an electronic device. On the one hand, the test audio with an adaptive frequency can be generated according to the current detection scenario for testing, so that the test result is closer to the actual application scenario of the device to be tested. On the other hand, according to the current test scenario, the actual output result of the test audio after being transmitted to the device to be tested via Bluetooth under the condition of stable Bluetooth transmission can be obtained. The actual output result can be used as the judgment basis in the subsequent simulation scene detection process, which is more in line with the current environmental requirements and improves the detection accuracy.
[0088] For example, when the device to be detected is connected to an electronic device and is ready to detect the device to be detected, the electronic device generates a test audio fixed in a preset frequency band according to the usage scenario of the device to be detected, and sends the test audio to the audio playback device. The audio playback device plays the test audio and transmits it to the device to be detected. The electronic device obtains the audio signal corresponding to the test audio from the device to be detected, and intercepts the reference audio signal of the preset duration from all audio signals. The reference audio signal reflects the audio signal corresponding to the audio segment transmitted by Bluetooth between the device to be detected and the audio playback device in a stable state. The reference audio signal is converted into the frequency domain to obtain the reference frequency domain signal corresponding to the reference audio signal, and the audio energy distribution range reflected by the reference frequency domain signal is determined as the preset energy distribution range and saved in the preset energy distribution range. Then the device to be detected is tested, and the electronic device transmits the audio control instruction to the audio playback device, and controls the audio playback device based on the audio control instruction. In the subsequent test process, the preset energy distribution range is used as a reference value for audio stability to judge the stability of the audio.
[0089] Through the above example, the test audio and the preset energy distribution range for stability judgment are obtained. When testing the device to be tested, it is equivalent to using the corresponding stable state in the actual usage scenario as a reference to judge the unstable state, which is close to the actual application scenario and improves the accuracy and reliability of the test results.
[0090] S202, obtaining a first audio signal output by the device to be detected, where the first audio signal reflects an audio output state of the device to be detected;
[0091] As an example, a method for acquiring a first audio signal output by a device to be detected includes: acquiring a first audio signal captured by an audio capture card based on a dynamic library.
[0092] In this example, the electronic device includes a differential signal converter, which is connected in parallel to the audio output circuit of the device to be detected. The differential signal converter is connected to an audio capture card, and the API of the audio capture card driver is encapsulated as an externally callable dynamic library.
[0093] Specifically, the sound output by the device to be detected is a differential signal. A differential to single-ended signal conversion board (differential signal converter) is connected in parallel to the audio output of the device to be detected to convert the audio output of the device to be detected into a single-ended signal. An audio capture card is connected to the adapter board, and the audio capture can collect the first audio signal of the audio signal in real time, thereby realizing automatic collection of the audio data output by the device to be detected.
[0094] In this embodiment, the audio capture card can collect the voltage value of the audio in real time, and the voltage value forms an audio signal and outputs it to the file, and also supports Cpp dynamic library for secondary development. The API of the audio capture card driver itself is encapsulated and exposed as an externally callable dynamic library.
[0095] The electronic device uses Python language to connect to the C++ interface, and calls the secondary packaged C++ interface through Python code. On the one hand, it can control the collection requirements of the audio acquisition card, such as controlling the time when the audio acquisition card collects data and / or the time when the collection ends, so as to achieve real-time detection. On the other hand, the first voltage signal of the audio signal can be obtained through the audio acquisition card, and the first voltage signal is the time domain signal of the audio signal.
[0096] As an example, an audio capture card can support multi-channel data acquisition, that is, it can simultaneously capture multiple audios output by the device to be detected. The electronic device can use Python to simultaneously read the data collected on multiple channels and analyze multiple data simultaneously.
[0097] Taking the vehicle-mounted device as an example, the vehicle-mounted device can output audio based on the local sound-generating components, and can also output audio through the test audio transmitted by the audio playback device. Assuming that the vehicle-mounted device has 8 sound outputs and the audio acquisition can support 8 channels, the audio signals corresponding to the 8 sounds can be collected at the same time, and the 8 audio signals can be analyzed at the same time. Simultaneous analysis can make it possible to quickly locate the problem location based on each test result in the same scene. And simultaneous analysis can improve detection efficiency.
[0098] In this example, the audio signal output by the device to be tested is collected through an audio capture card, and then the state of the output audio is analyzed to obtain the Bluetooth audio transmission stability of the device to be tested. The audio signal is an electrical signal, and the collection method is simple and less affected by environmental noise, without the help of artificial ears or other sound collectors.
[0099] As an example, the first audio signal may also be acquired in other ways.
[0100] S203: Perform stability analysis based on the first audio signal to obtain a detection result of the device to be detected.
[0101] The detection result includes abnormal or normal. Optionally, the abnormality refers to Bluetooth audio transmission freeze, delay or silence.
[0102] As an example, the audio played by the audio playback device is a test audio of a fixed frequency. In this case, the variation amplitude of the first audio signal output by the device to be detected is small. Therefore, by analyzing the variation amplitude of the first audio signal, the detection result of the audio signal can be obtained to determine whether the audio is received via Bluetooth at the current moment, and then judge the stability of the Bluetooth audio transmission (the genetic test audio is a fixed audio. If the first audio signal is not output at a certain moment, or the first audio signal changes greatly, it is determined that the Bluetooth transmission is stuck and delayed, that is, the transmission is unstable).
[0103] As an example, in order to improve the accuracy of the analysis result, the first audio signal is converted into a spectrum representation, and the stability of the Bluetooth audio is determined by analyzing the spectrum signal.
[0104] For example, the audio signal is analyzed according to the first audio signal to obtain a detection result of the audio signal, including: obtaining a corresponding time domain signal according to the first audio signal; obtaining a corresponding spectrum signal according to the time domain signal; determining a corresponding audio energy distribution according to the spectrum signal; if the audio energy distribution is not within a preset energy distribution range, the detection result of the device to be detected is abnormal; if the audio energy distribution is within the preset energy distribution range, the detection result of the device to be detected is normal.
[0105] It should be noted that when the device to be tested plays the test audio, it outputs a voltage value, and the voltage value reflects the audio signal corresponding to the test audio. The time domain signal refers to the representation of the audio waveform changing over time, so the corresponding time domain signal can be obtained according to the first audio signal and time.
[0106] For example, when a time domain signal with a fixed frequency of F (the time domain signal corresponding to the audio signal) x(t) = Acos(2πFt) is played, it represents a sine wave with an amplitude of A and a frequency of F. In the time domain, this signal is periodic with a period of 1 / F / second.
[0107] The frequency domain signal is converted from the time domain signal through Fourier transform, which shows the distribution of the signal in different frequency components. The Fourier transform reflects which frequency components are contained in the signal and their intensity.
[0108] In this embodiment, the time domain signal is converted into a frequency domain signal by the following method:
[0109] For a continuous time domain signal x(t), its Fourier transform X(f) is defined as:
[0110]
[0111] Where X(f) is the frequency domain representation of the time domain signal; f is the frequency and j is the imaginary unit.
[0112] That is, the time domain signal x(t) is decomposed into complex exponential components of different frequencies f, and the entire time axis is integrated to obtain the frequency domain representation X(f). Regarding the time domain signal x(t) = Acos(2πFt) of the above-mentioned fixed frequency signal F, this signal only contains the component with frequency F, and its frequency domain characteristics are:
[0113] Time domain analysis: The signal x(t) is a sine wave with amplitude A and frequency F. It is periodic in the time domain with a period of 1 / F / second.
[0114] Frequency Domain Analysis: Applying Fourier Transform:
[0115]
[0116] Further analysis is performed using the properties of Fourier transform and Euler's formula for complex exponentials. In the frequency domain, Fourier transform will produce two impulse functions (Dirac delta functions):
[0117]
[0118] The above formula indicates that the frequency domain signal X(f) has non-zero values at f=±F and is zero at other frequency domains. The coefficient A / 2 of each impulse function: δ(fF) and δ(f+F) represents the amplitude of the signal at F and -F in the frequency domain.
[0119] In the frequency domain, the Fourier transform decomposes the time domain signal into a weighted sum of a series of complex exponential functions. For a fixed-frequency audio signal: x(t) = Acos(2πFt), the Fourier transform can show a clear frequency component, that is, f = ±F, and its amplitude is A / 2. This phenomenon reflects the importance of the Fourier transform.
[0120] Optionally, the Fourier transform is further demonstrated in conjunction with Parseval's theorem. Parseval's theorem describes the energy conservation relationship between time domain signals and frequency domain signals. For a signal x(t) and its frequency domain representation X(f), Parseval's theorem states the following:
[0121]
[0122] Or for discrete signals:
[0123]
[0124] The above formula reflects that the total energy of the signal is equal between the time domain and the frequency domain, that is, the energy of the time domain signal is equal to the sum of the energies of the frequency domain signals.
[0125] For the fixed-frequency audio F mentioned above, Parseval's theorem is applied to verify the energy relationship between the time domain and the frequency domain:
[0126] Energy in time domain:
[0127]
[0128] Among them, cos 2 The average value of (2πFt) in one cycle is 1 / 2, so the result of integration is A 2 / 2.
[0129] Frequency domain energy:
[0130]
[0131] From the above formula, we can see that the contributions of δ(fF) and δ(f+F) are So the total energy is
[0132] That is A2 / 2, which is consistent with the time domain energy.
[0133] Through the above conversion process and principle, the judgment of audio freeze and silence can be centered around the entire frequency domain function, and the frequency domain analysis after Fourier transform of the audio signal can be performed in real time, and the value of the y coordinate (energy) when the coordinate is ±F. In actual situations, due to various factors (noise, distortion), other non-zero energy values may be found at other non-±F coordinates, but they are usually much smaller than the energy value at the ±F coordinates. In this scenario, the Y-axis energy values of all other coordinates are further threshold judged so that the Y-axis energy is less than the threshold M, and the Y-axis energy value at ±F is greater than the threshold M1, that is, between the energy distribution range M and M1. Further, in some embodiments, it can be based on judging whether the Y-axis energy value of the energy value in a very small interval range at the ±F coordinate is greater than or equal to the threshold M1. If so, the detection result is normal, if not, the detection result is abnormal, and freeze, delay or silence occurs.
[0134] In some embodiments, the audio output line of the device to be tested will also have relatively subtle level signals, which will affect the accurate nature of the final test results. In order to eliminate these interferences when there is no music or sound playing during the formal test process. Before the test, that is, before sending the audio control instruction to the audio playback device, the voltage signal for a period of time can be collected, and the voltage value can be weighted averaged to obtain the initial audio signal. When the audio control instruction is sent to the audio playback device for detection, after the real-time first audio signal is obtained, the real-time first audio signal is corrected based on the initial audio signal, and then a stability analysis is performed based on the corrected first audio information, so that the detection result is more accurate.
[0135] In some embodiments, in order to determine whether the abnormal detection result is caused by the compatibility performance problem between the audio playback device and the device to be detected, the position where the problem occurs in the device to be detected is located. The audio playback device connected to the device to be detected can also be switched, and the test audio is played based on the audio playback device after the control switch, and the device to be detected is detected. If the detection results of the device to be detected are consistent when multiple audio playback devices play the test audio, the compatibility performance problem between the audio playback device and the device to be detected is excluded. If not consistent, it may be a compatibility problem of the audio playback device. In other words, the electronic device is connected to multiple audio playback devices. The electronic device controls the audio playback device to connect with the device to be detected in turn, and tests are performed by switching different audio playback devices to identify device compatibility and connection stability problems.
[0136] In some examples, in order to improve detection accuracy, this embodiment generates multiple sets of audio playback instructions by simulating user-triggered operations of play, pause, previous song, and next song multiple times. After multiple rounds of testing, the Bluetooth audio stability of the device to be tested is evaluated by combining multiple sets of detection results.
[0137] In this embodiment, automated detection can be achieved using python+appium+pytest. By simulating human-computer interaction, the audio playback device is automatically triggered to control the audio output state, such as the audio playback device controls the audio output, and in the process of the audio playback device controlling the audio output, based on its connection with the device to be detected via Bluetooth, the audio playback device outputs the audio to the device to be detected; after the device to be detected receives the audio, it outputs an audio signal, and by detecting the first audio signal output by the device to be detected, the first audio signal is then analyzed to obtain the audio stability result of the device to be detected, and the Bluetooth audio stability of the audio device to be detected is fully automatically detected, and the detection efficiency is improved. And based on the audio control instruction that simulates the interaction of people to trigger the audio playback device, the test process can be made more in line with the actual use scenario, so that the reliability and accuracy of the test results are higher.
[0138] Figure 3 FIG. 2 is a flowchart of a Bluetooth audio test method provided by another embodiment of the present application. Figure 3 As shown, the Bluetooth audio stability detection device is implemented by an electronic device. The method of this embodiment may include the following steps:
[0139] S301, transmitting an audio control instruction generated by simulating human-computer interaction to an audio playback device, wherein the audio control instruction is used to control an audio output state of the audio playback device;
[0140] S302, obtaining a first audio signal output by the device to be detected, where the first audio signal reflects an audio output state of the device to be detected;
[0141] S303, performing stability analysis based on the first audio signal to obtain a detection result of the device to be detected;
[0142] Among them, steps S302 to S303 and Figure 2 The implementation of steps S201 to S203 in the embodiment is similar, and will not be repeated here in this embodiment.
[0143] S304: If the detection result is abnormal, capture the test log and the log of the device to be detected, and / or generate abnormal alarm information according to the detection result, and upload the abnormal alarm information to the cloud server.
[0144] In this embodiment, the first audio signal is collected in real time based on an audio capture card. Based on the first audio signal collected in real time, analysis is performed. If the analysis result is abnormal, log capture is triggered to capture the test log, the log of the device to be detected, and the Bluetooth log of the audio playback device, etc. The log is saved and sent to the background to facilitate backtracking analysis and problem solving to achieve a closed loop of the detection system. Among them, the test date includes the abnormal time of the detection result, the audio signal (waveform), etc. The log of the device to be detected includes the log of the Bluetooth protocol stack and the system log of the device to be detected.
[0145] Since the Bluetooth log flushes quickly, it is difficult to capture the Bluetooth log at the moment of detecting anomaly in the relevant detection scheme, so Bluetooth log is generally not captured. However, the present embodiment is based on the way that the audio capture card collects audio signals (electrical signals), and judges whether the detected audio signal is abnormal by comparing it with a pre-set reference value (such as a preset energy distribution range), so that the detection result can be obtained in time, and then the Bluetooth log can be captured in time, providing more accurate and effective data for subsequent abnormal analysis. After testing, the analysis of the present embodiment is very real-time, and can reach a delay of 1s. The abnormal result can be analyzed within 1s, so the relevant Bluetooth log can be captured.
[0146] As an example, abnormal alarm information is generated based on the detection results, uploaded to the cloud server, and the alarm mechanism of the cloud server is triggered. The cloud server processes it through SMS, email, etc. Combined with the cloud alarm mechanism, the detection results of the equipment to be detected can be fed back to the relevant personnel in a timely manner, and then respond to the detection results in a timely manner.
[0147] Figure 4 FIG. 2 is a flowchart of a Bluetooth audio test method provided by another embodiment of the present application. Figure 4 As shown, with the electronic device as the execution subject, the method of this embodiment may include the following steps:
[0148] S401, transmitting an audio control instruction generated by simulating human-computer interaction to an audio playback device, wherein the audio control instruction is used to control an audio output state of the audio playback device;
[0149] S402, obtaining a first audio signal output by the device to be detected, where the first audio signal reflects an audio output state of the device to be detected;
[0150] S403, performing stability analysis based on the first audio signal to obtain a detection result of the device to be detected;
[0151] Among them, steps S401 to S403 and Figure 2The implementation of steps S201 to S203 in the embodiment is similar, and will not be repeated here in this embodiment.
[0152] S404, if the detection result is silence, and the duration of silence reaches a preset duration, a trigger instruction simulating a local sound generating component of the device to be detected is transmitted to the device to be detected;
[0153] When the detection result is silent, it is a scene without any sound output. In the application of the vehicle side, it often happens that the mobile terminal plays music, but the vehicle side does not make any sound. In this scenario, it is impossible to determine whether it is the Bluetooth failure of the mobile terminal or the Bluetooth failure of the vehicle side. Therefore, the detection scheme proposed in the embodiment of the present application plays the test audio at the audio playback terminal, and when the audio detection result of the device to be detected is silent, the local generating component of the device to be detected is triggered to occur, and then the fault location is analyzed.
[0154] Taking the car side as an example, the local sound-generating components of the car side include instrument alarms and local music players. Among them, instrument alarms include but are not limited to turn signals, unfastened seat belts and other alarms. The sound-generating components are connected to the audio playback components of the car side via Bluetooth. If the detection result is silent, the electronic device generates a trigger instruction for the instrument alarm, transmits it to the car side, and triggers the instrument alarm on the car side to alarm. Alternatively, a trigger instruction for the local music player is generated and transmitted to the car side, triggering the local music player on the car side to traverse local music and play local music.
[0155] S405, obtaining a second audio signal output by the device to be detected;
[0156] In this step, the second audio signal is obtained in the same manner as described above. Figure 2 The manner of acquiring the first audio signal in the embodiments is the same and will not be described again.
[0157] S406, performing weighted averaging on the voltage values corresponding to the second audio signal to obtain a second voltage value;
[0158] In this example, the second voltage value is obtained by weighted averaging the voltage values corresponding to the second audio signal obtained within a certain time. For example, in this embodiment, the electronic device sends a trigger instruction through a python automation script combined with a CANoe simulation project to cyclically trigger the instrument alarm sound to obtain the voltage value corresponding to the second audio signal within a certain time.
[0159] Alternatively, a table related to music on the vehicle side is traversed through python+appium, and after the sound is triggered, a second audio signal is collected, and a weighted average is performed to obtain a second voltage value.
[0160] S407, comparing the second voltage value with the first voltage value in the mute state to determine whether the second voltage value is less than or equal to the first voltage value;
[0161] Optionally, the first voltage value in the silent state refers to the value collected when the local generating components of the audio playback device and the device to be detected are not generated. It should be noted that the audio output line of the device to be detected will also have a relatively subtle level signal, so the audio signal of the audio playback device (that is, the electrical signal reflecting the audio) can also be obtained in the silent state.
[0162] In some examples, the first voltage value can be obtained based on a voltage value collected over a preset time period when the detection result is silence.
[0163] Alternatively, in some examples, when the audio control instruction is a pause instruction, a weighted average is performed on the voltage values corresponding to the first audio signal within a preset duration to obtain the first voltage value in the mute state.
[0164] If not, then step S408 is obtained to determine that the device to be detected is normal;
[0165] If the second voltage value is greater than the first voltage value, it means that the device to be tested can receive the audio sent by the local sound-emitting component, indicating that the Bluetooth transmission of the device to be tested is normal. In this case, if the test audio transmitted by the audio playback device cannot be received, it means that there is a problem with the Bluetooth transmission of the mobile terminal, or the Bluetooth connection between the device to be tested and the mobile terminal is disconnected.
[0166] If yes, then step S409 is obtained to determine that the device to be detected is abnormal. Determining that the device to be detected is silent is based on a Bluetooth failure of the device to be detected, at which time the alarm mechanism of the test system is triggered, and then related operations such as log capture are performed.
[0167] In this embodiment, when applied on the vehicle side, the abnormal situation of the whole vehicle being silent can be detected on the vehicle side, and the test can be fully automated to enrich the application of detection functions and detection scenarios.
[0168] Figure 5 FIG. 2 is a flowchart of a Bluetooth audio test method provided by another embodiment of the present application. Figure 5 As shown, the Bluetooth audio stability detection device is implemented by an electronic device. The method of this embodiment may include the following steps:
[0169] S501, transmitting an audio control instruction generated by simulating human-computer interaction to an audio playback device, wherein the audio control instruction is used to control an audio output state of the audio playback device;
[0170] S502, obtaining a first audio signal output by the device to be detected, where the first audio signal reflects an audio output state of the device to be detected;
[0171] S503, performing stability analysis based on the first audio signal to obtain a detection result of the device to be detected;
[0172] Among them, steps S501 to S503 and Figure 2 The implementation of steps S201 to S203 in the embodiment is similar, and will not be repeated here in this embodiment.
[0173] S504, adjusting the Bluetooth signal strength between the audio playback device and the device to be detected;
[0174] In this step, you can adjust the Bluetooth signal strength between the audio playback device and the device to be detected in the following two ways:
[0175] For example, in one example, the electronic device further includes a sliding device, and the sliding device is driven by the electronic device. The audio playback device is disposed on the sliding device. During the detection process, the electronic device can control the sliding device to move a preset distance to detect the stability of the Bluetooth audio when the distance between the audio playback device and the device to be detected is different.
[0176] Optionally, the Bluetooth signal strength may be adjusted by gradually increasing or decreasing the distance between the audio playback device and the device to be detected, and the detection may be performed repeatedly to obtain the detection result.
[0177] Alternatively, in another example, a signal shielding device is provided, and during the detection process, the shielding parameters of the signal shielding device are adjusted to adjust the Bluetooth signal strength between the audio playback device and the device to be detected. Therefore, the stability of Bluetooth audio transmission of the device to be detected in scenarios with different Bluetooth signal strengths can be detected.
[0178] After adjusting the Bluetooth signal strength, the process returns to and continues to execute S501 to S504. After multiple adjustments and tests, the Bluetooth audio stability of the device to be tested is tested.
[0179] In this embodiment, if the detection result is abnormal, the Bluetooth signal strength can be adjusted to determine whether the cause of the Bluetooth instability of the device to be detected is related to the Bluetooth signal strength between the audio playback device and the device to be detected. Alternatively, by adjusting the Bluetooth signal strength, the Bluetooth signal strength corresponding to the strong connection stability between the device to be detected and the audio playback device can be detected.
[0180] In general, based on the solutions provided in the above embodiments, an experiment is conducted, taking the Bluetooth audio stability detection between the vehicle terminal and the mobile terminal as an example. The whole process and results of the experiment are as follows:
[0181] The detection system constructs an audio file with a fixed frequency of 1000Hz (also known as the test audio, 1000Hz is the fixed audio F) through the wavfile library of Python, imports it into the mobile terminal, and connects the Bluetooth of the mobile terminal and the Bluetooth of the vehicle machine.
[0182] The detection system simulates a scenario in which a user uses a mobile terminal to play music, generates a music playback control instruction, and sends it to the mobile terminal. The mobile terminal receives the music playback control instruction and plays the test audio constructed above. The detection system obtains the audio signal from the vehicle terminal, and in the obtained audio signal, captures the time domain data and frequency domain data within 1s when the audio is playing stably, where the time domain data is expressed by a voltage value, for example, the time domain data is 4.34604U or 3.02808U. The time domain data and the frequency domain data after discrete Fourier transformation are converted into a two-dimensional coordinate system, and the frequency domain data is displayed in the two-dimensional coordinate system for easy observation, such as Figure 6 shown. Figure 6 This is the time domain and frequency domain coordinate diagram for standard audio playback. Figure 6 In the figure, the time domain data corresponding to 1s is shown below the original data (the time domain data is displayed in the form of a sine wave, and the current display range is too small, so it looks like a complete and closely distributed area). From the time domain data, the stable distribution is combined with Figure 6 In the diagram after Fourier transformation, it is the frequency domain data after the time domain data within 1s is converted. The energy area is only distributed on ±2000Hz, ±1000Hz, and 0Hz, among which the energy corresponding to ±1000Hz reaches the maximum value of 6000. Of course, it can be seen that there are energy values on ±2000 and 0 on the x-axis, and the corresponding energy values on other x-axes are 0, indicating that the current sound has no distribution in other frequency bands (the noise existing in the device itself is avoided through the algorithm and is not included in the analysis range). In summary, multiple sets of experimental data and combined with Figure 6 As shown, with a fixed audio frequency of 1000 Hz and the same volume, the standard amplitude energy of 6000 and 5500 (the possible values of experimental data M1) both meet the conditions for stable playback.
[0183] In addition, the comparison of time domain data and frequency domain data where there is a freeze during the test is also intercepted:
[0184] like Figure 7 The following is the time domain and frequency domain data when the freeze occurs. Figure 7 The time domain data corresponding to the original data shown below is abnormal between 0.2s and 0.5s, that is, the sound is interrupted. At this time, the sound signal value corresponding to x in the 0.2s-0.5s interval is only the signal value generated by the background noise. Figure 7The data after Fourier transformation in the frequency domain has undergone a significant change. 1) The energy value when x is ±1000Hz drops to 3000. Except for x being ±2000Hz, 0Hz, and ±1000Hz, there is also energy distribution at other coordinate points. From the experimental data and Figure 7 It can be seen that the x-axis distribution is very wide, with about ±1600, ±500, ±800, etc. According to Parseval's theorem, the total energy within each 1s in the case of standard audio must be fixed. If there is a problem with playing the standard 1000Hz sound, it will definitely be distributed to other frequency ranges, resulting in x being ±1000Hz. The energy value on the y-axis becomes smaller, from the standard 6000 to 3000, and the change is obvious. There is only a problem with the audio playback within 0.3s. It can be seen that the solution provided by the embodiment of the present application has high detection accuracy and reliability. As an example, if the test audio is a standard audio of 1000Hz, under the same volume, in the corresponding frequency domain distribution, x is ±1000Hz, and the corresponding energy y>=5500, that is, greater than or equal to 5000 can be used as the preset energy distribution range, and the stability of the Bluetooth audio can be directly judged based on this range.
[0185] The embodiment of the present application also provides a Bluetooth audio stability detection device for detecting the audio output state of a device to be detected, wherein the device to be detected is connected to an audio playback device via Bluetooth, the audio playback device transmits audio to the device to be detected via Bluetooth, and the device to be detected plays audio; the detection device comprises:
[0186] A sending module, used to send the audio control instruction generated by simulating human-computer interaction to the audio playback device, wherein the audio control instruction is used to control the audio output state of the audio playback device;
[0187] An acquisition module, used for acquiring a first audio signal output by the device to be detected, where the first audio signal reflects an audio output state of the device to be detected;
[0188] The data processing module is used to perform stability analysis based on the first audio signal to obtain a detection result of the device to be detected.
[0189] The Bluetooth audio stability detection device provided in the embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be repeated here.
[0190] Optionally, in some examples, the Bluetooth audio stability detection device further includes a simulation module, which is used to simulate a user's human-computer interaction scenario and generate audio control instructions. The audio control instructions include play, pause, previous song, and next song.
[0191] The embodiment of the present application also provides an electronic device, the electronic device comprising: a memory, a processor;
[0192] The memory is used to store computer programs / instructions; the processor is used to execute the computer programs / instructions stored in the memory to implement the methods involved in the above embodiments.
[0193] The electronic device also includes a communication interface and a CAN bus, wherein the processor is used to provide computing power and control capabilities, and can be a GPU, CPU, NPU, MCU, FPGA, etc. The storage device includes an internal memory and a non-volatile memory. The non-volatile memory stores a computer program that implements the above method. The internal memory provides an environment for program startup and operation. The communication interface is used to communicate with an external terminal by wire or wireless.
[0194] In this embodiment, the electronic device may be an electronic component in a car, or may be the car.
[0195] The present invention also provides a computer-readable storage medium / computer program product, in which computer control instructions are stored / the computer program product includes computer control instructions, and when the computer control instructions are executed by a processor, they are used to implement the methods involved in the above-mentioned embodiments.
[0196] The above embodiments are only preferred embodiments for fully illustrating the present invention, and the protection scope of the present invention is not limited thereto. Any equivalent substitution or change made by a person skilled in the art based on the present invention is within the protection scope of the present invention.
Claims
1. A Bluetooth audio stability detection method, characterized in that: Used to detect the audio output state of a device to be detected, the device to be detected is connected to an audio playback device via Bluetooth, the audio playback device transmits audio to the device to be detected via Bluetooth, and the device to be detected plays the audio; the method comprises: Transmitting the audio control instruction generated by simulating human-computer interaction to the audio playback device, wherein the audio control instruction is used to control the audio output state of the audio playback device; Acquire a first audio signal output by the device to be detected, where the first audio signal reflects an audio output state of the device to be detected; A stability analysis is performed based on the first audio signal to obtain a detection result of the device to be detected.
2. The method according to claim 1, characterized in that When the audio control instruction is to play, play the previous song or play the next song, the stability analysis is performed based on the first audio signal to obtain the detection result of the device to be detected, including: Obtaining a corresponding time domain signal according to the first audio signal; According to the time domain signal, obtaining a corresponding frequency spectrum signal; Determine the corresponding audio energy distribution according to the frequency spectrum signal; If the audio energy distribution is not within the preset energy distribution range, the detection result of the device to be detected is obtained as abnormal; If the audio energy distribution is within the preset energy distribution range, the detection result of the device to be detected is normal.
3. The method according to claim 1, characterized in that When the audio control instruction is to pause, performing stability analysis based on the first audio signal to obtain a detection result of the device to be detected includes: A weighted average is performed on the voltage values corresponding to the first audio signal within a preset time period to obtain a first voltage value in a silent state.
4. The method according to any one of claims 1 to 3, characterized in that: After performing stability analysis based on the first audio signal to obtain the detection result of the device to be detected, the method further includes: If the detection result is silence, and the duration of silence reaches a preset duration, a trigger instruction simulating a local sound generating component of the device to be detected is transmitted to the device to be detected; Acquire a second audio signal output by the device to be detected; Performing weighted averaging on the voltage values corresponding to the second audio signal to obtain a second voltage value; Based on comparing the second voltage value with the first voltage value in the silent state; If the second voltage value is greater than the first voltage value, it is determined that the device to be detected is normal; If the second voltage value is less than or equal to the first voltage value, it is determined that the device to be detected is abnormal.
5. The method according to any one of claims 1 to 3, characterized in that: The performing stability analysis based on the first audio signal to obtain a detection result of the device to be detected includes: If the detection result is abnormal, capture the test log and the log of the device to be detected, and / or generate abnormal alarm information according to the detection result, and upload the abnormal alarm information to the cloud server.
6. The method according to any one of claims 1 to 3, characterized in that: Applied to a Bluetooth audio stability detection system, the detection system includes a differential signal converter, the differential signal converter is connected in parallel with the audio output circuit of the device to be detected, the differential signal converter is connected to an audio acquisition card, the API of the audio acquisition card driver is encapsulated as an externally callable dynamic library, and the first audio signal output by the device to be detected is obtained, including: A first audio signal captured by the audio capture card is acquired based on the dynamic library.
7. The method according to any one of claims 1 to 3, characterized in that: Before acquiring the first audio signal output by the device to be detected, the method further includes: The generated test audio is transmitted to the audio playback device, wherein when the audio playback device receives the audio control instruction, the output state of the test audio is controlled according to the audio control instruction.
8. The method according to any one of claims 1 to 3, characterized in that: After performing stability analysis based on the first audio signal to obtain the detection result of the device to be detected, the method further includes: Adjusting the Bluetooth signal strength between the audio playback device and the device to be detected; After adjusting the Bluetooth signal strength, the audio control instruction generated by simulating human-computer interaction continues to be transmitted to the audio playback device to detect the Bluetooth audio stability of the device to be detected.
9. The method according to claim 8, characterized in that The adjusting the Bluetooth signal strength between the audio playback device and the device to be detected includes: Controlling a sliding device to move a preset distance, wherein the audio playback device is arranged on the sliding device; Alternatively, adjust the shielding parameters of the signal shielding device.
10. A Bluetooth audio stability detection device, characterized in that: Used to detect the audio output state of the device to be detected, the device to be detected is connected to the audio playback device via Bluetooth, the audio playback device transmits audio to the device to be detected via Bluetooth, and the device to be detected plays the audio; The detection device comprises: A sending module, used for sending the audio control instruction generated by simulating human-computer interaction to the audio playback device, wherein the audio control instruction is used for controlling the audio output state of the audio playback device; An acquisition module, used for acquiring a first audio signal output by the device to be detected, where the first audio signal reflects an audio output state of the device to be detected; The data processing module is used to perform stability analysis based on the first audio signal to obtain a detection result of the device to be detected.
11. An electronic device, characterized in that: include: Memory, processor; The memory is used to store computer programs / instructions; The processor is configured to implement the method according to any one of claims 1 to 9 according to the computer program / instructions stored in the memory.
12. A computer-readable storage medium / computer program product, characterized in that: The computer-readable storage medium stores a computer program / the computer program product includes a computer program, and the computer program is used to implement the method according to any one of claims 1 to 9 when executed by a processor.
Citation Information
Cited By
System for carrying out audio test on earphone
CN121334585A