A method for monitoring and shielding sensitive words in audio and video calls of a set-top box
By performing real-time decoding and sensitive word detection on the prison set-top box terminal, and utilizing the Mel frequency cepstral coefficient feature vector and keyword matching model, sensitive words can be locally blocked. This solves the problem of sensitive content not being blocked in real time during prison audio and video calls, and improves communication security and regulatory reliability.
Patent Information
- Application Number
- CN202611167702.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-03
- Publication Date
- 2026-11-03
AI Technical Summary
Existing audio and video call terminals in prisons cannot achieve real-time blocking of sensitive content, nor can they prevent the instantaneous spread of illegal signals, posing risks of audio privacy leakage and network security. Furthermore, existing technology cannot meet the closed requirements of national regulatory standards.
Real-time decoding is performed on the set-top box terminal in the prison to extract the Mel frequency cepstral coefficient feature vector, use a keyword matching model to detect sensitive words, and generate directional audio and video blocking control commands to realize the configuration of blocking strategies and synchronous encapsulation processing of the local sensitive word library.
It enables local real-time blocking of sensitive content, avoids the risk of sensitive voice data being transmitted over the public network, enhances communication security and privacy protection, ensures the timeliness and reliability of regulatory instructions, and is suitable for unstable or closed network environments.
Smart Images

