Audio processing method for boiling liquid overflow prevention and storage medium

CN122930097APending Publication Date: 2026-10-16NINGBO FOTILE KITCHEN WARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

然而,基于固定频带的滤波器或基于静态声纹模板的匹配方法,其监测参数在系统设计阶段即已固化,无法随液体物理特性的实时变化而动态调整监测频段,从而在液体类型或烹饪阶段改变时容易产生漏检

Benefits of technology

[0033]1. Real-time adaptive tracking of the main frequency band of bubble sound is achieved, effectively solving the problem of missed detection in fixed frequency band monitoring schemes. By maintaining a dynamic statistical baseline of "median value - preset high quantile value" based on a sliding window on the real-time generated Mel spectrum sequence for each frequency band, the changing trend of energy distribution of each frequency band relative to its historical background level is perceived in real time in a data-driven manner. Therefore, there is no need to preset liquid type or pre-store acoustic template. It can automatically lock the main frequency band of bubble sound that drifts when the physical properties of liquids with different viscosities and compositions change, solving the problem that traditional fixed frequency band monitoring cannot follow changes in liquid physical properties. It realizes real-time, unsupervised tracking of the active main frequency band of bubble sound under the current soup. It can continuously track the true concentrated frequency band of bubble sound energy, avoiding missed detection caused by the main frequency band deviating from the preset filtering range, thereby improving the robustness of boiling detection under multiple liquid types and varying operating conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122930097A_ABST
    Figure CN122930097A_ABST
Patent Text Reader

Abstract

The application discloses an audio processing method for boiling liquid overflow prevention, which comprises the following steps: performing a mel-frequency spectrum transformation on a real-time collected audio signal to generate a mel-frequency spectrum frame sequence containing energy values of multiple frequency bands; calculating a median value and a preset high quantile value of the energy of each frequency band as a dynamic statistical baseline; calculating an original prominence of each frequency band based on the dynamic statistical baseline, sequentially performing nonlinear compression processing and time domain smoothing processing to generate a frequency band weight vector; and performing weighting processing on the mel-frequency spectrum of a current frame by using the frequency band weight vector to form an audio signal which can be used for boiling state judgment. The audio processing method for boiling liquid overflow prevention can track a bubble sound main frequency band which drifts due to changes in liquid physical properties in real time and adaptively, suppresses fixed noises such as pot resonance dynamically, and selectively enhances transient bubble sound signals. The application also relates to a computer readable storage medium, which stores a computer program capable of being executed by a processor to realize the audio processing method for boiling liquid overflow prevention.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of acoustic signal processing and smart home appliance control technology, specifically to an audio processing method and storage medium for preventing boiling liquid from overflowing. Background Technology

[0002] During cooking, boiling and overflowing liquids is a common safety hazard, potentially leading to stove flameout, gas leaks, and other risks. Detecting the boiling state of liquids and implementing overflow prevention warnings using acoustic methods has become a significant research direction in the field of intelligent stoves in recent years. When a liquid is heated to boiling, the formation, expansion, and collapse of bubbles generate acoustic signals with specific spectral characteristics. By analyzing these signals in real time, boiling state information can be obtained before overflow occurs, thereby triggering corresponding overflow prevention control actions.

[0003] Existing acoustic detection technologies for boiling liquids are primarily based on a framework of static feature matching and fixed threshold determination. Typically, this involves offline acquisition of audio samples under specific conditions (e.g., boiling water), analysis to extract the concentrated frequency band of bubble sound energy (e.g., 800Hz to 2.2kHz), and then pre-setting a set of hardware or digital bandpass filters with fixed parameters. During cooking, the real-time audio signal acquired by a microphone is filtered by this fixed filter, and the resulting energy or amplitude value is used as the primary criterion for determining bubble activity. Another more complex approach involves constructing a pre-stored static acoustic signature feature library of various boiling states, identifying the boiling state by calculating the similarity between the real-time audio spectrum and the pre-stored templates (e.g., using Mel-frequency cepstral coefficients for pattern matching).

[0004] In terms of environmental noise suppression, existing technologies generally employ two types of strategies. The first type involves taking physical sound insulation measures or using directional microphones at the hardware level to reduce external interference. The second type involves using the "quiet period" during the initial system startup to estimate the noise spectrum, storing the obtained noise spectrum as a fixed background noise template, and subtracting this fixed noise template from the real-time signal spectrum during subsequent signal processing to achieve noise suppression. In the specific implementation of spectrum analysis, the system typically performs Fast Fourier Transform calculations on the audio signal at a fixed time window on a resource-constrained microcontroller, or feeds the signal into a set of filters with a fixed center frequency to extract the energy of each subband, and then compares the obtained energy value with an energy threshold calibrated through numerous experiments in advance, thereby triggering an overflow alarm.

[0005] However, the aforementioned existing technical solutions face the following technical limitations in actual stove application scenarios:

[0006] First, there is insufficient environmental adaptability. In actual cooking scenarios, the composition, viscosity, and heating power of the liquid in the pot are constantly changing. For example, as water gradually boils and the soup or milk boils, the change in the physical properties of the liquid causes a significant shift in the dominant frequency band of the bubbling sound. However, the monitoring parameters of fixed-band filters or static acoustic template matching methods are fixed in the system design stage and cannot be dynamically adjusted with the real-time changes in the physical properties of the liquid. This makes it easy to miss detections when the type of liquid or the cooking stage changes.

[0007] Second, the noise suppression and signal enhancement capabilities are limited. Fixed noise templates based on silent period estimation cannot adapt to the slow evolution of noise sources during stove operation, such as changes in fan speed and the drift of the pot's resonant frequency with temperature. At the same time, the general spectrum subtraction method performs indiscriminate energy reduction across all frequency bands, lacking both the ability to specifically suppress fixed noise components that overlap with the bubble sound spectrum (such as the pot's resonant peak) and the mechanism to intelligently enhance transient bubble sound signals. This results in limited improvement in the overall signal-to-noise ratio and low detection reliability in complex kitchen noise environments.

