Gas-liquid interface detection method based on sliding window slope characteristic

CN122835522APending Publication Date: 2026-09-29SICHUAN LAI BOYI AUTOMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611339234.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-01
Publication Date
2026-09-29

AI Technical Summary

Technical Problem

当前自动化液面检测技术主要包括电容式、压力式/阻抗式、光学式以及超声式等方法,但在实际临床应用过程中,样本在运输、离心及振荡混匀等操作后,往往在真实液面上方形成不同厚度的气泡层或泡沫层,这使得液面检测环境复杂化,对检测技术的准确性与稳定性提出了更高要求

Benefits of technology

本发明通过构建三重斜率联合判据机制,有效适配生物样本中气泡层干扰这一复杂应用场景。在液面检测过程中,同时对窗口首端斜率、尾端斜率以及窗口内逐点压力增量进行综合分析,从“穿刺进入-持续下行-末端稳定”三个连续阶段对压力变化特征进行立体刻画。该机制不仅能够识别探测针由气泡区进入液相的瞬时变化,还能够验证后续区段是否保持稳定液相特征,从多个维度对液面进行确认。针对气泡层中压力波动不稳定的特点,通过多条件互补约束,大幅降低将气泡层误判为真实液面的概率,从而显著提高液面检测的可靠性与准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122835522A_ABST
    Figure CN122835522A_ABST
Patent Text Reader

Abstract

This invention discloses a gas-liquid interface detection method based on the slope characteristics of a sliding window, belonging to the field of automated detection technology for in vitro medical diagnostics. The method includes the following steps: driving a blowing probe to move gradually into the test tube along the Z-axis, simultaneously acquiring pressure signals and probe tip position signals during the movement, forming corresponding pressure and position data sequences; processing the acquired pressure and position data sequences, arranging the position data according to their numerical values, and averaging the pressure data corresponding to the same position data to obtain a unique position sequence and its corresponding average pressure sequence. This invention uses a triple slope joint criterion to identify liquid phase characteristics from multiple dimensions of entry, continuous change, and stability, and combines point-by-point pressure increment constraints to eliminate bubble interference; it utilizes a sliding window and continuous clustering to achieve stable segment extraction, adapting to small-scale test tube detection, and is applicable to various biological sample types without relying on sample physical parameters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of automated detection technology for in vitro medical diagnostics, and more specifically to a gas-liquid interface detection method based on the slope characteristics of a sliding window. Background Technology

[0002] In the fields of medical testing and in vitro diagnostics, automated sample pretreatment systems require liquid level detection in biological samples (such as whole blood, serum, plasma, urine, and cerebrospinal fluid) in blood collection tubes or test tubes to precisely control the insertion depth of the sampling needle or dispensing needle, thereby avoiding sample cross-contamination or needle damage. Current automated liquid level detection technologies mainly include capacitive, pressure / impedance, optical, and ultrasonic methods. However, in actual clinical applications, after sample transport, centrifugation, and mixing, air bubbles or foam layers of varying thicknesses often form above the actual liquid surface. This complicates the liquid level detection environment and places higher demands on the accuracy and stability of the detection technology.

[0003] Existing liquid level detection methods all have significant limitations in scenarios with bubble interference: capacitive methods suffer from insignificant capacitance changes due to the much lower dielectric constant of bubbles compared to liquids, leading to missed or false detections; pressure-based or impedance-based methods typically rely on fixed thresholds, easily misidentifying bubbles as liquid levels when a bubble layer is present, causing the sampling needle to stop prematurely; optical methods are severely affected by bubbles, blood clots, lipemia, or turbidity changes in jaundice samples; and ultrasonic methods face difficulties in probe coupling due to the small diameter of the test tube, while the bubble layer causes strong acoustic impedance reflections, causing measurement results to deviate from the true liquid level. Under these limitations, automated sampling systems may experience insufficient sample volume, sample detection deviations, needle contamination, or even blockage. Therefore, there is an urgent need for a detection method that can accurately distinguish between a bubble layer and the true liquid level under bubble layer interference conditions.

[0004] The information disclosed in the background section is only intended to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0005] The purpose of this invention is to provide a gas-liquid interface detection method based on the slope characteristics of a sliding window, so as to solve the problems in the background art mentioned above.

[0006] To achieve the above objectives, the present invention provides the following technical solution: a gas-liquid interface detection method based on sliding window slope characteristics, comprising the following steps: The blowing probe is driven to move gradually into the test tube along the Z-axis. During the movement, pressure signals and probe tip position signals are acquired simultaneously to form corresponding pressure data and position data sequences. The acquired pressure and location data sequences are processed. The location data are arranged according to the numerical value, and the pressure data corresponding to the same location data are averaged to obtain a unique location sequence and its corresponding average pressure sequence. A fixed window size is used to slide point by point on the unique location sequence and the corresponding average pressure sequence. For the data in each window, the pressure change rate between the two adjacent points at the beginning of the window is calculated as the first slope, and the pressure change rate between the two adjacent points at the end of the window is calculated as the last slope. At the same time, the pressure increment of each adjacent sampling point in the window is calculated one pair at a time. For each window, the window with a slope at the beginning greater than the first threshold, a slope at the end greater than the second threshold, and a pressure increment at all adjacent sampling points within the window not less than the third threshold is determined as a qualified window that meets the liquid phase characteristics. Qualified windows that meet the liquid phase characteristics are merged into feature groups according to the continuity of their position indices. The starting position data corresponding to the starting window in the first feature group is selected as the position output of the liquid surface of the biological sample in the test tube.

