Power consumption detection method and device, electronic equipment and storage medium

CN122882807APending Publication Date: 2026-10-09SHENZHEN YI ZHAO TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610954376.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-29
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

相同系统音量下,音源音频动态特征差异可能会导致Smart PA的实际输出功耗存在显著差异

Benefits of technology

[0015]根据本公开实施例提供的功耗检测方法,采集音频输出端的音频信号以及音频输出端的电压和电流。根据音频信号,确定音频信号的特征参数,其中,特征参数至少包括短时能量和峰值因子。根据音频信号的特征参数以及音频输出端的电压和电流,生成音频输出端的功耗检测信息,可以建立音源动态特性与输出功耗水平的对应映射关系,为音频功耗问题的排查与归因提供多维度的检测依据,进而可以提升功耗检测结果的信息维度与参考价值,并且可以降低音频功耗问题的排查与归因难度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122882807A_ABST
    Figure CN122882807A_ABST
Patent Text Reader

Abstract

The present disclosure provides a power consumption detection method and device, electronic equipment and storage medium. The power consumption detection method comprises: collecting an audio signal of an audio output end and a voltage and a current of the audio output end. According to the audio signal, a characteristic parameter of the audio signal is determined, wherein the characteristic parameter at least includes a short-time energy and a peak factor. According to the characteristic parameter of the audio signal and the voltage and the current of the audio output end, power consumption detection information of the audio output end is generated, a corresponding mapping relationship between a sound source dynamic characteristic and an output power consumption level can be established, and multi-dimensional detection basis is provided for troubleshooting and attribution of an audio power consumption problem, so that the information dimension and reference value of the power consumption detection result can be improved, and the troubleshooting and attribution difficulty of the audio power consumption problem can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of power consumption detection technology, and in particular to a power consumption detection method, apparatus, electronic device, and storage medium. Background Technology

[0002] A smart power amplifier (Smart PA) can dynamically adjust its output voltage and current by real-time acquisition of parameters such as the speaker's load impedance, diaphragm displacement, and voice coil temperature. This maximizes output loudness and audio dynamics while ensuring device safety. At the same system volume, differences in the audio dynamic characteristics of the sound source can lead to significant differences in the actual output power consumption of a Smart PA.

[0003] However, existing audio logging systems typically only record the on / off status of the audio path and the system volume level, lacking the recording of the dynamic characteristics of the audio source and the real-time output electrical parameters of the Smart PA. This makes it impossible to establish a corresponding relationship between the actual power consumption performance and the characteristics of the audio source itself, making it difficult to troubleshoot and attribute audio power consumption problems. Summary of the Invention

[0004] In view of the above, embodiments of this disclosure provide a power consumption detection method, apparatus, electronic device, and computer storage medium to at least partially solve the above problems.

[0005] According to a first aspect of the present disclosure, a power consumption detection method is provided, the method comprising: acquiring an audio signal from an audio output terminal and the voltage and current of the audio output terminal; determining characteristic parameters of the audio signal based on the audio signal, wherein the characteristic parameters include at least short-time energy and peak factor; and generating power consumption detection information of the audio output terminal based on the characteristic parameters of the audio signal and the voltage and current of the audio output terminal.

[0006] In one possible implementation, generating power consumption detection information for the audio output terminal based on the characteristic parameters of the audio signal and the voltage and current of the audio output terminal includes: if the short-time energy is greater than a first threshold, and the peak factor is less than a second threshold, and the fluctuation period of the current at the audio output terminal is related to the change period of the short-time energy, then the power consumption detection information is determined to be normal high power consumption; if the short-time energy is less than a third threshold, and the voltage and / or current at the audio output terminal is greater than a fourth threshold, then the power consumption detection information is determined to be abnormally high power consumption.

[0007] In one possible implementation, the method further includes: acquiring the voltage and total current of the audio system, wherein the audio system includes the audio output terminal; determining the power consumption value of the audio system based on the voltage and total current of the audio system; and generating power consumption detection information of the audio output terminal based on the characteristic parameters of the audio signal, the voltage and current of the audio output terminal, and the power consumption value of the audio system.

[0008] In one possible implementation, the method further includes: if the characteristic parameter of the audio signal is 0, and the total current of the audio system is greater than a fifth threshold within a first preset time period, then it is determined that the audio system has a hardware fault.

[0009] In one possible implementation, generating power consumption detection information for the audio output terminal based on the characteristic parameters of the audio signal and the voltage and current of the audio output terminal includes: determining a theoretical power consumption value based on the characteristic parameters of the audio signal and a preset theoretical power consumption model; determining an actual power consumption value based on the voltage and current of the audio output terminal; and generating power consumption detection information for the audio output terminal based on the theoretical power consumption value and the actual power consumption value.

[0010] In one possible implementation, the method further includes: when the total current of the audio system is greater than a sixth threshold for a second preset time period, and / or the power consumption of the audio system is greater than a seventh threshold, correcting the preset theoretical power consumption model based on the actual power consumption value and the theoretical power consumption value.

[0011] In one possible implementation, the step of correcting the preset theoretical power consumption model based on the actual power consumption value and the theoretical power consumption value includes: collecting the voltage and current of the audio output terminal at a preset period and determining the actual power consumption value; if the difference between the actual power consumption value and the theoretical power consumption value shows a regularity within multiple consecutive preset periods, then the preset theoretical power consumption model is corrected.

[0012] According to a second aspect of the present disclosure, a power consumption detection device is provided, comprising: a acquisition unit for acquiring an audio signal from an audio output terminal and the voltage and current of the audio output terminal; a determination unit for determining characteristic parameters of the audio signal based on the audio signal, wherein the characteristic parameters include at least short-time energy and peak factor; and a generation unit for generating power consumption detection information of the audio output terminal based on the characteristic parameters of the audio signal and the voltage and current of the audio output terminal.

