A local reasoning and anomaly detection method for wireless sensor networks

By constructing a hypergraph model and performing local neighborhood information reasoning, the problems of high communication energy consumption, high computational complexity, and uncontrollable errors in wireless sensor networks are solved, achieving low-energy, interpretable anomaly detection and localization.

CN122114159APending Publication Date: 2026-05-29UNIV OF SCI & TECH OF CHINA

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
UNIV OF SCI & TECH OF CHINA
Filing Date
2026-02-06
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing wireless sensor networks suffer from high communication energy consumption, high computational complexity, uncontrollable errors, and poor anomaly detection interpretability in resource-constrained real-time distributed networks, making it difficult to achieve deterministic error upper bounds and interpretable real-time anomaly detection based on local communication.

Method used

A hypergraph model is constructed and sensitivity constraints are applied. Local deterministic approximate reasoning is performed using local neighborhood information. The conditional edge probability of sensor nodes is calculated. Anomaly detection is performed based on anomaly scores, including negative log-likelihood scores, local energy mutation scores, or constraint residual aggregation scores.

Benefits of technology

It achieves real-time anomaly detection with low communication and low power consumption, possesses deterministic approximation and controllable error, and can perform interpretable anomaly localization in large-scale networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122114159A_ABST
    Figure CN122114159A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of Internet of Things data processing, and discloses a local reasoning and abnormality detection method for a wireless sensor network, which comprises the following steps: constructing a hypergraph model according to a sensor node set in the sensor network and corresponding association relations, and defining an energy function; applying a sensitivity constraint to the potential function, so that the potential function satisfies a bounded difference condition; determining a constraint range of coupling strength and a truncation order m; performing local deterministic approximate reasoning to obtain a conditional edge probability of a target sensor node; calculating an abnormality score of the target sensor node, and performing abnormality detection. In the wireless sensor network, a hypergraph Gibbs model with a sensitivity constraint is constructed, and based on strong spatial mixing ensured by theory, the application realizes the probability reasoning of a deterministic error bound only by relying on a limited-step local communication, so that the explainable abnormality detection and positioning are completed on a resource-limited edge device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of Internet of Things (IoT) data processing technology, and more specifically to a method for local inference and anomaly detection in wireless sensor networks. Background Technology

[0002] Large-scale wireless sensor networks typically consist of a large number of distributed nodes, and their observation data often exhibits spatial and temporal correlations. To achieve state estimation, data completion, and anomaly detection, existing technologies commonly employ the following approaches:

[0003] (1) Reasoning methods based on probabilistic graphical models, such as belief propagation (BP) and variational inference, are used to estimate marginal distributions or maximum a posteriori (MAP) solutions.

[0004] (2) Sampling-based inference methods, such as Gibbs sampling and MCMC methods, approximate the posterior distribution by generating sample sequences; (3) Anomaly detection methods based on time series or machine learning, such as data-driven algorithms like Kalman filter residuals, isolated forests, and deep autoencoders.

[0005] Although the above methods are theoretically sound, they suffer from the following endogeneous drawbacks in resource-constrained real-time distributed networks: (1) The contradiction between communication energy consumption and convergence: Although sampling and BP algorithms are based on local interaction, a large number of iterations are often required to achieve global consistency in loopy graphs. Frequent wireless transmission and reception lead to a sharp increase in node energy consumption, and the Loopy BP algorithm has the risk of oscillation and non-convergence under certain topologies, lacking convergence guarantee.

[0006] (2) Resource mismatch in computational complexity: MCMC method is limited by mixing time and converges slowly in large-scale networks; while high-precision variational inference or deep learning models involve complex matrix operations and non-convex optimization, making it difficult to achieve millisecond-level real-time deployment on sensor nodes with weak computing power (such as MCU level).

