Cross-scene real-time dtmf detection method, device and equipment and storage medium

By using a hybrid model of convolutional neural networks and long short-term memory networks and a sliding window majority voting strategy, the high false detection rate of traditional DTMF detection in noisy and network packet loss scenarios is solved, thus improving the stability and accuracy of detection.

CN122417084BActive Publication Date: 2026-08-25SHENZHEN DINSTAR TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610867429.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-06-16
Publication Date
2026-08-25
Estimated Expiration
2046-06-16

AI Technical Summary

Technical Problem

Traditional DTMF detection algorithms are not strong enough to resist interference in noisy environments and network packet loss scenarios, resulting in a high false detection rate and making it difficult to meet the accuracy and anti-interference requirements of real-time communication scenarios.

Method used

A hybrid model combining convolutional neural networks and long short-term memory networks is used for feature learning and temporal modeling, and a sliding window majority voting strategy is combined to improve the stability and accuracy of detection.

Benefits of technology

It significantly reduces the false detection rate of DTMF detection, improves the anti-interference capability in noisy environments and network packet loss scenarios, and ensures the reliability of real-time communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122417084B_ABST
    Figure CN122417084B_ABST
Patent Text Reader

Abstract

The application discloses a cross-scene real-time DTMF detection method and device, equipment and a storage medium, and relates to the technical field of audio signal processing. The cross-scene real-time DTMF detection comprises the following steps: receiving an original audio stream, pre-processing the original audio stream to obtain a target audio signal; inputting the target audio signal into a hybrid model of a convolutional neural network and a long short-term memory network to obtain a classification result of the target audio signal; constructing a sliding window based on the classification result, performing majority voting on the classification result in the sliding window to obtain a majority voting result; and according to the scene identifier of the current running environment, mapping the majority voting result into a corresponding target signaling format to obtain an audio detection result. The application can improve the detection precision and anti-interference ability of DTMF detection in a noisy environment and a network packet loss scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of audio signal processing technology, and in particular to a cross-scene real-time DTMF detection method, apparatus, device and storage medium. Background Technology

[0002] DTMF (Dual Tone Multi Frequency) signal detection is a key technology in WebRTC (Web Real-Time Communication) - SIP (Session Initiation Protocol) real-time communication, voice interaction and other scenarios. It is used to accurately identify user key commands from real-time audio streams, and its detection accuracy directly affects the reliability of signaling parsing.

[0003] Currently, DTMF detection technology mainly employs traditional methods such as the Goertzel algorithm and energy detection. These methods use manually designed fixed frequency extraction rules to match the dual-tone frequencies of audio signals to determine the key category. However, these traditional algorithms rely on preset frequency thresholds and fixed signal duration parameters. When faced with non-ideal audio environments such as network packet loss, background noise, and echo interference, they cannot effectively distinguish between real DTMF signals and noise components, leading to a significantly higher false detection rate. Especially in scenarios with low SNR (Signal-to-Noise Ratio) of 5dB or lower, or in situations with packet loss, the false detection rate of traditional algorithms is generally greater than or equal to 3%, which is insufficient to meet the technical requirements of real-time communication scenarios for DTMF detection accuracy and anti-interference capabilities.

[0004] Therefore, how to improve the anti-interference ability of traditional DTMF detection in noisy environments and network packet loss scenarios, and reduce the false detection rate, is an urgent problem to be solved.

[0005] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention

[0006] The main purpose of this application is to provide a cross-scenario real-time DTMF detection method, device, equipment and storage medium, aiming to solve the technical problem of how to improve the anti-interference ability of traditional DTMF detection in noisy environments and network packet loss scenarios and reduce the false detection rate.

[0007] To achieve the above objectives, this application proposes a cross-scene real-time DTMF detection method. The method includes: receiving an original audio stream; preprocessing the original audio stream to obtain a target audio signal; inputting the target audio signal into a hybrid model of a convolutional neural network and a long short-term memory network to obtain a classification result of the target audio signal; constructing a sliding window based on the classification result; performing a majority vote on the classification results within the sliding window to obtain a majority vote result; and mapping the majority vote result to the corresponding target signaling format according to the scene identifier of the current operating environment to obtain an audio detection result.

[0008] In one embodiment, the step of obtaining the classification result of the target audio signal includes: The target audio signal is converted into a Mel spectrogram, wherein the Mel spectrogram is generated based on a preset number of Mel filters and the frame length is a preset duration; The Mel spectrogram is processed by three convolutional and pooling layers to extract local frequency features from the spectrogram. The local frequency features are time-series modeled using a two-layer bidirectional long short-term memory network to obtain the modeled time-series features. Based on the modeled temporal features, the target audio signal classification result is obtained by mapping the feature dimensions through a fully connected layer and combining it with an activation function.

[0009] The step of performing time-series modeling on the local frequency features using a two-layer bidirectional long short-term memory network to obtain the modeled time-series features includes: The local frequency features are input into the first layer of the bidirectional long short-term memory network to extract the forward and backward temporal features of the audio signal, and then the features are concatenated. The concatenated features are input into the second-layer bidirectional long short-term memory network to further model the deep temporal dependencies, thus obtaining the modeled temporal features.

[0010] In one embodiment, before the step of inputting the target audio signal into a hybrid model of a convolutional neural network and a long short-term memory network to obtain the classification result of the target audio signal, the method further includes: A training dataset of real-world audio data is constructed, wherein the audio data covers noise types and signal strengths under different network environments, and is accurately labeled with classification tags and durations; The training dataset is augmented to simulate signal distortion during cross-scenario transmission; Based on the enhanced dataset, the initial model is trained so that the model learns the time-frequency feature mapping relationship of audio signals in different scenarios; The trained model is pruned to remove redundant convolutional kernels to reduce model parameters and storage resource consumption, resulting in a lightweight hybrid model of convolutional neural network and long short-term memory network.

[0011] In one embodiment, the step of constructing a sliding window based on the classification result and performing a majority vote on the classification results within the sliding window to obtain a majority vote result includes: Obtain classification results for N consecutive frames; If there is packet loss in the current frame, the previous valid frames are used for interpolation and padding to obtain the N-frame classification results after padding. The classification results of the padded N frames are stored in a sliding window of length N; Count the number of categories for each classification result within the sliding window; If more than half of the items in the sliding window belong to the same category, then the category is determined to be the majority vote result, and the confirmation button is pressed based on the majority vote result.

