A method and system for controlling the temperature of an endoscope lens to prevent fogging

By arranging temperature and humidity sensors on the endoscope lens, noise suppression and humidity stabilization clamping are performed, dew point margin and negative margin correction terms are calculated, and combined with PID control algorithm, the fogging problem of the endoscope lens in high humidity and temperature environment is solved, realizing fast and stable temperature control, reducing the risk of fogging and clarity fluctuations.

CN121478019BActive Publication Date: 2026-07-07SUN YAT SEN UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SUN YAT SEN UNIV
Filing Date
2025-11-19
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

Existing technologies struggle to adapt to the rapid temperature and humidity fluctuations and nonlinearity of the electrothermal actuator when the endoscope enters a body cavity environment characterized by high humidity, variable temperature, and disturbances from perfusion fluid and airflow. This results in condensation and fogging on the endoscope surface, affecting clarity and surgical safety.

Method used

By deploying temperature and humidity sensors to collect data, noise suppression is performed, lens temperature and humidity are calculated, humidity is stabilized and clamped, actual water vapor pressure is obtained, instantaneous dew point is solved, and the final dew point is output using first-order exponential smoothing. Instantaneous dew point margin and negative margin correction terms are calculated, future margin is predicted, and combined with the logistic risk index, a PID control algorithm is used to output control commands.

Benefits of technology

Adaptive temperature control of the endoscope lens was achieved, significantly reducing the probability of fogging and clarity fluctuations, reducing temperature overshoot and fluctuations, and improving system stability and interpretability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121478019B_ABST
    Figure CN121478019B_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for controlling the temperature of an endoscope lens to prevent fogging, relating to the field of temperature control technology. The method includes: arranging temperature and humidity sensors on the endoscope to collect temperature and humidity data and performing noise suppression; calculating the temperature and humidity of the endoscope lens based on the data; stabilizing and clamping the humidity and calculating a normal pressure correction coefficient; calculating the saturated vapor pressure of the endoscope lens to obtain the actual vapor pressure; obtaining the instantaneous dew point through inverse solving of the normal pressure correction coefficient; outputting the final dew point using first-order exponential smoothing; calculating the instantaneous dew point margin based on the lens temperature and the final dew point, and calculating a negative margin correction term; predicting future margins and calculating a logistic risk index; finally, comprehensively obtaining the lens adaptive margin; calculating the total error of PID control and executing the control command output using the PID control algorithm. This invention significantly reduces the probability of fogging and clarity fluctuations, and reduces temperature overshoot and fluctuations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of temperature control technology, and in particular to a method and system for controlling the temperature of an anti-fogging endoscope lens. Background Technology

[0002] When endoscopic imaging systems enter the high-humidity, temperature-changing, and perfusion fluid and airflow-disturbed environment of a body cavity, the mirror surface is highly susceptible to condensation and fogging due to temperatures below the dew point. To ensure clarity and surgical safety, the industry has evolved from open-loop anti-fogging using external anti-fogging agents and preheating sleeves, to constant power or constant temperature control with transparent conductive films / resistive rings, and finally to closed-loop control with integrated temperature sensors and a single temperature threshold. Meanwhile, the development of miniature temperature and humidity sensors, low-noise sampling links, and embedded algorithms has made anti-fogging approaches "based on thermal-humidity coupling models" possible: for example, estimating the dew point using empirical formulas, heating the mirror surface at a margin above the estimated dew point, and supplementing with basic integral limiting. However, these methods often assume a steady-state environment and drive heating with a fixed target temperature or margin, making it difficult to adapt to rapid temperature and humidity drift within the cavity and the nonlinearity of the electrothermal actuator. Summary of the Invention

[0003] In view of the aforementioned existing problems, the present invention is proposed.

[0004] Therefore, the present invention provides a method and system for controlling the temperature of an endoscope lens to prevent fogging, which solves the problems of existing technologies that often assume a steady environment, drive heating with a fixed target temperature or a fixed margin, and are difficult to adapt to rapid temperature and humidity drift in the cavity and nonlinearity of the electrothermal actuator.

[0005] To solve the above-mentioned technical problems, the present invention provides the following technical solution:

[0006] In a first aspect, the present invention provides a method for controlling the temperature of an anti-fogging endoscope lens, comprising,

[0007] Temperature and humidity sensors are placed on the endoscope to collect temperature and humidity data and perform noise suppression. The temperature and humidity of the endoscope lens are calculated based on the temperature and humidity data.

[0008] The humidity is stabilized and the atmospheric pressure correction factor is calculated. The saturated water vapor pressure of the endoscope lens is calculated to obtain the actual water vapor pressure. The instantaneous dew point is obtained by inverse solving the atmospheric pressure correction factor. The final dew point is output using first-order exponential smoothing.

[0009] The instantaneous dew point margin is calculated based on the lens temperature and the final dew point, and a negative margin correction term is calculated. The future margin is predicted to calculate the logistic risk index, and finally the lens adaptive margin is obtained by combining the results.

[0010] The total error of PID control is calculated, and the control command is output and executed after the PID control algorithm is used.

[0011] As a preferred embodiment of the anti-fogging endoscope lens temperature control method of the present invention, the step of arranging temperature and humidity sensors on the endoscope to collect temperature and humidity data and perform noise suppression refers to arranging temperature and humidity sensors in the inner cavity at the front end of the endoscope lens to collect temperature and humidity data, and performing time stamp unification and alignment of the data through linear interpolation, and performing noise suppression on the sampled temperature and humidity data.

[0012] As a preferred embodiment of the anti-fogging endoscope lens temperature control method of the present invention, wherein: the calculation of endoscope lens temperature and humidity based on temperature and humidity data refers to obtaining the temperature of the endoscope at the sensor point using a Pt1000 sensor. ;

[0013] Estimate the gas temperature near the endoscope lens based on the noise-reduced temperature data. ;

[0014] Estimate the relative humidity near the endoscope lens by combining sampled temperature and humidity data. ;

[0015] A first-order IIR low-pass filter was used to filter the temperature and humidity near the endoscope lens.

[0016] As a preferred embodiment of the anti-fogging endoscope lens temperature control method of the present invention, wherein: the humidity is stabilized and clamped and the normal pressure correction coefficient is calculated, the saturated water vapor pressure of the endoscope lens is calculated and the actual water vapor pressure is obtained, and the humidity of the endoscope lens is clamped in the range.

[0017] The Buck pressure correction factor is used as the atmospheric pressure correction factor;

[0018] Calculate Buck's saturation pressure based on the atmospheric pressure correction factor. And obtain the actual water vapor partial pressure .

[0019] As a preferred embodiment of the anti-fogging endoscope lens temperature control method of the present invention, wherein: the instantaneous dew point is obtained by inverse solution of the atmospheric pressure correction coefficient, and the final dew point index is output using first-order exponential smoothing by constructing a logarithmic term based on the actual water vapor partial pressure. ;

[0020] Instantaneous dew point is obtained by analytical inverse solving of several terms. ;

[0021] Dual stabilization treatment of instantaneous dew point under near-saturation conditions;

[0022] The final dew point is obtained by applying first-order exponential smoothing to the instantaneous dew point. .

[0023] As a preferred embodiment of the anti-fogging endoscope lens temperature control method of the present invention, the method involves: calculating the instantaneous dew point margin based on the lens temperature and the final dew point, calculating a negative margin correction term, predicting future margins, calculating a logistic risk index, and finally comprehensively obtaining the lens adaptive margin index. ;

[0024] Based on instantaneous dew point margin Calculate the negative margin correction term g;

[0025] Predicting future dew point margin using first-order extrapolation ;

[0026] Future dew point margin The risk index r is mapped through the logistic function;

[0027] The adaptive margin of the endoscope lens is calculated by combining the negative margin correction term and the risk index. .

[0028] As a preferred embodiment of the anti-fogging endoscope lens temperature control method of the present invention, wherein: after calculating the total error of PID control and outputting control commands using the PID control algorithm, the PID control error is calculated based on the endoscope lens adaptive margin and the endoscope lens temperature. ;

[0029] The PID control algorithm is used in conjunction with the control error to output PID control commands and execute them.

