Home safety control method and system based on big data analysis
Through the home security control method based on big data analysis, multi-source sensor data and intelligent algorithms are used to calculate dynamic risk indexes and send safety control instructions, the problem that existing systems cannot fully monitor security risks in complex environments is solved, and efficient and accurate security risk identification and response are achieved.
Patent Information
- Application Number
- CN202510389614.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2045-03-31
AI Technical Summary
The existing home safety control system has limitations in data processing and cannot fully monitor potential security risks. Especially in complex dynamic environments, the lack of intelligent decision-making support leads to misjudgment or missed judgments, and poor security.
The home safety control method based on big data analysis is adopted, and by obtaining multi-source sensor data, pre-processing and feature extraction are performed, combined with isolated forest algorithms, autoencoder models and weighted fusion technology, dynamic risk index is calculated, and corresponding safety control instructions are sent.
It realizes automated monitoring and real-time response of home safety, can efficiently and accurately identify potential safety risks, improves the intelligence level of safety management, and enhances the home security and emergency response capabilities.
Smart Images

Figure CN119902451A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of home security control technology, and in particular to a home security control method and system based on big data analysis. Background Art
[0002] With the continuous development of society and the improvement of people's living standards, the safety of home environment has become more and more important. Home safety not only includes traditional safety issues such as anti-theft and fire prevention, but also covers a variety of factors such as electrical failure, gas leakage, and air quality monitoring. Due to the complexity and diversity of the living environment, the design of home safety control systems is increasingly inclined to intelligence and automation to improve response speed and accuracy, reduce manual intervention, and improve system reliability and safety.
[0003] At present, common home security control systems have limitations in data processing. Most of them rely on single sensor data for judgment and cannot fully monitor potential security risks. Especially in the face of complex dynamic environments (such as environmental changes or the interweaving of multiple dangerous factors), multi-dimensional collaborative monitoring cannot be achieved. At the same time, there is a lack of intelligent decision-making support, which leads to misjudgment or missed judgment in some emergencies, and poor security. Summary of the invention
[0004] In order to provide a more efficient and safer home environment protection, the present application provides a home security control method and system based on big data analysis.
[0005] In the first aspect, the present application provides a home security control method based on big data analysis, which adopts the following technical solutions: A home security control method based on big data analysis, the control method comprising: Obtaining the original sensor data stream in the home environment; wherein the original sensor data stream includes real-time temperature data, smoke concentration data, real-time current data and door and window status; Preprocessing the raw sensor data stream to obtain a synchronization calibration matrix; Calculate the temperature change rate, smoke concentration accumulation, current harmonic components and temperature-current correlation coefficient according to the synchronous calibration matrix to obtain a characteristic matrix; Performing anomaly detection on the temperature change rate by using an isolation forest algorithm and outputting a temperature isolation score; Based on a preset smoke risk mapping relationship, a smoke risk coefficient is calculated according to the accumulated smoke concentration; Reconstructing the current harmonic components through an autoencoder model and calculating a current reconstruction error; Based on a preset environmental risk mapping relationship, determining an environmental risk coefficient according to the state of the door and window; The temperature isolation score, smoke risk coefficient, current reconstruction error and environmental risk coefficient are weighted and integrated to calculate a dynamic risk index; Send corresponding security control instructions according to the dynamic risk index.
[0006] By adopting the above technical solutions, through real-time collection, preprocessing and analysis of multi-source data, combined with multi-dimensional feature extraction, dynamic risk calculation, intelligent decision-making control and other methods, the automatic monitoring and real-time response of home safety is realized. Through the application of big data analysis and intelligent algorithms, potential safety risks can be identified efficiently and accurately, and control strategies can be adjusted according to real-time data to ensure that the home safety system can make reasonable responses according to real-time risks and protect users from risks such as fire or electrical failure.
[0007] Optionally, the step of preprocessing the original sensor data stream to obtain a synchronous calibration matrix includes: Performing time stamp alignment on the raw sensor data stream to obtain synchronously calibrated real-time temperature data, smoke concentration data, and real-time current data; A temperature compensation function is established based on a thermodynamic diffusion model, and environmental compensation is performed on the real-time temperature data after synchronous calibration; The dynamic baseline is calculated based on the sliding window moving average method, and the baseline drift correction is performed on the smoke concentration data after synchronous calibration; Adaptively filter the real-time current data after synchronization calibration based on wavelet transform; Combined with the ordered discrete codes corresponding to the door and window states, a synchronous calibration matrix is constructed.
[0008] By adopting the above technical solutions, efficient preprocessing of multi-source sensor data is achieved. By using wavelet transform and Fourier transform to extract key signal features, combined with advanced compensation and filtering technology, the noise interference, environmental change impact and baseline drift of the data are solved. Finally, through multimodal data fusion and ring buffer storage structure, an efficient, stable and continuous data matrix is provided, laying a solid foundation for subsequent intelligent analysis and decision-making control.
[0009] Optionally, the step of performing anomaly detection on the temperature change rate by using an isolation forest algorithm and outputting a temperature isolation score includes: Standardizing the temperature change rate to obtain a standardized temperature change rate sequence; Cache the data in a preset historical period in the standardized temperature change rate sequence as a training set; Dynamically configure the number of trees according to the training set, construct an isolated tree set with a maximum depth, randomly select features and segmentation values at each segmentation, recursively segment the data until a single sample is isolated or the depth limit is reached, and obtain an isolation forest model; Based on the isolation forest model, the average path length of the real-time data in the standardized temperature change rate sequence in each tree is calculated, a preset weighting coefficient is determined according to the real-time temperature data, and a temperature isolation score is calculated.
[0010] By adopting the above technical solution, the temperature change rate is detected based on the isolation forest algorithm, the path length of multiple trees is used to evaluate the abnormality of the data, and the detection accuracy is improved by adjusting the dynamic weighting coefficient. Through the steps of standardizing the temperature change rate, dynamically training the isolation forest model, and calculating the anomaly score in real time, this technical solution can effectively identify temperature changes caused by emergencies such as fire and equipment failure, and provide accurate abnormal warning capabilities for home security systems.
[0011] Optionally, the method further includes a training step of the autoencoder model, wherein the training step includes: Collecting historical sample data; wherein the historical sample data includes current harmonic component data under historical normal operating conditions; Preprocessing the historical sample data and dividing it into training samples and reserved samples; Training a pre-built stacked convolutional autoencoder based on the training samples, optimizing model parameters, and obtaining the autoencoder model; The autoencoder model is tested and model parameters are corrected based on the reserved samples until the loss function of the model meets a preset condition or the number of model iterations reaches a preset number, thereby obtaining the trained autoencoder model.
[0012] By adopting the above technical solution, the current harmonic components are efficiently learned and reconstructed based on the stacked convolutional autoencoder (SCAE), which can accurately capture the normal mode in the current signal. Through standardization, division of training and reserved samples, multiple rounds of model training and correction, an autoencoder model with excellent performance is finally obtained. This model can accurately calculate the reconstruction error as the basis for electrical fault detection, has efficient and stable fault identification capabilities, and can adapt to changes in different equipment.
[0013] Optionally, the step of weighting and fusing the temperature isolation score, smoke risk coefficient, current reconstruction error and environmental risk coefficient to calculate a dynamic risk index includes: Receive basic weight configuration input by the user; Determine the corresponding current risk mode according to the temperature-current correlation coefficient in the characteristic matrix; Optimizing and adjusting the basic weight configuration according to the current risk model to obtain an optimized weight configuration; According to the optimized weight configuration, the temperature isolation score, smoke risk coefficient, current reconstruction error and environmental risk coefficient are combined for weighted fusion to calculate the corresponding dynamic risk index.
[0014] By adopting the above technical solution and combining it with the dynamic correlation analysis of temperature and current, the weight of each feature can be adjusted in real time, and the dynamic risk index can be accurately calculated. This technical solution has strong adaptability and can cope with different risk modes (such as electrical overload and environmental fire), improves the accuracy and response speed of risk judgment, and can adapt to complex and changing home safety scenarios.
[0015] Optionally, the step of sending a corresponding security control instruction according to the dynamic risk index includes: Determining a corresponding dynamic risk level according to the dynamic risk index; Based on a preset strategy mapping table, determining a corresponding security control strategy according to the dynamic risk level; Generate corresponding security control instructions according to the security control strategy and send them to the home control terminal.
[0016] By adopting the above technical solution, the dynamic risk index is combined with the risk level, and the corresponding safety control strategy is selected according to different risk levels, and then the safety control instructions are generated and automatically executed. This technical solution has a high degree of automation and real-time response capabilities, and can flexibly respond to different safety risk scenarios, such as emergency situations such as electrical overload or fire. Through the preset strategy mapping table, the system can accurately judge and take corresponding measures to ensure the safety of the home environment under different risk situations, and optimize the response speed and accuracy of safety management.
[0017] In a second aspect, the present application provides a home security control system based on big data analysis, which adopts the following technical solutions: A home security control system based on big data analysis, the control method comprising: A data acquisition module is used to acquire the original sensor data stream in the home environment; wherein the original sensor data stream includes real-time temperature data, smoke concentration data, real-time current data and door and window status; A data preprocessing module, used for preprocessing the raw sensor data stream to obtain a synchronous calibration matrix; A characteristic matrix generation module is used to calculate the temperature change rate, the smoke concentration accumulation, the current harmonic component and the temperature-current correlation coefficient according to the synchronous calibration matrix to obtain a characteristic matrix; A temperature isolation module, used to detect anomalies of the temperature change rate by using an isolation forest algorithm and output a temperature isolation score; A smoke risk calculation module, used to calculate a smoke risk coefficient according to the accumulated smoke concentration based on a preset smoke risk mapping relationship; A current reconstruction module, used to reconstruct the current harmonic components through an autoencoder model and calculate a current reconstruction error; An environmental risk determination module, used to determine an environmental risk coefficient according to the state of the door and window based on a preset environmental risk mapping relationship; A dynamic risk assessment module, used for weighted fusion of the temperature isolation score, smoke risk coefficient, current reconstruction error and environmental risk coefficient to calculate a dynamic risk index; The security control module is used to send corresponding security control instructions according to the dynamic risk index.
[0018] Optionally, the data preprocessing module includes: A synchronous calibration module, used for aligning the timestamps of the original sensor data stream to obtain real-time temperature data, smoke concentration data and real-time current data after synchronous calibration; Environmental compensation module, used to establish temperature compensation function based on thermodynamic diffusion model and perform environmental compensation on real-time temperature data after synchronous calibration; A baseline drift correction module is used to calculate the dynamic baseline based on the sliding window moving average method and perform baseline drift correction on the smoke concentration data after synchronous calibration; A filtering module, used for adaptively filtering the real-time current data after synchronization calibration based on wavelet transform; The calibration matrix construction module is used to construct a synchronous calibration matrix in combination with the ordered discrete codes corresponding to the door and window states.
[0019] In a third aspect, the present application provides a computer device, which adopts the following technical solution: A computer device comprises a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method as described in the first aspect.
[0020] In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution: A computer-readable storage medium stores a computer program that can be loaded by a processor and execute any one of the methods in the first aspect.
[0021] To summarize, the present application includes at least one of the following beneficial technical effects: by accurately identifying potential risks, such as fire, electrical overload, etc., and taking timely safety measures based on real-time risk assessment, automated and intelligent home safety control is achieved, which greatly improves the intelligence level of home safety management, and has significant practical significance and application value, especially in improving family safety and emergency response capabilities. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 This is a first flow chart of a home security control method based on big data analysis in one of the embodiments of the present application.
[0023] Figure 2 This is a second flow chart of a home security control method based on big data analysis in one of the embodiments of the present application.
[0024] Figure 3 This is a third flow chart of a home security control method based on big data analysis in one of the embodiments of the present application.
[0025] Figure 4 This is a fourth process diagram of a home security control method based on big data analysis in one of the embodiments of the present application.
[0026] Figure 5 This is a fifth flow chart of a home security control method based on big data analysis in one of the embodiments of the present application.
[0027] Figure 6 This is the sixth flow chart of a home security control method based on big data analysis in one of the embodiments of the present application. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solutions and advantages of this application more clear, the following Figure 1-6 It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0029] The embodiment of the present application discloses a home security control method based on big data analysis.
[0030] Reference Figure 1 , a home security control method based on big data analysis, the control method comprising: Step S101, obtaining the original sensor data stream in the home environment; Among them, the original sensor data stream includes real-time temperature data, smoke concentration data, real-time current data and door and window status; Specifically, a variety of sensor devices are pre-deployed in the home environment. These sensors constitute the perception basis of the home security system. Environmental data is mainly monitored through sensors installed in high-risk areas such as kitchens and living rooms, ensuring real-time acquisition of multi-dimensional data in the home environment, and providing complete and comprehensive original data support for subsequent analysis.
[0031] Exemplarily, the core sensors include: temperature sensors (deployed in high-risk fire areas such as kitchens and living rooms), smoke concentration sensors (used to detect PM2.5 and CO concentrations), current monitors (used to monitor the real-time current of high-power electrical appliances), door and window opening and closing status sensors (used to detect the status of doors and windows), etc.
[0032] Step S102, preprocessing the original sensor data stream to obtain a synchronization calibration matrix; Among them, since the data of different sensors may have timing deviations, the network time protocol (NTP) can be used to calibrate the clocks of each sensor to ensure the time synchronization of all sensor data. At the same time, environmental compensation is performed on the temperature sensor, baseline drift correction is performed on the smoke sensor data, and the sliding window moving average method is used to filter out instantaneous noise. Through the timing calibration and noise processing of the data, high-quality synchronous data is obtained, providing accurate basic data for subsequent analysis.
[0033] Step S103, calculating the temperature change rate, smoke concentration accumulation, current harmonic components and temperature-current correlation coefficient according to the synchronous calibration matrix to obtain a characteristic matrix; Among them, multi-dimensional features are extracted from the synchronously calibrated data matrix, such as the temperature change rate, the accumulation of smoke concentration, the harmonic components of the current, and the Pearson correlation coefficient between temperature and current. These features help to identify potential fires or other dangerous conditions.
[0034] In some embodiments, the temperature change rate can be obtained by calculating the temperature difference between the current and previous 60 seconds; the accumulated smoke concentration within 5 minutes can be used to determine the persistence of the smoke concentration; the harmonic components of the current can be extracted through Fourier transform to identify whether there is an overload phenomenon; the correlation between temperature and current helps to determine whether there is a risk of equipment failure or electrical fire, and can be used for subsequent weight adjustment.
[0035] Step S104, performing anomaly detection on the temperature change rate by using an isolation forest algorithm, and outputting a temperature isolation score; The temperature isolation score is generated by the temperature change rate anomaly detection of the isolation forest algorithm, which is essentially an abnormal quantitative indicator of real-time temperature data. The isolation forest algorithm is a tree-based outlier detection method that can identify abnormal data in the temperature change rate by building multiple trees. Abnormal temperature change rates may be an indication of fire or equipment failure.
[0036] It should be noted that if the temperature change rate suddenly exceeds the set threshold, the temperature isolation score output by the algorithm is high, indicating that the data may be abnormal and requires further inspection or response.
[0037] Step S105, based on the preset smoke risk mapping relationship, the smoke risk coefficient is calculated according to the smoke concentration accumulation; The accumulated smoke concentration is calculated by detecting the change in smoke concentration per unit time. When the accumulated smoke concentration exceeds a certain threshold, the system determines it as a high smoke risk. By effectively distinguishing the risk levels of different smoke concentrations, the system can provide accurate decision-making basis.
[0038] Exemplarily, the preset smoke risk mapping relationship can be configured and adjusted in advance. For example, if the smoke concentration exceeds 200 mg·min / m³, the smoke risk coefficient can be set to 1.0, indicating high risk; if it is between 50 and 200 mg·min / m³, the risk coefficient is set to 0.5; and below 50 indicates low risk.
[0039] Step S106, reconstructing the current harmonic components through the autoencoder model and calculating the current reconstruction error; Among them, the reconstruction error is used to reflect the degree of abnormality of the current waveform, which is essentially the quantification of the characteristic deviation of the current data. The autoencoder model is used to learn the normal mode of the current harmonic components and evaluate the abnormality of the current waveform by calculating the reconstruction error between the actual input and the model output. If the reconstruction error is large, it indicates that the current waveform is abnormal, which may involve potential risks of electrical failure or electrical fire. For example, during the operation of the appliance, if the proportion of harmonic components suddenly exceeds 15%, the reconstruction error increases, and the system will be marked as overloaded.
[0040] Step S107, determining the environmental risk coefficient according to the state of the door and window based on the preset environmental risk mapping relationship; Among them, the state of doors and windows directly affects the ventilation and smoke diffusion of the home environment. If the doors and windows are closed, the risk of fire is low; if the doors and windows are open, the smoke may spread rapidly and the risk is high, so the environmental risk factor needs to be adjusted dynamically.
[0041] Exemplarily, the preset environmental risk mapping relationship can be pre-configured and adjusted according to actual conditions; for example, if the doors and windows are in a closed state, the environmental risk coefficient can be set to 1.0; if the doors and windows are partially open, the risk coefficient can be set to 0.6; if the doors and windows are fully open, the risk coefficient can be set to 0.3.
[0042] Step S108, weighted fusion of the temperature isolation score, smoke risk coefficient, current reconstruction error and environmental risk coefficient to calculate a dynamic risk index; Among them, the safety risk of the home environment is comprehensively evaluated by weighted fusion of multiple features. Different features are given different weights according to their importance in specific scenarios, and finally a dynamic risk index is generated to reflect the real-time home safety risk, which helps to make timely control decisions.
[0043] Step S109: sending corresponding security control instructions according to the dynamic risk index.
[0044] Among them, according to the calculated dynamic risk index, the system sends corresponding safety control instructions through the preset strategy configuration. For example, if the risk index reaches a high risk value, the system may take measures such as cutting off the circuit, starting the exhaust, and sounding and visual alarms; if the risk is low, the system will make slight adjustments and only reduce the power of the electrical appliances.
[0045] In the above implementation, after real-time collection, preprocessing and analysis of multi-source data, combined with multi-dimensional feature extraction, dynamic risk calculation, intelligent decision-making control and other methods, automatic monitoring and real-time response of home safety are realized. Through the application of big data analysis and intelligent algorithms, potential safety risks can be identified efficiently and accurately, and control strategies can be adjusted according to real-time data to ensure that the home safety system can make reasonable responses according to real-time risks and protect users from risks such as fire or electrical failure.
[0046] Reference Figure 2 As an implementation of step S102, the step of preprocessing the original sensor data stream to obtain a synchronous calibration matrix includes: Step S201, aligning the timestamps of the original sensor data stream to obtain real-time temperature data, smoke concentration data and real-time current data after synchronization calibration; The original sensor data stream may come from different sensors, and the clocks of these sensors may be out of sync. To ensure the timing consistency of the data, the clocks of each sensor are first calibrated through the Network Time Protocol (NTP) to ensure that the timestamps of all data are consistent. Secondly, for low sampling rate data, the cubic spline interpolation method is used to supplement the data so that the sampling frequency meets the uniform requirements; for high sampling rate data, the method of downsampling to retain the peak and valley value characteristics is used to reduce the amount of data while maintaining the main characteristics of the current waveform.
[0047] For example, if the temperature sensor data is sampled once per minute and the current sensor data is sampled once per second, the cubic spline interpolation method will supplement the real-time temperature data to once per second to ensure that the data timestamps of the two are aligned.
[0048] Step S202, establishing a temperature compensation function based on a thermodynamic diffusion model, and performing environmental compensation on the real-time temperature data after synchronous calibration; Among them, the temperature sensor is affected by the local environment (such as heat source, airflow, etc.), which may cause data deviation. By establishing a temperature compensation function based on the thermodynamic diffusion model and combining the data of neighboring sensors, the real-time temperature data is environmentally compensated. The compensated real-time temperature data is further smoothed by the Kalman filter to avoid inaccurate results caused by sudden data fluctuations.
[0049] For example, assuming that the temperature sensor is affected by the heat source and causes the reading to be high, the compensation value of the adjacent sensor can be calculated using the thermodynamic diffusion model, and then the compensated data can be smoothed using the Kalman filter to ensure that the real-time temperature data is more stable and reliable.
[0050] Step S203, calculating the dynamic baseline based on the sliding window moving average method, and performing baseline drift correction on the smoke concentration data after synchronous calibration; The smoke sensor may cause baseline drift due to long-term use, environmental changes, and other factors, resulting in data deviation. The dynamic baseline is calculated by the sliding window moving average method to correct the drift in the smoke concentration data. This method can adjust the baseline value in real time to ensure the stability and accuracy of the measurement results. For example, if the reading of a smoke sensor gradually increases due to environmental changes, the moving average can be calculated through a sliding window (for example, every 2 hours), and the concentration value can be corrected after adjusting the baseline.
[0051] Step S204, performing adaptive filtering on the real-time current data after synchronization calibration based on wavelet transform; Among them, current data is often affected by high-frequency noise, which may lead to inaccurate data. Through wavelet transform, Daubechies 4 wavelet is used to separate high-frequency noise and fundamental components, and adaptive filtering is performed on the noise in the current waveform to further improve data quality. In addition, fast Fourier transform (FFT) is used to extract the fundamental and harmonic components of the current signal for monitoring the working status of electrical equipment. If the harmonic component accounts for more than 15%, it is marked as an overload state. For example, for the current waveform of an electrical appliance, after removing high-frequency noise through wavelet transform, FFT is used to calculate the 50Hz fundamental and the third harmonic of 150Hz. If the amplitude of the 150Hz harmonic exceeds 15% of the 50Hz fundamental, the current signal at this time will be marked as a potential overload.
[0052] Step S205 , combining the ordered discrete codes corresponding to the door and window states to construct a synchronous calibration matrix.
[0053] Among them, the door and window status data are encoded as 0 (corresponding to the door and window closed state), 0.5 (corresponding to the door and window partially open state), and 1 (corresponding to the door and window fully open state), and aligned with other sensor data by timestamp to generate a data matrix.
[0054] Specifically, different types of sensors (such as temperature, smoke, current, and door and window status) provide data of different dimensions, which are integrated for better comprehensive analysis. By encoding the door and window status as an ordered discrete code, all data are aligned according to timestamps, encapsulated into a multidimensional data matrix, and stored as a ring buffer structure to ensure data continuity and real-time performance.
[0055] In the above implementation, efficient preprocessing of multi-source sensor data is achieved. By using wavelet transform and Fourier transform to extract key signal features, and combining advanced compensation and filtering technologies, the noise interference, environmental change impact and baseline drift problems of data are solved. Finally, through multimodal data fusion and ring buffer storage structure, an efficient, stable and continuous data matrix is provided, laying a solid foundation for subsequent intelligent analysis and decision-making control.
[0056] Reference Figure 3 As an implementation of step S104, the step of performing abnormal detection on the temperature change rate by using the isolation forest algorithm and outputting the temperature isolation score includes: Step S301, normalizing the temperature change rate to obtain a standardized temperature change rate sequence; The temperature change rate reflects how fast the temperature changes over time. Since temperature data is usually affected by factors such as different equipment, environment, and sensor accuracy, the scale of the data may vary greatly. Therefore, the Z-score standardization method is used to standardize the temperature change rate so that its mean is 0 and its standard deviation is 1, thereby eliminating the scale differences of the data and allowing all types of data to be compared under the same standard.
[0057] Step S302, caching data in a preset historical period in the standardized temperature change rate sequence as a training set; Among them, in order to establish an accurate isolation forest model, a large amount of data is required for training. This step provides a reliable training set for training the isolation forest model by caching the standardized temperature change rate data within a certain period of time (for example, the data in the last hour). This historical data set can capture the normal range of temperature change rate, thereby helping to detect abnormal behavior. For example, if the standardized data of the temperature change rate series is [0.8, 1.2, -0.4, ..., 1.0], then by caching the most recent 3600 data points (1 hour of data), a training set is formed.
[0058] Step S303, dynamically configuring the number of trees according to the training set, constructing an isolated tree set with the maximum depth, randomly selecting features and segmentation values each time, recursively segmenting the data until a single sample is isolated or the depth limit is reached, and obtaining an isolation forest model; Among them, the isolation forest algorithm is an anomaly detection method based on a tree structure. Each tree recursively splits the data until each data point is isolated. In this step, the number of trees and the maximum depth of each tree are dynamically configured according to the size of the training set. The number and depth of trees are key parameters of the isolation forest. The number of trees is adjusted according to the data density to improve the effect of anomaly detection. The segmentation of each tree is random, that is, the features (temperature change rate in this technical solution) and segmentation points are randomly selected at each segmentation.
[0059] For example, if the training set D_train has 3600 data points, according to the formula n_trees=⌈100⋅(1−e^(-0.002⋅|D_train|))⌉, 100 trees may be obtained. In the construction of each tree, the temperature change rate is randomly selected for splitting, recursively dividing the data into smaller subsets until all samples are isolated.
[0060] It can be understood that by dynamically configuring the number and depth of trees, the isolation forest can automatically optimize parameters according to the density of data, thereby improving the accuracy of the model in detecting temperature anomalies.
[0061] Step S304, based on the isolation forest model, calculate the average path length of the real-time data in the standardized temperature change rate sequence in each tree, determine the preset weighting coefficient according to the real-time temperature data, and calculate the temperature isolation score.
[0062] The path length of each data point in the isolation forest is an important indicator to measure its abnormality. The shorter the path length, the faster the data point is isolated and the greater the possibility of being an abnormal point. By calculating the path length for each tree and averaging it, the degree of abnormality of the data point in the entire forest can be obtained. This process helps to capture sudden changes in the rate of temperature change and further determine whether it is abnormal.
[0063] For example, assuming that the real-time temperature change rate is 1°C / s, after passing through all the trees in the isolated forest, the path length of each tree is calculated. If the path lengths are [3, 4, 2, 5, 3], the average path length of the data point is 3.4. By calculating the path lengths of multiple trees, the reliability of anomaly detection can be improved, allowing the system to more accurately identify temperature changes caused by fire or equipment failure.
[0064] To further enhance the accuracy of the model, the weighting coefficient of the anomaly score is dynamically adjusted according to the absolute value of the temperature in the real-time temperature data. When the temperature value is higher, there may be a stronger abnormal signal, so the isolated score is adjusted by the weighting coefficient (for example, when the temperature exceeds 50°C, the coefficient is 1.2, otherwise it is 1.0) to ensure that important temperature changes can be detected more accurately.
[0065] For example, if the real-time temperature is 60°C, the weighting factor of the temperature isolation score will be set to 1.2 according to the preset rule. If the average path length of the real-time data is calculated to be 0.4, then multiply it by 1.2 to get the final temperature isolation score.
[0066] In the above implementation, the temperature change rate is detected based on the isolation forest algorithm, the path length of multiple trees is used to evaluate the abnormality of the data, and the detection accuracy is improved by adjusting the dynamic weighting coefficient. Through the steps of standardizing the temperature change rate, dynamically training the isolation forest model, and calculating the anomaly score in real time, this technical solution can effectively identify the temperature changes caused by emergencies such as fire and equipment failure, and provide accurate abnormal warning capabilities for the home security system.
[0067] Reference Figure 4 As an implementation of the autoencoder model, the training steps of the autoencoder model include: Step S401, collecting historical sample data; Among them, the historical sample data includes the current harmonic component data under historical normal working conditions; Specifically, the current harmonic component data under normal working conditions reflects the current harmonic characteristics of the equipment during normal operation, and serves as the benchmark data for the subsequent training of the stacked convolutional autoencoder model. The quality and diversity of historical sample data directly affect the effectiveness of model training. For example, the current harmonic component data of common household appliances such as water heaters and air conditioners during normal operation can be collected. These data may include the proportion of fundamental wave, third harmonic and fifth harmonic, as well as other relevant information.
[0068] Step S402, preprocessing the historical sample data and dividing it into training samples and reserved samples; In order to ensure the effectiveness of model training, the historical sample data is first preprocessed, including denoising, standardization and other operations, and then the data is divided into training samples and reserved samples. The training samples are used for model training, and the reserved samples are used for model verification and calibration to ensure the generalization ability of the model and avoid overfitting.
[0069] Exemplarily, the current harmonic data is Z-score standardized to ensure that different harmonic components have the same scale. At the same time, the data is time-series cut using a 10-second window and divided into multiple training samples (for example, divided by device type) and reserved samples. Preprocessing and data partitioning ensure the stability and accuracy of the model during training and testing, and eliminate possible noise and deviation in the data through standardization operations, ensuring the effectiveness of the training process.
[0070] Step S403, training the pre-built stacked convolutional autoencoder based on the training samples, optimizing the model parameters, and obtaining the autoencoder model; Specifically, the pre-built stacked convolutional autoencoder (SCAE) is used to optimize the model parameters according to the training samples. The autoencoder automatically extracts features from the input data through convolution operations and reconstructs the data. During the training process, the reconstruction error is used as the loss function, and the model parameters are optimized through the back propagation algorithm to improve the model's ability to learn and reconstruct the current harmonic components. For example, the model can be trained using the normal operating data of air-conditioning equipment. The model learns the characteristics of harmonics of different orders through the convolution layer, and gradually optimizes the model parameters to reduce the reconstruction error.
[0071] It can be understood that through the training of the convolutional autoencoder, the model can effectively learn the normal pattern of the current harmonic components and provide high-precision reconstruction error calculation for subsequent electrical fault detection.
[0072] Step S404, testing the autoencoder model and calibrating model parameters based on the reserved samples until the loss function of the model meets the preset conditions or the number of model iterations reaches the preset number, thereby obtaining a trained autoencoder model.
[0073] Specifically, during the training process, the model is verified and tested using reserved samples. The generalization ability of the model is evaluated by calculating the reconstruction error of the verification set, and the model parameters are adjusted according to the performance of the loss function until the preset conditions are met or the set maximum number of iterations is reached. This process can effectively prevent overfitting and optimize the performance of the model.
[0074] For example, in the later stage of training, the model reconstruction error is tested with reserved samples, and the model learning rate, number of training rounds and other parameters are adjusted according to the error trend to ensure that the final model can accurately process the current harmonic data. Through testing and correction, the model can be adjusted and optimized according to the actual data to ensure that it has strong generalization ability and low error, thereby improving the accuracy and robustness of electrical fault detection.
[0075] In the above implementation, the current harmonic components are efficiently learned and reconstructed based on the stacked convolutional autoencoder (SCAE), which can accurately capture the normal mode in the current signal. Through standardization, division of training and reserved samples, and multiple rounds of model training and correction, an autoencoder model with excellent performance is finally obtained. This model can accurately calculate the reconstruction error as the basis for electrical fault detection, has efficient and stable fault identification capabilities, and can adapt to changes in different equipment.
[0076] Reference Figure 5 As an implementation method of step 108, the step of weighting and fusing the temperature isolation score, the smoke risk coefficient, the current reconstruction error and the environmental risk coefficient to calculate the dynamic risk index includes: Step S501, receiving a basic weight configuration input by a user; Among them, the user inputs the initial configuration of feature weights according to the system requirements. This basic weight configuration reflects the initial importance of each input feature in the dynamic risk assessment, and the basic weight configuration provides a starting point for subsequent dynamic adjustments.
[0077] For example, the user may set initial weights according to actual conditions, for example, the weight of the current reconstruction error is 0.3, the weight of the smoke risk coefficient is 0.2, etc. These weights will reflect the importance of each feature in the initial calculation of the dynamic risk index.
[0078] Step S502, determining the corresponding current risk mode according to the temperature-current correlation coefficient in the characteristic matrix; Among them, the system determines the current dominant risk mode based on the correlation coefficient between temperature and current. By calculating the correlation coefficient between temperature and current signals, the system can capture in real time whether there is an electrical overload mode or an environmental fire mode. This judgment is based on dynamically changing temperature and current data in order to adjust the risk mode in real time.
[0079] For example, when the system is running, the temperature time series data and the current harmonic data will be calculated with a correlation coefficient. For example, if the calculated correlation coefficient is higher than 0.7, the system will determine that it is in electrical overload mode; if the correlation coefficient is lower than 0.7 and lasts for 5 minutes, it will switch to ambient fire mode.
[0080] Step S503, optimizing and adjusting the basic weight configuration according to the current risk model to obtain an optimized weight configuration; Among them, once the current risk mode (electrical overload or environmental fire) is determined, the system will optimize and adjust the basic weight configuration according to this mode. Different risk modes focus on different features, so the weight value of each feature needs to be adjusted. For example, in the electrical overload mode, the current reconstruction error may require a higher weight, while in the environmental fire mode, the smoke risk factor may have a larger weight.
[0081] For example, when the system detects an electrical overload mode, the weight of the current reconstruction error may be increased from 0.3 of the basic configuration to 0.5, and the weight of the smoke risk factor may be reduced to 0.1; in the ambient fire mode, the weight of the smoke risk factor may be increased to 0.4, and the weight of the current reconstruction error may be reduced.
[0082] Step S504, according to the optimized weight configuration, the temperature isolation score, the smoke risk coefficient, the current reconstruction error and the environmental risk coefficient are weighted and integrated to calculate the corresponding dynamic risk index.
[0083] Among them, using the optimized weight configuration, the system weightedly integrates each feature to obtain the final dynamic risk index. Each feature (such as temperature isolation score, smoke risk coefficient, etc.) is weighted according to its weight in the current risk mode to generate a comprehensive risk index.
[0084] For example, assuming that the current risk mode is electrical overload, the optimized weight configuration is: [0.2, 0.15, 0.5, 0.15], which corresponds to the temperature isolation score, smoke risk coefficient, current reconstruction error and environmental risk coefficient respectively. The system will calculate the dynamic risk index based on these weights.
[0085] In the above implementation, combined with the dynamic correlation analysis of temperature and current, the weight of each feature can be adjusted in real time, and the dynamic risk index can be accurately calculated. This technical solution has strong adaptability and can cope with different risk modes (such as electrical overload and environmental fire), improves the accuracy and response speed of risk judgment, and can adapt to complex and changing home safety scenarios.
[0086] Reference Figure 6 As an implementation of step S109, the step of sending a corresponding security control instruction according to the dynamic risk index includes: Step S601, determining the corresponding dynamic risk level according to the dynamic risk index; Among them, the system maps the calculated dynamic risk index to a preset risk level system. This risk level system is usually divided into multiple levels, such as low risk, medium risk and high risk. Each risk level corresponds to a different risk response strategy. The dynamic risk index reflects the real-time risk status, and based on this index, the safety of the home environment can be evaluated in real time.
[0087] Example: If the calculated dynamic risk index is 0.8, it will fall into the high risk level, indicating that the home environment has a greater potential safety threat, such as a possible fire or electrical overload. If the dynamic risk index is 0.3, it corresponds to the low risk level, indicating that the home environment is safe and the risk is relatively small.
[0088] Step S602, based on the preset strategy mapping table, determine the corresponding security control strategy according to the dynamic risk level; Once the dynamic risk level is determined, the system will select the security control strategy corresponding to the risk level according to the preset strategy mapping table. The strategy mapping table is a pre-defined rule that determines the security control measures to be taken at different risk levels. For example, a high risk level may require immediate power cut-off and activation of fire fighting equipment, while a low risk level may only require reducing the power of electrical appliances.
[0089] For example, in high-risk situations (e.g., dynamic risk index ≥ 0.7), the system may select the following safety control strategies: cut off the power supply of non-essential appliances; start the exhaust system to remove smoke; sound and light alarms to alert household members. In low-risk situations (e.g., dynamic risk index < 0.4), the system may only take the following measures: reduce the power output of appliances; make slight adjustments to the operation of appliances to reduce load.
[0090] Step S603: Generate corresponding security control instructions according to the security control strategy and send them to the home control terminal.
[0091] Among them, once the corresponding security control strategies are determined, the system will generate specific security control instructions based on these strategies and send them to home control terminals (such as smart sockets, home central control systems, fire protection systems, etc.) through the home automation platform. These instructions can trigger actual safety measures, such as cutting off power, starting the exhaust system, starting the alarm system, etc.
[0092] In the above implementation, the dynamic risk index is combined with the risk level, and the corresponding safety control strategy is selected according to different risk levels, thereby generating and automatically executing safety control instructions. This technical solution has a high degree of automation and real-time response capabilities, and can flexibly respond to different safety risk scenarios, such as emergency situations such as electrical overload or fire. Through the preset strategy mapping table, the system can accurately judge and take corresponding measures to ensure the safety of the home environment under different risk situations, and optimize the response speed and accuracy of safety management.
[0093] The embodiment of the present application also discloses a home security control system based on big data analysis.
[0094] A home security control system based on big data analysis, the control method includes: A data acquisition module is used to acquire the original sensor data stream in the home environment; wherein the original sensor data stream includes real-time temperature data, smoke concentration data, real-time current data and door and window status; A data preprocessing module is used to preprocess the raw sensor data stream to obtain a synchronization calibration matrix; A characteristic matrix generation module is used to calculate the temperature change rate, smoke concentration accumulation, current harmonic components and temperature-current correlation coefficient according to the synchronous calibration matrix to obtain a characteristic matrix; The temperature isolation module is used to detect anomalies in the temperature change rate through the isolation forest algorithm and output the temperature isolation score; A smoke risk calculation module is used to calculate the smoke risk coefficient according to the accumulated smoke concentration based on a preset smoke risk mapping relationship; A current reconstruction module is used to reconstruct the current harmonic components through an autoencoder model and calculate the current reconstruction error; An environmental risk determination module is used to determine the environmental risk coefficient according to the state of doors and windows based on a preset environmental risk mapping relationship; The dynamic risk assessment module is used to perform weighted fusion of the temperature isolation score, smoke risk coefficient, current reconstruction error and environmental risk coefficient to calculate the dynamic risk index; The security control module is used to send corresponding security control instructions according to the dynamic risk index.
[0095] As an implementation of the data preprocessing module, the data preprocessing module includes: The synchronous calibration module is used to align the timestamps of the original sensor data stream to obtain the real-time temperature data, smoke concentration data and real-time current data after synchronous calibration; Environmental compensation module, used to establish temperature compensation function based on thermodynamic diffusion model and perform environmental compensation on real-time temperature data after synchronous calibration; A baseline drift correction module is used to calculate the dynamic baseline based on the sliding window moving average method and perform baseline drift correction on the smoke concentration data after synchronous calibration; A filtering module, used for adaptively filtering the real-time current data after synchronization calibration based on wavelet transform; The calibration matrix construction module is used to construct a synchronous calibration matrix by combining the ordered discrete codes corresponding to the door and window states.
[0096] A home safety control system based on big data analysis in an embodiment of the present application can implement any of the above-mentioned home safety control methods, and the specific working process of each module in the home safety control system can refer to the corresponding process in the above-mentioned method embodiment.
[0097] In the several embodiments provided in this application, it should be understood that the provided methods and systems can be implemented in other ways. For example, the system embodiments described above are only illustrative; for example, the division of a certain module is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed.
[0098] The embodiment of the present application also discloses a computer device.
[0099] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, a home security control method based on big data analysis as described above is implemented.
[0100] The embodiment of the present application also discloses a computer-readable storage medium.
[0101] A computer-readable storage medium stores a computer program that can be loaded by a processor and execute any one of the above-mentioned home security control methods based on big data analysis.
[0102] Among them, computer-readable storage media can be any tangible medium that contains or stores a program, which can be used by or in conjunction with an instruction execution system, apparatus or device; the program code contained on the computer-readable medium can be transmitted using any appropriate medium, including but not limited to wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0103] It should be noted that in the above embodiments, the description of each embodiment has different emphases, and for parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0104] The above are all preferred embodiments of the present application, and are not intended to limit the protection scope of the present application. Any feature disclosed in this specification (including the abstract and drawings), unless otherwise stated, can be replaced by other equivalent or alternative features with similar purposes. That is, unless otherwise stated, each feature is only an example of a series of equivalent or similar features.
Claims
1. A home security control method based on big data analysis, characterized in that: The control method comprises: Obtaining the original sensor data stream in the home environment; wherein the original sensor data stream includes real-time temperature data, smoke concentration data, real-time current data and door and window status; Preprocessing the raw sensor data stream to obtain a synchronization calibration matrix; Calculate the temperature change rate, smoke concentration accumulation, current harmonic components and temperature-current correlation coefficient according to the synchronous calibration matrix to obtain a characteristic matrix; Performing anomaly detection on the temperature change rate by using an isolation forest algorithm and outputting a temperature isolation score; Based on a preset smoke risk mapping relationship, a smoke risk coefficient is calculated according to the accumulated smoke concentration; Reconstructing the current harmonic components through an autoencoder model and calculating a current reconstruction error; Based on a preset environmental risk mapping relationship, determining an environmental risk coefficient according to the state of the door and window; The temperature isolation score, smoke risk coefficient, current reconstruction error and environmental risk coefficient are weighted and integrated to calculate a dynamic risk index; Send corresponding security control instructions according to the dynamic risk index.
2. A home security control method based on big data analysis according to claim 1, characterized in that: The step of preprocessing the raw sensor data stream to obtain a synchronous calibration matrix includes: Performing time stamp alignment on the raw sensor data stream to obtain synchronously calibrated real-time temperature data, smoke concentration data, and real-time current data; A temperature compensation function is established based on a thermodynamic diffusion model, and environmental compensation is performed on the real-time temperature data after synchronous calibration; The dynamic baseline is calculated based on the sliding window moving average method, and the baseline drift correction is performed on the smoke concentration data after synchronous calibration; Adaptively filter the real-time current data after synchronization calibration based on wavelet transform; Combined with the ordered discrete codes corresponding to the door and window states, a synchronous calibration matrix is constructed.
3. A home security control method based on big data analysis according to claim 2, characterized in that: The steps of performing abnormal detection on the temperature change rate by using an isolation forest algorithm and outputting a temperature isolation score include: Standardizing the temperature change rate to obtain a standardized temperature change rate sequence; Cache the data in a preset historical period in the standardized temperature change rate sequence as a training set; Dynamically configure the number of trees according to the training set, construct an isolated tree set with a maximum depth, randomly select features and segmentation values at each segmentation, recursively segment the data until a single sample is isolated or the depth limit is reached, and obtain an isolation forest model; Based on the isolation forest model, the average path length of the real-time data in the standardized temperature change rate sequence in each tree is calculated, a preset weighting coefficient is determined according to the real-time temperature data, and a temperature isolation score is calculated.
4. A home security control method based on big data analysis according to claim 1, characterized in that: Also included is a training step of the autoencoder model, the training step comprising: Collecting historical sample data; wherein the historical sample data includes current harmonic component data under historical normal operating conditions; Preprocessing the historical sample data and dividing it into training samples and reserved samples; Training a pre-built stacked convolutional autoencoder based on the training samples, optimizing model parameters, and obtaining the autoencoder model; The autoencoder model is tested and model parameters are corrected based on the reserved samples until the loss function of the model meets a preset condition or the number of model iterations reaches a preset number, thereby obtaining the trained autoencoder model.
5. A home security control method based on big data analysis according to claim 1, characterized in that: The steps of weighting and fusing the temperature isolation score, smoke risk coefficient, current reconstruction error and environmental risk coefficient to calculate a dynamic risk index include: Receive basic weight configuration input by the user; Determine the corresponding current risk mode according to the temperature-current correlation coefficient in the characteristic matrix; Optimizing and adjusting the basic weight configuration according to the current risk model to obtain an optimized weight configuration; According to the optimized weight configuration, the temperature isolation score, smoke risk coefficient, current reconstruction error and environmental risk coefficient are combined for weighted fusion to calculate the corresponding dynamic risk index.
6. A home security control method based on big data analysis according to any one of claims 1 to 5, characterized in that: The step of sending a corresponding security control instruction according to the dynamic risk index comprises: Determining a corresponding dynamic risk level according to the dynamic risk index; Based on a preset strategy mapping table, determining a corresponding security control strategy according to the dynamic risk level; Generate corresponding security control instructions according to the security control strategy and send them to the home control terminal.
7. A home security control system based on big data analysis, characterized in that: The control system comprises: A data acquisition module is used to acquire the original sensor data stream in the home environment; wherein the original sensor data stream includes real-time temperature data, smoke concentration data, real-time current data and door and window status; A data preprocessing module, used for preprocessing the raw sensor data stream to obtain a synchronous calibration matrix; A characteristic matrix generation module is used to calculate the temperature change rate, the smoke concentration accumulation, the current harmonic component and the temperature-current correlation coefficient according to the synchronous calibration matrix to obtain a characteristic matrix; A temperature isolation module, used to detect anomalies of the temperature change rate by using an isolation forest algorithm and output a temperature isolation score; A smoke risk calculation module, used to calculate a smoke risk coefficient according to the accumulated smoke concentration based on a preset smoke risk mapping relationship; A current reconstruction module, used to reconstruct the current harmonic components through an autoencoder model and calculate a current reconstruction error; An environmental risk determination module, used to determine an environmental risk coefficient according to the state of the door and window based on a preset environmental risk mapping relationship; A dynamic risk assessment module, used for weighted fusion of the temperature isolation score, smoke risk coefficient, current reconstruction error and environmental risk coefficient to calculate a dynamic risk index; The security control module is used to send corresponding security control instructions according to the dynamic risk index.
8. A home security control system based on big data analysis according to claim 7, characterized in that: The data preprocessing module comprises: A synchronous calibration module, used for aligning the timestamps of the original sensor data stream to obtain real-time temperature data, smoke concentration data and real-time current data after synchronous calibration; Environmental compensation module, used to establish temperature compensation function based on thermodynamic diffusion model and perform environmental compensation on real-time temperature data after synchronous calibration; A baseline drift correction module is used to calculate the dynamic baseline based on the sliding window moving average method and perform baseline drift correction on the smoke concentration data after synchronous calibration; A filtering module, used for adaptively filtering the real-time current data after synchronization calibration based on wavelet transform; The calibration matrix construction module is used to construct a synchronous calibration matrix in combination with the ordered discrete codes corresponding to the door and window states.
9. A computer device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 6 when executing the program.
10. A computer-readable storage medium, characterized in that: A computer program is stored which can be loaded by a processor and execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Intelligent monitoring system based on network communication
CN111522249A
Regional air quality prediction method and device based on power consumption data and storage medium
CN117409879A
Urban emergency risk assessment system and method based on AI image recognition
CN118279835A
Smart home safety control method and system based on Bayesian algorithm
CN118393909A
Geological disaster early warning method and system based on composite gravity data
CN118486136A
Cited By
Home security system based on multi-mode perception and semantic linkage control
CN120595624A