WO2021057387A1 - 一种事件处理方法、装置、终端及计算机可读存储介质 - Google Patents
一种事件处理方法、装置、终端及计算机可读存储介质 Download PDFInfo
- Publication number
- WO2021057387A1 WO2021057387A1 PCT/CN2020/112251 CN2020112251W WO2021057387A1 WO 2021057387 A1 WO2021057387 A1 WO 2021057387A1 CN 2020112251 W CN2020112251 W CN 2020112251W WO 2021057387 A1 WO2021057387 A1 WO 2021057387A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data
- rule
- event processing
- reported
- memory
- Prior art date
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 39
- 230000000875 corresponding effect Effects 0.000 claims description 68
- 238000012545 processing Methods 0.000 claims description 68
- 238000013507 mapping Methods 0.000 claims description 26
- 238000004364 calculation method Methods 0.000 claims description 21
- 230000009471 action Effects 0.000 claims description 17
- 238000000034 method Methods 0.000 claims description 17
- 238000004590 computer program Methods 0.000 claims description 16
- 238000004891 communication Methods 0.000 claims description 10
- 238000006243 chemical reaction Methods 0.000 claims description 2
- 238000005516 engineering process Methods 0.000 description 13
- 230000002776 aggregation Effects 0.000 description 6
- 238000004220 aggregation Methods 0.000 description 6
- 238000004458 analytical method Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 6
- 230000001960 triggered effect Effects 0.000 description 6
- 230000001276 controlling effect Effects 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 206010039203 Road traffic accident Diseases 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 3
- QVFWZNCVPCJQOP-UHFFFAOYSA-N chloralodol Chemical compound CC(O)(C)CC(C)OC(O)C(Cl)(Cl)Cl QVFWZNCVPCJQOP-UHFFFAOYSA-N 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 230000007246 mechanism Effects 0.000 description 3
- 230000006855 networking Effects 0.000 description 3
- 230000032683 aging Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000002372 labelling Methods 0.000 description 2
- 238000005192 partition Methods 0.000 description 2
- 230000002265 prevention Effects 0.000 description 2
- 206010063659 Aversion Diseases 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/466—Transaction processing
- G06F9/467—Transactional memory
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/12—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
Definitions
- the embodiments of the present application relate to but not limited to the fields of Internet of Things and edge computing, and specifically relate to but not limited to an event processing method, device, terminal, and computer-readable storage medium.
- the Internet of Things is the Internet of Things, it is the extension of the Internet and the future development direction.
- the hot Internet can be understood as the close connection of humans, and the Internet of Things connects humans and various things (ie devices).
- the number of connections is at least an order of magnitude higher, and secondly, things are also connected.
- the network the linkage of people and things, and things and things, will produce many valuable application scenarios.
- an “event” refers to the occurrence of something.
- an “event” refers to an object that points to computer processing, which marks or records an event that has occurred.
- an event is the object of a certain activity record in the system.
- An event marks an activity, and an event may be related to other events.
- CEP Complex Event Processing
- CEP Complex Event Processing
- Edge computing technology as another key technology of the Internet of Things, is also a hot spot of current research.
- cloud computing emerged, there was a view that the terminal only needs a display screen, and all the data of the Internet of Things is transmitted to the cloud center, and the cloud center completes the calculation process, and then transmits it back to the user's terminal. Therefore, thin terminals will be the future trend.
- edge computing refers to an open platform that integrates core capabilities of network, computing, storage, and applications on the edge of the network close to the source of things or data, and provides edge intelligent services nearby.
- An event processing method, device, terminal, and computer-readable storage medium provided by the embodiments of the present application.
- An embodiment of the application provides an event processing method, including: obtaining reported data of a device; obtaining a rule corresponding to the device; splitting the reported data according to the rule; storing the reported data in a corresponding memory Data set; obtain target data from the memory data set, the target data includes at least the reported data, the target data is the data required to match the rule; the target data is calculated and the rule is matched .
- An embodiment of the present application also provides an event processing device, including: a first acquisition module for acquiring reported data of a device; a second acquisition module for acquiring a rule corresponding to the device; and a shunting module for acquiring The rules divide the reported data; the memory data set is used to store the corresponding reported data; the third acquisition module is used to obtain target data from the memory data set, and the target data includes at least the reported data , The target data is data required to match the rule; a calculation matching module is used to calculate the target data and match the rule.
- An embodiment of the present application also provides an event processing terminal, including: a processor, a memory, and a communication bus; the communication bus is used to realize the connection and communication between the processor and the memory; the processor is used to execute data stored in the memory
- One or more computer programs to implement the steps of the event processing method as described in any one of the above.
- the embodiments of the present application also provide a computer-readable storage medium, the computer-readable storage medium stores one or more computer programs, and the one or more computer programs can be executed by one or more processors to realize The steps of the event processing method as described in any one of the above.
- FIG. 1 is a schematic flowchart of an event processing method provided in Embodiment 1 of this application;
- FIG. 2 is a schematic flowchart of a specific embodiment of an event processing method provided in Embodiment 1 of this application;
- FIG. 3 is a structural diagram of an event processing device provided in Embodiment 2 of this application.
- FIG. 4 is a networking diagram of the event processing device IoT cloud and edge nodes provided by the second embodiment of the application;
- FIG. 5 is a schematic diagram of the second embodiment of the application when the event processing device is an edge node
- FIG. 6 is a schematic structural diagram of an event processing terminal provided in Embodiment 3 of this application.
- an event processing method provided by an embodiment of the present application includes:
- the event processing method is applied to the Internet of Things, in which the reported data of the device can be obtained by directly sending the report data acquisition instruction to the device, and the reported data of the obtained device can also be directly received by the device.
- the reported data of the device it can also be converted into the reported data of the device based on the user's instruction.
- the device before obtaining the reported data of the device, it further includes: establishing a mapping relationship between the device and the rule and the mapping relationship between the rule and the memory data set, where the mapping relationship between the rule and the memory data set is one One mapping.
- the mapping relationship between devices and rules can be that one device maps one rule, one device maps multiple rules, or multiple devices map one rule. In the embodiment of this application, it is not Make a limit.
- the mapping relationship between the device and the rule can be matched with the rule through the identification information of the device, so as to subsequently match the corresponding rule by identifying the identification information of the device.
- the identification information of the device may be the serial number of the device.
- the labeling method of the identification information of the device can be set according to industry rules or set by the user. However, it should be noted that in an event processing process, the device identification information of each device is different.
- the aforementioned rules are configured on the cloud platform side.
- obtaining the rule corresponding to the device may be to match the corresponding rule through the device identification information included in the reported data.
- the device identification information may be the device serial number, such as the IMEI code of the mobile phone.
- the reported data of the device is split by a corresponding amount.
- device A corresponds to the three rules of A, B, and C
- the three rules of A, B, and C correspond to the three memory data sets of D, E, and F respectively.
- the reported data F of device A will be based on A, B
- the three rules of 3 and C are divided into three times, and the divided flows are F1, F2, and F3 with the same reported data. What needs to be explained is that F1, F2, F3 and F are consistent. Save F1, F2, and F3 in the three memory data sets of D, E, and F respectively.
- the memory data set uses rules as the granularity, and a logical partition is established in the memory for each rule to become a memory data set.
- the target data includes at least the reported data, and the target data is the data required by the matching rule.
- the historical reported data is also stored in the memory data set; at this time, the target data includes the reported data and the target historical reported data.
- the historical report data is the report data acquired before the time point when the current report data is acquired and/or the report data acquired at the same time point when the current report data is acquired.
- the data source of the historically reported data can be the same device as the current device that reports the data, or it can be from other devices that are different from the device that reports the data, but there is at least one common rule in the rules corresponding to the other devices and the current device. rule.
- the reported data A of device A is obtained, the reported data B and C of device C, and the reported data E of device D are obtained at time T0.
- Time T0 is before time T1, and the corresponding data of device A, C, and D are obtained.
- calculating the target data and matching the rule includes: a sliding window calculating the target data and matching the rule.
- the sliding window calculates the target data and matches the rules, it also includes:
- the historically reported data is released. It can be understood that when the next report data is acquired or received, the sliding window of the calculation will shift by one grid.
- the current rule is to calculate the average value of the data reported by the temperature sensor for the most recent 20 times.
- the historical data reported in the memory data set may be 20 times, plus the current reported data, resulting in a total of 21 reported data.
- the sliding window only needs 20 reported data including the current reported data, and the earliest 21st historical reported data is beyond the historical reported data included in the sliding window.
- the 21st reported data The historically reported data will be released from the memory data set.
- the current rule is to calculate the number of input words in the last 20 minutes, and the current time is 15:20.
- the data memory set corresponding to the rule actually includes slaves.
- a total of 21 minutes of input word data from 14:59 to 15:20. Since the rule requires calculating the number of input words in the last 20 minutes, it is obvious that the historical data reported at 14:59 is not within the calculation range of the sliding window. At this time, the historical data reported before 15:00 can be released.
- timing of historical data release can be after the sliding window calculates the target data and matches the rules, or it can release the oldest data directly according to the memory capacity while saving the uploaded data.
- This method is similar to the principle that the memory card in the driving recorder saves the image data by covering the earliest data in real time.
- the method before splitting the reported data according to the rules, the method further includes:
- the reported data is split according to the rules.
- the format of the reported data can be understood as the language type of the reported data, and can also be understood as the transmission protocol type of the reported data, and those skilled in the art can set it according to their needs.
- the current device A and device B both have a mapping relationship with Rule A.
- the protocol type of the reported data D is converted to the MQTT protocol, and then the above-mentioned reported data is split according to the rules.
- the above event processing method is applied to at least one of the following: IoT cloud, edge node.
- the above rule may be configured in the IoT cloud and then issued to the edge node related to the rule for calculation.
- the Internet of Vehicles scene requires vehicles to respond to the data of various sensors in a very short time. If the data is sent to the cloud for analysis and processing and then returned, it may cause serious traffic accidents.
- Car companies can configure IoT rules in the IoT cloud. For example, when a distance sensor detects a certain distance from an obstacle, it can trigger an active braking system and send it to the processing system in the vehicle.
- an edge node it is responsible for receiving sensor data and processing Rules, triggering rule actions without sending data directly to the cloud for processing.
- the user wants to know the average speed of the vehicle in the past half hour. If the average speed is higher than 120Km/h, the driver will be reminded through the on-board broadcast. He can set the above rules in the IoT cloud and send it to the edge node. The reported data of the obtained vehicle will be calculated in real time and matched to the rule, that is, the rule is executed at the edge node. When the average speed of the vehicle in the past half an hour is higher than 120Km/h at a certain moment, the driver will be broadcast to the driver through the vehicle Make a reminder.
- the target data and matching the rule after calculating the target data and matching the rule, it further includes: if the matching rule is successful, execute a corresponding action.
- the action includes at least one of the following: informing the user, reporting to the IoT cloud, and controlling the corresponding The device executes the corresponding action.
- the corresponding device in controlling the corresponding device to perform the corresponding action can be the same device as the device that obtains the reported data, or it can be many including the device that obtains the reported data.
- the device may also be one or more devices that are not related to the device that reports the data. It is not limited in the embodiments of this application.
- the computer room manager is very concerned about the temperature of the computer room. He hopes that the temperature sensor in the computer room can notify him when the average temperature reported by the temperature sensor in the computer room exceeds 40 degrees in the last 20 times. Then he can establish such a rule that when the average temperature of the last 20 times is greater than 40, the action is triggered to send him a text message notification.
- the edge node After receiving this rule, the edge node establishes a memory data set in the memory for the rule, and is responsible for the execution of the rule. Each time it receives the reported temperature, it is saved in the corresponding memory data set after shunting, and in the memory in real time. The data set is calculated in a sliding window to determine whether the average value meets the conditions, and if it meets the conditions, the action is triggered and a message is sent to the administrator.
- S201 Establish a mapping relationship between a device and a rule and a mapping relationship between a rule and a memory data set;
- the sliding window calculates the target data and matches the rule
- the target data includes at least the reported data, and the target data is the data required by the matching rule.
- the actions include but are not limited to notifying the user, reporting to the IoT cloud, and controlling the corresponding device to perform the corresponding action.
- the event processing method provided by the embodiments of the present application obtains the reported data of the device and the rules corresponding to the device, splits the reported data according to the rules and saves it in the corresponding memory data set, and obtains target data from the memory data set.
- the target data includes at least Report data.
- the target data is the data required to match the rules.
- the target data is calculated and the rules are matched. It solves the technical problem that there is no effective solution to the complex event rules, especially the aggregation type rules in the current related technologies, and the technical problem of low user experience, and the problem of providing a complex event rule, especially the aggregation type rule. Effective solutions to improve the technical effects of user experience.
- the edge nodes support complex event rules, especially aggregation rules, which can greatly improve the ability of the rule engine on the edge nodes.
- the cloud IoT platform does not need to perform a large number of complex event processing, which reduces Pressure.
- the processing is closer to the source of the data generation, the calculation is faster, and the speed of outputting the result is relatively faster.
- the use of memory-based sliding window calculations like the use of large data components such as Spark/Flink (big data flow computing engine) in the existing related technologies, requires a large amount of CPU and memory.
- the event processing method provided by the embodiments of the present application occupies less memory, and is therefore suitable for use in scenarios where resources are limited, such as edge nodes.
- the event processing method When the event processing method is used in the cloud of the Internet of Things, since this event processing method requires a large amount of CPU and memory as compared with the existing related technologies that use big data components such as Spark/Flink, the event processing provided by the embodiment of the application The method's memory footprint is relatively small, saving resources. Furthermore, in the embodiment of the present application, since the historical report data stored in the memory data set beyond the sliding window is released, the occupied memory is further reduced.
- the event processing device 300 includes:
- the first obtaining module 201 is used to obtain reported data of the device
- the second obtaining module 202 is used to obtain the rules corresponding to the device
- the shunt module 203 is configured to shunt the reported data according to the rules
- the memory data set 204 is used to store the corresponding reported data
- the third acquisition module 205 is configured to acquire target data from a memory data set, the target data includes at least reported data, and the target data is data required for matching rules;
- the calculation matching module 206 is used to calculate the target data and match the rules.
- the event processing method is applied to the Internet of Things, in which the reported data of the device can be obtained by directly sending the report data acquisition instruction to the device, and the reported data of the obtained device can also be directly received by the device.
- the reported data of the device it can also be converted into the reported data of the device based on the user's instruction.
- the event processing apparatus further includes a configuration module, which is used to establish the mapping relationship between the device and the rule and the mapping relationship between the rule and the memory data set before obtaining the reported data of the device.
- the mapping relationship between the data sets is a one-to-one mapping.
- the mapping relationship between devices and rules can be that one device maps one rule, one device maps multiple rules, or multiple devices map one rule. In the embodiment of this application, it is not Make a limit.
- the mapping relationship between the device and the rule can be matched with the rule through the identification information of the device, so as to subsequently match the corresponding rule by identifying the identification information of the device.
- the identification information of the device may be the serial number of the device.
- the labeling method of the identification information of the device can be set according to industry rules or set by the user. However, it should be noted that in an event processing process, the device identification information of each device is different.
- the aforementioned rules are configured on the cloud platform side.
- obtaining the rule corresponding to the device may be to match the corresponding rule through the device identification information included in the reported data.
- the device identification information may be the device serial number, such as the IMEI code (International Mobile Equipment Identity) of the mobile phone.
- the reported data of the device is split by a corresponding amount.
- device A corresponds to the three rules of A, B, and C
- the three rules of A, B, and C correspond to the three memory data sets of D, E, and F respectively.
- the reported data F of device A will be based on A, B
- the three rules of 3 and C are divided into three times, and the divided flows are F1, F2, and F3 with the same reported data. What needs to be explained is that F1, F2, F3 and F are consistent. Save F1, F2, and F3 in the three memory data sets of D, E, and F respectively.
- the memory data set uses rules as the granularity, and a logical partition is established in the memory for each rule to become a memory data set.
- the target data includes at least the reported data, and the target data is the data required by the matching rule.
- the historical reported data is also stored in the memory data set; at this time, the target data includes the reported data and the target historical reported data.
- the historical report data is the report data acquired before the time point when the current report data is acquired and/or the report data acquired at the same time point when the current report data is acquired.
- the data source of the historically reported data can be the same device as the current device that reports the data, or it can be from other devices that are different from the device that reports the data, but there is at least one common rule in the rules corresponding to the other devices and the current device. rule.
- the reported data A of device A is obtained, the reported data B and C of device C, and the reported data E of device D are obtained at time T0.
- Time T0 is before time T1, and the corresponding data of device A, C, and D are obtained.
- the calculation matching module includes a sliding window.
- the event processing device further includes a release module for calculating the target data in a sliding window and matching the rules, and then checking the data stored in the memory data set. Release the historically reported data beyond the sliding window. It can be understood that when the next report data is acquired or received, the sliding window of the calculation will shift by one grid.
- the current rule is to calculate the average value of the data reported by the temperature sensor for the most recent 20 times. At this time, the historical data reported in the memory data set may be 20 times, plus the current reported data, resulting in a total of 21 reported data.
- the sliding window only needs 20 reported data including the current reported data, and the earliest 21st historical reported data is beyond the historical reported data included in the sliding window. At this time, the 21st reported data
- the historically reported data will be released from the memory data set.
- the current rule is to calculate the number of input words in the last 20 minutes, and the current time is 15:20. When the number of input words at 15:20 is obtained as the reported data, the data memory set corresponding to the rule actually includes slaves. A total of 21 minutes of input word data from 14:59 to 15:20. Since the rule requires calculating the number of input words in the last 20 minutes, it is obvious that the historical data reported at 14:59 is not within the calculation range of the sliding window. At this time, the historical data reported before 15:00 can be released.
- timing of historical data release can be after the sliding window calculates the target data and matches the rules, or it can release the oldest data directly according to the memory capacity while saving the uploaded data.
- This method is similar to the principle that the memory card in the driving recorder saves the image data and overwrites the earliest data in real time.
- the event processing apparatus further includes a configuration module, which is used to convert the format of the reported data to the preset format if the format of the reported data is inconsistent with the preset format before splitting the reported data according to the rules , According to the rules, the reported data will be distributed.
- a configuration module which is used to convert the format of the reported data to the preset format if the format of the reported data is inconsistent with the preset format before splitting the reported data according to the rules , According to the rules, the reported data will be distributed.
- the format of the reported data can be understood as the language type of the reported data, and can also be understood as the transmission protocol type of the reported data, and those skilled in the art can set it according to their needs.
- the current device A and device B both have a mapping relationship with Rule A.
- the protocol type of the reported data D is converted to the MQTT protocol, and then the above-mentioned reported data is split according to the rules.
- the above-mentioned event processing device further includes at least one of the following: IoT cloud, edge node.
- the above rule may be configured in the IoT cloud and then issued to the edge node related to the rule for calculation.
- the Internet of Vehicles scene requires vehicles to respond to the data of various sensors in a very short time. If the data is sent to the cloud for analysis and processing and then returned, it may cause serious traffic accidents.
- Car companies can configure IoT rules in the IoT cloud. For example, when a distance sensor detects a certain distance from an obstacle, it can trigger an active braking system and send it to the processing system in the vehicle.
- an edge node it is responsible for receiving sensor data and processing Rules, triggering rule actions without sending data directly to the cloud for processing.
- the user wants to know the average speed of the vehicle in the past half hour. If the average speed is higher than 120Km/h, the driver will be reminded through the on-board broadcast. He can set the above rules in the IoT cloud and send it to the edge node. The reported data of the obtained vehicle will be calculated in real time and matched to the rule, that is, the rule is executed at the edge node. When the average speed of the vehicle in the past half an hour is higher than 120Km/h at a certain moment, the driver will be broadcast to the driver through the vehicle Make a reminder.
- the event processing device further includes an action processing module, which is used to calculate the target data and match the rule, and if the matching rule is successful, execute a corresponding action.
- the action includes at least one of the following: informing the user, Report to the IoT cloud and control the corresponding device to perform corresponding actions.
- the corresponding device in controlling the corresponding device to perform the corresponding action can be the same device as the device that obtains the reported data, or it can be many including the device that obtains the reported data.
- the device may also be one or more devices that are not related to the device that reports the data. It is not limited in the embodiments of this application.
- the computer room manager is very concerned about the temperature of the computer room. He hopes that the temperature sensor in the computer room can notify him when the average temperature reported by the temperature sensor in the computer room exceeds 40 degrees in the last 20 times. Then he can establish such a rule that when the average temperature of the last 20 times is greater than 40, the action is triggered to send him a text message notification.
- the edge node After receiving this rule, the edge node establishes a memory data set in the memory for the rule, and is responsible for the execution of the rule. Each time it receives the reported temperature, it is saved in the corresponding memory data set after shunting, and in the memory in real time. The data set is calculated in a sliding window to determine whether the average value meets the conditions. If it meets the conditions, the action processing module is responsible for triggering the action and sending a short message to the administrator.
- the following describes the event processing device of the embodiment of the present application in a scenario where the above event processing device includes an edge node.
- Figure 4 is a networking diagram of the IoT cloud and edge nodes. It can be seen from Figure 4 that the rules are configured in the cloud.
- the configuration module 401 includes: a rule configuration module 4011, which is used to establish the mapping relationship between the device and the rule and the mapping relationship between the rule and the memory data set; the rule management module 4012, which is used to manage the above rules; the rule issuing module 4013, It is used to deliver the above rules to edge nodes related to the rules for calculation.
- the networking of FIG. 4 includes two edge nodes. It should be noted that the number of edge nodes is not limited in the embodiment of the present application.
- the acquisition module 4015 including the second acquisition module first receives the rules, then parses and preprocesses the rules, and loads the rules into the memory data set.
- the acquisition module 4015 including the first acquisition module will distribute the reported data to the memory data set corresponding to the rule by the shunt module 4016 after receiving the reported data from the device.
- the calculation matching module 4017 is responsible for calculation and rule matching. If the matching is successful, the action processing module 4018 is responsible for subsequent processing. The same is true for edge node B.
- the acquisition module 4019 including the second acquisition module first receives the rules, then parses and preprocesses the rules, and loads the rules into the memory data set.
- the acquisition module 4019 which includes the first acquisition module, receives the reported data from the device, and the shunt module 4020 distributes the reported data to the memory data set corresponding to the rule.
- the calculation matching module 4021 is responsible for calculation and rule matching. If the matching is successful, the action processing module 4022 is responsible for subsequent processing.
- Figure 5 is a schematic diagram when the event processing device is an edge node in an embodiment of the application.
- Device A uses MQTT (Message Queuing Telemetry Transport) to report data and device B uses LORA (Long Range Radio, long distance) to report data.
- MQTT Message Queuing Telemetry Transport
- LORA Long Range Radio, long distance
- the protocol conversion module 505 After the reported data of the radio) is converted into a preset format by the protocol conversion module 505, the shunt module 504 first distributes the reported data to the memory data sets corresponding to the rules corresponding to device A and device B.
- the sliding window 502 is stored based on the memory data.
- the historical reported data 503 and the reported data in the past period of time are calculated to determine whether the rule is matched, and if the matching is successful, the rule action is triggered. It should be noted that there may be only one device or multiple devices in FIG.
- each rule corresponds to a memory data set.
- the sliding window processes the target data
- the target data includes the historical reported data
- the sliding window processing includes the reported data and the target reported data, which is a part of the data in the memory data set as shown in Figure 5.
- the window does not include or has no corresponding data, which can be released in time to reduce memory usage.
- An event processing apparatus includes a first acquisition module for acquiring reported data of a device; a second acquisition module for acquiring rules corresponding to the device; and a shunting module for reporting data according to the rules Distribute; the memory data set is used to save the corresponding reported data; the third acquisition module is used to obtain the target data from the memory data set, the target data includes at least the reported data, and the target data is the data required by the matching rule; the calculation matching module , Used to calculate the target data and match the rules.
- the edge nodes support complex event rules, especially aggregation rules, which can greatly improve the ability of the rule engine on the edge nodes.
- the cloud IoT platform does not require a large amount of complex event processing. Reduced the pressure.
- the processing is closer to the source of the data generation, the calculation is faster, and the speed of outputting the result is relatively faster.
- the use of memory-based sliding window calculations like the use of large data components such as Spark/Flink in existing related technologies, requires a large amount of CPU and memory.
- the event processing apparatus provided in the embodiments of the present application occupies less memory, and is therefore suitable for use in scenarios where resources are limited, such as edge nodes.
- the processing method of the event processing device requires a large amount of CPU and memory as compared with the existing related technology using Spark/Flink and other big data components.
- the memory occupancy of the event processing device is relatively small, saving resources. Further, in the embodiment of the present application, due to the existence of the release module, a reasonable resource release will be performed according to certain requirements to further reduce the occupied memory.
- An embodiment of the present application also provides an event processing terminal. As shown in FIG. 6, it includes a processor 601, a memory 603, and a communication bus 602, where:
- the communication bus 602 is used to implement connection and communication between the processor 601 and the memory 603;
- the processor 601 is configured to execute one or more computer programs stored in the memory 603 to implement at least one step in the event processing method in the foregoing embodiments.
- the embodiments of the present application also provide a computer-readable storage medium, which is included in any method or technology for storing information (such as computer-readable instructions, data structures, computer program modules, or other data) Implementation of volatile or non-volatile, removable or non-removable media.
- Computer readable storage media include but are not limited to RAM (Random Access Memory), ROM (Read-Only Memory, read-only memory), EEPROM (Electrically Erasable Programmable read only memory, charged Erasable Programmable Read-Only Memory) ), flash memory or other memory technology, CD-ROM (Compact Disc Read-Only Memory), digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, Or any other medium that can be used to store desired information and that can be accessed by a computer.
- the computer-readable storage medium in the embodiments of the present application may be used to store one or more computer programs, and the stored one or more computer programs may be executed by a processor to implement at least one of the event processing methods in the above embodiments step.
- the embodiments of the present application also provide a computer program (or computer software).
- the computer program can be distributed on a computer-readable medium and executed by a computable device to realize at least the event processing methods in the foregoing embodiments.
- One step; and in some cases, at least one step shown or described can be performed in an order different from that described in the foregoing embodiment.
- the embodiment of the present application also provides a computer program product, including a computer-readable device, and the computer-readable device stores the computer program as shown above.
- the computer-readable device in the embodiment of the present application may include the computer-readable storage medium as shown above.
- An event processing method, device, terminal, and computer-readable storage medium are provided in the embodiments of the present application.
- the event processing method obtains the reported data of the device and the rules corresponding to the device, and divides the reported data according to the rules and saves it in the corresponding
- the target data is obtained from the memory data set.
- the target data includes at least the reported data.
- the target data is the data required by the matching rule.
- the target data is calculated and the rule is matched.
- An effective solution to the problem of complex event rules, especially aggregation-type rules, is provided. The method is simpler, consumes less time, and improves user experience.
- the functional modules/units in the system, and the device can be implemented as software (which can be implemented by computer program code executable by a computing device. ), firmware, hardware and their appropriate combination.
- the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may consist of several physical components. The components are executed cooperatively.
- Some physical components or all physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit .
- communication media usually contain computer-readable instructions, data structures, computer program modules, or other data in a modulated data signal such as carrier waves or other transmission mechanisms, and may include any information delivery medium. Therefore, this application is not limited to any specific combination of hardware and software.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
Description
Claims (18)
- 一种事件处理方法,包括:获取设备的上报数据;获取所述设备所对应的规则;根据所述规则将所述上报数据进行分流;将所述上报数据保存在对应的内存数据集中;从所述内存数据集中获取目标数据,所述目标数据至少包括所述上报数据,所述目标数据为匹配所述规则所需的数据;对所述目标数据进行计算并匹配所述规则。
- 如权利要求1所述的事件处理方法,其中,当所述目标数据多于所述上报数据时,所述内存数据集中还保存有历史上报数据;此时,所述目标数据包括所述上报数据和目标历史上报数据。
- 如权利要求2所述的事件处理方法,其中,所述对所述目标数据进行计算并匹配所述规则包括:滑动窗口对所述目标数据进行计算并匹配所述规则。
- 如权利要求3所述的事件处理方法,其中,所述滑动窗口对所述目标数据进行计算并匹配所述规则之后,还包括:对保存在所述内存数据集中超出滑动窗口所包括的所述历史上报数据进行释放。
- 如权利要求1-4任一项所述的事件处理方法,其中,所述获取设备的上报数据之前,还包括:建立所述设备与所述规则之间的映射关系以及所述规则与所述内存数据集之间的映射关系,其中所述规则与所述内存数据集之间的映射关系为一一映射。
- 如权利要求1-4任一项所述的事件处理方法,其中,所述根据所述规 则将所述上报数据进行分流之前,还包括:若所述上报数据的格式与预设格式不一致,则将所述上报数据的格式转换为预设格式后,根据所述规则将所述上报数据进行分流。
- 如权利要求1-4任一项所述的事件处理方法,其中,所述事件处理方法应用于以下至少之一:物联网云端、边缘节点。
- 如权利要求1-4任一项所述的事件处理方法,其中,所述对所述目标数据进行计算并匹配所述规则之后,还包括:若匹配所述规则成功,则执行相应的动作,所述动作包括以下至少之一:通知用户、上报物联网云端、控制对应的设备执行相应的动作。
- 一种事件处理装置,包括:第一获取模块,用于获取设备的上报数据;第二获取模块,用于获取所述设备所对应的规则;分流模块,用于根据所述规则将所述上报数据进行分流;内存数据集,用于保存对应的上报数据;第三获取模块,用于从所述内存数据集中获取目标数据,所述目标数据至少包括所述上报数据,所述目标数据为匹配所述规则所需的数据;计算匹配模块,用于对所述目标数据进行计算并匹配所述规则。
- 如权利要求9所述的事件处理装置,其中,当所述目标数据多于所述上报数据时,所述内存数据集中还保存有历史上报数据;此时,所述目标数据包括所述上报数据和目标历史上报数据。
- 如权利要求10所述的事件处理装置,其中,所述计算匹配模块包括滑动窗口。
- 如权利要求11所述的事件处理装置,其中,所述事件处理装置还包括:释放模块,用于在所述滑动窗口对所述目标数据进行计算并匹配所述规则之后,对保存在所述内存数据集中超出滑动窗口所包括的所述历史上报数据进行释放。
- 如权利要求9-12任一项所述的事件处理装置,其中,所述事件处理装置还包括:配置模块,用于在所述第一获取模块获取设备的上报数据之前,建立所述设备与所述规则之间的映射关系以及所述规则与所述内存数据集之间的映射关系,其中所述规则与所述内存数据集之间的映射关系为一一映射。
- 如权利要求9-12任一项所述的事件处理装置,其中,所述事件处理装置还包括:协议转换模块,用于所述分流模块根据所述规则将所述上报数据进行分流之前,若所述上报数据的格式与预设格式不一致,则将所述上报数据的格式转换为预设格式后,根据所述规则将所述上报数据进行分流。
- 如权利要求9-12任一项所述的事件处理装置,其中,所述事件处理装置还包括以下至少之一:物联网云端、边缘节点。
- 如权利要求9-12任一项所述的事件处理装置,其中,所述事件处理装置还包括:动作处理模块,用于若匹配所述规则成功,则执行相应的动作,所述动作包括以下至少之一:通知用户、上报物联网云端、控制对应的设备执行相应的动作。
- 一种事件处理终端,包括:处理器、存储器及通信总线;所述通信总线用于实现处理器和存储器之间的连接通信;所述处理器用于执行存储器中存储的一个或者多个计算机程序,以实现如权利要求1至8中任一项所述的事件处理方法的步骤。
- 一种计算机可读存储介质,其中,所述计算机可读存储介质存储有一个或者多个计算机程序,所述一个或者多个计算机程序可被一个或者多个处 理器执行,以实现如权利要求1至8中任一项所述的事件处理方法的步骤。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910907179.1 | 2019-09-24 | ||
CN201910907179.1A CN112631740A (zh) | 2019-09-24 | 2019-09-24 | 一种事件处理方法、装置、终端及计算机可读存储介质 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021057387A1 true WO2021057387A1 (zh) | 2021-04-01 |
Family
ID=75165588
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2020/112251 WO2021057387A1 (zh) | 2019-09-24 | 2020-08-28 | 一种事件处理方法、装置、终端及计算机可读存储介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN112631740A (zh) |
WO (1) | WO2021057387A1 (zh) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2023056943A1 (zh) * | 2021-10-09 | 2023-04-13 | 天翼物联科技有限公司 | 基于物联网规则引擎的终端控制方法、装置、设备及介质 |
CN116502125A (zh) * | 2023-04-28 | 2023-07-28 | 成都赛力斯科技有限公司 | 车辆事件划分方法、装置及车联网服务器 |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116016822A (zh) * | 2022-12-12 | 2023-04-25 | 天翼数字生活科技有限公司 | 监控设备数据存储方法、装置、存储介质及设备 |
CN116048866B (zh) * | 2023-03-07 | 2023-06-09 | 浙江鹏信信息科技股份有限公司 | 基于实时流计算引擎的数据故障检测方法、系统及介质 |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102473143A (zh) * | 2009-07-23 | 2012-05-23 | 日本电气株式会社 | 事件处理系统、分配控制器、事件处理方法、分配控制方法和程序存储介质 |
CN104756079A (zh) * | 2012-10-23 | 2015-07-01 | 日本电气株式会社 | 规则分配服务器、事件处理系统和方法以及程序 |
CN105138385A (zh) * | 2015-08-25 | 2015-12-09 | 北京邮电大学 | 一种物联网复杂事件处理方法 |
CN106104525A (zh) * | 2014-03-31 | 2016-11-09 | 华为技术有限公司 | 事件处理系统 |
US20170235783A1 (en) * | 2016-02-17 | 2017-08-17 | Verizon Patent And Licensing Inc. | Rules execution system for iot devices |
US20190278625A1 (en) * | 2018-03-12 | 2019-09-12 | Vmware, Inc. | Rule-based reallocation of hosted compute resources |
-
2019
- 2019-09-24 CN CN201910907179.1A patent/CN112631740A/zh active Pending
-
2020
- 2020-08-28 WO PCT/CN2020/112251 patent/WO2021057387A1/zh active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102473143A (zh) * | 2009-07-23 | 2012-05-23 | 日本电气株式会社 | 事件处理系统、分配控制器、事件处理方法、分配控制方法和程序存储介质 |
CN104756079A (zh) * | 2012-10-23 | 2015-07-01 | 日本电气株式会社 | 规则分配服务器、事件处理系统和方法以及程序 |
CN106104525A (zh) * | 2014-03-31 | 2016-11-09 | 华为技术有限公司 | 事件处理系统 |
CN105138385A (zh) * | 2015-08-25 | 2015-12-09 | 北京邮电大学 | 一种物联网复杂事件处理方法 |
US20170235783A1 (en) * | 2016-02-17 | 2017-08-17 | Verizon Patent And Licensing Inc. | Rules execution system for iot devices |
US20190278625A1 (en) * | 2018-03-12 | 2019-09-12 | Vmware, Inc. | Rule-based reallocation of hosted compute resources |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2023056943A1 (zh) * | 2021-10-09 | 2023-04-13 | 天翼物联科技有限公司 | 基于物联网规则引擎的终端控制方法、装置、设备及介质 |
CN116502125A (zh) * | 2023-04-28 | 2023-07-28 | 成都赛力斯科技有限公司 | 车辆事件划分方法、装置及车联网服务器 |
CN116502125B (zh) * | 2023-04-28 | 2024-03-12 | 重庆赛力斯凤凰智创科技有限公司 | 车辆事件划分方法、装置及车联网服务器 |
Also Published As
Publication number | Publication date |
---|---|
CN112631740A (zh) | 2021-04-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021057387A1 (zh) | 一种事件处理方法、装置、终端及计算机可读存储介质 | |
CN110430079B (zh) | 车路协同系统 | |
US11616840B2 (en) | Method, apparatus and system for processing unmanned vehicle data, and storage medium | |
US10696257B2 (en) | Automatic crowd sensing and reporting system for road incidents | |
US10477375B2 (en) | Communication between responders | |
WO2019128028A1 (zh) | 一种道路交通数据的记录方法及车载设备 | |
US20230049501A1 (en) | Service processing method and apparatus, and storage medium | |
CN110708258B (zh) | 流量控制方法、装置、服务器及存储介质 | |
CN110232010A (zh) | 一种告警方法、告警服务器及监控服务器 | |
CN113220715B (zh) | 一种数据处理方法、系统、计算机及可读存储介质 | |
US20200004785A1 (en) | Automatic grouping based on user behavior | |
US10735984B2 (en) | Systems and methods for identifying user density from network data | |
US10819596B2 (en) | System and method to access aggregated metric data in a computer network | |
EP3748913A1 (en) | Link bandwidth utilization rate acquisition method and device, and terminal | |
US20240144815A1 (en) | Method and system for collecting evidence following a vehicle incident | |
CN110198294B (zh) | 安全攻击检测方法及装置 | |
CN111399749B (zh) | 一种数据处理系统及方法 | |
US20240144735A1 (en) | Method and system for providing evidence following a vehicle incident | |
CN116319810A (zh) | 分布式系统的流量控制方法、装置、设备、介质及产品 | |
WO2019184434A1 (zh) | 一种基于gps实时位置大数据的信息处理方法、装置及其系统 | |
US11171806B1 (en) | Dynamic quality of service control for automotive ethernet | |
CN114501374A (zh) | 车联网的动态服务部署方法、系统、装置及存储介质 | |
WO2023134636A1 (zh) | 视频告警处理方法、装置、系统、存储介质及电子装置 | |
US20240146882A1 (en) | Method and system for collecting and reporting evidence method and system for collecting and reporting evidence | |
US10789347B1 (en) | Identification preprocessing |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20869823 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 20869823 Country of ref document: EP Kind code of ref document: A1 |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 140223) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 20869823 Country of ref document: EP Kind code of ref document: A1 |