[0007] The slope at the beginning of the window is calculated by the ratio of the pressure difference to the position difference between the first and second data points within the window. This slope is used to characterize the rate of pressure change when the probe moves from the bubble region into the liquid phase region, thereby detecting the initiation event of entering the liquid phase.

[0008] The slope at the end of the window is calculated by the ratio of the pressure difference to the position difference between the second-to-last data point and the last data point within the window. This slope is used to characterize the pressure change trend in the end region of the window and to verify whether the end of the window is in a stable liquid phase region.

[0009] The third threshold is the lower limit of the pressure increment between adjacent sampling points. The pressure increment is the pressure difference between adjacent sampling points. When the pressure increment of all adjacent sampling points within the window is not less than the third threshold, it is determined that the monotonically increasing condition is met, so as to exclude the unstable pressure region in the bubble layer in the test tube caused by bubble rupture and regeneration. The value range of the third threshold is 0-2 Pa.

[0010] The sliding window has a window size of 6-20 data points, corresponding to a spatial range of 3-10 mm when the sampling interval is 0.5 mm. This is used to improve the ability to suppress bubble interference while ensuring spatial resolution, and to adapt to the liquid column height range of biological sample tubes.

[0011] The first threshold value corresponding to the slope at the beginning is in the range of 5-25 Pa / mm, and the second threshold value corresponding to the slope at the end is in the range of 0.5-3 Pa / mm. The first threshold value is set to a smaller value for low-viscosity biological samples and a larger value for high-viscosity biological samples to balance detection sensitivity and anti-interference ability.

[0012] The sliding window moves point by point along the position sequence with a step size of 1, performing a full-range scan of the entire pressure-position data sequence to ensure the continuity and integrity of the liquid level detection process.

[0013] Qualified windows with consecutive indexes are grouped into feature groups, and each feature group corresponds to a continuous pressure change range that meets the characteristics of the liquid phase.

[0014] The starting position of the first qualified window in the first feature group is selected as the liquid surface position output, which is used to indicate the spatial position of the probe when it first enters the liquid phase region.

[0015] When multiple feature groups are detected, the position corresponding to the first feature group is taken as the main liquid surface position, and the remaining feature groups are used to assist in identifying the sample layer interface or sediment layer position.

[0016] The technical effects and advantages provided by the present invention in the above technical solution are as follows: This invention effectively adapts to the complex application scenario of bubble layer interference in biological samples by constructing a triple slope joint criterion mechanism. During liquid level detection, it comprehensively analyzes the slope at the beginning and end of the window, as well as the pressure increment at each point within the window, providing a three-dimensional characterization of pressure change characteristics from three consecutive stages: "puncture entry - continuous descent - terminal stabilization." This mechanism can not only identify the instantaneous changes in the probe as it enters the liquid phase from the bubble region, but also verify whether subsequent sections maintain stable liquid phase characteristics, confirming the liquid level from multiple dimensions. Addressing the unstable pressure fluctuations within the bubble layer, it significantly reduces the probability of misjudging the bubble layer as a real liquid level through complementary constraints under multiple conditions, thereby significantly improving the reliability and accuracy of liquid level detection.

[0017] This invention introduces a point-by-point pressure increment monotonicity check mechanism during sliding window analysis, strictly constraining the pressure changes of each pair of adjacent sampling points within the window, requiring that the pressure increment not fall below a set threshold. This design controls the pressure change trend at a microscopic level, effectively identifying and eliminating local pressure stagnation or drop phenomena in the bubble region caused by repeated bubble formation and collapse. Compared to traditional detection methods that rely solely on overall difference or average change trends, this approach emphasizes local continuity and monotonicity, thus significantly improving adaptability to complex bubble environments, and is particularly suitable for biological sample detection scenarios with thick foam layers or high bubble density.

[0018] This invention achieves full-range scanning and structured analysis of pressure-position data by introducing a processing mechanism combining sliding windows and continuous clustering. As the sliding window moves point by point, local pressure change characteristics can be captured, and windows that continuously meet the conditions are merged to form physically meaningful feature groups. This transformation from discrete judgment to continuous interval identification makes the detection results more stable and reliable. Simultaneously, this mechanism is adaptable to applications with small liquid column heights in test tubes, maintaining both spatial resolution and detection continuity within a range of 20-80 mm, and possessing the ability to identify multi-layered structures such as gas-liquid interfaces and liquid-solid interfaces.

[0019] This invention identifies liquid levels based on pressure-position curves obtained from actual measurements, without relying on specific physical properties of the sample, such as density, viscosity, surface tension, or bubble layer thickness, thus exhibiting good versatility. Through a unified criterion system, it can be applied to various types of biological samples, including whole blood, serum, plasma, urine, cerebrospinal fluid, and various reagent solutions, avoiding the need for separate modeling or adjustment of complex parameters for different samples. This sample-independent design approach ensures stable performance in various application scenarios, improving the system's adaptability and promotional value. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.

[0021] Figure 1 This is a flowchart of the gas-liquid interface detection method based on the slope feature of a sliding window according to the present invention. Detailed Implementation

[0022] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided so that the description of this disclosure will be more complete and fully convey the concept of the exemplary embodiments to those skilled in the art.

[0023] This invention provides, for example Figure 1 The gas-liquid interface detection method based on sliding window slope features, as shown, has the following specific steps: This detection system is deployed in an automated medical testing sample pretreatment platform to achieve stable and reliable liquid level detection in complex biological sample environments. Its overall structure consists of multiple cooperating components that work together to acquire pressure and position signals in real time and determine the liquid level. The system includes a blow-type probe, which can be a sampling needle on an automated sampling arm or a dedicated probe. One end of the probe is connected to a miniature constant-pressure gas source, which can be an air pump or a compressed air circuit. A small amount of clean gas is continuously output to the probe tip through a flow-limiting method, creating differentiated pressure responses at the probe tip in different media. The other end of the probe is driven by a Z-axis motion mechanism, which can be a stepper motor or a linear motor, enabling the probe to move precisely downwards in the vertical direction, thus inserting into the target test tube and gradually approaching the liquid surface area.