[0007] (3) Uncontrollability of approximation error: The error of random sampling method has statistical properties, making it difficult to give a deterministic error bound under limited computing power; traditional variational methods often sacrifice accuracy for computational feasibility under non-conjugate models, resulting in the difficulty in quantifying the deviation of the estimation results.

[0008] (4) Lack of interpretability in anomaly detection: Traditional Kalman filtering is difficult to handle nonlinear / non-Gaussian complex anomalies; while machine learning models based on centralized training (such as isolated forests) are not only difficult to deploy at the edge, but also usually only output the decision result, and cannot use the probability dependency structure to perform node-level attribution analysis of the source of anomalies.

[0009] Therefore, there is an urgent need for a technical solution that can achieve the following in sensor networks: local communication based on a finite number of steps, approximate inference with a deterministic upper bound on error, and interpretable real-time anomaly detection using marginal probability distributions. Summary of the Invention

[0010] To address the aforementioned technical problems, this invention provides a method for local inference and anomaly detection in wireless sensor networks. This invention is particularly suitable for monitoring systems with limited computing resources, high-order inter-node relationships, and strong spatiotemporal correlations. Application scenarios include, but are not limited to: industrial Internet of Things (IIoT) fault diagnosis, health monitoring of large-scale infrastructure (power grids / pipelines / bridges), smart building environmental sensing, and environmental monitoring networks.

[0011] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: A method for local inference and anomaly detection in wireless sensor networks, comprising: A hypergraph model is constructed based on the set of sensor nodes in the sensor network and their corresponding relationships, and an energy function containing the sum of potential functions is defined. A sensitivity constraint is applied to the potential function to make the potential function satisfy the bounded difference condition; Obtain the maximum degree Δ and maximum hyperedge size r of the hypergraph model, as well as the upper bound of the sensitivity L of the potential function. Determine the constraint range of the coupling strength based on Δ, r, and L, and determine the truncation order m as the m value of the m-hop neighborhood based on the preset target error. Obtain the m-hop neighborhood information of the target sensor node in the hypergraph model, and perform local deterministic approximate reasoning based on the information in the m-hop neighborhood to obtain the conditional marginal probability of the target sensor node; The anomaly score of the target sensor node is calculated based on the conditional edge probability, and anomaly detection is performed on the sensor according to the anomaly score.

[0012] In one embodiment, the step of constructing a hypergraph model based on the set of sensor nodes in the sensor network and their corresponding relationships, defining an energy function containing the sum of potential functions, and defining the corresponding Gibbs probability distribution based on the coupling strength specifically includes: The associations are constructed based on spatial proximity, network topology, physical constraints, or business relevance; Define the state of each sensor node as a variable, define... Let be the joint state vector of all sensor nodes. Let be the variable sub-vector composed of the states of multiple sensor nodes connected to each hyperedge e in the hypergraph model. , Energy function , Let be the potential function of the hyperedge e. Let be the set of superedges.

[0013] In one embodiment, the application of sensitivity constraints to the potential function is achieved by one or any combination of the following methods: normalizing or binning the sensor observations, penalizing the constraint residuals with a piecewise linear or truncated loss function, and truncating the potential function output.

[0014] In one embodiment, determining the constraint range of the coupling strength based on Δ, r, and L specifically includes: The constraint range for coupling strength β is: ; Where c is the preset safety factor.

[0015] In one embodiment, determining the truncation order m based on a preset target error specifically includes: , in Related to Δ, r, L, and coupling strength β, ε∈(0,1) is the preset target error. This represents the function for rounding up.

[0016] In one embodiment, the step of acquiring the m-hop neighborhood information of the target sensor node in the hypergraph model, and performing local deterministic approximate inference based on the information within the m-hop neighborhood to obtain the conditional marginal probability of the target sensor node specifically includes: Inference is performed on target sensor node j at time t: Obtain the m-hop neighborhood sphere centered on the target sensor node j in the hypergraph model. Within the observation and necessary parameters; information outside the neighborhood is represented by boundary event A; Partition function with boundaries defined under event A constraint : ; For coupling strength, Joint state vector The energy function, Represents the joint state vector The corresponding probability measure; For any measurable set of target sensor nodes j Conditional marginal probability Defined as: ; This represents the state variable corresponding to the target sensor node j; right A deterministic approximation with a truncation order of m is performed to obtain the conditional marginal probability. The estimate.

