Abstract
Aiming at the problems of leakage alarms and false alarms in fire detection systems, this paper explores the commonality and characteristics of its development process through in-depth analysis of typical fire detection and fire alarm modes at home and abroad and effectively summarizes the process of building fire alarms. In the case of fully grasping the principles of fire alarm and related policy protection, find out the appropriate development mode of fire alarm. At the same time, it can also study the perspectives of the government, the market, and the public, according to the needs of the market, it can be driven by industry and technological innovation can be used as a strong support for the development of fire alarm. Finally, the results of example analysis show that: using blockchain, this paper can effectively obtain high-precision fire detection and fire alarm target analysis results, and meet the needs of real-time analysis of fire detection and fire alarm analysis. Experiments show that the system can detect fires correctly and quickly, and identify interference sources such as fluorescent lamps and alcohol lamps. It has strong interference and good economic benefits.
1. Introduction
Fire detection technology is mainly based on the processing of signals by different types of sensors to complete fire detection and early warning. With the continuous increase of fire detection and fire alarm in China, the large-scale fire detection and fire alarm in China have developed rapidly, and more fire alarm methods have emerged [1, 2]. Detailed analysis of fire alarm methods is carried out, in order to explore the problems and shortcomings in the fire detection and fire alarm process, so as to formulate training and improvement plans later. In the process of traditional fire alarm methods [3, 4], two-dimensional maps are usually mainly used for fire detection and fire alarm analysis of fire alarm methods. However, because two-dimensional maps can only describe the relative height of the environmental plane information, they cannot provide relatively complete data information [5, 6]. The requirements of the fire alarm mode now require that the fire alarm mode enterprise can solve the one-stop service system, provide strong support for life, and allow the entire fire alarm mode to obtain the highest economic benefits, which is the overall goal of the fire alarm mode enterprise. Fire detection and fire alarm analysis play an important role in fire alarm methods. A good fire detection and fire alarm analysis system can speed up the flow of fire alarm methods, reduce costs, ensure the normal operation of services, and at the same time achieve effective management of resources and use.
In order to effectively improve the accuracy of fire detection and fire alarm analysis in the process of fire alarm mode, this paper proposes a fire alarm mode method under the blockchain and uses the blockchain to analyze the real-time evolution of targets in fire detection and fire alarm. Finally, through the analysis of the experimental results, it is shown that by comparing other specific practices of fire detection and fire alarm, this paper designs a fire alarm system with image information, which improves the speed and reliability of the system’s alarm output, and can correctly identify switch interference such as fluorescent lamps and candles to prevent interference.
2. Methods
2.1. Related Technologies of Fire Image Detection
The blockchain golden fox mainly connects multiple units according to the appropriate method, and the most basic unit is called the meta-network, which is mainly composed of elements, connection methods, and activation functions. The protrusion of the nerve is connected; the activation function is mainly a linear mapping and a nonlinear mapping in the system, and at the same time, the output of the neuron can be limited within a specific range. Among them, the basic model of the blockchain is shown in Figure 1.