[0030] Secondly, the present invention provides an anti-fogging endoscope lens temperature control system, comprising,

[0031] The temperature and humidity analysis module is used to collect temperature and humidity data by arranging temperature and humidity sensors on the endoscope and to perform noise suppression, and to calculate the temperature and humidity of the endoscope lens based on the temperature and humidity data.

[0032] The dew point analysis module is used to stabilize and clamp the humidity and calculate the atmospheric pressure correction coefficient, calculate the saturated water vapor pressure of the endoscope lens to obtain the actual water vapor pressure, obtain the instantaneous dew point through the inverse solution of the atmospheric pressure correction coefficient, and output the final dew point using first-order exponential smoothing.

[0033] The margin adjustment module is used to calculate the instantaneous dew point margin based on the lens temperature and the final dew point, calculate the negative margin correction term, predict the future margin calculation logic risk index, and finally obtain the lens adaptive margin.

[0034] The control execution module is used to calculate the total error of PID control and then execute the control commands output by the PID control algorithm.

[0035] Thirdly, the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, wherein when the computer program is executed by the processor, it implements any step of the anti-fogging endoscope lens temperature control method as described in the first aspect of the present invention.

[0036] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the anti-fogging endoscope lens temperature control method as described in the first aspect of the present invention.

[0037] The beneficial effects of this invention are as follows: This invention uses sensor chain noise suppression and humidity stabilization as entry points, calculates the normal pressure correction coefficient, and obtains the saturated water vapor pressure and actual water vapor partial pressure accordingly. Then, it solves the instantaneous dew point and uses first-order exponential smoothing to obtain the robust dew point. Subsequently, based on the lens temperature and dew point, it constructs an instantaneous dew point margin and negative margin correction term, introduces prediction margin and logistic risk index to form an adaptive margin, and finally inputs the total error into the PID control algorithm to generate power commands. This achieves a closed-loop strategy of "using dew point as a reference, providing heating on demand, and being fast with small overshoot", significantly reducing the probability of fogging and clarity fluctuations, and reducing temperature overshoot and fluctuations. Attached Figure Description

[0038] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0039] Figure 1 This is a flowchart of the anti-fogging endoscope lens temperature control method in Example 1.

[0040] Figure 2 This is a structural diagram of the anti-fogging endoscope lens temperature control system in Example 1. Detailed Implementation

[0041] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0042] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0043] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0044] Example 1, referring to Figure 1 and Figure 2 This is the first embodiment of the present invention, which provides a method for controlling the temperature of an anti-fogging endoscope lens, including the following steps:

[0045] S1. Arrange temperature and humidity sensors on the endoscope to collect temperature and humidity data and perform noise suppression, and calculate the temperature and humidity of the endoscope lens based on the temperature and humidity data;

[0046] Specifically, the process of placing temperature and humidity sensors on the endoscope to collect temperature and humidity data and performing noise suppression involves placing temperature and humidity sensors in the inner cavity at the front end of the endoscope lens (1.5mm from the lens surface) to collect temperature and humidity data, and then performing time stamp unification and alignment of the data through linear interpolation, and performing noise suppression on the sampled temperature and humidity data.

[0047]

[0048] in The sampled temperature and humidity data are after noise suppression, and k is the data sampling time. In this invention, 100Hz is used as a sampling time. Noise suppression is achieved by oversampling by 8 times and averaging within each sampling time.

[0049] Furthermore, based on the temperature and humidity data, the temperature and humidity index of the endoscope lens was calculated, and the temperature of the endoscope at the sensor point was obtained using a Pt1000 sensor. :

[0050]

[0051] Where A is the primary temperature coefficient and B is the secondary temperature coefficient. The nominal resistance is... The resistance of Pt1000 is calculated by measuring the voltage through constant current source excitation of Pt1000;

[0052] Estimate the gas temperature near the endoscope lens based on the noise-reduced temperature data. :

[0053]

[0054] in For sampling temperature data, The coefficients are dimensionless coupling coefficients. The temperature of the endoscope at the sensor point;

[0055] Estimate the relative humidity near the endoscope lens by combining sampled temperature and humidity data. :

[0056]