[0024] A miniature pressure sensor is arranged in the gas path channel to detect gas pressure changes at the needle tip outlet in real time. Its measurement range covers 0-500 Pa, and it has a resolution better than 0.1 Pa to ensure accurate capture of minute pressure differences between the air, bubble, and liquid phase regions. Simultaneously, a position detection element, such as a linear encoder or grating ruler, is integrated into the Z-axis motion mechanism to continuously record the real-time height position of the probe tip. The position detection resolution is better than 0.1 mm, thus ensuring a high-precision correspondence between pressure change data and spatial position data.

[0025] To achieve synchronous data processing and liquid level identification, the system also includes a data acquisition and processing unit. This unit can be an embedded controller or a host computer to synchronously acquire pressure signal P and position signal Z, and perform a sliding window slope analysis algorithm on the acquired sequence data to identify pressure change trends and output the liquid level position result. Through this data processing, the pressure response differences between the air zone, bubble layer, and real liquid phase region can be effectively distinguished, improving the accuracy and stability of liquid level detection.

[0026] Furthermore, the target container is the test tube used to hold biological samples, such as a vacuum blood collection tube or reagent tube, with a diameter typically in the range of 12-16 mm. An air bubble layer may exist above the liquid surface inside the tube due to transportation, shaking, or centrifugation. All these components operate collaboratively within an automated platform, enabling the probe to continuously output gas and collect pressure and position data in real time as it enters the test tube. This allows for effective identification of the true liquid surface position even in the presence of air bubble interference.

[0027] As the air-blowing probe gradually enters the test tube vertically, the gas flow at its tip exit varies significantly depending on the surrounding medium. It exhibits distinct pressure response characteristics in three different regions: the air region, the bubble or foam region, and the liquid phase region. In the air region above the liquid surface, the gas can freely escape from the tip exit into the external atmosphere with minimal flow resistance. Consequently, the pressure at the tip is essentially close to the atmospheric reference pressure, remaining approximately constant. Furthermore, as the probe moves downward along the Z-axis, the pressure variation is minimal, showing almost no significant fluctuations with position.

[0028] As the probe continues to descend into the bubble or foam region, the gas, composed of numerous bubble structures, must constantly overcome the barrier of the bubble membrane during its escape. The bubble membrane itself is in a dynamic process of continuous rupture and regeneration, resulting in a discontinuous and unstable gas flow path. Under these conditions, the tip pressure exhibits slight fluctuations, with the overall average pressure slightly higher than in the air region. However, the pressure changes between sampling points lack a stable pattern, and the pressure increments between adjacent sampling points show significant instability, even exhibiting local zero or negative increments. This non-monotonic variation reflects the complex flow characteristics within the bubble layer.

[0029] As the probe penetrates deeper into the liquid phase below the actual liquid surface, the gas must overcome the hydrostatic pressure of the liquid column to escape from the probe tip. With increasing probe depth, the liquid column height gradually increases, and the resistance the gas needs to overcome rises linearly, resulting in a linear increase in pressure at the probe tip with increasing depth. Within this region, the pressure increment between adjacent sampling points remains a stable positive value, and the magnitude of the pressure increment is positively correlated with the liquid density and the probe's downward step distance, demonstrating the stability characteristics of flow resistance in a continuous medium.

[0030] The differences in pressure response exhibited by the different medium regions, especially the unstable and non-monotonic pressure increment in the bubble region, contrast sharply with the stable and continuously positive pressure increment in the liquid phase region. This contrast forms the key basis for distinguishing the bubble layer from the real liquid surface during the liquid surface identification process, and provides a reliable basis for subsequent liquid surface detection based on pressure change trends.

[0031] The data preprocessing process in the dynamic window slope triple criterion algorithm first obtains the synchronization sequence data formed by the probe during its descent from the data acquisition system, represented as: The ternary set of data fully describes the pressure response of the probe as its spatial position changes. Parameters Indicates the sampling time, used to identify the time order of each set of data; parameters This indicates the height position corresponding to the probe tip, in mm, and reflects the specific spatial position of the probe in the vertical direction; Parameter This represents the real-time reading of the pressure sensor, measured in Pa, and is used to characterize the pressure state of the gas at the needle tip outlet. By simultaneously acquiring these three types of parameters, a complete pressure-position change trajectory can be constructed, providing fundamental data support for subsequent feature extraction.

[0032] Obtaining raw data Next, the data needs to be validated, and some of it needs to be removed. or Empty or invalid records are removed to avoid abnormal data interfering with subsequent analysis. Based on this, the remaining data is processed according to... The values ​​are sorted from smallest to largest to ensure that the data sequence strictly corresponds to the continuous downward puncture process of the probe from high to low, thus guaranteeing that the spatial order is consistent with the physical movement process. The significance of this sorting operation is to eliminate potential temporal order disturbances during sampling, making positional changes the primary order of the data organization.

[0033] Furthermore, in actual sampling, because the system may briefly stop at a certain location or have a high sampling frequency, it may cause issues to occur on the same... Multiple corresponding pressure records were obtained for the location. To address this situation, for the same... Multiple pressure values ​​corresponding to a location are averaged to obtain a unique pressure representation value, thus constructing a discrete but single-valued sequence structure. After this processing, a unique sequence of altitude positions is formed. and its corresponding mean pressure sequence .in, This represents the set of discrete positions after deduplication and sorting, where each element... It corresponds to a unique spatial location; This represents the average pressure value at the corresponding location, for each element. For in position The average of multiple pressure values ​​collected is used. This averaging process effectively reduces the impact of random noise and instantaneous fluctuations on data stability, making the pressure change trend smoother and more representative.