The blockchain model can be represented by the following formula:
In the above expression: represents the real situation inside the blockchain; represents the deviation (threshold) of the blockchain; represents the input signal, represents the i-th input node value; and represents the j-th blockchain The output value of represents the weight from the input node in the blockchain; and f represents the activation function.
2.1.1. Step 1: Construct the User-Blockchain Evaluation Matrix
The blockchain is represented by a matrix , where m represents the specific number of users, n represents the number of blockchains, and the element in column j of the i-th row represents the evaluation score of user i on blockchain j. If it satisfies , it means that the evaluation is closer to 0, and correspondingly, it means that the user is not aware of the alarm method for this blockchain. If the evaluation value is closer to 5, it means that the user is very high on this blockchain, and 0 means that the user has not responded to this blockchain. Do an assessment. The user-blockchain corresponding evaluation matrix is shown in the following expression :
2.1.2. Step 2: Construct the Similarity Matrix
First, the user’s blockchain needs are expressed as an appropriate user alarm mode model, the most general form of which is the user alarm mode vector. Then, the blockchain items to be processed are represented as vectors of the same dimension. Computation of the user’s blockchain requires the similarity between the vector and each blockchain object vector. In order to better represent the user’s alarm mode and reduce the computational complexity, the blockchain purpose feature model and user-sensing alarm mode model are represented by the space vector method. The space vector representation can not only contain the data information of the user’s alarm mode in detail, but also can construct a vector model with this keyword, and complete the weight value of each vector model according to the user’s alarm mode. Combined with the content-blockchain project, it can be divided into two types: text-based blockchain and nontext-based blockchain. Among them, for text-based blockchain projects, the TF-IDF algorithm can be used to calculate the weight value. For nontext blockchain projects, their weights can be calculated with the help of the error value between blockchain attributes and user attributes.
For nondocument-type blockchains, the weight of blockchain j for attribute is calculated as shown in the following formula:
For projects with blockchain attributes, the user’s alarm method does not consider absolute positive or negative, and usually can also represent any value between [0, 1] according to his or her alarm method preference. The weight calculation formula of the feature item is as follows:
Among them, is used to indicate the degree of user i’s liking for the attribute feature of the blockchain, that is, the so-called weight value. If the calculated value is closer to 1, it indicates that the secondary user has a higher interest in the attribute feature ; represents the sum of the evaluations of the attribute feature under the evaluation of user i; and represents the sum of all evaluation scores of user i. The sum a, b represent the number of items corresponding to the blockchain evaluation in turn.
According to the space vector representation of the function, the alarm mode of user i can be represented by a vector, the feature vector of j in the blockchain can be represented by a vector, t represents the attribute feature in the blockchain , and represents the weight of the feature item in the model . Then the similarity expression can be obtained as
Process the similarity so that the similarity is numerically consistent with the score:
From the calculated similarity, the structural similarity matrix is shown in the following formula:
2.1.3. Step 3: Construct a New User-Blockchain Evaluation Matrix
According to the evaluation matrix and similarity matrix obtained above, the 0 values that have not been evaluated in the evaluation matrix of the original user-blockchain can be replaced, and can be converted into the values in the corresponding similarity matrix [7, 8], and then the-region block chain evaluation matrix, assuming that the value evaluated by the new matrix is represented by
Therefore, the new user-blockchain evaluation matrix is expressed as
2.1.4. Step 4: Retrieve Neighboring Neighbor Evaluation Items
Searching for optimal neighbors is the core content of the algorithm cited in this paper, and the efficiency and effect of this process also affect the efficiency and effect of the push algorithm to a certain extent. Similar to the optimal neighbor mainly refers to the user group that is relatively close to the user group under the current evaluation operation. The similar optimal neighbor is actually a process of building a model in the blockchain, that is, using the evaluation matrix of the blockchain, The similarity between the user i and the user j is calculated by the similarity algorithm, which can be represented by sim(i, j). The set of blockchains evaluated by user i and user j is represented by , then the corresponding sim(i, j) can be calculated by using the Pearson correlation coefficient. The calculation formula is expressed as follows:Here, the evaluation value of user i to blockchain c in the blockchain evaluation matrix is represented, and the evaluation value of user j to blockchain c in the blockchain evaluation matrix is represented. ,,, and represent the average evaluation values of user i and user j in turn.
2.1.5. Step 5: Push the User’s Content Similarity
The degree of similarity that can be calculated can accurately find the similar optimal neighbors of the target user and complete the push to its blockchain. Assuming that the nearest neighbor set of user u is represented by , then the evaluation value of user u to blockchain i, using , can borrow the evaluation of the blockchain in the nearest neighbor set of user u, and the calculation process is as follows:
Among them, sim(u, n) represents the similarity between user u and user n, represents the evaluation of user n on blockchain i, and represent the average value of user u and user n on the blockchain in turn.
There are two main stages to running the blockchain.(1)Training phase: In this phase, the input data and output data of the sample are input or output to the blockchain, the weights and thresholds of node connections are learned and modified, and the parameters are optimized by numerical calculation methods until the generated output matches the required value. Required value.(2)Prediction stage: This stage is mainly used to predict unknown samples. The blockchain is based on gradient descent learning, and the algorithm can modify the weight value in the opposite direction of the error performance function gradient. Figure 2 shows a block chain-based image detection block diagram.

