Method and system for measuring working fluid level of oil well

By using low-frequency narrowband linear frequency modulated wave excitation and an improved resonant peak extraction algorithm in oil wells, the problems of energy loss and noise interference in long-distance liquid level detection were solved, achieving high-precision and high-stability liquid level measurement, extending the detection distance and eliminating safety hazards.

CN121007614APending Publication Date: 2025-11-25CHONGQING UNIVERSITY OF SCIENCE AND TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511101781.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-07
Publication Date
2025-11-25

AI Technical Summary

Technical Problem

Traditional liquid level detection methods suffer from energy loss, signal attenuation, and noise interference in long-distance detection, leading to inaccurate results. In particular, stability and safety are difficult to achieve in long-distance liquid level detection in oil wells.

Method used

Using a low-frequency narrowband linear frequency modulated wave as the excitation source signal, and combining time-varying bandpass filtering, fast Fourier transform, local maximum detection method and DFT coefficient interpolation for high-precision parameter estimation, high-precision liquid level measurement is achieved through resonance peak extraction and sound velocity calibration.

Benefits of technology

It improves the accuracy and stability of long-distance liquid level detection, extends the effective detection distance to over 1700 meters, reduces measurement errors and eliminates the risk of explosion, and is suitable for harsh working environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121007614A_ABST
    Figure CN121007614A_ABST
Patent Text Reader

Abstract

The invention discloses a method and system for measuring the working fluid level of an oil well, and the method comprises the steps: generating a low-frequency narrow-band linear frequency modulation wave as an excitation source signal, and transmitting the amplified excitation source signal to a pipeline, so as to excite the resonance of a gas column in the pipeline; receiving the resonance sound wave signal, and preprocessing the resonance sound wave signal to generate a purification signal; wherein the preprocessing comprises time-varying band-pass filtering processing; carrying out fast Fourier transform processing on the purified signal so as to carry out spectrum analysis on a corresponding frequency spectrum, extracting a resonance band in a target frequency range, identifying formant positions through a local maximum value detection method based on the resonance band, and counting the number of formants; determining the frequency spectrum resolution and the discrete frequency point number in the resonance band based on the resonance band, and determining the frequency interval based on the formant number, the frequency spectrum resolution and the discrete frequency point number; and determining the liquid level distance according to the frequency interval and the sound velocity. The precision, stability and reliability of long-distance liquid level detection can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of liquid level measurement, and in particular to an oil well dynamic liquid level measurement method and system. BACKGROUND

[0002] Liquid level measurement methods include acoustic reflection methods and acoustic resonance methods. Acoustic reflection methods are based on the principle of reflection of acoustic waves at the interface of a medium, and by emitting an acoustic pulse to the liquid surface and receiving the reflected echo, the liquid level distance is calculated using the propagation time. This method is widely used in pipeline leak detection, oil dynamic liquid level measurement, and coalbed methane liquid two-phase flow monitoring in industrial scenarios. However, in practical applications, narrow pipe structures and physical barriers such as sediments and foam cause a sharp attenuation of acoustic pulse energy, making the true echo drowned in environmental noise. At the same time, structural reflections such as pipe splices and dead oil rings produce false echo signals, interfering with the identification of the true liquid surface echo. These signal attenuation and interference caused by physical structure limitations make it difficult to achieve stable and accurate measurement for long-distance liquid level detection.

[0003] Acoustic resonance methods excite air column resonance by emitting acoustic waves into the pipeline, and determine the liquid level by inversely calculating the air column length based on the fundamental frequency or series of resonance frequencies in the received signal. This method is widely used in food, chemical and other industrial scenarios, and has been extended to long-distance detection of oil wells. However, in practical applications, the narrow structure of long-distance pipes and sediments cause acoustic energy attenuation and noise interference, making the resonance signal weak, distorted or resonance frequency missing; dead oil ring disturbance and irregular wall reflection further distort the resonance peak shape, and existing algorithms are difficult to correct distortion. More seriously, increasing the intensity of the sound source to overcome attenuation poses an explosion risk in the presence of flammable gases in the oil well. These physical structure limitations and principle vulnerabilities together restrict the accuracy, stability and safety of long-distance liquid level detection.