[0008] Third, there is a trade-off between computational resource consumption and real-time performance. Continuously running Fast Fourier Transform and multi-channel filtering operations have high computational complexity, resulting in significant power consumption and memory usage, making it difficult to directly embed into resource-constrained stove main control chips. At the same time, the signal processing latency introduced by the batch processing mode based on a fixed time window is high, making it difficult to meet the stringent real-time requirements of overflow prevention warnings, and potentially missing the optimal warning opportunity in rapid overflow scenarios.

[0009] In summary, how to achieve real-time adaptive tracking of the main frequency band of bubble sound, how to effectively highlight transient bubble sound signals in dynamic noise environments, and how to complete the above adaptive processing with extremely low latency and power consumption on resource-constrained stove hardware platforms are the technical problems that urgently need to be solved in the field of acoustic overflow detection of boiling liquids. Summary of the Invention

[0010] The first technical problem to be solved by the present invention is to provide an audio processing method for preventing boiling liquid from overflowing, which is capable of real-time adaptive tracking of the main frequency band of bubble sound that drifts due to changes in the physical properties of the liquid in a data-driven manner, while dynamically suppressing fixed noise such as pot resonance and selectively enhancing transient bubble sound signals.

[0011] The second technical problem to be solved by the present invention is to provide an audio processing method for preventing boiling liquid from overflowing, which is based on the above-mentioned prior art and completes the above-mentioned adaptive processing under extremely low latency and extremely low power consumption conditions, thereby meeting the embedded deployment requirements of resource-constrained stove platforms.

[0012] The third technical problem to be solved by the present invention is to provide a computer-readable storage medium that stores a computer program that can be executed by a processor to implement the aforementioned audio processing method for preventing boiling liquid from overflowing.

[0013] The technical solution adopted by this invention to solve the first technical problem mentioned above is: an audio processing method for preventing boiling liquid from overflowing, comprising the following steps:

[0014] S0. During cooking, the audio signal of the cooking liquid is collected in real time.

[0015] S1. Perform Mel spectrum transformation on the real-time acquired audio signal to generate a Mel spectrum frame sequence, and calculate the energy values ​​of multiple frequency bands in each frame of the Mel spectrum frame sequence.

[0016] S2. Set a dynamic statistical baseline based on a sliding window for each frequency band. The dynamic statistical baseline includes the energy median value and the preset high quantile value of the frequency band, which are calculated in real time within the sliding window. The energy median value represents the current background energy reference of the frequency band, and the preset high quantile value represents the current active energy limit of the frequency band.

[0017] S3. Based on the energy values ​​of each frequency band in the current frame and the dynamic statistical baseline of the corresponding frequency band, calculate the original salience of each frequency band, and perform nonlinear compression and time-domain smoothing processing on the original salience in sequence to generate the weight values ​​of each frequency band with values ​​ranging from 0 to 1, forming a frequency band weight vector.

[0018] S4. The Mel spectrum of the current frame is weighted using the frequency band weight vector to form an audio signal that can be used to determine the boiling state.

[0019] Preferably, in step S1, the audio signal is processed in frames at a fixed time interval of 20ms, and each frame generates a 128-dimensional Mel spectrum.

[0020] Preferably, in step S2, a circular buffer is allocated in memory for each frequency band. When a new frame of data is obtained, the circular buffer of the corresponding frequency band is updated, and the median energy value and the preset high quantile value of the frequency band within the time window covered by the circular buffer are calculated in real time.

[0021] Preferably, the time window length covered by the circular buffer is 4 seconds, the frame capacity of the circular buffer is 200 frames, and the preset high percentile value is the 90th percentile value.

[0022] As an improvement, in step S3, the original prominence R of each frequency band is calculated using the formula: R = (Ecurrent−M) / (P−M);

[0023] Where Ecurrent is the energy value of the frequency band in the current frame, M is the median energy value of the frequency band, and P is the preset high quantile value of the frequency band.

[0024] As an improvement, in step S3, the calculation formula for nonlinear compression processing of the original protrusion is Wraw=tanh(γ∗R);

[0025] Where γ is an adjustable scaling factor, and tanh(*) is the hyperbolic tangent calculation function. The nonlinear hyperbolic tangent compression function avoids noise amplification that may be caused by linear gain, while the exponential smoothing mechanism effectively filters out occasional transient impact interference (such as pot lid collisions), thereby substantially improving the input signal-to-noise ratio for subsequent boiling state determination.

[0026] As an improvement, in step S3, the time-domain smoothing process adopts first-order exponential smoothing, and the calculation formula for the time-domain smoothing process is: Wfinal[t]=α∗Wraw[t]+(1−α)∗Wfinal[t−1];

[0027] Where Wfinal[t] is the final frequency band weight value of frame t, Wraw[t] is the weight value of frame t after nonlinear compression, α is the smoothing coefficient, and Wfinal[t−1] is the final frequency band weight value of frame t-1.

[0028] Preferably, the smoothing coefficient α is 0.4.

[0029] The technical solution adopted by this invention to solve the second technical problem mentioned above is as follows: the Mel spectrum frame energy value, dynamic statistical baseline value, and frequency band weight value involved in steps S2 and S3 are all represented and calculated using Q15 fixed-point number format. The nonlinear compression processing is implemented through a pre-stored lookup table, and the energy median value and preset high quantile value within the sliding window are calculated through a sorting network. This calculation method achieves embedded deployment with extremely low latency and extremely low power consumption, meeting the real-time anti-overflow warning requirements of resource-constrained stove main control. All core operations, such as dynamic statistical baseline maintenance, nonlinear mapping, and exponential smoothing, are designed as multiply-accumulate operations based on fixed-point number format. Nonlinear functions are replaced by real-time calculations using lookup tables, and sliding window statistics are approximated through efficient circular buffers and sorting networks, avoiding the use of floating-point arithmetic units. The above operation process can be embedded in the hardware preprocessing unit and executed in a pipeline manner, with an additional latency of less than 1ms for processing a single 20ms frame of data and additional power consumption controlled at the milliwatt level. Compared to existing technologies that require continuous execution of Fast Fourier Transform and multi-channel filter banks, typically with a batch processing cycle of 1 second, this application reduces the computational latency of the signal preprocessing stage by more than an order of magnitude, effectively meeting the stringent requirements of sub-second response time in overflow prevention scenarios. Furthermore, key algorithm parameters are stored in registers that can be updated via the main controller, supporting remote parameter configuration optimization through over-the-air upgrades. This allows the system to be adapted and adjusted for newly discovered acoustic characteristics of ingredients after deployment, demonstrating excellent maintainability and scalability.