[0012] In one embodiment, the step of mapping the majority voting result to the corresponding target signaling format based on the scene identifier of the current operating environment to obtain the audio detection result includes: Obtain the scene identifier of the current operating environment; If the scenario is identified as a web-based real-time communication scenario, then the majority voting result is mapped to the data sending event callback format of the browser-side real-time communication object; The data sending event callback is used to synchronize the results to the session initiation protocol gateway to obtain the audio detection results; If the scenario is identified as a session initiation protocol scenario, then the majority voting result is mapped to the information request message format of the session initiation protocol; The results are encapsulated into the information request message and fed back to obtain the audio detection results.

[0013] In one embodiment, the step of receiving the original audio stream and preprocessing the original audio stream to obtain the target audio signal includes: Receive raw audio streams containing different sampling rates; The original audio stream is resampled and converted into a 16kHz mono audio signal; The converted audio signal is denoised using a lightweight spectral subtraction method, wherein the denoising process includes optimization of the core frequency range of the dual-tone multi-frequency (DTMF). The denoised audio signal is divided into a frame sequence to obtain the target audio signal.

[0014] Furthermore, to achieve the above objectives, this application also proposes a cross-scenario real-time DTMF detection device, which includes: A receiving module is used to receive the raw audio stream, preprocess the raw audio stream, and obtain the target audio signal; The classification module is used to input the target audio signal into a hybrid model of convolutional neural network and long short-term memory network to obtain the classification result of the target audio signal; The voting module is used to construct a sliding window based on the classification results, perform a majority vote on the classification results within the sliding window, and obtain a majority vote result. The detection module is used to map the majority voting result to the corresponding target signaling format based on the scene identifier of the current operating environment, so as to obtain the audio detection result.

[0015] In addition, to achieve the above objectives, this application also proposes a cross-scene real-time DTMF detection device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the cross-scene real-time DTMF detection method as described above.

[0016] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the cross-scene real-time DTMF detection method described above.

[0017] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the cross-scene real-time DTMF detection method described above.

[0018] This application provides a cross-scene real-time DTMF detection method. First, the target audio signal is input into a hybrid model of a convolutional neural network and a long short-term memory network. Leveraging the powerful local feature extraction capabilities of CNNs and the temporal dependency modeling capabilities of LSTMs, background noise is accurately extracted from low-level features, and the spectral temporal patterns of the DTMF signal are captured. Based on this, a sliding window is constructed based on the classification results, and majority voting is performed. Statistical decision-making smooths out potential instantaneous misjudgments and jitter in single-frame predictions, significantly improving detection stability. Finally, the system can dynamically map the voting results to the corresponding target signaling format according to the scene identifier of the current operating environment.

[0019] In summary, this application improves the anti-interference ability of traditional DTMF detection in noisy environments and network packet loss scenarios and reduces the false detection rate by introducing a CNN-LSTM hybrid model for feature learning and temporal modeling, and combining a sliding window majority voting strategy for decision optimization. Attached Figure Description

[0020] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0021] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 This is a flowchart illustrating an embodiment of the cross-scenario real-time DTMF detection method of this application. Figure 2 A simplified flowchart illustrating the method for obtaining the classification result of the target audio signal provided in Embodiment 1 of this application; Figure 3 This is a flowchart illustrating Embodiment 2 of the cross-scenario real-time DTMF detection method of this application; Figure 4 This is a schematic diagram of the module structure of the cross-scene real-time DTMF detection device according to an embodiment of this application; Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the cross-scenario real-time DTMF detection method in the embodiments of this application. Detailed Implementation

[0023] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0024] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0025] The main solution of this application embodiment is as follows: receiving the original audio stream, preprocessing the original audio stream to obtain the target audio signal; inputting the target audio signal into a hybrid model of convolutional neural network and long short-term memory network to obtain the classification result of the target audio signal; constructing a sliding window based on the classification result, performing majority voting on the classification results within the sliding window to obtain the majority voting result; mapping the majority voting result to the corresponding target signaling format according to the scene identifier of the current operating environment to obtain the audio detection result.

[0026] Currently, DTMF detection technology mainly employs traditional methods such as the Goertzel algorithm and energy detection. These methods use manually designed fixed frequency extraction rules to match the dual-tone frequencies of audio signals to determine the key category. However, these traditional algorithms rely on preset frequency thresholds and fixed signal duration parameters. When faced with non-ideal audio environments such as network packet loss, background noise, and echo interference, they cannot effectively distinguish between real DTMF signals and noise components, leading to a significantly higher false detection rate. Especially in scenarios with low signal-to-noise ratios (SNR) ≤ 5dB or where packet loss exists, the false detection rate of traditional algorithms is generally ≥ 3%, failing to meet the technical requirements of real-time communication scenarios for accuracy and anti-interference capabilities in DTMF detection. Therefore, improving the anti-interference capability of traditional DTMF detection in noisy environments and network packet loss scenarios, and reducing the false detection rate, is a pressing issue that needs to be addressed.

[0027] This application improves the anti-interference ability of traditional DTMF detection in noisy environments and network packet loss scenarios and reduces the false detection rate by introducing a CNN-LSTM hybrid model for feature learning and temporal modeling, and combining it with a sliding window majority voting strategy for decision optimization.

[0028] It should be noted that the executing entity in this embodiment can be a cross-scenario real-time DTMF detection system, or a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or a cross-scenario real-time DTMF detection device capable of performing the above functions. This embodiment does not specifically limit the specific implementation. The following uses a cross-scenario real-time DTMF detection system as the executing entity to describe this embodiment and the following embodiments.

[0029] Based on this, embodiments of this application provide a cross-scenario real-time DTMF detection method, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the cross-scenario real-time DTMF detection method of this application.

[0030] In this embodiment, the cross-scene real-time DTMF detection method includes steps S10 to S40: Step S10: Receive the original audio stream, preprocess the original audio stream, and obtain the target audio signal; It should be noted that the raw audio stream refers to audio data originating from different communication protocols or terminal devices, with inconsistent sampling rates and encoding formats. Specifically, in this embodiment, it refers to the 48kHz sampled audio stream from the WebRTC browser and the 8kHz / 16kHz sampled audio stream from the SIP terminal. Preprocessing refers to a series of standardization operations performed to adapt the audio data to subsequent model detection.

[0031] Additionally, it should be noted that the target audio signal refers to a standardized audio data frame that has undergone preprocessing and meets the input requirements of the detection model.