[0013] According to a third aspect of the present disclosure, an electronic device is provided, including: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other through the communication bus; the memory is used to store at least one executable instruction, which causes the processor to execute the power consumption detection method as described in the first aspect.

[0014] According to a fourth aspect of the present disclosure, a computer storage medium is provided that stores a computer program thereon, which, when executed by a processor, implements the power consumption detection method of the first aspect.

[0015] According to the power consumption detection method provided in this disclosure, an audio signal, voltage, and current at the audio output terminal are collected. Based on the audio signal, characteristic parameters of the audio signal are determined, wherein the characteristic parameters include at least short-time energy and peak factor. Based on the characteristic parameters of the audio signal and the voltage and current at the audio output terminal, power consumption detection information of the audio output terminal is generated. This establishes a mapping relationship between the dynamic characteristics of the sound source and the output power consumption level, providing multi-dimensional detection basis for troubleshooting and attributing audio power consumption problems. This enhances the information dimension and reference value of the power consumption detection results and reduces the difficulty of troubleshooting and attributing audio power consumption problems. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings.

[0017] Figure 1 This is a flowchart of a power consumption detection method provided in an embodiment of this disclosure; Figure 2a This is a power consumption characteristic waveform diagram of a normal high power consumption scenario provided in an embodiment of this disclosure; Figure 2b This is a power consumption characteristic waveform diagram of an abnormally high power consumption scenario provided in an embodiment of this disclosure; Figure 3 This is a schematic diagram of a power consumption detection device provided in an embodiment of this disclosure; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0018] To enable those skilled in the art to better understand the technical solutions in the embodiments of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art should fall within the protection scope of this disclosure.

[0019] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The singular forms “a,” “the,” and “the” as used in this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.

[0020] It should be understood that although the terms first, second, third, etc., may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are used only to distinguish information of the same type from one another. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."

[0021] As mentioned earlier, a Smart PA can dynamically adjust its output voltage and current by collecting parameters such as the speaker's load impedance, diaphragm displacement, and voice coil temperature in real time. This maximizes output loudness and audio dynamic performance while ensuring device safety. At the same system volume, differences in the dynamic characteristics of the audio source can lead to significant differences in the actual output power consumption of the Smart PA. However, existing audio logging systems typically only record the on / off status of the audio path and the system volume level, lacking records of the audio source's dynamic characteristics and the Smart PA's real-time output electrical parameters. This makes it impossible to establish a correlation between actual power consumption and the audio source's inherent characteristics, making it difficult to troubleshoot and attribute audio power consumption issues.

[0022] This disclosure provides a power consumption detection method that acquires audio signals, voltage, and current at an audio output terminal. Based on the audio signals, characteristic parameters of the audio signals are determined, including at least short-time energy and peak factor. Power consumption detection information for the audio output terminal is generated based on the characteristic parameters of the audio signals and the voltage and current at the audio output terminal. This establishes a mapping relationship between the dynamic characteristics of the audio source and the output power consumption level, providing multi-dimensional detection basis for troubleshooting and attributing audio power consumption problems. This enhances the information dimension and reference value of the power consumption detection results and reduces the difficulty of troubleshooting and attributing audio power consumption problems.

[0023] The power consumption detection method provided in this disclosure is illustrated below through examples.

[0024] Figure 1 This is a flowchart of a power consumption detection method provided in an embodiment of this disclosure, such as... Figure 1 As shown, the power consumption detection method includes the following steps 101 to 103: Step 101: Collect the audio signal, voltage, and current at the audio output terminal.

[0025] An audio output terminal is a circuit node or physical interface in an audio system that outputs audio signals, including but not limited to the output node of an audio power amplifier circuit, a speaker interface, or a wired audio output interface. Audio signals can be obtained from an audio digital signal processing (DSP) link or the driver layer corresponding to the audio output terminal. In one example, the target audio signal is acquired by attaching an audio feature extraction probe to the output of an AudioFlinger mixer. In another example, the target audio signal is acquired by attaching the audio feature extraction probe to a Smart PA driver layer.

[0026] The voltage and current at the audio output terminal can be read from the corresponding register at the audio output terminal through the power amplifier status monitoring module. In one example, the power amplifier status monitoring module is a power management integrated circuit (PMIC), which periodically reads the actual output voltage, current, chip temperature, and other status data related to the output power amplifier from the register corresponding to the Smart PA via the Inter-Integrated Circuit (I2C) bus or the Serial Peripheral Interface (SPI) bus, as hardware feedback data.

[0027] It should be noted that when acquiring audio signals from the audio output terminal, the acquisition time can be recorded simultaneously, and a system timestamp can be added to each frame of the audio signal. The timestamp accuracy can be in the millisecond range. Simultaneously, the acquired voltage and current data from the audio output terminal also have corresponding timestamps, ensuring a one-to-one correspondence between the audio signal and the voltage and current data on the timeline. This provides an aligned data source for subsequent power consumption detection. The acquired voltage and current data from the audio output terminal can be logged and stored, facilitating subsequent power consumption backtracking analysis based on data matched with the same timestamp.

[0028] Step 102: Determine the characteristic parameters of the audio signal based on the audio signal.

[0029] Feature extraction is performed on the acquired audio signals to obtain feature parameters that characterize the audio output properties of the audio signals. These feature parameters can be used to generate logs and store the output, which can then be used in conjunction with hardware electrical parameters to achieve power consumption backtracking analysis over the corresponding time dimension.

