A cloud-edge collaborative-based fire safety detection system and method
By using a cloud-edge collaborative fire safety detection system, principal component analysis and support vector machine models, combined with adaptive algorithms, the system achieves real-time fire situation assessment and efficient data processing. This solves the problems of insufficient data processing capacity and high network pressure in traditional fire detection systems, and improves the accuracy and timeliness of fire early warning.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-28
- Publication Date
- 2026-03-27
Smart Images

Figure CN116489191B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of fire safety testing, and in particular to a fire safety testing system based on cloud-edge collaboration. Background Technology
[0002] Traditional fire detection systems often only provide simple alarm and location functions when a fire occurs, making it difficult to effectively prevent fires in their early stages and avoid their spread. Furthermore, because traditional fire detection systems are usually offline, their data processing and analysis capabilities are limited, making real-time detection and remote management impossible. They also cannot achieve comprehensive, three-dimensional detection of fire sources over large areas.
[0003] In recent years, with the continuous development of technologies such as sensors, wireless communication, cloud computing, and the Internet of Things (IoT), research in the field of smart fire protection has also emerged. For example, Chinese patent CN112714189A discloses an IoT-based fire safety detection system, method, and storage medium, including a sensor, a fire early warning module, WF-IoT nodes, a WF-IoT cloud monitoring platform, and an intelligent monitoring terminal. This invention improves the efficiency of fire accident handling, reduces labor costs, and enables real-time monitoring of fire equipment status data. Another example is Chinese patent CN114937348A, which discloses a building fire detection system, including a back-end monitoring platform, a wireless transceiver module, a central processing module, a data acquisition module, and a fire control module. This invention can achieve accurate detection of each resident's data and centralized data collection and monitoring.
[0004] However, these studies often suffer from low data transmission efficiency and high cloud computing pressure, which may lead to untimely responses and lack complete fire situation assessment criteria. Therefore, this invention designs a cloud-edge collaborative fire safety detection system. Summary of the Invention
[0005] The technical problem to be solved by this invention is how to improve the processing efficiency of fire safety detection systems.
[0006] To address the aforementioned technical problems, this invention provides a cloud-edge collaborative fire safety detection system, which deploys a data transmission module, a fire model training module, and a fire judgment module in the cloud service system.
[0007] The data transmission module is responsible for receiving data from the data acquisition subsystem, uploading the judgment results to the application layer to complete the data uplink, and transmitting instructions to the data acquisition subsystem to complete the data downlink.
[0008] The model training module is used to train the fire situation judgment model, which is used to judge the fire situation. The trained dynamic fire situation judgment model is sent to the data acquisition subsystem to complete the real-time fire situation judgment at the edge.
[0009] The fire situation assessment module is used to assess the fire situation based on the data transmitted to the cloud.
[0010] The aforementioned cloud-edge collaborative fire safety detection system includes a data acquisition subsystem comprising the following modules:
[0011] Data acquisition module: Collects information from various sensors according to the sampling frequency;
[0012] Data transmission preprocessing module: performs dimensionality reduction processing on the collected sensor data;
[0013] Data transmission module: Enables communication with the cloud service system;
[0014] Acquisition and Control Adaptive Module: Calculates and adjusts the sampling frequency of the acquired data after dimensionality reduction.
[0015] Control module: Based on the data output by the acquisition and control adaptive module, it uses the received fire situation judgment model to judge the fire situation, and issues control commands to various actuators based on the fire situation judgment results, or issues control commands to various actuators based on the fire situation judgment results sent by the directly received model training module.
[0016] The aforementioned cloud-edge collaborative fire safety detection system, in its data transmission preprocessing module, uses principal component analysis to reduce the dimensionality of dataset X from n-dimensional to 2-dimensional, and calculates each principal component using the following formula:
[0017] Y k =w 1,k X1+w 2,k X2+...+w n,k X n
[0018] Among them, Y k It is the kth principal component, w i,k It is the weight of the i-th feature with respect to the k-th principal component, i = 1, 2, ..., n;
[0019] Use the following formula to calculate the variance of each feature in the dataset:
[0020]
[0021] Among them, X i Var(X) represents the i-th feature of the dataset. iX represents the variance of the i-th feature. ij This represents the i-th feature value of the j-th sample. Let represent the average value of the i-th feature, where i = 1, 2, ..., n;
[0022] The variance of the k-th principal component is calculated using the following formula:
[0023]
[0024] By maximizing the variance of the principal components, we find the two largest variances among the k principal components, and then calculate the feature weights w. i,k Given i = 1, 2, ..., n, k = 1, 2, we obtain the two principal components containing the most information:
[0025] Y1 = w 1,1 X1+w 2,1 X2+...+w n,1 X n
[0026] Y2 = w 1,2 X1+w 2,2 X2+...+w n,2 X n
[0027] When the system is running, it processes the data from n sensors acquired by the data acquisition module in real time. In the data transmission preprocessing module, the data is processed according to the feature weights w. i,k Calculate principal component 1 Y1 and principal component 2 Y2.
[0028] The aforementioned cloud-edge collaborative fire safety detection system, in its data acquisition and control adaptive module, calculates the average value Y of principal component 1 Y1 and principal component 2 Y2, and adjusts the frequency of fluctuations in the average value Y. The steps are as follows:
[0029] 1) Set the initial threshold T0, the sampling period P0, and start data acquisition from the edge device;
[0030] 2) After each sampling period P0, calculate the fluctuation range d of the data collected within that period, i.e.:
[0031]
[0032] Where N represents the number of data points collected within the sampling period; Y i This represents the value of the i-th data point within a sampling period. This represents the average value of all data points within a sampling period.
[0033] 3) If the fluctuation amplitude d is greater than the current threshold T nIf the threshold is positive, add a variable ΔT to it; otherwise, subtract a variable ΔT from it.
[0034]
[0035] 4) Based on the current threshold T n To adjust the sampling period P n This causes the sampling period to decrease as the threshold increases. The sampling period is calculated using the following formula:
[0036]
[0037] Here, α is a constant used to control the rate of change of the sampling period.
[0038] In the aforementioned cloud-edge collaborative fire safety detection system, in the control module of the data acquisition subsystem, when t≤αP0, the corresponding fire warning is issued based on the judgment result of the cloud service system; when t>αP0, the fire judgment and fire warning are performed locally, where t is the data transmission cycle of the data acquisition subsystem.
[0039] The aforementioned cloud-edge collaborative fire safety detection system employs a support vector machine-based fire judgment model in the fire model training module of the cloud service system. The training set of the fire judgment model is X′, where each sample contains a feature vector x = (Y1, Y2) and a label y. The goal of the support vector machine (SVM) is to pass through an optimal hyperplane w. T x+b=0 divides the data into two classes, maximizing the distance from each class of data points to the hyperplane, where w∈R d Let b be the normal vector of the hyperplane, b∈R be the bias, and R d Let R represent the d-dimensional real vector space, and let R represent the real number field.
[0040] Introducing slack variable ξ i If ≥0, the SVM is transformed into the following constrained convex quadratic programming problem:
[0041]
[0042] sty i (w T x i +b)≥1-ξ i (ξ i ≥0, i=1,...,n)
[0043] Among them, ||w|| 2 Let y denote the square norm of the hyperplane w. iThe label of the i-th sample takes values {-1, 1} and is used to represent the corresponding sample type. y = 1 represents fire, and y = -1 represents no fire. Transpose w into a row vector w T C is the regularization parameter;
[0044] By solving the above optimization problem, the optimal hyperplane is obtained, and then a trained dynamic fire situation judgment model is obtained.
[0045] The aforementioned cloud-edge collaborative fire safety detection system, in the fire assessment module of the cloud service system, uses a trained fire assessment model to analyze the data uploaded to the cloud to determine whether a fire has occurred. The steps are as follows:
[0046] The system receives information transmitted from the edge side and uses the principal components Y1 and Y2 extracted by the data transmission preprocessing module as inputs to the fire situation judgment model. The model is then used to make a judgment and obtains the judgment result f(Y1, Y2). If f(Y1, Y2) ≥ W, it indicates that the data is abnormal and there is a fire risk. If f(Y1, Y2) < W, it indicates that the data is normal and there is no fire risk. W is a pre-evaluation parameter.
[0047] The aforementioned cloud-edge collaborative fire safety detection system also includes a model update step, which involves adding new input data, principal component 1 Y1, principal component 2 Y2, and the judgment result f(Y1, Y2), to the training set X′, retraining the model, and thus updating the existing fire judgment model. Let X′ t ={(x1,y1),(x2,y2),...,(x m y m Let w be the training dataset at time t. t Let b be the normal vector of the hyperplane at time t. t Let x be the intercept of the hyperplane at time t, and let x be the new data at time t+1. m+1 y m+1 ), will the new data point (x) m+1 y m+1 Add the model parameters to the training dataset X′ and update them by solving the following optimization problem:
[0048]
[0049] sty i (w T x i +b)≥1-ξ i (ξ i ≥0, i=1,...,m+1)
[0050] Where C′ is the incremental parameter;
[0051] By solving the above optimization problem, the optimal hyperplane w at time t+1 is obtained. t+1 and b t+1 This enables dynamic correction of the fire situation assessment model.
[0052] A fire safety detection method based on cloud-edge collaboration includes the following steps:
[0053] 1) The data transmission module is responsible for receiving data from the data acquisition subsystem;
[0054] 2) The dynamic fire situation judgment model is trained by the model training module. The dynamic fire situation judgment model is used for fire situation judgment, and the trained dynamic fire situation judgment model is sent to the data acquisition subsystem.
[0055] 3) The fire situation assessment module is used to assess the fire situation based on the data transmitted to the cloud.
[0056] The aforementioned cloud-edge collaborative fire safety detection method includes the following steps for the data acquisition subsystem to collect data:
[0057] 11) Use the acquisition module to collect information from various sensors according to the sampling frequency;
[0058] 12) The data transmission preprocessing module is used to perform dimensionality reduction processing on the collected sensor information;
[0059] 13) The sampling frequency of the dimensionality-reduced acquisition data is calculated and adjusted using the acquisition control adaptive module;
[0060] 14) Based on the data output by the acquisition and control adaptive module, the fire situation is assessed using the received fire situation assessment model. Based on the fire situation assessment result, control commands are issued to various actuators, or...
[0061] Based on the fire situation assessment results sent directly from the model training module, control commands are sent to various actuators.
[0062] The beneficial effects achieved by this invention are as follows: The cloud-based fire situation assessment model in this invention has multiple types, supporting different application scenarios to ensure higher adaptability and accuracy.
[0063] In this invention, the edge-side acquisition and control adaptive module can automatically adjust the sampling frequency of each sensor according to the acquired information. In the absence of fire, it greatly reduces the sampling pressure on the edge side; in the presence of abnormal data, it can increase the sampling frequency, promptly detect possible fires, and increase the timeliness of judgment.
[0064] The data transmission preprocessing module on the edge side in this invention can perform dimensionality reduction processing on the transmitted data, which can greatly reduce the pressure on network transmission when there are many sensor deployment points.
[0065] The invention supports a dual early warning mechanism at the edge, ensuring normal operation and judgment even in the event of high network latency or network outage, thereby reducing the risks associated with the network. Attached Figure Description
[0066] Figure 1 This is a schematic diagram of the cloud-edge collaborative fire safety detection system architecture of the present invention;
[0067] Figure 2 A schematic diagram of the development framework for a cloud service system;
[0068] Figure 3 This is a schematic diagram of the functional modules of a cloud-edge collaborative fire safety detection system. Detailed Implementation
[0069] To clearly illustrate the technical features of this solution, the invention will be described in detail below through specific implementation methods and in conjunction with the accompanying drawings.
[0070] Example 1
[0071] Figure 1 This is a schematic diagram of a cloud-edge collaborative fire safety detection system architecture based on the present invention. The cloud-edge collaborative fire safety detection system of this embodiment includes an edge side and a cloud service system. The gateway on the edge side connects actuators and sensors. The actuators include buzzers and relays, and the sensors include temperature sensors, carbon monoxide concentration sensors, methane concentration sensors, and smoke concentration sensors. A data acquisition subsystem is set up on the edge side, which communicates with the cloud service system via the MQTT protocol. The cloud service system communicates with a mobile APP to receive or send data from users who monitor and issue commands in real time through the mobile APP.
[0072] Figure 2 This is a schematic diagram of the development framework for a cloud service system. In this embodiment, a client program developed based on Spring Boot is deployed to subscribe to MQTT topics; a Python backend program based on the Flask framework is deployed to complete the fire situation assessment function; Spring Boot also acts as the backend for the application client APP, used to forward data to the APP; and the Python backend program communicates with the Spring Boot program to complete data analysis and result judgment.
[0073] Figure 3 This is a schematic diagram of the functional modules of a fire safety detection system that supports cloud-edge collaboration. A data acquisition subsystem is deployed on the edge side, including:
[0074] Data acquisition module: Collects information from various sensors according to the sampling frequency;
[0075] Data transmission preprocessing module: performs dimensionality reduction processing on the collected sensor data;
[0076] Data transmission module: Enables communication with the cloud service system;
[0077] Acquisition and Control Adaptive Module: Calculates and adjusts the sampling frequency of the acquired data after dimensionality reduction.
[0078] Control module: Based on the data output by the acquisition and control adaptive module, it uses the received fire situation assessment model to assess the fire situation and sends control commands to various actuators based on the fire situation assessment results.
[0079] Based on the fire situation assessment results sent directly from the model training module, control commands are sent to various actuators.
[0080] The cloud service system is equipped with a data transmission module, a fire model training module, and a fire assessment module.
[0081] The data transmission module is responsible for receiving data from the data acquisition subsystem, uploading the judgment results to the application layer to complete the data uplink, and can also transmit instructions to the data acquisition subsystem to complete the data downlink.
[0082] The model training module is used to train a dynamic fire situation judgment model, which is used for fire situation judgment. The trained dynamic fire situation judgment model is then sent to the control module in the data acquisition subsystem to complete the real-time fire situation judgment at the edge.
[0083] The fire situation assessment module is used to assess the fire situation based on the data transmitted to the cloud.
[0084] The implementation methods of each functional module in this embodiment are as follows:
[0085] In the data acquisition module, before the system runs, an n-dimensional dataset X is collected for the selected corresponding scene type. The dataset X contains m samples, and each sample includes data collected by n different types of sensors, denoted as X1, X2, ..., ξ. i Since this invention is an intelligent fire detection system for specific environments, buildings can be classified into commercial buildings, industrial buildings, residential buildings, and public buildings according to their uses.
[0086] Commercial buildings include shopping malls, office buildings, and hotels. These buildings are typically densely populated, large in scale, and contain a lot of electrical equipment and cable conduits. Industrial buildings include factories and warehouses. These buildings are also large in scale and usually contain flammable and explosive materials, such as oil drums and chemicals. They also have complex production processes and equipment. Residential buildings include dormitories, apartments, and villas. These buildings are smaller in scale, have complex structures, and have lower personnel flow. Public buildings include schools, hospitals, and libraries. These buildings are typically places where people gather, are large in scale, and have high personnel flow.
[0087] In the data transmission preprocessing module, an n-dimensional dataset X of a building is collected for weight analysis and fire situation assessment model training. Each sample in dataset X has four features, namely data collected by temperature and humidity sensors, smoke sensors, carbon monoxide sensors, and methane sensors, denoted as X1, X2, X3, and X4. Principal component analysis (PCA) is used to reduce the dimensionality of the data, reducing the 4-dimensional data to 2-dimensional data, thereby reducing the data transmission burden. Each principal component is calculated using the following formula:
[0088] Y k =w 1,k X1+w 2,k X2+w 3,k X3+w 4,k X4
[0089] Among them, Y k It is the kth principal component, w i,k This refers to the weight of the i-th feature with respect to the k-th principal component, where i = 1, 2, 3, 4. The data transmission preprocessing module needs to find the two principal components used for dimensionality reduction, i.e., find the feature weights w in the two principal components. i,k ;
[0090] Use the following formula to calculate the variance of each feature in the dataset:
[0091]
[0092] Among them, X i Var(X) represents the i-th feature of the dataset. i X represents the variance of the i-th feature. ij This represents the i-th feature value of the j-th sample. Let represent the average value of the i-th feature, where i = 1, 2, 3, 4;
[0093] The variance of the k-th principal component is calculated using the following formula:
[0094]
[0095] By maximizing the variance of the principal components, we can find the largest variance among the k principal components, which are the two principal components containing the most information, thus achieving data dimensionality reduction.
[0096] Principal component analysis (PCA) offers advantages such as reducing data redundancy and complexity, improving data processing efficiency, and helping to discover hidden patterns and structures within the data for better understanding. In edge computing applications, PCA can perform dimensionality reduction on large-scale datasets to reduce computational and storage overhead, thereby improving system performance and efficiency.
[0097] In IoT applications, edge devices need to upload the collected data to the cloud service system for processing and analysis. However, due to the limited computing resources and network bandwidth of edge devices, uploading data too frequently can lead to resource waste and network congestion. Therefore, an adaptive algorithm is needed to adjust the data collection frequency to ensure that the amount of data uploaded is neither too much nor too little.
[0098] In the adaptive acquisition and control module, the adaptive algorithm dynamically adjusts the data acquisition frequency based on data fluctuations. In the data transmission preprocessing module, principal component extraction is performed on the data acquired by the acquisition module to achieve dimensionality reduction. Two principal components are extracted: Principal Component 1 (Y1) and Principal Component 2 (Y2). First, the average value Y of Principal Component 1 (Y1) and Principal Component 2 (Y2) is calculated. Then, the frequency is adjusted based on the fluctuations of the average value Y. The specific implementation steps are as follows:
[0099] 1) Initialization: Set the initial threshold T0 = 1, the sampling period P0 = 5 seconds, and start data acquisition from the edge device;
[0100] 2) Calculate the data fluctuation amplitude: After each sampling period P0, calculate the fluctuation amplitude d of the data collected in that period, i.e.:
[0101]
[0102] Where N represents the number of data points collected within the sampling period, and if the sensor's rated sampling period is set to 1 second, then N = 5; Y i This represents the value of the i-th data point within a sampling period. This represents the average value of all data points within a sampling period.
[0103] 3) Determine the data fluctuation range: If the fluctuation range d is greater than the current threshold T n If the threshold is positive, add a variable ΔT to it; otherwise, subtract a variable ΔT from it.
[0104]
[0105] 4) Adjust the sampling period: based on the current threshold T n To adjust the sampling period P n This causes the sampling period to decrease as the threshold increases, and vice versa. Specifically, the sampling period can be calculated using the following formula:
[0106]
[0107] Here, α is a constant used to control the rate of change of the sampling period, which is set to 0.5 in this embodiment; in addition, to prevent the data acquisition subsystem from having an excessively long acquisition period, which would prevent timely updates and feedback of environmental data, the acquisition period P needs to be given. n Set upper limit P max To prevent the data acquisition subsystem's acquisition period from being less than the sensor's rated acquisition period, resulting in N < 1, the acquisition period P needs to be increased. n Set a lower limit P min In the embodiment, P max =30s, P min =1s, ensuring that the data acquisition subsystem collects and uploads data at least once every half minute and at most once every 1 second.
[0108] Adaptive algorithms are data acquisition frequency control algorithms based on data fluctuations. When sensor values change very little, they can effectively reduce the acquisition frequency, thereby reducing the frequency of data uploads from edge devices and saving computing resources and network bandwidth. It is important to note that the parameter settings and debugging of the algorithm need to be optimized for specific application scenarios to achieve the best performance and results.
[0109] In the control module of the data acquisition subsystem, the sampling period P0 of the adaptive algorithm is not only used to control the acquisition frequency of the data acquisition subsystem, but also serves as the basis for the dual early warning mechanism. For the data transmission period t on the edge side, when t≤αP0, it is determined that the network latency is small, and the corresponding fire warning is performed according to the judgment result of the cloud service system; when t>αP0, it is determined that the network latency is large, and the fire judgment and fire warning are performed locally; in the embodiment, the parameter α=1.1.
[0110] In the fire model training module of the cloud service system, a dynamic fire judgment model based on support vector machine (SVM) is adopted to cope with the variability of the environment and the differences in sensor installation locations. The dynamic fire judgment model can effectively predict the possible factors of fire occurrence at specific times, locations and seasons through dynamic training and updating, thereby effectively reducing the occurrence of fires.
[0111] Support Vector Machine (SVM) is a machine learning algorithm capable of solving binary and multi-class classification problems. It can be used for classification, regression, and anomaly detection tasks. Based on the Structural Risk Minimization (SRM) principle, the SVM algorithm attempts to find an optimal hyperplane that separates data from different classes to achieve classification. The advantages of SVM include its ability to effectively handle high-dimensional data, handle non-linear classification problems, and achieve good classification results even with limited training data. In the fire safety detection system of this invention, an SVM model is used to analyze data uploaded to the cloud to determine whether a fire has occurred.
[0112] The n-dimensional dataset X collected by the acquisition module, after dimensionality reduction, serves as the training set X′ for the fire situation assessment model. Each sample contains a feature vector x = (Y1, Y2) and a label y, y ∈ {-1, 1}, where y = 1 represents fire and y = -1 represents no fire. The goal of the Support Vector Machine (SVM) is to achieve an optimal hyperplane w T x+b=0 divides the data into two classes, maximizing the distance from each class of data points to the hyperplane, where w∈R d Let b be the normal vector of the hyperplane, b∈R be the bias, and R d Let R represent the d-dimensional real vector space, and let R represent the real number field.
[0113] Introducing slack variable ξ i If ≥0, the SVM is transformed into the following constrained convex quadratic programming problem:
[0114]
[0115] sty i (w T x i +b)≥1-ξ i (ξ i ≥0, i=1,...,n)
[0116] Among them, ||w|| 2 Let y denote the square norm of the hyperplane w. i The label of the i-th sample takes values {-1, 1} and is used to represent the corresponding sample type. Since the hyperplane w is a column vector, x i It is also a column vector. In order to perform matrix multiplication, w is transposed into a row vector w. T C is a regularization parameter used to balance the complexity and generalization ability of the model. In this embodiment, C = 10.0 is set.
[0117] By solving the above optimization problem, the optimal hyperplane can be obtained, and thus a well-trained dynamic fire situation judgment model can be obtained.
[0118] In the fire model training module, the fire judgment model is divided into different types according to the application scenario. During training, the scenario type is first selected, and the acquisition module obtains the acquisition dataset X. The acquisition dataset X contains multiple sets of samples. Each sample includes temperature and humidity sensor data X1, smoke sensor data X2, carbon monoxide sensor data X3, and methane sensor data X4, as well as sample label y. The dataset X is subjected to dimensionality reduction processing by the data transmission preprocessing module to obtain the training set X′. The training set X′ contains principal component one Y1 and principal component two Y2 extracted by the data transmission preprocessing module, as well as sample label y. The model is trained based on the training set to analyze the pre-evaluation parameters W of the corresponding scenario.
[0119] In the fire detection module of the cloud service system, a trained dynamic fire detection model is used to analyze the data uploaded to the cloud to determine whether a fire has occurred. If the dynamic fire detection model determines that a fire has occurred, an alarm is issued and relevant personnel are notified to take action. The specific steps are as follows:
[0120] S0: Receive information transmitted from the edge side, take the principal component Y1 and principal component Y2 extracted by the data transmission preprocessing module as input to the model, and input them into the fire judgment model to make a judgment and obtain the judgment result f(Y1, Y2). When f(Y1, Y2)≥W, it means that the data is abnormal and there is a fire risk. When f(Y1, Y2)<W, it means that the data is normal and there is no fire risk.
[0121] S1: Real-time feedback, uploading the above judgment results to the application client and outputting them on the application client;
[0122] S2: Model update, adding the new input data principal component 1 Y1, principal component 2 Y2, and decision result f(Y1, Y2) to the training set Y. train The model is then retrained to update and correct the existing fire situation assessment model.
[0123] As time goes by, data characteristics may change, so the fire situation assessment model needs to be continuously updated and corrected to ensure that the fire situation assessment model can accurately judge new data. In this embodiment, an incremental learning algorithm, namely online support vector machine (OSVM), is used to update and correct the fire situation assessment model, so as to effectively process new data without retraining the entire model.
[0124] Let X′ t ={(x1,y1),(x2,y2),...,(x m y m Let w be the training dataset at time t. t Let b be the normal vector of the hyperplane at time t. tLet x be the intercept of the hyperplane at time t, and let x be the new data at time t+1. m+1 y m+1 );
[0125] New data point (x) m+1 y m+1 Add to training dataset D t In this process, the model parameters are updated by solving the following optimization problem:
[0126]
[0127] sty i (w T x i +b)≥1-ξ i (ξ i ≥0, i=1 ,.. .,m+1)
[0128] C′ is an incremental parameter used to control the degree of penalty for new samples. Usually, the incremental parameter C′ is set to a value smaller than the regularization parameter C to ensure that the impact of the new data is relatively small. In this embodiment, C′ is set to 1.0. In the dynamic correction part, the SVM model will be continuously updated to adapt to the feature changes of the new data and improve the timeliness and accuracy of the model.
[0129] By solving the above optimization problem, the optimal hyperplane w at time t+1 is obtained. t+1 and b t+1 This enables dynamic correction of the SVM model to ensure it can accurately judge new data.
[0130] This embodiment employs a cloud-edge collaboration approach, supporting a dual early warning mechanism. The data acquisition subsystem on the edge side periodically synchronizes the evaluation parameters W from the cloud locally for real-time judgment on the edge side. When network latency is low, the control module in the data acquisition subsystem issues corresponding early warnings based on the judgment results from the cloud. However, when network latency is high or the network is down, the control module in the data acquisition subsystem performs judgments and issues early warnings locally.
[0131] A fire safety detection method based on cloud-edge collaboration includes the following steps:
[0132] 1) The data transmission module is responsible for receiving data from the data acquisition subsystem;
[0133] 2) The dynamic fire situation judgment model is trained by the model training module. The dynamic fire situation judgment model is used for fire situation judgment, and the trained dynamic fire situation judgment model is sent to the data acquisition subsystem.
[0134] 3) The fire situation assessment module is used to assess the fire situation based on the data transmitted to the cloud.
[0135] The data acquisition subsystem acquires data in the following steps:
[0136] 11) Use the acquisition module to collect information from various sensors according to the sampling frequency;
[0137] 12) The data transmission preprocessing module is used to perform dimensionality reduction processing on the collected sensor information;
[0138] 13) The sampling frequency of the dimensionality-reduced acquisition data is calculated and adjusted using the acquisition control adaptive module;
[0139] 14) Based on the data output by the acquisition and control adaptive module, the fire situation is assessed using the received fire situation assessment model. Based on the fire situation assessment result, control commands are issued to various actuators, or...
[0140] Based on the fire situation assessment results sent directly from the model training module, control commands are sent to various actuators.
[0141] The working process of each functional module mentioned in the cloud-edge collaborative fire safety detection method is the same as that of the functional modules in the cloud-edge collaborative fire safety detection system.
[0142] Example 2
[0143] In addition to the aforementioned functional modules, the cloud-edge collaborative fire safety detection system of this invention also includes a mobile APP for users to monitor and issue commands in real time. The application client adopts a front-end and back-end separation model for mobile application development, using the Flutter framework for front-end development and integrating Spring Boot and MyBatis Plus frameworks for back-end development, primarily based on the Android operating system. The mobile application mainly includes the following functional modules:
[0144] 1) Real-time data display module: Displays various indicator data in real time on the mobile APP page;
[0145] 2) Warning module: When a sensor receives abnormal data and the fire prediction model calculates that a fire may exist, it immediately issues a warning to the user;
[0146] 3) Data recording module: Stores the data of each indicator within a certain time range in the database;
[0147] 4) Alarm module: Controls the corresponding buzzer to sound an alarm.
[0148] The aforementioned control and setting commands will be forwarded through the cloud service system to the control module on the edge side.
[0149] Matters not covered in this invention are common knowledge. The above embodiments are only for illustrating the technical concept and features of this invention, and are intended to enable those skilled in the art to understand the content of this invention and implement it accordingly. They should not be construed as limiting the scope of protection of this invention. All equivalent changes or modifications made in accordance with the spirit and essence of this invention should be covered within the scope of protection of this invention.
Claims
1. A cloud-edge collaboration based fire safety detection system, characterized in that, The cloud service system is provided with a data transmission module, a fire situation model training module and a fire situation judgment module; The data transmission module is responsible for accepting data of the data acquisition subsystem, uploading the judgment result to the application layer to complete data uploading, and transmitting instructions to the data acquisition subsystem to complete data downloading; The model training module is used for training a fire situation judgment model, the fire situation judgment model is used for fire situation judgment, and the trained dynamic fire situation judgment model is sent to the data acquisition subsystem to complete real-time fire situation judgment at the edge side; The fire situation judgment module is used for fire situation judgment on data transmitted to the cloud; The data acquisition subsystem comprises the following modules: A data acquisition module acquires information of various sensors according to a sampling frequency; A data transmission preprocessing module performs dimension reduction processing on the acquired sensor data information; A data transmission module realizes communication with the cloud service system; A collection control adaptive module calculates and adjusts the sampling frequency of the collected data after dimension reduction processing; A control module judges the fire situation by using the received fire situation judgment model according to the data output by the collection control adaptive module, and sends control commands to various actuators according to the fire situation judgment result, or sends control commands to various actuators according to the fire situation judgment result directly received from the model training module; In the data transmission preprocessing module, the data set The data dimensionality reduction is performed using the principal component analysis method, and the data of 100 dimensions is reduced to 2 dimensions, and each principal component is calculated using the following formula: The data of 100 dimensions is reduced to 2 dimensions, and each principal component is calculated using the following formula: wherein is the first principal component, is the weight of the first feature for the first principal component, ; The variance of each feature in the data set is calculated by the following formula: in, Represents the first of the datasets One characteristic, Indicates the first The variance of each feature Indicates the first The first sample 1 eigenvalue, Indicates the first The average of the features, ; The variance of the first principal component is calculated using the following equation: variance = sum of (x - mean)2 The principal components are found by maximizing the variance of the principal components The two principal components with the largest variances are found, and the weights of the features are calculated , , The two principal components that contain the most information are obtained When the system is running, the data collected by the data acquisition module... The sensor data is processed in real time. In the data transmission preprocessing module, the data is processed according to the feature weights. Calculate principal components 1 and principal component two ; In the acquisition control adaptive module, the average value of the principal component one and the principal component two is calculated , and the frequency adjustment of the fluctuation of the average value is performed, with the following steps: 1) Set initial threshold , sampling period , and start data collection from edge devices; 2) every sampling period , the fluctuation amplitude of the data collected in this period is calculated , that is: wherein, represents the number of data collected in the sampling period; represents the value of the i-th data point in a sampling period, represents the average value of all data points in a sampling period; 3) if the amplitude of the fluctuation is greater than the current threshold then add a variable to the threshold else subtract a variable from the threshold i.e.: 4) Adjust the sampling period according to the current threshold such that the sampling period decreases as the threshold increases, the sampling period being calculated according to the following formula: wherein is a constant for controlling the speed of variation of the sampling period.
2. The cloud-edge collaborative fire safety detection system of claim 1, wherein, In the control module of the data acquisition subsystem, when , the corresponding fire warning is performed according to the judgment result of the cloud service system; when , the fire judgment and the fire warning are performed locally, is the data sending period of the data acquisition subsystem.
3. The cloud-edge collaborative fire safety detection system of claim 2, wherein, In the fire situation model training module of the cloud service system, a fire situation judgment model based on support vector machines is adopted. The training set of the fire situation judgment model is... Each sample contains a feature vector. and tags The goal of Support Vector Machine (SVM) is to pass through an optimal hyperplane. The data is divided into two classes, such that the distance from the data points of each class to the hyperplane is maximized. Let be the normal vector of the hyperplane. For bias, express 3D real vector space, Represents the real number field; Introducing slack variables The SVM is converted into the following constrained convex quadratic programming problem: wherein, represents the squared norm of the hyperplane , represents the label of the th sample, taking values in {−1,1}, used to indicate the corresponding sample type, represents the fire, represents the non-fire, and is transposed into a row vector , is a regularization parameter; By solving the above optimization problem, the optimal hyperplane is obtained, and then the trained dynamic fire situation judgment model is obtained.
4. The cloud-edge collaborative fire safety detection system of claim 3, wherein, In the fire situation judgment module of the cloud service system, the trained fire situation judgment model is used to analyze the data uploaded to the cloud to judge whether a fire occurs, and the steps are as follows: Receiving the information transmitted by the edge side, the data transmission preprocessing module extracts the principal component one and the principal component two As the input of the fire condition judgment model, it is input into the fire condition judgment model for judgment to obtain the judgment result When , it indicates that the data is abnormal and there is a fire risk, and when , it indicates that the data is normal and there is no fire risk. is a pre-evaluation parameter.
5. The cloud-edge collaborative fire safety detection system according to claim 4, wherein, Further comprising a model updating step, The new input data is principal component one. , principal component two and judgment results Add to training set The model is retrained to update the existing fire situation assessment model. For time The training dataset at each time step, for The normal vector of the hyperplane at time t. for The intercept of the hyperplane at time t, with respect to time New data at any time , will new data points Add to training dataset In this process, the model parameters are updated by solving the following optimization problem: wherein is an increment parameter; By solving the above optimization problem, the optimal hyperplane at time is obtained and , which realizes the dynamic correction of the fire situation judgment model.
6. A cloud-edge collaboration-based fire safety detection method, characterized in that, Comprising the following steps: 1) The data transmission module is responsible for accepting data of the data acquisition subsystem; 2) The dynamic fire situation judgment model is trained by the model training module, and the trained dynamic fire situation judgment model is sent to the data acquisition subsystem; 3) The fire situation judgment module is used for fire situation judgment on data transmitted to the cloud; The data acquisition subsystem acquires data in the following steps: 11) The collection module acquires information of various sensors according to a sampling frequency; 12) The data transmission preprocessing module performs dimension reduction processing on the acquired sensor information; 13) The collection control adaptive module calculates and adjusts the sampling frequency of the collected data after dimension reduction processing; 14) According to the data output by the collection control adaptive module, the fire situation is judged by using the received fire situation judgment model, and control commands are sent to various actuators according to the fire situation judgment result, or According to the fire situation judgment result directly received from the model training module, control commands are sent to various actuators; In the data transmission preprocessing module, the data set The data dimensionality reduction is performed using the principal component analysis method, and the data of 100 dimensions is reduced to 2 dimensions, and each principal component is calculated using the following formula: The data of 100 dimensions is reduced to 2 dimensions, and each principal component is calculated using the following formula: wherein is the first principal component, is the weight of the first feature for the first principal component, ; The variance of each feature in the data set is calculated by the following formula: wherein, represents the i-th feature of the data set, represents the variance of the i-th feature, represents the i-th feature value of the i-th sample, represents the i-th feature value of the i-th sample, represents the mean of the i-th feature, ; The variance of the first principal component is calculated using the following equation: variance = sum ( (x - mean) * (x - mean) ) The two principal components with the largest variances are found by maximizing the variance of the principal components The weights of the features are calculated by finding the two principal components with the largest variances , , The two principal components that contain the most information are obtained When the system is running, the data collected by the data acquisition module... The sensor data is processed in real time. In the data transmission preprocessing module, the data is processed according to the feature weights. Calculate principal components 1 and principal component two ; In the acquisition control adaptive module, the average value of the principal component one and the principal component two is calculated , and the frequency adjustment of the fluctuation of the average value is performed, with the following steps: 1) Set initial threshold , sampling period and start data collection from edge devices; 2) every sampling period , the fluctuation amplitude of the data collected in this period is calculated , that is: wherein, represents the number of data collected in the sampling period; represents the value of the i-th data point in a sampling period, represents the average value of all data points in a sampling period; 3) if the amplitude of the fluctuation is greater than the current threshold then add a variable to the threshold else subtract a variable from the threshold i.e. 4) Adjust the sampling period according to the current threshold such that the sampling period decreases as the threshold increases, the sampling period being calculated according to the following formula: wherein is a constant for controlling the speed of variation of the sampling period.
Citation Information
Patent Citations
Internet-of-Things fire safety detection system and method based on WF-IoT, and storage medium thereof
CN112714189A
Building fire-fighting detection system
CN114937348A
End-side-cloud architecture-based community fire monitoring system
CN110807905A