[0030] Preferably, the operations in steps S2 and S3 are embedded in an independent hardware acceleration module and processed sequentially band by band in a multiply-accumulate pipeline manner. The additional latency for processing a single frame of data is less than 0.6ms, and the additional power consumption is 20 to 30 milliwatts.

[0031] The technical solution adopted by the present invention to solve the third technical problem mentioned above is: a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the aforementioned audio processing method for preventing boiling liquid from overflowing.

[0032] Compared with the prior art, the advantages of the present invention are as follows:

[0033] 1. Real-time adaptive tracking of the main frequency band of bubble sound is achieved, effectively solving the problem of missed detection in fixed frequency band monitoring schemes. By maintaining a dynamic statistical baseline of "median value - preset high quantile value" based on a sliding window on the real-time generated Mel spectrum sequence for each frequency band, the changing trend of energy distribution of each frequency band relative to its historical background level is perceived in real time in a data-driven manner. Therefore, there is no need to preset liquid type or pre-store acoustic template. It can automatically lock the main frequency band of bubble sound that drifts when the physical properties of liquids with different viscosities and compositions change, solving the problem that traditional fixed frequency band monitoring cannot follow changes in liquid physical properties. It realizes real-time, unsupervised tracking of the active main frequency band of bubble sound under the current soup. It can continuously track the true concentrated frequency band of bubble sound energy, avoiding missed detection caused by the main frequency band deviating from the preset filtering range, thereby improving the robustness of boiling detection under multiple liquid types and varying operating conditions.

[0034] 2. This application achieves dynamic suppression of fixed noise and selective enhancement of transient bubble noise, effectively improving the signal-to-noise ratio in complex stove environments. It calculates the original salience by comparing the energy of each frequency band in the current frame with its dynamic statistical baseline, and generates a frequency band weight vector through nonlinear compression mapping and exponential smoothing, thus constructing an adaptive "frequency domain equalization" mechanism. This mechanism uses the median energy value to distinguish between background steady-state and transient burst signals, and uses high quantile values ​​to define the normalized scale of active energy. This automatically compresses the weights of fixed noise frequency bands, such as the pot resonance peak and range hood operating noise, whose energy is consistently stable near the baseline, to low values, while transient broadband pulse signals generated by bubble bursts receive high weights due to their sustained and significant energy deviation from the baseline. Compared with traditional fixed noise template spectral subtraction based on initial silence period estimation, the weight vector in this application is automatically updated with the slow changes in noise characteristics during cooking, eliminating the problem of noise template obsolescence leading to degradation of suppression effect. Attached Figure Description

[0035] Figure 1 This is an overall flowchart of the audio processing method for preventing boiling liquid from overflowing in an embodiment of the present invention. Detailed Implementation

[0036] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments.

[0037] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0038] This embodiment provides an audio processing method for preventing boiling liquid overflow, capable of analyzing the state of boiling liquids. This audio processing method can be applied to overflow detection scenarios during cooking on a stove. In actual cooking environments, liquids in a pot undergo a continuous evolution from not boiling to initial boiling, then to vigorous boiling, and finally to the possibility of overflow during heating. The acoustic signals generated by the formation, expansion, and collapse of bubbles in the liquid carry rich information about the boiling state. However, the spectral characteristics of this signal are not fixed but drift in real time with changes in the type of liquid (such as water, milk, broth, etc.) and its physical parameters such as viscosity and composition. From the perspective of fluid dynamics acoustics, the dominant frequency band of bubble sound is directly affected by various physical parameters such as liquid viscosity, surface tension, and component concentration. The dominant frequency band of bubble sound varies significantly between different liquids. Even within the same pot of liquid, changes in concentration due to water evaporation or the addition of new ingredients during cooking will cause the spectral characteristics of bubble sound to drift in real time. This non-stationary characteristic means that traditional detection schemes based on fixed frequency band monitoring or static template matching will face serious environmental adaptability problems in practical applications.

[0039] Based on the above analysis, this method abandons the technical approach that relies on preset liquid types or pre-built static feature libraries, and instead adopts a fully data-driven approach of "dynamic statistical baseline plus nonlinear adaptive weighting". The core design motivation of this approach is to simultaneously solve the following three interrelated core problems: First, the problem of main frequency drift tracking, that is, to independently maintain a dynamic statistical baseline based on a sliding window for each frequency band of the Mel spectrum, and to unsupervisedly and adaptively track and lock the true active main frequency band of the bubble sound under the current liquid conditions by continuously comparing the deviation of the current energy of each frequency band from its dynamic statistical baseline; Second, the problem of noise suppression, that is, to construct an adaptive frequency band weighting mechanism with both steady-state noise suppression and transient noise filtering capabilities through a combination of nonlinear compression and exponential smoothing, effectively distinguishing boiling signals from various environmental interference noises; Third, the problem of limited hardware resources, that is, to fundamentally solve the bottleneck of computing power and power consumption by designing all core operations as a multiply-accumulate pipeline based on fixed-point number format and embedding it in the hardware acceleration module. This method performs adaptive spectrum analysis on the above non-stationary acoustic signals, obtains boiling state information before the boiling liquid overflows, and triggers corresponding anti-overflow control actions.

[0040] When the audio processing method for preventing boiling liquid from overflowing in this application is applied to a stove system, the hardware architecture required for the stove system includes four core components: a microphone pickup module, a hardware preprocessing acceleration unit, a stove main control MCU, and an alarm actuator. These components are connected sequentially according to the signal flow direction.