[0030] The characteristic parameters of an audio signal include at least short-time energy and peak factor. Short-time energy is obtained by calculating the root mean square or average energy frame by frame after windowing the audio sampling points. It characterizes the energy intensity and trend of the audio signal over a short time scale, and can intuitively reflect the power fluctuations and loudness changes of the audio output. Peak factor is obtained by calculating the ratio of the instantaneous peak value to the root mean square (RMS) of the audio waveform frame by frame after segmenting the audio sampling points. It characterizes the peak characteristics and dynamic range of the audio signal, reflecting the energy distribution and waveform impact characteristics of the audio output signal. For example, at the same average output power, a sine wave has a lower peak factor (approximately 1.414), its energy distribution is concentrated, exhibiting a continuous and stable high load characteristic. Symphonic music has a higher peak factor (up to 10 or more), its peak value is higher than the average level, its energy distribution is discrete, exhibiting a transient and large-fluctuation load characteristic.

[0031] In some implementations, additional time-domain or frequency-domain characteristic parameters, as well as system parameters of the audio output link, can be introduced to supplement the detection accuracy requirements. Combining multi-dimensional characteristic parameters provides more comprehensive signal characteristic basis for power consumption correlation analysis. In one example, the characteristic parameter also includes the spectral centroid, which belongs to the audio dynamic characteristic in the frequency domain. It is obtained by calculating the weighted center frequency of the spectral energy after frequency domain transformation of the audio signal. It is used to characterize the spectral energy distribution of the audio signal, distinguishing the proportion of low-frequency and mid-to-high-frequency components, and reflecting the power consumption characteristics of signals in different frequency bands. In another example, the characteristic parameter also includes the system volume level, which belongs to the gain parameter of the audio output link. It is used to characterize the gain level of the current audio output channel and can be used as a gain coefficient in power consumption correlation calculations, reflecting the impact of output gain on the power consumption level of the audio output terminal.

[0032] It should be noted that the aforementioned acquisition and processing of audio signals at the audio output end is only used for lightweight audio feature extraction. There is no need to record or store the original audio waveform. Instead, feature calculations are performed on the real-time audio data stream according to a preset acquisition cycle. Only the generated mathematical and statistical feature parameters and corresponding hardware status values ​​are recorded. No original audio content or user voice data that can be restored is stored or retained. This reduces computational complexity and storage space occupation while realizing power consumption detection and avoids privacy risks of the original audio data.

[0033] Step 103: Generate power consumption detection information for the audio output terminal based on the characteristic parameters of the audio signal and the voltage and current at the audio output terminal.

[0034] Using timestamps as indexes, the characteristic parameters of the audio signal are mapped one-to-one with the voltage and current of the audio output terminal on the time axis. The characteristic parameters representing the audio output's operating state are correlated with the voltage and current parameters representing actual power consumption. Combined with pre-defined power consumption analysis logic, power consumption detection information for the audio output terminal is generated. This power consumption detection information may include quantized data and semantic tags. Quantized data includes, but is not limited to, real-time power consumption values ​​and power consumption trends at the audio output terminal, while semantic tags are used to mark the corresponding power consumption state of the audio output terminal.

[0035] It should be noted that this step can be triggered by the user or automatically by the system. When a user feedback command is received regarding abnormal power consumption during audio playback, the system retrieves the stored timestamped audio characteristic parameter logs and audio output voltage and current logs, and performs attribution analysis on the abnormal audio power consumption using preset power consumption analysis logic. When the system detects that the power consumption parameters of the audio power supply domain exceed the preset abnormal threshold, the system automatically marks the abnormal time period and initiates this step to complete the attribution analysis.

[0036] In this embodiment of the disclosure, by collecting the audio signal, voltage, and current of the audio output terminal, determining the characteristic parameters of the audio signal based on the audio signal, and generating power consumption detection information of the audio output terminal based on the characteristic parameters of the audio signal and the voltage and current of the audio output terminal, a corresponding mapping relationship between the dynamic characteristics of the sound source and the output power consumption level can be established, providing multi-dimensional detection basis for the investigation and attribution of audio power consumption problems, thereby improving the information dimension and reference value of the power consumption detection results, and reducing the difficulty of investigating and attributing audio power consumption problems.

[0037] In one possible implementation, when generating power consumption detection information for the audio output terminal based on the characteristic parameters of the audio signal and the voltage and current at the audio output terminal, if the short-time energy is greater than a first threshold, the peak factor is less than a second threshold, and the fluctuation period of the current at the audio output terminal is related to the change period of the short-time energy, then the power consumption detection information is determined to be normal high power consumption. If the short-time energy is less than a third threshold, and the voltage and / or current at the audio output terminal is greater than a fourth threshold, then the power consumption detection information is determined to be abnormally high power consumption.

[0038] A short-term energy exceeding the first threshold indicates a high-energy, high-loud operating condition for the current audio output, corresponding to a higher amplifier output power requirement. A peak factor less than the second threshold indicates a low peak-to-RMS ratio in the current audio waveform, stable signal energy distribution without drastic transient peak fluctuations, and the amplifier operating in a stable state continuously matching high loads. If the current fluctuation at the audio output terminal shows a periodic correlation with the short-term energy change, it indicates that the power consumption fluctuation and the audio signal energy change are time-domain synchronized. Therefore, when the short-term energy exceeds the first threshold, the peak factor is less than the second threshold, and the current fluctuation period at the audio output terminal is correlated with the short-term energy change period, it indicates that the high power consumption is directly driven by the characteristics of the audio content itself, and is within the normal operating range. The power consumption detection information generated at this time corresponds to a normal high power consumption state.