[0034] Through the above data preprocessing steps, raw discrete data that may contain duplicates or anomalies can be transformed into a standardized data sequence with a clear structure, consistent order, and low noise. and This standardized sequence not only preserves the essential characteristics of pressure variation with spatial location, but also provides a reliable data foundation for subsequent sliding window slope calculation, pressure increment analysis, and liquid level determination, thereby ensuring the stability and accuracy of the entire identification process.

[0035] After completing data preprocessing and obtaining unique location sequences and the corresponding mean pressure sequence Subsequently, the sequence was further processed using a sliding window scan to extract local pressure change information that reflects the characteristics of medium changes. First, the window size was set. , where parameters This indicates the number of data points contained within the window, with a recommended range of 6-20 data points. With a sampling interval of 0.5 mm, this corresponds to a spatial range of approximately 3-10 mm, which ensures spatial resolution while also suppressing bubble interference. The window starts at the beginning of the sequence and slides point by point along the sequence with a step size of 1, thus covering the entire pressure-position data sequence. For each window position... The range of data point indexes covered by the window is to Within this window, multiple characteristic parameters are calculated to characterize the behavior of local pressure changes.

[0036] In each window, first calculate the slope at the top of the window. The calculation formula is as follows: in, and These represent the average pressure values ​​at the starting position of the window and the next sampling point, respectively, in Pa; and This indicates the corresponding tip height position, in mm. The slope reflects the pressure change rate within the window entry segment, i.e., the first sampling interval, and is used to characterize the pressure response change when the probe first enters a new medium region. When the probe penetrates from the bubble region into the liquid region, the pressure change changes from the initial unstable fluctuations to a continuous upward trend, and the slope will show a significant positive jump, thus becoming an important basis for identifying the initial position of the liquid phase.

[0037] Subsequently, the slope at the end of the window is calculated within the same window. Its expression is: in, and This represents the average pressure value of two adjacent sampling points at the end of the window. and This indicates the corresponding position. The slope reflects the rate of pressure change within the last sampling interval, specifically the end of the window. When the end of the window has penetrated deep into the liquid phase region, the pressure change exhibits a stable growth characteristic, and the slope remains a stable positive value. However, when the end of the window is still within the bubble region, due to the instability of the bubble structure, the pressure change is smaller or may even fluctuate, causing the slope value to approach zero or its sign to be unstable. Therefore, this parameter is used to verify whether the end of the window has entered the stable liquid phase region.

[0038] After calculating the slopes at the beginning and end of the sampling point, it is necessary to check the consistency of pressure changes within the window point by point. For each pair of adjacent sampling points within the window, the pressure increment is calculated as follows: for arrive Each of them : in, Indicates the first The pressure difference between each sampling point and its next sampling point, in Pa; and These represent the average pressure values ​​of adjacent sampling points. This parameter describes the local continuity of pressure changes within the window. To ensure that the overall pressure change within the window exhibits a monotonically decreasing trend, for each... Set constraints: in, This represents the minimum permissible pressure increment threshold between adjacent sampling points, expressed in Pa. If any... If the pressure is below this threshold, it indicates that there is pressure stagnation or drop within the window, and the window will be judged as not meeting the characteristics of a stable liquid phase. This criterion can effectively eliminate abnormal local pressure fluctuations in the bubble region caused by the continuous bursting and regeneration of bubbles, and avoid misjudging the bubble layer as a liquid region.

[0039] Through the calculation and constraint of the above three characteristic parameters, namely the slope at the beginning of the window... Window tail slope and the incremental pressure at each point within the window Consistency assessment allows for detailed analysis of the pressure-position curve on a sliding window scale. This approach not only focuses on local trends but also considers the continuity of overall changes, enabling the stable identification of segments with monotonically increasing characteristics even in complex bubble interference environments, providing a reliable data foundation for subsequent liquid level determination.

[0040] After completing the sliding window scan and obtaining features such as the slope at the beginning and end of the window, and the pressure increment at adjacent points within the window, a multi-condition joint judgment needs to be performed on each sliding window to identify the valid segments that meet the liquid phase characteristics. This judgment process is based on three mutually cooperating constraints with different physical meanings. Only when all three conditions are met simultaneously is the corresponding window marked as a "qualified window" for subsequent extraction of the liquid surface position.

[0041] First, the changing characteristics of the window entry segment are determined by comparing the slope of the window's beginning with a set threshold. The determination expression is as follows: in, It represents the slope at the beginning of the window, reflecting the rate at which the pressure at the initial position of the window changes with position; This indicates the threshold for determining the initial slope, expressed in Pa / mm. This condition is primarily used to identify the pressure change transition that occurs when the probe moves from the bubble region to the liquid region. When the probe enters the liquid region from the bubble region, the pressure change changes from an unstable state to a continuously rising state, manifested as a significant increase in the slope. Therefore, only when... Exceeding the threshold Only then is it considered that the starting position of the window already has the tendency to enter the liquid phase. The typical value range is 5-25 Pa / mm, and this parameter directly affects the response sensitivity to the critical event of "penetrating the bubble layer and entering the liquid phase". When processing low-viscosity biological samples, such as urine, the pressure rise rate is slower due to lower liquid resistance, so a lower range (5-10 Pa / mm) can be selected. When processing high-viscosity samples, such as whole blood or serum, the pressure rise is more significant, so a higher range (10-25 Pa / mm) should be selected to avoid false triggering.