[0057]

[0058] in This is the primary humidity coefficient. This is the secondary humidity coefficient. To collect humidity data, For water vapor partial pressure, It is the saturated vapor pressure;

[0059] A first-order IIR low-pass filter was used to filter the temperature and humidity near the endoscope lens.

[0060] By unifying the timestamps and aligning the temperature and humidity channels using linear interpolation, strict correspondence between cross-channel data at the same moment is achieved. This avoids instantaneous misalignment caused by inconsistent channel sampling, especially in scenarios where rapid humidity changes and temperature lag coexist. Misalignment can be amplified in subsequent dew point calculations. The ultimate benefit is suppressing sawtooth fluctuations and spurious pulses in the dew point sequence, reducing unnecessary modulation of the control output, and improving stability and comfort. By performing eight rapid samplings and averaging within each 1 / 100th of a second control frame, random noise, quantization errors, and high-frequency interference are suppressed. This helps to mitigate the effects of electrical noise, analog-to-digital conversion granularity, and occasional droplet obstruction. The transient offset is statistically eliminated, so that the single-frame estimate represents the true mean rather than a random value. The beneficial effect is that the variance of the temperature and humidity time series is significantly reduced, the estimation interval of dew point and margin is significantly converged, and the controller can operate on a smoother input, thereby reducing overshoot and overcompensation. By using the noise-suppressed temperature and humidity time series as the only input for subsequent calculations, single-source consistency of the measurement and control link is achieved. Its role is to ensure that the generation of each target temperature and control command is based on a strictly homogeneous dataset, which facilitates the tracing and location of abnormal events. The ultimate benefit is to improve the interpretability and maintainability of the system, and facilitate recording, reproduction and compliance assessment in the clinical environment.

[0061] S2. Stabilize and clamp the humidity and calculate the normal pressure correction coefficient. Calculate the saturated water vapor pressure of the endoscope lens to obtain the actual water vapor pressure. Obtain the instantaneous dew point by inverse solving the normal pressure correction coefficient. Use first-order exponential smoothing to output the final dew point.

[0062] Specifically, the humidity is stabilized and a normal pressure correction factor is calculated. The saturated vapor pressure of the endoscope lens is then calculated to obtain the actual vapor pressure index. The humidity of the endoscope lens is clamped into a separate range to avoid logarithmic singularity.

[0063]

[0064] in Humidity of the endoscope lens after clamping;

[0065] The Buck pressure correction factor is used as the atmospheric pressure correction factor:

[0066]

[0067] in The absolute atmospheric pressure is based on sea level pressure.

[0068] Calculate Buck's saturation pressure based on the atmospheric pressure correction factor. And obtain the actual water vapor partial pressure :

[0069]

[0070] in It is the approximate saturation pressure at 0℃.

[0071] By utilizing the denoised sampling temperature and introducing a dimensionless coupling coefficient, the sensor point temperature is mapped to the temperature of the boundary layer gas near the lens, achieving a targeted characterization of the actual condensation region. Its function is to transform spatial measurement bias into an equivalent temperature within the boundary layer, compensating for the thermal difference between the sensor and the mirror surface. The ultimate benefit is a significant reduction in dew point determination bias caused by spatial misalignment, improving the sensitivity to fogging risk assessment. This approach differs from conventional methods that directly use far-field or uncompensated temperature for judgment, directly targeting the critical physical location of the "interface," solving the problem of inconsistency between previous judgment criteria and actual condensation locations. By combining sampling temperature and humidity for near-field relative humidity estimation and introducing the physical quantities of saturation and actual partial pressure, a robust conversion from measured quantities to near-field humidity is achieved. Its function is to maintain physical consistency in humidity estimation even under conditions of rapid temperature fluctuations or near-saturation. This approach avoids numerical instability near extreme values. The ultimate benefit is a significant reduction in humidity temporal fluctuations and artificially high humidity levels, resulting in better anti-interference capabilities for subsequent calculations of dew point and margin. This concept differs from conventional schemes that directly use raw humidity for judgment. Addressing the technical challenge of near-saturation amplification, it provides a physical constraint path of partial pressure to saturation pressure. By applying a first-order low-pass filter to near-field temperature and relative humidity, it suppresses high-frequency noise and occasional spikes without sacrificing response speed. Its effect is to substantially reduce the variance of the input sequence by using a small hysteresis, allowing subsequent control to operate on a smoother signal. The ultimate benefit is reduced control command jitter and unnecessary power fluctuations, thereby reducing overshoot and thermal stress accumulation. This concept differs from simple moving averages or large-window smoothing, balancing real-time performance and stability, and providing a more suitable filtering mechanism for rapid changes and spray interference in endoscopic scenarios.