[0017] In one embodiment, the step of calculating the anomaly score of the target sensor node based on the conditional edge probability and performing anomaly detection on the sensor according to the anomaly score specifically includes: Based on the local inference output, anomaly scores are constructed, which are negative log-likelihood scores, local energy mutation scores, or constrained residual aggregation scores. Among them, target sensor nodes negative log-likelihood fraction ; This represents the approximate probability distribution. This represents the value actually observed by the target sensor node j at time t. Neighborhood observation refers to the set of observations (i.e., A) of other sensor nodes within a certain neighborhood of the target sensor node j at time t. The change in local energy or local logarithmic partition function before and after the current observation is taken as the local energy mutation fraction; For target sensor nodes The relevant hyperedge set E(j) is used to calculate the aggregate value of the constraint residual on each hyperedge as the constraint residual aggregate score; The anomaly score is compared with a preset threshold. If the score exceeds the threshold, an anomaly alarm is triggered, and the correlation constraint with the largest contribution of the anomaly is output for anomaly localization.

[0018] Compared with the prior art, the beneficial technical effects of the present invention are: Real-time performance and scalability: Inference relies only on m-hop neighborhood information, and the computation and communication overhead is weakly correlated with the overall network size, making it suitable for large-scale edge deployment.

[0019] Deterministic approximation and controllable error: The truncation order m is controlled by the target error, the output accuracy is configurable, and convergence is independent of random sampling.

[0020] Enhanced stability: Under parameter constraints, the influence of distant boundaries diminishes with distance, reducing the risk of non-convergence in iterative inference on networks containing loops.

[0021] Anomaly localization can be explained: Anomaly scores originate from local probabilities and can be located to nodes and related hyperedges, which facilitates operation and maintenance and diagnosis.

[0022] Low communication and low power consumption: Only m-hop neighborhood communication is required, reducing bandwidth usage and node power consumption, making it suitable for battery-powered or low-power networks. Attached Figure Description

[0023] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation

[0024] A preferred embodiment of the present invention will now be described in detail with reference to the accompanying drawings.

[0025] like Figure 1 As shown, this invention provides a method for local inference and anomaly detection in wireless sensor networks, comprising the following steps: S1. Construct a hypergraph model based on the set of sensor nodes in the sensor network and their corresponding relationships, and define an energy function that includes the sum of potential functions; S2, apply a sensitivity constraint to the potential function so that the potential function satisfies the bounded difference condition; S3, obtain the maximum degree Δ and maximum hyperedge size r of the hypergraph model and the upper bound of the sensitivity L of the potential function, determine the constraint range of the coupling strength according to Δ, r and L, and determine the truncation order m according to the preset target error; S4, obtain the m-hop neighborhood information of the target sensor node in the hypergraph model, and perform local deterministic approximate reasoning based on the information in the m-hop neighborhood to obtain the conditional edge probability of the target sensor node; S5, calculate the anomaly score of the target sensor node based on the conditional edge probability, and perform anomaly detection on the sensor according to the anomaly score.

[0026] The technical solution of the present invention will be described in detail below in several parts.

[0027] 1. Construction of hypergraph model and Gibbs probability distribution.

[0028] The set of sensor nodes is denoted as V, and the set of hyperedges is denoted as E. Hyperedges can be constructed based on spatial proximity, network topology, physical constraints, or business statistics-related rules. A hypergraph is a graph structure that allows a single edge to connect multiple nodes.

[0029] Collect real-time observations from each sensor node. Mapping observations to variables The variable can be a continuous value or a discrete state.