[0032] Understandably, due to differences in sampling rates and environmental noise interference from audio streams from different sources, directly using the raw data for analysis can lead to decreased recognition accuracy or model incompatibility. Therefore, performing step S10 can avoid signal distortion and noise interference to key frequency components caused by incompatible device formats, thereby improving the robustness of subsequent audio feature extraction and the recognition accuracy of the detection model.

[0033] In a first feasible implementation, step S10 may include steps A11 to A14: Step A11: Receive raw audio streams containing different sampling rates; It should be noted that the original audio streams with different sampling rates include browser audio streams with a sampling rate of 48kHz and terminal audio streams with sampling rates of 8kHz or 16kHz. Browser audio streams refer to audio data generated by web applications originating from PCs (Personal Computers) or mobile devices; specifically, in this embodiment, they refer to audio data transmitted based on the WebRTC protocol. Terminal audio streams refer to audio data originating from traditional communication devices such as IP phones (Internet Protocol Phones), voice gateways, etc.; specifically, in this embodiment, they refer to audio data transmitted using the SIP protocol.

[0034] It is understandable that the original audio stream has a "heterogeneous" characteristic, which is mainly reflected in the differences in sampling rate and number of channels. This difference will cause subsequent processing modules to be incompatible. Therefore, step A11 can clarify the diversity of data sources, thereby providing targeted processing objects for subsequent standardization conversion and improving the system's compatibility.

[0035] Step A12: Resample the original audio stream and convert it into a 16kHz mono audio signal; It should be noted that resampling refers to converting audio streams with different sampling rates, such as 48kHz and 8kHz, into a uniform 16kHz sampling rate through interpolation or decimation algorithms to eliminate the sampling rate differences between multiple audio sources. Converting to a 16kHz mono audio signal means merging two-channel or multi-channel stereo audio signals into a single-channel signal.

[0036] Additionally, it should be noted that a 16kHz sampling rate was chosen because it covers the range of human hearing (20Hz-8kHz) and the core frequency range of DTMF signals (697Hz-1633Hz), while also balancing computational efficiency and signal integrity, avoiding waste of computational resources due to an excessively high sampling rate or signal distortion due to an excessively low sampling rate.

[0037] It is understandable that, due to the inconsistency in sampling rate and number of channels of raw audio streams from different sources, direct use can lead to model input errors or feature extraction deviations. Therefore, performing step A12 can avoid signal processing failures caused by inconsistent formats, thereby improving the compatibility and computational efficiency of subsequent processing modules.

[0038] Step A13: Lightweight spectral subtraction is used to denoise the converted audio signal, wherein the denoising process includes optimization of the core frequency range of dual-tone multi-frequency (DTMF). It should be noted that lightweight spectral subtraction is a frequency-domain-based noise reduction algorithm that recovers a clean speech signal by estimating the noise spectrum and subtracting the noise component from the noisy signal spectrum. Optimization of the core frequency range of dual-tone multi-frequency (DTMF) signals refers to setting a protection mechanism for the standard frequencies of DTMF signals during the noise reduction process. Spectral subtraction is performed only within this specific frequency range, and the original signal is directly preserved for ineffective frequency bands to avoid weakening of effective signal components due to excessive noise reduction.

[0039] Specifically, the processing steps of the lightweight spectral subtraction include: The sampled and adapted mono audio signal is framed according to the set frame length and overlap rate, and the frame signal is weighted using a Hanning window to reduce spectral leakage. Perform a fast Fourier transform on a single frame of audio signal to obtain the amplitude spectrum and phase spectrum of the signal; The signal during the initial silent segment of the system startup is captured, and the global noise power spectrum is statistically analyzed and calculated to complete a lightweight and fast noise estimation without the need for recursive iterative updates. Based on the core frequency range of the dual-tone multi-frequency signal, and combined with the sampling rate and the number of points of the fast Fourier transform, a bandpass frequency mask is generated, and only the frequency points within this range are retained to participate in the spectral subtraction operation. The spectral subtraction operation is performed only within the effective frequency band, keeping the original signal phase unchanged. The denoised amplitude spectrum is combined with the original phase spectrum, and an inverse fast Fourier transform is performed to convert it back to the time domain, outputting a denoised single-frame audio signal.

[0040] It is understandable that since communication channels are often mixed with environmental noise, and traditional noise reduction methods may inadvertently damage the key frequency components of DTMF signals, performing step A13 can prevent effective signals from being masked by noise or mistakenly deleted by noise reduction algorithms, thereby improving the signal-to-noise ratio of DTMF signals and the accuracy of subsequent identification.

[0041] Step A14: Divide the denoised audio signal into a frame sequence to obtain the target audio signal; It should be noted that a frame sequence refers to dividing a continuous audio signal into multiple short segments according to a time window, with each segment corresponding to a detection window. Specifically, in this embodiment, the frame length of the frame sequence is set to 20ms, and the frame overlap rate of the frame sequence is set to 50%. Additionally, it should be noted that a frame length of 20ms means that the duration of each segment is 20 milliseconds. The 20ms frame length is set to meet real-time requirements and shorten the processing cycle of a single frame. A frame overlap rate of 50% means that 50% of the data between two adjacent segments is repeated. The 50% overlap rate is set to preserve the temporal continuity of the signal through inter-frame overlap and avoid the signal truncation effect caused by framing.

[0042] It is understandable that since direct processing of continuous audio signals is difficult to capture short-term features and involves a large amount of computation, step A14 can avoid poor real-time performance due to excessively long frame lengths or feature loss due to lack of overlap, thereby improving the continuity of temporal feature extraction and the response speed of the detection model.

[0043] It should be understood that since a single processing module cannot simultaneously meet the requirements of standardized conversion, noise reduction optimization, and frame processing of multi-source heterogeneous audio, this implementation method can avoid signal distortion and processing delay caused by sampling rate differences, environmental noise interference, and improper frame processing strategies, thereby improving the compatibility, signal-to-noise ratio, and real-time processing efficiency of audio signals.

[0044] The above is only one feasible implementation of step S10 provided in this embodiment. This embodiment does not specifically limit the specific implementation of step S10.