[0072] Furthermore, the instantaneous dew point is obtained by inverse solving using the atmospheric pressure correction coefficient, and the final dew point index is output using first-order exponential smoothing. This is achieved by constructing a logarithmic term based on the actual water vapor partial pressure. :

[0073]

[0074] Instantaneous dew point is obtained by analytical inverse solving of several terms. :

[0075]

[0076] Dual stabilization treatment of instantaneous dew point under near-saturation conditions:

[0077]

[0078] in It is a small constant;

[0079] The final dew point is obtained by applying first-order exponential smoothing to the instantaneous dew point. :

[0080]

[0081] in For smoothing coefficients, For a moment Main time base sampling rate, This is the dew point equivalent cutoff frequency.

[0082] By constructing logarithmic terms from actual water vapor partial pressure and saturation values ​​and introducing atmospheric pressure correction, the inherently exponentially sensitive phase transition equilibrium relationship is transformed into a linearly reversible form with better numerical conditions. Its purpose is to limit the small measurement errors in the high-humidity region to the logarithmic domain, preventing them from being exponentially amplified. Under the same measurement noise level, the fluctuations in dew point calculation are significantly reduced. By using analytical inverse solutions to obtain instantaneous dew points instead of iterative numerical solutions, a real-time path with fixed time delay and fixed computational load is constructed. This avoids the dependence of iterative convergence on initial values ​​and the risk of divergence under strong disturbances and high humidity conditions. On resource-constrained embedded hardware, it ensures that the dew point is reliably obtained in one go within each control frame. This is achieved by calculating the instantaneous dew point under near-saturation conditions. The system employs a dual stabilization process (including physical upper bound constraints and empirical lower bounds) to establish a hard constraint barrier consistent with thermodynamic principles. Its purpose is to eliminate non-physical anomalies such as "dew point exceeding air temperature" or "instantaneous depth underestimation" caused by droplet, spray, or sensor noise. It creates a suppression effect on anomalous samples in a continuous sequence by applying first-order exponential smoothing to the constrained dew point and explicitly setting its bandwidth with an equivalent cutoff frequency. This allows for dynamic matching between the dew point output and the control loop, achieving maximum noise suppression with minimal phase lag, thus coordinating the target temperature update rate with the actuator's thermal inertia. Under the same disturbance, target changes will be smoother, and control overshoot and power ripple can be quantified and reduced.

[0083] S3. Calculate the instantaneous dew point margin based on the lens temperature and the final dew point, calculate the negative margin correction term, predict the future margin calculation logistic risk index, and finally obtain the lens adaptive margin.

[0084] Specifically, the instantaneous dew point margin is calculated based on lens temperature and final dew point, and a negative margin correction term is calculated. The future margin is predicted, and the logistic risk index is calculated. Finally, the lens adaptive margin index is obtained by comprehensively considering these factors. :

[0085]

[0086] Based on instantaneous dew point margin Calculate the negative margin correction term g:

[0087]

[0088] in The correction factor;

[0089] Predicting future dew point margin using first-order extrapolation :

[0090]

[0091] in To predict duration, and The output is the rate of change of temperature and dew point after processing the endoscope lens temperature and final dew point using a first-order hysteresis differentiator.

[0092] Future dew point margin Mapped to a risk index via a logistic function :

[0093]

[0094] in To achieve the desired safety margin, This is the steepness coefficient. It is the sigmoid function;

[0095] The adaptive margin of the endoscope lens is calculated by combining the negative margin correction term and the risk index. :

[0096]

[0097] in As a baseline safety margin, For risk-based gains.

