Intelligent security warning system based on ZigBee

By using deep reinforcement learning algorithms and situational awareness mechanisms in intelligent security systems and combining with cloud service platforms, the problems of adaptive alarm threshold adjustment, dynamic transmission power control, personalized alarm and permission management and real-time data processing delays have been solved, significantly improving the problem of delays in adaptive alarm threshold adjustment, dynamic transmission power control, personalized alarm and permission management, and The intelligence and stability of the system.

CN119136212AInactive Publication Date: 2024-12-13SHANDONG TRANSPORT VOCATIONAL COLLEGE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411321532.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-23
Publication Date
2024-12-13
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional intelligent security systems lack adaptive adjustment capabilities, resulting in false alarms or missed reports, limited signal coverage, waste of energy, inability to meet user personalized needs, and delayed data processing.

Method used

Using a ZigBee-based intelligent security warning system, the transmission power is automatically adjusted through deep reinforcement learning algorithms, the situation awareness mechanism adjusts the alarm threshold, and the cloud service platform realizes personalized alarm and permission management, and real-time data processing.

Benefits of technology

It improves the system's adaptability and response speed, reduces false alarm rate, extends the device life, and enhances the system's intelligence and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119136212A_ABST
    Figure CN119136212A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent security warning system based on ZigBee, which relates to the technical field of Internet of Things and comprises a topological structure based on a ZigBee network and hardware equipment for deploying a ZigBee unit, a sensor and a central controller. A sensor is used for collecting network load and inter-node distance data, a model is trained through a deep reinforcement learning algorithm to automatically adjust transmitting power, and an initial alarm threshold value is automatically adjusted through a situation awareness mechanism while the sensor collects data of external environment change in real time; and the cloud service platform continuously monitors the state of the sensor, immediately triggers an alarm if an abnormal condition is found, and sends a notification to a user through the mobile application. According to the invention, the transmitting power is automatically adjusted through deep reinforcement learning, the alarm threshold is adaptively adjusted through a context awareness mechanism, and the intelligence, flexibility and response speed of the system are effectively improved through personalized alarm setting and efficient cloud data processing, so that the stability and reliability of the security and protection system are remarkably enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of Internet of Things, and in particular to an intelligent security warning system based on ZigBee. Background Art

[0002] With the rapid development of Internet of Things technology, intelligent security systems have become an important means to ensure public safety and personal privacy. Traditional security systems usually rely on fixed alarm thresholds and manual monitoring, while the intelligent security systems that have emerged in recent years use wireless communication technology, sensor networks and advanced data analysis technology to achieve more efficient and flexible security protection. Among them, ZigBee, as a low-power, low-cost wireless communication protocol, has been widely used in smart homes, industrial automation and other fields due to its unique networking capabilities and low energy consumption characteristics. ZigBee networks support a variety of topologies, including star, tree and mesh topologies, and can adapt to different physical environments and needs. In addition, with the advancement of machine learning technology, especially the application of deep learning algorithms, intelligent security systems can not only monitor environmental changes in real time, but also self-optimize through situational awareness and learning capabilities to improve the intelligence and response speed of the system.

[0003] Although the existing technology has made some progress, it still has some limitations. First, traditional intelligent security systems often lack the ability to adaptively adjust, that is, they cannot dynamically adjust the alarm threshold according to environmental changes, which can easily cause false alarms or missed alarms. Secondly, existing systems usually use fixed transmission power in wireless communications, which may lead to limited signal coverage or unnecessary energy waste. In addition, existing intelligent security systems do not take into account the personalized needs of users, and often lack effective methods to set personalized alarms and permission management. Finally, existing intelligent security systems still have delay problems in data processing, especially when the system needs to process a large amount of real-time data, it may not respond in time. Summary of the invention

[0004] In view of the above existing problems, the present invention is proposed.

[0005] Therefore, the present invention provides a ZigBee-based intelligent security warning system to solve the problems in the prior art regarding adaptive alarm threshold adjustment, dynamic transmission power control, personalized alarm and authority management, and real-time data processing delay.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions: In the first aspect, an embodiment of the present invention provides a ZigBee-based intelligent security warning system, which includes: a ZigBee network deployment module: based on the topological structure of the ZigBee network, deploying ZigBee units, sensors and hardware devices of a central controller; a sensor configuration module: initializing the ZigBee network through the ZigBee unit, and configuring the initial threshold and trigger conditions of the sensor; a deep reinforcement learning power control module: using sensors to collect network load and node distance data, and automatically adjusting the transmission power through a deep reinforcement learning algorithm training model; an alarm threshold adjustment module: while the sensor collects data on changes in the external environment in real time, the initial alarm threshold is automatically adjusted through a situational awareness mechanism; a cloud service integration module: aggregating the sensor data to the central controller, connecting to the cloud service platform at the same time, and setting personalized alarms and user permissions; an alarm trigger module: the cloud service platform continuously monitors the status of the sensor, and immediately triggers an alarm if an abnormal situation is found, and sends a notification to the user through a mobile application.

