A Self-Detection Method and System for Water IoT Based on Edge Computing

By using edge computing technology to perform spatiotemporal alignment and cleaning of water IoT data, combined with logical operations and time series models, the water IoT system can quickly identify faults and handle emergencies in weak network environments, solving the problems of response delay and false alarms in traditional systems.

CN121619337BActive Publication Date: 2026-11-10ZHOUSHAN CHANGMAO MATERIALS OPERATION CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511812708.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-04
Publication Date
2026-11-10
Estimated Expiration
2045-12-04

AI Technical Summary

Technical Problem

Existing water IoT monitoring systems suffer from large data transmission delays and are unable to respond to sudden faults in real time under weak network conditions. Furthermore, traditional terminals lack local self-diagnostic capabilities, resulting in a high false alarm rate.

Method used

An edge computing-based approach is adopted to perform spatiotemporal alignment and cleaning of heterogeneous data through sliding time windows and discrete Kalman filtering. The logic operation engine of the edge computing unit is used to identify hard faults, and the decision weights are dynamically adjusted by combining time series inference models and network packet loss rate to achieve rapid local identification and emergency response.

Benefits of technology

Identify and handle sudden failures within millisecond response time, reduce false alarm rate, and ensure the system's autonomous decision-making capability and the complete retention of key data in weak network environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121619337B_ABST
    Figure CN121619337B_ABST
Patent Text Reader

Abstract

This invention discloses a self-detection method and system for water IoT anomalies based on edge computing, belonging to the field of water IoT data processing technology. It addresses the problems of equipment monitoring delay and false alarms in weak network environments. First, heterogeneous data is spatiotemporally aligned and denoised using a sliding time window and discrete Kalman filtering to construct a real-time operating status matrix. Then, a logic engine performs Boolean operations based on device interlocking rules to generate hard fault risk values. Next, a time-series inference model is used to calculate the prediction deviation, and the gain coefficient is dynamically adjusted according to the network packet loss rate to calculate a weighted comprehensive decision index, achieving adaptive decision-making in weak networks. Finally, when the index exceeds the limit, a relay is directly driven to activate, and the fault data is fixed in non-volatile memory. This invention achieves fully closed-loop autonomous protection without relying on the cloud.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of water IoT data processing technology, specifically to a water IoT anomaly self-detection method and system based on edge computing. Background Technology

[0002] With the deepening of integrated urban and rural water supply and smart water management, the digital management of water infrastructure has become a key link in ensuring the safety of residents' water use and improving operational efficiency. Various IoT sensors are widely deployed in water intake pumping stations, water supply networks, and secondary water supply facilities to monitor flow, pressure, water quality, and equipment operating status in real time, forming a vast water sensing network. Through the collection and analysis of massive amounts of water data, timely early warnings of network leakage, equipment failure, and water quality anomalies are achieved, which is of great significance for ensuring the continuous and stable operation of the water system.

[0003] However, existing water monitoring systems mostly adopt a centralized architecture with edge-cloud collaboration. This means that the terminal is only responsible for collecting raw data and transmitting it to the cloud, where the cloud server performs anomaly analysis and issues commands. This architecture has substantial technical flaws in practical applications: First, many rural drinking water stations, village water plants, and secondary water supply pumping stations are located in remote mountainous areas or buried deep in basements, resulting in extremely unstable network signal coverage. This leads to high latency and high packet loss rates in data transmission, making it difficult for the cloud to obtain real-time on-site conditions. In the event of a sudden failure, the system often cannot respond promptly due to communication delays. Second, traditional data acquisition terminals lack local computing and logical judgment capabilities, relying solely on a single threshold for alarms. They cannot clean and correlate multi-source heterogeneous data, are highly susceptible to random noise interference from sensors causing false alarms, and cannot autonomously identify complex equipment logic conflicts and gradual faults under extreme conditions of communication interruption, making it difficult to meet the requirements for highly reliable unattended monitoring. Summary of the Invention

[0004] To address the shortcomings of existing technologies, this invention provides a method and system for self-detection of anomalies in water affairs IoT based on edge computing, thus solving the problems mentioned in the background.

[0005] To achieve the above objectives, the present invention provides the following technical solution: a water affairs IoT anomaly self-detection method based on edge computing, comprising the following steps: S1. Reading analog operation data and switch status values ​​from water affairs field sensors, mapping asynchronously sampled heterogeneous data to the same time section through a sliding time window, performing discrete Kalman filtering on the analog operation data, and constructing a real-time operating condition state matrix containing full-dimensional data at the current moment; S2. Importing the real-time operating condition state matrix into the logic operation engine of the edge computing unit, performing Boolean logic operations on the power load data and pipeline hydraulic parameters in the matrix according to preset equipment interlock rules, generating deterministic feature vectors and mapping them to hard fault risk values; S3. Extracting historical sub-sequences of continuous time steps from the real-time operating condition state matrix. The input column is fed into the time series inference model to perform convolution operation, calculate the Euclidean distance between the current standard value and the measured value to obtain the prediction deviation value, obtain the data packet loss rate parameter by reading the status register of the wireless communication module, calculate the dynamic gain coefficient through the positive correlation function mapping relationship, perform multiplication amplification operation on the prediction deviation value through the dynamic gain coefficient, and then perform weighted summation with the hard fault risk value to obtain the comprehensive decision index; S4. The comprehensive decision index is compared with the preset action threshold register value. When the comprehensive decision index exceeds the action threshold, a high-level signal is directly output through the relay output interface of the acquisition terminal to drive the actuator to act, and the local non-volatile memory is addressed to write the real-time operating condition state matrix data before and after the abnormal trigger time into the specified storage sector.

[0006] Furthermore, the specific process of reading analog operation data and switch status values ​​from water field sensors and mapping asynchronously sampled heterogeneous data to the same time segment using a sliding time window is as follows: Voltage and current encoded values ​​acquired from multiple analog interfaces are written to a memory buffer via the direct memory access channel of the acquisition terminal; the level transition signal of the switch status is read through the interrupt service routine of the general-purpose input / output port; a first-in-first-out (FIFO) data buffer queue is constructed in the random access memory of the edge computing unit, and hardware timer timestamps are used to mark the analog and switch data frames entering the queue; the sliding time window algorithm is started, using the current system clock as the reference time anchor point, and a reverse traversal search is performed in the FIFO data buffer queue to select the analog data frame with the smallest absolute time difference from the reference time anchor point as the analog reference at the current moment; for switch data captured based on level change triggers, a zero-order hold read operation is performed to lock the status value at the most recent transition moment before the reference time anchor point, and the status value is combined with the current analog reference at the current moment using a data bit combination operation.

