Valve well automatic monitoring method
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WUHAN YIXUN IOT TECH CO LTD
- Filing Date
- 2026-02-28
- Publication Date
- 2026-06-09
Smart Images

Figure CN122179754A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of underground pipeline monitoring technology, and in particular to an automatic monitoring method for valve wells. Background Technology
[0002] Valve wells, as critical nodes in urban underground pipeline systems for water supply, heating, and gas, are widely distributed throughout cities. They house vital equipment such as valves and instruments, primarily used for sectional control, flow regulation, and maintenance of the pipeline network. Because valve wells are typically located underground, they operate in a constantly enclosed, humid environment, sometimes even submerged due to rising groundwater levels. Their operational status directly impacts the safety and stability of the city's lifeline system. In actual operation, valve wells are highly susceptible to accumulating flammable and explosive gases such as methane leaking from pipelines, or experiencing backflow of rainwater and groundwater due to seal failure. Furthermore, geological subsidence can cause the well structure to tilt and deform. If these safety hazards are not detected and addressed promptly, they could potentially lead to major safety accidents such as explosions or pipeline network failures.
[0003] Currently, monitoring and inspection of valve wells mainly rely on regular manual inspections or early, simple automated monitoring devices. Manual inspections have significant limitations. Due to the large number and dispersed distribution of valve wells, it is difficult for personnel to conduct high-frequency, full-coverage inspections, resulting in long inspection cycles and often "time blind spots" in monitoring. This prevents immediate response in the early stages of an accident. Furthermore, the harsh underground environment poses safety risks such as oxygen deprivation and poisoning for manual workers. Although some automated monitoring devices based on IoT technology have emerged, these existing technologies still face numerous bottlenecks in practical applications. First, most existing monitoring devices use a fixed-frequency "acquisition-upload" mode, lacking adaptability to environmental changes. They mechanically transmit data regardless of the underground condition, leading to significant power consumption due to frequent activation of the wireless communication module. This results in extremely short battery life for battery-powered devices, requiring frequent battery replacements and greatly increasing maintenance costs. Second, the underground environment suffers from severe signal shielding and highly unstable wireless network quality. Existing devices often resort to simple infinite retry strategies when encountering weak network environments, which not only further accelerates battery depletion but also easily causes data packet congestion and loss. Furthermore, existing monitoring equipment has a low level of intelligence, mostly relying on a single threshold judgment method. This makes it susceptible to sensor zero-point drift caused by the high humidity environment underground, temperature changes, or vibration interference from passing vehicles on the surface, resulting in numerous false alarms and missed alarms, leading to ineffective maintenance and uptime. Finally, firmware updates and parameter configurations for existing equipment typically require technicians to bring computers to the site via wired connection, which cannot meet the needs of remote maintenance and algorithm iteration after large-scale deployment, resulting in poor system maintainability and scalability. Summary of the Invention
[0004] The technical problem addressed in this application is: how to overcome the shortcomings of existing valve well monitoring technologies, such as high sensor false alarm rate, short battery life due to high energy consumption in weak network environments, and high on-site maintenance costs, and to provide an automatic valve well monitoring method and system that can intelligently identify environmental interference, adaptively adjust power consumption strategies, and support highly reliable remote maintenance.
[0005] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is: an automatic monitoring method for valve wells, the method comprising: S1. In response to the system wake-up event, the sensor health self-test based on frequency response characteristic analysis is performed through the sensor acquisition module, and after the self-test is passed, multi-dimensional environmental raw data and wireless signal quality data in the valve well are acquired according to the hierarchical sampling strategy. S2. The data acquisition and processing module performs time-frequency domain denoising based on wavelet transform and multi-source heterogeneous data fusion verification on the original multi-dimensional environmental data to generate high-confidence monitoring results. S3. Use the adaptive dynamic benchmark algorithm and trend evolution prediction model to extract abnormal features from the monitoring results, determine the current system status, and generate a risk level including confidence weights. S4. Dynamically calculate transmission priority based on wireless signal quality data and risk level, perform differentiated data compression and adaptive reporting, save algorithm context after task completion and control system to enter deep sleep mode.
[0006] In the preferred embodiment, the sensor health self-check and graded sampling strategy based on frequency response characteristic analysis in step S1 includes: During the sensor preheating stage, multiple sets of sinusoidal perturbation signals of different frequencies are applied to the electrochemical sensor, the sensor's response current is collected, and a Nyquist impedance spectrum is constructed in memory. The nonlinear least squares method is used to fit the constructed impedance spectrum to the pre-set Landers equivalent circuit model, and the parameter values of charge transfer resistance and double layer capacitance are calculated. Determine whether the rate of change of charge transfer resistance exceeds the preset aging threshold. If it does, automatically adjust the signal gain compensation coefficient of the analog front end. If it does not exceed the threshold, maintain the current gain. During the formal sampling phase, the variance value of the triaxial accelerometer is first read. If the variance value is lower than the static threshold, environmental data is collected in low-frequency mode. If the variance value is higher than the static threshold, it is determined that there is external vibration interference, and the system automatically switches to high-frequency oversampling mode and activates the anti-aliasing filter.
[0007] In the preferred embodiment, step S2, which involves wavelet transform-based time-frequency domain denoising and multi-source heterogeneous data fusion verification, includes: By selecting a preset wavelet basis function, multi-level wavelet packet decomposition is performed on the collected non-stationary environment raw data sequence to obtain high-frequency detail coefficients and low-frequency approximation coefficients in different frequency bands. An adaptive soft thresholding function is used to shrink the high-frequency detail coefficients, remove random noise components, and a reconstruction algorithm is used to synthesize the denoised clean data sequence. Construct a multidimensional feature vector containing temperature, humidity, gas concentration, and water level data, and calculate the Mahalanobis distance between this feature vector and the historical normal state dataset; The calculated Mahalanobis distance is compared with the critical value of the chi-square distribution. If the distance is less than the critical value, the data are determined to be strongly correlated and valid. If the distance is greater than the critical value, the slope of the humidity data change is further analyzed. If the slope of the humidity change is positively correlated with the slope of the gas concentration change, it is determined to be water vapor interference, and the gas concentration data is negatively corrected.
[0008] In the preferred embodiment, the adaptive dynamic benchmark algorithm and trend evolution prediction model in step S3 include: A weighted moving average model incorporating a forgetting factor is established to iteratively calculate historical monitoring data, giving greater weight to data closer to the current moment, thereby updating the current dynamic background baseline. Calculate the deviation between the current high-confidence monitoring results and the dynamic background baseline, and calculate the current Z-Score standardized score by combining the data's volatility variance; A trend prediction model based on differential autoregressive moving average is constructed. The time series curve is fitted using monitoring data from the most recent N periods, and the numerical evolution trend within a preset time window is extrapolated. If the Z-Score standardized score exceeds the preset statistical anomaly limit, or if the extrapolated prediction value indicates that the safety red line will be reached in the future, the risk confidence weight is calculated based on the integral of the product of the anomaly magnitude and duration, and a graded alarm instruction is generated.
[0009] In the preferred scheme, step S4, which involves dynamically calculating transmission priority and adaptive reporting, includes: The reference signal received power (RSRP) and signal-to-interference-plus-noise ratio (SINR) of the wireless communication module are read in real time, and a communication link quality scoring function is constructed by combining the remaining battery power. Establish a priority queue for data transmission, marking emergency alarm data as high priority and periodic routine data as low priority; The token bucket algorithm is used to shape the traffic of the reported requests. If the communication link quality score is lower than the preset threshold, the token issuance rate is automatically reduced, and only high-priority data is allowed to pass through. Before sending data, monitor the channel status. If channel congestion is detected, execute the exponential backoff algorithm to calculate a random waiting time, and re-initiate the connection request after the waiting time expires, until the data is successfully sent or the maximum number of retries is reached.
[0010] In the preferred embodiment, the differential data compression step in this method includes: For alarm data marked as high priority, lossy compression is not performed; instead, the LZ77 lossless compression algorithm is used directly for encoding to preserve the complete waveform characteristics. For regular data marked as low priority, the Rotating Door Compression (SDT) algorithm is used to process it, calculate the slope between the data points and the compression door, and retain only the key inflection point data that exceeds the range of the compression door parallelogram. The compressed data payload is divided into fixed-length transmission units, and a Cyclic Redundancy Check (CRC32) code is calculated for each transmission unit. The check code is appended to the end of the data for integrity verification at the receiving end.
[0011] In a preferred embodiment, the method further includes a remote firmware update and rollback step based on differential patching: After receiving the firmware version description file from the server, the system compares the differences between the local firmware version and the target firmware version, and only downloads the binary differential patch package to the buffer of the external Flash memory. The new firmware image is reconstructed in memory using the local old firmware and the downloaded differential patch package, and the reconstructed image is verified by SHA-256 hash. After verification, the new firmware image is written to a separate partition to be activated, and the boot pointer of the bootloader is modified. After the system restarts and loads the new firmware, a watchdog timer is started and a function self-test is performed. If the self-test fails or a system crash occurs, the watchdog resets the system and automatically restores the boot pointer to the old firmware partition, thus achieving a fault rollback.
[0012] In the preferred embodiment, step S4, which involves saving the algorithm context and controlling the system to enter deep sleep mode, includes: The state estimation vector, covariance matrix, and forgetting factor parameters of the dynamic benchmark algorithm of the Kalman filter are written into the non-volatile ferroelectric memory (FRAM) to prevent loss when power is off. Iterate through all peripheral interfaces of the microcontroller, configure pins not connected to external devices as analog input mode, and configure pins connected to external pull-up resistors as open-drain output high-level mode; Send an I2C command to the power management chip to cut off the power supply circuit for the sensor acquisition module and the wireless communication module; Configure the alarm interrupt trigger time of the real-time clock (RTC) and call system instructions to put the kernel into stop mode, retaining only the microampere power supply for the wake-up logic circuit.
[0013] In the preferred embodiment, the system includes: The sensor acquisition module includes an excitation response circuit for constructing impedance spectra and a multi-dimensional environmental sensing unit; The data acquisition and processing module has an embedded digital signal processing (DSP) core, which is used to perform wavelet transforms and matrix operations. The wireless communication module integrates a radio frequency link quality detection unit and an adaptive modulation and coding controller. The low-power control module includes an independent power management integrated circuit and an external hardware watchdog. The local storage module includes a serial Flash for storing differential patches and a ferroelectric memory for saving the algorithm context.
[0014] In the preferred embodiment, the data acquisition and processing module is connected to the sensor acquisition module via an isolated bus, and the data acquisition and processing module is configured to periodically read the coulomb counter register of the power management integrated circuit to obtain accurate remaining power data to participate in the calculation of the communication link quality scoring function.
[0015] This invention provides an automatic monitoring method for valve wells. The technical solution employed in this invention, through in-depth optimization of both hardware and software, significantly improves the overall performance of the valve well monitoring system across multiple dimensions. Firstly, this invention greatly enhances the accuracy of monitoring data and the system's anti-interference capability. By introducing a sensor self-checking mechanism based on frequency response characteristic analysis, the device can automatically assess the sensor's health status and perform gain compensation before each data acquisition, effectively solving the measurement error problem caused by sensor aging after long-term use. Combined with wavelet transform time-frequency domain denoising and multi-source heterogeneous data fusion verification technology, the system can accurately identify and filter out water level fluctuation noise caused by ground vehicle vibration, and utilize the correlation analysis between humidity and gas concentration to eliminate false alarms caused by condensation, ensuring the authenticity and effectiveness of each alarm.
[0016] Secondly, this invention achieves an optimal balance between system power consumption and real-time response capability. Through the designed adaptive dynamic benchmark algorithm and hierarchical sampling strategy, the device can automatically adjust its working mode according to the stability of the environment. Under normal conditions, it maintains low-power silent monitoring, and automatically switches to high-frequency sampling to capture transient characteristics when abnormal fluctuations are detected. In conjunction with a dynamic data reporting strategy based on risk level, the system only activates the high-energy-consuming communication link when a real danger occurs, while under normal conditions, it adopts differential compression and packet delay transmission, which greatly reduces the number of wake-up calls and data throughput of the wireless communication module, thereby significantly extending the device's battery life without sacrificing security.
[0017] Furthermore, this invention enhances the system's communication reliability and ease of operation and maintenance in complex underground environments. By utilizing token bucket flow control and channel contention backoff mechanisms, the device can intelligently adapt to weak underground network environments, avoiding invalid forced transmissions during signal congestion and reducing packet loss and power waste. Simultaneously, the remote firmware update and automatic rollback mechanism based on differential patching allows administrators to complete algorithm upgrades and fault repairs for large-scale devices without going to the site. Moreover, the unique dual-partition design ensures that even if a power outage or network interruption occurs during the upgrade process, the device can automatically recover to the previous stable version, completely eliminating the risk of traditional devices becoming unusable and significantly reducing the overall lifecycle maintenance costs. Attached Figure Description
[0018] The present invention will be further described below with reference to the accompanying drawings and embodiments: Figure 1 This is a schematic diagram of the automatic monitoring system for valve wells of the present invention.
[0019] Figure 2 is a flowchart of the automatic monitoring method for valve wells of the present invention. Detailed Implementation
[0020] Example 1 like Figure 1-2 As shown, an automatic monitoring method for valve wells includes: S1. In response to the system wake-up event, the sensor health self-test based on frequency response characteristic analysis is performed through the sensor acquisition module, and after the self-test is passed, multi-dimensional environmental raw data and wireless signal quality data in the valve well are acquired according to the hierarchical sampling strategy. S2. The data acquisition and processing module performs time-frequency domain denoising based on wavelet transform and multi-source heterogeneous data fusion verification on the original multi-dimensional environmental data to generate high-confidence monitoring results. S3. Use the adaptive dynamic benchmark algorithm and trend evolution prediction model to extract abnormal features from the monitoring results, determine the current system status, and generate a risk level including confidence weights. S4. Dynamically calculate transmission priority based on wireless signal quality data and risk level, perform differentiated data compression and adaptive reporting, save algorithm context after task completion and control system to enter deep sleep mode.
[0021] This embodiment proposes an automatic monitoring method for valve wells, which is implemented through the collaborative operation of the system's main control unit, sensor acquisition module, data processing module, and wireless communication module. The method first executes step S1, which, in response to a system wake-up event, performs a sensor health self-check based on frequency response characteristic analysis through the sensor acquisition module. After passing the self-check, it acquires multi-dimensional environmental raw data and wireless signal quality data within the valve well according to a hierarchical sampling strategy. In this step, the system is typically in a state of timed wake-up or external interrupt wake-up. The specific implementation of the sensor health self-check utilizes electrochemical impedance spectroscopy (EIS). The main control unit controls the excitation circuit to apply a small sinusoidal voltage signal as a disturbance to the electrochemical sensor. The frequency range of this signal typically covers the low-frequency to high-frequency region. Upon excitation, the sensor generates a corresponding response current. The system acquires this response current and calculates its ratio to the excitation voltage to obtain the sensor's complex impedance. The system then fits the measured complex impedance data with a pre-stored equivalent circuit model to calculate the charge transfer resistance. If the rate of change of the charge transfer resistance value relative to the factory reference value exceeds the preset aging threshold, the system will automatically increase the gain coefficient of the front-end signal amplifier to compensate for the decrease in sensitivity caused by aging. If the rate of change exceeds the failure threshold, the sensor is marked as faulty and subsequent data acquisition is stopped. After passing the self-test, the system enters the data acquisition phase. The tiered sampling strategy means that the system first reads the output data of the triaxial accelerometer and calculates its variance over a short period of time. If the variance is lower than the preset static threshold, it indicates that the valve well is in a static state, and the system reads the methane concentration, water level, and temperature data at a low-power base sampling frequency. If the variance is higher than the static threshold, it indicates that the valve well may be affected by the passage of ground vehicles or vibration of the manhole cover. The system automatically switches to a high-frequency oversampling mode, increases the sampling frequency to capture transient changes, and simultaneously activates an anti-aliasing filter to prevent signal distortion.
[0022] Then, step S2 is executed, where the data processing module performs time-frequency domain denoising based on wavelet transform and multi-source heterogeneous data fusion verification on the original multidimensional environmental data to generate high-confidence monitoring results. Considering the prevalence of non-stationary noise in the valve well environment, this embodiment uses wavelet packet transform to denoise the original data. Specifically, the Daubechies wavelet system is selected as the basis function, and the acquired data sequence is decomposed into multiple layers to obtain high-frequency detail coefficients and low-frequency approximation coefficients in different frequency bands. For the noisy high-frequency detail coefficients, an improved soft thresholding function is used for processing. The calculation formula for the soft thresholding function is as follows: ; In the above formula, Represents the processed wavelet coefficients. Represents the original wavelet coefficients. For symbolic functions, This is an adaptive threshold. The selection of thresholds is usually based on a common threshold criterion, i.e. ,in This is an estimate of the standard deviation of the noise. The signal length is given. This formula effectively filters out random noise while preserving the signal's abrupt changes. After denoising, multi-source heterogeneous data fusion verification is performed. The system constructs a multi-dimensional feature vector containing temperature, humidity, gas concentration, and water level data, and calculates the Mahalanobis distance between this feature vector and the historical normal state dataset. The calculation formula is as follows: ; In the above formula, Indicates the distance to Maharanobis. This is the currently collected multidimensional feature vector. This is the mean vector of historical normal data. It is the inverse of the covariance matrix of historical normal data. This represents the transpose operation. If the calculated result is... If the value is less than the preset threshold, the current data is considered a valid monitoring result. If the value exceeds the threshold, the system will further analyze the correlation between humidity and gas concentration. If the two show a significant positive correlation, it will be determined as water vapor interference and the gas concentration data will be corrected to generate a high-confidence monitoring result.
[0023] Next, step S3 is executed, where anomaly features are extracted from the monitoring results using an adaptive dynamic benchmark algorithm and a trend evolution prediction model to determine the current system state and generate a risk level including confidence weights. Traditional fixed threshold methods are prone to false alarms; therefore, this embodiment uses an exponentially weighted moving average algorithm to construct a dynamic benchmark that changes slowly with the environment. The update formula for the dynamic benchmark is as follows: ; In the above formula, This represents the dynamic baseline value at the current moment. This represents the dynamic baseline value at the previous moment. This represents the high-confidence monitoring results at the current moment. This is a smoothing coefficient, ranging from 0 to 1, used to adjust the sensitivity of the baseline to the current data. The system calculates the current monitoring results and the dynamic baseline value. The system calculates the Z-Score standardized score by analyzing the deviation and combining it with the volatility of the data. Simultaneously, it constructs a trend evolution prediction model using monitoring data from several recent periods, fitting the slope of data changes using the least squares method to extrapolate the numerical trend within a preset time window. Combining the Z-Score score and trend prediction results, the system calculates the risk confidence weight. The calculation logic is as follows: ; In the above formula, and Here, |Z| represents the weighting coefficient, |Z| is the absolute value of the Z-Score, and k is the predicted slope. The predicted time window length. Based on the calculated... Based on the value, the system classifies the current status into three levels: normal, warning, and alarm. The generated risk level data includes specific risk information. The value is used as the basis for confidence level.
[0024] Finally, step S4 is executed, dynamically calculating the transmission priority based on wireless signal quality data and risk level, performing differentiated data compression and adaptive reporting, saving the algorithm context after task completion, and controlling the system to enter deep sleep mode. The system reads the reference signal received power and signal-to-noise ratio of the wireless communication module in real time. Transmission priority The calculation formula is as follows: ; In the above formula, The risk confidence weights calculated in step S3 The absolute value of the reference signal received power. As a regulating factor. When A high value indicates a high risk or an excellent signal, and the system is set to high-priority transmission; when When the value is low, it is set to low priority. For high-priority data, the system uses a lossless compression algorithm such as LZ77 for encoding and attempts to establish a connection and report immediately. For low-priority data, the system uses a rotating door compression algorithm for lossy compression, retaining only critical data points that exceed the compression deviation threshold, and temporarily storing the data in a local buffer, waiting to accumulate to a certain amount or for the signal to improve before reporting in batches. After all data processing and communication tasks are completed, the system will set the current dynamic baseline value. Smoothing coefficient The state variables of the Kalman filter are written to non-volatile memory to save the algorithm context. Then, the system shuts down all peripheral power except for the real-time clock wake-up circuit, entering a deep sleep mode with microampere current, awaiting the next wake-up.
[0025] The automatic valve well monitoring method provided by this invention has significant advantages. First, through sensor health self-check based on frequency response characteristic analysis, this method can identify sensor aging and failure at the physical level. Combined with automatic gain compensation, it solves the problem of long-term monitoring accuracy decline caused by sensor zero-point drift in traditional methods. Second, denoising based on wavelet transform and data fusion verification using Mahalanobis distance effectively eliminates environmental noise and cross-interference at the algorithm level, especially distinguishing between real leaks and water vapor interference, significantly reducing the false alarm rate. Third, the application of adaptive dynamic benchmark algorithm and trend evolution prediction model enables the system to adapt to seasonal or long-term slow environmental changes instead of relying on a single rigid fixed threshold, improving the ability to capture subtle abnormal trends. Finally, based on differentiated compression and reporting strategies according to transmission priority, optimal configuration of communication resources and power consumption is achieved. While ensuring the real-time arrival of high-risk data, the maintenance cycle of the battery-powered system is extended to the maximum extent, solving the technical problem of short equipment battery life in underground weak network environments.
[0026] In the preferred embodiment, the sensor health self-check and graded sampling strategy based on frequency response characteristic analysis in step S1 includes: During the sensor preheating stage, multiple sets of sinusoidal perturbation signals of different frequencies are applied to the electrochemical sensor, the sensor's response current is collected, and a Nyquist impedance spectrum is constructed in memory. The nonlinear least squares method is used to fit the constructed impedance spectrum to the pre-set Landers equivalent circuit model, and the parameter values of charge transfer resistance and double layer capacitance are calculated. Determine whether the rate of change of charge transfer resistance exceeds the preset aging threshold. If it does, automatically adjust the signal gain compensation coefficient of the analog front end. If it does not exceed the threshold, maintain the current gain. During the formal sampling phase, the variance value of the triaxial accelerometer is first read. If the variance value is lower than the static threshold, environmental data is collected in low-frequency mode. If the variance value is higher than the static threshold, it is determined that there is external vibration interference, and the system automatically switches to high-frequency oversampling mode and activates the anti-aliasing filter.
[0027] Step S1 in this embodiment mainly includes two core components: sensor health self-check based on frequency response characteristic analysis and a graded sampling strategy based on environmental conditions. During the sensor warm-up stage, the system applies multiple sets of sinusoidal perturbation voltage signals of different frequencies to the counter electrode of the electrochemical sensor through the microcontroller's analog-to-digital converter module. The frequency range of these sinusoidal perturbation signals covers the kinetic control region and diffusion control region of the electrochemical reaction, and is typically set as a scanning sequence from low to high frequency. Simultaneously with the perturbation, the system uses a high-precision analog-to-digital converter to synchronously acquire the response current signal fed back from the working electrode. Based on Ohm's law and the phase difference principle, the system calculates the complex impedance at each frequency point, where the complex impedance includes both real and imaginary impedances. The system constructs a Nyquist impedance spectrum in memory, with the real impedance as the horizontal axis and the negative imaginary impedance as the vertical axis. This spectrum typically presents as a combination of a semicircle and a diagonal line, where the semicircle corresponds to the charge transfer process and the diagonal line corresponds to the mass diffusion process.
[0028] Subsequently, the system uses a nonlinear least squares algorithm to iteratively fit the constructed Nyquist impedance spectrum to a pre-defined Landers equivalent circuit model. The Landers equivalent circuit model includes solution resistance, charge transfer resistance, double-layer capacitance, and Weber impedance. The charge transfer resistance and double-layer capacitance are connected in parallel, and this parallel structure is then connected in series with the solution resistance. The fitting objective is to minimize the sum of squared errors between the measured impedance data points and the theoretical impedance data points calculated by the model. The mathematical expression of the fitting process is as follows: ; In the above formula, The objective function represents the sum of squared errors. This represents the total number of test frequency points. and They represent the frequencies respectively. The real and imaginary parts of the impedance obtained from the measurement. and They represent the parameters based on the model. The calculated real and imaginary parts of the theoretical impedance, where the parameter set... Includes the charge transfer resistance to be determined. and double-layer capacitor The algorithm is used to solve for... By minimizing the parameter value, the current charge transfer resistance can be accurately obtained. .
[0029] After obtaining the current charge transfer resistance, the system performs an aging condition assessment and automatic gain compensation. The magnitude of the charge transfer resistance is negatively correlated with the active surface area of the catalyst inside the electrochemical sensor. As the sensor is used for longer periods, catalyst poisoning or electrolyte drying can lead to… The value has increased significantly. The system calculates the rate of change of the current charge transfer resistance relative to the factory initial value. The calculation formula is as follows: ; In the above formula, This is the charge transfer resistance obtained from the current fitting. This is the factory-installed charge transfer resistor stored in the device's read-only memory. The system will calculate the rate of change. Compare with the preset aging threshold. If Exceeding the aging threshold indicates a significant decrease in sensor sensitivity. At this point, the system... The value is automatically adjusted by a digital potentiometer to change the gain coefficient of the analog front-end signal conditioning circuit, which increases the feedback resistor value of the transimpedance amplifier, thereby offsetting the signal amplitude loss caused by the decrease in sensor sensitivity and ensuring the accuracy of the output signal. If the aging threshold is not exceeded, the current gain coefficient remains unchanged.
[0030] After completing the self-test and entering the formal sampling phase, the system executes a tiered sampling strategy to cope with external environmental interference. The system first wakes up the microelectromechanical system's triaxial accelerometer, reads its triaxial acceleration data within a short time window, and calculates the variance of the acceleration vector magnitude. The formula for calculating the variance is as follows: ; In the above formula, The number of sampling points. For the first The magnitude of the acceleration vector at each sampling point This represents the mean acceleration within the sampling window. The system will calculate the variance value. The variance is compared with a preset static threshold. If the variance is lower than the static threshold, it indicates that the valve well has not been affected by severe external vibrations such as vehicles running over the manhole cover, and the fluid and gas state inside the well is relatively stable. In this case, the system uses a low-frequency mode to collect environmental data, i.e., reducing the sampling rate of the analog-to-digital converter to reduce system power consumption. If the variance is higher than the static threshold, it indicates that there is significant external vibration interference. This vibration can cause ripples on the surface of the water level inside the well or cause a micro-noise effect in the gas sensor. In this case, the system automatically switches to a high-frequency oversampling mode, increasing the sampling rate to more than twice that of the highest frequency component of the signal, and activates the digital anti-aliasing filter. The digital anti-aliasing filter can filter out noise components higher than the Nyquist frequency, preventing high-frequency vibration noise from folding into the effective signal frequency band, thereby ensuring the authenticity of the data collected under dynamic interference environments.
[0031] The technical solution detailed in this embodiment has significant beneficial effects. First, by introducing a sensor health self-checking mechanism based on electrochemical impedance spectroscopy, quantitative assessment and in-situ compensation of the sensor's aging state are achieved. This not only solves the high maintenance cost problem caused by traditional periodic sensor replacement, but also ensures the measurement accuracy of the sensor throughout its entire life cycle through automatic gain correction, avoiding missed or false alarms caused by sensitivity drift. Second, based on the nonlinear least squares fitting of the Landels model, the charge transfer resistance, a key aging indicator, can be accurately separated from the complex impedance response, eliminating interference from non-aging factors such as solution resistance fluctuations. Finally, the hierarchical sampling strategy based on acceleration variance cleverly balances the requirements for low power consumption and anti-interference. Low-frequency sampling in a static state saves power to the maximum extent, while automatically switching to high-frequency oversampling and anti-aliasing filtering under vibration interference conditions effectively eliminates the interference of external mechanical vibrations such as passing vehicles on water level and gas monitoring data, ensuring the robustness and reliability of monitoring data in complex urban road environments.
[0032] In the preferred embodiment, step S2, which involves wavelet transform-based time-frequency domain denoising and multi-source heterogeneous data fusion verification, includes: By selecting a preset wavelet basis function, multi-level wavelet packet decomposition is performed on the collected non-stationary environment raw data sequence to obtain high-frequency detail coefficients and low-frequency approximation coefficients in different frequency bands. An adaptive soft thresholding function is used to shrink the high-frequency detail coefficients, remove random noise components, and a reconstruction algorithm is used to synthesize the denoised clean data sequence. Construct a multidimensional feature vector containing temperature, humidity, gas concentration, and water level data, and calculate the Mahalanobis distance between this feature vector and the historical normal state dataset; The calculated Mahalanobis distance is compared with the critical value of the chi-square distribution. If the distance is less than the critical value, the data are determined to be strongly correlated and valid. If the distance is greater than the critical value, the slope of the humidity data change is further analyzed. If the slope of the humidity change is positively correlated with the slope of the gas concentration change, it is determined to be water vapor interference, and the gas concentration data is negatively corrected.
[0033] Step S2 in this embodiment mainly involves deep cleaning of environmental monitoring data and multi-source data fusion verification, aiming to eliminate non-stationary noise interference and identify sensor false alarms caused by environmental cross-factors. When performing this step, the data acquisition and processing module first selects a preset wavelet basis function, such as the Daubechies wavelet or Symlet wavelet, to perform multi-level wavelet packet decomposition on the acquired raw environmental data sequence with non-stationary characteristics. Wavelet packet decomposition can finely divide the signal frequency band at multiple levels, decomposing not only the low-frequency part but also the high-frequency part, thereby obtaining high-frequency detail coefficients and low-frequency approximation coefficients in different frequency bands. Subsequently, the system uses an adaptive soft thresholding function to shrink the high-frequency detail coefficients obtained from the decomposition to remove random noise components contained in the detail coefficients. The mathematical expression of the adaptive soft thresholding function is as follows: ; In the above formula, Indicates the processed number of... Layer Wavelet coefficients, Represents the original wavelet coefficients. For symbolic functions, For the first An adaptive threshold for the layer decomposition coefficients. This threshold... It is usually calculated based on the statistical properties of the coefficients of this layer, for example, using the formula. ,in This is an estimate of the standard deviation of the noise in this layer. The signal length is denoted as . After threshold shrinkage, the system uses a wavelet packet reconstruction algorithm to synthesize the processed high-frequency detail coefficients with the unprocessed low-frequency approximation coefficients, thus obtaining a denoised clean data sequence. This process effectively preserves the abrupt changes in the signal while filtering out high-frequency random noise.
[0034] After denoising the data, the system performs multi-source heterogeneous data fusion verification to evaluate the validity of the data and eliminate cross-interference. The system constructs a multi-dimensional feature vector containing temperature, humidity, gas concentration, and water level data. And calculate the feature vector. Mahalanobis distance to the historical normal state dataset. Mahalanobis distance is a distance metric that eliminates differences in the dimensions of variables and takes into account the correlation between variables. Its calculation formula is as follows: ; In the above formula, This represents the calculated Mahalanobis distance. The multidimensional feature vector constructed for the current moment. This is the mean vector of the historical normal state dataset. It is the inverse of the covariance matrix of the historical normal state dataset. This indicates the transpose operation. The system will use the calculated Mahalanobis distance. Compared with the preset chi-square distribution critical value Perform a comparison. If... If so, it is determined that the current multidimensional data has a strong correlation, conforms to the historical normal pattern, and the data is valid and reliable. This indicates that the data pattern deviates from the normal state, and there may be anomalies or interference. At this point, the system further analyzes the slope of the humidity data change. slope of change in gas concentration data If the system detects the slope of the humidity change. It is a positive value, and the slope of the gas concentration change is... If the correlation coefficient between the two values is also positive and greater than the preset positive correlation threshold, then the increase in the current gas concentration is determined to be caused by condensation interference from water vapor entering the sensor, rather than a real leak. In this case, the system performs a negative correction operation on the gas concentration data, using the following formula: ; In the above formula, This is the corrected gas concentration value. This is the current measurement value. Humidity interference coefficient, This is the current humidity value. This serves as the humidity baseline. Through this correction step, the system is able to restore the true gas concentration level.
[0035] In the preferred embodiment, the adaptive dynamic benchmark algorithm and trend evolution prediction model in step S3 include: A weighted moving average model incorporating a forgetting factor is established to iteratively calculate historical monitoring data, giving greater weight to data closer to the current moment, thereby updating the current dynamic background baseline. Calculate the deviation between the current high-confidence monitoring results and the dynamic background baseline, and calculate the current Z-Score standardized score by combining the data's volatility variance; A trend prediction model based on differential autoregressive moving average is constructed. The time series curve is fitted using monitoring data from the most recent N periods, and the numerical evolution trend within a preset time window is extrapolated. If the Z-Score standardized score exceeds the preset statistical anomaly limit, or if the extrapolated prediction value indicates that the safety red line will be reached in the future, the risk confidence weight is calculated based on the integral of the product of the anomaly magnitude and duration, and a graded alarm instruction is generated.
[0036] Step S3 in this embodiment mainly involves establishing a dynamic environmental baseline using an adaptive algorithm and combining statistical analysis and trend prediction techniques to accurately determine the system state. When performing this step, the system first establishes a weighted moving average model incorporating a forgetting factor to update the current dynamic background baseline. Since environmental parameters within the valve well, such as methane background concentration or water level, drift slowly with changes in season, temperature, or atmospheric pressure, a fixed alarm threshold cannot adapt to these changes. Therefore, the system introduces a forgetting factor to iteratively calculate historical monitoring data, assigning greater weight to data closer to the current moment, thus enabling the baseline to closely follow long-term environmental trends while maintaining a certain lag for instantaneous fluctuations. The iterative update formula for the dynamic background baseline is as follows:
[0037] In the above formula, Indicates the current time The dynamic background reference value, This represents the dynamic background reference value at the previous moment. This represents the high-confidence monitoring results at the current moment. This is the forgetting factor, with a value between 0 and 1, used to adjust the model's sensitivity to new data. When... When the value is large, the baseline updates quickly and is highly adaptable; when... When the value is small, the baseline updates slowly but is more stable. Using this formula, the system can calculate the current dynamic background baseline in real time, serving as a reference for determining whether the data is abnormal.
[0038] After obtaining the dynamic background baseline, the system calculates the deviation of the current high-confidence monitoring result from the dynamic background baseline, and combines this with the data's variance to calculate the current Z-Score standardized score. The Z-Score standardized score is used to measure the statistical significance of the current monitoring value's deviation from the baseline value. To accurately calculate the Z-Score, the system also needs to update the dynamic variance of the environmental data in real time. The formula for updating the dynamic variance is as follows: Based on the aforementioned dynamic variance, the formula for calculating the Z-Score standardized score is as follows: ; In the above formula, This is the estimated dynamic variance at the current moment. This is the estimated dynamic variance value from the previous time step. This is the standardized Z-Score for the current moment. This score is a dimensionless value that intuitively reflects how many times the current monitored value deviates from the background baseline compared to the standard deviation. If... A large value indicates that the current data deviates from the normal fluctuation range, and there is a high possibility of an anomaly.
[0039] To achieve early warning of potential risks, the system constructs a trend prediction model based on differential autoregressive moving average. This model fits a time series curve using monitoring data from the most recent N periods, eliminates non-stationary trends by analyzing the differencing characteristics of the data, and captures the intrinsic correlation of the data using autoregressive and moving average terms. It then extrapolates the numerical evolution trend within a preset future time window. The mathematical expression of the prediction model is as follows: ; In the above formula, Indicates the future number The predicted value at each time step, The mean of the data. Let the order be the autoregressive order. These are the autoregressive coefficients. The moving average order is... The moving average coefficient is... This represents the white noise error term. In practical embedded systems, first-order or second-order differences are typically used to simplify calculations. Using this model, the system can predict the trajectory of environmental parameter changes over a future period and determine whether these changes will trigger safety limits.
[0040] Finally, the system performs a risk assessment by combining the Z-Score standardized score with the trend prediction results. If the calculated Z-Score standardized score exceeds a preset statistical anomaly limit, or if the extrapolated prediction indicates that a safety threshold will be reached in the future, the system does not immediately issue an alarm, but instead proceeds to the risk confidence level calculation stage. The system calculates the risk confidence level weight based on the integral of the product of the anomaly magnitude and its duration to distinguish between genuine fault risks and occasional transient disturbances. Risk Confidence Level Weight The calculation formula is as follows: ; In the above formula, As the risk confidence level weight, The moment the anomaly began. For the current moment, For a moment Z-Score value, The preset abnormal trigger threshold, This is a unit step function. The integral formula actually calculates the area of the abnormal waveform exceeding the threshold, i.e., the abnormal energy. Only when the accumulated risk confidence weights... The system only generates a tiered alarm command when the set alarm confirmation threshold is exceeded. This mechanism ensures that the alarm command has a very high degree of confidence and avoids false alarms caused by glitches.
[0041] The technical solution detailed in this embodiment has significant beneficial effects on anomaly monitoring and risk assessment. First, by establishing a weighted moving average model incorporating a forgetting factor, the system can adaptively follow the slow drift of environmental parameters and dynamically adjust the background baseline, thus solving the problem of fixed threshold methods easily failing after seasonal changes or long-term sensor operation, significantly improving the robustness of monitoring. Second, by introducing Z-Score standardization, the judgment of absolute values is transformed into a judgment of statistical significance, enabling the system to uniformly handle environmental parameters of different dimensions and automatically adjust sensitivity according to the fluctuation characteristics of the data. Third, by constructing a trend prediction model based on differential autoregressive moving average, the system is given the ability to "foresee the future," issuing early warnings when the value has not yet exceeded the limit but the trend has already deteriorated, buying valuable time for maintenance personnel to handle the situation. Finally, by using the integral of the product of anomaly amplitude and duration to calculate the risk confidence weight, the concept of energy integral is introduced, effectively filtering transient interference such as spikes and pulses. Only continuous anomalies with a certain intensity will trigger an alarm, greatly reducing the false alarm rate of the system and ensuring that every alarm has actual handling value.
[0042] In the preferred scheme, step S4, which involves dynamically calculating transmission priority and adaptive reporting, includes: The reference signal received power (RSRP) and signal-to-interference-plus-noise ratio (SINR) of the wireless communication module are read in real time, and a communication link quality scoring function is constructed by combining the remaining battery power. Establish a priority queue for data transmission, marking emergency alarm data as high priority and periodic routine data as low priority; The token bucket algorithm is used to shape the traffic of the reported requests. If the communication link quality score is lower than the preset threshold, the token issuance rate is automatically reduced, and only high-priority data is allowed to pass through. Before sending data, monitor the channel status. If channel congestion is detected, execute the exponential backoff algorithm to calculate a random waiting time, and re-initiate the connection request after the waiting time expires, until the data is successfully sent or the maximum number of retries is reached.
[0043] Step S4 in this embodiment mainly involves how to dynamically schedule communication resources by sensing link status in a complex underground wireless environment to achieve an optimal balance between power consumption and data timeliness. When executing this step, the system first queries the underlying registers of the wireless communication module using the AT command set to read the Reference Signal Received Power (RSRP) and Signal-to-Interference-plus-Noise Ratio (SINR) in real time. Simultaneously, the system reads the current remaining battery power through the power management unit. The system uses the above three parameters to construct a communication link quality scoring function, which is used to quantitatively evaluate the success rate and energy consumption cost of data transmission at the current moment. (Communication Link Quality Scoring) The calculation formula is as follows: ; In the above formula, and These are the minimum and maximum receive power limits specified for the communication module, respectively. and These are the lower and upper limits of the signal-to-noise ratio, respectively. This represents the battery's full charge capacity. , , These are normalized weight coefficients, and satisfy... This formula maps physical quantities of different dimensions to dimensionless scores between 0 and 1. When A low value indicates poor signal quality or insufficient battery power. Forcing data transmission will result in a high packet loss rate and excessive power consumption.
[0044] After obtaining the link score, the system establishes a priority queue management mechanism for data transmission. The system allocates two independent first-in-first-out queues in memory, named the high-priority queue and the low-priority queue, respectively. For emergency data with a risk level of warning or alarm generated in step S3, the system tags it with a high-priority label and pushes it into the high-priority queue; for periodic routine monitoring data, the system pushes it into the low-priority queue. Subsequently, the system uses the token bucket algorithm to perform traffic shaping on the reporting requests. The token bucket algorithm limits the data transmission frequency by controlling the token generation rate. In this embodiment, the token issuance rate... Communication link quality score They are positively correlated, and their dynamic adjustment formula is: ; In the above formula, Based on the basic token issuance rate, To adjust the sensitivity coefficient. When the link quality score... When the token issuance rate is below a preset threshold, This significantly reduces the number of available tokens in the bucket. At this point, the system implements a strict admission control policy: sending a high-priority data packet consumes... One token, while sending a low-priority data packet consumes [amount]. 1 token, of which Much larger This mechanism ensures that, under conditions of weak network or low power, limited communication resources are allocated only to emergency alarm data, while regular data is either temporarily stored locally or discarded because it cannot obtain enough tokens.
[0045] Before a data packet obtains a transmission token and prepares to access the network, the system executes channel sensing and collision avoidance logic. The system checks if the wireless channel is occupied; if channel congestion is detected or an acknowledgment frame is not received from the server within a specified time after data transmission, the transmission is considered a failure. At this point, the system executes a binary exponential backoff algorithm to calculate a random waiting time to distribute network load. Random waiting time. The calculation formula is as follows: ; In the above formula, This is the basic time slot length, which is usually an integer multiple of the wireless frame length. This is the current number of retries. Indicates from 0 to A value is randomly selected from the integer range. The number of retries increases. As the value of increases, the range of values for the waiting time expands exponentially. The system's waiting time... After the connection is completed, a new connection request will be initiated. If the number of retries reaches the preset maximum value... If the transmission still fails, the system will abandon the attempt and write the data to the local power-loss protection storage area. Then, it will force the wireless communication module into a sleep state to prevent the battery from being depleted due to infinite retries.
[0046] The technical solution detailed in this embodiment has significant beneficial effects on communication scheduling and energy consumption management. First, by constructing a communication link quality scoring function that integrates signal quality and remaining battery power, the system can intelligently perceive the environment and its own "health status," avoiding blindly sending data in high-energy-consuming areas with extremely poor signal strength, effectively extending battery life. Second, the priority-based token bucket traffic shaping mechanism creatively solves the bandwidth allocation problem in underground weak network environments, ensuring that critical alarm information such as methane leaks can be prioritized for transmission when communication resources are limited, while lower-value-density routine data automatically yields, reflecting the "safety first" design principle. Finally, the introduction of an exponential backoff algorithm to handle channel congestion not only improves the transmission success rate of individual devices in unstable networks but also reduces the probability of base station congestion caused by large-scale simultaneous wake-up and reporting by devices, improving the stability and robustness of the entire monitoring network.
[0047] In the preferred embodiment, the differential data compression step in this method includes: For alarm data marked as high priority, lossy compression is not performed; instead, the LZ77 lossless compression algorithm is used directly for encoding to preserve the complete waveform characteristics. For regular data marked as low priority, the Rotating Door Compression (SDT) algorithm is used to process it, calculate the slope between the data points and the compression door, and retain only the key inflection point data that exceeds the range of the compression door parallelogram. The compressed data payload is divided into fixed-length transmission units, and a Cyclic Redundancy Check (CRC32) code is calculated for each transmission unit. The check code is appended to the end of the data for integrity verification at the receiving end.
[0048] The differentiated data compression step in this embodiment is a crucial step in balancing data transmission timeliness, integrity, and communication bandwidth consumption. During this step, the system employs drastically different processing strategies based on the data priority determined in step S4. For alarm data marked as high priority, such as methane concentration mutation waveforms or records of rapid water level increases, the system determines that each sampling point it contains may be of significant value for subsequent accident tracing. Therefore, no lossy compression is performed; instead, the LZ77 lossless compression algorithm is directly used for encoding. The core idea of the LZ77 algorithm is to utilize the repetitiveness of data, using a "sliding window" mechanism to check whether the string in the current data buffer has appeared in the historical buffer. The system maintains a sliding window containing a search buffer and a look-ahead buffer. For the current character sequence to be encoded in the look-ahead buffer, the system searches for the longest matching string in the search buffer. If a match is found, the system outputs a triplet marker. .in, This represents the offset of the matched string relative to the current position. Indicates the length of the matched string. This indicates the first non-matching character after the matched string. By replacing repeated long strings with short pointer markers, the system can significantly reduce the data volume without losing any original waveform characteristics, ensuring that the alarm data received by the ground center is consistent with the original data collected downhole at the bit level.
[0049] For routine data marked as low priority, such as periodic records of stable temperature and humidity changes, the system employs a lossy rotating door compression algorithm (SDT) to minimize storage space and transmission bandwidth usage. The rotating door algorithm, based on geometric principles, aims to preserve key inflection points in data trends while filtering out redundant data within linear trends. The system sets a compression deviation threshold. Using the most recently saved data point Using the fulcrum as a reference point, construct two imaginary "doors," corresponding to the upward and downward opening slopes, respectively. For each subsequent new sampling point... The system calculates the upper bound of the fluctuation range from the fulcrum to that point. slope And the lower bound of the fluctuation range from the fulcrum to that point. slope The calculation formula is as follows: ; ; During continuous sampling, the system maintains the currently allowed slope channel in real time, that is, it records the minimum upper bound slope calculated from all historical points. and the maximum lower bound slope The angle formed by these two slopes is the current opening of the "gate". With new data points... With the addition of [the feature], the system updates the slope channel: ; ; If at a certain moment, the calculated Greater than This indicates that the current slope channel has closed and can no longer accommodate new data points; that is, the current data point... It has exceeded the limit set by the previous reserved point. And the parallelogram range defined by the current slope channel. At this point, the system determines the previous data point. As a key turning point, it should be retained as valid data and... Set as the new fulcrum The slope channel is reset, and the next round of compression begins. This algorithm can efficiently filter out data points that change linearly or nearly linearly, retaining only the inflection points of the curve, with a compression ratio typically exceeding 10:1.
[0050] After completing the compression process described above, the system divides the compressed data payload into fixed-length transmission units, typically 256 or 512 bytes, to facilitate packet transmission over the network. To ensure that data does not experience bit flipping or loss during transmission through complex wireless channels, the system calculates a Cyclic Redundancy Check (CRC32) code for each transmission unit. The CRC32 algorithm treats the data block as a large binary number. And select a specific 32nd order generator polynomial For example, the international standard IEEE 802.3 polynomial. The system performs modulo-2 division to calculate... Left shift by 32 bits and then divide by The remainder obtained The mathematical expression of the computational logic is as follows: ; The 32-bit remainder obtained This is the checksum. The system appends this checksum to the end of the data unit. Upon receiving the data, the receiving end uses the same generator polynomial... Perform a modulo-2 division operation on the complete data packet containing the checksum. If the remainder is 0, it indicates that the data transmission is complete and error-free; if the remainder is not 0, it indicates that the data was corrupted during transmission, and the receiving end will discard the packet and request a retransmission.
[0051] The differentiated data compression and transmission verification scheme detailed in this embodiment has significant beneficial effects. First, by distinguishing between high-priority alarm data and low-priority routine data, the system adopts a dual-track strategy of "fidelity preservation" and "data reduction." Alarm data is compressed using LZ77 lossless compression, ensuring the integrity of the original waveform data at the time of the incident, providing irrefutable original evidence for subsequent fault diagnosis and liability determination. Routine data is compressed using SDT lossy compression, which greatly eliminates redundant data without affecting long-term trend analysis, significantly reducing the daily monitoring's impact on communication traffic and storage space, allowing the equipment to maintain a longer operating cycle under battery power. Second, compared to simple dead-zone compression, the rotating door algorithm (SDT) can more sensitively capture data change trends and inflection points, avoiding signal distortion caused by over-compression. Finally, the CRC32-based transmission unit verification mechanism provides a robust integrity barrier for the data link layer, effectively preventing data errors caused by noise interference in underground weak network environments, ensuring that every byte received by the remote monitoring center is accurate and reliable.
[0052] In a preferred embodiment, the method further includes a remote firmware update and rollback step based on differential patching: After receiving the firmware version description file from the server, the system compares the differences between the local firmware version and the target firmware version, and only downloads the binary differential patch package to the buffer of the external Flash memory. The new firmware image is reconstructed in memory using the local old firmware and the downloaded differential patch package, and the reconstructed image is verified by SHA-256 hash. After verification, the new firmware image is written to a separate partition to be activated, and the boot pointer of the bootloader is modified. After the system restarts and loads the new firmware, a watchdog timer is started and a function self-test is performed. If the self-test fails or a system crash occurs, the watchdog resets the system and automatically restores the boot pointer to the old firmware partition, thus achieving a fault rollback.
[0053] The remote firmware update and rollback steps based on differential patches in this embodiment aim to address the risks of high data traffic consumption, long upgrade times, and device paralysis due to upgrade failures inherent in traditional full firmware upgrade methods. During this step, the valve well automatic monitoring system first receives a firmware version description file from the server via its wireless communication module. This description file contains the target firmware version number, file size, checksum, and applicable hardware platform information. The main control unit parses this file and compares the target firmware version number with the currently running local firmware version number. If the target version is higher than the local version, the system requests an update from the server. To maximize bandwidth and power savings, the system does not download the complete target firmware image but only requests a binary differential patch package. This differential patch package is generated by a differential algorithm tool on the server side; it only records the binary differences between the old and new firmware versions, and its size is typically only five to ten percent of the full firmware. The system temporarily stores the downloaded differential patch package in a buffer of external Flash memory, which is independent of the system's runtime area.
[0054] After the differential patch package is downloaded, the system initiates the firmware reconstruction process. The main control unit reads the old firmware image data from the local Flash memory and, combined with the differential patch package in the buffer, reconstructs the complete new firmware image block by block in the system's random access memory (RAM) using a restoration algorithm. After reconstruction, to ensure that no bit errors or malicious tampering occurred during the transmission and reconstruction of the new firmware, the system performs SHA-256 hash verification on the new firmware image in memory. The SHA-256 algorithm is a cryptographic hash function that maps input data of arbitrary length to a fixed-length 256-bit hash value. The verification formula is as follows: ; In the above formula, For the calculated hash value, This is the binary data for the reconstructed firmware. The system will... Compared to the original hash value carried in the firmware version description file A rigorous comparison was conducted. Only when... Completely equal to Only after this point does the system determine that the verification has passed. Subsequently, the system calls the Flash write driver to write the verified new firmware image to the reserved independent partition in the Flash memory that needs to be activated. At this time, both the old firmware partition and the new firmware partition exist simultaneously in the local memory. After the write is complete, the system modifies the boot pointer parameter of the bootloader, pointing it to the partition to be activated, sets a "trial run" flag, and then performs a soft reset to restart the system.
[0055] After the system reboots, the bootloader loads the new firmware based on the boot pointer. In the first stage of new firmware initialization, the system immediately starts a hardware watchdog timer and sets a preset timeout reset period. Next, the system executes a rigorous self-test program, which sequentially checks whether sensor interface communication is normal, whether the wireless module can successfully connect to the network, and whether memory read / write operations are error-free. If all self-tests pass, and the system runs stably within the preset time without crashing or abnormal resets, the system clears the "trial run" flag and marks the new firmware as "officially effective," while simultaneously disabling or feeding the watchdog to maintain operation. Conversely, if the new firmware has defects causing the self-test program to return error codes, or causes a system crash leading to a watchdog timer overflow, the watchdog will force a system reset. During the reset process, if the bootloader detects that the "trial run" flag has not been cleared and an abnormal reset has occurred, it determines that the upgrade has failed. The bootloader automatically executes rollback logic, redirects the boot pointer to the old firmware partition, clears the "trial run" flag, and restarts the device using the old firmware.
[0056] The remote firmware update and rollback scheme detailed in this embodiment has significant beneficial effects. First, by employing binary differential patching technology, the data download volume for firmware updates is reduced by an order of magnitude. This is crucial for NB-IoT or Cat.1 devices that rely on battery power and operate in underground environments with weak network connectivity, greatly reducing the wireless module's startup time and transmission power consumption, and avoiding the risk of device power loss due to excessive power consumption during the upgrade process. Second, the introduction of SHA-256 hash verification and memory reconstruction mechanisms ensures the absolute integrity and security of firmware data, eliminating the possibility of malicious code injection due to network packet loss or man-in-the-middle attacks. Finally, the automatic rollback strategy based on dual partitioning and watchdog mechanisms builds a final line of defense for unattended valve well monitoring equipment, completely solving the pain point of requiring on-site manual repair when equipment becomes "bricked" due to firmware compatibility issues or unexpected bugs, significantly reducing the system's total lifecycle maintenance costs and operational risks.
[0057] In the preferred embodiment, step S4, which involves saving the algorithm context and controlling the system to enter deep sleep mode, includes: The state estimation vector, covariance matrix, and forgetting factor parameters of the dynamic benchmark algorithm of the Kalman filter are written into the non-volatile ferroelectric memory (FRAM) to prevent loss when power is off. Iterate through all peripheral interfaces of the microcontroller, configure pins not connected to external devices as analog input mode, and configure pins connected to external pull-up resistors as open-drain output high-level mode; Send an I2C command to the power management chip to cut off the power supply circuit for the sensor acquisition module and the wireless communication module; Configure the alarm interrupt trigger time of the real-time clock (RTC) and call system instructions to put the kernel into stop mode, retaining only the microampere power supply for the wake-up logic circuit.
[0058] Step S4 in this embodiment mainly involves ensuring the continuity of monitoring services and achieving extremely low-power standby by persistently storing the algorithm state and finely configuring the microcontroller's underlying interface after the system completes the current monitoring task. When executing this step, the system first performs an algorithm context saving operation. Since valve well monitoring systems typically operate in a periodic, intermittent mode, re-initializing the filtering algorithm after each wake-up would cause the algorithm to be in a non-convergent state at the initial startup, resulting in significant estimation errors. Therefore, the system writes the core state parameters of the Kalman filter into the non-volatile ferroelectric memory (FRAM). The specific objects saved include the state estimation vector. And error covariance matrix .in, It represents The system's optimal state estimate is updated based on the observed values at each step. This represents the corresponding estimation error covariance matrix, reflecting the uncertainty of the estimated value. Simultaneously, the system also incorporates the forgetting factor parameter from the dynamic benchmark algorithm. and the current dynamic background baseline value The data is written to FRAM simultaneously. Ferroelectric RAM (FRAM) was chosen instead of ordinary Flash memory because FRAM offers nanosecond-level write speeds and virtually unlimited read / write endurance, capable of handling high-frequency write demands at the minute or even second level. Furthermore, the write process consumes extremely low power, unlike Flash which requires high-voltage erasing. By saving this context, the system can directly read the historical state for a "warm start" upon the next wake-up, eliminating the need for a lengthy algorithm convergence process and ensuring the smoothness and consistency of the monitoring data.
[0059] After data saving is complete, the system enters the GPIO configuration stage of the microcontroller's (MCU) input / output ports to eliminate pin leakage current. The main control unit iterates through all its GPIO pins, configuring them differently for each pin's hardware connection. For floating pins without any external devices connected to the circuit board, the system configures them as analog inputs. In analog input mode, the microcontroller's internal Schmitt trigger is turned off, and the power supply to the digital input buffer is cut off, preventing shoot-through current caused by frequent switching of the input buffer due to ambient electromagnetic noise picked up by floating pins. For pins with external pull-up resistors, the system configures them as open-drain output high-level mode. In this configuration, the internal N-MOS transistor is cut off, the pin exhibits high impedance characteristics, and the level is maintained at a high potential by the external pull-up resistor. This avoids the continuous static leakage current path that would occur if the pin were configured as push-pull output low or normal input pull-down, thus ensuring that the current consumption of all I / O ports is minimized.
[0060] Subsequently, the system performs a board-level power-off operation. The main control unit sends a shutdown command to the onboard power management chip (PMIC) via the I2C bus. Upon receiving the command, the PMIC physically disconnects the output of the low-dropout linear regulator (LDO) or DC-DC converter connected to the power input terminals of the sensor acquisition module and the wireless communication module. This step completely eliminates the static power consumption of the sensor and wireless module in standby mode, ensuring that the current consumption of other parts of the system, except for the main control unit and necessary wake-up circuits, is zero. Finally, the system configures the alarm interrupt trigger time of the real-time clock (RTC). The main control unit calculates the absolute time point of the next wake-up based on the preset acquisition interval and writes this time into the RTC's matching register. After setting, the main control unit calls the stop instruction in the system instruction set to put the kernel into Stop Mode. In Stop Mode, the CPU core clock stops oscillating, all high-speed peripheral clocks are turned off, and only the low-speed RTC clock and wake-up logic circuit maintain microamp-level power supply to maintain the timing function and wait for the next interrupt wake-up.
[0061] The sleep management scheme detailed in this embodiment has significant beneficial effects. First, by using FRAM to store the context of the Kalman filter and dynamic benchmark algorithm, "algorithm hot start" is achieved in low-power intermittent operation mode, avoiding data fluctuations and accuracy loss caused by algorithm re-convergence after each wake-up, and ensuring the continuity of long-term monitoring trends. Second, the refined configuration strategy for GPIO pins eliminates noise flipping leakage of floating pins and static leakage of pull-up circuits at the micro level, compressing the standby current of the microcontroller to its theoretical limit. Finally, by combining the physical power-off of the PMIC with the deep sleep mode of the RTC, a multi-level power consumption defense line at the system level is constructed, enabling the total power consumption of the device during sleep to be as low as microamps, thereby achieving an ultra-long battery life of several years with limited battery capacity, perfectly meeting the practical application requirements of underground valve wells where frequent battery replacements are difficult.
[0062] Example 2 Further explanation in conjunction with Example 1, such as Figure 1-2 The system, as shown, includes: The sensor acquisition module includes an excitation response circuit for constructing impedance spectra and a multi-dimensional environmental sensing unit; The data acquisition and processing module has an embedded digital signal processing (DSP) core, which is used to perform wavelet transforms and matrix operations. The wireless communication module integrates a radio frequency link quality detection unit and an adaptive modulation and coding controller. The low-power control module includes an independent power management integrated circuit and an external hardware watchdog. The local storage module includes a serial Flash for storing differential patches and a ferroelectric memory for saving the algorithm context.
[0063] In the preferred embodiment, the data acquisition and processing module is connected to the sensor acquisition module via an isolated bus, and the data acquisition and processing module is configured to periodically read the coulomb counter register of the power management integrated circuit to obtain accurate remaining power data to participate in the calculation of the communication link quality scoring function.
[0064] This embodiment introduces the hardware architecture of an automatic monitoring system for valve wells, which consists of five core modules working together. The first is the sensor acquisition module, which integrates a specially designed excitation response circuit and a multi-dimensional environmental sensing unit. The excitation response circuit includes a digital-to-analog converter (DAC) and a transimpedance amplifier (TIA). The DAC generates the multi-frequency sinusoidal excitation signal required in step S1, which is applied to the counter electrode of the electrochemical sensor. The TIA is connected to the working electrode and is responsible for converting the weak electrochemical reaction current into a voltage signal, which is then acquired by a high-precision analog-to-digital converter (ADC) to construct an impedance spectrum. The multi-dimensional environmental sensing unit includes a methane sensor, a piezoresistive water level sensor, a MEMS tilt sensor, and a triaxial accelerometer, used to comprehensively sense the physical environmental parameters downhole.
[0065] Secondly, there is the data acquisition and processing module, which serves as the system's computational hub and embeds a high-performance digital signal processing (DSP) core. This DSP core possesses single-cycle multiply-accumulate instruction capabilities and a hardware floating-point unit (FPU), enabling it to efficiently execute complex mathematical operations. Specifically, it is responsible for running the wavelet transform algorithm in step S2, using convolution operations to perform multi-level decomposition and reconstruction of the signal, and performing the Mahalanobis distance calculation involving matrix multiplication and inversion operations in step S2. The introduction of the DSP core allows the system to complete the cleaning and fusion of massive amounts of data within milliseconds without occupying the main frequency for extended periods, thus reducing overall power consumption.
[0066] The wireless communication module integrates an RF link quality detection unit and an adaptive modulation and coding controller. The RF link quality detection unit monitors the received signal strength RSRP and signal-to-noise ratio SINR in real time through hardware registers. The adaptive modulation and coding controller dynamically adjusts the modulation scheme (such as switching from QPSK to BPSK) or spreading factor of the transmitted data based on the data feedback from the link quality detection unit. When the signal quality is poor, the controller automatically reduces the coding rate to improve error correction capability, ensuring that the data can penetrate the thick manhole cover and be transmitted to the ground base station.
[0067] The low-power control module includes an independent power management integrated circuit (PMIC) and an external hardware watchdog. The PMIC integrates multiple low-dropout linear regulators (LDOs) and DC-DC converters, providing independent power supply channels to the sensors, MCU, and wireless module, and accepting I2C commands from the main control unit for branch circuit switching control. The external hardware watchdog is a timer chip independent of the main control MCU, connected to the MCU via a specific I / O pin. The MCU must send a pulse signal to this pin within a preset time to "feed" the watchdog. If the MCU malfunctions due to a software infinite loop or strong electromagnetic interference and fails to feed the watchdog on time, the hardware watchdog will directly pull down the MCU's reset pin, forcing a system restart, thus ensuring high reliability in unattended environments.
[0068] The local storage module employs a hierarchical storage architecture, comprising serial Flash and ferroelectric RAM. The serial Flash, connected to the MCU via the SPI bus, features large capacity and low cost, and is specifically used to store the binary differential patch package downloaded in step S4 and the backup firmware image. The ferroelectric RAM is used to store algorithm context data, such as the Kalman filter state vector and dynamic baseline values. FRAM is non-volatile, has extremely fast write speeds, and virtually unlimited read / write lifespan, making it ideal for storing frequently updated critical process data that cannot be lost after power failure.
[0069] In a preferred embodiment, the data acquisition and processing module is connected to the sensor acquisition module via an isolation bus. This isolation bus employs a digital magnetic isolation chip or an optocoupler isolator to completely isolate the analog ground on the sensor side from the digital ground on the processor side. This design prevents surge currents from contacting underground sewage or high-voltage leakage on the sensor side from damaging the main control unit, and also blocks high-frequency noise from the digital circuit from coupling to the high-sensitivity analog acquisition circuit, improving the signal-to-noise ratio of weak signals. Furthermore, the data acquisition and processing module is configured to periodically read the coulomb counter register inside the power management integrated circuit via an I2C bus. The coulomb counter register calculates the amount of charge consumed by integrating the current flowing through the battery in real time. Remaining battery power... The calculation formula is as follows: ; In the above formula, This refers to the battery's full factory capacity. The initial moment when the battery is enabled. For the current moment, For a moment The instantaneous current. Compared to the simple voltage method for measuring energy, the coulomb integral method is unaffected by voltage drops caused by battery load characteristics and temperature, and can provide accurate remaining energy data at the milliampere-hour level. This accurate data is then fed into the communication link quality scoring function in step S4, making the system's decision on transmission strategy more scientific and reasonable.
[0070] The system architecture detailed in this embodiment has significant advantages. First, the hardware-integrated excitation response circuit and DSP core enable "edge computing" capabilities, allowing complex impedance analysis and multi-source data fusion algorithms to be completed directly on the downhole terminal, reducing the huge bandwidth and power consumption required to upload raw data. Second, the hierarchical storage architecture cleverly combines the large capacity of Flash memory with the high durability of FRAM, meeting the needs of firmware upgrades while solving the problem of Flash memory being easily damaged by frequent writing of algorithm states. Third, the combination of an external hardware watchdog and a power management chip constructs a dual hardware defense, ensuring that the system can automatically recover in the event of program crashes or power failures, greatly reducing the maintenance costs of manual on-site restarts. Finally, the application of an isolated bus and coulomb counter significantly improves the electrical safety and power management accuracy of the system. In particular, the isolation design effectively prevents the risk of electrical sparks in methane environments, meeting intrinsically safe explosion-proof requirements, while precise power management provides data support for the system's ultra-long operating range.
[0071] Example 3 Further explanation in conjunction with Example 1, such as Figure 1-2 As shown in the diagram, this embodiment provides an automatic monitoring system and method for valve wells. The system's hardware architecture consists of five collaborative parts: a sensor acquisition module, a data processing module, a wireless communication module, a low-power control module, and a local storage module. The sensor acquisition module integrates a microelectromechanical system (MEMS) triaxial accelerometer, a methane concentration sensor, a piezoresistive water level sensor, and a specially designed excitation response circuit. This circuit includes a digital-to-analog converter and a transimpedance amplifier for performing electrochemical impedance spectroscopy analysis. The data processing module embeds a digital signal processing core with a hardware floating-point unit and is connected to the sensor module via a digital magnetic isolation bus to block downhole electrical interference. The wireless communication module integrates a radio frequency link quality detection unit, supporting real-time reading of RSRP and SINR parameters. The low-power control module consists of a power management integrated circuit (PMIC) and an external hardware watchdog, and provides precise electrical data from the coulomb counter register to the processing module via an I2C bus. The local storage module consists of a serial Flash memory for storing firmware differential patches and a ferroelectric RAM for storing algorithm context.
[0072] The system's workflow begins with the wake-up phase. When the real-time clock (RTC) interrupt is triggered or an external interrupt wakes the system, the main control unit first responds to the wake-up event by executing step S1. In this phase, the system uses the excitation response circuit to apply multi-frequency sinusoidal perturbations to the electrochemical sensor, collects the response current, constructs a Nyquist impedance spectrum, and calculates the charge transfer resistance using nonlinear least squares fitting. If the resistance change rate exceeds the aging threshold, the system automatically adjusts the analog front-end gain to compensate for sensitivity decay. After passing the self-test, the system reads the variance of the triaxial acceleration data. If it is below the static threshold, it collects environmental data such as methane and water level in low-frequency mode; if it is above the static threshold, it determines that vibration interference exists, automatically switches to high-frequency oversampling mode, and activates the anti-aliasing filter to obtain multi-dimensional environmental raw data.
[0073] After acquiring the raw data, the system proceeds to the data processing stage in step S2. The data acquisition and processing module uses wavelet basis functions to perform multi-level wavelet packet decomposition on the non-stationary environmental data sequence, extracting high-frequency detail coefficients and low-frequency approximation coefficients. An adaptive soft thresholding function is then used to shrink the detail coefficients, reconstructing clean, denoised data. Subsequently, the system constructs a multi-dimensional feature vector containing temperature, humidity, gas concentration, and water level, calculating its Mahalanobis distance to the historical normal state dataset. If this distance is less than the chi-square distribution critical value, the data is considered valid; if it is greater than the critical value, the slope of the humidity and gas concentration changes is further analyzed. If the two are significantly positively correlated, it is determined to be water vapor interference, and the gas concentration is negatively corrected, generating high-confidence monitoring results.
[0074] Based on the high-confidence monitoring results, the system performs state analysis in step S3. The system iteratively updates the current dynamic background baseline using a weighted moving average model incorporating a forgetting factor, calculating the deviation of the monitoring results from the baseline and the standardized Z-Score. Simultaneously, it uses a differential autoregressive moving average model to fit data from the most recent N periods, extrapolating and predicting the numerical trend within future time windows. If the Z-Score exceeds the limit or the predicted value reaches the safety threshold, the system calculates the risk confidence weight based on the integral of the product of the abnormal magnitude and duration, generating a risk assessment result that includes normal, warning, or alarm levels.
[0075] Subsequently, the system executes the communication and control strategy in step S4. The system constructs a communication link quality score by combining real-time read signal received power, signal-to-noise ratio, and remaining coulomb charge. Based on the score and risk level, the system performs tiered processing of the data: emergency alarm data is marked as high priority, placed in a high-priority queue, and compressed using LZ77 lossless compression; regular data is marked as low priority, placed in a low-priority queue, and compressed using rotating door (SDT) lossy compression, retaining only critical inflection points. The system uses a token bucket algorithm for traffic shaping; when the link score is low, the token issuance rate is reduced, allowing only high-priority data to pass. If channel congestion is detected before transmission, an exponential backoff algorithm is executed to wait for retry. All transmitted data packets include a CRC32 checksum to ensure integrity.
[0076] Furthermore, the system possesses remote maintenance capabilities. Upon receiving a firmware update command from the server, it only downloads the binary differential patch to the Flash buffer, reconstructs a new image using the local old firmware and the patch, performs SHA-256 verification, and writes it to the partition to be activated after successful verification. After rebooting, the system initiates a watchdog timer for functional self-testing; if the self-test fails, it automatically rolls back to the old version. After each monitoring task is completed, the system writes the Kalman filter state, dynamic benchmark forgetting factor, and other algorithm contexts into non-volatile FRAM. Subsequently, it configures the GPIO pins to high-impedance or open-drain mode to eliminate leakage, sends a command to the PMIC to cut off power to the sensor and wireless module, and finally sets an RTC alarm to put the kernel into a deep sleep stop mode, awaiting the next wake-up.
[0077] The above embodiments are merely preferred technical solutions of the present invention and should not be considered as limitations on the present invention. The scope of protection of the present invention should be limited to the technical solutions described in the claims, including equivalent substitutions of the technical features described in the claims. That is, equivalent substitutions and improvements within this scope are also within the scope of protection of the present invention.
Claims
1. An automatic monitoring method for valve wells, characterized in that: The method includes: S1. In response to the system wake-up event, the sensor health self-test based on frequency response characteristic analysis is performed through the sensor acquisition module, and after the self-test is passed, multi-dimensional environmental raw data and wireless signal quality data in the valve well are acquired according to the hierarchical sampling strategy. S2. The data acquisition and processing module performs time-frequency domain denoising based on wavelet transform and multi-source heterogeneous data fusion verification on the original multi-dimensional environmental data to generate high-confidence monitoring results. S3. Use the adaptive dynamic benchmark algorithm and trend evolution prediction model to extract abnormal features from the monitoring results, determine the current system status, and generate a risk level including confidence weights. S4. Dynamically calculate transmission priority based on wireless signal quality data and risk level, perform differentiated data compression and adaptive reporting, save algorithm context after task completion and control system to enter deep sleep mode.
2. The automatic monitoring method for valve wells according to claim 1, characterized in that: The sensor health self-check and graded sampling strategy based on frequency response characteristic analysis in step S1 includes: During the sensor preheating stage, multiple sets of sinusoidal perturbation signals of different frequencies are applied to the electrochemical sensor, the sensor's response current is collected, and a Nyquist impedance spectrum is constructed in memory. The nonlinear least squares method is used to fit the constructed impedance spectrum to the pre-set Landers equivalent circuit model, and the parameter values of charge transfer resistance and double layer capacitance are calculated. Determine whether the rate of change of charge transfer resistance exceeds the preset aging threshold. If it does, automatically adjust the signal gain compensation coefficient of the analog front end. If it does not exceed the threshold, maintain the current gain. During the formal sampling phase, the variance value of the triaxial accelerometer is first read. If the variance value is lower than the static threshold, environmental data is collected in low-frequency mode. If the variance value is higher than the static threshold, it is determined that there is external vibration interference, and the system automatically switches to high-frequency oversampling mode and activates the anti-aliasing filter.
3. The automatic monitoring method for valve wells according to claim 1, characterized in that: Step S2, which involves wavelet transform-based time-frequency domain denoising and multi-source heterogeneous data fusion verification, includes: By selecting a preset wavelet basis function, multi-level wavelet packet decomposition is performed on the collected non-stationary environment raw data sequence to obtain high-frequency detail coefficients and low-frequency approximation coefficients in different frequency bands. An adaptive soft thresholding function is used to shrink the high-frequency detail coefficients, remove random noise components, and a reconstruction algorithm is used to synthesize the denoised clean data sequence. Construct a multidimensional feature vector containing temperature, humidity, gas concentration, and water level data, and calculate the Mahalanobis distance between this feature vector and the historical normal state dataset; The calculated Mahalanobis distance is compared with the critical value of the chi-square distribution. If the distance is less than the critical value, the data are determined to be strongly correlated and valid. If the distance is greater than the critical value, the slope of the humidity data change is further analyzed. If the slope of the humidity change is positively correlated with the slope of the gas concentration change, it is determined to be water vapor interference, and the gas concentration data is negatively corrected.
4. The automatic monitoring method for valve wells according to claim 1, characterized in that: Step S3 includes the adaptive dynamic benchmark algorithm and trend evolution prediction model, which include: A weighted moving average model incorporating a forgetting factor is established to iteratively calculate historical monitoring data, giving greater weight to data closer to the current moment, thereby updating the current dynamic background baseline. Calculate the deviation between the current high-confidence monitoring results and the dynamic background baseline, and calculate the current Z-Score standardized score by combining the data's volatility variance; A trend prediction model based on differential autoregressive moving average is constructed. The time series curve is fitted using monitoring data from the most recent N periods, and the numerical evolution trend within a preset time window is extrapolated. If the Z-Score standardized score exceeds the preset statistical anomaly limit, or if the extrapolated prediction value indicates that the safety red line will be reached in the future, the risk confidence weight is calculated based on the integral of the product of the anomaly magnitude and duration, and a graded alarm instruction is generated.
5. The automatic monitoring method for valve wells according to claim 1, characterized in that: Step S4, which involves dynamically calculating transmission priority and adaptive reporting, includes: The reference signal received power (RSRP) and signal-to-interference-plus-noise ratio (SINR) of the wireless communication module are read in real time, and a communication link quality scoring function is constructed by combining the remaining battery power. Establish a priority queue for data transmission, marking emergency alarm data as high priority and periodic routine data as low priority; The token bucket algorithm is used to shape the traffic of the reported requests. If the communication link quality score is lower than the preset threshold, the token issuance rate is automatically reduced, and only high-priority data is allowed to pass through. Before sending data, monitor the channel status. If channel congestion is detected, execute the exponential backoff algorithm to calculate a random waiting time, and re-initiate the connection request after the waiting time expires, until the data is successfully sent or the maximum number of retries is reached.
6. The automatic monitoring method for valve wells according to claim 1, characterized in that: The differential data compression step in this method includes: For alarm data marked as high priority, lossy compression is not performed; instead, the LZ77 lossless compression algorithm is used directly for encoding to preserve the complete waveform characteristics. For regular data marked as low priority, the Rotating Door Compression (SDT) algorithm is used to process it, calculate the slope between the data points and the compression door, and retain only the key inflection point data that exceeds the range of the compression door parallelogram. The compressed data payload is divided into fixed-length transmission units, and a Cyclic Redundancy Check (CRC32) code is calculated for each transmission unit. The check code is appended to the end of the data for integrity verification at the receiving end.
7. The automatic monitoring method for valve wells according to claim 1, characterized in that: The method also includes a remote firmware update and rollback step based on differential patching: After receiving the firmware version description file from the server, the system compares the differences between the local firmware version and the target firmware version, and only downloads the binary differential patch package to the buffer of the external Flash memory. The new firmware image is reconstructed in memory using the local old firmware and the downloaded differential patch package, and the reconstructed image is verified by SHA-256 hash. After verification, the new firmware image is written to a separate partition to be activated, and the boot pointer of the bootloader is modified. After the system restarts and loads the new firmware, a watchdog timer is started and a function self-test is performed. If the self-test fails or a system crash occurs, the watchdog resets the system and automatically restores the boot pointer to the old firmware partition, thus achieving a fault rollback.
8. The automatic monitoring method for valve wells according to claim 1, characterized in that: Step S4, which involves saving the algorithm context and controlling the system to enter deep sleep mode, includes: The state estimation vector, covariance matrix, and forgetting factor parameters of the dynamic benchmark algorithm of the Kalman filter are written into the non-volatile ferroelectric memory (FRAM) to prevent loss when power is off. Iterate through all peripheral interfaces of the microcontroller, configure pins not connected to external devices as analog input mode, and configure pins connected to external pull-up resistors as open-drain output high-level mode; Send an I2C command to the power management chip to cut off the power supply circuit for the sensor acquisition module and the wireless communication module; Configure the alarm interrupt trigger time of the real-time clock (RTC) and call system instructions to put the kernel into stop mode, retaining only the microampere power supply for the wake-up logic circuit.
9. An automatic monitoring system for valve wells, used to implement the automatic monitoring method for valve wells according to any one of claims 1 to 8, characterized in that: The system includes: The sensor acquisition module includes an excitation response circuit for constructing impedance spectra and a multi-dimensional environmental sensing unit; The data acquisition and processing module has an embedded digital signal processing (DSP) core, which is used to perform wavelet transforms and matrix operations. The wireless communication module integrates a radio frequency link quality detection unit and an adaptive modulation and coding controller. The low-power control module includes an independent power management integrated circuit and an external hardware watchdog. The local storage module includes a serial Flash for storing differential patches and a ferroelectric memory for saving the algorithm context.
10. The valve well automatic monitoring system according to claim 9, characterized in that: The data acquisition and processing module is connected to the sensor acquisition module via an isolated bus, and the data acquisition and processing module is configured to periodically read the coulomb counter register of the power management integrated circuit to obtain accurate remaining power data to participate in the calculation of the communication link quality scoring function.