[0007] As a preferred solution of the ZigBee-based intelligent security warning system of the present invention, wherein: the topology of the ZigBee network includes star topology, tree topology and mesh topology; The ZigBee unit includes a network coordinator, a router and a terminal node; The sensors include temperature sensors, humidity sensors, light sensors, motion sensors, and gas sensors.

[0008] As a preferred solution of the ZigBee-based intelligent security warning system of the present invention, the hardware equipment of the ZigBee unit, sensor and central controller is deployed, and the specific steps are as follows: Select Raspberry Pi 4 Model B as the network coordinator and install the ZigBee coordinator software, and place the network coordinator in the central location; An integrated unit using the TI CC2530 chip is used as a router and the router is installed according to the building layout and obstacle distribution; The terminal node uses an integrated unit of the TI CC2530 chip and is equipped with corresponding sensors, and the terminal node is deployed at the monitoring location; Using the ZigBee protocol stack in the ZigBee coordinator software, connect a sensor node for preliminary testing.

[0009] As a preferred solution of the ZigBee-based intelligent security warning system of the present invention, the ZigBee network is initialized by the ZigBee unit, and the specific steps are as follows: Start the Raspberry Pi 4 Model B, turn on the Raspberry Pi, and make sure the ZigBee coordinator software is installed. Initialize the ZigBee coordinator by typing sudo.zigbee_init.sh in the command line. Use the ZigBee coordinator software to set the network ID and channel; Connect the router and the end node to the power supply at the same time and join the network using the command in the ZigBee coordinator software; Use the ZigBee coordinator software to check the network status.

[0010] As a preferred solution of the ZigBee-based intelligent security warning system of the present invention, the threshold and trigger conditions of the configuration sensor are specifically configured as follows: Select the integrated unit of TI CC2530 chip equipped with DS18B20 temperature, humidity, light, motion and gas sensors; Set corresponding thresholds for each type of sensor based on specific monitoring objectives and application scenarios; Use the configuration function in the ZigBee coordinator software to send configuration commands to the sensor nodes through the ZigBee protocol stack; Use the test function in the ZigBee coordinator software to simulate different ambient temperatures and verify that the sensor node behavior meets the expected threshold trigger conditions; If the test results do not meet expectations, fine-tune the thresholds and trigger conditions, and continue to iterate the testing and adjustment process until the expected performance level is achieved.

[0011] As a preferred solution of the ZigBee-based intelligent security warning system of the present invention, the method of using sensors to collect network load and node distance data and automatically adjusting the transmission power through a deep reinforcement learning algorithm training model includes the following specific steps: Deploy sensor nodes in the ZigBee network, and each node is equipped with a dedicated network load sensor; Use ZigBee coordinator software to record network load data for each node; The RSSI method is used to measure the distance between nodes; Define the state space S, where each state s∈S consists of the network load L and the distance between nodes D, that is, ; The action space A is defined as the adjustment range of the transmit power, which is expressed as: ; ; in, represents the adjustment amplitude of the i-th transmission power, is an integer index; Defining the reward function , evaluate the action In Status The effect is as follows: ; in, is the attenuation coefficient of the network load, is the quadratic coefficient of the distance, is the action cost coefficient, is the amplitude coefficient, is the frequency coefficient of the sine function; Select the DQN algorithm as the basic algorithm and improve it to adapt to specific network environments and requirements; Design a multi-layer neural network, where the input layer receives the state s and the output layer predicts the Q value corresponding to each action a; Use the experience replay mechanism to store and replay experiences to reduce the correlation between data, and periodically update the target Q value through the target network; Use the gradient descent method to minimize the loss function, the loss function Defined as: ; in, represents the expected value operator, For all possible actions The operation of taking the maximum value, Indicates the current state. Indicates the next state, Indicates in status The transmit power adjustment range under represents the parameters of the target network, Represents the parameters of the current network; when When , it is an ideal situation, indicating the action taken In Status It is beneficial to reduce network load, shorten the distance between nodes, and the transmission power adjustment is small; when When , it is a normal situation, indicating that the current action maintains the network efficiency at a stable level, without significantly reducing the network load and the distance between nodes, nor increasing the transmission power adjustment too much; when When , it is a non-ideal situation, indicating the action taken In Status It is not conducive to reducing the network load and shortening the distance between nodes, and the transmission power adjustment is large.

[0012] As a preferred solution of the ZigBee-based intelligent security warning system of the present invention, the sensor collects data on changes in the external environment in real time and automatically adjusts the initial alarm threshold through a situational awareness mechanism. The specific steps are: Define a series of situational variable expressions as follows: ; ; in, Represents a specific situation. is the index of the context variable; The context weight matrix is ​​introduced to quantify the importance of the context: ; in, Represents situational variables the importance of According to the current situation variables Calculate the situational awareness factor , the expression is: ; Among them, δ is the sensitivity coefficient, Context variables The average value of Context-aware factor , alarm threshold The expression is: ; in, is the initial alarm threshold, is the threshold adjustment coefficient, is the average situational awareness factor, is the maximum situational awareness factor, is the minimum situational awareness factor, is the nonlinear coefficient; when When , it indicates that the current situation leads to a higher alarm threshold, that is, the system becomes more tolerant and reduces the possibility of false alarms; when When , it indicates that the current situation leads to a lower alarm threshold, that is, the system becomes more sensitive, improving the timeliness of the alarm; when , it indicates that the current situation is at the average level and the alarm threshold remains unchanged.