[0030] definition Let the joint state of all variables be... The energy function (Hamiltonian) is: ;in Let e ​​represent the variable subvectors involved in the hyperedge e.

[0031] Introducing coupling strength β, we define the Gibbs distribution. The coupling strength β is a parameter that controls the degree of influence of the energy term.

[0032] 2. Potential function design and sensitivity constraints.

[0033] To support local approximation and error control, the local potential function of the hyperedge e is... It needs to satisfy the bounded difference condition, such as the L-Lipschitz condition: when and If they differ only at one coordinate, then , Indicates that the hyperedge e involves the relationship with Different variable subvectors.

[0034] The sensitivity reduction of the potential function can be achieved by one of the following methods or any combination thereof: The constraint residuals are penalized using piecewise linear or truncated loss functions; Normalize or bin the observations to control the amplitude of single-point disturbances; The output of the potential function is truncated to limit the maximum change.

[0035] 3. Parameter selection and truncation order determination.

[0036] (1) Structural parameters: Maximum degree Δ: The maximum number of hyperedges involved by any sensor node; Maximum superedge size r: ,and , which represents the maximum number of nodes contained in a single hyperedge; Upper bound L of potential function sensitivity: a constant that satisfies the above bounded difference condition.

[0037] (2) Coupling strength β: To ensure that the influence of distant boundaries decays exponentially with distance, β can be constrained within a safe range determined by Δ, r, and L. In a preferred embodiment, the constraint range for the coupling strength β is: ; Where c is a preset safety factor, which can be determined by offline calibration.

[0038] (3) Cutoff order m: Given target error Set the cutoff order , where 'a' is related to Δ, r, L, and β. A larger 'm' results in a smaller inference error, but also a corresponding increase in computational and communication overhead. Target error This is the upper bound of the allowable error for inference approximation.

[0039] 4. Local deterministic approximate reasoning process.

[0040] The following is an example of the process for inference on target sensor node j at time t: A1, Neighborhood Collection: Obtain the m-hop neighborhood sphere centered on the target sensor node j in the hypergraph. The observations and necessary parameters within the target sensor node j are defined; information outside the neighborhood is represented by boundary events A (observation range, missing marker, or constraint range). The m-hop neighborhood sphere centered on the target sensor node j refers to the set of nodes in the hypergraph whose shortest hyperedge path length from the target sensor node j does not exceed m. Here, the observations and necessary parameters refer to quantities such as the sensor node's measurements, graph structure, and graph connectivity state within the m-hop neighborhood sphere.

[0041] A2, Pinned Local Model: Defines a boundary-bounded partition function under the constraint of event A. : .

[0042] A3, Conditional Marginal Probability: For any measurable set Conditional marginal probability Defined as: .

[0043] Given a set X and a family of subsets Σ of X. If Σ is a σ-algebra, then the pair (X, Σ) is called a measurable space. Within this framework, a subset A... X is called a measurable set if and only if A∈Σ. Σ can be understood as a set that "allows measurement (assigning values ​​such as length, area, volume, or probability)". Measurable sets are those sets that belong to Σ; only for these sets are measures or probabilities defined as "meaningful and consistent". For example, an interval consisting of lengths from 30cm to 50cm is a measurable set.

[0044] A4, Truncation Approximation Calculation: Under weak coupling conditions, for or A deterministic approximation with a truncation order of m is performed (this can be achieved through local truncation, Barvinok approximation, or equivalent local recursion), yielding: Logarithmic partition function approximation The estimate; Conditional marginal probability The estimate.

[0045] Here is an example of an approximate calculation method: (a) Expected to calculate The truncated Taylor polynomial approximation: ; (b) Coefficient It is obtained by accumulating the contributions of connected substructures within the neighborhood sub-hypergraph: enumeration A connected sub-hypergraph F with no more than k internal hyperedges can be solved using the Regts algorithm. It is computed in polynomial time; (c) Then calculate approximation Then, the ratio of the partition function is calculated. .