[0007] Furthermore, the specific process of performing discrete Kalman filtering on the analog operation data to construct a real-time operating condition state matrix containing full-dimensional data at the current moment is as follows: Initialize the state transition matrix and observation noise covariance matrix of the discrete Kalman filter; calculate the prior state estimate and prior error covariance at the current moment based on the optimal estimate of the previous time step; read the analog operation data that has undergone data bit combination operation as the current observation vector; calculate the gain coefficient based on the prior error covariance; use the gain coefficient to perform a weighted correction operation on the prior state estimate using the current observation vector to generate the posterior state estimate; perform vector concatenation operation on the flow parameter, pressure parameter, and water quality parameter in the posterior state estimate and the switch state value, and write the time dimension identifier at the beginning of the matrix to construct the real-time operating condition state matrix.

[0008] Further, step S2 includes the following steps: parsing the real-time operating condition state matrix, separating the electrical parameter sub-vector representing the pump operating state and the hydraulic parameter sub-vector representing the pipeline network operating state; calling the preset device interlock logic truth table in the edge computing unit memory, which defines the normal logical constraint relationship between the electrical operating state and the hydraulic threshold range, comparing the current value in the electrical parameter sub-vector with the operating threshold to obtain the device operating Boolean state, and comparing the pressure value in the hydraulic parameter sub-vector with the safety threshold to obtain the hydraulic abnormal Boolean state; performing a logical AND operation on the device operating Boolean state and the hydraulic abnormal Boolean state, and if the operation result is true, it is determined to be a violation of the physical interlock rule, and the corresponding dimension of the deterministic feature vector is set; traversing all dimensions of the deterministic feature vector, mapping and accumulating the binary set states in the vector into a scalar form of hard fault risk value according to the preset fault severity weight table.

[0009] Furthermore, the specific process of extracting historical subsequences of continuous time steps from the real-time operating condition state matrix and inputting them into the time series inference model to perform convolution operations, and calculating the Euclidean distance between the current standard value and the measured value to obtain the prediction deviation value is as follows: A time sliding window is constructed in the memory of the edge computing unit, and historical time step data of a preset length is extracted from the real-time operating condition state matrix and reconstructed into a multi-dimensional tensor input format; the convolution kernel weight parameters of the pre-trained time series inference model are loaded from the memory, and multi-layer convolution and pooling operations are performed on the input tensor through the tensor acceleration computing unit, and the theoretical prediction vector at the current time is output after processing by a non-linear activation function; the measured vector at the current time is read from the real-time operating condition state matrix, the difference between the measured vector and the theoretical prediction vector in each dimension is calculated, the sum of squares of the differences in all dimensions is performed, and the square root is taken to obtain the prediction deviation value characterizing the degree of deviation of the current operating condition.

[0010] Furthermore, the data packet loss rate parameter is obtained by reading the status register of the wireless communication module. The dynamic gain coefficient is calculated through a positive correlation function mapping relationship. The prediction deviation value is multiplied and amplified by the dynamic gain coefficient, and then weighted and summed with the hard fault risk value to obtain the comprehensive decision index. The specific process is as follows: The diagnostic port of the wireless communication module is accessed through the serial communication interface, a status query command is sent and the returned status register value is read. The fields representing the bit error rate and retransmission count are parsed to calculate the data packet loss rate of the current period. A preset linear mapping function or a segmented lookup table algorithm is called, with the data packet loss rate as the input variable, and the dynamic gain coefficient, which changes positively with the loss rate, is calculated and output. The prediction deviation value and the dynamic gain coefficient are multiplied by floating point to obtain the weighted deviation value. At the same time, the hard fault risk value is read, and the weighted deviation value and the hard fault risk value are added together to generate the comprehensive decision index.

[0011] Furthermore, the comprehensive decision index is compared with the preset action threshold register value. When the comprehensive decision index exceeds the action threshold, a high-level signal is directly output through the relay output interface of the acquisition terminal to drive the actuator to act. The specific process is as follows: the preset alarm trigger threshold is read from the configuration storage area, and the comparator instruction is called to compare the comprehensive decision index with the alarm trigger threshold value; when the comparison result flag shows that the comprehensive decision index is greater than the alarm trigger threshold, the exception handling interrupt service routine is immediately triggered; in the interrupt service routine, the data output register of the general input / output port of the mapped relay control circuit is addressed, and the specific bit controlling the on / off state of the relay coil is set to output a continuous high-level logic signal.

[0012] Furthermore, the specific process of writing the real-time operating condition matrix data before and after the abnormal trigger moment into the specified storage sector by addressing the local non-volatile memory is as follows: read the abnormal trigger timestamp recorded by the current system clock, and calculate the start and end addresses of the real-time operating condition matrix data in the random access memory within the preset time range before and after the timestamp based on the data structure pointer of the circular buffer; initialize the local electrically erasable programmable read-only memory through the serial peripheral interface bus, and calculate the physical page address of the target sector to be written according to the page alignment rules of the memory; start the direct memory access transfer instruction, and burst write the binary data stream from the start address to the end address range into the calculated target physical page address through the serial peripheral interface bus, and write a check code at the end of the data to complete the solidification storage of the abnormal operating condition data.

[0013] The edge computing-based water IoT anomaly self-detection system includes the following modules: a state matrix construction module, used to read analog operation data and switch status values ​​from water field sensors, map asynchronously sampled heterogeneous data to the same time segment through a sliding time window, perform discrete Kalman filtering on the analog operation data, and construct a real-time operating condition state matrix containing full-dimensional data at the current moment; a logic fault detection module, used to import the real-time operating condition state matrix into the logic operation engine of the edge computing unit, perform Boolean logic operations on the power load data and pipeline hydraulic parameters in the matrix according to preset equipment interlock rules, generate deterministic feature vectors, and map them to hard fault risk values; and a comprehensive decision calculation module, used to extract historical subsequences of continuous time steps from the real-time operating condition state matrix and input them into the system. The time series inference model performs convolution operations to calculate the Euclidean distance between the current standard value and the measured value to obtain the prediction deviation value. It obtains the data packet loss rate parameter by reading the status register of the wireless communication module, calculates the dynamic gain coefficient through the positive correlation function mapping relationship, and performs a multiplicative amplification operation on the prediction deviation value using the dynamic gain coefficient. Then, it is weighted and summed with the hard fault risk value to obtain the comprehensive decision index. The autonomous control storage module is used to compare the comprehensive decision index with the value of the preset action threshold register. When the comprehensive decision index exceeds the action threshold, a high-level signal is directly output through the relay output interface of the acquisition terminal to drive the actuator to act. It also addresses the local non-volatile memory to write the real-time operating condition state matrix data before and after the abnormal trigger time into the designated storage sector.