[0004] In the field of liquid level detection, especially in long-distance liquid level detection scenarios, traditional liquid level detection methods face serious energy loss problems. When the measurement distance exceeds a certain range, the signal strength will be sharply reduced, resulting in inaccurate detection results or even failure to detect. For example, in acoustic liquid level detection, the energy of ordinary acoustic waves is greatly lost due to medium absorption, scattering and other factors during long-distance propagation, making the received signal weak and susceptible to noise interference, making it difficult to accurately extract liquid level information. In addition, traditional frequency spectrum analysis methods also have limitations in liquid level detection. In complex environments, the presence of noise can interfere with the results of frequency spectrum analysis, resulting in large errors in liquid level calculation. Moreover, traditional methods are not accurate enough in identifying and estimating resonance peaks, and are easily affected by factors such as frequency shift, which in turn affects the accuracy of liquid level measurement. For example, when the liquid level changes slightly, the traditional method may not be able to accurately capture the corresponding changes in the resonance peak, resulting in a large deviation in the liquid level measurement result. SUMMARY

[0005] The present application aims to at least partially solve the technical problems in the related art. To this end, a first object of the present application is to provide an oil well dynamic liquid level measurement method capable of improving the accuracy, stability and reliability of long-distance liquid level detection, which can realize high stability and high accuracy measurement of the long-distance liquid level through the introduction of a low-frequency narrow-band linear frequency modulation wave excitation, an improved resonance peak extraction algorithm and a high-precision parameter estimation method based on DFT coefficient interpolation.

[0006] A second object of the present application is to provide an oil well dynamic liquid level measurement system.

[0007] A third object of the present application is to provide a liquid level measurement instrument.

[0008] To achieve the above objects, the present application is implemented by the following technical solutions:

[0009] An oil well dynamic liquid level measurement method comprises:

[0010] A low-frequency narrow-band linear frequency modulation wave is generated as an excitation source signal, and the amplified excitation source signal is transmitted to the pipeline to excite the gas column resonance in the pipeline;

[0011] The resonance acoustic wave signal is received and preprocessed to generate a purified signal; wherein the preprocessing includes time-varying band-pass filtering processing;

[0012] The purified signal is subjected to fast Fourier transform processing to perform frequency spectrum analysis on the corresponding frequency spectrum, extract the resonance band in the target frequency range, and identify the resonance peak position based on the resonance band through a local maximum value detection method and count the number of resonance peaks;

[0013] The frequency spectrum resolution and the number of discrete frequency points in the resonance band are determined based on the resonance band, and the frequency interval is determined based on the number of resonance peaks, the frequency spectrum resolution and the number of discrete frequency points;

[0014] The liquid level distance is determined according to the frequency interval and the sound velocity.

[0015] In a possible implementation, the frequency range of the excitation source signal covers the target resonance band; and the time-varying band-pass filtering processing is to dynamically adjust the filter center frequency according to the frequency of the excitation source signal.

[0016] In a possible implementation, after the fast Fourier transform processing of the purified signal, the method further comprises: performing spectral smoothing processing on the frequency spectrum.

[0017] In a possible implementation, before the fast Fourier transform processing of the purified signal, the method further comprises: expanding the purified signal using zero padding technology to refine the frequency spectrum line distribution.

[0018] In a possible implementation, before identifying the resonance peak position and counting the resonance peak number based on the resonance band by the local maximum detection method, the method further comprises: correcting the frequency offset of the resonance band by a parameter estimation method based on DFT coefficient interpolation, so as to accurately identify the resonance peak position and count the resonance peak number.

[0019] In a possible implementation, the method further comprises: collecting environmental temperature data, so as to correct the sound velocity by the environmental temperature data.

[0020] In a possible implementation, the method further comprises: introducing a pipeline port correction term to correct the liquid level distance and compensate the pipeline edge effect.

[0021] In a possible implementation, the liquid level distance is represented as follows:

[0022]

[0023] wherein Ls represents the liquid level distance, c represents the sound velocity, η represents the resonance peak number, N1 represents the number of discrete frequency points in the resonance band, Δf represents the frequency spectrum resolution, d represents the pipeline diameter, and f1 represents the frequency interval. c

[0024] To achieve the above object, the second aspect of the present application provides an oil well liquid level measurement system, comprising:

[0025] a computer for generating a low-frequency narrow-band linear frequency modulation wave as an excitation source signal;