[0041] The microphone pickup module is installed on the cooktop panel or inside the cooktop housing near the pot to collect acoustic signals generated during cooking in real time. The microphone pickup module includes at least one microelectromechanical system (MEMS) microphone and a front-end analog signal conditioning circuit, which includes a preamplifier and an anti-aliasing low-pass filter. The conditioned analog audio signal is converted into a digital audio stream by an analog-to-digital converter and output to the hardware preprocessing acceleration unit.

[0042] The hardware preprocessing acceleration unit can be implemented using an FPGA or a dedicated hardware acceleration module. It receives the digital audio stream from the microphone pickup module and sequentially performs adaptive signal processing tasks such as Mel spectrum generation, dynamic statistical baseline setting, frequency band weight vector calculation, and weighted feature extraction. All operations within the hardware preprocessing acceleration unit are implemented using Q15 fixed-point format, operating in a pipelined manner. The additional latency for processing one frame of data is less than 0.6ms, with an additional power consumption of 20 to 30 milliwatts. After processing, the hardware preprocessing acceleration unit outputs the extracted weighted feature vector to the stove's main control MCU.

[0043] The cooktop's main control MCU connects to the hardware preprocessing acceleration unit via a data bus, receives weighted feature vectors, and executes boiling state judgment logic and anti-overflow decision algorithms accordingly. The cooktop's main control MCU also manages key adjustable parameters in the hardware preprocessing acceleration unit, including sliding window length, non-linear scaling factor, and smoothing factor. These parameters are stored in configurable registers within the hardware preprocessing acceleration unit, supporting remote updates and optimizations of the cooktop's main control MCU via OTA (Over-The-Air) updates to adapt to newly discovered acoustic characteristics of food ingredients.

[0044] The alarm actuator is connected to the main control MCU of the stove and performs corresponding control actions based on the anti-overflow judgment result output by the main control MCU of the stove, including but not limited to audible and visual alarm prompts, automatic reduction of stove firepower, or closing of stove gas valve.

[0045] In summary, the overall signal flow of the stove system is as follows: the acoustic signal is collected and digitized by the microphone pickup module, and then undergoes adaptive spectrum analysis and feature extraction by the hardware preprocessing acceleration unit. The extracted weighted features are sent to the stove's main control MCU for boiling state determination, and finally, the alarm actuator performs the anti-overflow control action.

[0046] Based on this, the audio processing method for preventing boiling liquid from overflowing in this embodiment includes the following steps S0 to S4.

[0047] S0. During cooking, the audio signal of the cooking liquid is collected in real time.

[0048] S1. Real-time generation of Mel spectrum sequence. The real-time acquired audio signal is divided into frames according to a preset frame period. Mel spectrum transformation is performed on each frame of audio signal to generate a Mel spectrum frame sequence with a preset dimension, where each dimension corresponds to the energy value of a Mel scale frequency band. The energy values ​​of multiple frequency bands in each frame signal in the Mel spectrum frame sequence are calculated respectively.

[0049] Specifically, in this embodiment, the audio signal is processed in frames with a fixed time interval of 20ms, and each frame generates a 128-dimensional Mel spectrum.

[0050] S2. Dynamic Statistical Baseline Setting Steps. A dynamic statistical baseline based on a sliding window is set for each frequency band. The dynamic statistical baseline includes the median energy value and a preset high quantile value for that frequency band, calculated in real time within the sliding window. The median energy value represents the typical background energy benchmark of that frequency band under the current cooking state, and the preset high quantile value represents the upper limit of active energy for that frequency band under the current cooking state. In this embodiment, the preset high quantile value is the 90th percentile value.

[0051] Specifically, a circular buffer based on a sliding window is set for each frequency band in the Mel spectrum frame, and the length of the circular buffer corresponds to the preset statistical window duration. When a new frame of Mel spectrum data is acquired, the energy values ​​of each frequency band in the current frame are written into the corresponding circular buffer, and the median energy value and preset high quantile value of each frequency band within the current sliding window are calculated in real time. That is, the dynamic statistical baseline of that frequency band is updated synchronously with each new frame.

[0052] The length of the circular buffer determines the time span of the sliding window, and the selection of this parameter requires an engineering trade-off between baseline stability and tracking response speed. If the window length is too short, for example, set to 1 second (50 frames), the amount of historical data stored in the circular buffer is limited, and the statistical baseline is easily affected by transient noise disturbances. In actual stove usage scenarios, transient acoustic events such as pot collision sounds, grease splattering sounds, and range hood vibrations can significantly raise the energy levels of certain frequency bands in a short period of time. If the window is too short, these transient events will account for too large a proportion of the window, leading to artificially high median M and 90th percentile P values. This, in turn, will cause severe fluctuations in the baseline after the transient events subside, affecting the stability of subsequent frequency band weight calculations and increasing the risk of false alarms. If the window length is too long, for example, set to 10 seconds (500 frames), although the statistical baseline's resistance to transient disturbances is significantly enhanced, its tracking ability for scenarios with rapidly changing liquid physical properties is significantly reduced. For example, in a scenario where a user quickly pours milk into boiling water, the dominant frequency band of the bubbling sound may drift within 2 to 3 seconds. However, a 10-second window requires a considerable amount of time to completely flush the old frequency band distribution data out of the buffer, resulting in a lag in baseline updates. This can lead to decreased detection sensitivity or even missed detections during the liquid switching transition period. Furthermore, an excessively long window linearly increases the memory usage of the circular buffer and the cumulative overhead of histogram updates. In this embodiment, the preferred time window length for the circular buffer is 4 seconds, and the frame capacity of the circular buffer is 200 frames. Experiments on various typical cooking scenarios have verified that a good balance can be achieved between baseline stability and tracking response speed. A 4-second window is sufficient to cover the acoustic events of multiple bubble cycles, allowing the median value M to stably reflect the background energy level of that frequency band without being significantly affected by single transient interference. Simultaneously, the 4-second time span is shorter than the complete transition time in most liquid switching scenarios, enabling the statistical baseline to converge essentially within 4 to 6 seconds after the liquid composition changes, meeting the real-time requirements of spill prevention warnings.