[0042] Secondly, the stability of the window's end region is verified by comparing the slope of the window's end with the corresponding threshold, expressed as follows: in, The slope at the end of the window is used to describe the rate of pressure change between the last two sampling points in the window. This indicates the threshold for determining the slope at the tail end, also in Pa / mm. This condition determines whether the end of the window has completely entered the stable liquid phase region. When the end of the window is in the liquid phase, the pressure change shows a stable positive increasing trend, therefore... The slope remains a stable positive value; however, if the end of the window is still within the bubble region, the pressure change may be small or even fluctuate due to the instability of the bubble structure, causing the slope to approach zero or exhibit an unstable sign. Therefore, only when... Exceeding the threshold Only then is it considered that the end of the window has detached from the bubble region and is inside the liquid phase. The typical value range is 0.5-3 Pa / mm. This parameter is used to ensure that the end of the window has stable liquid characteristics. Its value should not be too large, otherwise the effective liquid phase region may be mistakenly excluded.

[0043] Secondly, the consistency of overall pressure changes within the window is constrained by determining the pressure increment point by point. The constraint expression is as follows: Pressure increments at all adjacent points within the window are The pressure increment between adjacent points within the window is calculated as follows: For any pair of adjacent sampling points, the pressure increment is expressed as the pressure difference between the two adjacent points. This represents the minimum pressure increment threshold, expressed in Pa. This condition requires that the pressure change between any two adjacent sampling points within the window is not lower than this threshold, thus ensuring that the pressure change within the entire window exhibits a monotonically decreasing trend. This constraint effectively eliminates localized pressure stagnation or decline caused by repeated rupture and recombination of the bubble membrane in the bubble region. If the pressure increment between any pair of adjacent sampling points within the window is less than this threshold... If the window shows an unstable fluctuation, it should be considered an unqualified window. The typical value range is 0-2 Pa. When set to 0, it is equivalent to turning off the criterion, allowing a certain degree of fluctuation. When set to a positive value (e.g., 1-2 Pa), it can significantly enhance the ability to suppress bubble interference, but it may reduce the effective detection rate in extremely low viscosity samples. Therefore, it needs to be reasonably adjusted according to the sample type and bubble density.

[0044] The three judgment conditions mentioned above constrain the window from different perspectives: the initial slope is used to capture the instantaneous change characteristics of the liquid phase entering the window; the final slope is used to verify the continuous stability of the liquid phase state; and the point-by-point pressure increment constraint is used to ensure the continuity and consistency of the overall changes within the window. These three conditions do not exist independently, but rather complement and synergistically work together to form a multi-dimensional judgment mechanism for liquid phase characteristics. Only when all three conditions are met simultaneously does the window possess complete liquid phase characteristics, that is, it exhibits both the transition behavior of entering the liquid phase and stable growth at the end, while also showing no abnormal fluctuations within the entire window range, thus effectively distinguishing the bubble region from the real liquid phase region.

[0045] This triple-criteria joint judgment method significantly reduces the risk of misjudgment that may arise from a single criterion. For example, relying solely on the initial slope may misinterpret short-term fluctuations as entry into the liquid phase, relying solely on the tail slope may ignore instability in the intermediate region, and relying solely on point-by-point increments may be insensitive to the overall trend. The joint constraints of multiple conditions make the identification results more reliable, accurately extracting sections with stable pressure growth characteristics even in complex bubble environments, providing a solid foundation for the subsequent precise positioning of the liquid surface.

[0046] After completing the triple-criteria screening of the sliding window, a series of qualified windows that meet the conditions are obtained. These windows correspond to several discrete intervals in the pressure-position sequence on the index. Since the sliding window moves continuously in the sequence with a step size of 1, if multiple adjacent windows meet the criteria, these windows will exhibit a continuous distribution characteristic on the index. Based on this characteristic, the windows that meet the conditions need to be merged according to the continuity of the index. Qualified windows with continuous indices are grouped into a "feature group." Each feature group corresponds to a detection segment that is spatially continuous and whose overall pressure change characteristics conform to the characteristics of the liquid phase. This segment is represented by a continuous monotonically increasing trend region on the pressure-position curve, reflecting that the probe has been stably in the liquid phase environment within this range.

[0047] During merging, the starting index of the window is used as a reference. All windows that meet the criteria are sorted according to their index size, and the index difference between adjacent windows is checked one by one. When the starting index difference between two adjacent qualified windows is 1, they are determined to be continuous windows and are assigned to the same feature group. When an index jump occurs, the previous feature group is considered to have ended, and a new feature group is started. In this way, discrete qualified windows can be transformed into several continuous intervals, each interval representing a complete liquid phase response region. This transformation process from points to intervals helps to eliminate the impact of misjudgment of a single window and improves the overall stability of recognition.

[0048] After completing the feature group division, the first feature group that appears is selected as the main analysis object. This feature group is the first in the sequence, corresponding to the segment where the probe first enters and stabilizes in the liquid phase during its descent. Therefore, the first qualified window in the first feature group is taken as the key window, and the starting position data of this window is further extracted as the liquid surface position output. The Z coordinate value corresponding to this starting position can be represented as the liquid surface position, and its physical meaning is the height position of the probe tip when it first meets the liquid phase criterion. This position not only reflects the spatial position of the liquid surface, but also reflects the boundary point from the bubble region to the liquid phase region, which has clear physical meaning and practical application value.