[0039] The correlation determination between the current fluctuation period and the short-time energy change period at the audio output terminal can be achieved as follows: Based on the timestamp-aligned output current time series, autocorrelation analysis or short-time Fourier transform (STFT) is used to extract the fluctuation period characteristics of the current signal. Simultaneously, since the time-domain envelope of the short-time energy reflects the loudness changes of the music, and its fluctuation frequency is strongly correlated with the music rhythm, time-domain peak detection is performed on the short-time energy sequence, and the time interval between adjacent peaks is calculated to obtain the short-time energy fluctuation period. This period can indirectly reflect the loudness change rhythm of the music content. Synchronization verification is performed between the current fluctuation period and the short-time energy fluctuation period. When the peak value calculated by their cross-correlation exceeds a preset correlation threshold, or the period deviation is within a preset error range, it can be determined that the output current fluctuates synchronously with the music rhythm, and the current fluctuation is a normal response driven by the music content.

[0040] A short-term energy level below the third threshold indicates that the current audio output is in a low-energy, light-load operating condition, and theoretically, the power amplifier output should maintain a low power consumption level. If, at this time, the voltage or current at the audio output terminal is higher than the fourth threshold corresponding to the light-load condition, or if a sustained energy component exceeding the level corresponding to the input audio source is detected at a preset specific frequency point (e.g., 1kHz) after performing a frequency domain transformation on the electrical signal at the audio output terminal, it indicates that the actual power consumption at the audio output terminal does not match the audio source load state, and there is additional power consumption driven by non-input audio source factors. This is an abnormally high power consumption caused by non-audio source factors, and the generated power consumption detection information corresponds to an abnormally high power consumption state. This type of anomaly usually corresponds to software or firmware faults such as audio driver dead loops, abnormal audio output, or background noise amplification.

[0041] In addition to the above-mentioned normal high power consumption state and abnormal high power consumption state, audio output conditions that do not meet the above-mentioned abnormal high power consumption judgment conditions and whose power consumption level and audio characteristic parameters show a corresponding correlation will generate power consumption detection information corresponding to the normal power consumption working state.

[0042] The above thresholds can be pre-calibrated based on audio hardware specifications and system power consumption design parameters, or they can be adaptively adjusted based on power consumption benchmarks for different application scenarios.

[0043] Figure 2a This is a power consumption characteristic waveform diagram of a normal high power consumption scenario provided in an embodiment of this disclosure. Figure 2b This is a power consumption characteristic waveform diagram of an abnormally high power consumption scenario provided in an embodiment of this disclosure. For example... Figure 2a As shown, under normal music playback conditions, the short-term energy of the audio fluctuates dynamically with the music rhythm, and the peak factor conforms to the dynamic distribution of normal music. Correspondingly, the power consumption curve at the audio output also exhibits a peak-trough dynamic fluctuation characteristic synchronized with the short-term energy, corresponding to the normal power consumption fluctuation state driven by the characteristics of the audio source content itself. For example... Figure 2bAs shown, when an audio system experiences non-audio source-related faults such as low-level driver dead loops or abnormal noise amplification, the power consumption curve at the audio output terminal exhibits a continuous high-level straight line with no dynamic changes. Its power consumption level is not synchronously correlated with the short-term audio energy, corresponding to an abnormally high power consumption state driven by non-audio source factors. By comparing the waveforms of these two scenarios, normal power consumption fluctuations and abnormal power consumption states can be intuitively and quickly distinguished, assisting engineers in quickly locating the root cause of abnormal audio power consumption and reducing the troubleshooting and location cycle for audio power consumption faults.

[0044] In this embodiment of the disclosure, the high power consumption state of the audio output terminal can be reasonably classified through the combination and judgment mechanism of multi-dimensional parameters. It can clearly distinguish the normal high power consumption caused by the characteristics of the sound source itself and the abnormal high power consumption caused by other factors. This can improve the reference value of power consumption detection results, reduce the probability of power consumption misjudgment in normal high volume playback scenarios, and provide clear directional guidance for the investigation and attribution of subsequent power consumption problems, thus shortening the positioning cycle of audio power consumption problems.

[0045] In one possible implementation, the power consumption detection method further includes acquiring the voltage and total current of the audio system, wherein the audio system includes an audio output terminal. Based on the voltage and total current of the audio system, the power consumption value of the audio system is determined. Based on the characteristic parameters of the audio signal, the voltage and current of the audio output terminal, and the power consumption value of the audio system, power consumption detection information for the audio output terminal is generated.

[0046] An audio system is a complete functional subsystem in an electronic device that undertakes audio signal processing, power amplification, and electroacoustic output. It includes all hardware units in the entire chain from digital domain processing to final output of the audio signal, specifically including audio codec modules, power amplification circuits, audio output terminals, and supporting power supply links. In one example, the audio system corresponds to the audio power supply domain in the electronic device. The audio power supply domain is a dedicated power supply area defined by the power management integrated circuit. All the aforementioned audio functional hardware is included in the power supply range of this power supply domain and is uniformly powered by a dedicated power supply branch.

[0047] The total voltage and current at the power input of the audio system can be sampled via a power management integrated circuit on the dedicated power supply branch of the audio system, or by deploying corresponding voltage and current sampling circuits at the power input port of the audio system. The sampling times of the acquired audio system voltage and total current are synchronized with those of the audio signal and the voltage and current at the audio output, ensuring that all parameters have a unified time reference and that all data sources are alignable in the time dimension.

[0048] Based on the synchronously acquired power supply voltage and total current of the audio system, the overall power consumption of the audio system is obtained through electrical calculations. Specifically, the real-time instantaneous power consumption can be calculated by point-by-point multiplication of instantaneous voltage and instantaneous current, or the periodic average power consumption can be obtained by integration within a preset statistical period and normalized by the period duration. The power consumption of the audio system reflects the total power consumption level of the entire audio link, including the load output power consumption corresponding to the audio output terminal, as well as the power consumption of other link links such as the losses of the encoding and decoding circuits and power amplifier circuits. It can form a hierarchical correspondence with the local power consumption of the audio output terminal, providing an overall reference benchmark for power consumption distribution analysis.