[0053] Optionally, the window length can be adjusted within the range of 2 seconds (100 frames) to 8 seconds (400 frames) depending on the specific application scenario. In situations where higher false alarm rate requirements are needed and the cooking scenario is relatively stable, the window length can be appropriately extended to 6 seconds or 8 seconds to enhance baseline stability; in situations where higher response speed requirements are needed and liquid switching is frequent, the window length can be appropriately shortened to 2 seconds or 3 seconds to improve tracking sensitivity. The window length parameter is stored in a configurable register within the hardware preprocessing acceleration unit. It can be updated online by the cooktop's main control MCU via register write instructions, and also supports remote optimization and adjustment via over-the-air (OTA) download technology.

[0054] This step maintains a sliding window-based circular buffer for each band of the 128-mesh spectrum, used for real-time tracking of the background energy statistics of each band. Logically, the circular buffer is a two-dimensional array, with its row dimension corresponding to the 128 mesh bands and its column dimension corresponding to the 200-frame temporal depth; that is, the overall data structure is B ∈ Z¹². 8 × ² 00 Each element stores a Mel-spectral energy value in Q15 fixed-point format. Since the interval between each frame after frame extraction is 20ms, 200 frames correspond exactly to a sliding time window of 200 × 20ms = 4s.

[0055] During the system power-on initialization phase, all elements in the circular buffer are set to zero, and the write pointer ptr is initialized to 0. During the first 200 frames of data arrival, i.e., the first 4 seconds after system startup, the circular buffer is not yet fully filled, containing some zero-value elements. During this period, the calculation of the dynamic statistical baseline still proceeds normally, but due to the presence of zero-value elements, the calculated median and 90th percentile values ​​may be too low, causing the baseline to not yet converge to the true background level. Therefore, during the first 4 seconds of startup, the system sets the overflow prevention decision output to a suppressed state, not triggering any alarm actions, and only enters normal operation after the circular buffer is fully filled.

[0056] The dynamic statistical baseline, composed of the median M and the 90th percentile P, automatically follows the changes in the physical properties of the liquid during cooking. Taking a typical scenario as an example: In the initial stage of cooking, water is added to the pot and heated. As the water temperature rises, the energy of the bubble bursting sound is mainly concentrated in the Mel frequency band corresponding to 2kHz to 4kHz. The median M and 90th percentile P of each frequency band within this range gradually increase, reflecting the enhancement of bubble activity. At this time, the statistical baseline for frequency bands below 2kHz and above 4kHz remains at a low level, indicating that no significant bubble sound energy appears in these bands. When the user adds milk to the pot during cooking, due to the significant difference in viscosity and surface tension between milk and water, the size, bursting frequency, and acoustic radiation characteristics of the bubbles change accordingly. The main energy frequency band of the bubble sound shifts from the original 2kHz to 4kHz range towards lower frequencies, for example, to the Mel frequency band corresponding to 1kHz to 2.5kHz. Within a 4-second sliding window, the previously active high-frequency bands, no longer continuously receiving high-energy bubble sound signals, cause the newly written energy values ​​in their annular buffers to gradually fall below the old values, resulting in the median value M and the 90th percentile value P naturally dropping within a few seconds. Simultaneously, the statistical baselines of each band in the newly active frequency band gradually rise, completing the automatic tracking of the bubble sound main frequency band drift. The entire tracking process is completely data-driven, requiring no preset liquid type parameters or pre-stored acoustic templates, demonstrating the unsupervised adaptive characteristics of this method.

[0057] S3. After completing the setting of the dynamic statistical baseline, proceed to the frequency band weight vector generation step.

[0058] Based on the difference between the median energy value and the preset high quantile value of each frequency band, frequency bands with significant energy that continuously exceed their historical background levels are identified. The frequency bands that meet the identification conditions are determined as the active main frequency band of bubble sound corresponding to the current liquid, thereby realizing unsupervised real-time tracking of the main frequency band of bubble sound that drifts due to changes in the physical properties of the liquid.

[0059] Based on this, the adaptive frequency band weight vector generation steps are as follows: For each frequency band, the original salience is calculated by comparing the energy value of the current frame with the corresponding dynamic statistical baseline; the original salience is scaled by an adjustable coefficient and then fed into a nonlinear compression function for nonlinear compression processing to obtain the original weight value; the original weight value is then subjected to time-domain smoothing to generate the weight values ​​for each frequency band, with values ​​ranging from 0 to 1. The final weight values ​​of all frequency bands are combined into a frequency band weight vector. Specifically, for the main frequency band of bubble sound where the energy is consistently higher than the dynamic statistical baseline, its weight approaches the upper limit and is thus enhanced; for fixed noise frequency bands where the energy remains stable or transient interference frequency bands that only exhibit brief spikes, their weights are compressed to lower values ​​and thus suppressed.

[0060] The first step is to calculate the original salience. For each frequency band, the original salience R is calculated using the formula: R = (Ecurrent−M) / (P−M); where Ecurrent is the energy value of the frequency band in the current frame, M is the median energy value of the frequency band, and P is the preset high quantile value of the frequency band. In this embodiment, P is specifically the 90th quantile value.

[0061] The raw prominence R is essentially a normalization measure that standardizes the instantaneous energy of a frequency band in the current frame relative to the dynamic historical statistical characteristics of that band itself. Specifically, the numerator Ecurrent−M reflects the absolute amount by which the energy of the current frame deviates from the typical background level of that frequency band, while the denominator P−M characterizes the common amplitude range of energy fluctuations in that frequency band within a recent sliding window, i.e., the dynamic range from the typical level to the upper limit of activity. Through this normalization operation, the energy activity levels under different frequency bands, different liquid types, and different firepower levels are mapped to a unified dimensionless scale, thus making the prominence of each frequency band comparable. For example, the absolute energy of a certain low-frequency band may be much higher than that of a certain high-frequency band, but after normalization of their respective dynamic baselines, their prominence R can be fairly compared on the same order of magnitude.

