Intelligent liquid level detection method based on terahertz spectrum characteristics
By establishing a dual-baseline observation framework and orthogonal observations in the terahertz band, generating fringe templates and canceling them across bands, the instability of liquid level detection under environmental humidity and container wall interference was solved, achieving stable liquid level determination and cross-seasonal consistency, thus improving the usability of engineering applications.
Patent Information
- Application Number
- CN202511504935.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-21
- Publication Date
- 2026-01-09
AI Technical Summary
When environmental humidity fluctuates and interference fringes on container walls and interfacial foam/wall-mounted water film coexist, existing technologies struggle to achieve stable and consistent liquid level detection. In particular, without modifying the storage tank, liquid level determination is unstable, and readings vary across seasons and media batches.
By establishing a dual-baseline observation framework in the terahertz band, consisting of a humidity anchor subband, a clean window subband, and a stripe detection subband, and combining micro-angle switching and cross-polarization to obtain orthogonal observations, stripe templates are generated and cross-band cancellation is performed. Online discrimination of liquid surface, foam, and water film adhering to the wall is carried out using main lobe broadening, in-band slope consistency, and group delay jitter rate, and confidence steady-state fusion is performed, along with evidence chain self-calibration and version locking.
It achieves stable liquid level detection under environmental interference, simultaneously suppresses the coupling interference of air moisture absorption and container wall interference fringes, obtains continuous and stable liquid level determination, maintains reading consistency across seasons and batches, and improves engineering usability and stability.
Smart Images