[0049] The power consumption value of the audio system is added as an analysis input. By combining the characteristic parameters of the sound source side (characteristic parameters of the audio signal), the electrical parameters of the output side (voltage and current of the audio output terminal), and the overall power consumption value of the system level, a multi-dimensional joint correlation analysis is performed to generate power consumption detection information of the audio output terminal.

[0050] In this embodiment of the disclosure, by combining the power consumption value of the audio system as a reference dimension for power consumption detection, the analytical dimensions of power consumption detection information can be expanded, the comprehensiveness and reference value of power consumption detection results can be improved, and more sufficient data support can be provided for power consumption optimization assessment and anomaly investigation of the audio system. Furthermore, it can realize hierarchical power consumption decomposition and detection from the overall audio system to the output end, which is convenient for accurately locating the level to which the power consumption anomaly belongs, and reducing the difficulty and time cost of troubleshooting power consumption anomalies in the audio system.

[0051] In one possible implementation, the power consumption detection method further includes determining that there is a hardware fault in the audio system if the characteristic parameters of the audio signal are 0 and the total current of the audio system is greater than a fifth threshold within a first preset time period.

[0052] When the audio output link is in a closed state (including but not limited to scenarios such as audio playback process termination, audio focus release, output path switch disconnection, etc.), there is no valid audio data stream output from the audio output end. At this time, it is impossible to collect valid audio dynamic characteristic parameters such as short-time energy and peak factor, and the corresponding characteristic parameter value is 0. Therefore, if the characteristic parameters of the audio signal are continuously 0, it can be equivalently determined that the audio path is closed. This method is one way to determine the closed state of the audio path on the software side.

[0053] When the characteristic parameter of the audio signal is 0, it indicates that the audio system is in an idle standby state with no audio source load. In this state, the total current of the audio system should theoretically be maintained within the reference current range corresponding to the standby state. At this time, if the total current of the audio system, which is synchronously collected by timestamp, is continuously greater than the fifth threshold within the first preset time, it indicates that there is a continuous excessive current under the premise that no normal audio load is consumed. This current does not flow through the effective audio load, indicating that there is abnormal power consumption in the power supply path, and energy is consumed by abnormal paths (such as hardware leakage, short circuit of peripheral circuits, etc.). This abnormal state is marked as a hardware fault. The fifth threshold is the pre-calibrated standby current reference value of the power supply domain in the audio path closed state. The first preset time is a preset continuous verification duration, which is used to avoid misjudgment interference caused by short-term current spikes such as power-on transient pulses and instantaneous fluctuations in bus communication. Only when the total current is continuously greater than the fifth threshold within this duration will the hardware fault judgment result be output.

[0054] In this embodiment of the disclosure, based on the aforementioned power consumption detection, the dimensions of hardware fault analysis under no-load scenarios are further expanded, thereby enabling effective differentiation between software-related anomalies and hardware-related faults, further narrowing the attribution range of power consumption anomalies, improving the accuracy of fault location, helping to shorten the troubleshooting cycle of audio system power consumption anomalies, and improving the comprehensiveness of audio system operating status monitoring.

[0055] In one possible implementation, when generating power consumption detection information for the audio output terminal based on the characteristic parameters of the audio signal and the voltage and current at the audio output terminal, the theoretical power consumption value can be determined based on the characteristic parameters of the audio signal and a preset theoretical power consumption model. The actual power consumption value is then determined based on the voltage and current at the audio output terminal. Finally, the power consumption detection information for the audio output terminal is generated based on both the theoretical and actual power consumption values.

[0056] The preset theoretical model is an initial theoretical model established based on laboratory calibration data, representing the mapping relationship between the characteristic parameters of an audio signal and its power consumption under ideal conditions. Using the sound source's characteristic parameters as input to the preset theoretical power consumption model, the model outputs the ideal theoretical power consumption value at the audio output terminal under the current volume gain setting of the sound source, through a preset power consumption calculation formula or lookup table. For example, sound sources with high short-term energy and low peak factor (such as standard sine wave test signals) correspond to continuously stable theoretical power consumption with relatively high values. Sound sources with high short-term energy and high peak factor (such as symphonic music and complex multi-part audio) correspond to theoretical power consumption with larger fluctuations.

[0057] In one example, the audio characteristic parameters are related to the theoretical power consumption value P. theory Satisfy P theory=f(STE, Crest Factor, Spectral Centroid, Volume Gain), where STE is the short-time energy, used to determine the basic order of magnitude of theoretical power consumption. Crest Factor is the peak factor, used to characterize the impact of the instantaneous peak characteristics of the audio waveform on the instantaneous load of the power amplifier circuit. Spectral Centroid is the spectral centroid, used to characterize the spectral energy distribution characteristics of the audio signal. For example, when the proportion of low-frequency components is high, the power amplifier circuit needs to output a larger drive current to drive the electroacoustic load, and the corresponding theoretical power consumption value is adjusted upward. Volume Gain is the volume gain coefficient, which is converted from the system volume level and used to characterize the adjustment effect of the overall gain of the audio output link on the power consumption reference level. The mapping function f is obtained by fitting multiple sets of standard test audio samples through hardware calibration experiments. It can be adapted and calibrated according to the hardware specifications of the audio power amplifier circuit and the inherent gain characteristics of the audio output link, and outputs an ideal power consumption reference value that matches the current audio source load and link gain.

[0058] Based on the timestamped and synchronized audio output voltage and current data, the actual power consumption value in the corresponding time dimension is obtained through electrical calculations. Specifically, the real-time instantaneous power consumption can be calculated by multiplying the instantaneous voltage and instantaneous current point by point, or the periodic average power consumption can be obtained by integration within a preset statistical period. The statistical granularity is consistent with the output granularity of the theoretical power consumption value, ensuring that the two are comparable in the time dimension.