[0013] As a preferred solution of the ZigBee-based intelligent security warning system of the present invention, the data of the sensor is aggregated to the central controller and connected to the cloud service platform at the same time. The specific steps are as follows: Start the Node-RED receive data application in the ZigBee coordinator software and add the ZigBee input node; Configure the ZigBee input node connection port and set the communication parameters; Drag and drop the ZigBee input node onto the Node-RED editor canvas and add function nodes to process the received data. Add a debug node to view the received data, connect the nodes, and deploy the Node-RED instance; Log in to the Alibaba Cloud IoT platform and register the Raspberry Pi 4 Model B as the central controller device in the device management; In the Node-RED editor, use the device's Access Key ID, Access Key Secret, and ProductKey to configure the MQTT output node and connect to the Alibaba Cloud IoT platform. Set the Topic format and connect the ZigBee input node, function node, and MQTT output node.

[0014] As a preferred solution of the ZigBee-based intelligent security warning system of the present invention, the specific steps of setting personalized alarms and user permissions are as follows: Use the conditional node in Node-RED to determine whether the data meets the alarm condition; When the conditions are met, use the function node to construct an alarm message and send the alarm message to the Alibaba Cloud IoT platform through the MQTT node; Create different user roles on the Alibaba Cloud IoT platform and assign corresponding permissions to each role; Use the authentication service provided by Alibaba Cloud IoT platform to implement user login and add an authentication node in Node-RED; Use a web framework to build a user interface that allows users to view real-time data, history, and alarm information; Displays different information and operation options based on the user's role and permissions.

[0015] As a preferred solution of the ZigBee-based intelligent security warning system of the present invention, the specific steps of sending a notification to the user through a mobile application are as follows: Use the Isolation Forest anomaly detection model to train anomaly detection logic and adjust alert thresholds based on context-aware factors; Process sensor data in real time through Apache Kafka and apply anomaly detection models; Define trigger conditions based on anomaly detection model output; When an anomaly is detected, an alarm is triggered and an alarm message is sent through the cloud service platform; Use React Native to develop mobile applications and integrate push service SDK; Send personalized notifications via mobile apps based on user roles and permissions and set up user permissions.

[0016] The beneficial effects of the present invention are as follows: the present invention can effectively improve network performance and extend the service life of equipment by automatically adjusting the transmission power through the deep reinforcement learning algorithm; automatically adjust the initial alarm threshold through the situational awareness mechanism, so that the system can better adapt to environmental changes and reduce the false alarm rate; by aggregating sensor data to the central controller and connecting it to the cloud service platform, remote monitoring and personalized alarm settings are realized, which effectively improves the intelligence, flexibility and response speed of the system, thereby significantly enhancing the stability and reliability of the security system. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0018] Figure 1 This is a flow chart of the ZigBee-based intelligent security warning system in Example 1.

[0019] Figure 2 This is a flowchart of the hardware devices for deploying ZigBee units, sensors and central controllers in Example 1. DETAILED DESCRIPTION

[0020] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings.

[0021] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0022] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.

[0023] Example 1, reference Figure 1 and Figure 2 , which is the first embodiment of the present invention, and which provides a ZigBee-based intelligent security warning system, comprising the following steps: S1. Based on the topology of the ZigBee network, deploy the hardware devices of ZigBee units, sensors and central controllers.

[0024] Furthermore, the topologies of ZigBee networks include star topology, tree topology, and mesh topology; ZigBee units include network coordinators, routers, and terminal nodes; Sensors include temperature sensors, humidity sensors, light sensors, motion sensors, and gas sensors.

[0025] Furthermore, Raspberry Pi 4 Model B was selected as the network coordinator, ZigBee coordinator software was installed, and the network coordinator was located in a central location in order to maximize signal coverage, reduce signal attenuation, and ensure network stability and reliability; It should be noted that the ZigBee coordinator software is installed in order to be able to initialize and manage the entire ZigBee network.

[0026] Use integrated units based on TI CC2530 chips as routers, and plan router locations in advance based on building layout and obstacle distribution to ensure that each terminal node can communicate with at least one router or multiple hops to reach the network coordinator; The terminal nodes use the same integrated unit of the TI CC2530 chip, equipped with corresponding sensors, deploy the terminal nodes at the monitoring location, and ensure that they can communicate with the network coordinator through the router; Using the ZigBee protocol stack in the ZigBee coordinator software, connect a sensor node for preliminary testing to verify whether the communication between the node and the network coordinator is normal.

[0027] S2. Initialize the ZigBee network through the ZigBee unit and configure the initial threshold and trigger conditions of the sensor.

[0028] Furthermore, boot up the Raspberry Pi 4 Model B, turn on the Raspberry Pi, and make sure the ZigBee coordinator software is installed. Initialize the ZigBee coordinator by typing sudo .zigbee_init.sh on the command line. Use the ZigBee coordinator software to set the network ID and channel; The network ID should be a unique 16-bit identifier, such as 0x1234.

[0029] The channel should be a 2.4 GHz channel without interference, such as 11.