Figure CN121297983A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of liquid level measurement technology, specifically to a liquid level intelligent detection method based on terahertz spectral characteristics. Background Technology
[0002] Traditionally, liquid level measurement has relied on mechanical floats, pressure differentials, electrostatic capacitance, ultrasound, and millimeter-wave radar. For plastic drums commonly found in chemical and food processing plants, non-contact methods are preferred in practice: ultrasound is significantly affected by steam, temperature gradients, and foam; millimeter-wave radar is relatively stable through plastic walls, but echo distortion or reading fluctuations still occur during strong bubbling, condensation on the inner wall, or when a water film forms on the wall. On the other hand, terahertz waves, due to their ability to penetrate most dielectrics and their sensitivity to water content characteristics, are frequently used in literature for material identification and moisture content monitoring, but are rarely stably implemented in engineering scenarios involving "observing liquid levels from outside the drum." The core reason is that water strongly absorbs terahertz waves, is sensitive to changes in environmental humidity, and is easily affected by the combined interference of the container wall and interface conditions after installation.
[0003] For the specific working conditions of "external non-contact plastic containers," existing attempts mostly follow two paths: either change the measurement mechanism (such as millimeter-wave radar combined with algorithm filtering), or perform single-factor compensation on the terahertz link (such as using an environmental humidity sensor to calibrate the baseline, smoothing the spectrum, and setting thresholds to remove suspicious frames). These methods are effective when a single factor dominates, but when there are fluctuations in workshop humidity, multiple reflection stripes introduced by the container wall, and foam rings or film adhering to the liquid surface, the spectral baseline will drift, comb-like pseudo-peaks will appear in the frequency domain, and the main echo in the time domain will also broaden or jitter—single-point compensation often suffers from one aspect but another, and the range, refresh stability, and cross-seasonal consistency will all be compromised.
[0004] In this specific scenario, the field still faces a relatively concentrated technical problem: how to obtain stable characteristics that can be used for liquid level determination in real time, without modifying the storage tank, when there are fluctuations in ambient humidity, interference fringes on the container wall and interface foam / wall-mounted water film, and maintain the consistency of reading caliber across different seasons and media batches. Summary of the Invention (a) Technical problems to be solved
[0005] To address the shortcomings of existing technologies, this invention provides a liquid level intelligent detection method based on terahertz spectral characteristics. This method establishes a dual baseline in the terahertz band, comprising a humidity anchor sub-band, a clean window sub-band, and a stripe detection sub-band. Orthogonal observations are obtained by combining micro-angle switching and cross-polarization. A stripe template is generated in the stripe detection sub-band and canceled across bands. The net spectrum and net echo are labeled and judged based on main lobe broadening, in-band slope consistency, and group delay jitter rate, and then fused according to confidence level in a steady state. Combined with evidence chain-style self-calibration and version locking, this method solves the problems mentioned in the background technology. (II) Technical Solution
[0006] To achieve the above objectives, the present invention provides the following technical solution: a liquid level intelligent detection method based on terahertz spectral characteristics, comprising: S1. Establish observation benchmarks: Select humidity anchor point sub-band, clean window sub-band, and stripe detection sub-band in the terahertz frequency band, and activate the short-range reference cavity to form a dual baseline; S2. Humidity suppression: Extract absorption intensity and center drift in the anchor subband, construct baseline regression and map it to the remaining subbands, and correct echo amplitude and group delay. S3, fringe cancellation: By alternating sampling with micro-angle switching and cross-polarization, the fringe optical path and phase are estimated, and a fringe template is generated in the probe sub-band and canceled across the band. S4. Interface discrimination: Calculate the main lobe widening, in-band slope consistency and group delay jitter rate, distinguish between liquid surface, foam and water film adhering to the wall and give the confidence level. S5, Liquid Level Fusion: Select the solution channel by label, use time delay mapping for liquid surface, use broadening and slope compensation for foam, use polarization difference suppression for water film, and output the equivalent static liquid level and stability through confidence weighted recursion. S6. Self-calibration traceability: Monitor temperature, humidity and formula changes, reassess baseline regression, stripe template and threshold, update parameters and write to the evidence chain log.
[0007] In a preferred embodiment, S1 includes: In the terahertz band, a step search is used to determine the humidity anchor point sub-band, the clean window sub-band, and the stripe detection sub-band; When the spectral coverage of two subbands overlaps, the subband to be retained is determined in the following order: clean window subband first, stripe detection subband second, and humidity anchor point subband last. The intensity and frequency scale of the emission source are calibrated using a short-range reference cavity; When the three types of subbands meet the preset separation conditions and the short-range reference cavity meets the preset stability conditions, an observation benchmark is generated and used as a unified reference for subsequent steps. If any of the following occurs: environmental parameters exceed a preset threshold or the observation benchmark expires, the observation benchmark is determined to be invalid and a step search is re-executed to update the observation benchmark.
[0008] In a preferred embodiment, S2 includes: After establishing the observation benchmark, the absorption intensity and center drift are extracted from the humidity anchor point sub-band, and the source intensity change is obtained from the short-range reference cavity; Short-window robust estimation, time and frequency alignment, and background subtraction are performed on the indicator, and baseline regression is constructed to obtain amplitude correction coefficients and group delay correction coefficients. The correction coefficients are mapped to the clean window subband and the stripe detector subband and applied at the reference frequency. When the residual of the cleaning window band and the background fluctuation meet the preset threshold, a baseline regression block with a version identifier is generated and provided to subsequent steps along with the frame number. The stripe cancellation module reconstructs the template accordingly. If the template reconstruction is not completed, a conservative strategy is activated and the previous stable template is maintained. The interface determines that the weight is reduced during the conservative period.
[0009] In a preferred embodiment, S3 includes: In the terahertz band, small incident angle switching and alternating sampling with mutual orthogonal polarization are implemented, and a short-range reference cavity is used to unify the time and frequency scales. Periodic fluctuation components are extracted from the fringe probe sub-band, the equivalent optical path and phase of the container wall interference are estimated, and a fringe template is generated. The template is mapped to the clean window band to perform cancellation. The instantaneous frames corresponding to angle and polarization switching are removed and do not participate in modeling and cancellation, resulting in net spectrum and net echo for interface discrimination and liquid level fusion.
[0010] In a preferred embodiment, the stripe template is version-managed based on a dispersion table of container material and wall thickness, and is associated with the observation baseline version and the baseline regression version. Before being put into use, the stripe-related frequency component energy decreases to the corresponding threshold and the residual peak value is lower than the corresponding threshold after the stripe is cleaned and verified. When the mapping residual continues to rise during operation and is identified as a mismatch, it reverts to the previous version template, suppresses only the main frequency stripe period and triggers template reconstruction. During reconstruction, a fixed incident angle is used and orthogonal polarization sampling is maintained to maintain the preset frame acquisition rhythm.
[0011] In a preferred embodiment, S4 includes: After the observation benchmark, baseline regression and stripe cancellation take effect, the net spectrum and net echo with version marking are obtained at a unified time scale; Within a preset window, amplitude and phase normalization and consistency are completed. The main lobe broadening, in-band slope consistency, and group delay jitter rate are extracted. The liquid surface, foam, and wall-mounted water film are determined in the following decision order: broadening priority, slope consistency secondary, and group delay jitter rate secondary, and a confidence level is generated. When the confidence level is lower than a preset threshold, the frame is prevented from participating in the fusion process and the current stripe template is maintained. When consecutive frames in the thin-layer indicator band that meet the preset threshold polarization difference are detected, the confidence level of the wall-mounted water film is increased. The frame number, tag, confidence level, and version used are recorded in an append-only manner and made available for level fusion calls via a local message channel.
[0012] In a preferred embodiment, S5 includes: After obtaining the net spectrum and net echo and completing the label determination of liquid surface, foam, and wall-mounted water film, the liquid surface channel, foam channel, and wall-mounted water film channel are activated respectively according to the label. The liquid level channel maps the time delay to the relative reference plane height according to the locked geometric conversion table; the foam channel back-calculates the real interface based on the main lobe widening and the slope of the cleaning window; and the wall-mounted water film channel obtains a conservative liquid level estimate based on polarization difference to suppress echo interference. The results of the three channels are clipped at the boundary under a unified scale and then recursively fused according to the confidence level. The fusion is set with weight step size limit and freezing strategy. Generate and append a level block containing equivalent static level, stability, channel weight, status flag field, and version identifier field, and publish it via the local message channel; When the confidence level remains below the threshold, it enters a conservative configuration, holds the most recent qualified liquid level, and sends a reassessment request to the self-calibration module.
[0013] In a preferred embodiment, S6 includes: Set up a de-shaking trigger mechanism to continuously monitor temperature, relative humidity, media formulation markings, and container batch markings; When any monitored quantity reaches the preset trigger threshold, it enters the calibration state, reduces the frequency of external liquid level release within the preset observation window, re-estimates the baseline regression parameters of the humidity anchor point and the short-range reference cavity, reconstructs the stripe template of the stripe detection sub-band and projects it onto the clean window sub-band for verification, and verifies the interface discrimination threshold at the same time. Once the preset improvement criteria are met, the new parameters will be set as the effective version.
[0014] In a preferred embodiment, the effective version is locked by the version number and broadcast uniformly. The receiving side completes the switching in a monotonically increasing order of the version number and performs deduplication based on the unique identifier key formed by the combination of the version number and the frame number. If the preset improvement criteria are not met, the system will revert to the previous stable version and temporarily increase the trigger threshold. The self-calibration process and the version switching process will be recorded in the evidence chain in an unoverwriteable appending manner. When the temperature channel and humidity channel lose connection, it enters a conservative mode driven by a short-range reference cavity to maintain consistency between the external liquid level reporting frequency and the liquid level reading diameter.
[0015] Compared with the prior art, the present invention has the following beneficial effects: 1. A dual-baseline observation framework of "humidity anchor sub-band - clean window sub-band - stripe detection sub-band" is established in the terahertz band, and the spectral baseline and group delay are continuously corrected by humidity anchor regression. Orthogonal observations are obtained by combining micro-angle switching and cross-polarization. A stripe template is constructed in the stripe detection sub-band and cross-band projection cancellation is performed. Then, the liquid surface, foam and wall water film are judged online by main lobe broadening, in-band slope consistency and group delay jitter rate on the net spectrum and net echo. The equivalent static liquid level is output by steady-state fusion of different channels according to the confidence level. In this way, the coupling interference of air water vapor absorption, container wall interference fringes and interface scattering can be synchronously suppressed and effectively separated without modifying the storage tank. An external non-contact, continuous, stable and verifiable liquid level determination is obtained.
[0016] 2. By setting the operating rhythm of the de-jitter trigger and observation window, combined with the version locking and unified broadcasting of baseline regression, stripe template and discrimination threshold, and adopting the communication mechanism of idempotent retransmission and out-of-order reassembly, an uncoverable append method evidence chain and an operating strategy of automatic rollback, degradation and holding are established. Under the conditions of security interlock and resource limitation, self-calibration is performed, thereby achieving long-term consistency and traceable reproducibility under cross-season, cross-batch and different container batch conditions. This enables the field caliber to be quickly restored when the environment fluctuates and the operating conditions change, making maintenance and delivery more efficient. The upper system and manual review can be easily copied and verified under the unified caliber, and the overall availability and stability of the project are significantly improved. Attached Figure Description
[0017] Figure 1 This is a schematic flowchart of the intelligent liquid level detection method based on terahertz spectral characteristics of the present invention. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] Example: Figure 1 A flowchart illustrating the intelligent liquid level detection method based on terahertz spectral characteristics of this invention is provided. The intelligent liquid level detection method based on terahertz spectral characteristics includes: S1. Establish observation benchmarks: Select humidity anchor point sub-band, clean window sub-band, and stripe detection sub-band in the terahertz frequency band, and activate the short-range reference cavity to form a dual baseline; S2. Humidity suppression: Extract absorption intensity and center drift in the anchor subband, construct baseline regression and map it to the remaining subbands, and correct echo amplitude and group delay. S3, fringe cancellation: By alternating sampling with micro-angle switching and cross-polarization, the fringe optical path and phase are estimated, and a fringe template is generated in the probe sub-band and canceled across the band. S4. Interface discrimination: Calculate the main lobe widening, in-band slope consistency and group delay jitter rate, distinguish between liquid surface, foam and water film adhering to the wall and give the confidence level. S5, Liquid Level Fusion: Select the solution channel by label, use time delay mapping for liquid surface, use broadening and slope compensation for foam, use polarization difference suppression for water film, and output the equivalent static liquid level and stability through confidence weighted recursion. S6. Self-calibration traceability: Monitor temperature, humidity and formula changes, reassess baseline regression, stripe template and threshold, update parameters and write to the evidence chain log.
[0020] The technical connections and implementation logic of the six steps are as follows: S1 First, in the terahertz band, a step search is used to determine the humidity anchor sub-band, clean window sub-band, and stripe probe sub-band. A short-range reference cavity is used to unify the source intensity and frequency scale, forming an observation benchmark with version identification. S2 Under this benchmark, absorption intensity and center drift are extracted from the anchor sub-band. Combined with the reference, baseline regression parameters are generated, and amplitude and group delay correction coefficients are mapped to the clean window and stripe probe sub-bands, with the current regression version labeled on each frame. S3 Based on the corrected data, orthogonal observations are obtained using micro-angle switching and cross-polarization. The equivalent optical path and phase of wall-induced fringes are estimated in the stripe probe sub-band to generate a stripe template, which is then projected onto the clean window sub-band to perform cross-band cancellation, outputting the net spectrum and net echo with the template version. S4 On a unified time scale, main lobe broadening, in-band slope consistency, and group delay jitter rate are extracted from the net spectrum and net echo. According to a predetermined decision order, "liquid surface / foam / wall-mounted water film" labels and confidence levels are given. The labels record the observation benchmark and return... The template version is provided for downstream reference; S5 reads the tag and net echo, performs time delay mapping, broadening and slope compensation, and polarization difference suppression according to the tag, and recursively forms the equivalent static liquid level and stability with confidence weighting, publishes the liquid level block and sends back the stability and degradation status as upstream health signals; S6 continuously monitors temperature, humidity, formula and batch changes, and receives stability degradation and degradation requests from S5, triggering the self-calibration process after jitter removal: in the observation window, the baseline regression of S2, the stripe template of S3 and the discrimination threshold of S4 are re-evaluated in sequence. If the preset improvement criteria are met, the new version is broadcast uniformly and seamlessly switched. If not met, the previous stable version is rolled back, the trigger threshold is temporarily increased and conservative release is maintained; if the reconstruction of any link is not completed, S4 is downweighted and S5 holds the previous qualified liquid level until S6 completes convergence, thereby ensuring that the six steps are connected by version and time scale and can still operate stably in a closed loop under anomalies and environmental drift.
[0021] S1. Establish observation baseline: Select humidity anchor point sub-band, clean window sub-band, and stripe detection sub-band in the terahertz frequency band, and activate the short-range reference cavity to form a dual baseline. The specific implementation is as follows: In the case of external non-contact polyethylene and polyester containers, in order to ensure that all subsequent steps work on the same "ruler", the frequency domain and time domain coordinates of terahertz measurement are first established: radiation intensity and echo timing are continuously acquired on site according to a fixed rhythm. The recording items use five types of fields: frame number, timestamp, frequency point, amplitude, and phase, with units of milliseconds, gigahertz, decibels, and radians, respectively. The rhythm is preferably 10 to 30 frames per second, and the timestamp jitter is controlled within one percent of the frame period. Before the original records are entered into the benchmark establishment, time and frequency scale calibration is performed to make the same frequency point and the same scanning time comparable in different batches and under different environments. Then, the background is estimated and subtracted in the steady state of the device. If there are missing frames at the boundary, they are filled in by adjacent frames to avoid subsequent judgments being biased by irrelevant fluctuations.
[0022] To reduce uncertainties caused by geometric changes, the relative position of the machine head and the container sidewall should be fixed during initial deployment, preferably with a frontal distance of 20 to 30 centimeters, a pitch and horizontal offset of no more than 5 degrees, and a long-term average vibration acceleration of the machine base not exceeding one percent of gravity. The spectrum scan should cover 0.2 to 0.8 terahertz, with a frequency step size in the megahertz range. The single-band bandwidth of the three types of subbands should be in the tens of gigahertz range, and the center distance between any two types of subbands should not be less than one times their respective bandwidth to avoid overlap.
[0023] Subsequently, within several consecutive short windows, three narrow frequency bands are automatically selected based on air humidity and container wall characteristics: a humidity anchor point sub-band close to water vapor absorption characteristics to characterize baseline drift with the environment; a clean window sub-band far from strong absorption lines to carry steady-state observations related to liquid level; and a stripe detection sub-band sensitive to multiple reflections to estimate the effective optical path and phase of the stripes. The selection is performed by sliding within a preset search interval at a fixed step size, prioritizing the group with higher separation. In case of conflict, the clean window sub-band is prioritized, followed by the stripe detection sub-band, and then the humidity anchor point sub-band. The discarded candidates are written into the trace in chronological order.
[0024] Simultaneously with the screening, the short-range reference cavity in the near field of the head continues to work to stabilize the source strength and frequency scale with a fixed optical path and a low-absorption medium. The short-range reference cavity is preferably stable within a range of two degrees above and below room temperature, and the outer shell is made of environmentally resistant material. Thermal drift is checked quarterly. When the source strength jitter and scale drift of the reference simultaneously meet the standards, the three types of sub-bands and the reference status in the current window are declared usable and considered as a valid benchmark.
[0025] To facilitate reproduction, the on-site standard is to use a container wall thickness range of 3 to 8 millimeters, an ambient relative humidity range of 30 to 85 percent, and an ambient temperature range of 5 to 45 degrees Celsius. The observation window length is set at 2 to 5 seconds, and the number of frames in the current window is automatically determined according to the rhythm. The reference stability is quantified by the median and quantile expansion of the amplitude difference between frames within the steady-state segment. The source strength jitter threshold is no higher than 0.3 dB. Frequency scale drift is characterized by the center frequency shift, and the threshold is no higher than 5 MHz. The above thresholds are derived from the factory calibration and quarterly review table. They cannot be relaxed during online operation and can only be strictly enforced. The separation is characterized by the ratio of the center spacing of the two types of sub-bands to their respective bandwidths. The threshold is that the center spacing is not less than one times the bandwidth, and the separation is considered sufficient if the proportion of qualified frames in the current window is not less than 90%. This proportion is calculated on a frame-by-frame basis and is only counted within the current observation window. It is recalculated when the window is scrolled and is not accumulated across windows. If the proportion of missing frames in the steady-state segment exceeds 5%, a benchmark is not established and the previous version is rolled back, and the reason is recorded.
[0026] To facilitate traceability and reuse, the results obtained through the criteria are organized into observation benchmark blocks, which include the center and bandwidth of three types of sub-bands, reference qualification status, sampling rhythm and time boundary. These are appended to the local machine in the form of key-value sets and stored in an unoverwriteable appending manner, with a version number and generation time added. The version number adopts the format of year, month, day, hour, minute, second plus sequence number, and the timestamp precision is milliseconds. The deviation from the standard time is recorded synchronously, and automatic verification is triggered when the deviation exceeds the limit.
[0027] To reduce cross-process copying overhead, the observation benchmark block is issued a read-only handle and transmitted to subsequent processes via a local shared channel. Reading is read-only access; in case of congestion or handle failure, up to three retries are made at intervals of one second, two seconds, and four seconds. If still unsuccessful, a forced switch back to the previous valid version is made, and the time of failure, the version involved, the device number, and the container batch number are written into an unoverwriteable append-only storage. The end-to-end latency of benchmark establishment is controlled within one second. Multi-subband spectral analysis can be performed in parallel at the subband granularity. Lightweight constraints are imposed on the resource side, with single-core computing power consumption not exceeding half and memory consumption not exceeding one-tenth of the local capacity. A snapshot of the resources at that time is written into the block to locate potential sources of drift. The validity period of the observation benchmark block is set to five minutes, or it may expire prematurely if either temperature or humidity exceeds a preset threshold. It is automatically renewed once before expiration. If renewal fails, it is re-applied according to a backoff rhythm of one second, two seconds, and four seconds.
[0028] To improve feasibility and repeatability, the following frequency band recommendations are provided: one humidity anchor point subband near 0.3 and 0.5 terahertz, one cleanliness window subband near 0.4 and 0.6 terahertz, and one stripe detection subband near 0.4 and 0.5 terahertz. These locations are not rigid restrictions. When encountering different altitudes, seasons, or container batches, minor adjustments can be made in the vicinity of these locations. The adjustment range should not exceed one-tenth of the bandwidth in a single instance, and the cumulative adjustment should not exceed five times. If this is exceeded, a re-screening will be triggered, and the old version will be archived. If the field model is uniform and the conditions are stable, the accepted three types of subbands for the same type of container can also be retrieved from the offline calibration library as the starting version. The starting version must pass the consistency review within the first observation window. If the review fails, it will return to the online adaptive screening until it passes.
[0029] After each successful setup, a short-cycle consistency check is immediately performed. The setup is repeated twice without changing the geometry and environment, comparing the center and bandwidth of the three sub-bands, as well as the reference stability and rhythm records. Differences must all fall within a pre-defined narrow threshold for the version to be marked as reusable. If any exceeds the limit, the old version is used and the process is retried in the next short window. The specific definition of stability is fixed as the stricter of the percentile interval or variance of the current window's liquid level sequence. The threshold is set according to the established on-site thresholds; liquid levels cannot be released externally if stability does not meet the standard. Regarding safety and compliance, radiated power density and leakage are performed according to the equipment nameplate and on-site procedures. The machine head's direct line of sight distance, angle offset, and personnel prompting strategies are automatically retested and recorded after each drum change, according to the aforementioned geometric constraints.
[0030] All traces uniformly include the generator identifier, approver identifier, device number, container number, environment overview, time range, rhythm, threshold, criterion, conclusion, and checksum. Reference relationships are established in pairs using version number and timestamp. Any overwriting operations are prohibited. All changes generate a new version and solidify the reason for the change and approval information. When the reference fluctuation or scale drift approaches the threshold but does not exceed the limit, the current version is still usable but marked as an observation state and refreshed first in the next short window. When the window's missing frame ratio exceeds the threshold, a baseline is not established and a rollback is implemented. At the same time, a prompt record is pushed, including the time range, missing frame ratio, suspected cause, and suggested actions.
[0031] S2. Humidity Suppression: Extract absorption intensity and center drift in the anchor subband, construct baseline regression and map it to the remaining subbands, correct echo amplitude and group delay. Specifically, this is implemented as follows: After establishing the observation baseline, a humidity suppression process was immediately implemented on-site. This aimed to isolate the spectral baseline drift caused by air moisture and the subtle fluctuations in the emission source intensity from the observed data, ensuring comparability and traceability of readings across different time windows. The system reads the absorption intensity and its drift relative to the center position of the previous steady-state segment at the humidity anchor point sub-band, while simultaneously acquiring source intensity changes in the short-range reference cavity as an instrument-side stability indicator. The names used are frame number, timestamp, frequency, amplitude, and phase, with units of milliseconds, gigahertz, and decibels, respectively. The frame rate is preferably around twenty frames per second, and the timestamp jitter should not exceed one-hundredth of a frame period.
[0032] Before entering the calculation, the time and frequency scales are aligned, and the background is estimated using the steady-state segment. Then, occasional missing frames are filled in according to the proximity principle. To avoid individual abrupt changes pulling the fit, the system performs short-window robust estimation on the two types of indicators. The window length is preferably three seconds. Outliers are suppressed by endpoint protection and soft threshold limiting, and the limited markers are retained for review. The center frequency of the humidity anchor sub-band is preferably set near 0.3 and 0.5 terahertz, respectively, with a single-band bandwidth of 1 to 3 gigahertz. The clean window sub-bands are each 2 to 5 gigahertz. The stripe detection sub-band is 1 to 2 gigahertz. The center of the three types of sub-bands can be fine-tuned within 2%, with a single fine-tuning step size of 200 to 500 megahertz. When the overall shift of the field absorption line exceeds this upper limit, the observation benchmark verification is triggered.
[0033] The short-range reference cavity preferably uses a low-loss medium, and the material can be polytetrafluoroethylene or quartz, with an equivalent optical path of 30 to 80 mm and a group delay drift with temperature not exceeding 5 picoseconds per degree Celsius. The center position of the humidity anchor point is determined by the point of maximum slope of the rising edge within the sub-band; when the absorption depth is below 1 to 2 dB for 3 to 5 seconds, the anchor point is considered temporarily unusable, and a conservative strategy is entered to prevent miscalibration. This means that the system switches to steady-state protection configuration when any of the trigger conditions are met. Trigger conditions include: the new version of baseline regression does not meet the preset improvement criteria; stripe template reconstruction is incomplete; stripe template projection residue remains above the threshold; the low confidence percentage of interface discrimination within the observation window exceeds the limit; either the temperature channel or the humidity channel loses connection; and timing drift exceeds the limit. Upon entering this state, the system performs the following fixed actions: maintains the baseline regression, stripe template, and discrimination threshold of the previous stable version; pauses parameter updates; reduces the fusion weight step size to a low level and enables liquid level holding; limits the self-calibration trigger frequency; generates a conservative flag and records it in an increment-only manner. The exit condition is that two consecutive observation windows meet the preset improvement criteria and pass the consistency review. The regression construction uses the strength and center drift of two anchor points to form a piecewise monotonic interpolation table to obtain the amplitude and group delay correction coefficients. Linear extrapolation is allowed within the center frequency of adjacent clean window sub-bands; the extrapolation stops when it reaches the boundary. Several reference frequencies are simultaneously set within the clean window sub-band, with three to five in each sub-band, and the frequency interval is not less than 200 to 500 MHz. The allowable drift of the reference frequencies does not exceed one percent of the sub-band bandwidth.
[0034] Whether a correction is effective is determined by two tests: first, the residual at the reference frequency point of the clean window subband before and after correction is no higher than 0.3 dB; second, the decrease in the background fluctuation variance of the clean window subband within the window is no less than 30%. Both tests must be met consecutively for 20 to 50 frames for the new version generated in the current window to be considered valid. If neither is met, the previous stable version is retained and the failure count is incremented once; previously published frames are not retroactively modified. The system packages the parameters into a baseline regression block, including a timestamp, observation baseline version number, regression parameter summary, applicable subband set, residual and variance statistics, validity period indication, and construction window range. This block is written to the local persistent area in an unoverwriteable append-only manner, with the number incrementing sequentially over time without overwriting history. Each frame includes a current regression version identifier for subsequent steps to read and forms a continuous record in the evidence chain log.
[0035] The calculation delay should ideally not exceed half a second. If the current window is excessively disturbed, causing a timeout, the integrity of the frame-level timing should be prioritized, and the result of this version should be postponed to subsequent frames without rewriting the previous version. If the calculation fails consecutively, the waiting time should be gradually extended according to the backoff strategy: the first failure should be postponed by one window, the second failure by two windows, and from the third failure onwards, a doubling backoff should be used, with the total backoff time not exceeding ten seconds. The number of failures and the reasons should be written into the evidence chain. When the indicator value continuously exceeds the limit or the stability of the short-range reference cavity falls below the threshold, the new version should be paused, the status should be marked as unstable, and an observation benchmark review should be initiated upstream to request reconfirmation of the three types of sub-bands and the reference status. During the pause phase, the correction coefficient of the most recent stable value should be maintained, and the time constant of liquid level fusion should be increased to three to five times the original value. The release frequency should be reduced to once every three seconds to avoid large jumps in readings. The external liquid level release cycle is set to three seconds, while the internal acquisition rhythm and calculation process remain unchanged. A liquid level block is encapsulated and released once every three-second cycle. If no releaseable liquid level is formed within the cycle, the most recent qualified liquid level is released and a delay mark is added. After two consecutive release cycles meet the stability and confidence standards, the normal release frequency is automatically restored. The above release records are written into the evidence chain in an incremental manner and associated with the current version identifier.
[0036] Synchronous solidification of coupling caliber with downstream components: Stripe cancellation should complete template reconstruction within three to five frames after receiving notification of regression version changes. If not completed, a conservative threshold is used, and the conservative strategy lasts no more than thirty seconds. Interface discrimination uses a weighted judgment during the conservative period to maintain caliber stability. Stripe template blocks and label blocks are deduplicated using a version number and timestamp joint key when referencing regression versions. Out-of-order arrivals are recombined by timestamp within the window boundary, and idempotency is based on the joint key. When resources are limited, a small number of candidate regressions are allowed to be built in parallel within the same window, and the best one is selected in the end to prevent a single candidate from being pulled by instantaneous disturbances. The number of parallel processes is limited by computing power and memory, and the best one should not exceed the number of sub-bands. The overall goal of end-to-end latency is no more than three seconds, and the budget for this step accounts for about half a second of that. When the network is interrupted for a short time, three minutes of data can be cached locally, and the evidence chain log is retained for the most recent seven days. The installation distance error from the machine head to the barrel wall is no more than two millimeters, and the incident angle tolerance of the short-range reference cavity is no more than one degree.
[0037] In a representative scenario, with a room temperature of approximately 20 degrees Celsius and a relative humidity of approximately 60%, the system operates at a rhythm of 20 frames per second, completing robust statistical analysis of the indicated values within a three-second window. The new version's residual mean in the clean window band falls between 0.1 and 0.3 dB, with a background variance reduction rate between 30% and 50%. The latency from generation to effectiveness is approximately 200 to 400 milliseconds. During this period, a rapid increase in humidity occurred, but the reference remained stable. The system reconstructed regression and refreshed the version in the next window. The stripe template was updated on schedule after notification, and the confidence fluctuation of the interface judgment remained within an acceptable range. The reference frequency refers to the fixed set of frequency points within the clean window band used to determine residuals and variance; the window refers to the set of continuous frames used for statistics and decision-making; the backoff strategy refers to the timing rules for delaying reconstruction according to a preset sequence to avoid jitter in the event of consecutive failures; the signature and verification of the evidence chain uses a fixed-length message digest method, without writing any personally identifiable information.
[0038] S3. Fringe Cancellation: By alternating sampling with micro-angle switching and cross-polarization, the fringe optical path and phase are estimated. A fringe template is generated in the probe sub-band and canceled across the band. The specific implementation is as follows: With the prior observation benchmark and baseline regression already in effect, to remove interference fringes caused by multiple reflections from the container wall at their source, on-site sampling was conducted alternately using two sets of small incident angles and two mutually perpendicular polarization states. The angle step size was preferably two orders of magnitude, and the polarization was synchronously switched according to the state position within each frame. The receiver head was used to display a unified timestamp and frequency scale for the four observations on the same time scale, and the steady-state segment of the short-range reference cavity was used to ballast the amplitude baseline. The installation distance between the receiver head and the container wall was preferably 20 to 40 centimeters, with an assembly tolerance of no more than 5 millimeters. The maximum sway angle of the angle microstepping mechanism was no more than 5 degrees, and the repeatability was preferably no worse than 0.2 degrees. After installation, the angle zero point and distance scale were checked once on the reference plate using the steady-state segment of the short-range reference cavity, and recorded in the chain of evidence.
[0039] After the four observations are buffered, time and frequency alignment is performed first. Several subframes corresponding to the switching instant are either windowed or directly removed to make the data from each channel comparable at the same frequency point. Then, the components that fluctuate periodically with frequency are extracted from the stripe detection sub-band, and the equivalent optical path and phase are estimated. The optical path is expressed in millimeters, and the phase is expressed in radians. The initial values are given according to the container material and wall thickness, and converged to the measured range in the field through several stable segments of tens of frames. To facilitate verification and maintenance, the construction and use of the stripe template are performed according to a table: the container material is registered as two types, polyethylene and polyester, with a default wall thickness of three to eight millimeters. The amplitude and phase conversion between the stripe detection sub-band and the cleaning window sub-band is managed according to the dispersion table of the corresponding material, and linear interpolation is used at the center frequencies at both ends. The version of the dispersion table is recorded as the source of the factory calibration library or the material dispersion data issued by an accredited testing institution. The calibration cycle is preferably once every six months, and an incremental verification is performed before cross-batch online. When the dispersion table version is updated, the stripe template is automatically reconstructed at the next evaluation point according to the new version.
[0040] Each template generation uses a basic observation window of fifty frames. Within this window, time and frequency alignment and transient rejection are performed for four-way observations. The estimated optical path and phase must fall within the feasible range of the material and wall thickness before being solidified into a template. Before solidification, the energy reduction ratio of the fringe-related frequency components is checked in the clean window sub-band. It must reach no less than 60%, and the amplitude of the residual peak must not exceed 10% of the average of the adjacent flat segments. Only when both criteria are met can the net spectrum and net echo be declared usable. The determination of the fringe-related frequency components uses the set of periodic peaks with the highest energy proportion in the fringe detector sub-band as the candidate set. The frequency interval between peaks in the set must be kept within a stable range. If the energy difference between any candidate peak and the adjacent flat segment is less than a predetermined ratio, it will not be included in the cancellation template. The template record includes the period, amplitude, phase relationship, applicable temperature and humidity range, and validity period, and provides an uncertainty score for subsequent weighting. The template validity period is capped at fifteen minutes. If the cumulative temperature change exceeds two degrees Celsius, or the cumulative relative humidity change exceeds five percentage points, or the container batch mark is changed, the template becomes invalid immediately and a conservative strategy is prioritized.
[0041] During operation, the total latency of angle and polarization switching should preferably not exceed 300 milliseconds. If the upper limit is exceeded, the system will automatically downgrade to a lightweight mode with fixed angle and alternating polarization to maintain the frame acquisition rhythm. When entering conservative mode, only the dominant cycle is suppressed, with the suppression depth not exceeding the predetermined upper limit and the continuous dwell time not less than a minimum window. The system can automatically exit when the window expires and the projection residual falls below the threshold. If the residual continues to rise within the window, the conservative mode will be extended by one window and recording will resume. If the container wall is affected by sudden temperature changes, mechanical collisions, or changes in the equivalent thickness due to water film on the inner wall, the projection residual of the template in the clean window zone will increase. When the residual is higher than the predetermined threshold for 30 consecutive frames, a mismatch is determined. The system will roll back to the previous stable template and only cancel the dominant cycle, while issuing an urgent reconstruction request to the self-calibration stage. After the environment stabilizes, the system will automatically resume full template cancellation.
[0042] Once a template is generated, it is written to local storage in an append-only manner, explicitly referencing the dependent observation benchmark version and baseline regression version. It also records the material dispersion table version, equivalent optical path, equivalent phase, applicable scope, validity period, generation window start and end frame numbers, energy reduction ratio, uncertainty, and degradation flag. Any new template does not overwrite an old template; traceability is achieved only through time and version relationships. Net spectra and net echoes are not copied; only read-only handles and template numbers are sent downstream, along with the frame number and timestamp, and a one-time checksum for quick consistency verification. Numbering and archiving follow a unified rule: template numbers consist of three segments—year, month, day, frame sequence, and template sequence—all with a fixed width and padded with zeros on the left. Version numbers correspond one-to-one with template numbers. The archive directory is layered by year and month, with container batch markings. File names within the directory include the template number and the generation window start and end frame numbers for easy retrieval by third-party auditors.
[0043] Upstream and downstream communication uses the frame number plus template number as a unique key, with the order guaranteed by a single master sequence. Duplicate requests directly return the previous result, and the idempotent deduplication strategy is implemented accordingly. If a single frame processing fails to complete within the specified time due to resource constraints, it will retry exponentially up to three times, with the cumulative waiting time not exceeding a preset limit. If it still fails to complete, it will switch to the previous stable template to continue providing services, and the delay, degradation status, and reasons will be written into the evidence chain. When the interface determines that the confidence level is low, it can request to maintain the current template; when the confidence level is stable, it can suggest extending the template's validity period. Based on this, this step will suspend updates or extend the validity period to the next evaluation point, and the decision and reasons will be written into the evidence chain. The evidence chain log is retained for at least one year, stored in a designated path using read-only archiving, and can be retrieved by version and time index. Any subsequent processing will be done by referencing the log.
[0044] To ensure safety and compliance, electromagnetic radiation power does not exceed relevant limits. Materials used in food and chemical facilities meet entry regulations in terms of cleanliness and explosion-proof rating. Angle microstepping and thin-film insertion / removal mechanisms are equipped with protective covers and travel limits. During maintenance, if someone approaches, the machine head will prompt them to maintain a safe distance. Records are kept without recording personal identification information. If space is limited or vibration is significant, making angle microstepping inconvenient, a controllable medium thin film can be connected in series at the machine head. By changing the film's orientation or insertion order, an equivalent optical path difference can be formed. The optical path and phase can also be calculated and a template constructed in the stripe detection sub-band, followed by cross-band projection and cancellation. This method has a slightly slower response during rapid changes in operating conditions but offers better maintainability. The applicable boundaries and reasons for selection are explicitly noted in the records. Through these continuous actions, stripe cancellation does not rely on temporary adjustments or transfer the problem to subsequent smoothing stages. Instead, it cleanly separates the periodic pseudo-signals introduced by the container wall in a quantifiable and traceable manner, allowing subsequent interface discrimination and liquid level fusion to operate on a clean observation surface. This results in more stable, faster, and easier-to-deliver field readings.
[0045] S4. Interface Discrimination: Calculate main lobe widening, in-band slope consistency, and group delay jitter rate to distinguish between liquid surface, foam, and wall-mounted water film, and provide confidence levels. Specific implementation details are as follows: After suppressing humidity and stripes to a controllable range on-site, the liquid level interpretation focuses on the two "clean channels": net spectrum and net echo. The system continuously receives net spectrum and net echo with frame number and timestamp at the same sampling rhythm as described above, while also carrying the current version markers of the observation benchmark, baseline regression, and stripe template. Within the same time scale, three parameters are used as criteria: main lobe broadening, in-band slope consistency, and group delay jitter rate, with units of picoseconds, dimensionless fractions from zero to one, and percentages, respectively. To avoid interference between different dimensions, scale normalization and consistency are first performed within a short window. The short window length is preferably one to three seconds, corresponding to several tens to several hundred frames. Within the window, outliers are robustly suppressed and background fluctuations are locked. Specifically, peaks are suppressed by truncating at the 95th percentile and combining a rule of three times the absolute deviation of the median before proceeding to frame-by-frame judgment.
[0046] The main lobe broadening is explicitly measured at half-width at half-maximum (HWHM), with the window length and sampling rhythm fixed at 20 frames per second and a 2-second observation window. In-band slope consistency is defined as taking fixed bandwidths on both sides of the center frequency of the clean window sub-band, scoring it according to intra-frame linearity and normalizing it to the range of zero to one. Group delay jitter rate is defined as the percentage of the root mean square difference in group delay between adjacent frames relative to the steady-state mean. Initial thresholds are given by offline calibration and pre-testing: main lobe broadening threshold of 8 to 15 picoseconds, default 10 picoseconds; in-band slope consistency not lower than 0.75%; group delay jitter rate not higher than 1%; confidence threshold default 0.8%. The system assigns one of three labels ("liquid surface," "foam," "wall-mounted water film") with a confidence level for each frame. When the confidence level is lower than the threshold, the frame is not included in subsequent fusion, and a request to maintain the current fringe template is sent upstream to avoid frequent template rewriting during low-confidence periods.
[0047] To prevent conflicting opinions in boundary conditions, a clear decision-making order is established: first, examine the main lobe widening; second, examine the in-band slope consistency; and finally, examine the group delay jitter rate. If strong evidence meets the first criterion, classify the case directly and record the second strongest evidence as is. If none of the three criteria meet the weak evidence threshold, mark the case as uncertain and reduce its weight using a conservative strategy. To enhance the separability of thin-film wall-mounted water films, polarization differential morphological characteristics are introduced as supplementary evidence without changing the primary criterion: when the group delay jitter rate falls between 0.5% and 1%, the main lobe broadening does not exceed the limit, and the polarization difference is significant for three consecutive frames in the thin-film indicator band, the confidence level of the wall-mounted water film is increased by 0.1 to 0.2%. The thin-film indicator band can be set as a band centered at 0.45 terahertz with a bandwidth of not less than 0.05 terahertz. The quantization difference threshold of the polarization difference is defined as a net echo energy difference of not less than one dB in the polarization channel for at least three consecutive frames. This measure only provides a weighting basis in case of conflict and does not replace the primary criterion.
[0048] Each judgment generates a tag record containing key elements such as frame number, timestamp, tag, confidence level, values of three features, benchmark version used, regression version and stripe template number, current judgment order, whether it is low confidence, and whether it is delayed release. This is appended chronologically and stored in an unwriteable append-only manner. To ensure idempotency and order consistency, the unique key of the record uses a combination of version number and frame number. Duplicate records are discarded. Frames not judged during version switching are judged in queue order, and out-of-order processing is prohibited. Records are transmitted to the downstream fusion stage via a local reliable message channel, which uses this information to select channels and assign weights. The message channel uses an acknowledgment mechanism with a downstream acknowledgment time limit of 100 milliseconds. If acknowledgment is not received within the time limit, the message is resent three times at 100-millisecond intervals. If still not acknowledged, the batch is marked as delayed release and written into the log. Upon reading the delay mark, the fusion stage automatically lowers the weight of the batch to control fluctuations in the external reporting.
[0049] To avoid increasing end-to-end latency, the single-frame processing latency for tag determination is capped at 30 milliseconds. If this is exceeded, the frame will be downgraded to a conservative tag, and a latency event record will be generated. Continuous low-confidence frames are triggered proportionally: if the proportion of low-confidence frames exceeds 30% within a two-second observation window, a threshold self-check will be initiated. This self-check only runs in the shadow version and does not rewrite historical records. The evaluation window for the shadow version is two to ten seconds, and both stability and consistency must be improved by at least 10% compared to the current version before approval for switching can be submitted. For ease of replication and comparison, representative geometry and hardware specifications are provided: working distance of 20 to 50 centimeters, incident angle of 0 to 5 degrees, container wall thickness of 3 to 8 millimeters; working sub-band center frequencies of 0.4 and 0.6 terahertz respectively, with a single bandwidth of not less than 0.05 terahertz; the head-mounted radiated power density is preferably not higher than 1 milliwatt per square centimeter, meeting on-site specification limits, and requiring an audible and visual warning to maintain a safe distance of at least 20 centimeters when personnel approach.
[0050] The conditions for triggering adaptive operation are clearly defined as a temperature change exceeding three degrees Celsius, a relative humidity change exceeding five percentage points, or a change in the medium formulation label. Upon any of these changes, a new threshold suggestion is retrieved and a trial run is conducted within a shadow period of two to ten seconds. If the label stability and the consistency rate with manual labeling both improve by more than 10% compared to the current state, the switch to the new version number will take effect. If these standards are not met, the old version will be rolled back and the trigger threshold increased to avoid frequent switching. Stability is controlled using two criteria: in the control segment with fixed posture and static liquid level, the label change rate in adjacent windows should not exceed five percent; the consistency rate with manual labeling should not be less than 90%, with at least 500 sample frames covering four states: dry, condensation, light foam, and medium foam, with at least 100 frames for each state; and the consistency between two independent labelers should not be less than 95%. If these standards are not met, the verification result will prevail, and discrepancies will be recorded.
[0051] To reduce the risk of false positives, the upstream stripe template and this module maintain a state linkage: once the residual energy percentage of the stripe-related frequency components within the clean window exceeds 10% of the baseline, template mismatch is determined, and the upstream module is requested to revert to the previous stable template and initiate reassessment. During this period, this module maintains conservative labeling and weighting until the upstream module provides a new template and the residual energy falls back below the threshold. If polarization switching cannot be performed on-site, an equivalent differential scheme using a dual-channel antenna can be used to construct the morphology for verification. If angular scanning is limited, a controllable dielectric sheet can be used to introduce an equivalent optical path difference, with the process and threshold remaining unchanged, only the differential source is clearly marked in the record.
[0052] Through the aforementioned coherent discrimination and recording mechanism, the three types of returns—liquid surface, foam, and wall-mounted water film—are stably separated under the same time scale and version system. The tag records are complete, the threshold sources are clear, the decision priority is explicit, and the handling of delays and low-confidence issues is traceable. This provides a verifiable basis for subsequent weight fusion and external release, while controlling easily overlooked threshold drift, boundary conflicts, and message delays within an interpretable range during field operation. A representative set of results can be used as a reference: at 20 frames per second, a 2-second observation window, moderate relative humidity, and with water present in the container... When slight bubbling occurs, the main lobe width remains around 10 picoseconds, the in-band slope consistency is higher than 0.8, and the group delay jitter rate is lower than 1%. The system stably provides a liquid surface label with a confidence level higher than 80%. When bubbling intensifies, the width continuously exceeds the predetermined threshold and is accompanied by a slow slope drift. The label turns into foam and the confidence level increases with the degree of width. When a thin layer of condensation appears on the inner wall and the overall liquid surface is stable, the group delay jitter rate falls into the micro-range, the polarization difference is significant in the thin layer frequency band for three consecutive frames, the label turns into a wall-mounted water film and is automatically downweighted to avoid treating the thin layer as the real interface.
[0053] The entire content is constrained by version locking and non-overwriteable appending methods. Any changes to parameters, thresholds, and rules are fixed in the new version. The old version cannot be rewritten and can only be referenced. This facilitates reproduction and provides clear, verifiable, and reproducible evidence during the review process.
[0054] S5, Liquid Level Fusion: Select the solution channel by label. The liquid surface is mapped using time delay, the foam is compensated for by broadening and slope, and the water film is suppressed by polarization difference. The equivalent static liquid level and stability are output through confidence-weighted recursion. The specific implementation is as follows: After generating the net spectrum and echo and providing three types of labels for liquid level, bubble layer, and thin water film, continuous actions are carried out with the goal of forming an equivalent static liquid level and stability usable in engineering: all geometric quantities are uniformly measured in millimeters and fall on the same scale. The quantity corresponding to the liquid level label comes from the main peak time delay. Based on the geometric relationship table and optical path conversion factor solidified at the time of delivery, it is converted into the height calculated from the container reference plane. The factor is related to the container diameter, the head mounting angle, and the shell optical path. Upon delivery, it is written into an unoverwriteable append method for storage and the version is locked. At the same time, a delivery record table of geometric conversion factors is formed. The table header includes the container model, mounting angle, head distance from the wall, optical path factor, expiration date, and approver. It is locked upon delivery and can only be added to, not modified.
[0055] The quantity corresponding to the bubble layer label is given by the linkage characteristics of the main lobe widening and the absorption slope within the clean window band. First, the corresponding range of widening and bubble layer thickness is defined with reference to the factory bubble layer response table. Then, the overshoot is suppressed by the slow change in slope, and the actual interface is backtracked from the segment covered by the bubble layer. The quantity corresponding to the thin water film label is taken from the conservative quantity after polarization difference suppression. When the water film attached to the wall exists, it does not strongly pursue the mirror feature, but selects the polarization channel with slower change and holds it for a short period of time to avoid reading jumps. Before the three types of quantities enter the fusion, they are unified to the same scale and the boundary is clipped. The upper and lower limits of the clipping are bound to the container structure. The boundary from the bottom of the container to the nominal full position is a hard boundary. Values that exceed the boundary are edged and marked. Such segments are not included in the subsequent stability statistics. For example, for a common type of plastic container, the structural distance from the bottom to the full position is about 800 mm. The reasonableness of the edge-attaching behavior can be checked on site based on this.
[0056] The system operates continuously on a frame-level rhythm, with the window adapting to the scene: a short window is used when fluctuations are significant, and the time constant is automatically extended during stable phases. Weights are allocated by upstream confidence and are constrained by step size and a freeze mechanism. Each adjustment does not exceed one-fifth of the current weight, and a two-second freeze is performed after each adjustment. If a label is reclassified during the freeze period, the freeze is completed before the next adjustment to prevent oscillations. The statistical caliber for stability is uniformly calculated as half of the upper and lower quartile differences of the liquid level sequence within the observation window. A three-second window is used by default, and the system can be published when the score is below one millimeter. When short-term fluctuations intensify, the short window can be shortened to one second. When the scores of three consecutive short windows are all less than one millimeter, the three-second window is restored. Window switching is performed using a threshold plus hysteresis method, for example, the hysteresis is taken as one-tenth of the threshold range to avoid back-and-forth jitter.
[0057] The published content is organized into level blocks, including equivalent static level, stability, channel weights, publication flag, upstream version number, and local temperature and humidity snapshot. It is written to local storage using an append-only key-value set method that prevents overwriting, and pushed to the field display and upper-level system via a local message channel. Status fields within the level blocks use enumerated values, such as the corresponding indicator light or prompt for "restricted service," limited to normal, downgraded, rollback, holding, and self-calibration request, ensuring consistent presentation across all ports. Level blocks that fail to be written or pushed on time are not recalculated but reissued in the next frame, using the frame number plus version number as a unique key to ensure idempotency and order. The local clock is aligned with the reference every ten minutes, with a drift of no more than ten milliseconds, ensuring consistency in window calculations and latency statistics across publications.
[0058] The end-to-end delay is calculated from the time the self-cleaning echo is ready, preferably not exceeding three seconds; frame-level parallelism is advanced at the single-frame granularity, allowing no more than three frames of discontinuous loss, after which the frequency is reduced and a report is issued. To suppress weight oscillations and misjudgment propagation, when the confidence level of any channel is below 50% for five consecutive frames, the system enters a conservative configuration: the bubble layer compensation weight is reduced to a low level, the polarization differential channel weight is increased to a medium level, and the liquid level that most recently met the release conditions is released as the holding value, with a holding time not exceeding ten seconds; if the situation does not improve after this period, the frequency is automatically reduced to one frame every three seconds and an application is sent to the self-calibration module to request a reassessment of baseline regression, fringe template, and discrimination threshold; if self-calibration is not completed, the parameters of the previous stable version are used, and the field status is marked as limited service.
[0059] The trigger for downgrade is based on a two-tier threshold. Downgrade occurs if stability fails to meet the standard for ten consecutive seconds, or if the weight is adjusted more than three times within ten seconds without convergence. The execution order of downgrade, rollback, holding, and self-calibration requests is fixed as follows: downgrade first, then rollback, then holding, and finally self-calibration. The start and end of each step are recorded in a status field in the liquid level block for traceability. To ensure that others can replicate the process in the same way at different locations, the on-site calibration procedure for the optical path coefficient is as follows: use clean water as the calibration medium, affix scales at three locations (low, middle, and high), sample at each location for at least thirty seconds, repeat three times, and generate the optical path coefficient for this scenario after balancing the three locations. An average deviation of no more than two millimeters is considered acceptable. If the container is changed after installation, or the installation angle of the head deviates by more than one degree, or the distance between the head and the wall changes by more than five millimeters, the same procedure must be followed to recalibrate and generate a new version.
[0060] Installation tolerances are given within the following allowable ranges upon delivery: distance error from the machine head to the wall not exceeding 5 mm, installation angle error not exceeding 1 degree, and container positioning error not exceeding 5 mm. If any deviations are found during on-site inspection, publication is immediately prohibited, and a reset or re-labeling prompt is given. Re-labeling is only permitted after successful re-labeling. The generation diameters of the bubble layer and thin water film are specified in the examples: the stirring speed can be set to 100 to 300 revolutions per minute for 30 to 60 seconds; the spray nozzle diameter can be set to 0.3 to 1 mm, and the flow rate to 0.1 to 0.5 liters per minute, to reproduce the bubble layer height and water film thickness required for the experiment. The confidence level is publicly defined as a closed interval from 0 to 1, with a minimum change granularity of 1%. Higher consistency among the three features results in higher confidence, and vice versa. Monotonicity is strictly maintained, and the algorithm name is not mentioned.
[0061] The self-calibration and degradation requests in this section are aligned. The self-calibration section explicitly declares acceptance of degradation requests as one of the triggering conditions. Convergence criteria can be set as follows: stability recovers to less than one millimeter within ten seconds and remains continuously qualified; the residual energy of the stripes decreases by more than 50%. If both conditions are met simultaneously, convergence is declared and restricted service is lifted. The numerical boundaries of each field in the level block are also fixed: stability is a non-negative decimal in millimeters; weights are closed intervals from zero to one, and the sum of the weights of the three channels is one; the status field only allows the aforementioned enumerated values; the timestamp is a millisecond-level local time with a version number. The reference source for clock alignment can be set to the plant's internal timing server or a BeiDou timing gateway. If alignment fails and drift exceeds twenty milliseconds, the system enters degradation and issues an alarm, while simultaneously reducing the release frequency to maintain timing consistency. Resource usage is subject to hard constraints: on a given platform, processor usage cannot exceed 50%, memory usage cannot exceed 500 MB, and daily storage updates cannot exceed 500 MB; exceeding these limits will first reduce the frame rate to 10 frames per second and delay the release; if the limits are continuously exceeded, self-calibration will be paused and an on-site prompt will be given to clean up space or upgrade hardware. Factory bubble layer response tables are managed by version number, and the version used and the generation time are referenced in the evidence chain to ensure traceability.
[0062] For compliance boundaries involving food and chemical sites, relevant national or industry standards apply. Equipment certificates and test reports are archived, and the display reminds personnel to maintain a safe distance of at least 50 centimeters from the machine head. The upper-level system is read-only; parameter adjustments require maintenance permissions and confirmation on the local machine, with the confirmation action and result written into the evidence chain. Thus, the physical quantities, geometric conversion relationships, windows and thresholds, weight adjustments, downgrade rollback and holding, message passing and deduplication, clock alignment and resource constraints, version locking and evidence chain traceability, as well as the boundaries of safety and compliance, corresponding to the three types of labels, are further solidified. Third parties can replicate within the established boundaries and obtain equivalent static liquid levels and stability with consistent caliber, forming a self-consistent closed loop with self-calibration triggering and convergence criteria.
[0063] S6. Self-calibration traceability: Monitor changes in temperature, humidity, and formulation; reassess baseline regression, stripe template, and threshold; update parameters and write them to the evidence chain log. Specific implementation details are as follows: To ensure that the device provides stable and traceable readings even during seasonal changes and batch variations of media, the system prioritizes self-calibration and measurement as core capabilities: It continuously collects temperature, relative humidity, media formulation markings, and container batch markings at a rate of at least three times per minute. Time alignment and unit standardization are performed first, followed by short-window smoothing to suppress spikes. The source, time, and measurement point number are recorded for traceability. The timestamps are derived from the local reference clock, with a day-night drift controlled to no more than five parts per million. The preferred resolution for the on-site temperature and humidity channels is 0.1% relative humidity and 0.1 degrees Celsius temperature. A weekly comparison calibration is performed.
[0064] Trigger values are uniformly de-jittered, and a trigger is only established after two consecutive threshold crossings, with a maximum of three de-jitter attempts allowed. Threshold levels are related to container material, wall thickness, ventilation conditions, and the water content characteristics of the formula. A trigger is qualified when the cumulative change in relative humidity reaches approximately 5%, the cumulative change in temperature reaches approximately 3 degrees Celsius, or there is a single switch in either the formula label or the container batch. The threshold is automatically fine-tuned before and after seasonal changes to avoid back-and-forth jitter. After a trigger is established, the system enters a calibration state, temporarily reducing the external release frequency to allow for stabilization time. Within the default 30-second observation window, the baseline relationship between the humidity anchor point and the short-range reference cavity is reassessed, generating new amplitude and group delay correction coefficients. The fringe optical path and phase are remeasured in the fringe sensitive sub-band, a new template is constructed, and convergence is verified by small-scale projection on the clean window sub-band. The three thresholds used in the interface discrimination—main lobe broadening, in-band slope consistency, and group delay jitter rate—are reviewed to ensure they align with the current foam and wall-mounted water film performance.
[0065] The reference "stability" is measured by the intensity fluctuation amplitude and time drift rate over a ten-frame short window. The former is controlled within a decibel level, and the latter is less than one percent per minute to be considered stable. Stripe template "mismatch" is defined as the residual component after template projection exceeding 50% of the baseline within two consecutive windows. If mismatch is determined, the system reverts to the previous stable version and lowers the stripe suppression intensity by one level, with three intensity levels. Switching to new parameters follows clear improvement thresholds: a decrease of at least 30% in background variance during the cleaning window, a decrease of at least 40% in stripe-related component energy, and a liquid level stability within the preset range within ten seconds. Meeting two of these three criteria is sufficient for the system to take effect. If the initial criteria are not met, the observation window is extended for reassessment. If the criteria are still not met, the calibration is marked as failed and rolled back, while the trigger threshold is temporarily raised by one level to avoid frequent triggering. The stability range is defined as the fluctuation amplitude of the equivalent static liquid level within a ten-second time window not exceeding one millimeter. The judgment order is: first, stability; then, background variance and stripe energy; and finally, single-point error.
[0066] The entire process is subject to strict time and resource constraints: each trigger and confirmation should not exceed half a minute; broadcasting and switching should use a local reliable channel, with a timeout of two seconds and a maximum of three retransmissions; the only ordering rule is a monotonically increasing version number, and the receiving end should discard any lower or same version received to maintain idempotency; active calibration should not exceed three times per hour; computational usage should not exceed half of the single-core processing capacity, and memory usage should temporarily not exceed 20% of the normal level. Each calibration generates a complete chain of evidence, with fields including at least the trigger quantity name and value, old version number, new version number, effective time, difference statistics, approval mark, container batch and formula mark, and machine head number. These are stored in a fixed format: the timestamp is a 17-digit string, concatenated continuously without separators in the order of "year (4 digits), month (2 digits), day (2 digits), hour (2 digits), minute (2 digits), second (2 digits), and millisecond (3 digits); any missing digits are padded with zeros on the left (e.g., January 4, 2025, 09:05:30:123 milliseconds → 20250104090530123); the version number is a 10-digit number; the handle and validity period are fixed-length text; and the checksum is a 32-digit hexadecimal number. All records are written in chronological order and cannot be overwritten. Records are stored locally for at least one year, archived monthly, and encrypted and synchronized remotely weekly. Records can only be referenced and cannot be modified.
[0067] To ensure consistency between upstream and downstream systems, the baseline regression version, stripe template number, and discrimination threshold number will be broadcast uniformly after taking effect. The front-end and upper-level systems only need to follow the latest version number to maintain consistency. If manual review is required on-site, the central control unit can approve it first, and the device can complete the calculation and difference statistics first. After receiving the approval instruction, it will switch to the next stable window, maintaining the old version's steady-state release during this period. The applicable boundaries are clearly stated: This method is for polyethylene or polyester containers with a wall thickness of three to eight millimeters under normal conditions, with a limit not exceeding one centimeter; the medium is a water-based system. If it is a strongly absorbing non-water-based system or the container is metal, it will not enter the self-calibration process, and the previous stable version will be used with a reminder for manual intervention; if the humidity channel is continuously disconnected for more than two minutes, it will enter a conservative mode that is only usable for reference, suspend frequent template reconstruction, and prioritize maintaining the stability of the external caliber.
[0068] For on-site control, it is recommended to cover both low-temperature and low-humidity conditions and high-temperature and high-humidity conditions, with a sample size of no less than 200 frames for each condition. For container wall thickness, one container each with 3mm and 8mm walls should be selected; for color, one container each with a natural and dark color; and for surface treatment, one container each with a smooth and matte finish. The medium formulation should be batch-marked. Foam can be formed through mechanical agitation, continuing for several minutes until a thickness of millimeters is achieved before testing. Safety and interlocking boundaries are also strictly enforced: if personnel approach within 30cm or the radiation power deviates from the set value during calibration, the system will immediately engage the interlock and pause calibration. Personnel must move away and remain within two seconds before the interlock is automatically released and the process resumes. All actions must comply with on-site explosion-proof and cleanliness requirements.
[0069] The minimum configuration and geometric diameter of the receiver head are given as representative ranges: the axial spacing between the transmitting and receiving units is in the centimeter range, the default incident angle range is about ten degrees, the small step switching is about two degrees, the short-range reference cavity uses a stable medium and a high extinction inner wall, the optical path tolerance is controlled in the millimeter range, and sufficient isolation is maintained from the measurement channel. Default parameters are fixed in the device as a form, including the observation window length, number of de-jitter counts, trigger threshold levels, suppression intensity levels, broadcast timeout and retransmission counts, resource limits, etc., which can only be rewritten through the controlled interface. Rewriting immediately generates a new version and writes it into the evidence chain; the read and write order adopts a single master sequence, and deduplication is achieved by a unique key composed of version number and frame number, and duplicate records are directly discarded.
[0070] Through the above constraints and specifications, regardless of changes in humidity between winter and summer, slight fluctuations in the water content of the medium, or batch changes in the container wall material, the device can quickly re-establish the reference system, aligning the baseline, stripes, and discrimination thresholds to the current environment, and maintaining a stable equivalent static liquid level and clear stability indicators externally. If any step fails to meet the predetermined improvement threshold, the system prioritizes protecting the published specifications and traceability, rolls back to the known valid version, and fully incorporates the key points that need on-site attention into the evidence chain, facilitating closed-loop processing according to the established procedures.
[0071] All calculations involved in the embodiments are dimensionless numerical calculations, and the preset parameters and thresholds in the calculations are set by those skilled in the art according to the actual situation.
[0072] It should be noted that this invention can be deployed on the device itself to realize embedded applications, or it can run on a PC or other terminal with a user interface, thereby meeting various hardware environments and usage requirements.
[0073] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wireless or wired transmission; wired transmission methods include optical fiber, twisted pair, coaxial cable, etc.; wireless transmission includes infrared, microwave, etc. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center containing one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.
[0074] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0075] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.
[0076] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0077] In addition, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.
[0078] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion 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 this application. 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.
[0079] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0080] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A liquid level intelligent detection method based on terahertz spectral characteristics, characterized in that, include: S1. Establish observation benchmarks: Select humidity anchor point sub-band, clean window sub-band, and stripe detection sub-band in the terahertz frequency band, and activate the short-range reference cavity to form a dual baseline; S2. Humidity suppression: Extract absorption intensity and center drift in the anchor subband, construct baseline regression and map it to the remaining subbands, and correct echo amplitude and group delay. S3, fringe cancellation: By alternating sampling with micro-angle switching and cross-polarization, the fringe optical path and phase are estimated, and a fringe template is generated in the probe sub-band and canceled across the band. S4. Interface discrimination: Calculate the main lobe widening, in-band slope consistency and group delay jitter rate, distinguish between liquid surface, foam and water film adhering to the wall and give the confidence level. S5, Liquid Level Fusion: Select the solution channel by label, use time delay mapping for liquid surface, use broadening and slope compensation for foam, use polarization difference suppression for water film, and output the equivalent static liquid level and stability through confidence weighted recursion. S6. Self-calibration traceability: Monitor temperature, humidity and formula changes, reassess baseline regression, stripe template and threshold, update parameters and write to the evidence chain log.
2. The intelligent liquid level detection method based on terahertz spectral characteristics according to claim 1, characterized in that, S1 includes: In the terahertz band, a step search is used to determine the humidity anchor point sub-band, the clean window sub-band, and the stripe detection sub-band; When the spectral coverage of two subbands overlaps, the subband to be retained is determined in the following order: clean window subband first, stripe detection subband second, and humidity anchor point subband last. The intensity and frequency scale of the emission source are calibrated using a short-range reference cavity; When the three types of subbands meet the preset separation conditions and the short-range reference cavity meets the preset stability conditions, an observation benchmark is generated and used as a unified reference for subsequent steps. If any of the following occurs: environmental parameters exceed a preset threshold or the observation benchmark expires, the observation benchmark is determined to be invalid and a step search is re-executed to update the observation benchmark.
3. The intelligent liquid level detection method based on terahertz spectral characteristics according to claim 1, characterized in that, S2 include: After establishing the observation benchmark, the absorption intensity and center drift are extracted from the humidity anchor point sub-band, and the source intensity change is obtained from the short-range reference cavity; Short-window robust estimation, time and frequency alignment, and background subtraction are performed on the indicator, and baseline regression is constructed to obtain amplitude correction coefficients and group delay correction coefficients. The correction coefficients are mapped to the clean window subband and the stripe detector subband and applied at the reference frequency. When the residual of the cleaning window band and the background fluctuation meet the preset threshold, a baseline regression block with a version identifier is generated and provided to subsequent steps along with the frame number. The stripe cancellation module reconstructs the template accordingly. If the template reconstruction is not completed, a conservative strategy is activated and the previous stable template is maintained. The interface determines that the weight is reduced during the conservative period.
4. The intelligent liquid level detection method based on terahertz spectral characteristics according to claim 1, characterized in that, S3 include: In the terahertz band, small incident angle switching and alternating sampling with mutual orthogonal polarization are implemented, and a short-range reference cavity is used to unify the time and frequency scales. Periodic fluctuation components are extracted from the fringe probe sub-band, the equivalent optical path and phase of the container wall interference are estimated, and a fringe template is generated. The template is mapped to the clean window band to perform cancellation. The instantaneous frames corresponding to angle and polarization switching are removed and do not participate in modeling and cancellation, resulting in net spectrum and net echo for interface discrimination and liquid level fusion.
5. The intelligent liquid level detection method based on terahertz spectral characteristics according to claim 4, characterized in that: The stripe template is version-managed based on the dispersion table of container material and wall thickness, and is associated with the observation benchmark version and baseline regression version. Before being put into use, the stripe-related frequency component energy decreases to the corresponding threshold and the residual peak value is lower than the corresponding threshold after the stripe is cleaned and verified. When the mapping residual continues to rise during operation and is identified as a mismatch, it reverts to the previous version template, suppresses only the main frequency stripe period and triggers template reconstruction. During reconstruction, a fixed incident angle is used and orthogonal polarization sampling is maintained to maintain the preset frame acquisition rhythm.
6. The intelligent liquid level detection method based on terahertz spectral characteristics according to claim 1, characterized in that, S4 include: After the observation benchmark, baseline regression and stripe cancellation take effect, the net spectrum and net echo with version marking are obtained at a unified time scale; Within a preset window, amplitude and phase normalization and consistency are completed. The main lobe broadening, in-band slope consistency, and group delay jitter rate are extracted. The liquid surface, foam, and wall-mounted water film are determined in the following decision order: broadening priority, slope consistency secondary, and group delay jitter rate secondary, and a confidence level is generated. When the confidence level is lower than a preset threshold, the frame is prevented from participating in the fusion process and the current stripe template is maintained. When consecutive frames in the thin-layer indicator band that meet the preset threshold polarization difference are detected, the confidence level of the wall-mounted water film is increased. The frame number, tag, confidence level, and version used are recorded in an append-only manner and made available for level fusion calls via a local message channel.
7. The intelligent liquid level detection method based on terahertz spectral characteristics according to claim 1, characterized in that, S5 include: After obtaining the net spectrum and net echo and completing the label determination of liquid surface, foam, and wall-mounted water film, the liquid surface channel, foam channel, and wall-mounted water film channel are activated respectively according to the label. The liquid level channel maps the time delay to the relative reference plane height according to the locked geometric conversion table; the foam channel back-calculates the real interface based on the main lobe widening and the slope of the cleaning window; and the wall-mounted water film channel obtains a conservative liquid level estimate based on polarization difference to suppress echo interference. The results of the three channels are clipped at the boundary under a unified scale and then recursively fused according to the confidence level. The fusion is set with weight step size limit and freezing strategy. Generate and append a level block containing equivalent static level, stability, channel weight, status flag field, and version identifier field, and publish it via the local message channel; When the confidence level remains below the threshold, it enters a conservative configuration, holds the most recent qualified liquid level, and sends a reassessment request to the self-calibration module.
8. The intelligent liquid level detection method based on terahertz spectral characteristics according to claim 1, characterized in that, S6 include: Set up a de-shaking trigger mechanism to continuously monitor temperature, relative humidity, media formulation markings, and container batch markings; When any monitored quantity reaches the preset trigger threshold, it enters the calibration state, reduces the frequency of external liquid level release within the preset observation window, re-estimates the baseline regression parameters of the humidity anchor point and the short-range reference cavity, reconstructs the stripe template of the stripe detection sub-band and projects it onto the clean window sub-band for verification, and verifies the interface discrimination threshold at the same time. Once the preset improvement criteria are met, the new parameters will be set as the effective version.
9. The intelligent liquid level detection method based on terahertz spectral characteristics according to claim 1, characterized in that: The effective version is locked by the version number and broadcast uniformly. The receiving side completes the switching in a monotonically increasing order of the version number and performs deduplication based on the unique identifier key formed by the combination of the version number and the frame number. If the preset improvement criteria are not met, the system will revert to the previous stable version and temporarily increase the trigger threshold. The self-calibration process and the version switching process will be recorded in the evidence chain in an unoverwriteable appending manner. When the temperature channel and humidity channel lose connection, it enters a conservative mode driven by a short-range reference cavity to maintain consistency between the external liquid level reporting frequency and the liquid level reading diameter.
Citation Information
Patent Citations
Non-contact measurement system and method for liquor level in closed container
CN113252142A
Photonics ultra-wideband terahertz frequency hopping source based on optical injection locking dynamic frequency selection
CN115459859A
Terahertz detection method and device and computer readable storage medium
CN116008220A
Terahertz transmission-based plastic pipe wall thickness testing method and device
CN119354075A
High-precision liquid level measuring device and method based on sweep frequency interference measurement
CN120445365A