A deep learning-based wireless smoke sensing device battery power prediction method and system
Patent Information
- Application Number
- CN202410366527.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-28
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2044-03-28
AI Technical Summary
由于电池内部的反应机制过于复杂,使用这类方法很难建立精确的电池模型,且该方法预测准确率不高、可移植性差
[0011] (1) Based on the way smoke detectors handle fires or dense smoke, a strong correlation is established between smoke concentration detection values and the number of fire alarm reports and battery power, and the unique strong correlation characteristics of battery power of smoke detectors are extracted.
Smart Images

Figure CN118277764B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of time series prediction technology, and more specifically, relates to a method and system for predicting battery power of wireless smoke detectors based on deep learning. Background Technology
[0002] A time series is a sequence of data points arranged chronologically. Typically, the time intervals in a time series are constant, thus requiring analysis as discrete time data. Time series forecasting involves uncovering hidden patterns in historical data and using appropriate models to predict future data. Battery power in wireless smoke detectors, as a type of time series data that can be acquired through periodic sampling and has specific temporal correlations, reflects changes in the device's operating status, such as battery power variations with time, weather, and other factors, or the remaining time before battery replacement. Battery power is a crucial indicator for fire warning devices, significantly impacting fire safety in the surrounding area. Furthermore, due to the rapid generation of battery power data, its real-time nature and timeliness necessitate effective analysis of real-time battery power data to accurately predict battery power trends and replacement times, ensuring timely battery replacement before the device runs out of power and maintaining continuous operation.
[0003] Existing battery capacity prediction methods are generally divided into battery model-based methods and data-driven methods. Battery model-based methods require establishing a dynamic model by exploring the battery's physicochemical reactions and internal structure, and then using filtering algorithms to estimate the battery's physicochemical parameters to predict remaining battery capacity. However, due to the complexity of the battery's internal reaction mechanisms, it is difficult to build an accurate battery model using this method, and the prediction accuracy is low, with poor portability. Data-driven prediction methods require extracting features reflecting changes in battery capacity from the raw data. Accurate extraction of these features is crucial; if the extracted features cannot effectively reflect the battery capacity variation patterns in conjunction with the device's own characteristics, the model will fail to predict battery capacity accurately. Furthermore, if the model cannot effectively extract the global and temporal correlations of battery capacity, it will also result in inaccurate battery capacity prediction. Summary of the Invention
[0004] To address the shortcomings of existing technologies, the present invention aims to provide a deep learning-based method for predicting the battery level of wireless smoke detectors. This method analyzes the operating mode of smoke detectors, extracts unique features strongly correlated with battery level based on the operating characteristics of smoke detectors, and uses an improved model based on a self-attention mechanism to accurately extract high-level features of the battery level sequence and accurately predict the battery level at future moments. It also enables real-time prediction of the battery level change trend and accurate acquisition of the remaining time before battery replacement.
[0005] To achieve the above objectives, this invention provides a deep learning-based method for predicting the battery level of wireless smoke detectors. This method mines battery level features that are strongly correlated with smoke detectors and combines an improved model with a self-attention mechanism to accurately and in real-time predict the future battery level of smoke detectors.
[0006] This method includes: firstly, analyzing the correlation between smoke concentration characteristics and battery power in smoke detectors, and then extracting features that strongly influence the battery power of smoke detectors based on the analyzed correlation. When a fire occurs, the smoke concentration detected by smoke detectors rises rapidly. Simultaneously, the device significantly increases the number of message reports and continuously sounds its buzzer to alert personnel to handle the fire. The increased buzzer activity and message reporting frequency accelerate battery consumption. Therefore, when a smoke detector detects high concentrations of smoke, it consumes additional power due to the increased message reporting frequency and buzzer usage. From each device, the smoke concentration detection value, the daily number of fire alarm message reports, and the total number of fire alarm message reports since the device's installation are extracted as three features related to the battery power of the smoke detector. These features are then combined with the daily temperature, wind speed, humidity, and some local features of the device itself to form a time series feature. A sliding window is used to divide the data into multiple fixed-length time series to increase data utilization.
[0007] In the original self-attention algorithm, a softmax operation is always performed after calculating the attention score of the current vector and other vectors at each time step. Even if there is no vector with the highest correlation to the current vector, the model will still output a maximum value in the correlation score, resulting in an unbalanced weight distribution of attention scores. Furthermore, experiments have shown that the positions of these improperly distributed attention score maxima always correspond to a series of vectors at the beginning of the sequence. Therefore, this method adds some meaningless buffer vectors at the beginning of the sequence. When the correlation between a vector and other vectors at a certain time step is not strong, the improperly distributed attention score maxima are concentrated at the positions corresponding to these buffer vectors. In subsequent calculations, the output results corresponding to the buffer vectors are discarded, resulting in a more balanced distribution of actual attention scores.
[0008] When performing real-time battery power prediction, simply remove the oldest day from the input data and add the data from the newest day to update the battery power prediction value. After one cycle of prediction, retrain the network using the newly arrived data and then feed it into the power prediction to ensure the model's real-time performance.
[0009] Compared with the prior art, the above-described technical solutions conceived in this invention can achieve the following results.
[0010] Beneficial effects:
[0011] (1) Based on the way smoke detectors handle fires or dense smoke, a strong correlation is established between smoke concentration detection values and the number of fire alarm reports and battery power, and the unique strong correlation characteristics of battery power of smoke detectors are extracted.
[0012] (2) Improved the defects in the calculation of the self-attention mechanism model by adding several buffer vectors at the beginning of the input sequence, concentrating the maxima of the attention scores that are not reasonably distributed in the matrix at the position of the buffer vector, so that the weight of the attention scores is more balanced when calculating the output vector.
[0013] (3) It can update the battery power for several days from the current date in real time, and update the model parameters regularly with new data, which has good real-time performance and accuracy.
[0014] Therefore, this method can extract the strong correlation features of battery power unique to smoke detectors, and uses an improved self-attention algorithm to make the output weights more balanced, thereby improving the accuracy of battery power prediction. At the same time, it can also predict battery power in real time and update the model regularly, thereby improving the stability and timeliness of the model. Attached Figure Description
[0015] Figure 1 This is a flowchart of a deep learning-based method for predicting the battery power of a wireless smoke detector, provided by the present invention.
[0016] Figure 2 This is a flowchart of the device data preprocessing provided by the present invention.
[0017] Figure 3 This is an overall structural diagram of the improved self-attention mechanism model provided by the present invention.
[0018] Figure 4 This is a flowchart of adding a buffer vector and calculating the q, k, and v vectors in the improved self-attention mechanism model provided by this invention.
[0019] Figure 5 This is a flowchart of the calculation process of the encoder self-attention layer in the improved model provided by this invention.
[0020] Figure 6 This is a flowchart of the real-time prediction of battery power and the periodic updating of the model provided by the present invention.
[0021] Figure 7 This is a graph showing the battery power prediction result for a sample provided by the present invention. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.
[0023] The overall process of this invention is as follows: Figure 1 As shown, the raw data obtained all come from wireless smoke detectors at multiple locations in the same area. Each device reports multiple messages related to its own battery characteristics every day. Furthermore, all the raw reports from the devices are concentrated in the same file, requiring data cleaning and filtering methods to process. Subsequently, a deep neural network is used to calculate the predicted battery level. The specific steps are as follows:
[0024] The first step is to extract unique features strongly correlated with battery power from the obtained smoke detector data and organize them into time series data that can be input into a deep neural network, such as... Figure 2As shown. First, when no fire occurs, the smoke detector sends a heartbeat signal every 22 hours to test its normal operating status, and sends almost no messages at other times. When it detects a fire, the detected smoke concentration percentage rises to 100% in a short period of time. Once the smoke concentration reaches 100%, the device will continuously report fire alarm messages until the smoke dissipates and the detected smoke concentration percentage drops to a certain value. At the same time, the buzzer will continuously sound an alarm while the smoke concentration percentage remains at 100%, accelerating power consumption. Therefore, the smoke concentration percentage, the number of daily fire alarm message reports, and the total number of fire alarm message reports since the device was installed are all strongly correlated with the rate of battery consumption. When processing data, the smoke concentration percentage and the number of daily fire alarm messages are considered. The number of message reports and the total number of fire alarm message reports since the equipment was installed were used as three dimensions in the time series of the input deep neural network. In addition, features related to the equipment itself, such as battery level, field strength, signal coverage level, signal level, signal-to-noise ratio, signal strength, equipment temperature, and installation time, as well as weather features such as the maximum and minimum values of temperature, wind speed, and humidity, were added. The data was organized into a time series containing multiple dates, with each date containing the above 17 dimensions of features. Then, a sliding window was used to split the data into multiple samples of 192 days in length. The first 96 days of the sample were used as the input to the network, and the last 96 days were used as the real values for training and testing.
[0025] The second step is to input the sample data into the improved self-attention model. The overall structure of the improved model is as follows: Figure 3 As shown. The model's input and output are both vector sequences of length 96, and the model consists of two parts: an encoder and a decoder. In the encoder, six randomly generated buffer vectors are added to the starting positions of the 96 input vectors and positional encoding is performed. For each input vector, three vectors q, k, and v are generated; for the buffer vectors, only q and k vectors are generated. Subsequently, the q, k, and v vectors are processed through multiple rounds of self-attention, residual layers, and fully connected layers to obtain the encoder output. The specific process of adding buffer vectors and generating q, k, and v vectors is as follows: Figure 4 As shown, the calculation steps are as follows:
[0026] (1) First, add 6 buffer vectors at the beginning of the input vector sequence so that the maxima of the weights that are not properly distributed in the self-attention score are concentrated at the positions of these vectors.
[0027] (2) Using a learnable parameter matrix W q W k W v The vectors q, k, and v are obtained using the following formula:
[0028] q i =W q ai
[0029] k i =W k a i
[0030] v i =W v a i
[0031] Where a i Let q represent a vector in the sequence. i k i v i This generates q, k, and v vectors for this vector. Each of the 96 input vectors generates three vectors (q, k, v), while each of the 6 buffer vectors generates only two vectors (q and k).
[0032] (3) Concatenate the q, k, v vectors of all time vectors column by column to form Q, K, V matrices. The Q and K matrices contain the q and k vectors formed by the buffer vectors, and their size is dim × (96 + 6). The size of the K matrix is dim × 96, where dim is the dimension of the q, k, and v vectors.
[0033] The obtained Q, K, and V matrices are used as input to the self-attention module. First, the attention score matrix needs to be calculated, followed by the output vector at all time points. The specific calculation process of the self-attention mechanism and the processing method of the output are as follows: Figure 5 As shown, the specific steps are as follows:
[0034] (1) First, calculate the attention score matrix and then perform a softmax operation on the attention score matrix. The calculation formula is as follows:
[0035] A = softmax(K) T ×Q)
[0036] Where A is the calculated (96+6)×(96+6) attention score matrix, and the attention score in the i-th row and j-th column of the matrix represents the correlation between the vector at time j and the vector at time i. The set buffer vector will concentrate the maxima of the unreasonable weights in the original attention score matrix on the row corresponding to the buffer vector in the new attention score matrix, thereby ensuring that the output vector can more evenly integrate the global sequence information.
[0037] (2) Discard the attention scores from the buffer vector to all vectors and from all input vectors to the buffer vector in the attention score matrix, and retain only the last 96 rows and the last 96 columns of matrix A to form a 96×96 matrix A. ′ A ′The algorithm removes the maxima of attention scores that are not properly allocated in the softmax result, resulting in a more uniform weight matrix.
[0038] (3) Use the matrix A formed in the previous step ′ The output vector sequence is calculated by weighted summation of each column of the V matrix formed by the input vectors, as shown in the following formula:
[0039] Output = V × A ′
[0040] The structure of the decoder is almost identical to that of the encoder, with the only differences being the following:
[0041] (1) First, there is a difference between the output method of the decoder and the encoder. The encoder can output a vector sequence of length 96 at a time, while the decoder can only output the vector at the current time step at a time. The final result can only be obtained by outputting the vectors at all 96 time steps in sequence.
[0042] (2) Next is the difference between the first self-attention module of the decoder and the encoder that uses the buffer vector. The first self-attention mechanism module of the decoder only has the start symbol vector and the buffer vector in the input vector sequence at the initial time. After calculating the output vector at each new time, the output vector is added to the input vector sequence of the decoder. When calculating the output vector at a certain time, only the self-attention calculation result of the existing input vector sequence is considered.
[0043] (3) Finally, there is the difference between the second self-attention module of the decoder that uses buffer vectors and the encoder. The input of the second self-attention module of the decoder is the Q and K matrices obtained from the encoder output and the V matrix obtained from the output of the previous module of the decoder. The cross-attention output result of the encoder and decoder is calculated.
[0044] The third step is to achieve real-time prediction of battery power and periodic updates to the model, such as... Figure 6 As shown, each time new data arrives, the battery feature vector from the first day of the input time series is removed, and the newly added feature vector for that day is added to the end. Then, the network is used to re-predict the battery power for the next 96 days. After more than one cycle of new data has been added, the network is retrained using the newly arrived data, and the original network is replaced with the network whose parameters have been updated.
[0045] Finally, here is a sample of battery capacity prediction results, such as... Figure 7 As shown in the figure, the blue curve represents the actual battery capacity, and the red curve represents the predicted battery capacity.
[0046] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for predicting battery power in a wireless smoke detector based on deep learning, characterized in that, Includes the following steps: The smoke concentration detection value, the number of daily fire alarm messages reported, and the total number of fire alarm messages reported since the equipment was installed were extracted from each device as three features related to the battery power of the smoke detector. These features were combined with the temperature, wind speed, humidity, and local features of the equipment itself on the same day to form a time series feature, which was then divided into a time series on a daily basis using a sliding window. Several buffer vectors are added at the beginning of the time series and input into the improved self-attention model. The improved self-attention model introduces a self-attention mechanism using buffer vectors and outputs the prediction result of battery power. In the improved self-attention model, n buffer vectors are added at the beginning of the input vector sequence so that the maxima of the unreasonable weights in the self-attention score are concentrated at the positions of the buffer vectors. Using a learnable parameter matrix , , The vectors q, k, and v are obtained using the following formula: in, Represents a vector in the sequence. , , The input vector generates three vectors: q, k, and v. However, each vector in the buffer vector generates only two vectors: q and k. The q, k, and v vectors of all time-time vectors are concatenated column-wise to form Q, K, and V matrices. The Q and K matrices contain the q and k vectors formed by the buffer vectors, and their size is dim × (M + n). The size of the K matrix is dim × M, where dim is the dimension of the q, k, and v vectors, and M is the sample length during training and testing. The self-attention mechanism specifically includes: Calculate the attention score matrix and perform a softmax operation on it. The calculation formula is as follows: Where A is the calculated (M+n)×(M+n) attention score matrix, and the attention score in the i-th row and j-th column of the matrix represents the correlation between the vector at time j and the vector at time i. The set buffer vector will concentrate the maxima of the unreasonable weights in the original attention score matrix on the row corresponding to the buffer vector in the new attention score matrix, thereby ensuring that the output vector can more evenly integrate the global sequence information. Discard the attention scores from the buffer vector to all vectors and from all input vectors to the buffer vector in the attention score matrix, retaining only the matrix itself. The last M rows and last M columns form an M×M matrix. ; Using the matrix The weighted summation of each column of matrix V for each v vector in matrix V is used to calculate the output vector sequence, as shown in the following formula: 。 2. The battery power prediction method according to claim 1, characterized in that, The time series features include 17 dimensions: smoke concentration detection value, number of daily fire alarm messages reported, total number of fire alarm messages reported since equipment installation, equipment battery level, field strength value, signal coverage level, signal level, signal-to-noise ratio, signal strength, equipment temperature, installation time, air temperature, wind speed, and maximum and minimum humidity values.
3. The battery power prediction method according to claim 1, characterized in that, The sliding window takes samples of length N+M days, using the first N days as the input vector for the model and the last M days as the actual values for training and testing.
4. The battery power prediction method according to claim 3, characterized in that, In the improved self-attention model, n randomly generated buffer vectors are added at the beginning of the input vector and position encoding is performed. Three vectors, q, k, and v, are generated for each input vector, and only q and k vectors are generated for the buffer vectors. Then, the q, k, and v vectors are processed through multiple rounds of self-attention, residual layers, and fully connected layers to obtain the encoder output.
5. The battery power prediction method according to claim 1, characterized in that, Whenever new data arrives for a new day, the battery feature vector from the first day of the input time series is removed and the newly added feature vector for that day is added to the end. Then, the network is used to re-predict future battery levels. After more than one cycle of new data has been added, the network is retrained using the newly arrived data and the original network is replaced with the network with updated parameters.
6. A deep learning-based battery power prediction system for wireless smoke detectors, characterized in that, include: Computer-readable storage media and processors; The computer-readable storage medium is used to store executable instructions; The processor is used to read executable instructions stored in the computer-readable storage medium and execute the deep learning-based battery power prediction method for wireless smoke detectors as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Decommissioned battery capacity prediction method and device based on deep learning time sequence algorithm
CN116559681A
Dam defect time-sequence image description method based on local self-attention mechanism
WO2023217163A1