[0059] Using a unified timestamp as an index, the theoretical power consumption value and the actual power consumption value at the same moment are compared and analyzed, and power consumption detection information is generated by combining the results with preset deviation judgment rules. When the deviation between the actual power consumption value and the theoretical power consumption value is within the preset allowable deviation range, the current power consumption level is determined to match the characteristics of the audio source load and the link gain status, corresponding to a normal power consumption state. When the actual power consumption value exceeds the preset allowable deviation range of the theoretical power consumption value, it is determined that there is additional power loss driven by non-audio source load, and the abnormality type label and deviation quantification data can be further output in combination with the aforementioned abnormality judgment logic. This comparison logic can be combined with the aforementioned high power consumption classification judgment and hardware fault judgment logic to provide a quantitative reference for the hierarchical judgment of power consumption status.

[0060] In this embodiment of the disclosure, the theoretical power consumption value of the audio source corresponding to the characteristic parameters of the audio signal is obtained by a preset theoretical power consumption model, and the actual power consumption value under synchronous timing is calculated. The theoretical power consumption value and the actual power consumption value under the same time dimension are compared and analyzed to generate power consumption detection information. This provides a quantitative reference benchmark for power consumption status determination, provides more concrete data support for assessing the severity of power consumption anomalies and troubleshooting fault causes, and improves the accuracy and interpretability of power consumption detection results.

[0061] In one possible implementation, the power consumption detection method can also correct the preset theoretical power consumption model based on the actual power consumption value and the theoretical power consumption value when the total current of the audio system is greater than the sixth threshold for a second preset time period, and / or the power consumption value of the audio system is greater than the seventh threshold.

[0062] The sixth threshold is a pre-calibrated current judgment benchmark for continuous high-load operation of the audio power supply domain. The second preset time is a preset duration verification threshold used to avoid false triggering in scenarios such as instantaneous peak output and transient condition switching. The seventh threshold is a pre-calibrated power consumption judgment benchmark for continuous high-load operation of the audio system. Both conditions—where the total current of the audio system is greater than the sixth threshold for the second preset time, and where the power consumption of the audio system is greater than the seventh threshold—indicate that the audio system is in a high-power output state for an extended period.

[0063] When an audio system operates at high power output for extended periods, core components such as power amplifier circuits are prone to electrical characteristic deviations within the normal range due to factors such as temperature drift and component parameter aging. This leads to a gradual increase in the deviation between the theoretically calculated value of the preset theoretical power consumption model and the actual operating power consumption, reducing the accuracy of power consumption benchmarking. Therefore, when one or both of the above two conditions are met, and the current state is confirmed to be normal high power consumption through the aforementioned judgment logic, excluding abnormal high power consumption and hardware faults, the preset theoretical power consumption model is corrected and calibrated based on the deviation data between the actual power consumption value and the theoretical power consumption value obtained synchronously with the timestamp.

[0064] In one example, voltage and current data for each power supply domain of the entire device are continuously collected via PMIC. When the current in the audio power supply domain remains above the sixth threshold for a second preset time (e.g., exceeding the reference current by 20% for a duration of not less than 30 seconds), and / or the power consumption curve of the entire device exhibits a sustained high power consumption characteristic strongly correlated with the audio playback period, and the power consumption value of the entire device exceeds the seventh threshold, the model correction process is initiated.

[0065] In this embodiment of the disclosure, by adding a model adaptive correction triggering mechanism based on continuous high load conditions, the impact of hardware parameter deviation on the accuracy of theoretical power consumption calculation can be reduced, making the theoretical power consumption closer to the actual physical characteristics of the device, improving the accuracy and adaptability of the power consumption detection benchmark, and the calibrated model can be used for snapshot comparison of similar anomalies in the future, which can quickly distinguish between normal parameter deviation of the device and real power consumption anomalies, simplify the anomaly judgment and verification process, effectively shorten the power consumption anomaly identification and detection cycle, and improve the overall efficiency and reliability of power consumption fault detection in audio systems.

[0066] In one possible implementation, when revising the preset theoretical power consumption model based on the actual power consumption value and the theoretical power consumption value, the voltage and current at the audio output terminal can be collected at preset periods to determine the actual power consumption value. If the difference between the actual power consumption value and the theoretical power consumption value shows a regularity over multiple consecutive preset periods, the preset theoretical power consumption model is then revised.

[0067] Under normal operating conditions, voltage, current, and other status data of the audio output terminal are collected at a lower sampling frequency for daily power consumption monitoring and baseline data accumulation. When the audio system is detected to be in a high power consumption state, i.e., when the total current of the audio system exceeds the sixth threshold within a second preset time and / or the power consumption of the audio system exceeds the seventh threshold, an abnormal alarm signal is triggered, and the system switches to a high-frequency sampling mode to collect the voltage and current of the audio output terminal at a preset period. The sampling period frequency of the preset period (e.g., once every 100ms) is higher than the sampling frequency under normal operation (e.g., once every 5s) to capture the instantaneous hardware status under abnormal operating conditions.

[0068] It should be noted that high-frequency sampling mode increases I2C or SPI bus load and CPU overhead, making it unsuitable for continuous operation. Therefore, it only enters high-frequency mode after high power consumption triggering, which can simultaneously ensure anomaly diagnosis accuracy, model calibration accuracy, and system performance.

[0069] If the judgment logic of the aforementioned embodiment identifies the current state as a normal high-power state, then the actual power consumption value P is calculated based on the voltage and current of the audio output terminal collected at a preset period. actual The theoretical power consumption value P is output by combining the theoretical power consumption model at the synchronization moment. theory, Calculate the power consumption deviation ΔP=P actual -P theory It analyzes the positive and negative directions and fluctuation amplitude of the deviation within multiple consecutive preset periods to determine whether the difference between the actual power consumption value and the theoretical power consumption value has a stable change pattern.