[0026] a power amplifier connected with the computer for amplifying the excitation source signal;

[0027] a loudspeaker connected with the power amplifier for emitting the amplified excitation source signal to the pipeline to excite the air column resonance in the pipeline;

[0028] a microphone for receiving a resonance sound wave signal;

[0029] a data acquisition device connected with the microphone and the computer respectively for collecting the resonance sound wave signal, performing digital conversion processing, and inputting a corresponding digital signal to the computer, so that the computer generates a purified signal by preprocessing the digital signal, performs fast Fourier transform processing on the purified signal, performs frequency spectrum analysis on a corresponding frequency spectrum, extracts a resonance band in a target frequency range, identifies a resonance peak position based on the resonance band by a local maximum detection method, counts the resonance peak number, determines a frequency spectrum resolution and a number of discrete frequency points in the resonance band based on the resonance band, and determines a liquid level distance based on the resonance peak number, the frequency spectrum resolution, the number of discrete frequency points, and the sound velocity.​

[0030] To achieve the above objectives, a third aspect of the present invention provides a liquid level measuring instrument, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the above-described method for measuring the dynamic liquid level in an oil well.

[0031] This invention has at least the following technical effects:

[0032] (1) When a low-frequency narrowband linear frequency modulated wave is emitted from the pipe opening, the sound wave excites resonance within the air column. The resonant sound wave signal can be dynamically filtered out by a time-varying bandpass filter to remove high-order responses and noise interference. In addition, the extracted resonance signal can be smoothed by spectrum processing to eliminate the influence of the gradual change characteristics of the excitation source. Finally, the number of resonance peaks can be accurately calculated by an adaptive window function interpolation algorithm, i.e., a parameter estimation method based on DFT coefficient interpolation, so that the measurement error of the 1700-meter liquid level distance is reduced from a significant deviation of the traditional method to within ±0.6 meters. In addition, because the present invention uses a low-frequency narrowband linear frequency modulated wave to avoid the high-frequency attenuation band, the energy can be concentrated and transmitted to the kilometer-level liquid surface. At the same time, the resonance feature extraction method can enhance the identification capability of weak resonance signals, extending the effective detection distance from the hundreds of meters of the traditional acoustic resonance method to more than 1700 meters.

[0033] (2) Traditional acoustic reflection methods require high-intensity acoustic pulses to overcome long-distance attenuation, which poses an explosion risk in oil and gas mixed environments. However, this invention uses low-pressure continuous linear frequency modulation waves to excite resonance, eliminating the need for high-pressure pulse equipment and removing safety hazards.

[0034] (3) When pipelines bend and deform due to installation or corrosion, traditional methods produce large errors due to echo path distortion. This invention uses resonance peak periodicity analysis combined with interpolation algorithm compensation to suppress the measurement fluctuation of bent pipelines to within 0.5 meters. In addition, the spectral smoothing technology can effectively resist signal distortion caused by foam residue and maintain stable output even when the signal-to-noise ratio is as low as -21 dB, making this invention adaptable to harsh working conditions such as oilfields and chemical plants.

[0035] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0036] Figure 1 This is a flowchart of the system solution according to an embodiment of the present invention.

[0037] Figure 2 This is a flowchart of the oil well dynamic fluid level measurement method according to an embodiment of the present invention.

[0038] Figure 3 This is a structural block diagram of the oil well dynamic fluid level measurement system according to an embodiment of the present invention.

[0039] Figure 4 A schematic diagram of the physical structure of a liquid level measuring instrument is shown. Detailed Implementation

[0040] The following describes this embodiment in detail. Examples of the embodiments 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 intended to explain the invention, and should not be construed as limiting the invention.

