Abstract
Hazardous chemicals need to strengthen the monitoring and management of storage because of its particularity to prevent the dangerous chemical accidents caused by improper management and avoid the loss of people’s lives and property. Due to the influence of environment, traditional positioning technology and may cause poor positioning accuracy. And it was difficult to realize real-time and accurate monitoring of hazardous chemicals warehouse. The improved TDOA algorithm based on wavelet transform was very important to ensure the storage management of hazardous chemicals. Error elimination algorithm based on Wavelet Transform can be used to obtain better positioning accuracy in the case of zero mean Gauss random variables under a small error. In order to verify the effect of wavelet based TDOA positioning error elimination algorithm, T1P1 channel model was used for simulation analysis. The comparative analysis was carried out through the simulation results of Chan algorithm, LS algorithm and the improved wavelet location error elimination algorithm. It can be seen by comparison that the improved algorithm was more effective than other two kinds of algorithms in different radius range, measurement error and channel environment, which can improve the positioning accuracy effectively.
Introduction
With the increasing demand of social production and the continuous development of production technology in our country, the status of hazardous chemicals in the social development was more and more important, and had a close relationship with people’s life. As early as 2014, China’s total annual production of hazardous chemicals has more than 30 thousand tons, and will further increase with the growth of social demand [1]. Hazardous chemicals had special corrosive, toxic, radioactive and other characteristics, so the production, transportation and storage and other aspects of hazardous chemicals had very special safety requirements in order to prevent the occurrence of safety accidents caused serious harm and endanger the security of people’s lives as well as caused serious environmental pollution [2]. Once the accidents happened to hazardous chemicals it was difficult to deal with, and the ecological environment caused by pollution was difficult to recover in a short time. In order to regulate the storage of chemicals, and avoid the disaster caused by the storage technology without standardized, countries around the world have introduced the chemical storage norms and constraints, China issued General rules for the storage of dangerous chemicals, which provided the goods stacking of dangerous ways in detail [3]. However, due to the company’s chemical storage was often only in order to meet the safety supervision and inspection, they placed at random for their daily use of convenience or cost savings, which was not in accordance with the requirements of the standard [4].
In order to facilitate the supervision and management of hazardous chemicals, and facilitate the management of enterprises, the precise position and relative relationship of various chemicals in the warehouse can be obtained accurately by using the 3D reconstruction system. According to the structure of the warehouse and the size of the chemical, the spatial modeling was carried out to reduce the stacking state, and it was compared with the national standard requirements for chemical piling up [5]. At present, indoor positioning technology has made great progress. According to the different positioning, it can be divided into network, mobile station and GPS positioning system. These three kinds of positioning systems had different characteristics and application scope. However, the wireless channel was very complex, so the positioning accuracy will be affected by the change of the environment [6]. Especially in the process of chemical storage, the chemical structure was small and the environment was complex, and the positioning precision was high. Therefore, it was necessary to eliminate the error in non-line of sight propagation as far as possible and improve the positioning accuracy. In this regard, wavelet analysis theory was used to eliminate the error of TDOA positioning accuracy of hazardous chemicals warehouse, which was helpful to improve the safety management of dangerous chemicals warehouse and was of great significance to the safe use of chemicals in China.
Hazardous chemicals storage and wavelet analysis theory
Hazardous chemicals warehouse positioning technology
There was a serious fire explosion accident in Tianjin Binhai company Ruihai dangerous chemicals warehouse on August 12, 2015. Affected by the accident, employees, firefighters, residents, a total of 165 people were killed and injured nearly 800 people as well as direct economic losses was up to $6 billion 866 million. In addition to causing a large number of casualties, this particular production safety accident has caused more than and 300 buildings, more than 10 thousand cars and more than 7 thousand containers suffered the loss. The scene of the accident was shown in Fig. 1. The accident caused serious economic losses, and has brought serious harm to the people’s physical and mental health. The accident also sounded the alarm for the storage management of hazardous chemicals in China. After investigation, the causes of the accident were that Ruihai company was not in accordance with the national laws and regulations for hazardous chemicals in the storage stack with security management confusion so that there was a long-term security risk without effective supervision [7]. Thus, it was necessary to take effective and effective supervision and management of hazardous chemicals storage. The modern precision positioning technology was used to conduct real-time supervision and understanding the hazardous goods warehouse so that timely find and solve problems to avoid improper storage of hazardous chemicals accidents to people’s lives and property safety threat.