[0030] Connect the router and the end node to the power supply at the same time and join the network using the command in the ZigBee coordinator software; For each sensor node, ensure that the device type and port are configured correctly; Use the ZigBee coordinator software to check the network status and ensure that all nodes have successfully joined the network.

[0031] Going a step further, the integrated unit that chooses the TI CC2530 chip is equipped with DS18B20 temperature, humidity, light, motion and gas sensors; Set corresponding thresholds for each type of sensor based on specific monitoring objectives and application scenarios; For example, for a temperature sensor: set the upper temperature limit Tupper and the lower temperature limit Tlower.

[0032] Humidity sensor: Set the humidity upper limit Hupper and the humidity lower limit Hlower.

[0033] Light sensor: Set the upper limit of light intensity Lupper and the lower limit of light intensity Llower.

[0034] Motion sensor: Set the motion detection threshold Mthreshold.

[0035] Gas sensor: Set the upper limit of gas concentration Gupper and the lower limit of gas concentration Glower.

[0036] Use the configuration function in the ZigBee coordinator software to send configuration commands to the sensor nodes through the ZigBee protocol stack; Use the test function in the ZigBee coordinator software to simulate different ambient temperatures and verify that the sensor node behavior meets the expected threshold trigger conditions; For example, for temperature sensors, temperature changes can be simulated by heating or cooling the environment; for humidity sensors, humidity changes can be simulated by spraying or drying the air; for light sensors, light changes can be simulated by changing the light intensity; for motion sensors, motion can be simulated by moving objects; for gas sensors, gas concentration changes can be simulated by releasing gases of different concentrations.

[0037] If the test results do not meet expectations, fine-tune the thresholds and trigger conditions, and continue to iterate the testing and adjustment process until the expected performance level is achieved.

[0038] By precisely configuring thresholds and trigger conditions, you can ensure that sensors can accurately trigger alarms under specific conditions, thereby improving the reliability and accuracy of the system.

[0039] S3. Use sensors to collect network load and node distance data, and train the model through deep reinforcement learning algorithm to automatically adjust the transmission power.

[0040] Furthermore, sensor nodes are deployed in the ZigBee network, and each node is equipped with a dedicated network load sensor to measure the traffic of each node; Use the ZigBee coordinator software to record network load data for each node, including the amount of data uploaded and downloaded; The RSSI (Received Signal Strength Indicator) method is used to measure the distance between nodes; Define the state space S, where each state s∈S consists of the network load L and the distance between nodes D, that is, ; Action Space Defined as the adjustment amplitude of the transmit power, the expression is: ; ; in, Indicates the i-th transmit power adjustment amplitude action, is an integer index used to identify the action space Each transmit power adjustment range ; Defining the reward function , evaluate the action In Status The effect is as follows: ; in, is the attenuation coefficient of the network load, is the network load, in bits per second (bps), indicating the data transmission rate of the node. is the quadratic coefficient of the distance, which is used to adjust the degree of influence of the distance D between nodes on the reward function. is the distance between nodes, in meters (m), indicating the physical distance between two nodes. is the action cost coefficient, which is used to adjust the degree of influence of action a on the reward function. is the amplitude coefficient, used to adjust the sine function The amplitude of is the frequency coefficient of the sine function, used to adjust the sine function frequency; Select the DQN algorithm as the basic algorithm and improve it to adapt to specific network environments and requirements; It should be noted that the choice of DQN algorithm as the basic algorithm means that the DQN algorithm is used as the basic framework for solving the current problem. The DQN algorithm estimates the Q value of each state-action pair through a deep neural network, thereby deciding which action should be taken in a given state to obtain the maximum long-term reward.

[0041] It should also be noted that improving it to adapt to specific network environments and requirements means making customized adjustments based on DQN to better adapt to the specific environment and requirements in the ZigBee network. Such improvements may include but are not limited to the following aspects: State representation: According to the characteristics of the ZigBee network, a more appropriate state representation is designed, for example, combining factors such as network load and distance between nodes.

[0042] Action space: Adjust the range and granularity of the transmit power adjustment range based on actual needs.

[0043] Reward function: Adjust the parameters of the reward function according to the network environment and goals to better reflect network performance indicators, such as the attenuation coefficient α of network load, the quadratic coefficient β of distance, and the action cost coefficient , amplitude coefficient δ and frequency coefficient η.

[0044] Network architecture: Design a neural network architecture that is more suitable for the current problem, such as adding more hidden layers to improve the expressiveness of the model.

[0045] Training strategy: Adopt more effective training strategies, such as experience replay mechanism, regular update of target network, etc., to improve the stability and efficiency of training.

[0046] Exploration strategy: Adjust the balance between exploration and exploitation, such as adjusting the ε value in the ε-greedy strategy to better explore the action space.

[0047] Hyperparameter adjustment: Adjust hyperparameters such as learning rate, discount factor θ, etc. according to experimental results to optimize the performance of the model.

[0048] Design a neural network with multiple layers, where the input layer receives the state s and the output layer predicts the Q value corresponding to each action a.