[0046] A5, Output: Outputs the predicted distribution or marginal probability of the target sensor node j for subsequent anomaly detection and control.

[0047] 5. Anomaly detection and localization.

[0048] Anomaly scores are constructed based on local inference output. In a preferred embodiment, the anomaly scores include, but are not limited to: (1) Negative log-likelihood fraction: .

[0049] (2) Local energy mutation fraction: The change in local energy or local logarithmic partition function before and after the current observation is significant and is judged as an anomaly.

[0050] (3) Constrained residual aggregation fraction: for the target sensor node Given the relevant set of hyperedges E(j), calculate the aggregate value of the constraint residuals on each hyperedge.

[0051] An alarm is triggered when the abnormal score exceeds a threshold, and the superedge / constraint that contributes the most is output for interpretation and localization. The threshold can be a static threshold, a quantile threshold, or a sliding window adaptive threshold. The abnormal score can be calculated by choosing one of the three scores, selecting the maximum value of the three scores, or treating all three scores as abnormal scores, setting thresholds for each, and judging an abnormality as long as any score exceeds the threshold.

[0052] Example 1, Building Environment Monitoring (Temperature, Humidity, or Carbon Dioxide): Scenario: Multi-room sensor network in a building.

[0053] Modeling: Nodes are room sensors; edges are adjacent rooms; multiple rooms in the same air conditioning branch can form hyperedges (e.g., r=3 or r=4) to express coupling constraints.

[0054] Potential function: Temperature difference between adjacent rooms and energy consistency residuals in the same branch are used, and a loss function is applied and truncated to satisfy bounded difference.

[0055] Operation: Updates at a fixed sampling period (e.g., 1 minute); sets the target error ε and calculates m; each node only exchanges necessary summary information with its m-hop neighbors.

[0056] Anomaly: Sensor drift, short circuit, or sudden opening of doors or windows causes a significant deviation in local probability, triggering an alarm and locating the relevant room or branch.

[0057] Example 2, Vibration monitoring of industrial equipment: Scenario: Multi-point vibration sensors or current sensors on a production line.

[0058] Modeling: Multiple sensors of the same device form a hyperedge (r≥3) to represent the cooperative change constraint.

[0059] Anomalies: Bearing wear, loosening, etc. cause the residual to continue to increase. When the anomaly score accumulates within the sliding window and exceeds the threshold, an alarm is triggered, and the most relevant superedge is output for explanation.

[0060] Example 3, Power Grid or Pipeline Network Monitoring: Scenario: Monitoring of voltage and current at power grid nodes or flow and pressure in pipeline networks.

[0061] Modeling: The potential function is constructed from the residuals of physical equations such as Kirchhoff's Current Law (KCL), Kirchhoff's Voltage Law (KVL), or flow conservation, and piecewise linear or truncated quadratic equations are used to control the sensitivity.

[0062] Advantages: Anomalies can not only locate abnormal nodes, but also point out the violated conservation constraints, which facilitates rapid troubleshooting.

[0063] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the invention. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0064] It should be understood that although the steps in the flowcharts of the accompanying drawings are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the flowcharts of the accompanying drawings may include multiple steps or stages, which are not necessarily completed at the same time, but may be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but may be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0065] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0066] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention, and no reference numerals in the claims should be construed as limiting the scope of the claims.

[0067] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.

Claims

1. A method for local inference and anomaly detection in wireless sensor networks, characterized in that, include: A hypergraph model is constructed based on the set of sensor nodes in the sensor network and their corresponding relationships, and an energy function containing the sum of potential functions is defined. A sensitivity constraint is applied to the potential function to make the potential function satisfy the bounded difference condition; Obtain the maximum degree Δ and maximum hyperedge size r of the hypergraph model, as well as the upper bound of the sensitivity L of the potential function. Determine the constraint range of the coupling strength based on Δ, r, and L, and determine the truncation order m as the m value of the m-hop neighborhood based on the preset target error. Obtain the m-hop neighborhood information of the target sensor node in the hypergraph model, and perform local deterministic approximate reasoning based on the information in the m-hop neighborhood to obtain the conditional marginal probability of the target sensor node; The anomaly score of the target sensor node is calculated based on the conditional edge probability, and anomaly detection is performed on the sensor according to the anomaly score.