[0041] It should be noted that the oil well dynamic fluid level measurement method provided in this embodiment is applied to an oil well dynamic fluid level measurement system. The hardware of this system consists of a computer, power amplifier, speaker, microphone, data acquisition device (NI9234), power supply, temperature sensor, and piping. The computer is connected to the power amplifier, and the power amplifier is connected to the speaker. The computer generates a low-frequency narrowband linear frequency modulated wave, which is amplified by the power amplifier and transmitted to the speaker. The speaker emits sound waves into the piping, exciting the resonance of the gas column inside the pipe, providing hardware support for the sound wave excitation generation stage. The microphone is connected to the data acquisition device, and the data acquisition device is connected to the computer. The microphone receives the resonant sound wave signal, which is converted into a digital signal by the data acquisition device and transmitted back to the computer, providing raw data for signal acquisition and preprocessing, resonance band extraction, and spectrum analysis. The temperature sensor is used to collect ambient temperature to calibrate the sound velocity, directly improving the accuracy of fluid level distance calculation and solving the technical problem of sound velocity being affected by temperature. In this embodiment, the power supply is used to ensure the stable operation of the entire hardware system and ensure the continuous execution of each technical step.

[0042] The system's flowchart is as follows Figure 1 As shown, the entire process begins with the generation of acoustic excitation, followed by signal acquisition and preprocessing to extract effective signals. Key features are then identified through resonance band extraction and spectral analysis. High-precision calculations are achieved using parameter estimation based on DFT (Discrete Fourier Transform) coefficient interpolation, and finally, the result is output through liquid level distance calculation. Each process step corresponds clearly to a hardware device. The hardware system provides the physical basis for process execution, while the process steps process the data acquired by the hardware through algorithms, collectively achieving the goal of accurate long-distance liquid level detection.

[0043] The method and system for measuring the dynamic fluid level in an oil well according to this embodiment are described below with reference to the accompanying drawings.

[0044] Figure 2 This is a flowchart of an oil well dynamic fluid level measurement method according to an embodiment of the present invention. Figure 2 As shown, the method includes:

[0045] Step S101: Generate a low-frequency narrowband linear frequency modulated wave as an excitation source signal, and transmit the amplified excitation source signal to the pipeline to excite the resonance of the air column inside the pipeline.

[0046] Traditional methods suffer from weak signals over long distances due to sound wave energy loss, making it difficult to effectively excite gas column resonance. This embodiment uses a low-frequency narrowband linear frequency modulated (LFM) wave as the excitation source signal, with its frequency range designed to cover the target resonance band, i.e., the resonance frequency range of the target liquid level.

[0047] The computer generates a low-frequency narrowband (LFM) digital signal, which is transmitted through the computer, power amplifier, and speaker path. The power amplifier amplifies the signal, and the speaker emits sound waves into the pipe.

[0048] In this embodiment, the low-frequency characteristics significantly reduce energy attenuation caused by medium absorption and scattering, ensuring that the excitation source signal can maintain sufficient energy to excite the air column resonance during long-distance propagation. Simultaneously, narrow-band scanning avoids high-order response interference. If the upper limit of the scanning frequency band exceeds twice the lower limit, a time-varying bandpass filter is required to eliminate unwanted responses. This embodiment optimizes energy distribution by driving a loudspeaker to emit sound waves through a power amplifier, laying the foundation for subsequent signal acquisition.

[0049] In one embodiment, an experimental system is set up. After the experimental system is set up, signal generation and excitation are performed. Specifically, a power amplifier, speaker, microphone, data acquisition equipment, and computer are connected. One end of the pipe is open and exposed to air, while the other end is immersed in liquid. During the experiment, the computer generates a low-frequency narrowband linear frequency modulation (LFM) wave with a frequency sweep range of f. low to f high The formula for a low-frequency narrowband linear frequency modulation (LFM) signal is as follows:

[0050]

[0051] Where r(t) represents a low-frequency narrowband linear frequency modulated wave, f low Indicates the lower limit of the scanning frequency band, f high The upper and lower limits of the scanning frequency band are indicated. The upper and lower limits of the scanning frequency band need to be selected according to the pipe length L to ensure that the resonant frequency covers the low frequency region (to avoid high-order response interference). t is time, and T represents the frequency sweep time, which needs to be calculated based on the pipe length L and the speed of sound c: T = 2L / C, to ensure that the signal completes one round trip propagation in the pipe, that is, to ensure the effective propagation and resonant excitation of the signal in the pipe.

[0052] Step S102: Receive the resonant acoustic wave signal and preprocess the resonant acoustic wave signal to generate a purified signal; wherein, the preprocessing includes time-varying bandpass filtering.

[0053] Specifically, the mathematical model related to excitation in the resonant acoustic signal can be expressed as:

[0054] y0(t)≈p(t)*s(t)*r(t)+q(t)*s(t)*r(t)+u(t)+z(t)(2)

[0055] Where y0(t) represents the received resonant acoustic wave signal, * represents the convolution operation, p(t) represents the characteristic signal of the air column in the pipe; s(t) represents the system characteristic signal, including the characteristic parts of the loudspeaker, acoustic sensor and measurement circuit; q(t) represents the transmission characteristic signal from the sound source to the acoustic sensor; u(t) represents the higher-order response signal of r(t); and z(t) represents the noise signal from the measurement system and the environment.

[0056] The microphone can be placed near the opening of the pipe to collect the resonant sound wave signal y0(t), and then converted to digital (A / D) using a data acquisition device at a sampling rate f. s The Nyquist condition (i.e., f) must be satisfied. s >2f max ), f max The highest frequency of the signal is used for processing, and the processed signal is then input into the computer. The computer receives the digitized signal and executes subsequent signal processing algorithms.

[0057] In this embodiment, the signal acquisition stage receives signals via a microphone and transmits them through the microphone, data acquisition equipment, and computer. To address the issue of weak resonant signals that are susceptible to noise interference, a time-variable bandpass filter technique is introduced. The center frequency of the filter is dynamically adjusted according to the excitation frequency to suppress higher-order resonant responses and environmental noise, ensuring that the purified signal effectively retains its resonant characteristics.

[0058] Specifically, the resonant sound wave signal acquired by the microphone needs to pass through a time-varying bandpass filter to suppress higher-order responses and environmental noise. The center frequency of the time-varying bandpass filter is dynamically adjusted according to the excitation frequency, for example, extracting the resonant frequency band in the range of 26-54Hz. After preprocessing, the signal is converted from analog to digital (A / D) and then input to the computer at a sampling rate f. s The Nyquist condition must be met to avoid aliasing. The pre-treated purified signal is represented as follows:

[0059] y(t)≈p(t)*s(t)*r(t)+q(t)*s(t)*r(t)(3)

[0060] Where y(t) represents the purified signal after preprocessing to eliminate u(t) and z(t).

[0061] Step S103: Perform Fast Fourier Transform on the purified signal to perform spectral analysis on the corresponding spectrum, extract the resonance bands in the target frequency range, and identify the resonance peak positions based on the resonance bands using the local maximum detection method, and count the number of resonance peaks.

[0062] Optionally, before performing Fast Fourier Transform on the cleaned signal, zero-filling technology can be used to expand the cleaned signal to refine the spectral line distribution, thereby improving the spectral resolution.

[0063] Specifically, to improve frequency estimation accuracy, zero-padding techniques can be used to expand the spectral resolution. For example, zeros can be padded at the end of the original signal before performing a Fast Fourier Transform (FFT).

[0064] Furthermore, based on the cleaned signal received by the computer, the corresponding spectrum can be obtained by performing a Fast Fourier Transform (FFT). The spectrum after the FFT transformation is as follows:

[0065]

[0066] Where Y(k) is the spectrum of the cleaned signal after FFT transformation, n is the sampling point index (n=0,1,…,N-1), N is the number of sampling points (FFT transformation length), y(n) is the discretized cleaned signal, and k is the frequency index (k=0,1,…,N-1).

[0067] Among them, spectral resolution The spectrum of Y(k) was then smoothed to further eliminate the influence of random noise, and then the resonance band G was extracted. (k) Its periodic characteristics.

[0068] In this embodiment, the spectrum formula after FFT transformation is shown in formula (4), and its spectrum model can be expressed as follows:

[0069] Y(k)≈P(f)·S(f)·R(f)+Q(f)·S(f)·R(f)(5)

[0070] Where P(f), S(f), R(f), and Q(f) are the Fourier transform results of p(t), s(t), r(t), and q(t), respectively. The resonance band G is extracted from this spectral signal after spectral smoothing. (k) It is expressed as follows:

[0071] |G (k) |≈|P(f)|·|S(f)|·|R(f)|+Q(f)·S(f)·R(f)(6)

[0072] Wherein, the phase correction parameter M(f) = S(f)·R(f), and ΔP(f)·M(f) is the phase correction term. The phase correction term can ensure that the preprocessed signal has a high signal-to-noise ratio. Here, ΔP(f) represents the phase correction parameter, which is used to compensate for phase distortion.