The training samples of this paper include 9 mineral lamp images, 9 incandescent light bulb images, 9 lamp images, and 50 fire images in total. Select 25 samples of the trained neural network as the input of the neural network, in which 10 flame images, 5 incandescent light bulb images, 5 miner’s lamp images, and 5 car lamp images are collected, and the collection speed is 25 f/s.
2.2. Fire Detection and Fire Alarm Model
In this paper, the fire alarm system design based on SEED-VIM642 mainly adopts DSP technology. On the basis of sufficient traditional alarm methods, the digital image processing technology is effectively combined to design a fire alarm system. Data is mainly divided into information layer, feature layer, and decision layer (Figure 3).

If there is a fire, the gray value of the image corresponding to the fire scene will change due to the random movement of the fire smoke, and the pixel value of the corresponding fire image will also change differently, and then the gray value will change in a matrix, which changes. This will be accompanied by changes in the values of parameters such as energy, partial changes, and inertia. If the image parameters of the fire scene are represented by x1, x2, x3, and x4 in sequence according to the row vector, the average fluctuation of the change trend of the fire scene image can be expressed as
According to the average energy fluctuation, the change parameters of the fire texture can be judged. The parameter judgment of the fire feature layer is mainly based on the neural network data recognition method. The fire monitoring system constructed by this method can improve the fault tolerance of the system against changes in the environment [9, 10]. The corresponding the network structure is shown in Figure 4.

The network structure of the blockchain is mainly composed of a radial-based network layer and a conflicting network layer. For the pattern classification of small samples in the blockchain-based fire image detection, in general, we choose to use the blockchain based on the process of building small samples and nonlinear models, and choose to use functions and penalty factor. For a given model sample , the blockchain can be used to transform the problem into:
The parameters that can be solved for the blockchain function are expressed as
In the process of solving the above problems, the most common method is the conjugate gradient method. This method has the advantages of simple operation and large data storage, and has the advantages of fast convergence speed, and so on. It can better solve the above problems. The conjugate gradient method needs to obtain the search direction, and the step factor as the premise of the calculation. Based on the blockchain, this paper uses the conjugate gradient algorithm to realize the sum of the squares of the sample errors to construct the blockchain model. The process of fire image detection based on blockchain is shown in Figure 5.

2.3. Flame Image Processing Process
Grayscale conversion: Since the values of R, , and B range from 0 to 255, the grayscale level is 256, that is, a grayscale image can only express 256 colors (grayscale). On the other hand, since a grayscale image is easy to handle and convert, the image of the processing object is first converted to a grayscale image. In order to convert into a grayscale image, the weighted average method is used, and the expression is as follows:
In the formula, R is red light with a wavelength of 700 nm, is green light with a wavelength of 546.1 nm, B is blue light with a wavelength of 435.8 nm, is the weighted value of red light, is the weighted value of green light, and WB is the weighted value of blue light value.
According to the principle of three colors, the most reasonable grayscale image is obtained with = 0.30, = 0.59, and = 0.11. Using the weighted average method, as shown in Figure 6, the 24 bit true color image of the flame was converted to a grayscale image.

2.3.1. Binarization of Images
The image binarization process is essentially a kind of image segmentation method. The effect of binarization enhances the contrast of the image. The binary image is the basis for the subsequent target recognition. Therefore, it is important to obtain a binary image with less interference pixels. The most important problem in the binarization process is obviously the problem of threshold selection.
(1) Iterative threshold method. The threshold iteration scheme can automatically search for a relatively suitable threshold through the program. If the iterations are repeated in this way, there is no change in the switching function, i.e., if the iterations converge to a stable threshold, the current threshold is used as the final result of image segmentation. The iterative look at equation: in the expression represents the threshold value of the image solution for the i-th iteration; L represents the number of gray levels; and represents the number of pixels with a gray value of k. The binarized image solved using the above method is shown in Figure 7.

(2) Maximum inter-class variance method. The basic idea of the maximum interclass dispersion method is to use the grayscale histogram of the image to dynamically determine the segmentation threshold of the image with the aim of maximizing the dispersion of the target and the background. The operation process is as follows: take a gray value, use the gray value as the boundary, divide the image into two gray value sizes, and calculate the number of pixels and the gray average value of the two types, respectively. Next, these interclass dispersions are calculated, and finally the gray level corresponding to the maximum value of all gray level interclass dispersions is used as a threshold. The quoted formula (17) for calculating the variance between classes:
In the expression, and are the pixels whose grayscale is less than i, the number of pixels whose image is not less than i, and represent the corresponding average values of and in turn. ω(i) is expressed as a function of the gray value of the image as a parameter, and the function value of the solution image is set as the maximum value, that is, the binarization threshold of the image corresponding to the case where ω(i) and the maximum value are solved is shown in the following expression:
Among them, T represents the segmentation threshold of the binarization of the image.
Figure 8 shows a binarized image obtained by the maximum interclass dispersion method.