[0045] Step S20: Input the target audio signal into a hybrid model of convolutional neural network and long short-term memory network to obtain the classification result of the target audio signal; It should be noted that Convolutional Neural Networks (CNNs) are feedforward neural networks that incorporate convolutional computations and have a deep structure. They are primarily used to extract local spatial features from audio signals. Specifically, in this embodiment, this refers to using convolutional kernels of different sizes to slide across the Mel spectrogram to capture local frequency textures and spatial combination features in the spectrogram. Long Short-Term Memory Networks (LSTMs) are a type of improved recurrent neural network primarily used to capture long-range temporal dependencies and dynamic changes in audio signals. Specifically, in this embodiment, this refers to receiving the feature sequence output by the CNN and using its internal gating mechanism to memorize and transmit the temporal context information of the audio signal.

[0046] Additionally, it should be noted that a hybrid model refers to a deep learning architecture that connects CNN and LSTM sequentially or in parallel. It mainly combines the spatial feature extraction capability of CNN with the temporal modeling capability of LSTM, and can simultaneously utilize the "static" spectral information and "dynamic" temporal evolution information of audio to achieve a more comprehensive understanding of audio content.

[0047] It is understandable that CNN alone is difficult to capture long-term dependencies in time series, while LSTM alone is computationally expensive and difficult to extract local details when processing high-dimensional raw spectra. Therefore, step S20 can avoid incomplete feature extraction due to the limitations of a single model, thereby improving the accuracy and robustness of audio classification.

[0048] In the first feasible implementation, please refer to Figure 2 Step S20 may include steps A21 to A24: Step A21: Convert the target audio signal into a Mel spectrogram, wherein the Mel spectrogram is generated based on a preset number of Mel filters and the frame length is a preset duration; It should be noted that the Mel spectrogram refers to a spectral representation based on the Mel scale. By non-linearly mapping linear frequencies to the Mel frequency scale, it can simulate the non-linear characteristics of human ear perception of different frequencies, i.e., sensitive to low-frequency changes and insensitive to high-frequency changes, thus better conforming to the perceptual laws of the human auditory system. A Mel filter is a set of triangular bandpass filters evenly distributed on the Mel scale, used to extract the energy characteristics of the spectrum in different frequency bands. In this embodiment, the preset number is 40. Choosing 40 filters is to achieve a balance between frequency resolution and computational complexity, ensuring sufficient frequency detail to distinguish different phonemes or sound events while avoiding feature redundancy and overfitting risks caused by too many filters.

[0049] Additionally, it should be noted that frame length refers to the length of the time window intercepted when performing a short-time Fourier transform on an audio signal. By performing frame segmentation, continuous non-stationary audio signals are converted into short-time stationary signals for frequency domain analysis. In this embodiment, the preset duration is 20ms. 20ms is chosen as the frame length because it is short enough to satisfy the assumption of short-time stationarity of speech signals, thereby accurately capturing the instantaneous spectral characteristics of sound, while avoiding insufficient frequency resolution due to excessively short frame length.

[0050] Step A22: The Mel spectrogram is processed by three convolutional and pooling layers to extract local frequency features from the spectrogram; It should be noted that a convolutional layer is a neural network layer that uses convolutional kernels to perform sliding scans and weighted summations on the input Mel-ray spectrogram. This is used to automatically capture local spatial features such as time-frequency textures, edges, and combination patterns in the spectrogram. A pooling layer is a layer that downsamples the feature map output by the convolutional layer, used to reduce the spatial dimensionality of the data while preserving the main feature information. Specifically, in this embodiment, the kernel sizes of the three convolutional and pooling layers are 3, 5, and 3, respectively. Additionally, it's important to note that the use of alternating or combined convolutional kernel sizes of 3, 5, and 3 is to construct a multi-scale receptive field. This structure is specifically designed for the frequency spacing and feature distribution of the high and low frequencies in DTMF signals. The larger kernel size of 5 covers a wider range, effectively capturing the overall macroscopic features of the two-tone combination; while the smaller kernel size of 3 focuses more on extracting fine local features of a single frequency point. This multi-scale approach allows the model to refine features layer by layer, accurately matching the high and low frequency combination patterns of DTMF signals, thereby extracting richer and more discriminative frequency features and improving the model's specificity and robustness.

[0051] Step A23: The local frequency features are modeled temporally using a two-layer bidirectional long short-term memory network to obtain the modeled temporal features; It should be noted that Bidirectional Long Short-Term Memory (BiLSTM) refers to a neural network structure consisting of two independent Long Short-Term Memory (LSTM) layers in parallel. One LSTM layer processes the input sequence in forward chronological order to capture historical information, while the other LSTM layer processes the input sequence in reverse chronological order to capture future contextual information.

[0052] Additionally, it should be noted that the hidden layer dimension refers to the feature length of the hidden state vector in a bidirectional long short-term memory network. This dimension determines the amount of information the network can store and transmit during temporal modeling. Specifically, in this embodiment, the hidden layer dimension is set to 64. Setting the hidden layer dimension to 64 means that the forward LSTM and backward LSTM each output 32-dimensional feature vectors, which are then concatenated to form a total 64-dimensional feature vector. This achieves an optimal balance between model expressive power and computational complexity. This dimension value ensures that the network has sufficient capacity to fully learn the complex long-distance temporal dependencies in audio signals, while effectively avoiding the problems of model overfitting and reduced training and inference efficiency caused by excessive parameters.

[0053] Step A24: Based on the modeled temporal features, the feature dimensions are mapped through a fully connected layer, and the target audio signal classification result is obtained by combining the activation function. It's important to note that a fully connected layer is a neural network layer that linearly maps and integrates the multi-dimensional feature vectors output from the previous layer. Its function is to convert the extracted deep abstract features into feature dimensions that match the number of categories in the target audio signal. Mapping the feature dimension in a fully connected layer means transforming the high-dimensional hidden state vector output from the bidirectional long short-term memory network into a one-dimensional feature vector with dimensions equal to the total number of preset categories in the target audio signal through a linear transformation of the weight matrix. This provides the foundation for subsequent probabilistic classification.

[0054] Additionally, it should be noted that the activation function is a mathematical function that introduces a non-linear transformation, used to map the numerical output of the fully connected layer to a probability distribution or classification confidence level with clear physical meaning. Specifically, this embodiment uses the Softmax function. The target audio signal classification result refers to the set of probability values ​​corresponding to each preset audio classification category after normalization by the Softmax function, and the category label corresponding to the maximum probability value selected from this set of probability values. In this embodiment, the classification result specifically includes 17 categories: 12 DTMF keys (0-9, ...). The audio signal is categorized into four classes: #, 4 silent / noise classes, and 1 unknown class. These class labels represent the final identification or classification result of the target audio signal.