[0062] Based on the positional relationship of Ecurrent relative to the median M and the 90th percentile P, the original salience R exhibits three values ​​with clear physical meaning. First, when Ecurrent is below M, R is negative, indicating that the energy of this frequency band in the current frame is below its recent typical background level, and the band is in a relatively quiet state, having no indicative significance in boiling detection. Second, when Ecurrent is between M and P, R ranges from 0 to 1, indicating that although the energy of this frequency band in the current frame is above the typical background level, it is still within the range of energy fluctuations commonly seen in this band recently, belonging to normal energy fluctuations, and cannot yet be used as a reliable indicator of a boiling signal. Third, when Ecurrent exceeds P, R is greater than 1, indicating that the energy of this frequency band in the current frame has significantly exceeded the active upper limit corresponding to 90% of its recent historical observations, and this frequency band is experiencing an abnormal energy surge. This usually corresponds to the concentrated expression of boiling characteristic signals such as bubble bursting sounds or liquid churning sounds in this frequency band.

[0063] When the difference between P and M is less than a preset minimum threshold ε, the denominator is clamped to ε to avoid division by zero anomalies and ensure numerical stability. In this embodiment, the preset minimum threshold ε is preferably set to 0.01. Besides avoiding division by zero anomalies, this clamping operation also has important signal processing implications: when P and M in a certain frequency band are extremely close, it indicates that the energy of that frequency band remains almost constant throughout the sliding window. This corresponds precisely to the typical characteristics of certain fixed-frequency noise sources in the stove environment, such as narrowband noise generated by a fan operating at constant speed. In this case, even if there are slight energy fluctuations in that frequency band, the denominator clamping operation will limit R within a controllable range, preventing it from being excessively amplified.

[0064] Next is the nonlinear compression calculation. In this embodiment, an adjustable scaling factor γ is applied to the original salience R, and nonlinear compression is performed using the hyperbolic tangent function to obtain the original weight Wraw. Specifically, the calculation formula for nonlinear compression of the original salience is Wraw=tanh(γ∗R); where γ is the adjustable scaling factor, and tanh(*) is the hyperbolic tangent calculation function.

[0065] The adjustable scaling factor γ controls the mapping sensitivity from the original prominence R to the original weight Wraw. Its typical value ranges from 1.5 to 3.0, with a preferred value of 2.0. When γ is larger, the slope of the mapping curve near the origin increases, meaning that a small positive offset of R can quickly bring Wraw close to 1, making the system more sensitive to frequency band energy anomalies, but also increasing its sensitivity to noise fluctuations. When γ is smaller, the mapping curve tends to be flatter, requiring greater prominence to produce a higher weight output. Noise immunity is enhanced, but the response speed decreases accordingly. In practical applications, γ can be calibrated and adjusted according to the acoustic environment characteristics of the stove and the target detection sensitivity requirements.

[0066] The hyperbolic tangent function, as a nonlinear compression function, plays two key roles in this method. Firstly, it enhances performance through saturation: when the original salience R is a large positive value, γ · R is much greater than 1, and the output of (γ · R) approaches 1 and enters the saturation region. This means that no matter how much the energy of this frequency band exceeds the dynamic baseline, its original weight is stably limited to a level close to 1, avoiding the impact of extreme energy values ​​on subsequent processing, while ensuring that truly active frequency bands receive sufficient enhancement. Secondly, it provides strong suppression: when R is negative or a small positive value close to zero, γ · R is negative or close to zero, and the output of (γ · R) approaches 0 or is negative. In this embodiment, a lower limit truncation is applied to Wraw, truncating negative values ​​to zero, i.e., Wraw = (0, (γ · R)). The purpose of this truncation operation is to ensure the non-negativity of each element in the final weight vector. Since the weight vector will be applied to the Mel-spectrum vector in subsequent steps via band-by-band multiplication, the non-negativity of the weights guarantees that the weighting operation physically represents the preservation or attenuation of energy in each band, rather than a reversal of signal polarity. Therefore, bands with energy below or equal to the background level are assigned zero or very low weights, effectively suppressing them in subsequent weighted feature extraction.

[0067] Finally, temporal smoothing is performed. In this embodiment, first-order exponential smoothing is applied to the original weights Wraw to generate the final frequency band weight value Wfinal[t]. Specifically, the calculation formula for temporal smoothing is: Wfinal[t] = α * Wraw[t] + (1 - α) * Wfinal[t-1]; where Wfinal[t] is the final frequency band weight value of frame t, Wraw[t] is the weight value of frame t after nonlinear compression, α is the smoothing coefficient, and Wfinal[t-1] is the final frequency band weight value of frame t-1. The smoothing coefficient α ranges from 0.3 to 0.5, with a preferred value of 0.4. The physical meaning of the smoothing coefficient α is: the larger the value of α, the greater the proportion of the original weights Wraw[t] in the final weights of the current frame, and the faster the system tracks weight changes; the smaller the value of α, the stronger the inertia of the historical weights Wfinal[t-1], and the smoother the system's response to weight changes. In this embodiment, the selection of α to 0.4 is based on the following: the bubbling sound during boiling has quasi-periodic and continuous characteristics, and its energy in the main frequency band usually remains at a high level for several consecutive frames. Therefore, α of 0.4 can ensure a fast response to such continuous signals, and the weight value can rise from a low value to near steady state within about 5 to 8 frames, or 100ms to 160ms. At the same time, α of 0.4 means that the historical weight accounts for 0.6, which means that although transient pulses appearing in a single frame (such as knocking sounds or the sound of tableware colliding) may produce a brief high peak in Wraw, after exponential smoothing, the peak will only produce a limited amplitude of brief rise in Wfinal, and will quickly decay back to the original level within the following 2 to 3 frames, thereby effectively filtering out the weight jitter caused by transient interference.

