Event rule processing method and apparatus, and event processing method and apparatus
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional event bus systems are inadequate for processing complex event filtering rules, particularly in IoT scenarios, as they lack support for custom rule configurations, duration, and repeatability conditions, leading to inefficiencies in event handling and filtering.
Innovation Solution
The implementation of a programmed event rule expression and plugin manner to support custom extension rules, including duration and repeatability conditions, using a tree-based structure for event matching and storage of event filtering rules by key-value pairs to enhance filtering capabilities and scalability.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If conventional event bus filtering rules are used, then simple event filtering is supported, but complex event filtering scenarios cannot be handled
Solution Approach 1:
The event bus system transitions from static, fixed filtering rules to dynamic, programmable rule expressions. Users can now configure rules with duration conditions (e.g., event must occur within specific time window) and repeatability conditions (e.g., event must occur N times), allowing the system to adapt to complex IoT scenarios like detecting sustained high temperature or repeated error occurrences.
Solution Approach 2:
The system introduces new configurable parameters for event rules, including duration parameters (time window for event occurrence) and repeatability parameters (minimum number of occurrences). These parameter changes enable the event bus to handle complex filtering scenarios while maintaining a structured rule configuration approach through the tree-based expression system.
2Ease of manufacture
If fixed filtering rules are implemented, then implementation is simple, but custom rule configuration is not supported
Solution Approach 1:
The rule expression system is segmented into a tree structure with different node types (condition nodes, logical operator nodes, duration nodes, repeatability nodes). Each node represents a specific aspect of the filtering rule, allowing complex custom rules to be built from simple, standardized components. This segmentation maintains implementation simplicity while enabling extensive custom rule configuration capability.
3Speed
If basic event filtering is used, then processing is fast, but duration and repeatability conditions cannot be evaluated
Solution Approach 1:
The system performs preliminary evaluation of duration and repeatability conditions by maintaining state information about event sequences. As events are processed, the system pre-calculates whether duration thresholds are met and whether repeatability requirements are satisfied, allowing these complex conditions to be evaluated efficiently alongside basic filtering without significant speed penalty.
Data Source
Figure 1~2
Figure 3~4A
Figure 4B
AI summary
This application provides an event processing method, applied to filtering of events in a server. The method includes: matching a to-be-filtered event against an event matching rule, where the event matching rule is used for performing filtering to obtain an event that meets one or more first conditions and one or more second conditions, and the second condition indicates duration or repeatability of the one or more first conditions; and sending an instruction to a destination address when the to-be-filtered event meets the event matching rule. The event processing method provided in this application supports condition rule configuration of duration or repeatability, for example, a timing rule or a count rule. This increases event rule configuration types, and the rule has high extensibility, so that events in a complex Internet of things scenario can be effectively filtered.