[0014] The present invention has the following beneficial effects: (1) The water IoT anomaly self-detection method based on edge computing effectively solves the problem of spatiotemporal misalignment of heterogeneous data caused by inconsistent sampling frequencies of sensors at the water site through sliding time window and discrete Kalman filter operation. It completes data standardization cleaning and noise reduction at the edge, eliminating the impact of random signal interference on monitoring accuracy. At the same time, by using the logic operation engine of the edge computing unit to perform Boolean logic operation, it can quickly identify hard faults that violate physical mechanisms locally based on the physical interlock rules of the equipment itself (such as the logical relationship between power load and hydraulic parameters). It can achieve millisecond-level logic anomaly judgment without uploading to the cloud, which greatly improves the response speed and accuracy to sudden equipment failures.

[0015] (2) The water IoT anomaly self-detection system based on edge computing obtains the data packet loss rate by reading the status register of the wireless communication module and constructs a positive correlation function mapping relationship to dynamically adjust the gain coefficient. This enables the system to automatically increase its sensitivity to the prediction deviation value when the network communication quality deteriorates, thereby strengthening the local autonomous decision-making weight in weak network or network outage environments. With the direct drive of the relay output interface and the addressing and writing function of the local non-volatile memory, it ensures that even in the extreme case of disconnection from the central cloud, the edge terminal can still decisively perform protection actions such as shutdown or valve closure based on the comprehensive decision index, and completely retain the black box data before and after the fault, effectively solving the technical problems of monitoring blind spots and data loss in weak network environments.

[0016] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description

[0017] Figure 1 This is a flowchart of the water affairs IoT anomaly self-detection method based on edge computing according to the present invention.

[0018] Figure 2 This is a flowchart of the water affairs IoT anomaly self-detection system based on edge computing, as described in this invention. Detailed Implementation

[0019] This application's embodiments address the problems of existing water IoT monitoring systems, such as large data transmission delays in weak network environments, inability to respond to sudden faults in real time, and high false alarm rates due to the lack of local self-diagnostic capabilities of traditional terminals, through an edge computing-based water IoT anomaly self-detection method and system.

[0020] The overall approach of the scheme in this application embodiment is as follows: First, at the edge, the collected multi-source heterogeneous data is spatiotemporally aligned and filtered for cleaning to construct a standardized real-time operating status matrix; then, local computing power is used for dual detection. The first layer identifies deterministic hard faults based on physical interlocking rules through a logic operation engine, and the second layer identifies gradual anomalies by dynamically adjusting the decision weights through a time series inference model combined with the network packet loss rate; finally, based on the comprehensive decision index, the execution mechanism is directly driven locally to perform emergency response and solidify key data, achieving a fully closed-loop anomaly self-detection and protection that does not rely on the cloud.

[0021] Please see Figure 1This invention provides a technical solution: a water affairs IoT anomaly self-detection method based on edge computing, comprising the following steps: S1. Reading analog operation data and switch status values ​​from water affairs field sensors, mapping asynchronously sampled heterogeneous data to the same time section through a sliding time window, performing discrete Kalman filtering on the analog operation data, and constructing a real-time operating condition state matrix containing full-dimensional data at the current moment; S2. Importing the real-time operating condition state matrix into the logic operation engine of the edge computing unit, performing Boolean logic operations on the power load data and pipeline hydraulic parameters in the matrix according to preset equipment interlock rules, generating deterministic feature vectors and mapping them to hard fault risk values; S3. Extracting historical subsequences of continuous time steps from the real-time operating condition state matrix and inputting them into... The time series inference model performs convolution operations to calculate the Euclidean distance between the current standard value and the measured value to obtain the prediction deviation value. It obtains the data packet loss rate parameter by reading the status register of the wireless communication module, and calculates the dynamic gain coefficient through the positive correlation function mapping relationship. After performing a multiplication amplification operation on the prediction deviation value through the dynamic gain coefficient, it is weighted and summed with the hard fault risk value to obtain the comprehensive decision index. S4. The comprehensive decision index is compared with the value of the preset action threshold register. When the comprehensive decision index exceeds the action threshold, a high-level signal is directly output through the relay output interface of the acquisition terminal to drive the actuator to act, and the local non-volatile memory is addressed to write the real-time operating condition matrix data before and after the abnormal trigger time into the specified storage sector.

[0022] In this implementation plan, step S1 mainly performs the low-level acquisition and standardization preprocessing of multi-source heterogeneous data. Specifically, the acquisition terminal reads analog operational data (such as current and pressure) and switch status values ​​(such as pump start / stop status) from waterworks field sensors in parallel through a hardware interface, and processes this asynchronously sampled heterogeneous data using a sliding time window algorithm. The sliding time window is a data alignment mechanism used to map data points with different sampling frequencies to the same time segment, solving the problem of data asynchrony caused by differences in sensor response speeds. The discrete Kalman filter is a recursive estimation algorithm used to optimally estimate the system state in the presence of measurement noise. Through the above processing, this step constructs a real-time operating condition state matrix containing full-dimensional data at the current moment. Its technical role is to eliminate random noise caused by electromagnetic interference at the field and complete the spatiotemporal alignment of heterogeneous data, providing a high-quality, standardized data foundation for subsequent logical judgments and algorithm inferences. Step S2 mainly performs deterministic fault identification based on physical mechanisms. Specifically, the system imports the real-time operating status matrix into the logic operation engine of the edge computing unit, and performs Boolean logic operations on the power load data and pipeline hydraulic parameters in the matrix according to the preset equipment interlock rules. The equipment interlock rules refer to logical constraints based on the physical characteristics of water equipment, such as the requirement for corresponding current load and water pressure changes during pump operation. The Boolean logic operation is the calculation process for judging the truth or falsehood of these physical constraints. This operation generates a deterministic feature vector and maps it to a hard fault risk value. Its technical function is to quickly identify hard faults that violate common sense (such as motor idling, pipe bursting and pressure loss) using clear physical mechanisms, achieving millisecond-level rapid screening of serious faults without relying on complex algorithm models. Step S3 mainly performs intelligent inference for gradual anomalies and adaptive decision weighting based on the network environment. Specifically, the system extracts historical sub-sequences and inputs them into the time series inference model to perform convolution operations, calculates the Euclidean distance between the current standard value and the measured value to obtain the prediction deviation value, and simultaneously obtains the data packet loss rate parameter by reading the status register of the wireless communication module, and calculates the dynamic gain coefficient through a positive correlation function mapping relationship. The time-series inference model is used to extrapolate the current theoretical normal value based on historical patterns. The dynamic gain coefficient is a weighting factor linked to network quality; the higher the packet loss rate, the larger the coefficient. The predicted deviation value is multiplied and amplified by the dynamic gain coefficient, then weighted and summed with the hard fault risk value. This technology enables an adaptive protection mechanism in weak network environments: when network communication quality deteriorates (high packet loss rate) and the cloud cannot intervene in time, the system automatically amplifies the weight of the local detection deviation, increasing the device's sensitivity to anomalies and its autonomous decision-making authority, preventing the escalation of accidents caused by network latency. Step S4 mainly executes local closed-loop control and the solidified storage of key data.Specifically, the system compares the comprehensive decision index with the preset action threshold register value. When the comprehensive decision index exceeds the action threshold, a high-level signal is directly output through the relay output interface of the acquisition terminal to drive the actuator. The system also addresses the local non-volatile memory to write the real-time operating status matrix data before and after the abnormal triggering moment into a designated storage sector. The action threshold register value is the critical standard for triggering an emergency response; non-volatile memory refers to a storage medium that can retain data even after power failure. The technical role of this step is to construct a final safety line of defense independent of a host computer, ensuring that power can be immediately cut off or valves closed when a serious risk is detected. Simultaneously, the black box mechanism completely records the on-site data before and after the fault, providing tamper-proof data support for subsequent fault review and responsibility determination.