Tianjin Binhai New Area explosion site.
The management of hazardous chemicals in China had a clear legal constraints and regulatory requirements, and the most typical of which was the regulation and supervision of the “five distance” in the warehouse of hazardous chemicals [8]. The five distances referred to the distance between the stamp and stamp, stamp and wall, stamp and beam, stamp and column, stamp and ground. They were not allowed to be less than the safe distance within a specified range [9]. This was the warehouse management of safety distance requirements. The utility model can realize the standardized management of the hazardous chemicals, such as avoiding light, neat, ventilation and firmness so as to prevent the safety hidden danger caused by the safety distance is too small [10]. Taking specific “five distance” requirement of three-nitrobenzene methyl ether in General rules for the storage of dangerous chemicals as an example: Your high limit was 2 m and the distance between the stamps was 0.8–0.9 m, and the distance from the wall spacing was 0.3–0.5 m and the goods stamp from the ground was 0.15–0.3 m [11], which was shown in Fig. 2.

Dangerous chemicals safety of the other side of the map door positioning.
These positioning technologies were suitable for the storage of hazardous chemicals [12]. It can be seen from locate technical contrast that UWB technology was reliable, safe, high precision, low cost and so on, which was suitable for the storage management of hazardous chemicals. The advantages and disadvantages of various indoor positioning methods were compared in Table 1.
Comparison of characteristics of multiple location methods
According to the needs of hazardous chemicals warehouse management, we generally needed to install UWB sensors for precise positioning. The positioning device was often installed in the monitoring area, and the electronic bar code was installed on the dangerous goods stacking cargo. In storage, we needed to read and write all electronic barcodes and stored in the system. We recorded the size of the goods and the specific attributes, and carried out the property parameters of hazardous chemicals and positioning signal reception through the network nodes [13]. In the daily handling of hazardous chemicals, we can understand the specific trajectory of the goods, and sent to the server in real-time for real-time monitoring and recording through the electronic tag. When the server changes according to the positioning data to reconstruct the dangerous goods changed amplitude or relative position was less than the threshold set in advance, we determined whether it was beyond the established stacking five distance requirements and chose whether conduct the alarm according to the situation [14]. When the system believed that it exceeded the safety requirements and alarm, supervision and management personnel can conduct on-site inspection and management in a timely manner and eliminated security risks or timely on-site emergency disposal to avoid major accidents.
Wavelet analysis theory originated from the field of signal analysis and it involved a wide range of basic knowledge, including statistical analysis, numerical analysis, signal and system and digital signal processing. It has been widely used in various fields since the 80 s of last century, such as computer identification, medical imaging, mechanical fault diagnosis, seismic wave detection and so on [15]. Wavelet analysis theory was based on translation and expansion method, and it developed from the theory of Fu Liye transform. We can analyze the signal from the time scales as to overcome the shortcomings of the traditional analysis of Fu Liye. That was to say, the size of the window can’t change with the frequency and lacked discrete orthogonal basis [16]. Wavelet analysis can be used to better characterize the local characteristics of the signal. Compared with the windowed Fourier transform, the wavelet transform had good time-frequency characteristics T Setting f (t), g (t) ∈ L2 (R), k1, k2 were arbitrary constants and there are:
This was the continuous property of the continuous wavelet transform. That was to say, the wavelet transform of the function was equivalent to the sum of the wavelet transform of the function component. In addition, the wavelet transform has the property of translation invariance, and the f (t) wavelet transform was WT
f
(a, τ):
When a signal was in accordance with a certain number of expansions, the wavelet was carried out in the same scale on the a axis and the τ axis respectively. The signal will not be distorted:
In addition, wavelet transform had the inner product theorem, differential properties and energy properties. Compared with the standard Fourier transform, the wavelet function ψ(t) had diversity. Based on this characteristic, we can get more appropriate results of wavelet analysis. As long as the function can satisfy the wavelet function that was the wavelet function and solved the new wavelet function according to the conditions created. Take the Morlet wavelet function as an example, its common expression was:
The corresponding Fourier transform was expressed as:
Morlet wavelet was a complex valued wavelet, which was often used to decompose the complex signal and time-frequency analysis. Thus, the complex value and phase information of the signal were extracted and analyzed. It also had a relatively good local video.
When the wavelet function was used for the two-dimensional discrete transform, only the scale function can be considered. One dimensional scaling function and the corresponding wavelet function can be set φ (x) and ψ (x). The two-dimensional square integrable orthonormal function space base:
Images were carried out 1/3 size image decomposition at each level of change. Based on the original image and wavelet image product, and then interval sampling was carried out in the direction of the row and column according to 2 times. To generate the form in Fig. 3 in order:

Sketch map of two-dimensional image wavelet decomposition process.
The effect and efficiency of different wavelet basis functions were different, so the difference between the results and the conclusions were needed to judge the pros and cons. The main factors were: complex and real wavelet selection, continuous wavelet effective support area selection, symmetry, regularity and similarity [17].
In practical application, due to the interference of different factors such as the environment or obstacles, the measured signal contains various kinds of noise and the model with noise was as follows:
Among them, noise signal was s (t), noise was n (t) and demand signal was f (t). At present, the signal noise reduction was mainly through the way of filtering. There were some shortcomings in the traditional noise reduction methods. One was the process of noise reduction may cause the loss of the main information leading to signal distortion and the second was that the entropy may be increased after the transformation. It was difficult to obtain a more stable signal [18].
The wavelet denoising method mainly had three kinds: Based on wavelet transform maximum principle, correlation denoising and threshold denoising. Among them, the most common method was threshold denoising, which was typical the application of wavelet transform in multi-scale characteristics [19]. But we needed to select the appropriate threshold in the choice of the threshold value. If the threshold was too small, it was difficult to remove completely to noise so that to affect the denoising results. If the threshold was too large, it will be distorted because the signal contained too little information. The specific steps for wavelet threshold denoising were as follows: (1) Analyze the signal to be processed in order to select the appropriate wavelet function to obtain the wavelet transform coefficient. (2) Calculate the threshold according to the empirical formula δ, and select the appropriate threshold method and choice of wavelet coefficients using W so as to obtain a new coefficient W δ (3) Using the quasi wavelet transform to reconstruct the signal, and finally achieve the target signal denoising.
Research on mathematical model and algorithm of location
In order to improve the accuracy of TDOA measurement positioning, wavelet analysis is used to eliminate errors. The distance between the mobile station and the base station can be estimated by TDOA in the wireless positioning system and the commonly used positioning algorithm. We can get the coordinate equations of the mobile station by constructing two or more measurements. The solution was the coordinate position of the mobile platform in the special coordinate system. The distance between the mobile station and the base station was R i with a total of M base stations. The mobile station coordinates was (x, y):
The measured value of TDOA was set to t il and the wave propagation velocity was c. The distance difference between the base station and the service base station was:
Further simplify:
Chan algorithm, Friedlander algorithm used the WLS or LS algorithm in the traditional positioning algorithm. Among them, the calculation of Chan algorithm was relatively small. Although the positioning accuracy can be obtained in the range of visual range, the positioning accuracy was seriously affected by the non-line of sight environment. The unknowns in the equations were less than the TDOA values considering on algorithms for 4 base stations, so the equations were nonlinear. It can be transformed into linear equations and the initial solution can be obtained by using a weighted least 20% algorithm. za = [x, y, R1]
T
was unknown.
If the noise error of the TDOA system was n
il
, the error vector was calculated as:
Calculate h value and G a value:
When the TDOA error is small, the error vector was calculated as ψ = BQB. The weighted least squares method was used to solve the problem for the first time:
A new error vector was constructed:
Formula (15),
The covariance matrix of ψ′ was calculated as:
Then the second WLS and third WLS calculation were carried out to obtain the conclusion that:
The results of the final positioning calculation:
When the error was small, the algorithm was subject to the zero mean Gauss random variable so as to obtain a better positioning accuracy. When the actual measured value of TDOA was obtained, it may be caused by the influence of channel environment to cause greater error.
Based on the wavelet transform, the TDOA measurement value was corrected to eliminate the measurement error. The TOA value of the mobile station to the i base station was
If the errors were independent of each other, you can get the same TDOA measured value in the NLOS environment:
The error of position measurement was composed of the random variable and the Gauss error of zero mean. The change trend of errors in the measured data was faster than the measured value the noise in the signal and the mutation can be distinguished effectively by using the wavelet analysis theory, which can be used to deal with the useless data in the original data. Because the measured value was low frequency signal and the noise was high frequency signal. According to the different distribution, the measured values can be divided into three layers to conduct wavelet decomposition (see Fig. 4).