[0073] Furthermore, accurate extraction of resonance peaks can be ensured through spectrum optimization, thereby avoiding measurement errors caused by signal distortion.

[0074] In one possible implementation, before identifying the location of the resonance peaks and counting the number of resonance peaks based on the local maximum detection method of the resonance band, the method further includes: using a parameter estimation method based on DFT coefficient interpolation to correct the frequency shift of the resonance band in order to accurately identify the location of the resonance peaks and count the number of resonance peaks.

[0075] Traditional spectrum analysis is sensitive to frequency shift, leading to parameter estimation errors. This embodiment employs an improved interpolation discrete Fourier transform algorithm, using the amplitude ratio of adjacent spectral lines to correct for frequency shift via an interpolation formula. The input data for this algorithm comes from high-quality signals transmitted from the microphone and data acquisition equipment. The iterative interpolation algorithm optimizes the frequency estimation; the coarse estimation formula for parameter estimation based on DFT coefficient interpolation is as follows:

[0076]

[0077] Where λ1 represents the coarse estimate of the normalized frequency, l represents the peak index of the spectrum, γ is the coefficient related to the window function, and ξ1 represents the amplitude ratio of the adjacent spectral lines of the peak.

[0078] in, This represents the amplitude of the zero-filled signal spectrum at the frequency point adjacent to the right of the peak frequency l. The amplitude of the zero-filled signal spectrum at the frequency point adjacent to the right of the peak frequency l is obtained through iterative optimization:

[0079]

[0080] Where λ2 represents the frequency estimate after iterative optimization, ξ1 represents the updated window function coefficients, μ1 represents the intermediate variable based on ξ1, and μ2 represents the interpolation point magnitude difference ratio.

[0081] in, Iterative optimization further reduces system errors, ensuring high-precision frequency estimation, where ξ2 represents the spectral amplitude ratio at the iteration position, and X... ω (λ) represents the weighted DFT value of a single-point frequency. This algorithm does not depend on a specific window function and is suitable for asymmetric windows.

[0082] The γ coefficient is calculated as follows:

[0083]

[0084] Where μ0 represents the ratio of the spectral amplitude at the offset position.

[0085] in, Where ξ0 represents the spectral magnitude ratio of the offset index, This represents the amplitude of the zero-filled signal spectrum at the index point (l+ε+1). Let represent the amplitude of the zero-filled signal spectrum at index point (l+ε-1), ε represent the sign function of the spectral gradient direction, and sign represent the sign function.

[0086] Furthermore, the frequency optimization is expressed as follows:

[0087]

[0088] The iteration termination condition is |λ m -λ m-1 |<τ. Where τ is a preset precision threshold.

[0089] Where, λ m , λ m-1 Let represent the frequency estimates for the m-th and (m-1)-th iterations, respectively.

[0090] In this embodiment, frequency iteration optimization and zero-filling techniques can further reduce system errors and ensure high-precision frequency estimation. Specifically, frequency iteration optimization facilitates accurate identification of resonance peak locations and the counting of resonance peaks.