[0055] It is understandable that, since this embodiment extracts frequency domain features by simulating human hearing characteristics through Mel spectrograms, captures local time-frequency textures and macroscopic frequency structures by combining multi-scale convolutional kernels (3, 5, 3), models temporal dependencies through bidirectional LSTM, and finally outputs 17-class classification results through fully connected layers and the Softmax function, this embodiment can avoid the problem of low classification accuracy caused by insufficient frequency resolution and incomplete temporal dependency modeling in traditional methods, thereby improving the accuracy and robustness of audio signal classification. At the same time, the single-frame inference time is ≤5ms, which meets the real-time requirements.

[0056] In a second feasible implementation, step A23 in step S20 can be further refined into steps B231~B232: Step B231: Input the local frequency features into the first layer bidirectional long short-term memory network, extract the forward and backward temporal features of the audio signal, and concatenate the features. It should be noted that the first layer of the bidirectional Long Short-Term Memory (LSTM) network is used for preliminary temporal modeling of the extracted local frequency features. Specifically, the forward LSTM processes the feature sequence in chronological order, capturing historical context information prior to the current moment; the backward LSTM processes the feature sequence in reverse chronological order, capturing future context information after the current moment. The feature vectors of the forward and backward outputs are concatenated along the feature dimension to form a preliminary temporal feature representation containing complete contextual information.

[0057] Step B232: Input the spliced ​​features into the second layer of the bidirectional long short-term memory network to further model the deep temporal dependencies and obtain the modeled temporal features; It should be noted that the second-layer bidirectional long short-term memory network is used to perform deep abstraction of the features after the initial modeling. By receiving the feature sequence containing contextual information from the output of the first layer, it further mines the complex dependencies spanning a longer time span in the feature sequence, thereby outputting more discriminative deep temporal features, providing high-quality feature input for subsequent classification tasks.

[0058] The above are only two feasible implementation methods of step S20 provided in this embodiment. This embodiment does not specifically limit the specific implementation method of step S20.

[0059] Step S30: Construct a sliding window based on the classification results, and perform a majority vote on the classification results within the sliding window to obtain the majority vote result; It should be noted that majority voting is a classic ensemble learning strategy that aims to reduce the variance of the model by combining the predictions of multiple weak classifiers or consecutive time steps, thereby improving the robustness of the overall prediction.

[0060] Additionally, it should be noted that the sliding window is a commonly used technique in time series data processing. It captures local time-series characteristics and dynamic change patterns of data by setting a fixed-length window that slides across the data stream.

[0061] Understandably, deep learning models (such as CNN-LSTM) are susceptible to transient noise, signal jitter, or background interference when processing single-frame audio signals, which can cause jumps or inconsistencies in classification results between consecutive frames (e.g., the previous frame identifies the number "1", and the next frame suddenly identifies the number "2"). Therefore, performing step S30 can avoid random jitter and occasional misjudgments in the single-frame prediction results, thereby improving the stability, continuity, and accuracy of the final DTMF key detection results.

[0062] In a first feasible implementation, step S30 may include steps A31 to A35: Step A31: Obtain the classification results of N consecutive frames; It should be noted that the classification results of consecutive N frames refer to the classification prediction values ​​of the audio signals at the current time and the previous N-1 time points output by the deep learning model in chronological order. Each frame represents the category with the highest recognition confidence in a time unit, where N is a positive integer used to define the length of the sliding window.

[0063] Additionally, it should be noted that the specific value of N can be flexibly adjusted according to the actual application scenario's requirements for real-time performance and accuracy. For example, in this embodiment, N is set to 3, meaning that the classification results of the current frame and the two frames preceding it, totaling 3 frames, are obtained. This value can ensure the system's rapid response while providing sufficient contextual information to cope with transient interference.

[0064] Step A32: If there is network packet loss in the current frame, interpolation is performed using the previous valid frames to obtain the classification result of the N frames after interpolation. It should be noted that network packet loss refers to the situation where a frame of audio data or its classification result fails to arrive or be generated normally during network transmission or processing. Using a preceding valid frame for interpolation means that when packet loss is detected in the current frame, the most recently successfully identified and valid classification result from the lost frame is used to fill the position of the current frame.

[0065] Additionally, it should be noted that this strategy of preserving previous values ​​through padding can maintain signal continuity and avoid detection interruptions due to missing data. For example, when N=3, if the second frame is lost and the first frame is a valid frame "5", then "5" is used to pad the second frame, thereby ensuring the integrity of data within subsequent windows.

[0066] Step A33: Store the padded N-frame classification results into a sliding window of length N; It should be noted that a sliding window is a logical storage unit used to cache classification results for N consecutive frames. Its length is consistent with the number of frames N acquired, and it is used to hold sample data to be voted on by majority vote.

[0067] Additionally, it should be noted that setting the length of the sliding window to N is to provide sufficient context information for logical judgment while ensuring the real-time performance of the system. The time span corresponding to this length is usually on the order of tens of milliseconds, which is consistent with the steady-state characteristics of DTMF signals.

[0068] Step A34: Count the number of categories in each classification result within the sliding window; It should be noted that the number of categories refers to the frequency statistics of the same DTMF key category appearing within the current sliding window.

[0069] Additionally, it should be noted that statistically analyzing the frequency of each category can provide data support for subsequent majority voting. For example, when N=3, if the three frames in the window are "5", "5", and "mute", then the number of categories "5" is 2, and the number of categories "mute" is 1.

[0070] Step A35: If more than half of the same category exist in the sliding window, then the category is determined to be the majority voting result, and the button is confirmed based on the majority voting result; It should be noted that "more than half" means that in a window of length N, a certain button category appears more than N / 2 times, which constitutes the threshold for triggering the "majority vote result".

[0071] Additionally, it should be noted that the "confirm button based on majority voting result" means that when the aforementioned threshold condition is met, the system outputs the DTMF button value corresponding to that category and locks that state until the condition changes after the window is slid. For example, when N=3, the number exceeding half is considered to be 2. If two "7"s appear in the window, the button is determined to be "7".