Comparing Figures 7 and 8, it can be seen that the maximum interclass dispersion method can better achieve the separation of flame and background.
In order to highlight the characteristics of the flame in the image, the small flames in the image need to be removed, and this can be achieved using erosion and dilation algorithms in mathematical formal processing. As shown in Figure 9(b), Figure 9 shows a processing example of performing an etching operation on a target image using structural elements to obtain a calculation result (as shown in Figure 9(c)).

(a)

(b)

(c)
Figure 10(a) is the original image, the constituent elements used here are crosses (as shown in Figure 10(b)), and Figure 10(c) is obtained after the expansion process. The pixels represented by black are new pixels that are generated by expansion that do not belong to the original target, and the pixels represented by gray are the position of the original image. As can be seen from Figure 10, dilation merges all background points in contact with the target to the target, the direct result of which is to expand the coverage area on the boundary by augmenting the original target image. Figures 11 and 12 show the results of the etching and dilation calculations of the flame binarized image.

(a)

(b)

(c)


The method described in this article can be operated through the following steps. For images with inconsistent formats from a wide range of sources, they need to be converted into grayscale images first; after binarization, they are converted into black and white bitmaps; finally, image morphological methods are used to remove noise. Remove furniture outside the building and objects of the text introduction class. Therefore, in different cases, most of the building interior plans are in the form of “horizontal, horizontal and vertical”, and the Hough method is used to convert two important directions. By rotating the obtained image around the x-axis and y-axis, the image block is obtained to improve the vectorization efficiency of the image.
The software research of image manipulation function is the process of blockchain object identification and processing. When 3D products are operated in image recognition technology, first of all, it is necessary to obtain the feature values of the target through target expansion training, and establish an effective and useful feature map [3, 11]. During the operation of the system, the feature value of the current operand is obtained, which is consistent with the feature map to achieve the purpose of identifying the target object. Figure 13 shows the flow of the image processing module.

