The development of the Internet of Things has brought more convenience to intelligent security and automatic monitoring, and at the same time, the development of new urban construction, smart cities and smart communities has also put forward higher requirements for the intelligence of security issues such as access control management. In the context of intelligent development, access control has become a comprehensive and convenient system security application that integrates more functions such as visitors, attendance, consumption, patrol, elevator control, etc., with the more and more widely used access control systems, the real-time rapid processing of massive data has become an increasingly important issue.
As a high-performance distributed time series database, DolphinDB provides streaming tables and streaming computing engines for real-time data processing, providing strong support for intelligent security. Today, we will introduce how to realize real-time monitoring of the abnormal state of access control devices through multi-level cascade of stream computing engine, and provide you with a set of low-latency solutions for real-time monitoring of abnormal status of access control devices based on the DolphinDB stream data processing framework.
Common intelligent security systems generally include 4 main functions of monitoring, alarm, access control and remote control, which can be operated separately or managed in a unified manner. Access control is the basic application of the entire intelligent security system, and it is also related to public safety, urban management, smart home and other aspects in the field of Internet of Things. First of all, let's take a look at the specific application scenarios and function settings of the access control system
1.Access control and alarm integrated management system server: provide centralized management and monitoring, output, and linkage functions.
2.Access Control Workstation: The access control workstation provides function setting and event monitoring.
3.Access controller: the core part of the access control management system, which directly manages and controls related equipment, has a storage function, and can store cardholder information and various event records.
4.Card reader: It works in radio frequency mode, collects the data of the proximity card and transmits it to the access controller, so that the controller can carry out various management and corresponding control.
5.Electric lock: electronic switch, to open and lock the door, directly controlled by the access controller.
6.Open Door Button: Provides a convenient way to open the door.
7.Door Magnetic: Detects the status information of the gate and transmits it to the controller.
8.Alarm input and output equipment: In order to strengthen the security of the system, the input and output equipment can be connected to the interface of the access control controller to realize the alarm and linkage of the system.
Industrial center access control management system structure.
The above figure shows a common access control management system structure, the alarm system is an important functional component and link to ensure security in the security and access control system, and can also realize joint prevention and control with other monitoring equipment.
1.Design ideas and schemes
With the increasing number of terminals connected to the intelligent access control system, how to calculate massive data in real time and efficiently and timely feedback alarm messages has become a key issue in the construction of intelligent access control and smart community. Maintaining the normal closure of the access control is one of the basic requirements to ensure the safety of residents in the building, assuming that there is a monitoring system that collects data from all access control devices every 5 seconds, and the event of opening or closing the door will actively report the data, the abnormal state detection requirement of the access control in this case is: the door opening state continues to exist for more than 5 minutes to alarm. First, the collected data needs to be deduplicated, and then the record of continuous timeout in the data is detected. At this time, the record will include all the data that lasts for more than 5 minutes, so it is still necessary to connect the data to the next-level engine to remove the door closing alarm, and only keep the door opening status timeout alarm. The dolphindb responsive state engine is used to complete the task of filtering and filtering data, and the timeout data is detected by the session window engine. Cascade the three engines to achieve a pipeline processing mode that detects abnormal access control states (door opening time greater than 5 minutes).
The data processing process of the abnormal state of access control.
2.The built-in stream computing engine monitors the abnormal status of access control
DolphinDB has a built-in responsive status engine and a session window engine to realize real-time monitoring of abnormal status of gate control.
CreateReactiveStateEngine
There are two factor calculations: stateless and stateful.
Stateless factors rely only on the most recent data and do not require historical data.
Stateful factors require up-to-date and historical data and update the state.
Each input piece of data will trigger a result output, and the amount of input and output data is the same.
The operator can only contain vector functions, which is optimized for common state operators to greatly improve the computational efficiency.
CreatSessionWindowEngine:
It is suitable for IoT scenarios and solves the problem of uneven time of equipment.
Windows are not generated at a fixed frequency, and the window length is not fixed.
The timestamp of the first piece of data is used as the start time of the first window.
If no new data is received within the specified waiting time, the current window ends.
Fixed: The problem that no data window adds unnecessary computing overhead in the calculation of the sliding window.
3.Implementation steps
Next, let's take a detailed look at how to implement the pipeline processing mode of cascading multi-level engines to detect abnormal access control status through dolphindb.
3.1 Define and share input and output stream data tables
First, define a streaming data table for receiving real-time access control device data, the table structure contains a total of seven columns, and share the streaming data table through the enabletableshareandpersistence function and persist it to the hard disk. Next, define the exception state flow data table for the output of the reactive state engine and persist it to disk.
3.2 Create a reactive state engine to filter duplicate data
The reactive state engine will make a calculated response to each input message, resulting in a record as a result, and filter conditions can be enabled to ensure that only the results that meet the conditions will be output. In this case, only the data with a change in the event code will be output to the set output table. The built-in stream computing engine of dolphindb implements the interface of data tables, so it is very easy to pipeline multiple engines, as long as the latter engine is used as the output of the previous engine.
3.3 Detect state timeout data via cascading session window engine
First, create an in-memory table to provide input to the reactive state engine, which is the same as the structure of the output table of the higher-level engine. In the session window engine, set the keycolumn of the grouping column to the door number of doornum and the time column of timecolumn to the time of eventdate. The detection requirement is that there is no data alarm within five minutes, so the sessiongap is 300 (seconds), which means that no new data arrives after waiting for a certain piece of data after receiving it, and the current window is terminated. metrics is set to last(dooreventcode), which returns the last record data in the window. The input data of the session window engine is the output of the higher-level reactive state engine, and the output is used as the input of the next-level reactive state engine.
3.4 Responsive status engine filters door closure alarms
The data obtained by the parent session window engine includes the data of door opening and closing for more than 5 minutes, so it is necessary to filter out the door closing state timeout data through the reactive state engine and only keep the door opening alarm.
3.5 Subscribe to streaming data
After filtering the shutdown alarm data, subscribe to the doorrecord table and write the received stream data to the session window engine.
3.6 Receive data from the MQTT server
DolphinDB provides the MQTT plug-in for subscribing to the data of the MQTT server, and the data format parsing function is required when subscribing, at present, the plug-in provides the parsing function in JSON and CSV format, in this example, we use MQTT::createJSONparser to parse the JSON format data. With the rapid development of network and digital technology, the access control system has long been no longer a simple door and key management, but has gradually evolved into a complete set of access control security management system, integrating microcomputer automatic identification technology and modern security management measures. DolphinDB provides a low-latency solution for real-time monitoring of the abnormal state of access control devices, realizes the cascade of session window engine and responsive state engine, reduces development difficulty, effectively improves the real-time computing efficiency of massive data, and meets the intelligent computing requirements of access control systems.
The above is a complete scheme based on the dolphindb stream data processing framework for engine cascade monitoring of abnormal state of access control, want to know the detailed implementation steps and simulate the verification by yourself? Welcome to pay attention to ***dolphindb Internet of Things] to learn more.