[0098] By "calculating the instantaneous dew point margin based on lens temperature and final dew point," real-time quantitative judgment of whether condensation boundary is approaching is achieved. Its function is to transform the previous fuzzy judgment based on absolute temperature or empirical thresholds into a measurable margin directly related to the phase transition criticality. Its purpose is to provide a unified benchmark for all subsequent scheduling. By "calculating the negative margin correction term g based on the instantaneous dew point margin," a rapid pull-back mechanism is achieved when the critical point is exceeded. Its function is to take on the task of "escaping the danger zone" with a dedicated correction channel. Its purpose is to avoid completely relying on the integral or slow channel for recovery responsibility and reduce recovery time. By "using first-order extrapolation to predict future dew point margin," short-term trends are incorporated into the forward-looking assessment of decision-making. Its function is to complete the margin pre-setting before the disturbance arrives. Its purpose is to block the impending condensation risk with smaller power changes. The ultimate benefit is that fogging is prevented rather than compensated for after the fact. The control action changes from passive stress response to active avoidance, and overshoot and power fluctuation are reduced simultaneously.

[0099] S4. Calculate the total error of PID control and execute the control command output using the PID control algorithm;

[0100] Specifically, the total error of PID control is calculated, and the control command is output using the PID control algorithm and then executed. The PID control error is calculated based on the endoscope lens adaptive margin and the endoscope lens temperature. :

[0101]

[0102] A PID control algorithm is used to output and execute PID control commands based on control error. The gain of the PID controller is tuned through offline training.

[0103] This embodiment also provides an anti-fogging endoscope lens temperature control system, including:

[0104] The temperature and humidity analysis module is used to collect temperature and humidity data by arranging temperature and humidity sensors on the endoscope and to perform noise suppression, and to calculate the temperature and humidity of the endoscope lens based on the temperature and humidity data.

[0105] The dew point analysis module is used to stabilize and clamp the humidity and calculate the atmospheric pressure correction coefficient, calculate the saturated water vapor pressure of the endoscope lens to obtain the actual water vapor pressure, obtain the instantaneous dew point through the inverse solution of the atmospheric pressure correction coefficient, and output the final dew point using first-order exponential smoothing.

[0106] The margin adjustment module is used to calculate the instantaneous dew point margin based on the lens temperature and the final dew point, calculate the negative margin correction term, predict the future margin calculation logic risk index, and finally obtain the lens adaptive margin.

[0107] The control execution module is used to calculate the total error of PID control and then execute the control commands output by the PID control algorithm.

[0108] This embodiment also provides a computer device applicable to the anti-fogging endoscope lens temperature control method, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the anti-fogging endoscope lens temperature control method proposed in the above embodiment.

[0109] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.

[0110] This embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements the endoscope lens temperature control method for achieving anti-fogging as proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0111] In summary, this invention uses sensor chain noise suppression and humidity stabilization as entry points, calculates atmospheric pressure correction coefficients to obtain saturated water vapor pressure and actual water vapor partial pressure, then solves the instantaneous dew point and uses first-order exponential smoothing to obtain a robust dew point. Subsequently, based on lens temperature and dew point, it constructs instantaneous dew point margin and negative margin correction terms, introduces prediction margin and logistic risk index to form adaptive margin, and finally inputs the total error into the PID control algorithm to generate power commands. This achieves a closed-loop strategy of "using dew point as a reference, providing heating on demand, and being fast with small overshoot," significantly reducing the probability of fogging and clarity fluctuations, and reducing temperature overshoot and fluctuations.