[0049] Through such improvements, the DQN algorithm can be more in line with the needs of actual application scenarios, thereby more effectively solving problems in ZigBee networks, such as automatically adjusting the transmission power to reduce energy consumption and improve network efficiency. This customized improvement helps to improve the performance and applicability of the algorithm, enabling it to achieve more efficient and accurate control strategies.

[0050] Use the experience replay mechanism to store and replay experiences to reduce the correlation between data.

[0051] The target Q-value is updated periodically using the target network to stabilize the training process.

[0052] Use the gradient descent method to minimize the loss function, the loss function Defined as: ; in, represents the expected value operator, which is used to calculate the average value of a random variable, represents the discount factor, which is used to balance the impact of immediate rewards and future rewards, Indicates the adjustment range of all possible transmit power The operation of taking the maximum value, Indicates the current state. Indicates the next state, Indicates in status The transmit power adjustment range under Represents the parameters of the target network, which is used to stabilize the training process. Represents the parameters of the current network; when When (target reward value), it means that the action a taken is conducive to reducing network load and shortening the distance between nodes in state s, and the transmission power adjustment is small, which is an ideal situation; when (target reward value), it is a normal situation, indicating that the current action maintains the network efficiency at a stable level, neither significantly reducing the network load and the distance between nodes, nor increasing too much transmission power adjustment; when (target reward value), it means that the action a taken is not conducive to reducing the network load, shortening the distance between nodes, or the transmission power adjustment is large in state s, which is a non-ideal situation.

[0053] It should be noted that the "target reward value" (P) is set based on the reward mechanism in the deep reinforcement learning algorithm. This value is not a fixed threshold, but is dynamically adjusted through the algorithm to guide the learning direction of the algorithm.

[0054] The calculation formula of the target reward value (P) can be expressed as: ; in, is the immediate reward obtained after taking action a in the current state s, The discount factor is usually between 0 and 1, which is used to balance the impact of immediate rewards and future rewards; The target reward value (P) is not a pre-set threshold, but is dynamically calculated during the algorithm operation. It is determined by observing the immediate reward r under the current state s and the predicted maximum future reward. During the algorithm training process, the target reward value will be continuously updated as the network learns.

[0055] S4. While the sensor collects data on changes in the external environment in real time, it automatically adjusts the initial alarm threshold through the situational awareness mechanism.

[0056] Furthermore, a series of situational variable expressions are defined as follows: ; ; in, Represents a specific situation. is the index of the context variable; The context weight matrix is ​​introduced to quantify the importance of the context: ; in, Represents situational variables the importance of According to the current situation variables Calculate the situational awareness factor , which is used to measure the impact of the current situation on the alarm threshold. The expression is: ; Among them, δ is the sensitivity coefficient, which determines the impact of situational changes on the factor. Situational variables The average value of Context-aware factor , alarm threshold The expression is: ; in, is the initial alarm threshold, is the threshold adjustment coefficient, which determines the amplitude of the threshold adjustment. is the average situational awareness factor, reflecting the level of situational awareness factors in general. is the maximum situational awareness factor, is the minimum situational awareness factor, is the nonlinear coefficient, which is used to adjust the nonlinear degree of threshold adjustment; when When , it indicates that the current situation leads to a higher alarm threshold, that is, the system becomes more tolerant and reduces the possibility of false alarms; when When , it indicates that the current situation leads to a lower alarm threshold, that is, the system becomes more sensitive, improving the timeliness of the alarm; when , it indicates that the current situation is at the average level and the alarm threshold remains unchanged.

[0057] It should be noted that It reflects the impact of the current situation on the alarm threshold through the sigmoid function , the context variable Mapped to the interval (0, 1), and then multiplied by the context weight To reflect the importance of the situation; The calculation takes into account the contextual awareness factor Average situational awareness factor The deviation of , and the normalized value of this deviation between the maximum and minimum situational awareness factors. Adjust the nonlinearity of the threshold adjustment to make the threshold adjustment more accurate in specific situations.

[0058] S5. Aggregate the sensor data to the central controller and connect to the cloud service platform to set personalized alarms and user permissions.

[0059] Furthermore, start the Node-RED receive data application in the ZigBee coordinator software and add the ZigBee input node; Configure the ZigBee input node connection port and set the communication parameters; Drag and drop the ZigBee input node onto the canvas of the Node-RED editor and add function nodes to process the received data, such as parsing data, converting formats, etc. Add a debug node to view the received data, confirm that the data format is correct, connect the nodes, and deploy the Node-RED instance; Log in to the Alibaba Cloud IoT platform and register the Raspberry Pi 4 Model B as the central controller device in the device management; In the Node-RED editor, use the device's Access Key ID, Access Key Secret, and ProductKey to configure the MQTT output node and connect to the Alibaba Cloud IoT platform. Set the Topic format and connect the ZigBee input node, function node, and MQTT output node.

[0060] Going a step further, use conditional nodes in Node-RED (such as switch nodes) to determine whether the data meets the alarm conditions; When the conditions are met, use the function node to construct an alarm message, including the alarm type, timestamp, location information, etc., and send the alarm message to the Alibaba Cloud IoT platform through the MQTT node; Create different user roles on the Alibaba Cloud IoT platform, such as administrator, operator, and guest, and assign corresponding permissions to each role. For example, administrators can configure devices and alarm rules, operators can view real-time data and receive alarms, and guests can only view limited data. Use the authentication service provided by Alibaba Cloud IoT platform to implement user login. Add an authentication node in Node-RED, which is responsible for verifying the user's login credentials. Use Node-RED Dashboard or other web frameworks to build a user interface that allows users to view real-time data, history, and alarm information; Displays different information and operation options based on the user's role and permissions.