Three layer wavelet decomposition.
If we used wavelet threshold denoising, we can use the appropriate threshold to deal with the high frequency of wavelet coefficients. Then the signal was reconstructed by the new coefficients so as to achieve the purpose of noise reduction. Using the modified method of error elimination was the key to select the wavelet and threshold value. These two had a decisive influence on the result of signal processing.
The distribution of wavelet coefficients was related to the results of signal processing directly. Now we chose the wavelet function coefficient in accordance with experience and experiment. According to previous studies, we can see that DbN wavelet system had good orthogonality and compact support. The N can be selected flexibly, so the length of the wavelet function can be well controlled. The threshold signal was selected by using the default threshold. Noise standard deviation was set as σ. If the sum of wavelet coefficients on a scale was n, the general formula of the threshold was:
Therefore, the error elimination procedures based on Wavelet for TDOA were: First, if there was a base station in the system network, one of them was set as a service base station, and you can calculate a TDOA value. Second, the wavelet transform was used to measure the TDOA value, and the decomposition level was selected according to the dominant position of the noise in the signal. Third, to calculate the default threshold and the threshold was used to choose wavelet coefficients. Fourth, the new coefficients were used to carry out the inverse wavelet transform to reconstruct the TDOA value after eliminating the error.
In order to verify the effect of wavelet based TDOA positioning error elimination algorithm, computer simulation software was used to simulate the algorithm so as to carry on the comparative analysis of the wavelet error elimination algorithm, Chan algorithm and LS algorithm. The simulation used the T1P1 simulation channel model, which was also called the COST259 channel model. In the model, each channel had a certain number of scatterers with their average power, time delay and angle characterization. There were a certain extension and excessive delay between the results of the T1P1 model and the actual measured values. It can be applied to different environments such as urban, suburban, rural and mountainous areas. Specific parameters of different channel conditions were shown in Table 2.
T1P1 channel model parameters
T1P1 channel model parameters
T1P1 simulation channel model was used to verify the effect of the error in NLOS environment and the mobile station was distributed in the 1/12 cell evenly. The TDOA measurement errors under the model was independent of the distribution of Gauss random variables. The mean value was 0 and the standard deviation is about 0.1 per30 m. Different location algorithm was defined under different cell radius. From 1000 to 5000 of the cell radius range, the performance of the three localization algorithms was decreased. But the TDOA based localization algorithm based on wavelet transform had the best effect on non-line of sight error, which was shown in Fig. 5.

Comparison of localization algorithms in different cell radii.
Simulation results of various positioning algorithms under different measurement errors were shown in Fig. 6. It can be seen from the figure that with the increase of measurement error, the root mean square error of the three positioning algorithms increased. But the root mean square error of the improved algorithm was smaller. When the error was small, the root mean square error of the improved positioning algorithm was small and relatively stable.

Comparison of different positioning algorithms under different measurement errors.
Most of the dangerous chemical storage warehouses were located in the suburbs or other densely populated areas. The simulation analysis of three kinds of location algorithms were carried out in the suburbs in this paper, such as near areas, urban areas, city areas and mountainous areas. The channel environment was different in different regions. It can be seen from Fig. 7. With the change of the channel environment, the non-line of sight error and root mean square error of the three kinds of localization algorithms were decreased. However, the improved algorithm was superior to the other two algorithms in different environments. It showed that the localization algorithm based on wavelet transform had a good effect on the error and improved the positioning accuracy of the mobile station.

Comparison of localization algorithms in different channel environments.
The theory of wavelet analysis can reduce the characteristic of signal and noise effectively and they were applied to the TDOA positioning error elimination algorithm of hazardous chemicals storage to improve the positioning accuracy. The error elimination procedures of TDOA location based on improved wavelet were: K-1 TDOA measurements were calculated in K base stations. The default threshold was calculated according to the relationship between the dominant noise selection of decomposition level after wavelet transform, and finally wavelet coefficients of new wavelet was used to conduct anti change so as to achieve the elimination of error. In order to verify the improved wavelet algorithm for TDOA positioning error, the algorithm was simulated with LS and Chan localization algorithm in T1P1 simulation channel model. It can be seen through the simulation analysis that compared with the LS and Chan algorithms, the improved algorithm had the best effect on the non-line of sight error. In the case of different measurement errors, the root mean square error of each algorithm increased with the increase of the error, and the root mean square error of the improved algorithm was smaller. Under the different channel environments such as mountain area, urban area and suburb, the non-line of sight error and root mean square error of the three kinds of localization algorithms were decreased, but the improved algorithm was better than the other two algorithms. Therefore, the accuracy of the improved TDOA positioning error elimination algorithm met the safety monitoring management of hazardous chemicals, which can be applied to specific practice.