[0023] Specifically, the process of reading analog operation data and switch status values ​​from waterworks field sensors and mapping asynchronously sampled heterogeneous data to the same time segment using a sliding time window is as follows: Voltage and current encoded values ​​acquired from multiple analog interfaces are written to a memory buffer via the direct memory access channel of the acquisition terminal; the level transition signal of the switch status is read through the interrupt service routine of the general-purpose input / output port; a first-in-first-out (FIFO) data buffer queue is constructed in the random access memory of the edge computing unit, and hardware timer timestamps are used to mark the analog and switch data frames entering the queue; the sliding time window algorithm is started, using the current system clock as the reference time anchor, and a reverse traversal search is performed in the FIFO data buffer queue to select the analog data frame with the smallest absolute time difference from the reference time anchor as the analog reference at the current moment; for switch data captured based on level change triggers, a zero-order hold read operation is performed to lock the status value at the most recent transition moment before the reference time anchor, and this status value is combined with the current analog reference at the current moment using a data bit combination operation.

[0024] This implementation scheme addresses the synchronization challenge of heterogeneous data along the time axis by leveraging the characteristics of low-level computer hardware and discrete mathematical algorithms. Specifically, Direct Memory Access (DMA) technology is a data transfer mechanism that allows hardware subsystems to independently access system memory without central processing unit intervention. Its function is to reduce the computational burden on the main control chip from high-frequency analog signal acquisition, ensuring that multiple voltage and current encoded values ​​can be written to the memory buffer in real-time at microsecond speeds. Zero-order hold read is an interpolation strategy in signal processing, assuming that the value remains unchanged between two sampling points, equal to the value of the previous sampling point. Since switching signals (such as pump start / stop and access control triggers) are low-frequency burst signals that only trigger interrupts during level transitions, the system uses the current system clock as the reference time anchor. By reverse searching and locking the state value at the most recent transition moment before the reference time anchor, it can restore the true physical state of the device at that moment to the greatest extent possible. Data bit combination operations are used to integrate the aligned analog and switching signals, providing a standardized input with strict time consistency for subsequent algorithms.

[0025] Specifically, the process of performing discrete Kalman filtering on analog operation data to construct a real-time operating condition state matrix containing full-dimensional data at the current moment is as follows: Initialize the state transition matrix and observation noise covariance matrix of the discrete Kalman filter; calculate the prior state estimate and prior error covariance at the current moment based on the optimal estimate of the previous time step; read the analog operation data that has undergone data bit combination operation as the current observation vector; calculate the gain coefficient based on the prior error covariance; use the gain coefficient to perform a weighted correction operation on the prior state estimate using the current observation vector to generate the posterior state estimate; perform vector concatenation operation on the flow parameter, pressure parameter, and water quality parameter in the posterior state estimate and the switch state value, and write the time dimension identifier at the beginning of the matrix to construct the real-time operating condition state matrix.

[0026] In this implementation scheme, the Discrete Kalman Filter algorithm is used to eliminate random measurement noise in the analog operation data. Essentially, it is a recursive process of "prediction-measurement-correction". First, the prior state at the current time step is deduced based on the optimal estimate from the previous time step, and the prior error covariance matrix is ​​calculated, as shown in the following formula: ;in, : The current moment; The prior error covariance matrix characterizes the degree of dispersion of the predicted values; State transition matrix: describes the physical laws governing the evolution of the system state over time; The previous moment; The posterior error covariance matrix; : The transpose of the state transition matrix; The process noise covariance matrix is ​​used to quantify the uncertainty of the system model itself. Then, the observation data at the current moment is introduced to calculate the Kalman gain coefficient, which determines whether the system trusts the predicted or measured values ​​more. The formula is as follows: ;in, Kalman gain coefficient; : Observation matrix, used to map state variables to the observation space; : The transpose of the observation matrix; : The observation noise covariance matrix, usually determined by the accuracy parameters provided by the sensor manufacturer; a larger value indicates greater measurement noise; -1: Matrix inversion operation. Finally, the Kalman gain is used to correct the prior state, obtaining the optimal posterior state estimate for the current time step. ;in, : The current moment; The posterior state estimate, i.e., the filtered output; The prior state estimate at the current moment; The current observation vector is composed of analog operational data from which data bit combination operations have been performed. This step effectively filters out spike noise caused by electromagnetic interference in the pump house and constructs a high-confidence real-time operating condition state matrix containing flow parameters, pressure parameters, and water quality parameters.