[0070] If the power consumption deviation exhibits a stable regularity over multiple preset periods—for example, the theoretical value consistently deviates from the expected value in the same direction under a specific spectral centroid, the deviation shows a monotonically corresponding relationship with device temperature changes, or the deviation conforms to the slow, monotonically changing characteristics caused by device aging—then the correlation coefficient of the sound source-power consumption mapping function f is adjusted according to the changing pattern to generate a corrected model f'. The corrected model is then used to recalculate the theoretical power consumption for the corresponding time period, and the comparison and iteration with the actual power consumption value are repeated until the deviation converges to a preset allowable deviation threshold or reaches a preset maximum number of iterations. If convergence is not achieved even after reaching the maximum number of iterations, it is determined that there are abnormal factors other than device characteristic drift, the model correction is terminated, and a power consumption anomaly warning is output.

[0071] In this embodiment, the actual power consumption is determined by periodically collecting the voltage and current at the audio output terminal. Based on the variation pattern of the difference between the actual power consumption and the theoretical power consumption, the preset theoretical power consumption model is corrected. This makes the preset theoretical power consumption model more closely match the actual electrical characteristics of the current hardware, further ensuring the reliability of the theoretical power consumption benchmark and improving the long-term accuracy of power consumption detection results.

[0072] Figure 3 This is a schematic diagram of a power consumption detection device provided in an embodiment of this disclosure, as shown below. Figure 3 As shown, the power consumption detection device 200 includes: The acquisition unit 201 is used to acquire the audio signal, voltage and current of the audio output terminal.

[0073] The determining unit 202 is used to determine the characteristic parameters of the audio signal based on the audio signal, wherein the characteristic parameters include at least short-time energy and peak factor.

[0074] The generation unit 203 is used to generate power consumption detection information of the audio output terminal based on the characteristic parameters of the audio signal and the voltage and current of the audio output terminal.

[0075] In this embodiment of the disclosure, the acquisition unit 201 can be used to execute step 101 in the above method embodiment, the determination unit 202 can be used to execute step 102 in the above method embodiment, and the generation unit 203 can be used to execute step 103 in the above method embodiment.

[0076] In one possible implementation, the generating unit 203 is further configured to determine the power consumption detection information as normal high power consumption if the short-time energy is greater than a first threshold, the peak factor is less than a second threshold, and the fluctuation period of the current at the audio output terminal is related to the change period of the short-time energy; and to determine the power consumption detection information as abnormal high power consumption if the short-time energy is less than a third threshold and the voltage and / or current at the audio output terminal is greater than a fourth threshold.

[0077] In one possible implementation, the power consumption detection device 200 is further used to acquire the voltage and total current of the audio system, wherein the audio system includes an audio output terminal; determine the power consumption value of the audio system based on the voltage and total current of the audio system; and generate power consumption detection information of the audio output terminal based on the characteristic parameters of the audio signal, the voltage and current of the audio output terminal, and the power consumption value of the audio system.

[0078] In one possible implementation, the power consumption detection device 200 is further configured to determine that there is a hardware fault in the audio system if the characteristic parameters of the audio signal are 0 and the total current of the audio system is greater than a fifth threshold for a first preset time period.

[0079] In one possible implementation, the generation unit 203 is further configured to determine the theoretical power consumption value based on the characteristic parameters of the audio signal and a preset theoretical power consumption model; determine the actual power consumption value based on the voltage and current of the audio output terminal; and generate power consumption detection information of the audio output terminal based on the theoretical power consumption value and the actual power consumption value.

[0080] In one possible implementation, the power consumption detection device 200 is further configured to correct the preset theoretical power consumption model based on the actual power consumption value and the theoretical power consumption value when the total current of the audio system is greater than the sixth threshold for a second preset time period, and / or the power consumption value of the audio system is greater than the seventh threshold.

[0081] In one possible implementation, the power consumption detection device 200 is also used to collect the voltage and current of the audio output terminal at a preset period and determine the actual power consumption value; if the difference between the actual power consumption value and the theoretical power consumption value shows a regularity in multiple consecutive preset periods, the preset theoretical power consumption model is corrected.

[0082] Reference Figure 4 This diagram illustrates the structure of an electronic device according to an embodiment of the present disclosure. The specific embodiments of the present disclosure do not limit the specific implementation of the electronic device.

[0083] like Figure 4 As shown, the electronic device may include: a processor 302, a communications interface 304, a memory 306, and a communications bus 308.

[0084] in: The processor 302, communication interface 304, and memory 306 communicate with each other via communication bus 308.

[0085] Communication interface 304 is used to communicate with other electronic devices or servers.

[0086] The processor 302 is used to execute program 310, which can specifically execute the relevant steps in the above power consumption detection method embodiment.

[0087] Specifically, program 310 may include program code that includes computer operation instructions.

[0088] Processor 302 may be a central processing unit (CPU), a graphics processing unit (GPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present disclosure. The electronic device may include one or more processors of the same type, such as one or more CPUs; one or more GPUs; or it may include processors of different types, such as one or more CPUs, one or more GPUs, and one or more ASICs.

[0089] Memory 306 is used to store program 310. Memory 306 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0090] Specifically, program 310 can be used to cause processor 302 to execute the power consumption detection method in any of the foregoing embodiments.

[0091] The specific implementation of each step in program 310 can be found in the corresponding steps and units described in any of the foregoing power consumption detection method embodiments, and will not be repeated here. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the devices and modules described above can be referred to the corresponding process descriptions in the foregoing method embodiments, and will not be repeated here.