[0068] First-order exponential smoothing is performed independently for each of the 128 frequency bands, with each band maintaining its own Wfinal[t-1] state. After smoothing, the final weight values ​​Wfinal[t] of all 128 frequency bands are arranged and combined in band order to form a 128-dimensional final frequency band weight vector, denoted as Wfinal. The value of each element in the final frequency band weight vector Wfinal ranges from 0 to 1, where 0 indicates that the frequency band is completely suppressed, and 1 indicates that the energy of the frequency band is completely preserved and transferred to subsequent processing stages. Functionally, this weight vector is equivalent to a 128-band equalizer that automatically adjusts frame by frame. The gain of each frequency band is dynamically determined by the real-time prominence of the corresponding frequency band, rather than using a statically preset gain configuration. It is this "automatic equalizer" mechanism that allows the subsequent weighted feature extraction stage to focus on the frequency bands that truly carry boiling information, while automatically shielding the frequency bands occupied by fixed environmental noise and transient interference.

[0069] The following analysis uses three typical scenarios as examples to illustrate the dynamic behavior of the final frequency band weight vector Wfinal.

[0070] The first typical scenario is the dominant frequency band of bubble sound. During the process of water or soup about to boil and continuing to boil, the broadband acoustic signal generated by the bursting of bubbles at the liquid surface exhibits a continuous energy boost in a specific mid-to-high frequency band. When bubble sound begins to appear, the Ecurrent of the corresponding frequency band is consistently higher than the M value in its dynamic baseline, and frequently exceeds the P value, causing the original salience R to remain at a high level above 1. After γ scaling, γ · R is much greater than 1, and after function mapping, Wraw is close to 1 in each frame. Due to the persistence of bubble sound, Wraw maintains a high value for several consecutive frames. After first-order exponential smoothing, Wfinal rapidly rises within a few frames and stabilizes at a level close to 1, typically in the range of 0.85 to 0.98. Thus, the dominant frequency band of bubble sound receives near-full weighting enhancement, and its energy information is fully preserved in subsequent weighted features.

[0071] The second typical scenario is the steady-state resonance peak of the pot. During heating, the pot on the stove generates structural resonances at specific frequencies. These resonance peaks are characterized by a relatively stable, high energy level in a specific frequency band over a long period. Because this energy is continuous and stable, in the circular buffer statistics, the M value of this frequency band gradually tracks to near this steady-state energy level, while the difference between P and M is small. Therefore, when the current frame's Ecurrent is still at this steady-state level, the numerator Ecurrent - M is close to zero, the R value is close to zero or even a small positive value, and after function mapping, Wraw is only a low value of 0.1 to 0.3. After exponential smoothing, Wfinal remains stable in the low-weight range of 0.2 to 0.4. This indicates that although the pot resonance peak may be strong in absolute energy, its weight is effectively suppressed because its energy is not abnormally prominent relative to its historical baseline. Its contribution to subsequent weighted features is significantly weakened, and it does not interfere with the determination of the boiling state.

[0072] The third typical scenario is transient knocking noise. During stove use, events such as users operating pots or utensils and colliding with them generate brief, broadband pulse noises. This type of transient noise is characterized by its extremely short duration, typically lasting only 1 to 3 frames (20ms to 60ms). At the moment the pulse occurs, the Ecurrent across multiple frequency bands suddenly increases, the R value may briefly jump to a large positive value, and the corresponding Wraw value also momentarily approaches 1. However, because α is set to 0.4 in the first-order exponential smoothing process, a high Wraw value in a single frame can only increase Wfinal from its original level by about 40%. More importantly, in subsequent frames after the pulse disappears, Ecurrent quickly returns to normal levels, Wraw subsequently drops back to a low value, and Wfinal recovers to its pre-pulse level within 2 to 3 frames under exponential decay. Simultaneously, even if this transient pulse causes a small number of high-energy frames in the circular buffer, since the circular buffer length is 200 frames (4 seconds), the impact of these anomalous frames on M and P is extremely limited, and the dynamic statistical baseline remains stable. Therefore, transient knocking noise only causes brief and limited disturbances in the final frequency band weight vector, and will not lead to misjudgment.

[0073] S4. Weighted Feature Extraction and Overflow Prevention Determination Steps. The Mel spectrum of the current frame is weighted using a frequency band weight vector to obtain weighted Mel spectrum features, forming an audio signal suitable for determining the boiling state. Based on these weighted Mel spectrum features, boiling state determination is facilitated. When the determination result meets the overflow prevention triggering conditions, an overflow prevention alarm signal is output.

[0074] Specifically, the 128-dimensional Mel-frequency energy vector of the current frame is multiplied element-wise with the 128-dimensional frequency band weight vector to obtain a weighted Mel-frequency feature vector. In this weighted feature vector, the frequency band energy corresponding to the active main frequency band of bubble sound is enhanced, while the frequency band energy corresponding to pot resonance noise, environmental background noise, and brief impact noise is effectively suppressed. The weighted feature vector, as the final output of the hardware preprocessing acceleration unit, is transmitted to the stove's main control MCU via the data bus. The stove's main control MCU receives the weighted feature vector and analyzes it based on the preset boiling state judgment logic to determine whether the current liquid is in a violent boiling state nearing overflow. When the judgment result indicates that anti-overflow intervention is required, the stove's main control MCU sends a control command to the alarm actuator to trigger the corresponding anti-overflow action.

[0075] In terms of timing, the aforementioned audio acquisition and preprocessing, Mel spectrum generation, dynamic statistical baseline maintenance, frequency band weight vector generation, and weighted feature extraction steps are all completed in a pipelined manner within the hardware preprocessing acceleration unit. Specifically, the circular buffer update and statistical baseline calculation, nonlinear mapping, and exponential smoothing are all completed sequentially within the same frame processing cycle. The additional processing latency of each 20ms frame of audio data from entering the hardware preprocessing acceleration unit to outputting the weighted feature vector is less than 0.6ms, ensuring the system's real-time performance. The overflow prevention decision is executed on the stove's main control MCU side, and its processing time is independent of the frame processing cycle of the hardware preprocessing acceleration unit.