[0072] It is understandable that, since this embodiment ensures the continuity of data through interpolation and introduces a "more than half" hard decision threshold mechanism, this implementation can avoid data interruption caused by network packet loss and the model outputting incorrect key commands due to extreme outliers or instantaneous noise in a certain frame (that is, it plays the role of "de-jittering"), thereby improving the anti-interference ability of the entire DTMF detection system and the reliability of user interaction in complex noise environments and network fluctuations.

[0073] The above is only one feasible implementation of step S30 provided in this embodiment. This embodiment does not specifically limit the specific implementation of step S30.

[0074] Step S40: Based on the scene identifier of the current operating environment, map the majority voting result to the corresponding target signaling format to obtain the audio detection result; It should be noted that the scenario identifier is a data tag that represents the type of communication environment in which the current system is operating, indicating whether the current interaction is based on a web browser, a native application, a SIP softswitch, or another specific protocol stack. The target signaling format refers to the standard data encapsulation structure used to carry control commands in the corresponding scenario, such as DataChannel messages in WebRTC, SIP INFO message bodies, or custom JSON (JavaScript Object Notation) signaling packets.

[0075] Furthermore, it should be noted that by dynamically identifying scene identifiers and selecting corresponding mapping rules, the system can achieve a unified audio detection output interface in complex networks where multiple platforms and protocols coexist, improving the system's compatibility and scalability. For example, in a customer service system, the same audio detection module can be used for both online calls on a web browser and for connecting to a traditional telephone gateway's SIP trunk link, without needing to rewrite the core logic for different environments.

[0076] It is understandable that, since different communication ecosystems use heterogeneous signaling mechanisms, directly outputting the original classification results would cause the receiving end to be unable to parse or trigger erroneous behavior. Therefore, performing step S40 can avoid signaling loss or protocol abnormalities caused by format mismatch, thereby improving the availability, transmission efficiency and end-to-end interaction reliability of audio detection results in actual business systems.

[0077] In one feasible implementation, step S40 may include steps A41 to A45: Step A41: Obtain the scene identifier of the current operating environment; It should be noted that scene identifiers can be obtained through configuration files, distribution from the registry center, or automatic detection at runtime, ensuring that the system can dynamically adapt to environmental changes, such as automatically reloading the mapping strategy when switching from the web page to the App (Application).

[0078] Step A42: If the scenario is identified as a webpage-based real-time communication scenario, then the majority voting result is mapped to the data sending event callback format of the browser-side real-time communication object. It should be noted that web-based real-time communication scenarios refer to environments where WebRTC technology is used to establish peer-to-peer audio, video, and data channels between browsers. The data transmission event callback format refers to a data object conforming to the RTCDataChannel interface specification, typically a string or binary type.

[0079] Step A43: Use the data sending event callback to synchronize the result to the session initiation protocol gateway to obtain the audio detection result; It should be noted that synchronizing to the Session Initiation Protocol Gateway refers to converting DTMF data from the WebRTC side into control commands recognizable by the SIP side through the backend signaling bridging service, thereby achieving cross-domain signaling interoperability.

[0080] Step A44: If the scenario is identified as a session initiation protocol scenario, then the majority voting result is mapped to the session initiation protocol information request message format. It should be noted that the Message Request format of the Session Initiation Protocol refers to the SIP Extended Request message conforming to the RFC 2976 specification, and its message body carries DTMF signal information (e.g., Signal=5, Duration=100).

[0081] Step A45: Encapsulate the result into the information request message and send it back to obtain the audio detection result; It should be noted that encapsulation feedback refers to sending the constructed SIP INFO request to the peer or SIP proxy through the UDP (User Datagram Protocol) / TCP (Transmission Control Protocol) / TLS (Transport Layer Security) transport layer to complete the signaling reporting.

[0082] It is understandable that, since this implementation method dynamically selects the signaling mapping path based on the scenario identifier, it realizes a unified audio detection and output mechanism in a heterogeneous communication environment. Therefore, implementing this implementation method can avoid signaling blocking or parsing failure caused by protocol incompatibility, thereby improving the system's adaptability, stability, and operation and maintenance efficiency in multi-platform converged communication scenarios.

[0083] This application provides a cross-scene real-time DTMF detection method. First, the target audio signal is input into a hybrid model of a convolutional neural network and a long short-term memory network. Leveraging the powerful local feature extraction capabilities of CNNs and the temporal dependency modeling capabilities of LSTMs, background noise is accurately extracted from low-level features, and the spectral temporal patterns of the DTMF signal are captured. Based on this, a sliding window is constructed based on the classification results, and majority voting is performed. Statistical decision-making smooths out potential instantaneous misjudgments and jitter in single-frame predictions, significantly improving detection stability. Finally, the system can dynamically map the voting results to the corresponding target signaling format according to the scene identifier of the current operating environment.

[0084] In summary, this application improves the anti-interference ability of traditional DTMF detection in noisy environments and network packet loss scenarios and reduces the false detection rate by introducing a CNN-LSTM hybrid model for feature learning and temporal modeling, and combining a sliding window majority voting strategy for decision optimization.

[0085] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in the first embodiment described above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 3 Before step S20, the cross-scene real-time DTMF detection method further includes steps F21 to F24: Step F21: Construct a training dataset of real-world audio data, wherein the audio data covers noise types and signal strengths under different network environments, and is precisely labeled with classification tags and durations; It should be noted that the noise types in different network environments include not only basic white noise and pink noise, but also digital artifact noise introduced by network packet loss, jitter buffering, or encoding / decoding compression, as well as street noise, indoor human noise, and self-oscillation noise from equipment circuits in real physical scenarios. Different signal strengths cover a dynamic range from -40dBm to -10dBm to simulate different button distances and different gain acquisition devices. The classification labels include 17 standard categories: 12 DTMF buttons (0-9, ...). , #), 4 silent / noise classes and 1 unknown class.

[0086] Additionally, it should be noted that the precise duration annotation is accurate to the millisecond level, used to define the key press moment, stable duration, and release moment, so that the model can learn the temporal characteristics of the key signal.

[0087] It is understandable that, since DTMF signals in real-world applications are often accompanied by various background interferences and the signal-to-noise ratio is not fixed, performing step F21 can avoid the "overfitting" phenomenon caused by overly idealized data distribution during model training, thereby improving the model's generalization ability and robustness in the face of unknown noise environments.