[0027] Specifically, step S2 includes the following steps: parsing the real-time operating condition state matrix, separating the electrical parameter sub-vector representing the pump operating state and the hydraulic parameter sub-vector representing the pipeline network operating state; calling the preset device interlock logic truth table in the edge computing unit memory, which defines the normal logical constraint relationship between the electrical operating state and the hydraulic threshold range, comparing the current value in the electrical parameter sub-vector with the operating threshold to obtain the device operating Boolean state, and comparing the pressure value in the hydraulic parameter sub-vector with the safety threshold to obtain the hydraulic abnormal Boolean state; performing a logical AND operation on the device operating Boolean state and the hydraulic abnormal Boolean state, and if the operation result is true, it is determined to be a violation of the physical interlock rule, and the corresponding dimension of the deterministic feature vector is set; traversing all dimensions of the deterministic feature vector, mapping and accumulating the binary set states in the vector into a scalar form of hard fault risk value according to the preset fault severity weight table.

[0028] In this implementation scheme, Boolean logic is used to transform the hard rules of the physical world into computer-processable digital features. First, the logic operation engine decouples the matrix data, separating electrical parameter sub-vectors from hydraulic parameter sub-vectors. The equipment interlock logic truth table is a pre-stored logic mapping table that exhaustively enumerates all fault combinations that violate physical laws. For example, a true value is defined as a pump current exceeding the operating threshold and an outlet water pressure falling below the safety threshold, indicating a coupling breakage or severe pipe rupture. To quantify the severity of such hard faults, the system performs a weighted cumulative calculation, as shown in the following formula: ;in, Hard failure risk value, in scalar form; The total dimension of deterministic feature vectors; : The dimension index of the current traversal; : No. The binary bit state of each dimension is set to 1 if the interlocking rule is violated, and 0 otherwise. :No. Preset severity weights for each fault type. (Regarding the weights...) The determination method in this embodiment adopts the analytic hierarchy process (AHP) to construct a judgment matrix to compare the impact of different faults (such as pipe bursts, idling, and voltage anomalies) on water supply safety, calculate their feature vectors, and normalize them. This calculation process transforms discrete logical alarm signals into continuous numerical risk indicators, which facilitates subsequent steps and time-series prediction deviations for fusion decision-making.

[0029] Specifically, the process of extracting historical subsequences of continuous time steps from the real-time operating condition state matrix and inputting them into the time series inference model to perform convolution operations, and calculating the Euclidean distance between the current standard value and the measured value to obtain the prediction deviation value is as follows: A time sliding window is constructed in the memory of the edge computing unit, and historical time step data of a preset length is extracted from the real-time operating condition state matrix and reconstructed into a multi-dimensional tensor input format; the convolution kernel weight parameters of the pre-trained time series inference model are loaded from the memory, and multi-layer convolution and pooling operations are performed on the input tensor through the tensor acceleration computing unit, and the theoretical prediction vector at the current moment is output after processing by a non-linear activation function; the measured vector at the current moment is read from the real-time operating condition state matrix, the difference between the measured vector and the theoretical prediction vector in each dimension is calculated, the sum of squares of the differences in all dimensions is performed, and the square root is taken to obtain the prediction deviation value that characterizes the degree of deviation of the current operating condition.

[0030] In this implementation scheme, deep feature mining and trend comparison are performed on multidimensional time-series data. The core of this approach is to transform the nonlinear equipment operating trajectory into a measurable numerical deviation. Specifically, a time sliding window is a data preprocessing mechanism used to extract fixed-length historical segments and reconstruct them into a multidimensional tensor input format to adapt to the input layer structure of a convolutional neural network. The tensor acceleration computing unit is a hardware coprocessor in the edge device specifically designed to perform matrix multiplication operations. It performs feature extraction on the input data by loading pre-trained convolutional kernel weight parameters. The essence of convolution is to extract local features using filters, while pooling is used to reduce data dimensionality and retain key information. After processing by a nonlinear activation function, the model outputs a theoretical prediction vector reflecting the normal operating pattern of the equipment. To quantify the difference between the current measured state and the theoretical normal state, the system performs Euclidean distance calculation, as shown in the following formula: ;in, : Prediction deviation value, representing the degree to which the current operating condition deviates from the normal model; M: Total number of dimensions of the feature vector; m: Index of the dimension currently being calculated; : The measured value of the m-th dimension in the real-time operating condition state matrix; : The theoretical predicted value of the m-th dimension output by the time series inference model. This calculation step compresses the complex differences in multidimensional heterogeneous data into a single scalar indicator, which can effectively identify gradual anomalies that traditional thresholding methods cannot capture, such as sensor drift and minor pipeline leaks.

[0031] Specifically, the process of obtaining the packet loss rate parameter by reading the status register of the wireless communication module, calculating the dynamic gain coefficient through a positive correlation function mapping relationship, and then performing a multiplicative amplification operation on the prediction deviation value using the dynamic gain coefficient and weighted summing it with the hard fault risk value to obtain the comprehensive decision index is as follows: Access the diagnostic port of the wireless communication module through the serial communication interface, send a status query command and read the returned status register value, and parse the fields representing the bit error rate and retransmission count to calculate the packet loss rate for the current period; call a preset linear mapping function or a segmented lookup table algorithm, using the packet loss rate as the input variable, and calculate the output dynamic gain coefficient that changes positively with the loss rate; perform a floating-point multiplication operation on the prediction deviation value and the dynamic gain coefficient to obtain the weighted deviation value, and simultaneously read the hard fault risk value, performing an addition and accumulation operation on the weighted deviation value and the hard fault risk value to generate the comprehensive decision index.

[0032] This implementation plan constructs an adaptive decision-making model based on communication environment awareness, aiming to address the security blind spot problem caused by cloud-based monitoring failures in weak network environments. Specifically, the system accesses the diagnostic port of the wireless communication module through a serial communication interface to directly read the underlying hardware status register. The status register is a hardware unit that stores the real-time operating parameters of the communication module. By parsing the fields related to bit error rate and retransmission count, the current data packet loss rate can be accurately quantified. To achieve self-rescue in case of network outages, the system constructs a positive correlation mapping mechanism, i.e., the worse the network, the higher the weight of local decision-making. The calculation logic of its comprehensive decision index is as follows: ;in, The comprehensive decision-making index is used as the basis for the final judgment on whether to trigger an action. : The prediction deviation value calculated in the preceding steps; : Dynamic gain adjustment factor, used to define the system's sensitivity to network quality. This parameter is determined through regression analysis of historical network fault data; The packet loss rate read in the current period, with a value ranging from zero to one; : The hard failure risk value generated by the preceding steps. This formula introduces... This dynamic gain term enables adaptive amplification of the prediction deviation value: when network communication is normal ( When the network is close to 0, the system mainly relies on the risk of hard failures and the deviation from the original prediction to make judgments; when the network is interrupted or there is severe packet loss ( When the value approaches 1), the weight of the prediction deviation is significantly amplified, so that even small abnormal signs can trigger a high-scoring decision index, thereby enabling edge terminals to have a more sensitive autonomous protection capability when they lose cloud instructions.