[0061] S6. The cloud service platform continuously monitors the status of the sensor. If any abnormal situation is found, an alarm is triggered immediately and a notification is sent to the user through the mobile application.

[0062] Furthermore, we use models such as Isolation Forest to train anomaly detection logic and adjust the alarm threshold based on context-aware factors. By dynamically adjusting the alarm threshold, the system can automatically adapt to changes in the current context, avoiding false positives or false negatives, thereby improving the accuracy and reliability of the alarm. Preferably, Isolation Forest is an efficient unsupervised learning method suitable for anomaly detection tasks, especially when there are few abnormal samples in the data set, and can also quickly identify potential anomalies and improve the response speed and accuracy of the system.

[0063] Process sensor data in real time through Apache Kafka and apply anomaly detection models; Preferably, using Apache Kafka as a stream processing framework can achieve real-time data processing and ensure that the system can respond to changes in sensor data in a timely manner, which is especially important for scenarios with high real-time requirements such as security monitoring.

[0064] Define trigger conditions based on the output of the anomaly detection model to ensure that alarms are triggered only when anomalies actually occur, reducing unnecessary alarms and improving the effectiveness of alarms; When an anomaly is detected, an alarm is triggered and an alarm message is sent through the cloud service platform; Use tools such as React Native to develop mobile applications and integrate push service SDKs; Preferably, React Native is a cross-platform development tool that can efficiently build native mobile applications. Integrating the Alibaba Cloud push service SDK enables mobile applications to receive alert information in real time, improving the system's response speed and user experience.

[0065] Send personalized notifications via mobile apps based on user roles and permissions and set up user permissions.

[0066] It should be noted that by defining user roles and permissions, it can be ensured that only authorized users can receive specific types of alarm information, protecting the security of sensitive information while improving the security of the system; sending personalized notifications based on user permissions and settings can ensure that users only receive the information they care about, reduce interference, and improve the pertinence and practicality of alarm information.

[0067] In summary, the present invention can effectively improve network performance and extend the service life of equipment by automatically adjusting the transmission power through the deep reinforcement learning algorithm; automatically adjust the initial alarm threshold through the situational awareness mechanism, so that the system can better adapt to environmental changes and reduce the false alarm rate; and realize remote monitoring and personalized alarm setting by aggregating sensor data to the central controller and connecting it to the cloud service platform, which effectively improves the intelligence, flexibility and response speed of the system, thereby significantly enhancing the stability and reliability of the security system.

[0068] Example 2, referring to Table 1, is the second example of the present invention. To further verify the advancement of the present invention, experimental simulation data of an intelligent security warning system based on ZigBee is provided.

[0069] The experimental site was a commercial office area, which includes multiple offices, meeting rooms and public areas with a total area of ​​approximately 1,000 square meters.

[0070] Firstly, Raspberry Pi 4 Model B was selected as the network coordinator, and ZigBee coordinator software was installed, and it was placed in the center of the office area. The integrated unit of TI CC2530 chip was used as the router, and the router was installed at the key location according to the building layout and obstacle distribution. The terminal node used the integrated unit of TI CC2530 chip, equipped with DS18B20 temperature sensor, humidity sensor, light sensor, motion sensor, gas sensor, etc., and deployed at each monitoring point. The ZigBee protocol stack in the ZigBee coordinator software was used to connect a sensor node for preliminary testing.

[0071] Secondly, start the Raspberry Pi 4 Model B, turn on the Raspberry Pi, and make sure the ZigBee coordinator software is installed; enter sudo .zigbee_init.sh through the command line to initialize the ZigBee coordinator; use the ZigBee coordinator software to set the network ID and channel; connect the router and end node to the power supply at the same time, and join the network using the commands in the ZigBee coordinator software; use the ZigBee coordinator software to check the network status.

[0072] Next, set the corresponding threshold for each type of sensor; use the configuration function in the ZigBee coordinator software to send configuration commands to the sensor nodes through the ZigBee protocol stack; use the test function in the ZigBee coordinator software to simulate different ambient temperatures to verify whether the behavior of the sensor nodes meets the expected threshold trigger conditions; if the test results do not meet expectations, fine-tune the thresholds and trigger conditions, and continuously iterate the testing and adjustment process until the expected level is reached.

[0073] Furthermore, sensor nodes are deployed in the ZigBee network, and each node is equipped with a dedicated network load sensor. The ZigBee coordinator software is used to record the network load data of each node. The RSSI method is used to measure the distance between nodes. The state space S, action space A and reward function R(s,a) are defined, and the model is trained through a deep reinforcement learning algorithm to automatically adjust the transmission power. The model is trained until convergence to obtain the optimal transmission power adjustment strategy.