2. The method for local inference and anomaly detection in a wireless sensor network according to claim 1, characterized in that, The process of constructing a hypergraph model based on the set of sensor nodes and their corresponding relationships in the sensor network, defining an energy function that includes the sum of potential functions, and defining the corresponding Gibbs probability distribution based on the coupling strength, specifically includes: The associations are constructed based on spatial proximity, network topology, physical constraints, or business relevance; Define the state of each sensor node as a variable, define... Let be the joint state vector of all sensor nodes. Let be the variable sub-vector composed of the states of multiple sensor nodes connected to each hyperedge e in the hypergraph model. , Energy function , Let be the potential function of the hyperedge e. Let be the set of superedges.

3. The method for local inference and anomaly detection in a wireless sensor network according to claim 1, characterized in that, The sensitivity constraint applied to the potential function is achieved through one or any combination of the following methods: normalizing or binning the sensor observations, penalizing the constraint residuals using a piecewise linear or truncated loss function, and truncating the potential function output.

4. The method for local inference and anomaly detection in a wireless sensor network according to claim 1, characterized in that, The constraint range for determining the coupling strength based on Δ, r, and L specifically includes: The constraint range for coupling strength β is: ; Where c is the preset safety factor.

5. The method for local inference and anomaly detection in a wireless sensor network according to claim 1, characterized in that, The step of determining the truncation order m based on the preset target error specifically includes: , in Related to Δ, r, L, and coupling strength β, ε∈(0,1) is the preset target error. This represents the function for rounding up.

6. The method for local inference and anomaly detection in a wireless sensor network according to claim 1, characterized in that, The process of acquiring the m-hop neighborhood information of the target sensor node in the hypergraph model, and performing local deterministic approximate inference based on the information within the m-hop neighborhood to obtain the conditional marginal probability of the target sensor node, specifically includes: Inference is performed on target sensor node j at time t: Obtain the m-hop neighborhood sphere centered on the target sensor node j in the hypergraph model. Within the observation and necessary parameters; information outside the neighborhood is represented by boundary event A; Partition function with boundaries defined under event A constraint : ; For coupling strength, Joint state vector The energy function, Represents the joint state vector The corresponding probability measure; For any measurable set of target sensor nodes j Conditional marginal probability Defined as: ; This represents the state variable corresponding to the target sensor node j; right A deterministic approximation with a truncation order of m is performed to obtain the conditional marginal probability. The estimate.

7. The method for local inference and anomaly detection in a wireless sensor network according to claim 1, characterized in that, The step of calculating the anomaly score of the target sensor node based on the conditional edge probability, and performing anomaly detection on the sensor according to the anomaly score, specifically includes: Based on the local inference output, anomaly scores are constructed, which are negative log-likelihood scores, local energy mutation scores, or constrained residual aggregation scores. Among them, target sensor nodes negative log-likelihood fraction ; This represents the approximate probability distribution. This represents the value actually observed by the target sensor node j at time t. Neighborhood observation refers to the set of observations of other sensor nodes within a certain neighborhood of the target sensor node j at time t. The change in local energy or local logarithmic partition function before and after the current observation is taken as the local energy mutation fraction; For target sensor nodes The relevant hyperedge set E(j) is used to calculate the aggregate value of the constraint residual on each hyperedge as the constraint residual aggregate score; The anomaly score is compared with a preset threshold. If the score exceeds the threshold, an anomaly alarm is triggered, and the correlation constraint with the largest contribution of the anomaly is output for anomaly localization.