[0033] Specifically, the process of comparing the comprehensive decision index with the preset action threshold register value, and directly outputting a high-level signal to drive the actuator through the relay output interface of the acquisition terminal when the comprehensive decision index exceeds the action threshold, is as follows: The preset alarm trigger threshold is read from the configuration storage area, and a comparator instruction is called to compare the comprehensive decision index with the alarm trigger threshold. When the comparison result flag indicates that the comprehensive decision index is greater than the alarm trigger threshold, an exception handling interrupt service routine is immediately triggered. In the interrupt service routine, the data output register of the general-purpose input / output port of the mapped relay control circuit is addressed, and a specific bit controlling the on / off state of the relay coil is set, outputting a continuous high-level logic signal.

[0034] This implementation primarily performs the physical mapping from software decision-making to hardware execution, aiming to achieve millisecond-level emergency response. Specifically, the configuration storage area typically refers to the Flash-simulated EEPROM area within the microcontroller, used to store parameters that are not lost when power is lost. The comparator instruction is an arithmetic logic operation instruction executed by the central processing unit (CPU) to determine the magnitude relationship between two values ​​and update the flag bits in the status register. The exception handling interrupt service routine is a high-priority code execution flow; once triggered, the CPU will suspend the current task and forcibly jump to this routine to ensure real-time performance in critical situations. The data output register of the general-purpose input / output port is a hardware mapping unit that directly controls the pin level states of the chip. Setting a specific pin is not a simple assignment; rather, to avoid affecting the state of other pins on the same port, a read-modify-write mechanism is typically used. The mathematical expression of its control logic is as follows: ;in, The updated data output register value directly determines the voltage level of the port pins. : The original value of the data output register read at the current moment; : The logical OR operator, used to set a specific bit to 1 without changing other bits; 1: The high-level reference value in binary; Left shift operator; The index of the pin controlling the relay coil in the register typically ranges from 0 to 15. This calculation process precisely controls the hardware pin to output a high level through bit manipulation, driving the external relay to close, thereby physically cutting off the power to the device or closing the valve, completing the final closed loop from algorithmic decision-making to mechanical action.

[0035] Specifically, the process of writing the real-time operating condition matrix data before and after the abnormal trigger moment into the specified storage sector by addressing the local non-volatile memory is as follows: Read the abnormal trigger timestamp recorded by the current system clock; based on the data structure pointer of the circular buffer, calculate the start and end addresses of the real-time operating condition matrix data in the random access memory within the preset time range before and after the timestamp; initialize the local electrically erasable programmable read-only memory through the serial peripheral interface bus; calculate the physical page address of the target sector to be written according to the page alignment rules of the memory; initiate the direct memory access transfer instruction, and burst-write the binary data stream within the range of the start address to the end address into the calculated target physical page address through the serial peripheral interface bus, and write a check code at the end of the data to complete the solidification storage of the abnormal operating condition data.

[0036] This implementation primarily focuses on the hardening of fault scene data based on Direct Memory Access (DMI) technology, aiming to construct a traceable digital black box. Specifically, a circular buffer is a contiguous memory structure used to continuously record the latest data stream, automatically overwriting the oldest data when it is full. An exception trigger timestamp, recorded by the system clock, is used to locate data within the buffer. The Serial Peripheral Interface (SPI) bus is a high-speed, full-duplex synchronous communication bus used to connect the host chip to external memory. Page alignment rules stipulate that electrically erasable programmable read-only memory (EEPROM) must be bounded according to a fixed page size during write operations; otherwise, write failures or data cross-page errors will occur. To quickly locate the write position, the system performs physical page address calculation using the following formula: ;in, The calculated starting address of the physical page of the target sector to be written; The physical base address of the local non-volatile memory; : The floor function operator; The relative offset of the data in the circular buffer, calculated based on the abnormal timestamp; The size of a single real-time operating condition status matrix in bytes; The single-page storage capacity specified in the memory chip datasheet. This formula ensures that write operations strictly adhere to the physical page boundaries of the hardware. Combined with direct memory access instructions, it enables the burst writing of critical data before and after a failure to non-volatile memory without consuming CPU resources, thus achieving permanent data storage and verification.

[0037] Please see Figure 2The edge computing-based water IoT anomaly self-detection system includes the following modules: a state matrix construction module, used to read analog operation data and switch status values ​​from water field sensors, map asynchronously sampled heterogeneous data to the same time section through a sliding time window, perform discrete Kalman filtering on the analog operation data, and construct a real-time operating condition state matrix containing full-dimensional data at the current moment; a logic fault detection module, used to import the real-time operating condition state matrix into the logic operation engine of the edge computing unit, perform Boolean logic operations on the power load data and pipeline hydraulic parameters in the matrix according to preset equipment interlock rules, generate deterministic feature vectors and map them to hard fault risk values; and a comprehensive decision calculation module, used to extract historical subsequences of continuous time steps from the real-time operating condition state matrix. The time series inference model performs convolution operations to calculate the Euclidean distance between the current standard value and the measured value to obtain the prediction deviation value. The data packet loss rate parameter is obtained by reading the status register of the wireless communication module. The dynamic gain coefficient is calculated through the positive correlation function mapping relationship. The prediction deviation value is multiplied and amplified by the dynamic gain coefficient and then weighted and summed with the hard fault risk value to obtain the comprehensive decision index. The autonomous control storage module is used to compare the comprehensive decision index with the preset action threshold register value. When the comprehensive decision index exceeds the action threshold, a high-level signal is directly output through the relay output interface of the acquisition terminal to drive the actuator to act. The local non-volatile memory is then addressed to write the real-time operating condition matrix data before and after the abnormal trigger time into the designated storage sector.