[0112] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for controlling the temperature of an anti-fogging endoscope lens, characterized in that: include, Temperature and humidity sensors are placed on the endoscope to collect temperature and humidity data and perform noise suppression. The temperature and humidity of the endoscope lens are calculated based on the temperature and humidity data. The humidity was stabilized and the atmospheric pressure correction factor was calculated. The saturated water vapor pressure of the endoscope lens was then calculated. Then obtain the actual water vapor pressure Instantaneous dew point is obtained by inverse solving using the atmospheric pressure correction coefficient. The final dew point is output using first-order exponential smoothing. ; Instantaneous dew margin is calculated based on lens temperature and final dew point. And calculate the negative margin correction term g to predict future margins. Calculate the logistic risk index r, and finally obtain the lens adaptive margin. ; Calculate the total error of PID control, output control commands using the PID control algorithm, and then execute them. The process involves stabilizing and clamping the humidity, calculating the normal pressure correction coefficient, calculating the saturated water vapor pressure of the endoscope lens, and then obtaining the actual water vapor pressure index to control the humidity of the endoscope lens within the specified range. The Buck pressure correction factor is used as the atmospheric pressure correction factor; Calculate Buck's saturation pressure based on the atmospheric pressure correction factor. And obtain the actual water vapor partial pressure ; The instantaneous dew point is obtained by inverse solving using the atmospheric pressure correction coefficient, and the final dew point index is output using first-order exponential smoothing by constructing a logarithmic term based on the actual water vapor partial pressure. ; Instantaneous dew point is obtained by analytical inverse solving of several terms. ; Dual stabilization treatment of instantaneous dew point under near-saturation conditions; The final dew point is obtained by applying first-order exponential smoothing to the instantaneous dew point. ; The process involves calculating the instantaneous dew point margin based on lens temperature and final dew point, calculating a negative margin correction term, predicting future margins, calculating the logistic risk index, and finally obtaining the lens adaptive margin index. ; Based on instantaneous dew point margin Calculate the negative margin correction term g; Predicting future dew point margin using first-order extrapolation ; Future dew point margin The risk index r is mapped through the logistic function; The adaptive margin of the endoscope lens is calculated by combining the negative margin correction term and the risk index. .

2. The method for controlling the temperature of an anti-fogging endoscope lens as described in claim 1, characterized in that: The process of arranging temperature and humidity sensors on the endoscope to collect temperature and humidity data and perform noise suppression refers to arranging temperature and humidity sensors in the inner cavity at the front end of the endoscope lens to collect temperature and humidity data, and performing time stamp unification and alignment of the data through linear interpolation, and performing noise suppression on the sampled temperature and humidity data.

3. The method for controlling the temperature of an anti-fogging endoscope lens as described in claim 2, characterized in that: The calculation of endoscope lens temperature and humidity based on temperature and humidity data refers to using Pt1000 to obtain the temperature of the endoscope at the sensor point. ; Estimate the gas temperature near the endoscope lens based on the noise-reduced temperature data. ; Estimate the relative humidity near the endoscope lens by combining sampled temperature and humidity data. ; A first-order IIR low-pass filter was used to filter the temperature and humidity near the endoscope lens.

4. The method for controlling the temperature of an anti-fogging endoscope lens as described in claim 3, characterized in that: After calculating the total error of the PID control and outputting control commands using the PID control algorithm, the PID control error is calculated based on the endoscope lens adaptive margin and endoscope lens temperature. ; The PID control algorithm is used in conjunction with the control error to output PID control commands and execute them.

5. A temperature control system for an anti-fogging endoscope lens, based on the anti-fogging endoscope lens temperature control method according to any one of claims 1 to 4, characterized in that: include, The temperature and humidity analysis module is used to collect temperature and humidity data by arranging temperature and humidity sensors on the endoscope and to perform noise suppression, and to calculate the temperature and humidity of the endoscope lens based on the temperature and humidity data. The dew point analysis module is used to stabilize and clamp the humidity and calculate the atmospheric pressure correction coefficient, calculate the saturated water vapor pressure of the endoscope lens to obtain the actual water vapor pressure, obtain the instantaneous dew point through the inverse solution of the atmospheric pressure correction coefficient, and output the final dew point using first-order exponential smoothing. The margin adjustment module is used to calculate the instantaneous dew point margin based on the lens temperature and the final dew point, calculate the negative margin correction term, predict the future margin calculation logic risk index, and finally obtain the lens adaptive margin. The control execution module is used to calculate the total error of PID control and then execute the control commands output by the PID control algorithm.

6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the anti-fogging endoscope lens temperature control method according to any one of claims 1 to 4.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the anti-fogging endoscope lens temperature control method according to any one of claims 1 to 4.