[0076] To enable all core operations of the adaptive spectrum analysis described above to be completed in real time with extremely low power consumption on the hardware preprocessing acceleration unit, this embodiment uses Q15 fixed-point number format to represent and calculate all intermediate variables and operations involved in each step, thereby completely avoiding the use of floating-point arithmetic units. That is, the Mel spectrum frame energy value, dynamic statistical baseline value, and frequency band weight value involved in steps S2 and S3 are all represented and calculated using Q15 fixed-point number format, nonlinear compression processing is implemented through a pre-stored lookup table, and the energy median value and preset high quantile value within the sliding window are calculated through a sorting network.

[0077] The nonlinear mapping of the hyperbolic tangent function is achieved through a pre-computed lookup table, further reducing computational complexity. This lookup table is pre-computed during system initialization and stored in on-chip read-only memory in Q15 format. During runtime, the mapping result can be obtained simply by performing a lookup operation based on the input value, avoiding the large number of multiplication and division operations required for real-time computation of transcendental functions.

[0078] Through the unified data representation scheme of the Q15 fixed-point format described above, all addition, subtraction, and multiplication operations in Mel spectrum generation, dynamic statistical baseline maintenance, frequency band weight vector generation, and weighted feature extraction are transformed into 16-bit integer addition and subtraction operations and 16-bit multiplication and addition operations, which perfectly match the hardware operation structure of the 16-bit multiplication and addition pipeline in the hardware preprocessing acceleration unit, without the need to call any floating-point operation instructions or enable the floating-point operation unit. Actual testing has verified that after adopting the above fixed-point format, the processing latency of the hardware preprocessing acceleration unit to complete all operations in a single frame does not exceed 0.6 milliseconds, far less than the 20-millisecond frame period. The overall system power consumption is controlled within the range of 20 milliwatts to 30 milliwatts, meeting the low-power real-time processing requirements of the stove embedded platform.

[0079] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0080] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. An audio processing method for preventing boiling liquid from overflowing, characterized in that: Includes the following steps: S0. During cooking, the audio signal of the cooking liquid is collected in real time. S1. Perform Mel spectrum transformation on the real-time acquired audio signal to generate a Mel spectrum frame sequence, and calculate the energy values ​​of multiple frequency bands in each frame of the Mel spectrum frame sequence. S2. Set a dynamic statistical baseline based on a sliding window for each frequency band. The dynamic statistical baseline includes the energy median value and the preset high quantile value of the frequency band, which are calculated in real time within the sliding window. The energy median value represents the current background energy reference of the frequency band, and the preset high quantile value represents the current active energy limit of the frequency band. S3. Based on the energy values ​​of each frequency band in the current frame and the dynamic statistical baseline of the corresponding frequency band, calculate the original salience of each frequency band, and perform nonlinear compression and time-domain smoothing processing on the original salience in sequence to generate the weight values ​​of each frequency band with values ​​ranging from 0 to 1, forming a frequency band weight vector. S4. The Mel spectrum of the current frame is weighted using the frequency band weight vector to form an audio signal that can be used to determine the boiling state.

2. The audio processing method for preventing boiling liquid from overflowing according to claim 1, characterized in that: In step S1, the audio signal is processed in frames at a fixed time interval of 20ms, and each frame generates a 128-dimensional Mel spectrum.

3. The audio processing method for preventing boiling liquid from overflowing according to claim 1, characterized in that: In step S2, a circular buffer is allocated in memory for each frequency band. When a new frame of data is obtained, the circular buffer of the corresponding frequency band is updated, and the median energy value and preset high quantile value of the frequency band within the time window covered by the circular buffer are calculated in real time.

4. The audio processing method for preventing boiling liquid from overflowing according to claim 3, characterized in that: The time window length covered by the circular buffer is 4 seconds, the frame capacity of the circular buffer is 200 frames, and the preset high percentile value is the 90th percentile value.

5. The audio processing method for preventing boiling liquid from overflowing according to any one of claims 1 to 4, characterized in that: In step S3, the original prominence R of each frequency band is calculated using the formula: R = (Ecurrent−M) / (P−M); Where Ecurrent is the energy value of the frequency band in the current frame, M is the median energy value of the frequency band, and P is the preset high quantile value of the frequency band.

6. The audio processing method for preventing boiling liquid from overflowing according to claim 5, characterized in that: In step S3, the calculation formula for nonlinear compression processing of the original protrusion is Wraw=tanh(γ∗R); Where γ is an adjustable scaling factor, and tanh(*) is the hyperbolic tangent calculation function.

7. The audio processing method for preventing boiling liquid from overflowing according to claim 6, characterized in that: In step S3, the time-domain smoothing process adopts first-order exponential smoothing, and the calculation formula for the time-domain smoothing process is: Wfinal[t]=α∗Wraw[t]+(1−α)∗Wfinal[t−1]; Where Wfinal[t] is the final frequency band weight value of frame t, Wraw[t] is the weight value of frame t after nonlinear compression, α is the smoothing coefficient, and Wfinal[t−1] is the final frequency band weight value of frame t-1.

8. The audio processing method for preventing boiling liquid from overflowing according to claim 7, characterized in that: The smoothing coefficient α is set to 0.

4.

9. The audio processing method for preventing boiling liquid from overflowing according to any one of claims 1 to 8, characterized in that: The Mel spectrum frame energy value, dynamic statistical baseline value, and frequency band weight value involved in steps S2 and S3 are all represented and calculated using the Q15 fixed-point number format. The nonlinear compression processing is implemented through a pre-stored lookup table, and the energy median value and preset high quantile value within the sliding window are calculated through a sorting network.

10. The audio processing method for preventing boiling liquid from overflowing according to claim 9, characterized in that: The operations in steps S2 and S3 are embedded in an independent hardware acceleration module and are processed sequentially band by band in a multiply-accumulate pipeline manner. The additional latency for processing a single frame of data is less than 0.6ms, and the additional power consumption is 20 to 30 milliwatts.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the audio processing method for preventing boiling liquid from overflowing, as described in any one of claims 1 to 8.