[0091] First, based on the peak index l of the zero-fill signal spectrum and the amplitude ratio of adjacent spectral lines... Calculate the rough estimate The formula was then iteratively optimized. and Update the estimate and use |λ m -λ m-1 |<τ is the termination condition, ultimately yielding the high-precision normalized frequency λ. m Through λ m Corrected resonance band G (k) The peak frequency point. First, perform frequency coordinate transformation, using the sampling rate f. s And the number of discrete frequency points N, the normalized frequency λ m Convert to continuous frequency This conversion eliminates the picket fence effect bias in discrete spectra, enabling frequency positioning accuracy to exceed spectral resolution. Then, discrete frequency mapping is performed, and the discrete index of the target frequency in the resonance band is calculated based on the spectral resolution Δf. The optimized continuous frequency is precisely mapped to G. (k) The specific frequency points, where round represents the rounding function; finally, the peak position correction is completed, and candidate resonant points are located based on the k value, through neighborhood amplitude comparison (when G... (k) >G (k-1) And G (k) >G (k+1) This confirms that it is the center of the physical resonance peak, overcoming misjudgments of sidelobes or noise caused by frequency shift. In this process, λ m The high-precision estimation significantly suppresses systematic shifts, ensuring that frequency point k strictly corresponds to the true resonance peak. When traversing the resonance band, the algorithm only needs to verify the amplitude condition in the neighborhood (k-1, k, k+1) of k to eliminate spurious peak interference and accurately count the number of resonance peaks η.

[0092] To accurately identify the location of resonance peaks, a local maximum detection algorithm can be used to count the number of resonance peaks, which is a key parameter for calculating liquid level distance. The local maximum detection algorithm is as follows:

[0093] Traversing the smooth spectrum, i.e., the resonance band G (k) The amplitude is used to identify local maxima as resonance peaks. The criterion for determining local maxima is: when G... (k) >G (k-1) And G (k) >G (k+1) When k is determined to be the location of the resonance peak, the number η of resonance peaks satisfying the conditions is counted and used as the input parameter for subsequent frequency interval calculation. Where G (k-1) G (k+1) These represent the amplitude at the previous frequency point (k-1) and the amplitude at the next frequency point (k+1), respectively.

[0094] Step S104: Determine the spectral resolution and the number of discrete frequency points within the resonance band based on the resonance band, and determine the frequency interval based on the number of resonance peaks, spectral resolution, and number of discrete frequency points.

[0095] Specifically, the frequency interval f1 is calculated using the number of resonant peaks η and the spectral resolution Δf: in N1 is the number of discrete frequency points within the selected resonance band.

[0096] Step S105: Determine the liquid level distance based on the frequency interval and sound velocity.

[0097] In this embodiment, the relationship between the liquid level distance and the frequency interval is modeled using the following formula:

[0098]

[0099] Where Ls is the liquid level distance and c is the speed of sound. Based on the resonance peak parameters and the speed of sound c calibrated from the temperature data collected by the temperature sensor, the liquid level distance is finally calculated as follows:

[0100]

[0101] Where, d c For pipe diameter, correction term 0.3d c This is a pipe port correction term used to compensate for edge effects. Furthermore, a recursive evidence fusion algorithm can be introduced to weight and fuse multiple measurement results to reduce random errors in a single measurement.

[0102] Therefore, this method can improve the accuracy, stability and reliability of long-distance liquid level detection. By introducing low-frequency narrowband linear frequency modulated wave excitation, improved resonant peak extraction algorithm and high-precision parameter estimation method based on DFT coefficient interpolation, high stability and high precision measurement of liquid level over long distances can be achieved.

[0103] Furthermore, the present invention also provides an oil well dynamic fluid level measurement system.

[0104] Figure 3 This is a structural block diagram of an oil well dynamic fluid level measurement system according to an embodiment of the present invention. Figure 3 As shown, the system includes a computer, a power amplifier, a speaker, a microphone, a data acquisition device, and a temperature sensor.

[0105] The computer, power amplifier, and speaker are connected in sequence; the microphone, data acquisition equipment, and computer are connected in sequence.

[0106] In this embodiment, a computer generates a low-frequency narrowband linear frequency modulated wave as an excitation source signal; a power amplifier amplifies the excitation source signal; a loudspeaker transmits the amplified excitation source signal into the pipeline to excite the resonance of the air column inside the pipeline; a microphone receives the resonant sound wave signal; a data acquisition device acquires the resonant sound wave signal, performs digital conversion processing, and inputs the corresponding digital signal into the computer so that the computer can preprocess the digital signal to generate a purified signal, perform fast Fourier transform processing on the purified signal, and perform spectral analysis on the corresponding spectrum to extract the resonance band within the target frequency range. Based on the resonance band, the computer identifies the location of the resonance peaks using the local maximum detection method, counts the number of resonance peaks, and determines the spectral resolution and the number of discrete frequency points within the resonance band. Finally, the liquid level distance is determined based on the number of resonance peaks, spectral resolution, number of discrete frequency points, and sound velocity. A temperature sensor is used to calibrate the sound velocity to accurately calculate the liquid level distance.

[0107] It should be noted that the specific implementation of the oil well dynamic fluid level measurement system of the present invention can be found in the specific implementation of the oil well dynamic fluid level measurement method described above. To avoid redundancy, it will not be repeated here.

[0108] Furthermore, the present invention also provides a liquid level measuring instrument, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it can realize the above-mentioned method for measuring the dynamic liquid level in oil wells.

[0109] Figure 4 A schematic diagram of the physical structure of a liquid level measuring instrument is shown. Figure 4 As shown, the liquid level measuring instrument may include: a processor 210, a communication interface 220, a memory 230, and a communication bus 240, wherein the processor 210, the communication interface 220, and the memory 230 communicate with each other through the communication bus 240. The processor 210 can call the logical instructions in the memory 230 to execute the aforementioned oil well dynamic fluid level measurement method.

[0110] Furthermore, the logical instructions in the aforementioned memory 230 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0111] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0112] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0113] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for measuring the dynamic fluid level in an oil well, characterized in that, include: A low-frequency narrowband linear frequency modulated wave is generated as an excitation source signal, and the amplified excitation source signal is transmitted into the pipeline to excite the resonance of the air column inside the pipeline. The system receives a resonant acoustic wave signal and preprocesses the resonant acoustic wave signal to generate a purified signal; wherein the preprocessing includes time-varying bandpass filtering. The purified signal is processed by Fast Fourier Transform to perform spectral analysis on the corresponding spectrum, extract the resonance bands in the target frequency range, and identify the resonance peak positions and count the number of resonance peaks based on the resonance bands using the local maximum detection method. The spectral resolution and the number of discrete frequency points within the resonance band are determined based on the resonance band, and the frequency interval is determined based on the number of resonance peaks, the spectral resolution, and the number of discrete frequency points. The liquid level distance is determined based on the frequency interval and the speed of sound.

