A method and system for handling complex events in IoT-enabled intelligent scenarios
By employing a dual filtering strategy of time pruning and predicate pruning in intelligent IoT scenarios, and utilizing window-aware Bloom filters and ordered arrays to optimize communication, the high transmission overhead and latency issues caused by limited computing resources of sensor nodes are resolved, enabling efficient processing of complex events.
Patent Information
- Application Number
- CN202511348570.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-21
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2045-09-21
AI Technical Summary
In IoT-enabled smart scenarios, existing methods for handling complex events suffer from high transmission overhead and processing latency due to the limited computing resources of sensor nodes, making it impossible to effectively utilize the computing power of sensor nodes.
A lightweight event filtering mechanism is adopted, which reduces the transmission of irrelevant events from sensor nodes to the central node through a dual filtering strategy of time pruning and predicate pruning. Communication is optimized by using window-aware Bloom filters and ordered arrays, and the set of feasible time intervals is gradually reduced.
This reduces communication overhead and processing latency between sensor nodes and the central node, and improves the efficiency of handling complex events.
Smart Images

Figure CN120825459B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of event stream processing, and in particular relates to a method and system for handling complex events in intelligent scenarios of the Internet of Things. Background Technology
[0002] The Internet of Things (IoT) is profoundly changing people's lives. Ubiquitous smart sensors and connected devices enable continuous monitoring of the real-world environment and intelligent management. Edge intelligence, a key development direction in IoT in recent years, deploys sensing, computing, and decision-making processes on edge devices close to the data source, allowing data to be processed and responded to locally in real time, significantly improving the system's real-time performance, reliability, and security. However, a core technical challenge in processing data generated by edge devices is minimizing query latency for complex event processing in edge intelligence scenarios. Achieving efficient complex event processing is crucial for optimizing edge intelligence functionality and upgrading the system. Specifically, consider the following three application scenarios:
[0003] (1) Suspicious Burglary Detection Scenario: The smart lock can record the attempts and results of password input, the infrared sensor can detect whether someone is in the room, and the optical sensor can detect the opening and closing of windows. If, at some point, multiple incorrect password attempts are detected, and then, within a short period, an open window and the presence of someone are detected in the room, it may indicate a suspected burglary. An alert notification should be sent to the user, or a user-defined alarm should be triggered.
[0004] (2) Industrial Internet of Things (IIoT) Anomaly Detection Scenarios: Electricity meters monitor the current power of equipment, temperature sensors monitor the real-time temperature of equipment, and cooling systems record operating and stopped states. At any given moment, if the current operating power of the equipment exceeds the normal operating range, and the equipment temperature rises by more than 10 degrees Celsius while the cooling system remains stopped, it indicates a possible cooling system malfunction or equipment overload. An overheating warning needs to be issued, and the equipment's operating power reduced.
[0005] (3) Health monitoring scenario for users living alone: The smart control screen can listen to voice input and respond to user requests through a microphone array; the infrared sensor can detect whether someone is in the room; and the smart bracelet can monitor the user's movement and various physiological indicators such as heart rate. At a certain moment, if someone is detected in the room but has not moved or made any sound for a long time, and the physiological indicators show abnormal data, it indicates that the user may be experiencing a sudden fainting or other special condition. It is necessary to turn on the room lights, try to wake them up through the smart control screen, and call emergency contacts for assistance.
[0006] In the three application scenarios mentioned above, data generated by multiple sensor nodes, combined with user-defined event attribute values, the sequence of events, and time window constraints, constitute a complex event pattern. However, existing complex event processing methods are typically based on centralized network architectures, where all data generated by sensor nodes is directly transmitted to a single intelligent central control terminal (i.e., the central node) with high computing power, completely ignoring the limited computing and storage capabilities of sensor nodes. Furthermore, user-defined complex event patterns usually occur infrequently; if sensor nodes transmit all their data to the central node, the network communication overhead will inevitably be very high (it's worth noting that in edge intelligence scenarios, the bottleneck for complex event processing usually comes from the network, not the computing power of the central node). Additionally, unlike distributed processing, due to the relatively limited computing resources of sensor nodes, tasks cannot be completely offloaded to sensor nodes in edge intelligence scenarios. In summary, these issues lead to high transmission overhead and processing latency in complex event processing in edge intelligence scenarios. How to effectively utilize the computing power of sensor nodes and minimize overall network transmission overhead to reduce overall query latency based on given query features has become an urgent problem to be solved in complex event processing in edge intelligence scenarios. Summary of the Invention
[0007] Purpose of the invention: In order to effectively utilize the computing power of sensor nodes in edge intelligent scenarios, reduce unnecessary network transmission overhead of sensor nodes, and achieve the goal of efficient complex event processing in edge intelligent scenarios, this invention provides a method and system for complex event processing in IoT edge intelligent scenarios. Through a lightweight and efficient event filtering mechanism, the number of events transmitted from sensor nodes to the central node is effectively reduced, the communication overhead between sensor nodes and the central node is reduced, thereby reducing the overall latency of complex event processing.
[0008] To achieve the above-mentioned objectives, the technical solution of the present invention is as follows:
[0009] Firstly, a method for handling complex events in intelligent IoT scenarios, applied to sensor nodes, includes:
[0010] The system receives the variable processing plan from the central node, generates reference bindings for the events corresponding to each variable according to the variable processing plan, and then sends the timestamp of the event bound to the first variable to be processed to the central node. The central node constructs an initial set of feasible time intervals based on the received timestamps and processes the remaining variables in sequence according to the variable processing plan.
[0011] In a communication round, the current feasible time interval set is received from the central node. If there is an equivalence dependency constraint between the variable processed in the current communication round and the variable processed in the previous communication round, a window-aware Bloom filter is constructed using the attribute values and timestamp information of the events bound to the processed variables and sent to the central node. The central node merges them into a complete window-aware Bloom filter. Then, based on the complete window-aware Bloom filter, the reference bindings of events whose corresponding attribute values are not under their current time window or adjacent window are removed from the events bound to the current processed variables.
[0012] If the current processing variable does not have any equivalence dependency constraints or the equivalence dependency constraints of the current processing variable have been processed, remove the event references bound to the current processing variable whose timestamps do not fall within the current feasible time interval set;
[0013] A new set of feasible time intervals is constructed based on the event list bound to the current processing variable. The intersection of this set with the current set of feasible time intervals is taken and sent back to the central node. The central node then merges these sets to obtain a new set of current feasible time intervals, thus completing one communication cycle.
[0014] After all variables to be processed are processed, the final feasible time interval set is received from the central node. Events whose timestamps fall within the final feasible time interval set are selected from the events bound to each variable and sent back to the central node. The central node then matches the obtained events to obtain the final query results.
[0015] Preferably, when constructing a window-aware Bloom filter, multiple independent hash functions are used for all events bound to the variable. The hash value is calculated using the time window ID where the event timestamp is located as the hash function seed and the corresponding attribute value as the key, and the corresponding bit in the bit array is set to 1. The time window ID is obtained by dividing the event timestamp by the query window length and taking the integer part of the result.
[0016] In a second aspect, an electronic device includes: one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, wherein when the programs are executed by the processors, they implement the steps of the complex event handling method in the IoT-enabled smart scenario as described in the first aspect.
[0017] Thirdly, a method for handling complex events in intelligent IoT scenarios, applied to a central node, includes the following:
[0018] Based on the characteristics of complex event patterns, a variable processing plan is determined and sent to each sensor node, which then generates reference bindings for the events corresponding to each variable.
[0019] Receive the timestamp of the event bound to the first variable to be processed in the variable processing plan from the sensor node, construct an initial set of feasible time intervals, and process the remaining variables in sequence according to the variable processing plan;
[0020] In a single communication round, the current feasible time interval set is sent to each sensor node. The sensor nodes then update the feasible time interval set. Specifically, if a sensor node determines that there is an equivalence constraint between the variable being processed in the current communication round and the variable processed in previous communication rounds, and constructs a window-aware Bloom filter using the attribute values and timestamp information of the events bound to the processed variables, it receives the window-aware Bloom filter from the sensor nodes, merges it into a complete window-aware Bloom filter, and sends it back to each sensor node. Each sensor node then removes references to events whose corresponding attribute values are not within its current time window or adjacent window from the events bound to the currently processed variable based on the complete window-aware Bloom filter. Additionally, if the current processed variable does not have an equivalence constraint or its equivalence constraint has been processed, the sensor nodes remove event references bound to the current processed variable whose timestamps do not fall within the current feasible time interval set. A new feasible time interval set is then constructed based on the event list bound to the current processed variable, and its intersection with the current feasible time interval set yields the updated feasible time interval set.
[0021] Receive updated sets of feasible time intervals from each sensor node, merge them to obtain a new set of current feasible time intervals, and complete one round of communication.
[0022] After all variables to be processed are completed, the final set of feasible time intervals is sent to each sensor node. The sensor node then selects events whose timestamps fall within the final set of feasible time intervals from the events bound to each variable, and matches the events selected by the sensor node to obtain the final query results.
[0023] Preferably, in the process of determining the processing order of each variable in the variable processing plan, a greedy strategy is used to first select the variable with the shortest time window covered by the generated feasible time interval as the first variable to be processed; secondly, the variable with the lowest selection rate is selected from the variables without equi-dependency constraints; when all unselected variables have equi-dependency constraints, the variable whose corresponding dependent variable was selected earliest is selected from the variables that only have equi-dependency constraints with the selected variables. If there are multiple such variables, the variable with the lowest selection rate is selected; when all unselected variables have equi-dependency constraints with other unselected variables, the variables with the lowest selection rates are selected sequentially for processing.
[0024] Preferably, the set of feasible time intervals is generated from the timestamps of the original events. For example, if the timestamp of a certain original event is... The time interval specified by the complex event pattern is Then the feasible time interval for the generation of this original event for:
[0025] ,
[0026] The first variable refers to the first variable in the complex event pattern being processed, while the last variable refers to the last variable in the complex event pattern being processed.
[0027] Preferably, the set of feasible time intervals is represented by an ordered array. The ordered array stores multiple time intervals that may contain matching results. Each time interval only records its start time and end time, and all time intervals do not overlap. When performing search, insertion, and deletion operations, a binary search method is used to quickly locate the relevant time intervals for operation.
[0028] Fourthly, an electronic device includes: one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, wherein when the programs are executed by the processors, they implement the steps of the complex event handling method in the IoT-enabled smart scenario as described in the third aspect.
[0029] Fifthly, a method for handling complex events in intelligent IoT scenarios includes the following steps:
[0030] (1) The central node receives complex event patterns given by the user, including variable names, attribute constraints and time window information;
[0031] (2) The central node determines the variable processing plan based on the characteristics of the complex event pattern and sends the variable processing plan to each sensor node. The variable processing plan includes the processing order and filtering logic of each variable.
[0032] (3) The sensor node reads the events corresponding to each variable from memory according to the independent constraints in the complex event pattern and generates pointer references for binding. Then, it selects the variable to be processed first and sends the timestamps of all its bound events to the central node.
[0033] (4) After receiving the timestamps from all sensor nodes, the central node constructs an initial feasible time interval set based on the received timestamps. The initial feasible time interval set is a set of time intervals that may contain matching events.
[0034] (5) If there are no unprocessed variables in the variable processing plan, jump to step (14); otherwise, start a new communication cycle and process the next unprocessed variable in the variable processing plan according to steps (6) to (13).
[0035] (6) The central node sends the set of current feasible time intervals to each sensor node;
[0036] (7) If there is no equivalence constraint between the variable being processed in the current exchange round and the variable being processed in the previous exchange round, jump directly to step (11); otherwise, proceed to step (8) to step (10).
[0037] (8) The sensor node constructs a window-aware Bloom filter for the corresponding attribute value and timestamp information of the event based on the events bound to the processed variables in the equivalent constraint conditions, and sends it to the central node;
[0038] (9) After receiving the window-aware Bloom filters from all sensor nodes, the central node performs a bit OR operation on these filters, merges them into a complete window-aware Bloom filter, and sends it back to each sensor node.
[0039] (10) The sensor node uses the complete window-aware Bloom filter to check whether the attribute value corresponding to the event to which the currently processed variable is bound is in the time window or adjacent window where the event is located. If not, the variable is removed from the reference binding to the event.
[0040] (11) After all the equivalence dependency constraints are processed, the sensor node checks whether the timestamp of the event to which the currently processed variable is bound falls within the current feasible time interval set. If not, the variable is removed from the reference binding to the event.
[0041] (12) The sensor node constructs a new set of feasible time intervals based on the events bound to the current processing variable, and takes the intersection with the current set of feasible time intervals, and sends the result back to the central node;
[0042] (13) After receiving the set of feasible time intervals from all sensor nodes, the central node takes the union of the sets and uses it as the updated set of current feasible time intervals;
[0043] (14) After all the variables to be processed in the variable processing plan are processed, the central node sends the final feasible time interval set to each sensor node. The sensor node selects the events whose timestamps fall in the final feasible time interval set from the events bound to each variable and sends them back to the central node.
[0044] (15) After receiving the filtered events from all sensor nodes, the central node transmits them to the matching engine for matching and obtains the final query results.
[0045] Sixthly, a complex event processing system for intelligent scenarios in the Internet of Things (IoT) includes:
[0046] A sensor node device is used for the generation, storage, and partial processing of data in an edge intelligent scenario, wherein the partial processing is performed according to the complex event handling method in the IoT edge intelligent scenario described in the first aspect.
[0047] The central node device is used to communicate with each sensor node device and to perform complex event processing according to the complex event processing method in the IoT terminal intelligent scenario described in the third aspect.
[0048] Beneficial Effects: This invention employs a lightweight dual-filtering strategy of time-based event pruning and predicate-based time pruning to minimize the transmission of irrelevant matching events from sensor nodes to the central node, thereby reducing communication overhead between them. By progressively reducing the set of feasible time intervals through multiple rounds of communication, it decreases the bandwidth requirements for communication between the sensor nodes and the central node. Furthermore, by utilizing data structures such as ordered arrays and window-aware Bloom filters, it efficiently executes relevant operations within the algorithm while reducing the amount of data to be transmitted. In the complex event processing of edge-oriented intelligent scenarios, this invention utilizes constraints such as query windows and dependencies to avoid the transmission of irrelevant original events, reducing communication overhead and processing latency, thus improving processing efficiency. Attached Figure Description
[0049] Figure 1 This is a flowchart of the efficient and complex event handling method for edge-oriented intelligent scenarios according to the present invention.
[0050] Figure 2 This is a schematic diagram illustrating the specific screening process of the dual filtering strategy of the present invention.
[0051] Figure 3 This is a schematic diagram illustrating the specific processing procedure of the complex event handling method of the present invention.
[0052] Figure 4 This is a schematic diagram comparing the average communication overhead of the processing method of the present invention with that of existing methods.
[0053] Figure 5 This is a schematic diagram comparing the average query latency of the processing method of the present invention with that of existing methods. Detailed Implementation
[0054] The technical solution of the present invention will be further described below with reference to the accompanying drawings.
[0055] This invention uses a suspected burglary incident identification application as an example to exemplify the specific process of an efficient and complex event handling method for edge-oriented intelligent scenarios. Considering a suspected burglary incident handling scenario, a smart door lock can record each password attempt and its result; infrared sensors are deployed in the room to detect and record whether anyone is present; optical sensors can detect the opening and closing of windows. In this embodiment, the sensor nodes represented by each sensor cannot communicate with each other and have limited computing power; the central node, represented by the intelligent control terminal or cloud server, can communicate with each sensor node and has high computing power.
[0056] like Figure 1 As shown, this embodiment discloses a method for handling complex events. This method achieves efficient handling of complex events through strategies such as dual filtering. It includes the following steps:
[0057] (1) The central node receives complex event patterns given by the user, including information such as variable names, attribute constraints and time windows;
[0058] (2) The central node determines the variable processing plan (i.e., the processing order and filtering logic of each variable) based on the characteristics of the complex event pattern, and sends the variable processing plan to each sensor node;
[0059] (3) The sensor node reads the events corresponding to each variable from memory according to the independent constraints in the mode and generates pointer references for binding. Then, it selects the variable to be processed first and sends the timestamps of all its bound events to the central node.
[0060] (4) After receiving the timestamps from all sensor nodes, the central node constructs an initial set of feasible time intervals (i.e., a set of time intervals that may contain matching events) based on the received timestamps.
[0061] (5) If there are no unprocessed variables in the variable processing plan, jump to step (14); otherwise, start a new communication cycle and process the next unprocessed variable in the variable processing plan according to steps (6) to (13).
[0062] (6) The central node sends the set of current feasible time intervals to each sensor node;
[0063] (7) If there is no equivalence constraint between the variable being processed in the current exchange round and the variable being processed in the previous exchange round, jump directly to step (11); otherwise, proceed to step (8) to step (10).
[0064] (8) The sensor node constructs a window-aware Bloom filter for the corresponding attribute value and timestamp information of the event based on the events bound to the processed variables in the equivalent constraint conditions, and sends it to the central node;
[0065] (9) After receiving the window-aware Bloom filters from all sensor nodes, the central node performs a bit OR operation on these filters, merges them into a complete window-aware Bloom filter, and sends it back to each sensor node.
[0066] (10) The sensor node uses the complete window-aware Bloom filter to check whether the attribute value corresponding to the event to which the currently processed variable is bound is in the time window or adjacent window where the event is located. If not, the variable is removed from the reference binding to the event.
[0067] (11) After all the equivalence dependency constraints are processed, the sensor node checks whether the timestamp of the event to which the currently processed variable is bound falls within the current feasible time interval set. If not, the variable is removed from the reference binding to the event.
[0068] (12) The sensor node constructs a new set of feasible time intervals based on the events bound to the current processing variable, and takes the intersection with the current set of feasible time intervals, and sends the result back to the central node;
[0069] (13) After receiving the set of feasible time intervals from all edge nodes, the central processing unit takes the union of the sets and uses it as the updated set of current feasible time intervals;
[0070] (14) After all the variables to be processed in the variable processing plan are processed, the central node sends the final feasible time interval set to each sensor node. The sensor node selects the events whose timestamps fall in the set from the events bound to each variable and sends them back to the central node.
[0071] (15) After receiving the filtered events from all sensor nodes, the central node transmits them to the matching engine for matching and obtains the final query results.
[0072] In the process of determining the processing order of variables in the variable processing plan, in order to minimize the amount of events processed during subsequent filtering, a greedy strategy is used to first select the variable with the shortest time window covered by the generated feasible time interval as the first variable to be processed; secondly, the variable with the lowest selection rate is selected from the variables without equi-dependency constraints for processing; when all unselected variables have equi-dependency constraints, the variable with the earliest selection of the corresponding dependent variable is selected from the variables that only have equi-dependency constraints with the selected variables. If there are multiple such variables, the variable with the lowest selection rate is selected; when all unselected variables have equi-dependency constraints with other unselected variables, the variables with the lowest selection rates are selected in turn for processing.
[0073] The feasible time interval set of this invention is generated by the timestamps of the original events. Assume that the timestamp of a certain original event is... The time interval specified by the complex event pattern is Then the feasible time interval for the generation of this original event for:
[0074] ,
[0075] Here, the first variable refers to the variable being processed as the first variable in the variable processing plan, and the last variable refers to the variable being processed as the last variable in the variable processing plan.
[0076] This invention represents the set of feasible time intervals using an ordered array. The ordered array stores multiple time intervals that may contain matching results. Each time interval only records its start and end times, and ensures that all time intervals do not overlap to reduce storage overhead. When performing operations such as searching, inserting, and deleting, a binary search method is used to quickly locate the relevant time intervals for operation.
[0077] In constructing the window-aware Bloom filter, this invention uses multiple independent hash functions for all events bound to a variable. The hash value is calculated using the time window ID (obtained by dividing the event timestamp by the query window length and rounding down) as the hash function seed and the corresponding attribute value as the key, with the corresponding bit in the bit array set to 1. Compared to traditional Bloom filters (which concatenate the time window ID and attribute value as the key and use a fixed hash seed to store the attribute value and time window information), the window-aware Bloom filter avoids string concatenation operations and reduces the length of the insertion key, achieving efficient insertion and lookup operations. Compared to key-value pair mapping structures, the window-aware Bloom filter significantly reduces the size of the information that needs to be transmitted.
[0078] like Figure 2 The diagram illustrates the basic principles and filtering process of the dual-layer filtering strategy. This example provides a simple schematic of the filtering process using a dual-layer filtering strategy. In this example, assume a complex event pattern "PATTERN (A N1*? B N2*? C) WITHIN '30' MINUTE", where variables A, B, and C represent events of type A, B, and C respectively. Variables N1 and N2 can match any event, and there is an attribute value constraint between variables B and C: B.attr = C.attr. The symbol "*" is a quantifier, indicating zero or more matches. The symbol "?" is a matching pattern modifier, indicating that events should be matched as few times as possible. The set of events to be queried is given in Table 1.
[0079] Table 1 Examples of event sets in complex event patterns
[0080] Event Number Event type (type) Event attribute value (attr) Timestamp e1 C 2 1:20 e2 C 5 1:30 e3 C 7 4:30 e4 B 5 1:20 e5 B 8 3:15 e6 B 9 4:20 e7 A 2 1:15 e8 A 3 2:45 e9 A 7 4:15
[0081] Assuming variables are processed in the order of CBA, variable C is processed first. Since variable C is a tail variable of a complex event pattern, the feasible time intervals generated for e1, e2, and e3 are [0:50, 1:20], [1:00, 1:30], and [4:00, 4:30], respectively, resulting in an initial feasible time interval set of {[0:50, 1:30], [4:00, 4:30]}. Next, variable B is processed. Since e5 does not fall into the initial feasible time interval set, and the attr attribute value 9 of e6 is in the corresponding feasible time interval, no event bound to variable C can be found to match it. Therefore, the binding of variable B to e5 and e6 is removed. At this point, variable B is only bound to e4, whose timestamp is 1:20. According to the time interval generation formula mentioned above, the feasible time interval set generated for variable B is {[0:50, 1:20], [1:00, 1:30], and [4:00, 4:30]}. 1:50]}; Then, the time interval set generated by variable B intersects with the initial feasible time interval set to obtain the current feasible time interval set as {[0:50, 1:30]}; Finally, variable A is processed, and the current feasible time interval set is checked. It is found that e8 and e9 do not fall into the current feasible time interval set. Therefore, the binding of variable A to e8 and e9 is removed. Since variable A is the first variable of the complex event pattern, the feasible time interval set generated by variable A for e7 is {[1:15, 1:45]}, which intersects with the current feasible time interval set {[0:50, 1:30]} to obtain the final feasible time interval set as {[1:15, 1:30]}.
[0082] To illustrate this method more clearly, a real-world IoT smart application scenario is provided: In the detection of suspected burglary in a smart home, the system continuously monitors for multiple failed attempts to unlock a door within 30 minutes, and also monitors for instances where someone enters the room after a window is detected to be open. The specific complex event patterns monitored are given below (for simplicity, this example only considers the scenario where the door lock fails to unlock once):
[0083] SELECT * FROM Events MATCH_RECOGNIZE (
[0084] ORDER BY date
[0085] MEASURES LF.id AS LFID, O.id AS OID, D.id AS DID
[0086] ONE ROW PER MATCH
[0087] AFTER MATCH SKIP TO NEXT ROW
[0088] PATTERN (LF N1*? O N2*? D) WITHIN '30' MINUTE
[0089] DEFINE
[0090] LF AS LF.primary_type = 'LOGIN FAILURE',
[0091] O AS O.primary_type = 'OPENING',
[0092] D AS D.primary_type = 'DETECTED'
[0093] AND D.room = O.room );
[0095] The MATCH_RECOGNIZE clause of this complex event query specifies the matching content and format, the ORDER BY clause specifies the row sorting order of the pattern matching, the MEASURES clause specifies the content of the output results, ONE ROW PER MATCH specifies that the output format is to output one line for each matching pattern, AFTER MATCH SKIP TO NEXT ROW specifies the starting position of the next match after a successful match, the PATTERN clause specifies the regular expression form of the complex event pattern, WITHIN specifies the time window limit for the occurrence of the complex event pattern, and the DEFINE clause specifies the constraints of each variable in the complex event pattern. In this embodiment, variable LF refers to the original event of type "LOGIN FAILURE", indicating that the attempt to unlock the door lock failed; variable O refers to the original event of type "OPENING", indicating that the room window was opened; variable D refers to the original event of type "DETECTED", indicating that someone was detected entering the room; the room attribute values of variables O and D must be the same, indicating that the two corresponding original events occurred in the same room; variables LF, O, and D are separated by skippable variables N1 and N2, respectively, indicating that there may be several other unrelated events between the corresponding events; the time window is limited to 30 MINUTE, indicating that the time difference between the events matched by the first variable LF and the last variable D does not exceed 30 minutes.
[0096] In this embodiment, the specific steps of the complex event handling execution process are as follows: Figure 3 As shown:
[0097] First, the central node determines the variable processing plan (i.e., the processing order and filtering logic of each variable) based on the characteristics of the complex event pattern. N1 and N2 are jump variables, which can match any event and thus filter irrelevant events occurring between the variables on their left and right. For non-jump variables, their selection rate is first determined by a sampling algorithm. Assuming that variable O has the lowest selection rate, variable O will be selected as the first variable to be processed. Among the remaining variables, variable LF does not have an equi-dependency constraint and is selected as the second variable to be processed. Therefore, the final processing order of non-jump variables is determined as O-LF-D.
[0098] In the first round of communication, which is the first communication round, the current processing variable is O. The central node sends the variable processing plan to each sensor node. According to the received variable processing plan, the sensor node generates pointer references for the events corresponding to the independent constraints of the three variables O, LF, and D, and sends the timestamps of the events bound to variable O to the central node in the processing order (the events bound to the variable are not matched before the final feasible time interval set is determined).
[0099] In the second round of communication, which is the second communication round, the current processing variable is LF. The central node constructs an ordered array based on the received timestamps to store the initial feasible time interval set (i.e., the set of time intervals that may contain matching events) and sends it to each sensor node. The sensor node filters out events that do not fall into the feasible time interval set from the events bound to the variable LF, removes the binding of LF to these events, constructs a new feasible time interval set based on the events bound to LF, takes the intersection with the current feasible time interval set, and sends the result back to the central node.
[0100] In the third round of communication, which is the third communication round, the current processing variable is D. The central node takes the union of the feasible time interval sets sent by each sensor node as the new current feasible time interval set and sends it to each sensor node. Since the variable D processed in the current communication round has an equivalence dependency constraint on the room attribute with the variable O processed in the previous communication round (i.e., a dependency constraint that only involves two variables and their corresponding attributes and is compared with an equal sign, such as D.room = O.room in the given pattern), each sensor node constructs a window-aware Bloom filter based on the room attribute value and timestamp information of the event bound to variable O and sends it to the central node.
[0101] In the fourth round of communication, which is still the third round of communication, the current processing variable is D. The central node performs a bit OR operation on the window-aware Bloom filters sent by each sensor node, merges them to obtain a complete window-aware Bloom filter and sends it back to each sensor node. The sensor node checks whether the attribute value corresponding to the event bound to the current processing variable D is within the time window or adjacent window of the event, and whether the timestamp of the event falls within the current feasible time interval set. If any condition is not met, the binding of D to the event is removed, and a new feasible time interval set is constructed based on the event bound to D. The intersection of the new feasible time interval set with the current feasible time interval set is taken and the result is sent back to the central node.
[0102] In the fifth round of communication, all variables in the variable processing plan have been processed. The central node takes the union of the feasible time interval sets sent by each sensor node as the final feasible time interval set and sends it to each sensor node. Each sensor node filters the events whose timestamps fall within the final feasible time interval set from the events bound to variables O, LF, and D, and sends them back to the central node. Finally, the central node transmits the received events to the matching engine for matching and obtains the final query results.
[0103] Furthermore, the performance of the efficient complex event processing method for edge-oriented intelligent scenarios described in this invention was verified using two real datasets. Here, Thrift was used to build a node communication framework, and the complex event processing method described was implemented using JAVA (referred to as DFS). It was compared with the following three methods: (1) Single-round predicate pushdown, which pushes independent constraints from the central node to the sensor node to filter irrelevant original events before the sensor node transmits events to the central node (referred to as Pushdown); (2) Multi-round predicate pushdown, which determines the feasible time interval set through multi-round communication, and then pushes the independent constraints and feasible time interval set to the sensor node to filter events before the sensor node transmits events to the central node (referred to as Pushdown+); (3) Multi-round push-pull, which gradually pushes all event window constraints and predicate constraints to the sensor node through multi-round communication for filtering (referred to as Pushpull). The experimental results are as follows: (1) Figure 4The data transfer volume of the present invention and other methods was compared when performing 100 executions of various complex event patterns (containing only independent constraints, including independent constraints and equi-dependent constraints, including all types of constraints) on various datasets. Compared with the Pushdown method, the present invention reduced the data transfer volume by 85.32% and 87.9% on the Citibike and Cluster datasets, respectively; compared with the Pushdown+ method, the present invention reduced the data transfer volume by 82.9% and 53.4% on the Citibike and Cluster datasets, respectively; compared with the Pushpull method, the present invention reduced the data transfer volume by 0.3% and 50.0% on the Citibike and Cluster datasets, respectively; (2) Figure 5 The paper presents a comparison of query latency between the present invention and other methods when performing 100 executions of various complex event patterns on different datasets. Compared to the Pushdown method, the present invention reduces query latency by 3.4 times and 21.5 times on the Citibike and Cluster datasets, respectively; compared to the Pushdown+ method, the present invention reduces query latency by 3.5 times and 3.6 times on the Citibike and Cluster datasets, respectively; and compared to the Pushpull method, the present invention reduces query latency by 2.3 times and 3.1 times on the Citibike and Cluster datasets, respectively.
[0104] In summary, this efficient and complex event processing method for edge-intelligent scenarios can reduce communication overhead between sensor nodes and the central node, avoid the transmission of irrelevant original events, reduce overall query latency, and improve the processing speed of complex events.
[0105] Based on the specific implementation steps and verification results of the efficient complex event processing method for edge-intelligent scenarios described above, this invention also provides a complex event processing method for IoT edge-intelligent scenarios executed on sensor nodes, including the following steps:
[0106] The system receives the variable processing plan from the central node, generates reference bindings for the events corresponding to each variable according to the variable processing plan, and then sends the timestamp of the event bound to the first variable to be processed to the central node. The central node constructs an initial set of feasible time intervals based on the received timestamps and processes the remaining variables in sequence according to the variable processing plan.
[0107] In a communication round, the current feasible time interval set is received from the central node. If there is an equivalence dependency constraint between the variable processed in the current communication round and the variable processed in the previous communication round, a window-aware Bloom filter is constructed using the attribute values and timestamp information of the events bound to the processed variables and sent to the central node. The central node merges them into a complete window-aware Bloom filter. Then, based on the complete window-aware Bloom filter, the reference bindings of events whose corresponding attribute values are not under their current time window or adjacent window are removed from the events bound to the current processed variables.
[0108] If the current processing variable does not have any equivalence dependency constraints or the equivalence dependency constraints of the current processing variable have been processed, remove the event references bound to the current processing variable whose timestamps do not fall within the current feasible time interval set;
[0109] A new set of feasible time intervals is constructed based on the event list bound to the current processing variable. The intersection of this set with the current set of feasible time intervals is taken and sent back to the central node. The central node then merges these sets to obtain a new set of current feasible time intervals, thus completing one communication cycle.
[0110] After all variables to be processed are processed, the final feasible time interval set is received from the central node. Events whose timestamps fall within the final feasible time interval set are selected from the events bound to each variable and sent back to the central node. The central node then matches the obtained events to obtain the final query results.
[0111] The present invention also provides an electronic device, comprising: one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, wherein when the programs are executed by the processors, they implement the steps of the complex event processing method based on IoT-based intelligent scenarios executed on a sensor node as described above.
[0112] This invention also provides a method for handling complex events in IoT-enabled smart scenarios executed on a central node, the method comprising the following steps:
[0113] Based on the characteristics of complex event patterns, a variable processing plan is determined and sent to each sensor node, which then generates reference bindings for the events corresponding to each variable.
[0114] Receive the timestamp of the event bound to the first variable to be processed in the variable processing plan from the sensor node, construct an initial set of feasible time intervals, and process the remaining variables in sequence according to the variable processing plan;
[0115] In a single communication round, the current feasible time interval set is sent to each sensor node. The sensor nodes then update the feasible time interval set. Specifically, if a sensor node determines that there is an equivalence constraint between the variable being processed in the current communication round and the variable processed in previous communication rounds, and constructs a window-aware Bloom filter using the attribute values and timestamp information of the events bound to the processed variables, it receives the window-aware Bloom filter from the sensor nodes, merges it into a complete window-aware Bloom filter, and sends it back to each sensor node. Each sensor node then removes references to events whose corresponding attribute values are not within its current time window or adjacent window from the events bound to the currently processed variable based on the complete window-aware Bloom filter. Additionally, if the current processed variable does not have an equivalence constraint or its equivalence constraint has been processed, the sensor nodes remove event references bound to the current processed variable whose timestamps do not fall within the current feasible time interval set. A new feasible time interval set is then constructed based on the event list bound to the current processed variable, and its intersection with the current feasible time interval set yields the updated feasible time interval set.
[0116] Receive updated sets of feasible time intervals from each sensor node, merge them to obtain a new set of current feasible time intervals, and complete one round of communication.
[0117] After all variables to be processed are completed, the final set of feasible time intervals is sent to each sensor node. The sensor node then selects events whose timestamps fall within the final set of feasible time intervals from the events bound to each variable, and matches the events selected by the sensor node to obtain the final query results.
[0118] The present invention also provides an electronic device, comprising: one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, wherein when the programs are executed by the processors, they implement the steps of the complex event processing method based on IoT-based intelligent scenarios executed on a central node as described above.
[0119] This invention also provides a complex event processing system for intelligent scenarios in the Internet of Things (IoT) era, comprising:
[0120] A sensor node device is used for the generation, storage, and partial processing of data in edge intelligence scenarios. The partial processing is performed according to the complex event processing method for IoT edge intelligence scenarios described above, which is executed on the sensor node.
[0121] The central node device is used to communicate with each sensor node device and to perform complex event processing according to the complex event processing method for IoT-based intelligent scenarios executed on the central node as described above.
[0122] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method for handling complex events in an IoT-based intelligent scenario executed on a sensor node or the method for handling complex events in an IoT-based intelligent scenario executed on a central node, as described above.
[0123] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for handling complex events in an intelligent IoT scenario, characterized in that, Applied to sensor nodes, the method includes: The system receives the variable processing plan from the central node, generates reference bindings for the events corresponding to each variable according to the variable processing plan, and then sends the timestamp of the event bound to the first variable to be processed to the central node. The central node constructs an initial set of feasible time intervals based on the received timestamps and processes the remaining variables in sequence according to the variable processing plan. The variable processing plan includes the processing order and filtering logic of each variable. In a communication round, the current feasible time interval set is received from the central node. If there is an equivalence dependency constraint between the variable processed in the current communication round and the variable processed in the previous communication round, a window-aware Bloom filter is constructed using the attribute values and timestamp information of the events bound to the processed variables and sent to the central node. The central node merges these into a complete window-aware Bloom filter. Then, based on the complete window-aware Bloom filter, references to events whose corresponding attribute values are not in their current time window or adjacent window are removed from the events bound to the currently processed variables. The equivalence dependency constraint is a dependency constraint that only involves two variables and their corresponding attributes and is compared using an equal sign. When constructing the window-aware Bloom filter, multiple independent hash functions are used for all events bound to the variables. The hash value is calculated using the time window ID where the event timestamp is located as the hash function seed and the corresponding attribute value as the key, and the corresponding bit in the bit array is set to 1. The time window ID is obtained by dividing the event timestamp by the query window length and rounding down. If the current processing variable does not have any equivalence dependency constraints or the equivalence dependency constraints of the current processing variable have been processed, remove the event references bound to the current processing variable whose timestamps do not fall within the current feasible time interval set; A new set of feasible time intervals is constructed based on the event list bound to the current processing variable. The intersection of this set with the current set of feasible time intervals is taken and sent back to the central node. The central node then merges these sets to obtain a new set of current feasible time intervals, thus completing one communication cycle. After all variables to be processed are processed, the final feasible time interval set is received from the central node. Events whose timestamps fall within the final feasible time interval set are selected from the events bound to each variable and sent back to the central node. The central node then matches the obtained events to obtain the final query results.
2. An electronic device, characterized in that, include: One or more processors; Memory; And one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, wherein when the programs are executed by the processors, they implement the steps of the complex event processing method in the IoT smart scenario as described in claim 1.
3. A method for handling complex events in an intelligent IoT scenario, characterized in that, Applied to the central node, the method includes: Based on the characteristics of complex event patterns, a variable processing plan is determined and sent to each sensor node. The sensor nodes then generate reference bindings for the events corresponding to each variable. The variable processing plan includes the processing order and filtering logic for each variable. Receive the timestamp of the event bound to the first variable to be processed in the variable processing plan from the sensor node, construct an initial set of feasible time intervals, and process the remaining variables in sequence according to the variable processing plan; In a single communication round, the current set of feasible time intervals is sent to each sensor node. The sensor nodes then update the set of feasible time intervals. Specifically, if a sensor node determines that there is an equivalence constraint between the variable being processed in the current communication round and variables processed in previous communication rounds, and constructs a window-aware Bloom filter using the attribute values and timestamp information of the events bound to the processed variables, it receives the window-aware Bloom filter from the sensor nodes, merges it into a complete window-aware Bloom filter, and sends it back to each sensor node. Each sensor node then removes references to events whose corresponding attribute values are not within its current time window or adjacent windows from the events bound to the currently processed variable based on the complete window-aware Bloom filter. Additionally, if the current processed variable does not have an equivalence constraint, or if the current processed variable... After the equivalence dependency constraint is processed, the event references bound to the current processing variable whose timestamps do not fall within the current feasible time interval set are removed. A new feasible time interval set is constructed based on the event list bound to the current processing variable, and the intersection of this set with the current feasible time interval set is used to obtain the updated feasible time interval set. The equivalence dependency constraint is a dependency constraint that only involves two variables and their corresponding attributes and is compared using an equality sign. When constructing the window-aware Bloom filter, multiple independent hash functions are used for all events bound to the variable. The hash value is calculated using the time window ID where the event timestamp is located as the hash function seed and the corresponding attribute value as the key. The corresponding bit in the bit array is set to 1. The time window ID is obtained by dividing the event timestamp by the query window length and rounding the result. Receive updated sets of feasible time intervals from each sensor node, merge them to obtain a new set of current feasible time intervals, and complete one round of communication. After all variables to be processed are completed, the final set of feasible time intervals is sent to each sensor node. The sensor node then selects events whose timestamps fall within the final set of feasible time intervals from the events bound to each variable, and matches the events selected by the sensor node to obtain the final query results.
4. The method according to claim 3, characterized in that, In determining the processing order of variables in the variable processing plan, a greedy strategy is used to first select the variable with the shortest time window covered by the generated feasible time interval as the first variable to be processed; secondly, the variable with the lowest selection rate is selected from the variables without equi-dependency constraints; when all unselected variables have equi-dependency constraints, the variable with the earliest selection of the corresponding dependent variable is selected from the variables that only have equi-dependency constraints with the selected variables. If there are multiple such variables, the variable with the lowest selection rate is selected; when all unselected variables have equi-dependency constraints with other unselected variables, the variables with the lowest selection rates are selected in sequence for processing.
5. The method according to claim 3, characterized in that, The set of feasible time intervals is generated from the timestamps of the original events. Let's assume the timestamp of a certain original event is... The time interval specified by the complex event pattern is Then the feasible time interval for the generation of this original event for: , The first variable refers to the first variable in the complex event pattern being processed, while the last variable refers to the last variable in the complex event pattern being processed.
6. The method according to claim 3, characterized in that, The set of feasible time intervals is represented by an ordered array. The ordered array stores multiple time intervals that may contain matching results. Each time interval only records its start and end times, and all time intervals do not overlap. When performing search, insertion, and deletion operations, a binary search method is used to quickly locate the relevant time intervals for operation.
7. An electronic device, characterized in that, include: One or more processors; Memory; And one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, wherein when the programs are executed by the processors, they implement the steps of the complex event processing method in the IoT smart scenario as described in any one of claims 3-6.
8. A method for handling complex events in an intelligent IoT scenario, characterized in that, Includes the following steps: (1) The central node receives complex event patterns given by the user, including variable names, attribute constraints and time window information; (2) The central node determines the variable processing plan based on the characteristics of the complex event pattern and sends the variable processing plan to each sensor node. The variable processing plan includes the processing order and filtering logic of each variable. (3) The sensor node reads the events corresponding to each variable from memory according to the independent constraints in the complex event pattern and generates pointer references for binding. Then, it selects the variable to be processed first and sends the timestamps of all its bound events to the central node. (4) After receiving the timestamps from all sensor nodes, the central node constructs an initial feasible time interval set based on the received timestamps. The initial feasible time interval set is a set of time intervals that may contain matching events. (5) If there are no unprocessed variables in the variable processing plan, jump to step (14); otherwise, start a new communication cycle and process the next unprocessed variable in the variable processing plan according to steps (6) to (13). (6) The central node sends the set of current feasible time intervals to each sensor node; (7) If there is no equivalence dependency constraint between the variable processed by the current exchange wheel and the variable processed by the previous exchange wheel, directly jump to step (11); otherwise, process according to steps (8) to (10); the equivalence dependency constraint is a dependency constraint that only involves two variables and their corresponding attributes and is compared with an equal sign. (8) The sensor node constructs a window-aware Bloom filter for the corresponding attribute value and timestamp information of the event based on the events bound to the processed variables in the equivalence dependency constraint, and sends it to the central node; When constructing a window-aware Bloom filter, multiple independent hash functions are used for all events bound to the variable. The hash value is calculated using the time window ID where the event timestamp is located as the hash function seed and the corresponding attribute value as the key. The corresponding bit in the bit array is set to 1. The time window ID is obtained by dividing the event timestamp by the query window length and taking the integer part of the result. (9) After receiving the window-aware Bloom filters from all sensor nodes, the central node performs a bit OR operation on these filters, merges them into a complete window-aware Bloom filter, and sends it back to each sensor node. (10) The sensor node uses the complete window-aware Bloom filter to check whether the attribute value corresponding to the event to which the currently processed variable is bound is in the time window or adjacent window where the event is located. If not, the variable is removed from the reference binding to the event. (11) After all the equivalence dependency constraints are processed, the sensor node checks whether the timestamp of the event to which the currently processed variable is bound falls within the current feasible time interval set. If not, the variable is removed from the reference binding to the event. (12) The sensor node constructs a new set of feasible time intervals based on the events bound to the current processing variable, and takes the intersection with the current set of feasible time intervals, and sends the result back to the central node; (13) After receiving the set of feasible time intervals from all sensor nodes, the central node takes the union of the sets and uses it as the updated set of current feasible time intervals; (14) After all the variables to be processed in the variable processing plan are processed, the central node sends the final feasible time interval set to each sensor node. The sensor node selects the events whose timestamps fall in the final feasible time interval set from the events bound to each variable and sends them back to the central node. (15) After receiving the filtered events from all sensor nodes, the central node transmits them to the matching engine for matching and obtains the final query results.
9. A complex event processing system for intelligent scenarios in the Internet of Things (IoT) era, characterized in that, include: A sensor node device is used for the generation, storage, and partial processing of data in an edge intelligent scenario, wherein the partial processing is performed by the complex event processing method in the IoT edge intelligent scenario according to claim 1. A central node device is used to communicate with each sensor node device and to implement complex event processing according to any one of claims 3-6 in the IoT-based intelligent scenario complex event processing method.
Citation Information
Patent Citations
Complex event processing system and method based on edge computing for Internet of Things
CN112653749A
Complex event matching method and device based on ordered event list and storage medium
CN114610978A