A liquid level wave recognition method and system based on full frequency domain acquisition and embedded AI
Patent Information
- Application Number
- CN202611235168.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-14
- Publication Date
- 2026-11-03
AI Technical Summary
[0003]1抗干扰能力弱
[0038]1、识别精度高
Smart Images

Figure CN123028676A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a liquid surface wave identification method and system based on full-frequency domain acquisition and embedded AI, belonging to the field of oilfield testing technology. It is applicable to the automatic identification of liquid surface waves and coupling waves in the annulus liquid surface echo method measurement of oil well casing, as well as the auxiliary diagnosis of casing damage anomalies. Background Technology
[0002] Echo method for measuring fluid level in the annulus of pumping unit casing is a key technology in oilfield development. Traditional fluid level testers use analog filtering circuits to process the microphone signal in frequency bands, and identify the fluid surface wave and coupling wave through fixed threshold or peak detection algorithms to calculate the fluid level depth. However, as oilfield development progresses and well conditions become increasingly complex (casing damage, wax deposition, sand production, gas intrusion, etc.), traditional methods have the following shortcomings:
[0003] 1. Weak anti-interference ability
[0004] The analog channel signal acquisition and software filtering (such as wavelet denoising and spectral subtraction) are mostly used, which cannot effectively separate the surface wave (low frequency) and the throttle wave (high frequency) in the analog domain. They are easily affected by pumping unit vibration, formation noise and other interference, resulting in large errors in the identification of characteristic signals.
[0005] 2. Low information utilization
[0006] Only the liquid level and coupling wave position are extracted, discarding a large amount of information in the acoustic signal that may reflect the well condition (such as casing damage and corrosion);
[0007] 3. Poor adaptability
[0008] Existing solutions are either only suitable for shallow wells (where high-frequency signals have low attenuation) or only suitable for deep wells (where low-frequency signals have strong penetrating power), lacking a universal architecture that can accommodate both high and low frequency signals, requiring frequent adjustments to test parameters. Fixed-frequency filtering and fixed thresholds are difficult to adapt to different well conditions, requiring repeated manual adjustments on-site.
[0009] Existing technologies employ fuzzy recognition methods to locate liquid surface waves (patent ZL201610780178.1), using parameters such as waveform amplitude, repeatability, and dual-channel similarity for comprehensive evaluation. Other methods utilize echo correlation (patents ZL201210094388.7 and ZL202410017777.2), comparing waveform similarity by extracting features such as upper-zero spacing, lower-zero spacing, and zero-crossing slope. However, these methods are still based on manually designed features and rules, making them difficult to adapt to complex and changing field conditions, and they cannot achieve automatic diagnosis of abnormal states such as casing damage.
[0010] With the development of embedded AI (TinyML) technology, it has become possible to run lightweight machine learning models on resource-constrained microcontrollers. Introducing AI algorithms into liquid level testing, and realizing the transformation from "manual rule setting" to "data-driven learning," is an effective way to improve the intelligence level of instruments. Summary of the Invention
[0011] The purpose of this invention is to provide an AI-based algorithm and system for identifying liquid surface waves. Through full-frequency domain acquisition, dual-track parallel processing, and an embedded lightweight neural network, it achieves automatic identification of liquid surface waves and coupling waves, as well as auxiliary diagnosis of coupling damage anomalies, improving the instrument's adaptability and identification accuracy under complex working conditions.
[0012] The technical solution of this invention: a liquid surface wave recognition method based on full-frequency domain acquisition and embedded AI, the method comprising the following steps:
[0013] Step 1: The echo signal picked up by the microphone is acquired in the full frequency domain using a high-precision analog-to-digital converter at a sampling rate of 500Hz, and the original sound wave signal in the frequency range of 1Hz to 1kHz is completely preserved.
[0014] Step 2: The raw acoustic signal is simultaneously fed into two processing paths—Path A extracts the 5Hz and 40Hz components through digital filtering and outputs the liquid level depth and coupling position compatible with the original instrument using a traditional algorithm; Path B divides the raw acoustic signal into time windows, constructs the input feature matrix, and feeds it into a lightweight 1D CNN neural network model for real-time inference.
[0015] Step 3: The 1D CNN neural network model adopts a three-layer convolutional structure, automatically learns waveform morphology features through hierarchical feature extraction, and outputs the probability distribution of liquid surface wave position, coupling wave position sequence and sleeve damage anomaly score;
[0016] Step 4: Combine the traditional algorithm results for path A with the AI recognition results for path B to make a decision and generate the final measurement report;
[0017] Step 5: Perform integer quantization on the trained 1D CNN model and deploy it on the microcontroller using AI tools to ensure that the single inference time is ≤2ms.
[0018] Furthermore, the high-precision analog-to-digital converter is a 24-bit high-precision analog-to-digital converter.
[0019] Furthermore, in step 2, path A extracts the 5Hz center frequency component and the 40Hz center frequency component from the original acoustic signal in real time through a digital filter, respectively simulating the A and B channel outputs of the original instrument, and uses traditional threshold or peak detection algorithms to calculate the liquid level depth and coupling position, outputting measurement results compatible with the original instrument.
[0020] Furthermore, in step 2, path B divides the original acoustic signal into a 1-second time window, constructs a single-channel input feature matrix X ∈ R^(500×1) or a dual-channel fused input feature matrix X ∈ R^(500×2), and feeds it into a lightweight 1DCNN neural network model for real-time inference.
[0021] Furthermore, the 1D CNN neural network model in step 3 includes:
[0022] First convolutional layer: Performs convolution operation on the input signal and outputs 8 feature maps. This layer is responsible for extracting short-time waveform morphological features and providing low-level feature input for subsequent layers.
[0023] First pooling layer: max pooling, which downsamples the feature map to reduce the amount of data while preserving the main features;
[0024] The second convolutional layer convolves the pooled feature maps to output 16 feature maps, which are used to combine micro-features and identify local waveform segments.
[0025] Second pooling layer: max pooling, further aggregating local features;
[0026] The third convolutional layer outputs 32 feature maps, which are used to synthesize the global context and identify complete waveforms and abnormal features.
[0027] Global average pooling layer: aggregates all time information;
[0028] Fully connected layer: Outputs three types of recognition results: probability distribution of liquid surface wave position, sequence of coupling wave position, and abnormal score of sleeve damage.
[0029] Furthermore, in step 5, the trained 1D CNN model is quantized to 8 bits and deployed on an STM32H7 series microcontroller using the STM32Cube.AI tool.
[0030] Furthermore, in step 3, the threshold for abnormal loss scoring is set to 80%. When the score exceeds 80%, the system will prompt that there may be abnormal loss.
[0031] A liquid surface wave recognition system based on full-frequency domain acquisition and embedded AI, implementing the aforementioned method, includes:
[0032] 1) Wellhead connector: includes a wellhead generator and a microphone. The wellhead generator is used to instantaneously generate acoustic pulses, and the microphone is used to pick up echo signals and convert them into electrical signals.
[0033] 2) Liquid level monitoring host: integrates edge terminal, human-machine interface, embedded software, AI algorithm model and remote transmission module;
[0034] 3) Cloud computing and model training software: used for data storage, model iteration, and remote distribution of updated models.
[0035] Furthermore, the remote transmission module supports 4G / 5G full network communication, supports oilfield VPDN private network, and has the function of remote model update.
[0036] Furthermore, the liquid level monitor's main unit operates in a temperature range of -40 to +70°C, has a protection rating of IP56 or higher, and is explosion-proof.
[0037] The beneficial effects of the present invention: Compared with the prior art, the present invention has the following beneficial effects:
[0038] 1. High recognition accuracy
[0039] By automatically learning waveform features through a 1D CNN neural network model, the limitations of manually designed features are avoided. The accuracy of fluid level recognition is ≥98% under normal well conditions and ≥95% under complex well conditions.
[0040] 2. Highly adaptable
[0041] Based on a data-driven learning approach, the model can adapt to different well conditions (casing damage, wax deposition, gas effects, etc.) without the need for on-site manual parameter adjustments.
[0042] 3. Functional Expansion
[0043] In addition to fluid level depth and coupling location, a new auxiliary diagnostic function for casing damage has been added, which outputs anomaly scores of 0-100%, providing data support for oil well health assessment.
[0044] 4. Good real-time performance
[0045] After 8-bit quantization, the model is small in size and has a fast inference speed. On STM32H7, the single inference time is ≤2ms, which meets the real-time processing requirements of 500Hz sampling rate.
[0046] 5. Strong compatibility
[0047] Adopting a dual-track parallel architecture, it is fully compatible with existing instrument functions, allowing users to enjoy intelligent upgrades without changing their usage habits.
[0048] 6. Continuous Evolution
[0049] It supports remote model updates and can distribute optimized models via 4G / 5G networks to achieve continuous iteration of the instrument's intelligence level. Attached Figure Description
[0050] Figure 1 , 2This is a schematic diagram of the system hardware architecture of the present invention;
[0051] Figure 3 This is a schematic diagram of a 1D CNN neural network model structure;
[0052] Figure 4 This is a schematic diagram of the model training and deployment process. Detailed Implementation
[0053] The present invention will be further described below with reference to the accompanying drawings and embodiments, but this should not be construed as limiting the present invention.
[0054] An embodiment of the present invention: A liquid surface wave recognition method based on full-frequency domain acquisition and embedded AI, specifically including the following steps:
[0055] Step 1: Full-frequency domain signal acquisition
[0056] The microphone picks up the echo signal from the wellhead, which is then amplified by a low-noise preamplifier and converted from analog to digital by a 24-bit high-precision ADC at a sampling rate of 500Hz. The original sound wave signal in the frequency range of 1Hz to 1kHz is completely preserved and denoted as S(t).
[0057] Step 2: Dual-track parallel processing
[0058] The original acoustic signal S(t) is simultaneously fed into two processing paths:
[0059] Path A (Traditional Algorithm Compatible Path): The 5Hz center frequency component and the 40Hz center frequency component are extracted from S(t) in real time through a digital filter, and the A and B channel outputs of the original instrument are simulated respectively. The liquid level depth and coupling position are calculated using a traditional threshold or peak detection algorithm, and the measurement results are output in a manner compatible with the original instrument.
[0060] Path B (AI Intelligent Recognition Path): The original signal S(t) is divided into 1-second time windows (500 sampling points), and the input feature matrix X ∈ R^(500×1) (single channel) or X ∈ R^(500×2) (dual channel fusion) is constructed and fed into a lightweight 1DCNN neural network model for real-time inference.
[0061] Step 3: 1D CNN Neural Network Model Inference
[0062] The 1D CNN neural network model uses a three-layer convolutional structure:
[0063] First convolutional layer: kernel size 5, stride 1, output 8 feature maps, used to extract short-time waveform morphology features, including micro features such as rising edge, falling edge, and spikes;
[0064] First pooling layer: max pooling, pooling size 2, step size 2, downsampling is performed;
[0065] The second convolutional layer has a kernel size of 5 and a stride of 1, and outputs 16 feature maps to combine micro-features and identify local waveform segments such as "sharp rise + oscillation".
[0066] Second pooling layer: max pooling, pooling size 2, step size 2;
[0067] The third convolutional layer has a kernel size of 5, a stride of 1, and outputs 32 feature maps, which are used to synthesize the global context and identify complete liquid surface wave, coupling wave sequences and abnormal reflection features.
[0068] Global average pooling layer: aggregates all time information;
[0069] Fully connected layer: The number of output nodes corresponds to three types of recognition results: probability distribution of liquid surface wave position, sequence of coupling wave position, and abnormal score of casing damage (0~100%).
[0070] Step 4: Result Fusion and Output
[0071] The traditional algorithm results for path A are fused with the AI recognition results for path B to generate a final measurement report, including liquid level depth, coupling markings, and sleeve damage warnings. The report is then displayed and transmitted remotely via a human-computer interaction interface.
[0072] Step 5: Model Lightweighting and Embedded Deployment
[0073] The trained 1D CNN neural network model was quantized to 8-bit integers, reducing the model size to 1 / 4 of the original floating-point model. It was then converted into optimized C code using the STM32Cube.AI tool and deployed in an STM32H7 microcontroller, ensuring that the single inference time is ≤2ms and meeting the real-time processing requirements of a 500Hz sampling rate.
[0074] This invention also claims protection for a system hardware architecture for implementing the above-described liquid surface wave recognition method based on full-frequency domain acquisition and embedded AI, such as... Figure 1 As shown, the system of the present invention includes:
[0075] Wellhead connector: includes a wellhead generator and a microphone. The wellhead generator is used to instantaneously generate an acoustic pulse, and the microphone is used to pick up the echo signal and convert it into an electrical signal.
[0076] Liquid level monitor host: integrates edge terminal, human-machine interface, embedded software, AI algorithm model and remote transmission module (4G / 5G).
[0077] Cloud computing and model training software: used for data storage, model iteration, and remote distribution of updated models.
[0078] The edge terminal uses an STM32H7 series microcontroller, with a built-in 8-bit quantized 1D CNN model, which runs in real time through the TinyML inference engine.
[0079] The structure of a 1D CNN neural network model is as follows: Figure 2 As shown, the 1D CNN neural network model used in this invention adopts a hierarchical structure design, extracting waveform features layer by layer from the microscopic to the macroscopic level. The specific structure is described below:
[0080] (a) Input layer
[0081] The input layer receives the raw acoustic wave signal. Each time window contains 500 sampling points. The number of channels is 1 (single-channel microphone signal) or 2 (dual-channel liquid surface wave and coupling wave fusion). The input feature matrix dimension is (500, 1) or (500, 2).
[0082] (II) First convolutional layer: Microscopic feature extraction
[0083] The first convolutional layer (Conv1D_1) uses five convolutional kernels of size 5 with a stride of 1 to perform convolution operations on the input signal, outputting eight feature maps with a size of (496, 8). This layer is responsible for extracting the most basic microscopic morphological features of the signal, including short-term waveform changes such as rising edges, falling edges, spikes, and flat regions, providing low-level feature input for subsequent layers. A max-pooling layer (MaxPool_1) is then applied, with a pooling size of 2 and a stride of 2, downsampling the feature maps and compressing the output size to (248, 8), reducing the amount of data while preserving the main features.
[0084] (III) Second convolutional layer: Local waveform recognition
[0085] The second convolutional layer (Conv1D_2) also uses five convolutional kernels of size 5 with a stride of 1 to convolve the pooled feature maps, outputting 16 feature maps with a size of (244, 16). This layer combines the microscopic features extracted by the first layer to identify local waveform segments with specific morphologies, such as the typical "steep rise + oscillating decay" pattern of a hoop wave and the "wide and gentle rise + plateau + gentle descent" pattern of a liquid surface wave. Then, max pooling (MaxPool_2) is performed again with a pooling size of 2 and a stride of 2, compressing the output size to (122, 16) to further aggregate local features.
[0086] (iv) Third convolutional layer: Global context understanding
[0087] The third convolutional layer (Conv1D_3) still uses five convolutional kernels of size 5 with a stride of 1. It convolves the feature maps output from the second layer, outputting 32 feature maps with a size of (118, 32). The receptive field of this layer covers a relatively long time range (hundreds of milliseconds), enabling it to synthesize the contextual relationships of multiple local waveform segments, identify complete liquid surface wave and coupling wave sequences, and discover global patterns related to sleeve loss, such as "abnormal features appearing in locations where there should be no reflection".
[0088] (v) Global Pooling and Fully Connected Layer
[0089] After three layers of convolution and pooling, a global average pooling layer (GlobalAvgPool) is applied, averaging all time points of each feature map to aggregate them into a 32-dimensional feature vector, significantly reducing the number of parameters and preventing overfitting. Finally, two fully connected layers are connected sequentially: the first fully connected layer contains 16 neurons for feature fusion and nonlinear transformation; the second fully connected layer is the output layer, containing 3 neurons, corresponding to three recognition results: probability distribution of liquid surface wave position, sequence of coupling wave position, and abnormal sleeve damage score (0-100%).
[0090] The model training and deployment process of this invention is as follows: Figure 3 As shown, the data flow of this invention includes:
[0091] Data acquisition and annotation: Echo data covering different well depths and operating conditions are collected, and experts accurately annotate the fluid level position, coupling position, and casing damage label.
[0092] Cloud training: Train a 1D CNN model on a PC using the TensorFlow framework, employing the cross-entropy loss function and the Adam optimizer, until convergence.
[0093] Model lightweighting: The trained floating-point model is quantized to 8-bit integers, and the memory usage and inference cycle are evaluated using the STM32Cube.AI tool to ensure that real-time requirements are met.
[0094] Embedded deployment: The quantized model is converted into C code and integrated into the STM32 firmware, enabling remote updates via a 4G network.
[0095] Real-time inference: After the instrument is powered on, the edge terminal collects the raw signal at a sampling rate of 500Hz, triggers AI inference once every 1 second time window, and outputs and displays the recognition result.
Claims
1. A liquid surface wave recognition method based on full-frequency domain acquisition and embedded AI, characterized in that: The method includes the following steps: Step 1: The echo signal picked up by the microphone is acquired in the full frequency domain using a high-precision analog-to-digital converter at a sampling rate of 500Hz, and the original sound wave signal in the frequency range of 1Hz to 1kHz is completely preserved. Step 2: The raw acoustic signal is simultaneously fed into two processing paths—Path A extracts the 5Hz and 40Hz components through digital filtering and outputs the liquid level depth and coupling position compatible with the original instrument using a traditional algorithm; Path B divides the raw acoustic signal into time windows, constructs the input feature matrix, and feeds it into a lightweight 1D CNN neural network model for real-time inference. Step 3: The 1D CNN neural network model adopts a three-layer convolutional structure, automatically learns waveform morphology features through hierarchical feature extraction, and outputs the probability distribution of liquid surface wave position, coupling wave position sequence and sleeve damage anomaly score; Step 4: Combine the traditional algorithm results for path A with the AI recognition results for path B to make a decision and generate the final measurement report; Step 5: Perform integer quantization on the trained 1D CNN model and deploy it on the microcontroller using AI tools to ensure that the single inference time is ≤2ms.
2. The liquid surface wave recognition method based on full-frequency domain acquisition and embedded AI according to claim 1, characterized in that: The high-precision analog-to-digital converter is a 24-bit high-precision analog-to-digital converter.
3. The liquid surface wave recognition method based on full-frequency domain acquisition and embedded AI according to claim 1, characterized in that: In step 2, path A extracts the 5Hz center frequency component and the 40Hz center frequency component from the original acoustic signal in real time through a digital filter, respectively simulating the A and B channel outputs of the original instrument. The liquid level depth and coupling position are calculated using traditional threshold or peak detection algorithms, and the measurement results are output in a manner compatible with the original instrument.
4. The liquid surface wave recognition method based on full-frequency domain acquisition and embedded AI according to claim 1, characterized in that: In step 2, path B divides the original acoustic signal into 1-second time windows, constructs a single-channel input feature matrix X∈R^(500×1) or a dual-channel fused input feature matrix X∈R^(500×2), and sends it into a lightweight 1D CNN neural network model for real-time inference.
5. The liquid surface wave recognition method based on full-frequency domain acquisition and embedded AI according to claim 1, characterized in that: The 1D CNN neural network model in step 3 includes: First convolutional layer: Performs convolution operation on the input signal and outputs 8 feature maps. This layer is responsible for extracting short-time waveform morphological features and providing low-level feature input for subsequent layers. First pooling layer: max pooling, which downsamples the feature map to reduce the amount of data while preserving the main features; The second convolutional layer convolves the pooled feature maps to output 16 feature maps, which are used to combine micro-features and identify local waveform segments. Second pooling layer: max pooling, further aggregating local features; The third convolutional layer outputs 32 feature maps, which are used to synthesize the global context and identify complete waveforms and abnormal features. Global average pooling layer: aggregates all time information; Fully connected layer: Outputs three types of recognition results: probability distribution of liquid surface wave position, sequence of coupling wave position, and abnormal score of sleeve damage.
6. The liquid surface wave recognition method based on full-frequency domain acquisition and embedded AI according to claim 1, characterized in that: In step 5, the trained 1D CNN model is quantized to 8 bits and deployed on an STM32H7 series microcontroller using the STM32Cube.AI tool.
7. The liquid surface wave recognition method based on full-frequency domain acquisition and embedded AI according to claim 1, characterized in that: In step 3, the threshold for abnormal loss scoring is set to 80%. When the score exceeds 80%, the system will prompt that there may be abnormal loss.
8. A liquid surface wave recognition system based on full-frequency domain acquisition and embedded AI, implementing the method of any one of claims 1-7, characterized in that: include: 1) Wellhead connector: includes a wellhead generator and a microphone. The wellhead generator is used to instantaneously generate acoustic pulses, and the microphone is used to pick up echo signals and convert them into electrical signals. 2) Liquid level monitoring host: integrates edge terminal, human-machine interface, embedded software, AI algorithm model and remote transmission module; 3) Cloud computing and model training software: used for data storage, model iteration, and remote distribution of updated models.
9. The liquid surface wave recognition system based on full-frequency domain acquisition and embedded AI according to claim 8, characterized in that: The remote transmission module supports 4G / 5G full network communication, supports oilfield VPDN private network, and has the function of remote model update.
10. The liquid surface wave recognition system based on full-frequency domain acquisition and embedded AI according to claim 8, characterized in that: The operating temperature range of the liquid level monitor is -40 to +70℃, and the protection level is greater than or equal to IP56.
Citation Information
Patent Citations
A method for testing liquid surface echo time
CN103147740B
A method for fuzzy recognition of liquid surface waveforms in gas field well depth testing
CN106291710B
Oil and gas well working fluid level identification and diagnosis method based on multi-dimensional credibility fusion
CN117514148A