[0038] In this implementation scheme, the state matrix construction module serves as the system's sensing front-end and data preprocessing center, primarily undertaking the task of standardizing and reconstructing heterogeneous data. This module acquires continuous analog signals such as current and pressure, as well as discrete state signals such as pump and valve start-stop, from the field in parallel via underlying drivers. It utilizes a sliding time window mechanism to resolve timing misalignment issues caused by inconsistent sampling frequencies of different sensors, while simultaneously employing a discrete Kalman filter algorithm to eliminate environmental noise interference. Its core function is to provide a high-confidence, time-strictly aligned real-time operating condition state matrix for subsequent logical judgments and algorithmic reasoning, ensuring the accuracy of the data foundation for edge computing. The logic fault detection module, as the system's first line of defense, primarily performs deterministic fault screening based on physical mechanisms. This module inputs the standardized state matrix into the logic operation engine and performs Boolean operations according to pre-set equipment interlocking rules (such as the linkage logic between electrical and hydraulic parameters) to quickly identify hard faults that violate physical principles. Its core function lies in leveraging the computing power of the edge to identify serious safety hazards such as motor idling and pipe bursting at millisecond levels through logical calculations, without relying on complex AI models. These hazards are quantified as hard fault risk values, providing deterministic criteria for comprehensive decision-making. The comprehensive decision-making calculation module, as the system's intelligent core, primarily performs adaptive decision-making based on gradual anomaly inference and communication environment awareness. On one hand, this module uses time-series inference models to mine deep data features and calculate the deviation between measured and theoretical values ​​to capture subtle anomalies. On the other hand, it innovatively introduces a network quality factor, automatically increasing the dynamic gain coefficient through positive correlation mapping when an increase in communication packet loss rate is detected, thus weighting and amplifying the prediction deviation. Its core function is to achieve dynamic sensitivity adjustment in weak network environments, automatically increasing local sensitivity to anomalies when the connection to the cloud is poor. By integrating intelligent algorithm deviations with hard fault risks, a comprehensive decision-making index that balances robustness and sensitivity is generated. The autonomous control storage module, as the system's execution terminal and data black box, primarily undertakes emergency response and on-site data solidification tasks. This module monitors the comprehensive decision index in real time. Once the index exceeds a preset safety threshold, it immediately outputs a high-level signal through the hardware interface to drive a relay, physically cutting off the power or closing a valve. Simultaneously, it uses an addressing mechanism to burst-write the critical state matrix before and after the fault trigger into non-volatile memory. Its core function is to construct a fully closed-loop protection mechanism independent of a host computer, ensuring timely loss mitigation under extreme conditions while completely preserving the original data from the fault scene, providing an tamper-proof basis for subsequent fault review.

[0039] In summary, this application has at least the following effects: A self-detection method and system for water IoT based on edge computing effectively solves the problems of spatiotemporal misalignment and noise interference caused by inconsistent sampling frequencies of sensors at water sites by constructing a preprocessing mechanism based on sliding time windows and discrete Kalman filtering within the edge acquisition terminal. It adopts a dual detection architecture of a logic operation engine and a temporal inference model, enabling millisecond-level identification of hard faults such as motor idling and pipe bursts based on physical interlocking rules, as well as detecting gradual anomalies such as minor leaks in the pipeline network. An adaptive decision-making mechanism based on network environment awareness is introduced, which automatically increases the dynamic gain coefficient through positive correlation mapping to enhance local decision weight when an increase in packet loss rate is detected. Combined with direct drive of relay interfaces and the fault data solidification storage function of non-volatile memory, this ensures that remote or underground water facilities can still achieve closed-loop autonomous protection of data acquisition, fault diagnosis, emergency control, and data retention even under extreme conditions of weak or even no network. This significantly reduces the risk of safety accidents caused by communication delays.

[0040] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0041] This invention is described with reference to flowchart illustrations and / or block diagrams of systems, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0042] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0043] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0044] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0045] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A self-detection method for water-related IoT anomalies based on edge computing, characterized in that, Includes the following steps: S1. Read the analog operation data and switch status values ​​of the water field sensors, map the asynchronously sampled heterogeneous data to the same time section through a sliding time window, perform discrete Kalman filtering on the analog operation data, and construct a real-time operating condition status matrix containing full-dimensional data at the current moment; S2. Import the real-time operating condition matrix into the logic operation engine of the edge computing unit, perform Boolean logic operations on the power load data and pipeline hydraulic parameters in the matrix according to the preset equipment interlock rules, generate deterministic feature vectors and map them as hard fault risk values; S3. Extract the historical subsequence of continuous time steps from the real-time operating condition state matrix and input it into the time series inference model to perform convolution operation. Calculate the Euclidean distance between the standard value and the measured value at the current time to obtain the prediction deviation value. Obtain the data packet loss rate parameter by reading the status register of the wireless communication module. Calculate the dynamic gain coefficient through the positive correlation function mapping relationship. Perform a multiplication amplification operation on the prediction deviation value through the dynamic gain coefficient and then perform a weighted sum with the hard fault risk value to obtain the comprehensive decision index. S4. Compare the comprehensive decision index with the preset action threshold register value. When the comprehensive decision index exceeds the action threshold, a high-level signal is directly output through the relay output interface of the acquisition terminal to drive the actuator to act, and the local non-volatile memory is addressed to write the real-time operating condition matrix data before and after the abnormal triggering time into the specified storage sector. Step S2 includes the following steps: The real-time operating condition state matrix is ​​analyzed to separate the electrical parameter sub-vectors representing the pump operating state and the hydraulic parameter sub-vectors representing the pipeline network operating state. The device interlock logic truth table preset in the edge computing unit memory is called. This truth table defines the normal logical constraint relationship between the electrical operating state and the hydraulic threshold range. The current value in the electrical parameter sub-vector is compared with the operating threshold to obtain the device operating Boolean state. The pressure value in the hydraulic parameter sub-vector is compared with the safety threshold to obtain the hydraulic abnormal Boolean state. Perform a logical AND operation on the Boolean states of equipment operation and hydraulic anomalies. If the result is true, it is determined that the physical interlocking rules have been violated, and the corresponding dimension of the deterministic feature vector is set. Iterate through all dimensions of the deterministic feature vector, and according to the preset fault severity weight table, map the binary set states in the vector and accumulate them into a scalar form of hard fault risk value.

2. The water affairs IoT anomaly self-detection method based on edge computing according to claim 1, characterized in that: The specific process of reading analog operation data and digital status values ​​from sensors at the waterworks site, and mapping asynchronously sampled heterogeneous data to the same time section using a sliding time window is as follows: The voltage and current encoded values ​​acquired by the multi-channel analog interface are written into the memory buffer through the direct memory access channel of the acquisition terminal, and the level transition signal of the switch status is read through the interrupt service routine of the general input / output port. A first-in-first-out data buffer queue is constructed in the random access memory of the edge computing unit, and hardware timer timestamps are used to mark the analog and digital data frames entering the queue. The sliding time window algorithm is started. Using the current system clock as the reference time anchor, a reverse traversal search is performed in the first-in-first-out data buffer queue. The analog data frame with the smallest absolute time difference with the reference time anchor is selected as the analog reference at the current moment. For switch data captured based on level change trigger, a zero-order hold read operation is performed to lock the state value at the most recent transition moment before the reference time anchor. The state value is then combined with the analog reference at the current moment to perform a data bit combination operation.