As shown in Figure 13, 3D modeling products require image preprocessing during image processing, which is also used to minimize image data and improve the detectability of useful information. Image segmentation is the technique and process of segmenting an image into several specific regions with unique properties and proposing objects of interest. Create a feature map consistent with image attribute values, extract the target object, and find the most effective attribute from multiple features. Image matching refers to the comparison between the extracted feature quantity and the feature mapping table to achieve the purpose of target object recognition.
2.3.2. Region Blocking Based on Integral Projection
After the preprocessing is completed, in order to quickly segment each wall region, the average integral projection function is used to extract the image region containing the wall line. If there is a change in the pixel gray mean value of a column (row) of an image, the change will respond to the mean integral projection value of the column (row) [12, 13]. The mean integral projection function is shown in the following equation:Here, I(x, y) ice point (x, y) pixel gray value; Mv(x)[y1, y2] presents the vertical mean integral projection function in the interval. Mh(y)[x1, x2] represents the horizontal mean integral projection function in the interval.
2.3.3. Block Image Vectorization
Through the integration head-type process, the whole image is divided into multiple word images, and each subimage includes multiple vertical or horizontal image units and some architectural data of the wall geometry are obtained through the line segment coupling of the postoperation bandwidth. Therefore, for the characteristics of these subimages, the advantages of the traditional SPV method and calculation level are maintained, in which the SPV is not in place in the recognition of the axes and small structures in the picture, and the discrimination ability of the intersection of lines is calculated. The adjustment is proposed and applied to separate images, which is helpful for the recognition and vectorization efficiency of graphics. The central points are detailed below.
(1) Selection of axis point and tracking direction. In the vectorization method used above, by searching for the axis points, the scan lines are scanned from the upper and lower sides of the preset block binary image. If the first black pixel point to be scanned is P0, scan to the right from P0 until the first white pixel point P0 and 39, and obtain the horizontal running midpoint P1 at the same time. Then, start from P1 and scan twice in the opposite direction from the vertical direction, passing through the midpoint P2 in the vertical direction. Similarly, it is necessary to ensure that the distance from P2 to the midpoint P3 of horizontal operation is less than the previously set value. The value of is generally 1 pixel. Therefore the point is defined as the pivot point. Through the experiment, get the correct starting axis point and repeat 3∼5 steps normally.
After passing the axis point , the horizontal and vertical values of the point are obtained. If the width in the horizontal direction and the width in the vertical direction are longer, the inclination of the line in the horizontal direction is less than 45°, and the length direction of the line segment is considered to be horizontal, otherwise the length direction is vertical. The width and length directions of the segments intersect. In this method, determining the length direction is the determining direction of the post-tracking procedure.
(2) Determine the sparse point. Through the length of the action, the search is carried out. Assuming the length action is horizontal then the search direction is from right to left; assuming the length action is vertical, it should be from bottom to top. Figure 13 shows that it is found that not long is the previously determined value, through the current P4 (P’4), and then moves the red arrow direction to the tracking step and then moves it to the black pixel value. Continue and trace the vertical behavior in both directions through this value, while crossing the white pixel values and and . Calculate the series number P5 (P’5) of the white pixel value, which is a new central axis number, and the value of the record point line width is cut off tracking. If three conditions are met at the same time, a new query needs to be started from this point [14–16].(1)The line width difference between the new central axis number and the previous central axis number is within the receiving range;(2)The new central axis number has never been queried;(3)The real search step is greater than the value 0.
In image connections such as intersection regions, branches, rotation angles, the node segmentation procedure is usually executed in violation of these three conditions.
(3) Node segmentation. If you violate one or more of the keep track conditions, the sparse point tracker will pause and node splitters, such as segment intersections and corners, will be enabled. Node segmentation is repeated in the following 3 steps [17, 18].(1)Return to the previous central axis point;(2)Adjust the tracking step to half of the current step.(3)Detect the continue condition at the new location.
When the detection fails, halve the step size and repeat. However, if the point at the new location satisfies all the conditions to resume the original tracking step from that point, the tracking is performed. The repeated tracking step size is 0, the node segmentation process ends, and all the conditions found at the end are satisfied to be the new central axis point. Through such processing, the program can divide the cross area into 3 straight line segments more accurately with the intersection as the boundary, and the corner polyline can be divided into two very accurately.
(4) Line segment integration. Because of the factor of image quality and line segment intersection, the original line to be connected is vectorized and divided into multiple separated line segments. To deal with this situation, it is necessary to combine the next line segments to achieve the combination of line segments connected at the same time in a horizontal line with the same line width. Import the line segment to be solved, with the structure of start, end coordinate direction, and line width data [19]. By using the end coordinates to remove the start coordinates, the number of each line segment can be obtained, and the value of each two angles can be calculated by vector calculation. If the angles of the two vectors are similar to 0, it can be concluded that the central axes of the two line segments are almost parallel. Assuming that the two parallel close distances are smaller than the predetermined line width, the two straight lines are combined, and the intersection segment through the node segmentation procedure is integrated into a complete line.
3. Experiment and Result Analysis
Figure 14 shows the hardware structure of the fire alarm system. The model of the temperature sensor is CHD301C smoke sensing instrument model CHD-LH93, which is connected to the RS485 serial port of the SEED-VFM 642 development platform through the RS485 bus. Each sensor is connected to the 485 bus with a 1-to-20 Ω resistance, and data collection errors due to the failure of a single sensor can be avoided. The sensor at the end of the RS485 bus can improve the reliability of the RS485 bus communication by connecting a 120-Ω resistance to the terminal in parallel.

Figure 15 shows the characteristic parameter change curve in the fire experiment.

(a)

(b)