[0074] Finally, a series of situational variable expressions are defined and the situational awareness factor F(C) is calculated. The initial alarm threshold T_new is adjusted according to F(C) so that the system can adaptively adjust the alarm threshold according to the current situation. Data from the ZigBee network is received through Node-RED and sent to the Alibaba Cloud IoT platform.

[0075] Set personalized alerts and user permissions to ensure that different users can access corresponding data and alert information according to their roles and permissions; send notifications to users through mobile applications to ensure that users can be informed of abnormal situations in a timely manner.

[0076] The details are shown in Table 1:

[0077] The above experimental data demonstrates the significant advantages of ZigBee-based intelligent security warning system in situational awareness and adaptive adjustment. As can be seen from the above table: Network load: As the network load increases, the system automatically reduces the transmit power to ensure network stability and reliability, thereby avoiding signal interference and energy waste. For example, from Office 1 to Conference Room 1, the network load increases from 25% to 55%, while the transmit power decreases from 0 dBm to -15 dBm.

[0078] Distance between nodes: The increase in distance between nodes also affects the adjustment of transmit power. As the distance increases, the system dynamically adjusts the transmit power to maintain an effective communication link. For example, from Office 1 to Conference Room 1, the distance between nodes increases from 5 meters to 20 meters, and the transmit power decreases from 0 dBm to -15 dBm accordingly.

[0079] Initial alarm threshold and context-awareness threshold: The initial alarm threshold is 20, and the threshold adjusted by the context-aware mechanism varies according to different contexts. For example, the context-awareness threshold of Office 1 is 18, which indicates that the system has become more sensitive in the current context and improves the timeliness of the alarm; while the context-awareness threshold of Conference Room 1 is 14, which indicates that the system is more tolerant in a high-load environment and reduces the possibility of false alarms.

[0080] The present invention significantly improves the sensitivity and response speed of the system while ensuring network stability and reliability by adaptively adjusting the transmission power and automatically adjusting the alarm threshold. Compared with the traditional static threshold alarm system, it has obvious advantages in innovation and practicality.

[0081] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. An intelligent security warning system based on ZigBee, Features: include, ZigBee network deployment module: deploys ZigBee units, sensors and central controller hardware based on the topology of the ZigBee network; Sensor configuration module: Initializes the ZigBee network through the ZigBee unit and configures the initial threshold and trigger conditions of the sensor; Deep reinforcement learning power control module: uses sensors to collect network load and node distance data, and automatically adjusts the transmission power through the deep reinforcement learning algorithm training model; Alarm threshold adjustment module: While the sensor collects data on changes in the external environment in real time, it automatically adjusts the initial alarm threshold through the context awareness mechanism; Cloud service integration module: aggregates sensor data to the central controller and connects to the cloud service platform to set personalized alarms and user permissions; Alarm triggering module: The cloud service platform continuously monitors the status of sensors. If any abnormality is found, an alarm is triggered immediately and a notification is sent to the user through the mobile application.

2. The ZigBee-based intelligent security warning system as claimed in claim 1, Features: The topology of the ZigBee network includes star topology, tree topology and mesh topology; The ZigBee unit includes a network coordinator, a router and a terminal node; The sensors include temperature sensors, humidity sensors, light sensors, motion sensors, and gas sensors.

3. The ZigBee-based intelligent security warning system as claimed in claim 2, Features: The hardware devices of the ZigBee unit, sensor and central controller are deployed in the following steps: Select Raspberry Pi 4 Model B as the network coordinator and install the ZigBee coordinator software, and place the network coordinator in the central location; An integrated unit using the TI CC2530 chip is used as a router and the router is installed according to the building layout and obstacle distribution; The terminal node uses an integrated unit of the TI CC2530 chip and is equipped with corresponding sensors, and the terminal node is deployed at the monitoring location; Using the ZigBee protocol stack in the ZigBee coordinator software, connect a sensor node for preliminary testing.

4. The ZigBee-based intelligent security warning system as claimed in claim 3, Features: The specific steps of initializing the ZigBee network through the ZigBee unit are as follows: Start the Raspberry Pi 4 Model B, turn on the Raspberry Pi, and make sure the ZigBee coordinator software is installed. Initialize the ZigBee coordinator by typing sudo.zigbee_init.sh in the command line. Use the ZigBee coordinator software to set the network ID and channel; Connect the router and the end node to the power supply at the same time and join the network using the command in the ZigBee coordinator software; Use the ZigBee coordinator software to check the network status.

5. The ZigBee-based intelligent security warning system as claimed in claim 4, Features: The specific steps of configuring the threshold and trigger conditions of the sensor are as follows: Select the integrated unit of TI CC2530 chip equipped with DS18B20 temperature, humidity, light, motion and gas sensors; Set corresponding thresholds for each type of sensor based on specific monitoring objectives and application scenarios; Use the configuration function in the ZigBee coordinator software to send configuration commands to the sensor nodes through the ZigBee protocol stack; Use the test function in the ZigBee coordinator software to simulate different ambient temperatures and verify that the sensor node behavior meets the expected threshold trigger conditions; If the test results do not meet expectations, fine-tune the thresholds and trigger conditions, and continue to iterate the testing and adjustment process until the expected performance level is achieved.