3. The water affairs IoT anomaly self-detection method based on edge computing according to claim 2, characterized in that: The specific process of performing discrete Kalman filtering on analog operational data to construct a real-time operational status matrix containing full-dimensional data at the current moment is as follows: Initialize the state transition matrix and observation noise covariance matrix of the discrete Kalman filter, and calculate the prior state estimate and prior error covariance at the current time based on the optimal estimate of the previous time step. Read the analog running data of the data bit combination operation that has been performed as the current observation vector, calculate the gain coefficient according to the prior error covariance, and use the current observation vector to perform a weighted correction operation on the prior state estimate through the gain coefficient to generate the posterior state estimate. The flow rate, pressure, and water quality parameters in the posterior state estimates are vector-concatenated with the switch state values, and a time dimension identifier is written at the beginning of the matrix to construct a real-time operating condition state matrix.

4. The water affairs IoT anomaly self-detection method based on edge computing according to claim 1, characterized in that: The specific process of extracting historical subsequences of continuous time steps from the real-time operating condition state matrix and inputting them into the time series inference model to perform convolution operations, and calculating the Euclidean distance between the current standard value and the measured value to obtain the prediction bias value is as follows: A time sliding window is constructed in the memory of the edge computing unit to extract historical time step data of a preset length from the real-time operating condition state matrix and reconstruct it into a multi-dimensional tensor input format. Load the convolutional kernel weight parameters of the pre-trained time series inference model from memory, perform multi-layer convolution and pooling operations on the input tensor through the tensor acceleration computing unit, and output the theoretical prediction vector at the current time after processing by a non-linear activation function. Read the measured vector at the current moment from the real-time operating condition state matrix, calculate the difference between the measured vector and the theoretical prediction vector in each dimension, perform a square summation operation on the differences in all dimensions, and then perform a square root operation to obtain the prediction deviation value that characterizes the degree of deviation of the current operating condition.

5. The water affairs IoT anomaly self-detection method based on edge computing according to claim 4, characterized in that: The process of obtaining the packet loss rate parameter by reading the status register of the wireless communication module, calculating the dynamic gain coefficient through the positive correlation function mapping relationship, and then performing a multiplicative amplification operation on the prediction deviation value using the dynamic gain coefficient and weighted summing it with the hard fault risk value to obtain the comprehensive decision index is as follows: Access the diagnostic port of the wireless communication module through the serial communication interface, send a status query command and read the returned status register value, and parse the fields representing the bit error rate and retransmission count to calculate the data packet loss rate of the current period. By calling a preset linear mapping function or a segmented lookup table algorithm, and taking the packet loss rate as the input variable, the output is calculated to be a dynamic gain coefficient that is positively correlated with the loss rate. The predicted deviation value is multiplied by the dynamic gain coefficient using a floating-point operation to obtain the weighted deviation value. At the same time, the hard fault risk value is read, and the weighted deviation value and the hard fault risk value are added together to generate a comprehensive decision index.

6. The water affairs IoT anomaly self-detection method based on edge computing according to claim 1, characterized in that: The process of comparing the comprehensive decision index with the preset action threshold register value, and then directly outputting a high-level signal to drive the actuator when the comprehensive decision index exceeds the action threshold through the relay output interface of the acquisition terminal, is as follows: Read the preset alarm trigger threshold from the configuration storage area, and call the comparator instruction to compare the comprehensive decision index with the alarm trigger threshold. When the comparison result flag shows that the comprehensive decision index is greater than the alarm trigger threshold, the exception handling interrupt service routine is immediately triggered. In the interrupt service routine, the data output register of the general-purpose input / output port of the mapped relay control circuit is addressed, and a specific bit controlling the on / off state of the relay coil is set to output a continuous high-level logic signal.

7. The water affairs IoT anomaly self-detection method based on edge computing according to claim 6, characterized in that: The specific process of addressing local non-volatile memory and writing the real-time operating condition matrix data before and after the abnormality triggering time into the specified storage sector is as follows: Read the abnormal trigger timestamp recorded by the current system clock, and calculate the start and end addresses of the real-time operating condition matrix data in the random access memory within a preset time range before and after the timestamp, based on the pointer of the data structure in the circular buffer. The local electrically erasable programmable read-only memory is initialized through the serial peripheral interface bus, and the physical page address of the target sector to be written is calculated according to the page alignment rules of the memory. Initiate a direct memory access transfer instruction to burst-write a binary data stream from the start address to the end address into the calculated target physical page address via the serial peripheral interface bus, and write a checksum at the end of the data to complete the solidified storage of abnormal operating condition data.

8. A water affairs IoT anomaly self-detection system based on edge computing, applied to the water affairs IoT anomaly self-detection method based on edge computing as described in any one of claims 1-7, characterized in that, Includes the following modules: The state matrix construction module is used to read the analog operation data and switch status values ​​of sensors at the water treatment site, map the asynchronously sampled heterogeneous data to the same time section through a sliding time window, perform discrete Kalman filtering on the analog operation data, and construct a real-time operating condition state matrix containing full-dimensional data at the current moment. The logic fault detection module is used to import the real-time operating condition matrix into the logic operation engine of the edge computing unit. According to the preset equipment interlock rules, it performs Boolean logic operations on the power load data and pipeline hydraulic parameters in the matrix to generate deterministic feature vectors and map them as hard fault risk values. The integrated decision calculation module is used to extract the historical subsequences of continuous time steps from the real-time operating condition state matrix and input them into the time series inference model to perform convolution operations. It calculates the Euclidean distance between the standard value and the measured value at the current time to obtain the prediction deviation value. It obtains the data packet loss rate parameter by reading the status register of the wireless communication module, calculates the dynamic gain coefficient through the positive correlation function mapping relationship, and performs a multiplication amplification operation on the prediction deviation value through the dynamic gain coefficient and then performs a weighted sum with the hard fault risk value to obtain the integrated decision index. The autonomous control storage module is used to compare the comprehensive decision index with the preset action threshold register value. When the comprehensive decision index exceeds the action threshold, a high-level signal is directly output through the relay output interface of the acquisition terminal to drive the actuator to act, and the local non-volatile memory is addressed to write the real-time operating condition matrix data before and after the abnormal triggering time into the specified storage sector.

Citation Information

Patent Citations

  • Visual application construction method of digital intelligent water affair business data based on open source gap

    CN120997426A