(c)
In Figure 15(a), there are obvious differences in the average fluctuations of texture parameters before and after the fire: before the fire, the average fluctuations of the texture parameters are relatively mild and relatively small; relatively large, the characteristic of this change is the manifestation of the out-of-control state after the fire. Therefore, the average variation of texture feature parameters can be used to quickly identify fires. In Figures 15(b) and 15(c), the temperature data began to rise from 4.32 s after the fire, and the smoke density data began to rise 12.16 s after the fire. The upward trend of these two parameters can also be used separately to identify fires.
The second group of experiments was the nighttime fluorescent light interference experiment. During the experiment, 1639 frames of images were collected, and the fluorescent light was turned on before the experiment. The 369th frame corresponds to the time when the fluorescent lamp is turned off, the 680th frame corresponds to the time when the fluorescent lamp is turned on, and the 1086th frame corresponds to the time when the fluorescent lamp is turned off again. The experimental characteristic parameter change curve is shown in Figure 16.

The third group of experiments was the alcohol lamp interference experiment during the day. During the experiment, 660 frames of images were collected, of which 370 frames of images corresponded to the lighting time of the alcohol lamp. The experimental characteristic parameter change curve is shown in Figure 17.

Figures 16 and 17 show that step changes occur in the texture parameters of the images of the two frames before and after the lighting of the fluorescent lamp and before and after the lighting of the alcohol lamp, and the average variation of the texture parameters suddenly increases and then suddenly decreases. This feature is significantly different from the average variation in the texture parameters of fire images and can be used to distinguish fire or disturbance. The second peak in Figure 17 is mainly affected by wind.
In the experimental process of this paper, we choose to monitor the fluctuation of the average value of the fire image texture based on the blockchain, judge the temperature and smoke density of the on-site fire, and select the fire trend in turn to judge the trend of the fire. The samples of the blockchain input variables are mainly the average texture fluctuations corresponding to 50 consecutive frames of images containing fire images. The fire data obtained during the first experiment collected 659 frames of images. After image processing, 658 texture average fluctuations can be obtained. At the same time, the fire data information contained in the corresponding fire input samples can be input with 628 samples, which can improve the recognition accuracy of the fire. The output of the blockchain sample is mainly based on the state change of the current fire scene image, that is, when the fire occurs. The fire is represented by 1, and 0 is used in the case of no fire. The output sample does not include the 50 frames of fire images used for testing. In this paper, based on a large number of fire experiments, the sample data is trained and the texture parameters are identified. The sample test during the experiment, as shown in Figure 18, the images corresponding to the 264 frames in the image are mainly based on the fire detected by the blockchain, and the response time is 1.1 s, so the fire alarm system with the fire image can accurately detect fire conditions.

In this paper, a threshold algorithm is used to identify the smoke concentration, and the threshold is 50%. In the first set of experiments, the moment of recognizing the fire under the temperature is the corresponding moment of the 339th frame image, and the reaction time is about 13.3 s, and the moment of recognizing the fire under the smoke density is the moment corresponding to the 369th frame image, and the reaction time is about 18.1 s. In the experiments of groups 2 and 3, the temperature and smoke density did not change, and the classification results were all nonfire patterns. To sum up, Table 1 shows the combination of fire alarm system outputs during the first set of experiments.
Table 1 illustrates that the identification results of texture parameters can provide early warning of fire, the identification results of temperature and smoke density data are used to confirm the occurrence of fire, and the interference prevention of fire alarm system can be improved.
4. Conclusion
In this paper, fire detection and fire alarm are studied in detail, and a computational model is proposed. This lightweight computation method can provide efficient block segmentation for the features of fire detection and fire alarm, and can improve the speed of vectorization. According to the discrimination of fire detection and fire alarm, blockchain technology is adopted, and corresponding calculation measures are given to ensure the accuracy of the background, and also improve the work efficiency. This method analyzes the process, can adjust the parameters intuitively, effectively detects and alarms fires, and saves and reads information more conveniently. It can also speed up fires in critical locations. High reliability detection. The fire alarm system based on this method has proved through experiments that it can detect fire correctly and quickly, and identify the interference sources such as fluorescent lamps and alcohol lamps, and has strong interference.
Data Availability
The data used to support the findings of this study are available from the corresponding author upon request.
Conflicts of Interest
The authors declare no conflicts of interest.
Acknowledgments
This research study was sponsored by the Major Project of Science and Technology of Yunnan Province, the project numbers are 202002AD080002 and 2019ZE005; National Natural Science Foundation of China, the project number is 32160374; and Yunnan Fundamental Research Projects, China, the project number is 202101AT070045. The authors thank these projects for supporting this article.