Overview
The Edge Rule Engine pushes some business rules from the cloud down to the edge gateway for execution, performing local judgments and triggering actions where the device data is generated, without the need to upload data to the cloud before issuing commands. This 'edge decision-making' brings three major benefits: ①Low latency — scenarios like industrial safety interlocks and emergency shutdowns require millisecond-level responses, which cannot be met by round trips to the cloud; ②Offline availability — when the network is interrupted, the edge can still execute alerts and linkages based on local rules, ensuring basic safety; ③Reduced cloud load — filtering and aggregation are performed at the edge, reducing the amount of uploaded data. It forms a 'real-time at the edge + complex in the cloud' division of labor with the cloud rule engine.
Rules of the edge rule engine are usually configured centrally in the cloud and then distributed to the edge, with the edge synchronizing periodically. Rule formats can be JSON DSL, SQL-like, or visual configuration. The execution engine needs to be lightweight to fit the limited computing power and memory of edge devices.
Core Functions
Local Trigger
Threshold judgment: temperature >50°C, pressure <0.1MPa, etc., with immediate action triggered when met. Device offline detection: alarm if no data is received for more than N minutes. Supports multiple condition combinations (AND/OR), time windows, and duration. Triggered actions include local alarms, device control, data reporting, and log recording.
Device linkage
Sensor triggers actuators: for example, automatically open the irrigation valve when soil moisture <30%; turn on supplemental lighting when illumination <100 lux. No cloud involvement required, local closed-loop. Supports multi-device linkage, delayed execution, interlock logic (e.g., if A is on then B is off).
Data filtering and aggregation
Change threshold filtering: only report when the value changes exceed Δ, reducing invalid data. Time window aggregation: for example, report the average or maximum once per minute. Upload only when conditions are met: for instance, only upload anomalies, store or discard normal data locally. Significantly reduces bandwidth and cloud storage costs.
Rule synchronization
Cloud configuration rules are issued to the edge via MQTT or HTTP. The edge parses and loads them, supporting hot updates. During network outages, the edge uses the last synchronized rules; once restored, it automatically pulls the latest rules. Supports rule version management and phased release.
Typical IoT Applications
Industrial safety interlock: Immediately closes valves when pressure exceeds limits, cuts off heating when temperature is abnormal, with millisecond-level response, ensuring personal and equipment safety.
Local smart home scenarios: Home mode and away mode can still execute when offline, not relying on cloud availability.
Agricultural irrigation linkage: Automatically irrigates when soil moisture is below the threshold, without human or cloud intervention. Local linkage is more reliable when field networks are unstable.
Energy station: Local alarms and protection for power over-limit, harmonic anomalies, etc., reducing reliance on the cloud.
Technical Implementation
EdgeX Foundry's Application Service and Rule Engine support edge rules. Node-RED can achieve visual rule orchestration. Some edge gateways have built-in rule engines. When combined with edge storage and edge protocol adaptation, a complete edge data processing chain is formed.