[0049] In the specific implementation, if the window starts with an index... If a given qualified window is represented, then the corresponding candidate liquid surface position can be represented by its starting position coordinates, i.e., the position of the first qualified window in the position sequence. The numerical value corresponding to each element. This position originates from the unique position sequence obtained during the preprocessing stage. Therefore, the liquid level position can be represented as ,in Represents position sequence The Middle This is a position value, in mm. This value is the final output liquid level height, used for subsequent control of the sampling needle insertion depth or to perform other automated operations.

[0050] In some complex samples, such as biological samples with obvious stratification (e.g., blood samples may contain a plasma layer and a blood cell sedimentation layer), multiple segments with stable growth characteristics may appear on the pressure-position curve, leading to the identification of multiple feature groups during the detection process. In this case, multiple feature groups correspond to different medium interfaces, such as gas-liquid interfaces, liquid-solid interfaces, or interfaces between liquids of different densities. For this situation, the first feature group is selected by default as the main liquid surface position output, because this feature group corresponds to the interface where the probe first enters the liquid phase, which is usually the most important gas-liquid interface. Meanwhile, the remaining feature groups can be retained as auxiliary information for analyzing the internal structure of the sample, such as determining the presence of stratification, identifying the location of sedimentation layers, or assisting in optimizing sampling strategies.

[0051] By employing the clustering and liquid surface position output mechanism within the aforementioned qualified window, complex pressure change data can be transformed into spatially meaningful location information, achieving an effective mapping from data analysis to practical applications. This method not only improves the accuracy of liquid surface detection but also enhances its adaptability to complex sample structures, ensuring good stability and reliability of the detection results across various real-world scenarios.

[0052] In the sliding window slope analysis process, parameter settings have a crucial impact on the liquid level detection effect: This parameter represents the number of data points in the window, with a recommended range of 6-20. It determines the data scale covered by the window; increasing it appropriately can effectively improve the suppression of bubble interference, but it will also reduce the spatial resolution of liquid surface positioning.

[0053] This represents the initial slope threshold, expressed in Pa / mm, with a recommended range of 5-25. It is used to determine whether a pressure transition occurs from the bubble region to the liquid phase region. Decreasing this parameter can improve the detection sensitivity for low-viscosity samples, while increasing it can help reduce false triggering caused by bubble fluctuations.

[0054] This represents the tail slope threshold, expressed in Pa / mm, with a recommended range of 0.5-3. Its function is to ensure that the end of the window is stably within the liquid phase region. This parameter should not be set too high, otherwise it may mistakenly exclude the true liquid phase region.

[0055] This represents the minimum pressure increment threshold between adjacent sampling points, expressed in Pa, with a recommended range of 0-2. It is used to constrain the continuity of pressure changes within the window. For high bubble density samples, a value of 1-2 Pa is recommended to enhance anti-interference capabilities, while for low-bubble or bubble-free samples, it can be set to 0 to improve detection sensitivity and adaptability.

[0056] By coordinating the above parameters, a balance between detection accuracy and stability can be achieved under different sample conditions.

[0057] In the implementation process, an automated medical testing sample dispensing platform was used as the application carrier to specifically implement the overall testing process. The Z-axis movement of the sampling arm in the platform is driven by a stepper motor, with a resolution of [resolution missing]. This ensures high positional control accuracy when the probe moves vertically; the inner diameter of the probe is... It can adapt to standard test tube sizes while ensuring stable gas output. The gas supply section uses a miniature gas pump to provide approximately... The gas supply pressure is adjusted to a micro-flow output via a flow limiter, ensuring a stable and continuous gas flow at the needle tip. The pressure detection section uses a range of... Resolution is The pressure sensor is used to accurately acquire pressure change signals under different media environments, thereby meeting the need for detecting subtle pressure differences.

[0058] During a single liquid level detection, the sampling arm is first moved to directly above the target test tube, aligning the probe with the tube's axis to provide the basic positioning conditions for subsequent vertical insertion. Then, the Z-axis is... The probe moves downwards at a speed that drives it to descend. The sampling frequency synchronously acquires the tip position. and the corresponding pressure signal Thus forming a complete Sequence data. This sampling frequency balances data continuity with system response speed, ensuring that the acquired data has sufficient resolution without significantly impacting system efficiency.

[0059] Collected The sequence data is transmitted to the processing unit, where a sliding window triple criterion algorithm is executed to analyze the pressure change trend. During this process, the bubble region and liquid phase region are effectively distinguished through window scanning, slope calculation, and point-by-point pressure increment constraints, thereby identifying segments that meet the characteristics of the liquid phase. After processing, the detected liquid level is output. The coordinates serve as an important reference for controlling the aspiration depth of the sampling needle, ensuring that the sampling process neither draws in air or foam due to being too shallow nor comes into contact with the sediment layer due to being too deep.

[0060] Regarding parameter configuration, a set of default algorithm parameters is provided to suit general scenarios: , , , This parameter combination can balance detection sensitivity and anti-interference ability under most common biological sample conditions, providing a stable initial operating state for the system.

[0061] In the experimental verification phase, a simulated bubble-containing biological sample was selected as the test object. A typical interference environment was constructed by injecting human serum sample into a test tube and then shaking it to form a bubble layer. Five independent tests were performed under these conditions, corresponding to Sheets 1 to 5, and the results are recorded below: Table 1: Results of liquid level detection experiments for five groups of biological samples containing air bubbles As can be seen from Table 1, the liquid surface detection results of the five groups of biological samples containing air bubbles were all successfully detected in all five tests. Coordinates are concentrated in Within the specified range, the position is essentially consistent with the actual liquid level obtained through visual calibration. Further analysis of the results' stability showed that the inter-group standard deviation was less than [value missing]. This indicates that the test results have high consistency and can meet the accuracy requirements for liquid level detection in automated sample preprocessing for medical testing, which generally requires control within a certain range. Within.