[0092] In this embodiment, audio signals, voltage, and current at the audio output terminal are acquired. Based on the audio signals, characteristic parameters are determined, including at least short-time energy and peak factor. Power consumption detection information for the audio output terminal is generated based on these characteristic parameters and the voltage and current at the audio output terminal. This establishes a mapping relationship between the dynamic characteristics of the audio source and the output power consumption level, providing multi-dimensional detection basis for troubleshooting and attributing audio power consumption problems. This enhances the information dimension and reference value of the power consumption detection results and reduces the difficulty of troubleshooting and attributing audio power consumption problems.

[0093] This disclosure also provides a computer program product, including computer instructions that instruct a computing device to perform an operation corresponding to any of the methods in the above-described plurality of method embodiments.

[0094] It should be noted that, depending on the implementation needs, the various components / steps described in the embodiments of this disclosure can be broken down into more components / steps, or two or more components / steps or parts of the operation of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of this disclosure.

[0095] The methods described above according to embodiments of this disclosure can be implemented in hardware, firmware, or as software or computer code that can be stored in a recording medium (such as a CD-ROM, RAM, floppy disk, hard disk, or magneto-optical disk), or as computer code originally stored on a remote recording medium or a non-transitory machine-readable medium and subsequently stored on a local recording medium, downloaded over a network. Thus, the methods described herein can be processed by software stored on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware (such as an ASIC or FPGA). It is understood that the computer, processor, microprocessor controller, or programmable hardware includes storage components (e.g., RAM, ROM, flash memory, etc.) capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the power consumption detection methods described herein. Furthermore, when a general-purpose computer accesses code used to implement the power consumption detection methods shown herein, the execution of the code transforms the general-purpose computer into a dedicated computer for executing the power consumption detection methods shown herein.

[0096] Those skilled in the art will recognize that the units and method steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments disclosed herein.

[0097] It should be noted that the user-related information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to sample data used for training the model, data used for analysis, stored data, displayed data, etc.) involved in the embodiments of this disclosure are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0098] The above embodiments are only used to illustrate the embodiments of this disclosure, and are not intended to limit the embodiments of this disclosure. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the embodiments of this disclosure. Therefore, all equivalent technical solutions also fall within the scope of the embodiments of this disclosure, and the patent protection scope of the embodiments of this disclosure should be defined by the claims.

Claims

1. A power consumption detection method, characterized in that, include: Acquire the audio signal from the audio output terminal, as well as the voltage and current of the audio output terminal; Based on the audio signal, characteristic parameters of the audio signal are determined, wherein the characteristic parameters include at least short-time energy and peak factor; Based on the characteristic parameters of the audio signal and the voltage and current of the audio output terminal, power consumption detection information of the audio output terminal is generated.

2. The method according to claim 1, characterized in that, The step of generating power consumption detection information for the audio output terminal based on the characteristic parameters of the audio signal and the voltage and current of the audio output terminal includes: If the short-time energy is greater than the first threshold, the peak factor is less than the second threshold, and the fluctuation period of the current at the audio output terminal is related to the change period of the short-time energy, then the power consumption detection information is determined to be normal high power consumption. If the short-term energy is less than the third threshold, and the voltage and / or current at the audio output terminal is greater than the fourth threshold, then the power consumption detection information is determined to be abnormally high power consumption.

3. The method according to claim 1, characterized in that, The method further includes: The voltage and total current of the audio system are collected, wherein the audio system includes the audio output terminal; The power consumption of the audio system is determined based on the voltage and total current of the audio system. Based on the characteristic parameters of the audio signal, the voltage and current of the audio output terminal, and the power consumption value of the audio system, power consumption detection information of the audio output terminal is generated.

4. The method according to claim 3, characterized in that, The method further includes: If the characteristic parameters of the audio signal are 0, and the total current of the audio system is greater than the fifth threshold within a first preset time period, then it is determined that there is a hardware fault in the audio system.

5. The method according to claim 3, characterized in that, The step of generating power consumption detection information for the audio output terminal based on the characteristic parameters of the audio signal and the voltage and current of the audio output terminal includes: The theoretical power consumption value is determined based on the characteristic parameters of the audio signal and the preset theoretical power consumption model; The actual power consumption value is determined based on the voltage and current at the audio output terminal; Based on the theoretical power consumption value and the actual power consumption value, power consumption detection information of the audio output terminal is generated.

6. The method according to claim 5, characterized in that, The method further includes: When the total current of the audio system is greater than the sixth threshold for a second preset time period, and / or the power consumption of the audio system is greater than the seventh threshold, the preset theoretical power consumption model is corrected based on the actual power consumption and the theoretical power consumption.

7. The method according to claim 6, characterized in that, The step of correcting the preset theoretical power consumption model based on the actual power consumption value and the theoretical power consumption value includes: The voltage and current at the audio output terminal are collected at a preset period to determine the actual power consumption value; If the difference between the actual power consumption value and the theoretical power consumption value shows a regularity within multiple consecutive preset periods, then the preset theoretical power consumption model is corrected.

8. A power consumption detection device, characterized in that, include: The acquisition unit is used to acquire the audio signal from the audio output terminal, as well as the voltage and current of the audio output terminal; A determining unit is configured to determine characteristic parameters of the audio signal based on the audio signal, wherein the characteristic parameters include at least short-time energy and peak factor; The generation unit is used to generate power consumption detection information of the audio output terminal based on the characteristic parameters of the audio signal and the voltage and current of the audio output terminal.

9. An electronic device, characterized in that, include: The processor, memory, communication interface, and communication bus are provided, wherein the processor, memory, and communication interface communicate with each other via the communication bus. The memory is used to store at least one executable instruction that causes the processor to perform the power consumption detection method as described in any one of claims 1-7.

10. A computer storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the power consumption detection method as described in any one of claims 1-7.