[0088] Step F22: Perform data augmentation processing on the training dataset to simulate signal distortion in cross-scene transmission; It should be noted that the signal distortion in simulated cross-scene transmission includes frequency offset, time stretching, and random noise superposition. Frequency offset is used to simulate small shifts in the signal spectrum caused by hardware clock drift or sampling rate mismatch, and is usually randomly adjusted within ±1%. Time stretching is to speed up or slow down the audio signal (e.g., 0.9x to 1.1x) to simulate the difference in the speed of button presses. Random noise superposition is to mix random background noise with different signal-to-noise ratios (e.g., 5dB to 20dB) into the original audio signal.

[0089] Additionally, it should be noted that data augmentation refers to performing linear or nonlinear transformations on the original data in the time or frequency domain to generate "new" samples with minor differences but with the labels unchanged, thereby expanding the diversity of the dataset.

[0090] Understandably, since the audio signals collected in the actual deployment environment have great uncertainty, step F22 can avoid the "domain offset" problem between the training set and the test set. By artificially expanding the size of the dataset, the model's tolerance to small perturbations in the input signal can be improved.

[0091] Step F23: Based on the enhanced dataset, train the initial model so that the model learns the time-frequency feature mapping relationship of audio signals in different scenarios; It should be noted that the initial model refers to a CNN-LSTM hybrid network architecture without weight optimization, where the CNN part is used to extract the spectral features of the audio signal, and the LSTM part is used to capture the dynamic sequence features of the key signals over time.

[0092] Additionally, it should be noted that during training, the cross-entropy loss function is used as the optimization objective, and the Adam or SGD (SIP Gateway Device) optimizer is used for backpropagation. The network parameters are adjusted through multiple rounds of iteration until the model's accuracy on the validation set reaches a preset threshold or the loss function converges.

[0093] Understandably, since the enhanced dataset contains rich noise and time-frequency variation features, performing step F23 can prevent the model from getting stuck in local optima, thereby improving the model's deep learning and recognition capabilities for cross-scene DTMF signal features.

[0094] Step F24: Prune the trained model by removing redundant convolutional kernels to reduce model parameters and storage resource consumption, resulting in a lightweight hybrid model of convolutional neural network and long short-term memory network. It should be noted that model pruning is a pruning strategy based on weight magnitude, that is, setting a threshold and setting zero to zero and removing connections or convolutional kernels with weight absolute values ​​less than the threshold; or using structured pruning, directly removing the entire convolutional kernel channel with low contribution to the output.

[0095] Additionally, it should be noted that lightweighting refers to compressing the model size to ≤5MB after pruning, and significantly reducing the amount of inference computation, making it suitable for embedded devices or mobile devices with limited computing power and storage space.

[0096] It is understandable that, due to the limited storage space and computing power of embedded devices or mobile devices, performing step F24 can avoid the awkward situation that the original large model cannot be deployed on resource-constrained devices, thereby improving the real-time performance and deployment flexibility of the system and meeting the storage space limit requirement of ≤5MB.

[0097] This embodiment provides an optimized cross-scene real-time DTMF detection method. By constructing a high-quality dataset, data augmentation, model training, and pruning compression, it not only significantly improves the detection accuracy of the model in complex noisy environments, but also greatly reduces the model size, achieving a balance between high precision and lightweight design. It is suitable for edge computing scenarios with strict requirements for storage and computing power.

[0098] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the cross-scenario real-time DTMF detection method of this application. Any simple modifications based on this technical concept are within the protection scope of this application.

[0099] This application also provides a cross-scenario real-time DTMF detection device; please refer to [reference needed]. Figure 4 The cross-scenario real-time DTMF detection device includes: The receiving module 10 is used to receive the raw audio stream, preprocess the raw audio stream, and obtain the target audio signal; The classification module 20 is used to input the target audio signal into a hybrid model of convolutional neural network and long short-term memory network to obtain the classification result of the target audio signal; Voting module 30 is used to construct a sliding window based on the classification results, perform majority voting on the classification results within the sliding window, and obtain a majority voting result; The detection module 40 is used to map the majority voting result to the corresponding target signaling format according to the scene identifier of the current operating environment, so as to obtain the audio detection result.

[0100] The cross-scenario real-time DTMF detection device provided in this application, employing the cross-scenario real-time DTMF detection method described in the above embodiments, can solve the technical problem of how to improve the anti-interference capability and reduce the false detection rate of traditional DTMF detection in noisy environments and network packet loss scenarios. Compared with the prior art, the beneficial effects of the cross-scenario real-time DTMF detection device provided in this application are the same as those of the cross-scenario real-time DTMF detection method provided in the above embodiments, and other technical features in the cross-scenario real-time DTMF detection device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.

[0101] This application provides a cross-scenario real-time DTMF detection device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the cross-scenario real-time DTMF detection method in the above embodiment 1.

[0102] The following is for reference. Figure 5 This document illustrates a structural diagram of a cross-scenario real-time DTMF detection device suitable for implementing embodiments of this application. The cross-scenario real-time DTMF detection device in this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 5 The cross-scenario real-time DTMF detection device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0103] like Figure 5As shown, the cross-scene real-time DTMF detection device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the cross-scene real-time DTMF detection device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the cross-scene real-time DTMF detection device to wirelessly or wiredly communicate with other devices to exchange data. Although a cross-scene real-time DTMF detection device with various systems is shown in the figure, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems can be implemented alternatively.

[0104] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.

[0105] The cross-scenario real-time DTMF detection device provided in this application, employing the cross-scenario real-time DTMF detection method described in the above embodiments, can solve the technical problem of how to improve the anti-interference capability and reduce the false detection rate of traditional DTMF detection in noisy environments and network packet loss scenarios. Compared with the prior art, the beneficial effects of the cross-scenario real-time DTMF detection device provided in this application are the same as those of the cross-scenario real-time DTMF detection method provided in the above embodiments, and other technical features in this cross-scenario real-time DTMF detection device are the same as those disclosed in the previous embodiment method, and will not be repeated here.

[0106] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0107] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0108] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, which are used to execute the cross-scene real-time DTMF detection method in the above embodiments.

[0109] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0110] The aforementioned computer-readable storage medium may be included in a cross-scenario real-time DTMF detection device; or it may exist independently and not be assembled into a cross-scenario real-time DTMF detection device.