[0062] In parameter sensitivity analysis, by adjusting key parameters and observing changes in detection results, we can further understand the impact of each parameter on detection performance. Depend on Reduce to At that time, the fifth group of samples changed from having no detected effective windows to detecting two windows, indicating that in samples with low viscosity or few bubbles, appropriately lowering the initial slope threshold helps improve the probability of recognizing liquid surface entry events, thereby improving the overall detection rate. On the other hand, when Depend on Reduce to At that time, the second group of samples changed from no detection to detection within two windows, indicating that the minimum pressure increment constraint at adjacent points has a significant suppressive effect on pressure fluctuations in the bubble region. When the bubble density is high, setting... A value of >0 can effectively filter out abnormal fluctuations caused by bubbles; however, in samples with fewer bubbles or those that have undergone defoaming treatment, this parameter can be set to 0 to avoid excessive restriction on normal pressure changes.

[0063] Based on the above implementation platform and process design and experimental verification results, it can be seen that in practical application environments, this detection method can stably identify the liquid surface position even in the presence of bubble interference. Furthermore, by reasonably adjusting the parameters, it can adapt to different types of samples and different bubble distribution conditions, demonstrating good versatility and robustness.

[0064] This invention effectively adapts to the complex application scenario of bubble layer interference in biological samples by constructing a triple slope joint criterion mechanism. During liquid level detection, it comprehensively analyzes the slope at the beginning and end of the window, as well as the pressure increment at each point within the window, providing a three-dimensional characterization of pressure change characteristics from three consecutive stages: "puncture entry - continuous descent - terminal stabilization." This mechanism can not only identify the instantaneous changes in the probe as it enters the liquid phase from the bubble region, but also verify whether subsequent sections maintain stable liquid phase characteristics, confirming the liquid level from multiple dimensions. Addressing the unstable pressure fluctuations within the bubble layer, it significantly reduces the probability of misjudging the bubble layer as a real liquid level through complementary constraints under multiple conditions, thereby significantly improving the reliability and accuracy of liquid level detection.

[0065] This invention introduces a point-by-point pressure increment monotonicity check mechanism during sliding window analysis, strictly constraining the pressure changes of each pair of adjacent sampling points within the window, requiring that the pressure increment not fall below a set threshold. This design controls the pressure change trend at a microscopic level, effectively identifying and eliminating local pressure stagnation or drop phenomena in the bubble region caused by repeated bubble formation and collapse. Compared to traditional detection methods that rely solely on overall difference or average change trends, this approach emphasizes local continuity and monotonicity, thus significantly improving adaptability to complex bubble environments, and is particularly suitable for biological sample detection scenarios with thick foam layers or high bubble density.

[0066] This invention achieves full-range scanning and structured analysis of pressure-position data by introducing a processing mechanism combining sliding windows and continuous clustering. As the sliding window moves point by point, local pressure change characteristics can be captured, and windows that continuously meet the conditions are merged to form physically meaningful feature groups. This transformation from discrete judgment to continuous interval identification makes the detection results more stable and reliable. Simultaneously, this mechanism is adaptable to applications with small liquid column heights in test tubes, maintaining both spatial resolution and detection continuity within a range of 20-80 mm, and possessing the ability to identify multi-layered structures such as gas-liquid interfaces and liquid-solid interfaces.

[0067] This invention identifies liquid levels based on pressure-position curves obtained from actual measurements, without relying on specific physical properties of the sample, such as density, viscosity, surface tension, or bubble layer thickness, thus exhibiting good versatility. Through a unified criterion system, it can be applied to various types of biological samples, including whole blood, serum, plasma, urine, cerebrospinal fluid, and various reagent solutions, avoiding the need for separate modeling or adjustment of complex parameters for different samples. This sample-independent design approach ensures stable performance in various application scenarios, improving the system's adaptability and promotional value.

[0068] The foregoing has only described certain exemplary embodiments of the present invention by way of illustration. Undoubtedly, those skilled in the art can modify the described embodiments in various ways without departing from the spirit and scope of the present invention. Therefore, the foregoing drawings and descriptions are illustrative in nature and should not be construed as limiting the scope of protection of the claims of the present invention.

Claims

1. A gas-liquid interface detection method based on sliding window slope characteristics, characterized in that, Includes the following steps: The blowing probe is driven to move gradually into the test tube along the Z-axis. During the movement, pressure signals and probe tip position signals are acquired simultaneously to form corresponding pressure data and position data sequences. The acquired pressure and location data sequences are processed. The location data are arranged according to the numerical value, and the pressure data corresponding to the same location data are averaged to obtain a unique location sequence and its corresponding average pressure sequence. A fixed window size is used to slide point by point on the unique location sequence and the corresponding average pressure sequence. For the data in each window, the pressure change rate between the two adjacent points at the beginning of the window is calculated as the first slope, and the pressure change rate between the two adjacent points at the end of the window is calculated as the last slope. At the same time, the pressure increment of each adjacent sampling point in the window is calculated one pair at a time. For each window, the window with a slope at the beginning greater than the first threshold, a slope at the end greater than the second threshold, and a pressure increment at all adjacent sampling points within the window not less than the third threshold is determined as a qualified window that meets the liquid phase characteristics. Qualified windows that meet the liquid phase characteristics are merged into feature groups according to the continuity of their position indices. The starting position data corresponding to the starting window in the first feature group is selected as the position output of the liquid surface of the biological sample in the test tube.