2. The method as described in claim 1, characterized in that, The frequency range of the excitation source signal covers the target resonance band; the time-varying bandpass filtering process dynamically adjusts the center frequency of the filter according to the frequency of the excitation source signal.

3. The method as described in claim 1, characterized in that, After performing Fast Fourier Transform on the purified signal, the method further includes: performing spectral smoothing on the spectrum.

4. The method as described in claim 1, characterized in that, Before performing Fast Fourier Transform processing on the purified signal, the method further includes: The purified signal is expanded using zero-filling technology to refine the spectral line distribution.

5. The method as described in claim 1, characterized in that, Before identifying the location of resonance peaks and counting the number of resonance peaks based on the resonance band using the local maximum detection method, the method further includes: The frequency shift of the resonance band is corrected by a parameter estimation method based on DFT coefficient interpolation in order to accurately identify the location of the resonance peak and count the number of resonance peaks.

6. The method as described in claim 1, characterized in that, The method further includes: Collect ambient temperature data so that the speed of sound can be corrected using the ambient temperature data.

7. The method according to any one of claims 1-6, characterized in that, The method further includes: A pipe port correction term is introduced to correct for the liquid level distance and compensate for pipe edge effects.

8. The method as described in claim 7, characterized in that, The liquid level distance is expressed as follows: Where Ls represents the liquid level distance, c represents the speed of sound, η represents the number of resonance peaks, N1 represents the number of discrete frequency points within the resonance band, Δf represents the spectral resolution, and d c f1 represents the pipe diameter and f1 represents the frequency interval.

9. A dynamic fluid level measurement system for oil wells, characterized in that, include: Computers are used to generate low-frequency narrowband linear frequency modulated waves as excitation source signals; A power amplifier, connected to the computer, is used to amplify the excitation source signal; A loudspeaker, connected to the power amplifier, is used to transmit the amplified excitation source signal into the pipe to excite the resonance of the air column inside the pipe. A microphone, used to receive resonant sound wave signals; The data acquisition device is connected to the microphone and the computer respectively. It is used to acquire the resonant sound wave signal, perform digital conversion processing, and input the corresponding digital signal to the computer. The computer then preprocesses the digital signal to generate a purified signal, performs fast Fourier transform processing on the purified signal, and performs spectral analysis on the corresponding spectrum to extract the resonant band within the target frequency range. Based on the resonant band, it identifies the position of the resonant peak using the local maximum detection method, counts the number of resonant peaks, and determines the spectral resolution and the number of discrete frequency points within the resonant band. Finally, it determines the liquid level distance based on the number of resonant peaks, spectral resolution, number of discrete frequency points, and sound velocity.

10. A liquid level measuring instrument, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the oil well dynamic fluid level measurement method as described in any one of claims 1-8.