[0111] The aforementioned computer-readable storage medium carries one or more programs. When these programs are executed by the cross-scene real-time DTMF detection device, the cross-scene real-time DTMF detection device: receives a raw audio stream, preprocesses the raw audio stream to obtain a target audio signal; inputs the target audio signal into a hybrid model of a convolutional neural network and a long short-term memory network to obtain a classification result of the target audio signal; constructs a sliding window based on the classification result, performs a majority vote on the classification results within the sliding window to obtain a majority vote result; and maps the majority vote result to the corresponding target signaling format according to the scene identifier of the current operating environment to obtain an audio detection result.

[0112] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0113] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0114] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0115] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described cross-scenario real-time DTMF detection method. This addresses the technical problem of improving the anti-interference capability and reducing the false detection rate of traditional DTMF detection in noisy environments and network packet loss scenarios. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the cross-scenario real-time DTMF detection method provided in the above embodiments, and will not be elaborated upon here.

[0116] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the cross-scenario real-time DTMF detection method described above.

[0117] The computer program product provided in this application can solve the technical problem of how to improve the anti-interference capability of traditional DTMF detection in noisy environments and network packet loss scenarios, and reduce the false detection rate. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the cross-scenario real-time DTMF detection method provided in the above embodiments, and will not be repeated here.

[0118] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.

Claims

1. A cross-scene real-time DTMF detection method, characterized in that, The method includes: Receive the raw audio stream, preprocess the raw audio stream, and obtain the target audio signal; The target audio signal is input into a hybrid model of convolutional neural network and long short-term memory network to obtain the classification result of the target audio signal; A sliding window is constructed based on the classification results, and a majority vote is performed on the classification results within the sliding window to obtain the majority vote result. Based on the scenario identifier of the current operating environment, the majority voting result is mapped to the corresponding target signaling format to obtain the audio detection result; The steps for obtaining the classification result of the target audio signal include: The target audio signal is converted into a Mel spectrogram, wherein the Mel spectrogram is generated based on a preset number of Mel filters and the frame length is a preset duration; The Mel spectrogram is processed by three convolutional and pooling layers to extract local frequency features from the spectrogram. The local frequency features are time-series modeled using a two-layer bidirectional long short-term memory network to obtain the modeled time-series features. Based on the modeled temporal features, the target audio signal classification result is obtained by mapping the feature dimensions through a fully connected layer and combining it with an activation function.

2. The method as described in claim 1, characterized in that, The step of performing time-series modeling on the local frequency features using a two-layer bidirectional long short-term memory network to obtain the modeled time-series features includes: The local frequency features are input into the first layer of the bidirectional long short-term memory network to extract the forward and backward temporal features of the audio signal, and then the features are concatenated. The concatenated features are input into the second-layer bidirectional long short-term memory network to further model the deep temporal dependencies, thus obtaining the modeled temporal features.

3. The method as described in claim 1, characterized in that, Before the step of inputting the target audio signal into a hybrid model of a convolutional neural network and a long short-term memory network to obtain the classification result of the target audio signal, the method further includes: A training dataset of real-world audio data is constructed, wherein the audio data covers noise types and signal strengths under different network environments, and is accurately labeled with classification tags and durations; The training dataset is augmented to simulate signal distortion during cross-scenario transmission; Based on the enhanced dataset, the initial model is trained so that the model learns the time-frequency feature mapping relationship of audio signals in different scenarios; The trained model is pruned to remove redundant convolutional kernels to reduce model parameters and storage resource consumption, resulting in a lightweight hybrid model of convolutional neural network and long short-term memory network.

4. The method as described in claim 1, characterized in that, The step of constructing a sliding window based on the classification result and performing a majority vote on the classification results within the sliding window to obtain the majority vote result includes: Obtain classification results for N consecutive frames; If there is packet loss in the current frame, the previous valid frames are used for interpolation and padding to obtain the N-frame classification results after padding. The classification results of the padded N frames are stored in a sliding window of length N; Count the number of categories for each classification result within the sliding window; If more than half of the items in the sliding window belong to the same category, then the category is determined to be the majority vote result, and the confirmation button is pressed based on the majority vote result.

5. The method as described in claim 1, characterized in that, The step of mapping the majority voting result to the corresponding target signaling format based on the scene identifier of the current operating environment to obtain the audio detection result includes: Obtain the scene identifier of the current operating environment; If the scenario is identified as a web-based real-time communication scenario, then the majority voting result is mapped to the data sending event callback format of the browser-side real-time communication object; The data sending event callback is used to synchronize the results to the session initiation protocol gateway to obtain the audio detection results; If the scenario is identified as a session initiation protocol scenario, then the majority voting result is mapped to the information request message format of the session initiation protocol; The results are encapsulated into the information request message and fed back to obtain the audio detection results.

6. The method as described in claim 1, characterized in that, The steps of receiving the raw audio stream, preprocessing the raw audio stream, and obtaining the target audio signal include: Receive raw audio streams containing different sampling rates; The original audio stream is resampled and converted into a 16kHz mono audio signal; The converted audio signal is denoised using a lightweight spectral subtraction method, wherein the denoising process includes optimization of the core frequency range of the dual-tone multi-frequency (DTMF). The denoised audio signal is divided into a frame sequence to obtain the target audio signal.

7. A cross-scenario real-time DTMF detection device, characterized in that, The device includes: A receiving module is used to receive the raw audio stream, preprocess the raw audio stream, and obtain the target audio signal; The classification module is used to input the target audio signal into a hybrid model of convolutional neural network and long short-term memory network to obtain the classification result of the target audio signal; The voting module is used to construct a sliding window based on the classification results, perform a majority vote on the classification results within the sliding window, and obtain a majority vote result. The detection module is used to map the majority voting result to the corresponding target signaling format based on the scene identifier of the current operating environment, so as to obtain the audio detection result; The classification module is also used to convert the target audio signal into a Mel spectrogram, wherein the Mel spectrogram is generated based on a preset number of Mel filters and the frame length is a preset duration; The Mel spectrogram is processed by three convolutional and pooling layers to extract local frequency features from the spectrogram. The local frequency features are time-series modeled using a two-layer bidirectional long short-term memory network to obtain the modeled time-series features. Based on the modeled temporal features, the target audio signal classification result is obtained by mapping the feature dimensions through a fully connected layer and combining it with an activation function.

8. A cross-scenario real-time DTMF detection device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the cross-scene real-time DTMF detection method as described in any one of claims 1 to 6.

9. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the cross-scene real-time DTMF detection method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Network connection control method and intelligent terminal

    CN106535312A

  • Incoming call processing method, electronic equipment and storage medium

    CN116055632A