Figure CN123035337A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of real-time compliance management and control technology for audio and video, and in particular to a method for detecting and blocking sensitive words in audio and video calls using a prison set-top box. Background Technology
[0002] Currently, in special settings such as prisons and detention centers, the common approach to secure and compliant audio and video call management is a technical route based on centralized network control and server-side audio and video data stream parsing. Existing prison audio and video call terminals (such as set-top boxes) generally employ embedded hardware configurations with limited computing and storage resources to ensure low cost and low power consumption. In the areas of sensitive word detection and audio and video content supervision, the mainstream practices currently include: One approach involves passively transmitting the audio and video signals of the call to a dedicated server or cloud platform at the set-top box. The server utilizes high-performance computing and storage resources to decode the entire audio and video data, extract features, and identify sensitive words based on a large-scale deep learning model, enabling the identification and screening of illegal content. Some systems also trigger manual review processes or transcribe suspicious segments frame by frame, combining text comparison and contextual analysis to confirm sensitive content. The advantages of this traditional centralized processing method are its large model capacity, flexible system expansion, and ease of unified maintenance and policy distribution. However, its weaknesses are also prominent: the audio and video call content must be transmitted to the server in real time, easily leading to compliance and security risks such as audio privacy leaks, network transmission hijacking by hackers, and illegal export. Furthermore, network pressure is high, latency is uncontrollable, and the risks of disconnection and buffering increase dramatically with the increase in concurrent users. National regulatory standards are also becoming increasingly stringent, requiring that "audio and video data must not be transferred beyond the local device and is strictly prohibited from being transmitted outside in any form."
[0003] Another common practice is for the set-top box to only collect audio and video signals at the front end, encode and compress them, and connect directly to the other end via a dedicated protocol. Supervision is limited to external control of call signaling and simple call disconnection. Sensitive word detection and blocking still mainly rely on manual spot checks or backend log analysis, which is seriously lagging, has a high false positive rate, and slow blocking response. It cannot achieve real-time blocking of sensitive content, cannot prevent the instantaneous spread of illegal signals, and has limited compliance significance.
[0004] Some "front-end and back-end collaboration" systems attempt to embed simplified speech recognition modules within set-top boxes. This allows audio segments to be transcribed, then the text is encoded and sent to a server for processing. The server then returns the results of sensitive word detection, after which local blocking is performed. While this approach alleviates the network transmission pressure on the original audio stream, it still has significant technical drawbacks: First, the audio content or plaintext relies on the network for one-way or two-way transmission to the server, posing a risk of leakage of illegal information and failing to meet the regulatory requirement of "local closure and complete exclusion from the set-top box." Second, there is uncontrollable latency between transcription and server response, severely impacting usability and easily inducing phenomena such as disconnections, echoes, and audio-visual asynchrony, affecting the natural continuity of calls. Third, lightweight speech recognition engines and large models deployed on embedded terminals are prone to overload, leading to increased stuttering and misjudgments. Summary of the Invention
[0005] This application provides a method for detecting and blocking sensitive words in audio and video calls of a prison set-top box, aiming to solve the problems mentioned in the background art, such as the inability to block sensitive content in real time and the inability to prevent the instantaneous spread of illegal signals.
[0006] This application provides a method for detecting and blocking sensitive words in audio and video calls on a prison set-top box, specifically including: S1: Obtain the raw call audio stream data received by the prison set-top box terminal, and perform real-time decoding processing on the raw call audio stream data to generate a pulse code modulation audio sequence to be detected. S2: Based on the pulse code modulation audio sequence to be detected, extract the Mel frequency cepstral coefficient feature vector, and input the Mel frequency cepstral coefficient feature vector into the keyword matching model to generate a sensitive word recognition result set including a precise sensitive word position index; S3: Based on the precise sensitive word location index in the sensitive word recognition result set, retrieve the corresponding blocking strategy configuration data from the local sensitive word library stored in the set-top box to generate directional audio blocking control instructions; S4: Using the directional audio masking control command, the pulse code modulation audio sequence to be detected is extracted, calculated and corrected to generate a masked audio output stream; S5: Based on the accurate sensitive word location index in the sensitive word recognition result set, a video screen occlusion mark overlay instruction is generated synchronously, and the video screen occlusion mark overlay instruction is applied to the current call video frame rendering pipeline to generate the masked video output stream; S6: Perform audio and video synchronization encapsulation processing on the shielded audio output stream and the shielded video output stream to generate the final uninterrupted continuous call media stream and output it to the other end of the call.
[0007] The method for detecting and blocking sensitive words in audio and video calls using a prison set-top box provided in this application has the following beneficial effects: Local processing on the device side avoids the risk of sensitive voice data being transmitted over the public network, enhances communication security and privacy protection capabilities, and overcomes the slow response or missed detection defects caused by bandwidth limitations in high-concurrency scenarios, ensuring the timeliness and reliability of regulatory instructions.
[0008] By employing a keyword matching model combined with audio feature extraction technology, efficient and low-power recognition is achieved on resource-constrained terminals, accurately capturing semantic units without requiring complex large models. Upon detecting sensitive words, targeted mute replacement or volume attenuation is implemented on the local audio output link, and an occlusion marker is simultaneously overlaid on the video screen, without affecting call continuity, thus improving human-computer interaction experience and the flexibility of law enforcement.
[0009] The sensitive word database is centrally stored in a secure and encrypted area, supporting remote offline updates based on permission authentication to prevent unauthorized tampering. The system can run stably for a long time without continuous network access, making it suitable for closed environments with unstable network conditions or physical isolation requirements, and has good deployability and scalability. Attached Figure Description
[0010] Figure 1 This is the main flowchart of a method for detecting and blocking sensitive words in audio and video calls using a prison set-top box.
[0011] Figure 2 This is a sub-flowchart of a method for detecting and blocking sensitive words in audio and video calls using a prison set-top box.
[0012] Figure 3 This is another sub-flowchart of a method for detecting and blocking sensitive words in audio and video calls using a prison set-top box. Detailed Implementation
[0013] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0014] The following disclosure provides many different embodiments or examples for implementing different structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. Of course, these are merely examples and are not intended to limit the invention. Furthermore, reference numerals and / or letters may be repeated in different examples; such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.
[0015] like Figure 1 As shown, this application provides a method for detecting and blocking sensitive words in audio and video calls of a prison set-top box, specifically including: S1: Obtain the raw call audio stream data received by the prison set-top box terminal, and perform real-time decoding processing on the raw call audio stream data to generate a pulse code modulation audio sequence to be detected.
[0016] S2: Based on the pulse code modulation audio sequence to be detected, extract the Mel frequency cepstral coefficient feature vector, and input the Mel frequency cepstral coefficient feature vector into the keyword matching model to generate a sensitive word recognition result set including a precise sensitive word position index.
[0017] S3: Based on the precise sensitive word location index in the sensitive word recognition result set, retrieve the corresponding blocking strategy configuration data from the local sensitive word library stored in the set-top box to generate directional audio blocking control instructions.
[0018] S4: Using the directional audio masking control command, the pulse code modulation audio sequence to be detected is extracted, calculated and corrected to generate a masked audio output stream.
[0019] S5: Based on the accurate sensitive word location index in the sensitive word recognition result set, a video screen occlusion mark overlay instruction is generated synchronously, and the video screen occlusion mark overlay instruction is applied to the current call video frame rendering pipeline to generate the masked video output stream.
[0020] S6: Perform audio and video synchronization encapsulation processing on the shielded audio output stream and the shielded video output stream to generate the final uninterrupted continuous call media stream and output it to the other end of the call.
[0021] like Figure 2 As shown, step S1 involves acquiring the raw call audio stream data received by the prison set-top box terminal and performing real-time decoding processing on the raw call audio stream data to generate a pulse code modulation audio sequence to be detected. Specifically, this includes: S1.1: Perform protocol parsing processing on the raw call audio stream data encapsulated in compressed encoding format received by the network communication interface of the detention center set-top box, so as to strip off the transport layer protocol header and extract the compressed audio data packet sequence including payload information.
[0022] The prison set-top box network communication interface captures raw call audio stream data encapsulated in compressed encoding format in real time. This data includes the transport layer protocol header and payload information. The received raw data stream undergoes byte-level scanning and boundary identification, locating the start and end markers of the protocol header according to preset communication protocol specifications. The version, length, and checksum fields in the protocol header are parsed to verify the integrity and validity of the data packets, eliminating invalid data packets that fail verification or have abnormal formats. The transport layer protocol header is stripped from the verified data packets, extracting a sequence of compressed audio data packets containing only payload information. The extracted compressed audio data packet sequence is reordered, restoring the order of data packets that were disrupted due to out-of-order arrival from the network, ensuring the temporal continuity of the audio data. Through protocol parsing, the mixed raw network data stream is transformed into a clean and ordered sequence of compressed audio data packets, effectively decoupling the underlying communication protocol from the upper-layer audio processing logic, providing standardized input data for subsequent hardware decoding.
[0023] For example, the prison set-top box receives G.711 encoded audio streams based on the RTP protocol via an RJ45 interface. The system sets the buffer size to 4KB and generates one data packet every 20ms. The parsing module identifies the fixed 12-byte structure of the RTP header, checks if the version number is 2, and if the payload type is Pulse Code Modulation U (value 8). If the checksum matches, the 12-byte RTP header and possible CSRC list are stripped, and the 160-byte G.711 payload is extracted. For out-of-order frames N+1 and N, the Nth frame is placed before the N+1 frame and after the N+1 frame according to the sequence number field, forming a continuous payload queue. This process ensures that the data received by the decoder strictly follows a linear time order, eliminating the interference of protocol overhead on subsequent acoustic feature extraction.
[0024] S1.2: Based on the compressed audio data packet sequence, the dedicated decoding algorithm in the set-top box's built-in hardware decoder is called to perform real-time decompression operations, so as to convert the nonlinear compressed domain signal into a linear uncompressed digital audio sample point sequence.
[0025] Receive the compressed audio data packet sequence output from step S1.1, identify the encoding format type identified in the header of the data packet, and match it with the corresponding dedicated decoding algorithm library in the set-top box's built-in hardware decoder.
[0026] By invoking the hardware decoder's direct memory access channel, compressed audio data packets are mapped from system memory to the decoder's dedicated input buffer with zero copy, reducing CPU load and minimizing data transfer latency.
[0027] The entropy decoding operation is performed, and the variable-length compressed bitstream is restored to the quantized frequency domain coefficient matrix according to the preset Huffman coding table or arithmetic coding model, thus restoring the spectral structure information of the signal.
[0028] Inverse quantization is performed on the frequency domain coefficient matrix, and the discrete cosine transform coefficients are reconstructed by combining the quantization step size parameter, thereby eliminating the quantization noise error introduced during the compression process.
[0029] An improved inverse discrete cosine transform method is applied to convert the frequency domain coefficients back to the time domain signal, generating a preliminary sequence of reconstructed audio sampling points.
[0030] The overlapping addition method is used to process the boundaries of adjacent audio frames. A preset overlapping window function is used to smoothly splice the end of the frame and the beginning of the frame, eliminating the auditory interruption caused by the block effect.
[0031] The aforementioned hardware-accelerated decoding process efficiently converts nonlinear compressed domain signals into linear uncompressed digital audio sample point sequences, achieving low-latency, high-fidelity audio restoration and providing a high-quality raw data foundation for subsequent real-time sensitive word detection.
[0032] For example, for an audio stream encoded in G.729 format, a hardware decoder is configured to load a conjugate structure algebraic codebook-excited linear predictive coding algorithm module. The input buffer size is set to 80 bytes, corresponding to a 10ms audio frame. During entropy decoding, a preset 14-bit codebook index table is used to parse the bitstream into excitation signals and filter parameters. In the inverse quantization stage, 16-bit fixed-point precision is used to reconstruct the line spectrum coefficients. During the inverse discrete cosine transform operation, the SIMD (Single Instruction Multiple Data) instruction set is used to process 8 sampling points in parallel, generating pulse code modulation data with a 16kHz sampling rate and 16-bit depth. A weighted average is applied to the 5ms overlap region of each frame using an overlap-addition method, with weight coefficients following a Hanning window distribution. The final output is a continuous, uninterrupted pulse code modulation audio stream with a decoding delay controlled within 2ms and a signal-to-noise ratio better than 35dB, meeting the real-time requirements for prison communication.
[0033] S1.3: Perform clock synchronization calibration and jitter elimination processing on the uncompressed digital audio sampling point sequence to correct timing deviations caused by network transmission fluctuations and generate a synchronized digital audio sampling point sequence with a unified time reference.
[0034] For the uncompressed digital audio sampling point sequence generated by S1.2, a buffer queue based on a sliding time window is established to cache continuously arriving audio data frames and record the received timestamp and sequence number of each frame.
[0035] The arrival time difference between adjacent audio data packets is calculated to construct the original jitter sequence. The original jitter sequence is then smoothed using the exponentially weighted moving average method to extract the long-term jitter trend component that reflects the stability of network transmission.
[0036] The target latency threshold of the playback buffer is dynamically adjusted based on long-term jitter trend components. When a sudden network congestion is detected that causes jitter to exceed the preset safety boundary, the buffer depth is automatically expanded to absorb timing fluctuations.
[0037] Linear interpolation is used to reconstruct the missing sampling points caused by network packet loss or delay. The estimated value of the missing points is calculated based on the amplitude slope of the adjacent valid sampling points to fill the time gaps and maintain signal continuity.
[0038] A resampling clock synchronization operation is performed on the interpolated audio sequence. By comparing the deviation between the local system clock and the timestamp embedded in the audio stream, the sampling rate conversion coefficient is dynamically fine-tuned to eliminate accumulated phase errors. The formula is as follows: in, This is the corrected output timestamp. This is the original input timestamp. The maximum permissible jitter threshold, This represents the current measured jitter value.
[0039] The corrected sampling point sequence is rearranged according to a unified global time base, and redundant data packets caused by repeated reception are removed to generate a synchronous digital audio sampling point sequence with strict timing consistency.
[0040] Through the aforementioned clock synchronization calibration and jitter elimination processing, the discrete sampling data affected by network fluctuations in the previous step is transformed into a synchronized digital audio sampling point sequence with a unified time reference, thereby achieving the expected technical effect of eliminating timing deviations and ensuring the accuracy of subsequent feature extraction.
[0041] S1.4: The synchronous digital audio sampling point sequence is subjected to bit depth normalization mapping processing using pulse code modulation quantization rules to uniformly convert sampling data with different bit rates into a pulse code modulation audio sequence to be detected with fixed precision.
[0042] It receives a sequence of synchronized digital audio samples after clock synchronization calibration, which serves as the input data source for bit-depth normalization mapping processing.
[0043] Traverse each discrete sampling point in the synchronous digital audio sampling point sequence, read its original bit depth identifier and current amplitude value, and determine the target quantization accuracy level.
[0044] Based on the pulse code modulation quantization rules, a linear quantization mapping function is constructed to map the dynamic range of the original sampling points to the target fixed-precision quantization interval.
[0045] The following formula is used to perform the bit depth conversion calculation: in, To input the amplitude value of the sampling point, For the source data bit depth, For the target bit depth, The round function represents rounding the quantized output value to the nearest integer.
[0046] Overflow truncation is performed on the calculated quantized output value to ensure that its value strictly falls within the range of signed integers allowed by the target bit depth, preventing waveform distortion caused by data exceeding the limit.
[0047] The truncated quantized values are repackaged into data frames in the standard pulse code modulation format, keeping the sampling rate and number of channels unchanged, to generate a pulse code modulation audio sequence to be detected with uniform bit depth.
[0048] Through the above-mentioned linear quantization mapping and overflow protection mechanism, the variable-length or non-standard bit-depth sampling data that may exist in the previous step is transformed into a fixed-precision pulse code modulation audio sequence to be detected, so as to achieve a high degree of consistency in the input data format of the subsequent feature extraction module and eliminate model inference errors caused by bit-depth differences.
[0049] like Figure 3 As shown, step S2 involves: extracting the Mel-frequency cepstral coefficient feature vector based on the pulse-code modulation audio sequence to be detected, and inputting the Mel-frequency cepstral coefficient feature vector into the keyword matching model to generate a sensitive word recognition result set including a precise sensitive word position index. Specifically, this includes: S2.1: Perform frame-by-frame windowing processing on the pulse code modulation audio sequence to be detected. Use the Hamming window function to truncate and smooth the continuous audio sampling points to generate a discrete audio frame sequence with short-time stationary characteristics, eliminate signal edge effects, and provide standardized input units for subsequent frequency domain transformation.
[0050] The system receives the pulse-code modulated audio sequence to be detected, generated by step S1. This sequence is a linear digital sampling point data stream with a unified time base. To address the non-stationary nature of the speech signal, a sliding window mechanism is used to segment and truncate continuous audio sampling points. The frame length is set to 25 milliseconds to cover one pitch period, and the frame shift is set to 10 milliseconds to ensure information overlap and smooth transition between adjacent frames, transforming the long-term non-stationary signal into a series of short-term quasi-stationary signal segments. A Hamming window function is applied to each segment of the extracted discrete audio data for weighting. Cosine weighting coefficients suppress signal abrupt changes at frame edges, eliminating spectral leakage caused by direct truncation and ensuring the energy concentration and accuracy of subsequent frequency domain transformation. The original audio frame data is multiplied point-by-point by the Hamming window coefficients to generate a windowed discrete audio frame sequence. This sequence preserves the local spectral characteristics of the speech signal and eliminates boundary effects. By using frame-segmentation and windowing, the continuous time-domain audio stream is transformed into a set of discrete frames with short-term stationary characteristics, providing a standardized input unit for subsequent fast Fourier transform and Mel frequency cepstral coefficient extraction, significantly improving the robustness of feature extraction in noisy prison environments.
[0051] S2.2: Perform a fast Fourier transform operation on the discrete audio frame sequence to convert the discrete audio frame sequence into a frequency domain power spectral density distribution. Based on the characteristics of human auditory perception, construct a Mel filter bank to perform nonlinear mapping integration on the frequency domain power spectral density distribution to generate a Mel spectrogram matrix that reflects the distribution law of speech energy on the Mel scale.
[0052] The system receives a sequence of discrete audio frames after frame segmentation and windowing, generated in step S2.1. This sequence exhibits short-time stationarity and eliminates signal edge effects. A Fast Fourier Transform (FFT) operation is performed on each frame of discrete audio data, mapping the time-domain sampling points to the frequency domain to generate a complex-form spectral coefficient matrix. The squared modulus of each frequency bin is calculated to obtain the frequency-domain power spectral density distribution, reflecting the signal energy distribution, providing a physical basis for subsequent auditory feature extraction.
[0053] Based on the nonlinear frequency response characteristics of the human auditory system, a Mel filter bank comprising multiple triangular bandpass filters is constructed. The filter center frequencies are set to be uniformly distributed on the Mel scale, with narrower bandwidths in the low-frequency region to preserve fine structure and wider bandwidths in the high-frequency region to simulate the degradation of human auditory resolution. The frequency domain power spectral density distribution is then weighted and integrated through the Mel filter bank to achieve a nonlinear mapping from the linear frequency axis to the Mel frequency axis.
[0054] The Mel frequency is calculated using the following formula. With linear frequency The conversion relationship between them: Based on this mapping relationship, the cutoff frequency and gain coefficient of each Mel filter are determined to ensure that the filter bank covers the main frequency range of the speech signal.
[0055] The weighted integral output energy values of each filter are arranged in frequency order to generate a Mel spectrogram matrix. The row indices of this matrix correspond to the Mel filter channel numbers, the column indices correspond to the time frame numbers, and the element values represent the speech energy intensity in a specific Mel frequency band within a specific time period. Through this processing method, the discrete-time audio frames from the previous step are transformed into a Mel spectrogram matrix that conforms to human auditory perception characteristics. This achieves the transformation from physical acoustic signals to psychoacoustic features, significantly improving the robustness and recognition accuracy of the subsequent lightweight model for sensitive word speech features.
[0056] For example, the audio sampling rate is set to 16kHz, and the FFT points N=512. Forty Mel filters are constructed, with a frequency range of 0-8000Hz. A 512-point FFT is performed on the t-th frame of audio data, yielding the power spectrum of 257 effective frequency points. The Mel scale corresponding to 0-8000Hz is calculated using the above formula, and the range is evenly divided into 40 intervals. The power spectrum is weighted and summed through 40 triangular filters to obtain a 40-dimensional energy vector. This process is repeated for all audio frames, ultimately generating a Mel spectrogram matrix of dimension [40,T], where T is the total number of frames. This matrix effectively compresses the data dimensionality and highlights the speech formant structure, providing a high signal-to-noise ratio feature input for subsequent Mel frequency cepstral coefficient extraction and sensitive word detection.
[0057] S2.3: Perform logarithmic compression on the Mel spectrogram matrix to simulate the logarithmic loudness characteristics of the human ear, generate a logarithmic Mel spectrogram matrix, and then apply the discrete cosine transform method to transform the logarithmic Mel spectrogram matrix from the frequency domain to the cepstral domain, extract low-order cepstral coefficients and remove DC components to generate a Mel frequency cepstral coefficient eigenvector that can characterize the essence of speech timbre and is robust to channel noise.
[0058] The Mel spectrogram matrix generated in the previous step is received. This matrix represents the distribution of speech energy on the Mel scale, but retains linear amplitude characteristics. It needs to be further converted into cepstral domain features that conform to the characteristics of human auditory perception.
[0059] A natural logarithmic operation is performed on the energy value of each frequency component in the Mel spectrogram matrix to simulate the nonlinear logarithmic response of the human ear to sound intensity. By compressing the dynamic range, the absolute dominance of high-energy bands is suppressed, while the subtle speech details contained in low-energy bands are enhanced, generating a logarithmic Mel spectrogram matrix.
[0060] The log-Mel spectrum matrix is treated as a two-dimensional signal, and the discrete cosine transform (DCT) method is applied along the frequency axis. Utilizing the energy concentration characteristic of the DCT, the frequency-domain correlated log-Mel coefficients are transformed to the cepstral domain, achieving decorrelation and generating the initial Mel frequency cepstral coefficient matrix.
[0061] The first 12 to 13 low-order coefficients are extracted from the initial Mel-frequency cepstral coefficient matrix. These low-order coefficients mainly carry the vocal tract envelope information of speech, i.e., the essential timbre features, while the high-order coefficients mostly correspond to the details of the excitation source and channel noise. Discarding the high-order coefficients can effectively improve the robustness of the features to background noise in the prison environment.
[0062] Calculate and remove the 0th-order cepstral coefficients, i.e., the DC component. This component mainly reflects the total energy level of the signal, has a low contribution to the identification of specific sensitive words, and is easily affected by fluctuations in call volume. Removing it can eliminate the interference of gain changes on the feature vector distribution.
[0063] The remaining low-order cepstral coefficients are arranged in order, and their first-order and second-order difference coefficients are combined to construct a multidimensional feature vector. The first-order difference represents the dynamic rate of change of the spectrum over time, and the second-order difference represents the acceleration of the rate of change. Together, they capture the temporal dynamic features of speech.
[0064] Through the above-mentioned logarithmic compression, discrete cosine transform, low-order truncation, and DC removal, the Mel spectrogram matrix from the previous step is transformed into a Mel frequency cepstral coefficient feature vector that can characterize the essence of speech timbre and is robust to channel noise, thereby achieving highly discriminative acoustic feature extraction.
[0065] For example, the number of Mel filter banks is set to 40, and the frame length is 25ms. The natural logarithm is performed on the 40-dimensional Mel energy spectrum of a certain frame of audio to obtain the logarithmic energy spectrum. A discrete cosine transform is then performed on this vector to obtain 40-dimensional cepstral coefficients. The coefficients from dimensions 1 to 12 are extracted as static features, and the differences between adjacent frames are calculated to obtain 12-dimensional first-order difference features and 12-dimensional second-order difference features. Finally, these are concatenated to generate a 36-dimensional Mel frequency cepstral coefficient feature vector. Testing shows that, under a prison background noise level of 15dB signal-to-noise ratio, this feature vector significantly reduces the false alarm rate of the sensitive word recognition model compared to the original spectral features, and the feature extraction time is controlled within 2ms, meeting real-time requirements.
[0066] S2.4: Input the Mel frequency cepstral coefficient feature vector into the forward propagation computation link of the preset keyword matching model, use the multi-layer convolutional neural network inside the model to extract local temporal dependency features and perform global semantic aggregation through a fully connected layer to output the sensitive word category probability distribution vector and temporal boundary regression parameters corresponding to the current audio frame.
[0067] The keyword matching model includes multi-layer one-dimensional convolution, batch normalization, max pooling, fully connected layers, and temporal boundary regression branches. The model calculates the probability distribution of sensitive word categories and the start and end time offsets. The Softmax (a normalization exponential function) normalization probability ranges from 0 to 1. When the final confidence score is higher than 0.8, a blocking instruction is automatically triggered.
[0068] The Mel frequency cepstral coefficient feature vector generated in the previous step is received and reshaped into a three-dimensional tensor structure adapted to the input dimension of the convolutional neural network, including time step, frequency channels and feature dimensions, in order to preserve the temporal topology of the speech signal.
[0069] The three-dimensional tensor is input into the convolutional layer of the keyword matching model. Multiple sets of one-dimensional convolutional kernels slide along the time axis to perform local feature extraction operations, capturing the short-term spectral texture changes unique to the pronunciation of sensitive words, and generating a high-order local temporal dependent feature map.
[0070] Batch normalization and linear rectification activation are performed on the local time-dependent feature map to suppress internal covariate shift and introduce nonlinear expressive power. Then, downsampling compression is performed through a max pooling layer to reduce computational load while retaining key acoustic response peaks.
[0071] The pooled feature sequence is flattened and input into a fully connected layer network. The global weight matrix is used to perform semantic aggregation and spatial mapping on the scattered local features, and the probability distribution of the current audio segment belonging to each category in the pre-set sensitive word library is calculated.
[0072] Parallel access regression branch network, based on the shared feature representation layer, outputs the offset of the start and end times of sensitive words relative to the center of the current frame and the duration scaling factor, forming the time boundary regression parameters.
[0073] Through the aforementioned forward propagation calculation, the time-frequency domain acoustic features are transformed into structured detection results, including the probability distribution vector of sensitive word categories and time boundary regression parameters. This enables the accurate localization and confidence quantification of illegal content in prison call audio, providing a data foundation for subsequent non-maximum suppression screening.
[0074] For example, the input Mel-frequency cepstral coefficient feature vector is set to 39 dimensions, the frame length is 25ms, and the stride is 10ms. The model includes three 1D convolutional layers with kernel sizes of 3, 5, and 7, and channel numbers of 64, 128, and 256, respectively. The fully connected layer outputs the probabilities of 10 sensitive word categories. When the word "jailbreak" is detected, the model outputs the corresponding category logits value [2.5, -1.0, ..., 3.2]. After Softmax calculation, the probability of the "jailbreak" category is approximately 0.85, the time regression parameter prediction starts with an offset of -5ms, and the duration is 200ms. This result is directly used for non-maximum suppression filtering in step S2.5, significantly improving the detection accuracy and boundary fit.
[0075] S2.5: Perform non-maximum suppression filtering based on the probability distribution vector of the sensitive word category, remove overlapping and redundant detection boxes and retain the candidate with the highest confidence, and combine the time boundary regression parameters to correct the start and end times of the sensitive words, and finally generate a sensitive word recognition result set including accurate sensitive word position index and normalized confidence score.
[0076] Receive the sensitive word category probability distribution vector and time boundary regression parameters output by the keyword matching model. This data includes the confidence scores, category labels, and start and end time offsets relative to the current audio frame for multiple candidate detection boxes.
[0077] The probability distribution vector of the sensitive word category is sorted in descending order. A priority queue of candidate detection boxes is constructed based on the confidence score from high to low to ensure that high-confidence detection results are retained first, providing an ordered input basis for subsequent non-maximum suppression screening.
[0078] Iterate through each candidate detection box in the priority queue and calculate its intersection-over-union ratio with all other candidate detection boxes in the queue on the time axis to quantify the degree of overlap between different detection boxes in the temporal dimension.
[0079] A preset overlap threshold is set. If the intersection-union ratio of two candidate detection boxes is greater than the threshold and they belong to the same sensitive word category, they are judged as redundant detections. The detection boxes with higher confidence are retained, and the detection boxes with lower confidence are removed, thereby eliminating the problem of repeated recognition caused by sliding window overlap.
[0080] For the retained non-redundant candidate detection boxes, their corresponding time boundary regression parameters are extracted, including the center time offset and the width scaling factor. The time start and end points of the original prediction are corrected using a linear transformation formula.
[0081] The corrected start and end times are mapped back to the original audio sampling point index to generate an accurate sensitive word location index. The corresponding confidence scores are then normalized to form the final sensitive word recognition result set.
[0082] Through the above non-maximum suppression screening and time boundary regression correction processing, the coarse probability distribution generated in the previous step is transformed into sensitive word location data with precise time boundaries. This achieves effective deduplication of overlapping detection boxes and fine-tuning of boundaries, significantly improving the accuracy of sensitive word detection and the timeliness of subsequent blocking operations.
[0083] Step S3: Based on the precise sensitive word location index in the sensitive word recognition result set, retrieve the corresponding blocking strategy configuration data from the local sensitive word library stored in the set-top box to generate directional audio blocking control commands. Specifically, this includes: S3.1: Based on the accurate sensitive word location index in the sensitive word recognition result set, perform an address mapping query operation on the local sensitive word library stored in the set-top box's secure encrypted area to obtain the blocking policy configuration data.
[0084] The system receives a sensitive word identification result set, including a precise sensitive word location index and a confidence score. This data originates from the inference output of the preceding keyword matching model. The system parses the sensitive word identification result set, extracts the sensitive word category identifier and the corresponding start and end timestamp boundary information, and constructs a primary key index vector for database queries.
[0085] The system invokes the local sensitive word database management interface within the set-top box's secure encrypted area, performing a hash mapping lookup operation based on the primary key index vector. The local sensitive word database is stored using a B+ tree data structure, with sensitive word category identifiers as keys and blocking policy configuration objects as leaf node data, ensuring high-precision retrieval within milliseconds.
[0086] After locating the target leaf node, the associated masking strategy configuration data block is read. This data block includes preset masking action type enumeration values, basic volume attenuation coefficient thresholds, video occlusion style identifiers, and effective priority levels. The read configuration data undergoes integrity verification, confirming the consistency of the data signature and version number to prevent data corruption due to storage medium bit flipping.
[0087] If the verification passes, the blocking policy configuration data is loaded into a temporary register buffer; if the verification fails or the index is not found, the default fallback policy is triggered, loading the system's preset standard silence blocking parameters. Through the above address mapping query and integrity verification mechanism, the abstract sensitive word location index is transformed into specific executable blocking policy configuration data, achieving a precise mapping from detection logic to control policy, ensuring the legitimacy and security of subsequent blocking command generation.
[0088] For example, the sensitive word recognition result set outputs a violation word category ID of 0x0A5B, with a time range of 1.2s to 1.4s. The set-top box security module searches in the B+ tree based on ID 0x0A5B, locating the leaf node in 0.8ms. The read blocking policy configuration data shows: the action type is volume attenuation, the attenuation coefficient threshold is 0.2, and the video occlusion style is a red semi-transparent mask. After SHA-256 hash comparison, the data signature is valid. The system loads the attenuation coefficient 0.2 and the style identifier into the buffer as the baseline input for calculating the specific blocking strength in step S3.2, ensuring the real-time performance and data reliability of the policy invocation.
[0089] S3.2: Based on the shielding strategy configuration data, perform a matching degree calculation to determine the specific shielding action type and intensity level parameters applicable to this call.
[0090] The system receives the blocking strategy configuration data obtained in step S3.1. This data includes sensitive word category identifiers, preset blocking mode enumeration values, and basic strength level parameters. The sensitivity threshold field in the blocking strategy configuration data is parsed and compared with the normalized confidence score output in step S2 to assess the reliability level of the current detection result. When the confidence score is higher than the high sensitivity threshold, it is determined to be high-risk illegal content, and the blocking action type is forcibly locked as complete mute replacement, with the strength level parameter set to the maximum attenuation coefficient. When the confidence score is between the medium and high sensitivity thresholds, it is determined to be medium-risk suspected illegal content, and the blocking action type is selected as volume attenuation. The dynamic strength level parameter is calculated based on a linear mapping of the confidence score. A weighted matching method is used, combined with the call scenario context label, to correct the basic strength level parameter. If the current scenario is marked as a strictly controlled period, the attenuation coefficient is increased; if it is marked as a normal visitation period, the standard attenuation coefficient is maintained. Through the above multi-dimensional matching degree calculation and logical judgment, the abstract strategy configuration is transformed into specific blocking action type identifiers and quantified intensity level values, so as to achieve differentiated and precise control of sensitive words with different risk levels, ensuring the complete blocking of high-risk information and reducing the interference of low-risk false detections on the call experience.
[0091] For example, a high-sensitivity threshold is set to 0.95, and a medium-sensitivity threshold is set to 0.80. If a sensitive word has a confidence score of 0.98, which is higher than 0.95, the system determines it as high-risk and directly determines the blocking action as a mute replacement, with an intensity level of 1.0 (full mute). If another sensitive word has a confidence score of 0.85, which is between 0.80 and 0.95, and the current period is a normal visitation time, the system determines it as medium-risk and selects the volume attenuation mode. The intensity level is calculated based on the linear mapping formula, and the basic attenuation coefficient is set to 0.3. After scene weighting correction, the final amplitude correction coefficient is determined to be 0.3, i.e., retaining 30% of the volume. This processing mechanism significantly improves the flexibility and compliance of the blocking strategy, effectively balancing the needs of security supervision and humanized communication.
[0092] S3.3: Based on the specific shielding action type and intensity level parameters, and combined with the time segment boundary information corresponding to the precise sensitive word position index, construct a directional audio shielding control command including a start timestamp, an end timestamp, and an amplitude correction coefficient.
[0093] The system receives the specific blocking action type and intensity level parameters determined in the preceding steps, and combines them with the precise sensitive word location index included in the sensitive word recognition result set to extract the start and end time boundary information of the sensitive word in the audio stream.
[0094] Based on the internal clock synchronization mechanism of the prison set-top box, the extracted start and end times are converted into absolute timestamps relative to the zero point of the current call session, which are defined as the start timestamp and end timestamp respectively, to ensure the uniformity and global consistency of the time base.
[0095] Based on the logic for determining the type of shielding action, if the action type is mute replacement, the amplitude correction coefficient is set to 0; if the action type is volume attenuation, the preset attenuation ratio corresponding to the intensity level parameter is read and mapped to a floating-point value in the range of 0 to 1 as the amplitude correction coefficient, where the smaller the amplitude correction coefficient value, the higher the attenuation degree.
[0096] Construct a data structure for directional audio masking control commands. This structure includes an opcode field for identifying the command type, a time window field for defining the processing range, and a gain control field for performing amplitude adjustments.
[0097] The calculated start timestamp is filled into the start position of the time window field, and the end timestamp is filled into the end position of the time window field to form an accurate time slice index, ensuring that the subsequent audio processing unit can accurately locate the sensitive word audio segment to be processed.
[0098] The determined amplitude correction coefficient is written into the gain control field and used as a scaling factor when the digital signal processor performs multiplication operations, thereby realizing real-time linear or nonlinear control of the audio energy of sensitive words.
[0099] Through the above parameter assembly and structured encapsulation processing, the strategy logic parameters generated in the previous step are transformed into standardized directional audio masking control instructions, including start timestamp, end timestamp, and amplitude correction coefficient. This achieves a precise mapping from high-level semantic strategy to low-level signal control parameters, providing a control basis with clear timing boundaries and amplitude constraints for the real-time execution of subsequent audio rendering pipelines.
[0100] For example, the detention center set-top box detects the sensitive word "contraband" for a duration of 150ms. The blocking strategy is configured as "volume attenuation" with a "high" intensity level and a corresponding amplitude correction coefficient of 0.05. The sensitive word in the audio stream starts at 5.200 seconds after the session begins and ends at 5.350 seconds. A directional audio blocking control command is constructed, with a start timestamp of 5.200, an end timestamp of 5.350, and an amplitude correction coefficient of 0.05. After this command is issued, the audio processing unit will multiply the amplitude of all audio sampling points by 0.05 within a time window of 5.200 to 5.350 seconds, achieving significant energy suppression while maintaining continuous transmission of the audio stream, effectively blocking the leakage of sensitive information without causing call interruption.
[0101] S3.4: Perform integrity verification and format encapsulation processing on the directional audio masking control command to generate a standardized masking execution command stream that conforms to the set-top box audio rendering pipeline interface specification.
[0102] S3.5: The standardized masking execution command stream is sent to the audio signal processing unit to trigger the subsequent real-time amplitude correction operation of a specific time segment in the pulse code modulation audio sequence to be detected.
[0103] The set-top box audio signal processing unit receives a standardized, masked command stream after integrity verification and format encapsulation. This data stream includes binary payload information such as operation type identifier, data packet length, sequence number, sampling point count, and standardized gain control word. The set-top box audio signal processing unit listens to the dedicated instruction buffer through the direct memory access controller and triggers a hardware interrupt response mechanism upon detecting a newly written command stream.
[0104] The digital signal processor reads the operation type identifier in the command header, parses out the current masking mode as either mute replacement or volume attenuation, and extracts the sequence number to confirm the timing legality of the instruction execution, preventing instruction overwriting or out-of-order execution due to multi-threaded concurrency.
[0105] Based on the number of sampling points in the command stream, the digital signal processor allocates a corresponding size of circular buffer pointer in the internal cache, locks the start and end addresses of the audio data frame to be processed in physical memory, and establishes a precise mapping relationship from logical timestamps to physical storage units.
[0106] If the operation type is volume attenuation, the digital signal processor loads the normalized gain control word into the multiplier-accumulator register; if it is mute replacement, a zero-value mask is loaded. The processor initiates a parallel pipeline to perform fixed-point multiplication or logical AND operations on each discrete audio sample point within the locked address range.
[0107] Employing single-instruction multiple-data-stream technology, multiple consecutive sampling points are packaged and processed. A hardware acceleration module completes batch amplitude correction within a single clock cycle, generating intermediate audio data blocks with amplitude adjustment, ensuring that the processing latency is lower than the audio frame playback interval.
[0108] Through the aforementioned hardware-level instruction parsing and parallel signal processing mechanism, the standardized masking execution command stream generated by the software layer is transformed into real-time amplitude correction actions of the underlying audio data, achieving microsecond-level response for targeted masking of sensitive words. This effectively eliminates illegal voice content during the call while ensuring low latency and high continuity of the audio stream.
[0109] For example, the set-top box audio sampling rate is set to 16kHz. The standardized masking execution command stream includes operation type 0x01 (volume attenuation), 3200 sampling points, and a standardized gain control word 410 (Q3.12 format). After receiving the instruction, the digital signal processor (DSP) parses out the need to attenuate the subsequent 3200 sampling points. The processor locks the corresponding 3200 16-bit integer sampling points in memory, starts the SIMD instruction set, and processes 4 sampling points per cycle. For each sampling point S[n], the operation Result[n]=(S[n]*410)>>12 is executed. Assuming the original value of a sampling point is 10000, the calculation result is (10000*410) / 4096≈1000. The processor completes the calculation of all 3200 points within 200 microseconds and writes the result back to the output buffer. This process does not occupy the main CPU resources, audio playback is smooth, and the volume of sensitive words is significantly reduced to 10% of the original volume, achieving efficient and compliant real-time masking.
[0110] Step S4: Using the directional audio masking control command, the pulse code modulation audio sequence to be detected is extracted, calculated, and corrected to generate a masked audio output stream. Specifically, this includes: S4.1: Based on the precise sensitive word location index included in the directional audio masking control instruction, extract the original audio data frame of the corresponding time segment from the pulse code modulation audio sequence to be detected, so as to generate a sensitive word audio segment sequence to be processed.
[0111] S4.2: According to the directional audio masking control command, perform amplitude zeroing calculation or gain coefficient attenuation operation on the sensitive word audio segment sequence to be processed, so as to generate a target audio segment sequence after amplitude correction.
[0112] The system receives the audio segment sequence of sensitive words extracted in the previous steps and the standardized masking execution command stream, and parses the operation type identifier and fixed-point gain control word. If the operation type identifier indicates a silence replacement mode, it initializes an all-zero buffer array with a length strictly consistent with the number of sampling points of the sensitive word segment, sets all the original audio data to zero, achieves absolute silence masking, and completely blocks the acoustic propagation of illegal speech information.
[0113] If the operation type identifier indicates volume attenuation mode, the integer multiplier-accumulator instruction set of the set-top box digital signal processing unit is invoked. The pulse-code modulation value of each discrete sample point in the audio segment to be processed is read and treated as a signed integer operand. A fixed-point multiplication operation is performed between the signed integer operand and the normalized gain control word. The operand is then right-shifted and truncated according to a preset decimal width to restore the original bit depth precision, generating the attenuated target sample value.
[0114] To address the potential overflow risk from multiplication operations, a saturation arithmetic protection mechanism is introduced. When the absolute value of the calculation result exceeds the maximum dynamic range allowed by the pulse code modulation format, the result is forcibly clamped to the boundary of the largest positive integer or the smallest negative integer to prevent waveform flipping distortion caused by numerical overflow, thus ensuring the linearity and naturalness of the audio signal.
[0115] Iterate through all sampling points of the sensitive word segment, repeat the above fixed-point multiplication and saturation truncation operations until the entire time window is covered, and generate a complete target audio segment sequence after amplitude correction.
[0116] Through the above-mentioned branch processing and fixed-point integer arithmetic mechanism based on the operation mode, the logical control parameters of the previous step are transformed into specific digital signal amplitude correction data, realizing high-precision, low-latency sensitive word audio masking under limited computing resources, effectively eliminating floating-point operation overhead and ensuring the integrity of call audio quality.
[0117] For example, the audio sampling rate is set to 16kHz, the duration of the sensitive word is 100ms, and the corresponding number of sampling points M is 1600. If the strategy is silence replacement, a zero array of length 1600 is directly generated. If the strategy is volume attenuation, the amplitude correction coefficient is 0.2, the Q3.12 fixed-point format is adopted, and the normalized gain control word C_fixed is 819. Traverse the 1600 sampling points and perform the operation on the i-th sampling point Sample[i]: Target[i]=(Sample[i]*819)>>12. If the value of a sampling point is 30000, the calculation result is (30000*819) / 4096≈6025, which does not overflow and is directly assigned; if the calculation result exceeds the range of 16-bit signed integers, it is clamped to 32767. After this processing, the volume of the sensitive word is significantly reduced, and there is no calculation overflow noise, which meets the real-time compliance management requirements of the detention center.
[0118] S4.3: Using a preset smooth transition window function, perform cross-fade-in and fade-out fusion processing on the target audio segment sequence after amplitude correction and the adjacent non-sensitive word audio data frames to generate a smooth transition audio segment sequence that eliminates boundary abrupt noise.
[0119] The system receives the target audio segment sequence after amplitude correction and the original audio data frames of adjacent non-sensitive words extracted from the pulse code modulation audio sequence to be detected. It then determines the start and end boundary overlap regions of the sensitive word time segments. Based on the set-top box processor's computing power constraints and audio sampling rate characteristics, the Hanning window function is selected as the prototype for the smooth transition window function. The transition region duration is set to 10 to 20 milliseconds to achieve a balance between computational overhead and natural sound quality.
[0120] A normalized time mapping method is used to transform the coordinates of discrete audio sampling points within the transition region, converting the sampling index into a continuous variable for calculating window function coefficients. The weighted coefficients for each sampling point are calculated using the Hanning window mathematical model, as shown in the following formula: in, The window function coefficients for the nth sampling point are... This represents the total number of sampling points in the transition zone.
[0121] Furthermore, a complementary energy conservation strategy is used to perform inverse window function weighting on adjacent non-sensitive word original audio data frames. At the starting boundary of the sensitive word segment, a rising edge weighted sequence is constructed, and the amplitude-corrected silence or attenuation audio data is multiplied point-by-point with the rising edge coefficient of the Hanning window to achieve a smooth transition of amplitude from zero or low level to the original level. At the same time, the previous non-sensitive word original audio data is multiplied point-by-point with the falling edge coefficient of the Hanning window to ensure that the total energy of the corrected audio and the original audio remains constant within the overlapping area, avoiding the introduction of additional artificial noise or volume fluctuations.
[0122] At the end boundary of the sensitive word segment, a falling edge weighted sequence is constructed. The amplitude-corrected audio data is multiplied point by point with the falling edge coefficient of the Hanning window to achieve a smooth transition of amplitude from the original level to zero or low level. At the same time, the original audio data of the next non-sensitive word segment is multiplied point by point with the rising edge coefficient of the Hanning window to maintain energy continuity.
[0123] By employing a temporal linear superposition fusion method, the weighted modified audio segment and the weighted original audio segment are added point-by-point in the overlapping region to generate a smooth transition audio segment sequence that eliminates boundary abrupt noise. This processing method transforms the amplitude step signal generated in the previous step into auditory continuous smooth audio data, achieving the expected technical effect of minimizing interference with call continuity caused by the masking operation.
[0124] S4.4: The smooth transition audio segment sequence is backfilled into the corresponding position of the pulse code modulation audio sequence to be detected according to the original timestamp order to generate a masked audio output stream after compliance correction.
[0125] Receive a smooth transition audio segment sequence generated by crossfade-in / fade-out fusion processing. This sequence includes complete temporal sampled data of the start boundary transition region, the middle silence or attenuation core region, and the end boundary transition region. Parse the directional audio masking control command generated in the preceding step S3, extract the start sampling point offset Offset_start and end sampling point offset Offset_end from the precise sensitive word position index, and determine the absolute physical address range of the data to be replaced in the original pulse code modulation buffer.
[0126] A pointer offset-based memory block copying mechanism is used to locate the starting address of the original data buffer corresponding to the interval from Offset_start to Offset_end in the pulse-code modulation audio sequence to be detected. Boundary alignment checks are performed to ensure that the total number of sampling points N_total of the smoothly transitioning audio segment sequence is strictly consistent with the length of the target replacement interval, preventing buffer overflows or data truncation errors caused by data length mismatches.
[0127] High-speed data transfer requests are initiated using a Direct Memory Access (DMA) controller to write smoothly transitioned audio segment sequences in batches from a temporary processing buffer to the target address range of the original pulse-code modulation (PCM) sequence. During the writing process, the PCM format of the audio data remains unchanged, ensuring complete compatibility with the original stream in terms of bit depth, number of channels, and byte order, achieving microsecond-level data substitution operations.
[0128] A global temporal integrity check is performed on the pulse-code modulated audio sequence after backfilling to verify the continuity of adjacent non-sensitive word segments and backfilled segments on the time axis, ensuring that no sampling points are lost or repeated. Through the above memory-level data backfilling and alignment processing, the smoothed compliant audio data is seamlessly embedded into the original call stream, generating a compliance-corrected masked audio output stream, achieving the expected technical effect of zero interruption to call continuity due to sensitive word masking.
[0129] Step S5: Based on the accurate sensitive word location index in the sensitive word recognition result set, a video screen occlusion marker overlay instruction is generated synchronously, and the video screen occlusion marker overlay instruction is applied to the current call video frame rendering pipeline to generate the masked video output stream. Specifically, this includes: S5.1: Based on the accurate sensitive word location index and confidence score in the sensitive word recognition result set, calculate the range of video frame sequences corresponding to the duration of sensitive words, so as to generate a set of target video frame intervals including the start frame and the end frame.
[0130] Receive the sensitive word recognition result set and extract the start timestamp, end timestamp, and confidence score data for each sensitive word entry. Obtain the frame rate parameters of the current call video frame rendering pipeline and convert the timestamp unit to millisecond precision to ensure the consistency of the timing baseline.
[0131] The time interval of each unit frame is calculated based on the video stream frame rate, and a linear mapping relationship from the timeline to the frame index is established. For each detected sensitive word entry, its starting timestamp is divided by the single frame duration and rounded up to determine the first frame index number where the occlusion marker begins to be overlaid.
[0132] The end timestamp of the sensitive word is divided by the single-frame duration and rounded down to determine the last frame index where the occlusion marker stops overlapping. A confidence score is introduced as a weighting factor to fine-tune the calculated frame interval boundaries; the frame interval corresponding to a high-confidence sensitive word is extended by one frame on each side to cover potential speech trailing effects.
[0133] Iterate through all detected sensitive word entries to generate a list of tuples including the start and end frames. Perform a merging operation on the tuple list. If the frame intervals corresponding to two adjacent sensitive words overlap or the interval is less than a preset threshold, merge them into a continuous target video frame interval to avoid screen flickering caused by frequent switching of occlusion states.
[0134] Through the above-mentioned temporal-to-spatial mapping and transformation process, the sensitive word time index of the previous step is transformed into discrete video frame sequence range data, realizing the precise alignment of audio and video control strategies in the temporal dimension, and providing a standardized spatial and temporal reference for pixel-level occlusion rendering of subsequent video images.
[0135] For example, the video frame rate is set to 25fps, and the duration of a single frame is 40ms. Sensitive word A is detected with a start time of 1005ms and an end time of 1280ms, with a confidence level of 0.95. The starting frame is calculated as ceil(1005 / 40)=26, and the ending frame is calculated as floor(1280 / 40)=32. Because the confidence level is higher than 0.9, the interval is expanded to [25,33]. Sensitive word B is detected with a start time of 1290ms and an end time of 1350ms, and the calculated interval is [33,34]. Because the intervals [25,33] and [33,34] overlap, they are merged into the final target video frame interval [25,34] to ensure the continuity of the occlusion visual effect.
[0136] S5.2: Based on the timestamp information of each frame in the target video frame interval set, and combined with the video stream resolution parameters in the current call video frame rendering pipeline, determine the standard occlusion area coordinate matrix in the video frame used to display control prompts, so as to generate a standardized spatial mapping mask.
[0137] The system receives the target video frame interval set generated in the preceding step S5.1 and extracts the temporal boundary data, including the start frame index and end frame index, as the time reference signal to trigger the video image spatial domain processing. It then obtains the video stream resolution parameters from the current call video frame rendering pipeline. These parameters originate from the width W and height H pixel values of the original YUV or RGB color space data output to the graphics rendering engine by the set-top box video decoding module after completing H.264 / H.265 standard decoding, establishing the physical pixel coordinate system basis for subsequent geometric transformations.
[0138] S5.3: Using standardized spatial mapping masks to call the pre-built graphics rendering interface library, construct a composite occlusion marker primitive object including a semi-transparent background layer and a warning icon layer to generate the texture data of the visual control marker to be overlaid.
[0139] The system receives the standardized spatial mapping mask matrix generated in the preceding steps. This matrix defines the coordinate range of the pixel regions in the video frame that require visual intervention, as well as the edge smoothing weight values. Based on the prison compliance UI design specifications, the system initializes the graphics rendering context and allocates a video memory buffer to store the upcoming RGBA format texture data, ensuring that the color channel accuracy meets the requirements of high dynamic range display.
[0140] A semi-transparent base layer is constructed, using a preset regulatory warning color value as the base fill color. Low-saturation dark gray or dark red is typically chosen to reduce visual jarring. The grayscale values in the mask matrix are read as input parameters for the Alpha channel (the Alpha channel is the fourth component in the RGBA color model, independent of red (R), green (G), and blue (B), specifically recording transparency / opacity data). A transparency mapping operation is performed on each pixel of the base layer, ensuring the center of the obscured area has the highest opacity, gradually transitioning to complete transparency at the edges, achieving a natural blend with the background video image.
[0141] Load the vector warning icon resource pre-installed in the set-top box's read-only storage area. This icon includes a standardized "content masking" symbol or text prompt. Determine the icon's anchor point position in texture space based on the geometric center coordinates of the occlusion area calculated in step S5. Apply an affine transformation matrix to scale and translate the vector icon, making its size fit the relative proportion of the occlusion area while maintaining a constant aspect ratio to avoid graphic distortion.
[0142] The warning icon layer, after geometric transformation, is composited pixel-by-pixel with a semi-transparent background layer. Using a source-over blending mode, the icon's alpha channel is used as a mask to overlay the icon's pixel color values onto the corresponding positions on the background layer. For non-transparent areas of the icon, the original icon color is preserved; for transparent areas, the semi-transparent effect of the background layer is retained, thus creating a layered and composite visual element.
[0143] Anti-aliasing and gamma correction are applied to the composite layer to eliminate stair-step artifacts at the edges of the graphics and correct brightness non-linearity deviations. The processed pixel data is then encapsulated into standardized RGBA texture objects, bound to texture units in the graphics rendering pipeline, and used to generate the visual control marker texture data to be overlaid.
[0144] Through the chain-like derivation process of layer construction, transparency mapping, vector transformation, and pixel synthesis, the spatial mapping mask of the previous step is transformed into composite texture data with clear semantic indication and visual softness. This enables the blocking of the visual presentation of illegal information while providing clear and standardized control status feedback to the other end of the call, thereby improving the interactivity and compliance of the prison audio and video call system.
[0145] For example, the video resolution is set to 1920×1080, and the occlusion area is 576×1080 pixels. The base color layer uses RGB(40,40,40) dark gray, and the alpha channel value is determined by the mask matrix. The alpha in the center area is set to 200 / 255, and the alpha at the edges is gradually reduced to 0 after Gaussian blurring. The warning icon is a white shield shape, scaled to a width of 200 pixels, and centered in the occlusion area. After compositing using the source-over blending mode, a 1920×1080 RGBA texture is generated. After gamma correction (Gamma=2.2), the texture data is injected into the rendering pipeline. Tests show that the texture presents a clear semi-transparent masking effect on the LCD screen, with smooth, jagged edges on the icon, effectively conveying the masking status without causing strong visual interference.
[0146] S5.4: Inject the texture data of the visual control mark to be superimposed into the mixing process stage of the current call video frame rendering pipeline, and perform a frame-by-frame pixel Alpha channel fusion operation based on the target video frame interval set to generate an intermediate rendered video frame sequence including the visual control mark.
[0147] S5.5: Encode and align the intermediate rendered video frame sequence, including the visual control identifier, to generate the final masked video output stream, including the visual control identifier.
[0148] Step S6: Perform audio-video synchronization encapsulation processing on the shielded audio output stream and the shielded video output stream to generate the final uninterrupted continuous call media stream and output it to the other end of the call. Specifically, this includes: S6.1: Obtain the audio frame timestamp sequence in the masked audio output stream after compliance correction and the video frame timestamp sequence in the masked video output stream including the visual control identifier. Calculate the deviation between the audio frame timestamp sequence and the video frame timestamp sequence based on a preset clock synchronization method to generate a synchronization offset parameter set that reflects the timing difference between audio and video.
[0149] S6.2: Perform dynamic interpolation or frame loss compensation processing on the shielded video output stream including the visual control identifier using the synchronization offset parameter set to generate a synchronized video frame sequence that is strictly aligned on the time axis with the compliance-corrected shielded audio output stream.
[0150] S6.3: Based on the synchronized video frame sequence and the compliance-corrected masked audio output stream, the audio and video data packets are interleaved and encapsulated using the multimedia multiplexing container format standard to generate an initial encapsulated media stream data packet carrying a unified global time baseline.
[0151] Read the audio sample data packets from the masked audio output stream after compliance correction, and extract the corresponding pulse code modulation (PCM) raw data blocks and associated absolute presentation timestamps (PTS).
[0152] Read the video frame data packets in the masked video output stream, including the visual control identifier, and extract the corresponding H.264 / H.265 encoded NAL units and associated absolute presentation timestamps (PTS).
[0153] An audio-video interleaved buffer based on a monotonically increasing time axis is established, and the extracted audio data packets and video data packets are inserted into the corresponding time positions of the buffer according to their respective PTS values.
[0154] The data packets in the buffer are subjected to timestamp normalization. The start time of the current call session is selected as the zero point reference, and all absolute PTS are converted into relative time offsets relative to the start of the session.
[0155] Using a Box structure definition similar to multimedia container standards, a file header metadata object is constructed, which contains the prison set-top box terminal identifier, session ID, and codec configuration information.
[0156] Traverse the interleaved buffer, read audio and video data blocks in chronological order, and calculate the byte offset and duration of each data block in the media stream.
[0157] Generate a standardized sample description index for each data block, recording the sample size, sample duration, keyframe flags, and synthesis time offset.
[0158] The audio sample description index and the video sample description index are merged into the media data index table (SampleTable) to establish a mapping relationship between logical sample numbers and physical storage locations.
[0159] Based on the preset segmentation strategy, audio and video sample data within consecutive time segments are aggregated into independent media segments. Each segment includes a complete moof box and mdat box structure (the core container in the segmented MP4 (fMP4) format that stores local metadata of a single segment, supporting streaming media "download and play simultaneously").
[0160] Write the segment offset information and cumulative sample count to the header of each media segment to ensure that the player can parse any segment independently without relying on the state of the preceding segment.
[0161] The generated media segments are converted to big-endian format to conform to the parsing specifications of mainstream multimedia transmission protocols.
[0162] By constructing sample indexes and processing fragments based on time-axis interleaving, the independent audio and video streams from the previous step are transformed into initial encapsulated media stream data packets with a unified global time baseline and support for random access. This enables efficient and structured organization of prison call media data on the local terminal, providing a standardized data carrier for subsequent addition of dedicated protocol headers and network transmission. It significantly reduces the demultiplexing complexity at the receiving end and ensures the stability of synchronized audio and video playback.
[0163] S6.4: Perform integrity verification and protocol header encapsulation processing on the initial encapsulated media stream data packet, and add session control information of the prison-specific transmission protocol to generate a target uninterrupted continuous call media stream that conforms to the prison intranet transmission specifications.
[0164] Read the initial encapsulated media stream data packet with a unified global time baseline generated in step S6.3, extract the binary data stream of its payload and header metadata information, and use it as the object to be verified for integrity check.
[0165] The set-top box's built-in cryptographic acceleration engine is invoked, and the SHA-256 hash algorithm is used to perform block-by-block iterative operations on the payload data stream to generate a fixed-length message digest value, ensuring that no bit flips or memory errors occur during the local encapsulation process.
[0166] The generated message digest value is compared with the preset session integrity check code. If they match, the data packet content is determined to be complete and lossless, allowing it to enter the subsequent protocol encapsulation stage. If they do not match, the local re-encapsulation mechanism is triggered, the current abnormal data packet is discarded, and the preceding module is requested to re-output the synchronized audio and video frame sequence.
[0167] Based on the prison intranet dedicated transmission protocol specification, a custom protocol header structure is constructed, including session identifier, encryption level mark and priority weight. The session identifier is used to uniquely map the current call link, and the encryption level mark indicates whether the data has undergone end-to-end encryption processing.
[0168] The custom protocol header structure is serialized into a set of binary byte sequences, and the length field of the byte sequence is calculated and filled into the length field of the protocol header to form a standardized protocol control frame.
[0169] Zero-copy memory mapping technology is used to splice the standardized protocol control frames to the front end of the initial encapsulated media stream data packets, maintaining the physical address continuity of audio and video load data and avoiding CPU overhead and latency jitter caused by large-scale memory movement.
[0170] A Cyclic Redundancy Check (CRC32) code is appended to the end of the concatenated data stream. This check code covers all data from the start bit of the protocol header to the end bit of the audio / video payload and is used by the receiving end to detect bit errors in the transmission link.
[0171] A boundary alignment check is performed on the final complete data stream. If the data length is not an integer multiple of the maximum transmission unit of the network, zero-value bytes are padded at the end until the alignment requirements are met, thereby generating a target uninterrupted continuous call media stream that conforms to the prison intranet transmission specifications.
[0172] Through the chained processing of hash integrity verification, custom protocol header encapsulation, and CRC tail verification, the initial media stream from the previous step is transformed into standardized network data packets with anti-tampering characteristics, session traceability, and transmission robustness, achieving the expected technical effect of high-security and compliant transmission of audio and video call data in the prison environment.
[0173] For example, the initial encapsulated media stream data packet size is set to 1400 bytes. A 32-byte message digest is generated using the SHA-256 algorithm and compared with a pre-stored checksum. A 7-byte custom protocol header is constructed, including a 4-byte session ID, a 1-byte encryption flag, and a 2-byte length field. The protocol header is prepended, and a 4-byte CRC32 checksum is appended to the end, bringing the total length to 1411 bytes. Since the maximum transmission unit is 1500 bytes, fragmentation is unnecessary, but padding to specific alignment boundaries is required. The final 1411-byte target data stream is injected into the transmission buffer to ensure call continuity and prevent unauthorized data tampering in the weak network environment of the detention center.
[0174] S6.5: Inject the target uninterrupted continuous call media stream into the network transmission buffer of the set-top box and push it to the receiving device at the other end of the call in real time to complete the end-to-end compliant audio and video call data transmission.
[0175] For those skilled in the art, various other corresponding changes and modifications can be made based on the technical solutions and concepts described above, and all such changes and modifications should fall within the protection scope of the claims of this invention.
[0176] Unless otherwise defined, the technical or scientific terms used herein shall have the ordinary meaning as understood by one of ordinary skill in the art to which this application pertains. The terms “first,” “second,” “third,” and similar terms used in this patent application specification and claims do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Similarly, the terms “an” or “a” and similar terms do not indicate a quantity limitation, but rather indicate the presence of at least one. The terms “comprising” or “including” and similar terms mean that the element or object preceding “comprising” or “including” encompasses the element or object listed following “comprising” or “including” and its equivalents, and do not exclude other elements or objects. The “multiple” mentioned in the embodiments of this application refers to two or more. A and / or B indicate three possibilities: A; B; and A and B.
[0177] The above description is merely an exemplary embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and such modifications or substitutions should all be covered 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.
Claims
1. A method for detecting and blocking sensitive words in audio and video calls of a prison set-top box, characterized in that, Specifically, it includes: S1: Obtain the raw call audio stream data received by the prison set-top box terminal, and perform real-time decoding processing on the raw call audio stream data to generate a pulse code modulation audio sequence to be detected. S2: Based on the pulse code modulation audio sequence to be detected, extract the Mel frequency cepstral coefficient feature vector, and input the Mel frequency cepstral coefficient feature vector into the keyword matching model to generate a sensitive word recognition result set including a precise sensitive word position index; S3: Based on the precise sensitive word location index in the sensitive word recognition result set, retrieve the corresponding blocking strategy configuration data from the local sensitive word library stored in the set-top box to generate directional audio blocking control instructions; S4: Using the directional audio masking control command, the pulse code modulation audio sequence to be detected is extracted, calculated and corrected to generate a masked audio output stream; S5: Based on the accurate sensitive word location index in the sensitive word recognition result set, a video screen occlusion mark overlay instruction is generated synchronously, and the video screen occlusion mark overlay instruction is applied to the current call video frame rendering pipeline to generate the masked video output stream; S6: Perform audio and video synchronization encapsulation processing on the shielded audio output stream and the shielded video output stream to generate the final uninterrupted continuous call media stream and output it to the other end of the call.
2. The method for detecting and blocking sensitive words in audio and video calls of a prison set-top box according to claim 1, characterized in that, The keyword matching model includes multi-layer one-dimensional convolution, batch normalization, max pooling, fully connected layers, and a temporal boundary regression branch.
3. The method for detecting and blocking sensitive words in audio and video calls of a prison set-top box according to claim 2, characterized in that, S2 specifically includes: The pulse code modulation audio sequence to be detected is subjected to frame-by-frame windowing processing. The Hamming window function is used to truncate and smooth the continuous audio sampling points to generate a discrete audio frame sequence with short-time stationary characteristics. The Mel spectrogram matrix is obtained by performing operations and processing on discrete audio frame sequences; The Mel frequency cepstral coefficient eigenvector is obtained by performing logarithmic compression on the Mel spectrum matrix and then transforming it. The Mel frequency cepstral coefficient feature vector is input into the forward propagation computation link of the preset keyword matching model. The model uses a multi-layer convolutional neural network to extract local temporal dependency features and performs global semantic aggregation through a fully connected layer to output the sensitive word category probability distribution vector and time boundary regression parameters corresponding to the current audio frame. The sensitive word identification result set is obtained by filtering and correcting based on the probability distribution vector of sensitive word categories and the time boundary regression parameters.
4. The method for detecting and blocking sensitive words in audio and video calls of a prison set-top box according to claim 3, characterized in that, The process of calculating and processing the discrete audio frame sequence to obtain the Mel spectrogram matrix includes: Based on the discrete audio frame sequence, a fast Fourier transform operation is performed to convert the discrete audio frame sequence into a frequency domain power spectral density distribution. Then, based on the characteristics of human auditory perception, a Mel filter bank is constructed to perform nonlinear mapping integration on the frequency domain power spectral density distribution to generate a Mel spectrogram matrix.
5. The method for detecting and blocking sensitive words in audio and video calls of a prison set-top box according to claim 3, characterized in that, The process of performing logarithmic compression on the Mel frequency spectrum matrix and then transforming it to obtain the Mel frequency cepstral coefficient eigenvector includes: Logarithmic compression is performed on the Mel spectrogram matrix to simulate the logarithmic loudness characteristics of the human ear, generating a logarithmic Mel spectrogram matrix. Then, the discrete cosine transform method is applied to transform the logarithmic Mel spectrogram matrix from the frequency domain to the cepstral domain, and the low-order cepstral coefficients are truncated and the DC component is removed to generate the Mel frequency cepstral coefficient eigenvector.
6. The method for detecting and blocking sensitive words in audio and video calls of a prison set-top box according to claim 3, characterized in that, The sensitive word identification result set obtained by filtering and correcting based on the sensitive word category probability distribution vector and time boundary regression parameters includes: Based on the probability distribution vector of the sensitive word category, a non-maximum suppression filtering operation is performed to remove overlapping and redundant detection boxes and retain the candidate with the highest confidence. The start and end times of the sensitive words are corrected by combining the time boundary regression parameters, and finally a sensitive word recognition result set including the accurate sensitive word location index is generated.
7. The method for detecting and blocking sensitive words in audio and video calls of a prison set-top box according to claim 1, characterized in that, S3 specifically includes: Based on the accurate sensitive word location index in the sensitive word recognition result set, an address mapping query operation is performed on the local sensitive word library stored in the set-top box's secure encrypted area to obtain the blocking strategy configuration data; Based on the aforementioned blocking strategy configuration data, a matching degree calculation is performed to determine the specific blocking action type and intensity level parameters applicable to this call. Based on the specific shielding action type and intensity level parameters, and combined with the time segment boundary information corresponding to the precise sensitive word location index, a directional audio shielding control command is constructed.
8. The method for detecting and blocking sensitive words in audio and video calls of a prison set-top box according to claim 7, characterized in that, The directional audio shielding control command includes a start timestamp, an end timestamp, and an amplitude correction coefficient.
9. The method for detecting and blocking sensitive words in audio and video calls of a prison set-top box according to claim 1, characterized in that, S4 specifically includes: Based on the precise sensitive word location index included in the directional audio blocking control command, the original audio data frame corresponding to the time segment is extracted from the pulse code modulation audio sequence to be detected, so as to generate a sensitive word audio segment sequence to be processed. According to the directional audio masking control command, the amplitude zeroing calculation or gain coefficient attenuation operation is performed on the sensitive word audio segment sequence to be processed to generate the target audio segment sequence after amplitude correction. The target audio segment sequence after amplitude correction is processed to obtain the masked audio output stream.
10. The method for detecting and blocking sensitive words in audio and video calls of a prison set-top box according to claim 9, characterized in that, The process of processing the amplitude-corrected target audio segment sequence to obtain the masked audio output stream includes: Using a preset smooth transition window function, cross-fade-in and fade-out fusion processing is performed on the target audio segment sequence after amplitude correction and the adjacent non-sensitive word audio data frames to generate a smooth transition audio segment sequence. The smooth transition audio segment sequence is then backfilled into the corresponding position of the pulse code modulation audio sequence to be detected according to the original timestamp order to generate a compliance-corrected masked audio output stream.