2. The gas-liquid interface detection method based on sliding window slope characteristics according to claim 1, characterized in that, The air-blowing probe uses a sampling needle or probe in an automated sampling arm. One end of the air-blowing probe is connected to a miniature constant-pressure gas source, which continuously outputs a small amount of clean gas to the probe tip using an air pump or compressed air circuit. The other end is driven by a Z-axis motion mechanism and moves vertically into the test tube. The pressure signal comes from a miniature pressure sensor installed in the probe's gas circuit, and the probe tip position signal comes from a Z-axis position sensor integrated in the Z-axis motion mechanism, so as to synchronously obtain the changes in gas pressure at the probe tip outlet and the corresponding height position during the probe's movement.

3. The gas-liquid interface detection method based on sliding window slope characteristics according to claim 1, characterized in that, The pressure and location data sequences include sampling time, needle tip height position, and pressure sensor readings. Records with empty needle tip height positions or pressure sensor readings are discarded, and the remaining records are sorted according to the numerical values ​​of the needle tip height positions to correspond to the downward puncture process of the probe needle from high to low. When there are multiple pressure records at the same needle tip height position, the corresponding pressure records are averaged to obtain a unique location sequence and average pressure sequence, with each needle tip height position corresponding to only one average pressure value, for use by the sliding window for point-by-point scanning.

4. The gas-liquid interface detection method based on sliding window slope characteristics according to claim 1, characterized in that, The fixed window size is set according to the number of data points contained in the window, and it slides continuously from the starting point of the unique position sequence and the average pressure sequence according to the movement interval of a single data point. Each window covers a continuous data point index. When the number of data points in the window increases, it is used to enhance the ability to suppress local pressure fluctuations caused by bubble interference. When the number of data points in the window decreases, it is used to maintain the spatial resolution of liquid level detection. The average pressure data and corresponding position data continuously covered by each window are used as the calculation objects for the first slope, the last slope, and the pressure increment of adjacent sampling points.

5. The gas-liquid interface detection method based on sliding window slope characteristics according to claim 4, characterized in that, The slope at the beginning of the window is the ratio of the pressure difference to the position difference between two consecutive sampling points at the starting position of the window. It is used to reflect the pressure change rate in the window entry section. The positive change in pressure from a fluctuating state to a continuously rising state when the probe penetrates from the bubble region into the liquid phase region is used as the comparison object for the first threshold. The first threshold is adjusted according to the characteristics of the biological sample. For low-viscosity biological samples, the first threshold is reduced to improve the detection sensitivity of liquid surface entry events. For high-viscosity biological samples, the first threshold is increased to reduce false triggering caused by bubble pressure fluctuations.

6. The gas-liquid interface detection method based on sliding window slope characteristics according to claim 4, characterized in that, The tail slope is the ratio of the pressure difference to the position difference between two consecutive sampling points at the end of the window. It is used to reflect the pressure change rate in the end section of the window. The stable positive value of the needle tip pressure in the liquid phase region as the detection depth increases is used as the comparison object for the second threshold. When the end of the window is still in the bubble region, the corresponding window is excluded by the response feature that the tail slope does not exceed the second threshold or the tail slope sign is non-positive. When the tail slope exceeds the second threshold, it is used to confirm that the end of the window has left the bubble region and is in the stable liquid phase region.

7. The gas-liquid interface detection method based on sliding window slope characteristics according to claim 4, characterized in that, The pressure increment of adjacent sampling points is the pressure difference between each pair of consecutive average pressure data within the window, and is compared with the third threshold one by one. The corresponding window is retained only when the pressure increment of all adjacent sampling points within the window is not less than the third threshold. The third threshold is used to exclude the pressure no increase or pressure drop caused by repeated rupture and regeneration of bubble film. High bubble density biological samples use a positive third threshold to filter bubble interference, and low bubble or bubble-free biological samples use a zero third threshold to check the pressure increment within the window.

8. The gas-liquid interface detection method based on sliding window slope characteristics according to claim 1, characterized in that, A qualified window must simultaneously meet three criteria: the slope at the beginning exceeds the first threshold, the slope at the end exceeds the second threshold, and the pressure increments at all adjacent sampling points within the window are not less than the third threshold. The slope at the beginning is used to identify the initial event of the probe penetrating the bubble layer and entering the liquid phase. The slope at the end is used to verify that the end of the window is in a stable liquid phase region. The pressure increments at adjacent sampling points are used to exclude local pressure pauses or drops caused by repeated bubble ruptures. The condition for a qualified window is that the window exhibits liquid phase pressure response characteristics from the entry section, the continuous detection section to the end section.

9. The gas-liquid interface detection method based on sliding window slope characteristics according to claim 1, characterized in that, Multiple qualified windows that meet the liquid phase characteristics are merged according to the continuous relationship of their position indices. Qualified windows with consecutive position indices are grouped into the same feature group. Each feature group corresponds to a detection segment that continuously meets the liquid phase pressure response characteristics. The feature group that appears first in the downward sequence of the probe is selected from multiple feature groups, and the starting position data of the first qualified window in it is extracted. The height position of the probe tip when it first simultaneously meets the criteria of the first-end slope, the last-end slope, and the pressure increment of adjacent sampling points is taken as the position of the liquid surface of the biological sample in the test tube.

10. The gas-liquid interface detection method based on sliding window slope characteristics according to claim 9, characterized in that, When the qualified window merging result contains multiple feature groups, the position corresponding to the first feature group that appears is output as the main liquid surface position according to the order in which the probe moves along the Z-axis into the test tube. The continuous detection segments corresponding to the remaining feature groups are retained as sample stratification information to help determine the density stratification or the interface between the blood cell layer and the sediment layer. The detected main liquid surface position is used as a reference benchmark to determine the insertion depth when the sampling needle performs subsequent liquid aspiration. Thus, the gas-liquid interface detection results obtained by the sliding window triple criterion are used in the automated medical testing sample sampling process.