6. The ZigBee-based intelligent security warning system as claimed in claim 5, Features: The method uses sensors to collect network load and node distance data, and automatically adjusts the transmission power through a deep reinforcement learning algorithm training model. The specific steps are: Deploy sensor nodes in the ZigBee network, and each node is equipped with a dedicated network load sensor; Use ZigBee coordinator software to record network load data for each node; The RSSI method is used to measure the distance between nodes; Define the state space S, where each state s∈S consists of the network load L and the distance between nodes D, that is, ; The action space A is defined as the adjustment range of the transmit power, which is expressed as: ; ; in, represents the adjustment amplitude of the i-th transmission power, is an integer index; Defining the reward function , evaluate the action In Status The effect is as follows: ; in, is the attenuation coefficient of the network load, is the quadratic coefficient of the distance, is the action cost coefficient, is the amplitude coefficient, is the frequency coefficient of the sine function; Select the DQN algorithm as the basic algorithm and improve it to adapt to specific network environments and requirements; Design a multi-layer neural network, where the input layer receives the state s and the output layer predicts the Q value corresponding to each action a; Use the experience replay mechanism to store and replay experiences to reduce the correlation between data, and periodically update the target Q value through the target network; Use the gradient descent method to minimize the loss function, the loss function Defined as: ; in, represents the expected value operator, For all possible actions The operation of taking the maximum value, Indicates the current state. Indicates the next state, Indicates in status The transmit power adjustment range under represents the parameters of the target network, Represents the parameters of the current network; when When , it is an ideal situation, indicating the action taken In Status It is beneficial to reduce network load, shorten the distance between nodes, and the transmission power adjustment is small; when When , it is a normal situation, indicating that the current action maintains the network efficiency at a stable level, without significantly reducing the network load and the distance between nodes, nor increasing the transmission power adjustment too much; when When , it is a non-ideal situation, indicating the action taken In Status It is not conducive to reducing the network load and shortening the distance between nodes, and the transmission power adjustment is large.

7. The ZigBee-based intelligent security warning system as claimed in claim 6, Features: While the sensor collects data on changes in the external environment in real time, the initial alarm threshold is automatically adjusted through the context awareness mechanism. The specific steps are: Define a series of situational variable expressions as follows: ; ; in, Represents a specific situation. is the index of the context variable; The context weight matrix is ​​introduced to quantify the importance of the context: ; in, Represents situational variables the importance of According to the current situation variables Calculate the situational awareness factor , the expression is: ; Among them, δ is the sensitivity coefficient, Situational variables The average value of Context-aware factor , alarm threshold The expression is: ; in, is the initial alarm threshold, is the threshold adjustment coefficient, is the average situational awareness factor, is the maximum situational awareness factor, is the minimum situational awareness factor, is the nonlinear coefficient; when When , it indicates that the current situation leads to a higher alarm threshold, that is, the system becomes more tolerant and reduces the possibility of false alarms; when When , it indicates that the current situation leads to a lower alarm threshold, that is, the system becomes more sensitive, improving the timeliness of the alarm; when , it indicates that the current situation is at the average level and the alarm threshold remains unchanged.

8. The ZigBee-based intelligent security warning system as claimed in claim 7, Features: The sensor data is aggregated to the central controller and connected to the cloud service platform. The specific steps are: Start the Node-RED receive data application in the ZigBee coordinator software and add the ZigBee input node; Configure the ZigBee input node connection port and set the communication parameters; Drag and drop the ZigBee input node onto the Node-RED editor canvas and add function nodes to process the received data. Add a debug node to view the received data, connect the nodes, and deploy the Node-RED instance; Log in to the Alibaba Cloud IoT platform and register the Raspberry Pi 4 Model B as the central controller device in the device management; In the Node-RED editor, use the device's Access Key ID, Access Key Secret, and Product Key to configure the MQTT output node and connect to the Alibaba Cloud IoT platform. Set the Topic format and connect the ZigBee input node, function node, and MQTT output node.

9. The ZigBee-based intelligent security warning system as claimed in claim 8, Features: The specific steps for setting personalized alerts and user permissions are as follows: Use the conditional node in Node-RED to determine whether the data meets the alarm condition; When the conditions are met, use the function node to construct an alarm message and send the alarm message to the Alibaba Cloud IoT platform through the MQTT node; Create different user roles on the Alibaba Cloud IoT platform and assign corresponding permissions to each role; Use the authentication service provided by Alibaba Cloud IoT platform to implement user login and add an authentication node in Node-RED; Use a web framework to build a user interface that allows users to view real-time data, history, and alarm information; Displays different information and operation options based on the user's role and permissions.

10. The ZigBee-based intelligent security warning system as claimed in claim 9, Features: The specific steps of sending a notification to a user via a mobile application are as follows: Use the Isolation Forest anomaly detection model to train anomaly detection logic and adjust alert thresholds based on context-aware factors; Process sensor data in real time through Apache Kafka and apply anomaly detection models; Define trigger conditions based on anomaly detection model output; When an anomaly is detected, an alarm is triggered and an alarm message is sent through the cloud service platform; Use React Native to develop mobile applications and integrate push service SDK; Send personalized notifications via mobile apps based on user roles and permissions and set up user permissions.