Closed space microenvironment prediction method, terminal device and storage medium
A data-driven method using Spearman correlation and LSTM networks predicts confined space microenvironments, addressing dynamic changes for accurate assessment and protection of sensitive equipment.
Patent Information
- Application Number
- CN202411294917.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2024-12-13
AI Technical Summary
Existing methods struggle to accurately predict and grasp the dynamic changes in the microenvironment of confined spaces, which are crucial for sensitive equipment and materials, due to real-time environmental variations.
A method involving data collection, preprocessing, and model construction using Spearman correlation to determine lag times, followed by a data-driven prediction model with LSTM networks for accurate microenvironment forecasting.
Enables precise prediction of internal environmental factors, providing early warnings and aiding in damage assessment and life assessment of materials and devices within confined spaces.
Smart Images

Figure CN119128491A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of natural environment testing, and in particular relates to a method for predicting a microenvironment in a confined space, a terminal device and a storage medium. Background Art
[0002] There are a large number of confined spaces in modern industrial construction, such as various equipment warehouses, server rooms, transport cylinders, packaging boxes, submarines, etc. Confined spaces can effectively isolate the influence of adverse environmental factors such as external pollution and corrosive media, and are also conducive to the concealment of one's own facilities and equipment. However, the environmental conditions inside the confined space may be significantly different from the external environment, and the real-time dynamic changes in external environmental factors make it a major problem to quickly and accurately assess the microenvironment inside the confined space. In particular, some high-tech equipment and equipment contain electronic components, precision optical components, energetic materials, etc. that are very sensitive to the microenvironment. It is very necessary to accurately grasp the characteristics and changing laws of the microenvironment in the confined space. Summary of the invention
[0003] In view of the above-mentioned deficiencies in the prior art, the technical problem to be solved by the present invention is: how to provide a method for predicting the microenvironment of a confined space, a terminal device, and a storage medium, so as to predict the microenvironment inside the confined space and accurately grasp the characteristics and changing laws of the microenvironment within the confined space.
[0004] In order to achieve the above-mentioned purpose, in a first aspect, the present invention discloses a method for predicting the microenvironment of a confined space, the method comprising: collecting internal and external environmental data of a confined space; preprocessing the internal and external environmental data of the confined space to obtain internal and external preprocessed environmental data; optionally taking a type of data K in the preprocessed environmental data as the data basis, and determining the microenvironment lag number corresponding to the highest Spearman correlation coefficient; based on the microenvironment lag number, determining the model input and output sequences, and confirming Ne sensitive environmental factors of the model input sequence based on the correlation coefficient; constructing and training the model to obtain a final prediction model; and predicting the microenvironment of the confined space based on the confined space environmental data and the final prediction model.
[0005] Optionally, when collecting the environmental data inside and outside the confined space:
[0006] When the external environment of the enclosed space is an outdoor exposure environment, the external environment data of the enclosed space at least includes atmospheric temperature, humidity, solar radiation intensity, and wind speed;
[0007] When the external environment of the enclosed space is a storage environment in a warehouse, the external environment data of the enclosed space includes at least temperature and humidity;
[0008] The internal environment data of the enclosed space includes at least temperature and humidity;
[0009] The preprocessing of the environmental data inside and outside the enclosed space at least includes alignment processing.
[0010] Optionally, one of the data K in the optional pre-processed environmental data is used as the data basis, and the content of the microenvironment lag number corresponding to the highest Spearman correlation coefficient is determined as follows:
[0011] Take Q cycles of external K-type preprocessing environment data sequences as comparison sequence s1; Q is greater than 2;
[0012] A typical periodic sequence s2 is intercepted from the internal K-type preprocessing environment data in the same time period as the Q-period external K-type preprocessing environment data sequence, and the starting time position X of s2 is recorded;
[0013] Slide the typical periodic sequence s2 on the comparison sequence s1 in turn to obtain the correlation coefficient;
[0014] Determine the sliding position S where the correlation coefficient is the largest d ;
[0015] The microenvironment hysteresis number n was calculated;
[0016] nδ=(XS d )δ;
[0017] S d is negative, indicating that sequence s2 is ahead of sequence s1; S d is positive, indicating that sequence s2 lags behind sequence s1;
[0018] δ is the time corresponding to the lag unit.
[0019] Optionally, the sensitive environmental factors of the input sequence confirmed based on the correlation coefficient select environmental factors with a medium sensitive environmental factor level.
[0020] Optionally, the model is constructed and trained to obtain the model construction content in the final prediction model as follows:
[0021] Determine the model time series input and output: Ne sensitive environmental factors are used as time series input;
[0022] Output one of the internal environment data predicted by the model as a time series;
[0023] Input Ne sensitive environmental factors into the main structure of the prediction model, and finally output the constructed model.
[0024] Optionally, the model building and training to obtain the final prediction model includes at least the following steps:
[0025] Data normalization and denormalization processing, deep learning model hyperparameter tuning processing, and k-fold cross validation processing.
[0026] Optionally, based on the confined space environment data and the final prediction model, when predicting the microenvironment of the confined space, a sliding window is used to predict the L-type data of the internal environment of the confined space;
[0027] The inversion method is used to predict the internal environment data other than the L category;
[0028] The L-type data is a type of internal environment data.
[0029] Optionally, the method further includes an error analysis step for the microenvironment prediction data, which step at least includes calculating the mean square error (MSE), the correlation coefficient (r 2 , one of the average error E.
[0030] In order to achieve the above-mentioned purpose, in a second aspect, the present invention discloses a terminal device, which also includes an internal and external environment data acquisition device for a confined space, a processor, and a memory. The processor is used to execute a control program of the memory to implement the above-mentioned confined space microenvironment prediction method.
[0031] In order to achieve the above-mentioned purpose, in a third aspect, the present invention discloses a storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to achieve: to achieve the above-mentioned confined space microenvironment prediction method.
[0032] The beneficial effects of the present invention are as follows: through the internal and external data of the confined space, the correlation coefficient algorithm is used to determine the lag time of the internal and external environments, the mechanism and algorithm criteria are used to jointly determine the length of the input and output sequences, and the network model is used to predict the internal environment sequence using the external environment characteristics to achieve prediction and early warning. It can effectively predict the change law of the internal environmental factors of the microenvironment over time, and by establishing a unified and fixed method step, it is used to calculate the internal state of the confined space under different external environments, so as to more accurately grasp the internal microenvironment characteristics and change laws, and provide accurate input for damage prediction and life assessment of materials and devices in the microenvironment. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0035] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0036] Figure 1 It is a real-time observation time curve of environmental factors of a certain station in Example 1;
[0037] Figure 2 This is the time course curve of temperature and humidity monitoring in a confined space in Example 1;
[0038] Figure 3 It is a schematic diagram of the external comparison sequence s1 and the internal typical sequence s2 of the present invention;
[0039] Figure 4 It is a sliding curve diagram of correlation coefficient of the present invention;
[0040] Figure 5 This is a graphical representation of the results of calculating the correlation coefficient of the sliding sequence in Example 1;
[0041] Figure 6 It is a schematic diagram of the model structure of the present invention;
[0042] Figure 7 This is a schematic diagram of the model structure of Example 1;
[0043] Figure 8 The figure is a curve comparison diagram of the predicted temperature and the measured temperature in Example 1;
[0044] Fig. 9 To invent a confined space microenvironment prediction flow chart. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without creative work belong to the scope of protection of the present disclosure. The following disclosure provides many different embodiments or examples for implementing different schemes of the present invention. In order to simplify the disclosure of the present invention, the components and settings of specific examples are described below. Of course, they are only examples and are not intended to limit the present invention. In addition, the present invention may repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed. The following will refer to the drawings and preferred embodiments to illustrate the embodiments of the present disclosure, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be understood that the preferred embodiments are only for illustrating the present disclosure, rather than for limiting the protection scope of the present disclosure. The present invention will be further described in detail below in conjunction with the accompanying drawings.
[0046] Embodiment 1:
[0047] In order to predict the microenvironment inside a confined space and accurately grasp the characteristics and changing laws of the microenvironment in the confined space, the present invention discloses a confined space microenvironment prediction method, a terminal device and a storage medium.
[0048] This embodiment provides a method for predicting the microenvironment of a confined space. Fig. 9 In this embodiment, the external environment of the confined space is introduced as an outdoor exposure environment, and the prediction method includes:
[0049] Step S1, collecting the internal and external environmental data of the confined space; pre-processing the internal and external environmental data of the confined space to obtain the internal and external pre-processed environmental data;
[0050] Step S2, taking a type of data K in the optional preprocessed environmental data as the data basis, and determining the microenvironment lag number corresponding to the highest Spearman correlation coefficient; wherein the data K may be the temperature data inside and outside the enclosed space or the humidity data inside and outside the enclosed space.
[0051] Step S3, determining the model input and output sequences based on the microenvironment hysteresis number, and confirming Ne sensitive environmental factors of the model input sequence based on the correlation coefficient;
[0052] Step S4: construct and train the model to obtain a final prediction model; the model is a data-driven model;
[0053] Step S5: Based on the confined space environment data and the final prediction model, a microenvironment prediction is performed on the confined space.
[0054] In step S1, the environmental factors of the outdoor exposure environment of the enclosed space of a station are observed. The external environmental factors vary greatly, and the data collection frequency is recommended to be no less than 1 time / minute.
[0055] When collecting environmental data inside and outside a confined space:
[0056] When the external environment of the enclosed space is an outdoor exposure environment, the external environment data of the enclosed space at least includes external temperature, external humidity, external solar radiation intensity, and external wind speed; the internal environment data of the enclosed space at least includes internal temperature and internal humidity;
[0057] When the external environment of the enclosed space is a storage environment inside a warehouse, the external environment data of the enclosed space includes at least the external temperature and external humidity, and may also include other data such as external solar radiation intensity and external wind speed. The internal environment data of the enclosed space includes at least the internal temperature and internal humidity;
[0058] In this embodiment, the external environment data of the enclosed space includes external temperature, external humidity, external solar radiation intensity, external wind speed and wind speed. Figure 1 The schematic diagram shown corresponds to the data, some of which are shown in Table 1.
[0059] Table 1 Real-time monitoring data of external environment
[0060]
[0061] In this embodiment, two groups of internal environment data collection devices are set up in the confined space, namely humidity and temperature collection devices, and the internal environment data obtained are as follows: Figure 2 The internal environment data of some confined spaces are shown in Table 2.
[0062] Table 2 Real-time monitoring data of internal environment
[0063]
[0064] Internal environmental factors change relatively slowly, and the frequency of data collection is recommended to be no less than once every 10 minutes. Relative humidity and temperature have a significant and strict negative correlation. As temperature rises, saturated water vapor pressure increases and relative humidity decreases; as temperature decreases, saturated water vapor pressure decreases and relative humidity increases.
[0065] In step S1, the preprocessing of the environmental data inside and outside the enclosed space at least includes alignment processing.
[0066] During the alignment process, the internal and external data are aligned during the period when there is no obvious abnormality in the internal data changes to form an aligned sequence.
[0067] (1) In the case of different data collection frequencies, the lowest common divisor of the time intervals of each series is used as the comprehensive time interval δ, and the average value within the interval is taken for data smoothing. The aligned series are shown in Table 3:
[0068] Table 3 List of data collection alignment numbers
[0069]
[0070]
[0071] (2) For the case where the collection time points are inconsistent, such as the time series of external temperature is [T1, T1+δ, T1+2δ…], and the time series of internal temperature is [t1, t1+δ, t1+2δ…], T1≠t1. First, confirm the reference time point, and calculate the data corresponding to the reference time point with uniform changes in other data columns, and finally form a series with neat time scales.
[0072] (3) In the case where the data collection frequency and collection time points are inconsistent, it is necessary to use a combination of methods (1) and (2). First, the lowest common divisor of the time intervals of each series is used as the comprehensive time interval to take the average value for data smoothing, and then the reference time is aligned to form an aligned series.
[0073] In this embodiment, the internal and external environment data series are aligned by using the lowest common divisor of the time intervals of each series as the comprehensive time interval and the alignment reference time to form an aligned series. In the case where the data collection frequency of the internal and external environmental factor data is different, the lowest common divisor of the time interval is taken as the time interval, that is, 10 minutes is taken as the time interval. Since there is data at each time point, there is no need to smooth the data. The aligned time series is shown in Table 4.
[0074] Table 4 Aligned time series
[0075]
[0076] In step S2, the environmental data inside and outside the confined space are selected from the optional pre-processed environmental data as the data basis to determine the microenvironment hysteresis number corresponding to the highest Spearman correlation coefficient, and the specific content is:
[0077] The lag time is determined by the correlation coefficient algorithm. When the external environment data sequence is shifted back by n intervals, the correlation coefficient reaches the maximum, and the lag time is nδ.
[0078] Take Q cycles of external environment data, associated data, and preprocessed environment data sequences as comparison sequence s1; Q is greater than 2;
[0079] A typical period sequence s2 is intercepted from the internal preprocessing environment data in the same time period as the Q period external environment data preprocessing environment data sequence, and the starting time position X of s2 is recorded; Figure 3 shown.
[0080] Slide the typical periodic sequence s2 on the comparison sequence s1 in turn to obtain the correlation coefficient;
[0081] Determine the sliding position S where the correlation coefficient is the largest d ; For details of the sliding curve of the correlation coefficient, see Figure 4 .
[0082] The microenvironment hysteresis number n is calculated, and the specific calculation formula is:
[0083] nδ=(XS d )δ;
[0084] S d is negative, indicating that sequence s2 is ahead of sequence s1; S d is positive, indicating that sequence s2 lags behind sequence s1;
[0085] δ is the time corresponding to the lag unit.
[0086] Since the lag time is related to the size of the enclosed space and the material of the enclosed space shell, for example, a metal cylinder with a diameter of 1 meter can be taken as 50 minutes to 70 minutes.
[0087] In this embodiment, the internal and external temperature series are used as the data basis, and the sliding series is used to calculate the spearman correlation coefficient. The calculation results are shown in Table 5. The calculation results of the spearman correlation coefficient calculated based on the sliding series are fitted to obtain the following Figure 5 The sliding series correlation coefficient fitting curve is shown.
[0088] Table 5 Sliding sequence calculation correlation coefficient calculation results
[0089]
[0090]
[0091] In this embodiment, according to Table 5 and Figure 5It can be seen intuitively that the correlation coefficient is the highest when the lag is 6 time steps (equivalent to 60 minutes), but the lag time is related to the size of the closed cylinder and the shell material. In this type of closed space, the lag time is 60 minutes.
[0092] In step S3, when determining the model input and output sequences based on the microenvironment hysteresis number, the length of the input sequence is determined to be 2n to form an input and output sequence.
[0093] External environment, such as temperature, humidity, wind speed, solar radiation, etc., intercepted a sequence of length 2n as input data. After orthogonal test verification and analysis, the longer the input sequence length, the more stable the training process and the higher the accuracy of the training results, but the network is larger and the training efficiency is lower. For example, the input sequence of length 4n improves the model accuracy by 0.5% and increases the number of parameters by 50% compared with the input sequence of length 2n. Comprehensive considerations show that taking a sequence of length 2n as input is the best solution.
[0094] At the same time, the output sequence length is determined based on efficiency and theoretical predictions. Since the internal and external environmental data have good followability and the required model parameters are not large, the output sequence length is taken as 1, that is, only the environmental data of the next time step is predicted.
[0095] The input and output sequences are: 1):
[0097]
[0098] The four input sequences in 1) are used to predict the internal environment temperature t at time 2nδ 2n , 2):
[0100]
[0101] The time series in 2) is used to predict the temperature t at time (2n+1)δ by moving one step back. 2n+1 , and so on to obtain the temperature and other data at the following times. 3):
[0103]
[0104] …
[0105] In this embodiment, since the correlation coefficient is the highest when the time is lagged by 6 time steps (equivalent to 60 minutes), the length of the input sequence is 2n=2*6=12. The length of the output sequence is 1. Examples of input and output sequences are as follows:
[0106] first step:
[0107]
[0108] Second step:
[0109]
[0110] third step:
[0111]
[0112] The first step is to use the external environment data of the 1-12 time period to predict the internal environment data t 12 In the second step, the external environment data of the 2-13 time period is used to predict the internal environment data t 13 , and so on.
[0113] Step S3 confirms the sensitive environmental factors of the input sequence based on the correlation coefficient and selects environmental factors with a medium sensitive environmental factor level. The specific confirmation process is:
[0114] Through the analysis of heat transfer mechanism, we know that heat will be transferred when there is a temperature difference between the internal and external environment, humidity will affect the diffusion and conduction speed of heat, solar radiation directly causes temperature rise in the form of thermal radiation, wind speed affects the convection heat transfer coefficient of the enclosed space shell (such as metal, composite materials, etc.), wind direction is related to the shape of the enclosed space shell, etc., and changes the heat dissipation by affecting the convection area. Through data correlation analysis, sensitive environmental factors are screened, important factors are retained, and minor data are eliminated, so as to improve the efficiency of model construction while ensuring the accuracy of the model as much as possible.
[0115] Take the correlation (Spearman) coefficient for correlation analysis and calculate the correlation coefficient ρ according to the following formula:
[0116]
[0117] In the above formula, ρ is the correlation (Spearman) coefficient, n is the total number of samples, and d i is the difference in the rank values of the i-th data pair.
[0118] Sensitive environmental factors are determined according to the correlation coefficient ρ. According to experience, |ρ|>0.8 is considered to be extremely strongly correlated, 0.8≥|ρ|>0.6 is considered to be strongly correlated, 0.6≥|ρ|>0.4 is considered to be moderately correlated, and 0.4≥|ρ|>0.2 is considered to be weakly correlated. Since the model proposed in the present invention is data-driven, all moderately correlated environmental factors are included in the model input, and the environmental data corresponding to 0.6≥|ρ|>0.4 are selected as sensitive environmental data, and finally Ne sensitive environmental factors are obtained.
[0119] In this embodiment, sensitive environmental factors are confirmed based on correlation analysis, and the spearman correlation coefficient of each factor is calculated. The calculation results are shown in Table 6.
[0120] "External temperature" in the table refers to the temperature of the external environment (unit: °C);
[0121] "Humidity" in the table refers to the humidity of the external environment (unit: %);
[0122] "Radiation" in the table refers to the solar radiation of the external environment (unit: W / m 2 );
[0123] "Wind direction" in the table refers to the wind direction of the external environment (unit: °);
[0124] "Wind speed" in the table refers to the wind speed of the external environment (unit: m / s);
[0125] The "internal temperature" in the table refers to the temperature of the internal environment (unit: °C).
[0126] From the results, we can see that the external environmental factors affecting the internal ambient temperature are ranked as temperature>solar radiation>humidity>wind direction>wind speed, among which humidity and wind direction are negatively correlated, and the other factors are positively correlated. Environmental factors with correlation coefficient |ρ|>0.4 are retained, so temperature, solar radiation, and humidity are taken as sensitive environmental factors, and wind direction and wind speed have less influence. Wind direction and wind speed data are excluded when constructing the prediction model.
[0127] Table 6 Correlation coefficients of various environmental factors
[0128]
[0129]
[0130] The model building process in step S4 is:
[0131] (1) Confirm the network input and output of the model according to the data sequence, the Ne sensitive environmental factors obtained in step S3 are respectively used as time series input, and the internal environmental temperature data predicted by the model is used as time series output;
[0132] (2) The main structure of the network is further sorted out. The input is Ne time series of sensitive environmental factors. The features are learned through the LSTM (time recurrent neural network) structure to form Ne feature sequences with reduced parameters. After fusion, a feature sequence is formed. The feature sequence is then passed through a fully connected layer for feature learning, and finally output as the predicted time series.
[0133] (3) Finally, the number of layers and parameters are confirmed to form a model structure. In this embodiment, Ne=4, and the model structure is as follows: Figure 6 :
[0134] The reference formula for confirming the number of model network layers is layer number C = sqrt(N·M), where N represents the input sequence length and M represents the output sequence length. This layer is the feature learning layer. The LSTM layer and the fully connected layer (dense) in this model are feature learning layers.
[0135] The number of hidden neurons in the model network is N hidden , the formula is as follows:
[0136]
[0137] Where N Sample is the number of samples, N input is the size of the input layer, N output is the size of the output layer, α is a variable, and its value is usually 2 to 10. When the volume of time series data is large, the number of parameters confirmed by this formula will lead to serious overfitting or low efficiency. The principle should also be referred to - the number of hidden neurons in the model network is less than twice the size of the input layer. Finally, the number of hidden neurons should be adjusted comprehensively according to the training effect and training efficiency.
[0138] In this embodiment, the three sensitive environmental factor time series data confirmed in the above steps are used as input, the input sequence length is 12, and the output sequence length is 1, then the feature learning layer can be approximately 3, and it is planned as a two-layer LSTM (time recurrent neural network) structure and a fully connected layer. The sample is a time series, which is split into 50,000+ input samples. The number of hidden neurons in the model network is too large, far exceeding twice the size of the input layer. Finally, the number of units of the first LSTM layer is 4 (due to the particularity of the LSTM structure, each LSTM unit has 4 activation functions, and when the number of units is 4, there are 16 hidden neurons), the number of units of the second LSTM layer is 1 (the network is generally in an inverted pyramid shape, and the number of parameters is gradually reduced through feature learning. The more macroscopic the learning features are), the fully connected layer parameter is 16 (because the data fusion is performed before the fully connected layer, the size has been expanded, so the number of parameters in this layer is more than the second layer LSTM).
[0139] In this embodiment, the main structure of the network model is as follows: Figure 7 As shown in the figure, the external temperature, humidity, and solar radiation data are learned through the LSTM structure respectively, and then fused to form a feature sequence, and finally a fully connected layer is used to complete the prediction output.
[0140] Step S4: The model training process is:
[0141] (1) Data normalization and denormalization. Before data training, the input data is normalized and the mean and variance are recorded to prepare for the subsequent denormalization of the result data.
[0142] (2) Tuning hyperparameters of deep learning models. Based on the above model structure, select loss function, optimizer, etc. The activation function of the fully connected layer is Relu, the loss function is mean square error loss, the optimizer is Adam, the learning rate is 0.01, the truncation accuracy is 0.001, and the batch-size is determined according to the host performance, which can be 512.
[0143] (3) Perform k-fold cross validation.
[0144] After the above training and cross-validation, the final prediction model is obtained.
[0145] In this embodiment, before deep learning model training, data normalization is performed, and the retained mean and variance are recorded.
[0146] Adjust the hyperparameters of the deep learning model. The activation function of the fully connected layer is Relu, the loss function is the mean square error loss, the optimizer is Adam, the learning rate is 0.01, the truncation accuracy is 0.001, and the batch-size is determined according to the host performance. In this experiment, 512 is used.
[0147] Select the k-fold cross-validation strategy, with k being 10. The dataset first needs to be shuffled and divided into 10 folds. Each time, 1 fold of the data is taken as the validation set, and the rest is used for training to evaluate the performance and generalization ability of the model.
[0148] After completing model training and cross-validation, the model structure and model parameters are stored for subsequent multiple prediction analyses. The model output results need to be restored through denormalization.
[0149] Step S5 predicts the microenvironment of the confined space based on the confined space environment data and the final prediction model. Specifically, a sliding window is used to implement L-type data prediction.
[0150] In this embodiment, four input sequences of external temperature, humidity, solar radiation, and wind speed are used, and a sliding window is continuously used to achieve a step-by-step prediction of the internal temperature sequence.
[0151] The step-by-step prediction is performed using the prediction model obtained in step S4: (1) [T1T2…T 2n ], [RH1 RH2…RH 2n ], [Rd1 Rd2…Rd2n], [Wd1 Wd2…Wd 2n ] as input, predict the internal temperature t2n at time 2nδ; (2) Sliding window, [T2T3…T 2n+1 ]、[RH2RH3…RH 2n+1 ]、[Rd2 Rd3…Rd 2n+1 ]、[Wd2 Wd3…Wd 2n+1] is used as input, and the internal temperature at time (2n+1)δ is predicted to be t2n+1. Similarly, the internal temperature time series [t 2n t 2n+1 t 2n+2 …].
[0152] According to the internal temperature of the enclosed space obtained in step S5, the internal humidity data of the enclosed space is calculated by an inversion method, specifically:
[0153] By absolute humidity The water vapor pressure P w (hPa):
[0154]
[0155] Where C = 2.16679g*K / J, T is Kelvin temperature; it is assumed that the water vapor content in the enclosed space remains unchanged, that is, the absolute humidity is a constant value H (g / m3).
[0156] Saturated vapor pressure P ws (hPa):
[0157]
[0158] Among them, A=6.116441, m=7.591386, Tn=240.7263, -20℃<T<50℃;
[0159] A=6.004918, m=7.337936, Tn=229.3975, 50℃<T<100℃;
[0160] Therefore, relative humidity RH:
[0161]
[0162] The relative humidity can be calculated from the temperature data using the above formula, that is, the relative temperature data of the predicted temperature data of the enclosed space.
[0163] In this embodiment, the microenvironment relative humidity is calculated from the predicted internal temperature and the initial absolute humidity through a formula to complete the inversion of the internal environment humidity. The predicted data is shown in Table 7.
[0164] After completing the calculation of the confined space prediction data in step S5, an error analysis is also performed:
[0165] By MSE, correlation coefficient r 2 , average error E and other indicators are used to quantitatively analyze the errors between measured data and predicted data and evaluate the prediction performance of the model.
[0166] Among them, the average error E formula is:
[0167]
[0168] Among them, Dr. i represents the ith measured data, Dp i Represents the i-th predicted data.
[0169] In this embodiment, the mean square error MSE and the correlation coefficient r 2 , mean error E and other indicators, quantitatively analyze the error between the measured data and the predicted data, and the comparative analysis data is shown in Table 7. The calculated MSE is 2.6905, r 2 =0.9895, E=1.1433, the maximum temperature error is 5°C, and the maximum humidity error is 15%. The curve comparison between the predicted temperature and the measured temperature is shown in the figure below. Figure 8 As shown in the figure, the yellow line is the predicted value and the blue line is the actual value. In summary, both the numerical quantification results and the graphical intuitive results show that this technical solution can be used to predict the microenvironment of a confined space. The prediction accuracy of this time series model is high and can be used in practice.
[0170] Table 7 Comparison and analysis of predicted data and actual data
[0171]
[0172]
[0173] This embodiment also discloses a terminal device, which also includes an internal and external environment data acquisition device for a confined space, a processor, and a memory. The processor is used to execute a control program of the memory to implement the above-mentioned confined space microenvironment prediction method.
[0174] This embodiment also discloses a storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the above-mentioned confined space microenvironment prediction method.
[0175] Embodiment 2:
[0176] The difference between this embodiment and embodiment 1 is the preprocessing process in step 1, namely, the alignment process, and the other steps are the same as those in embodiment 1.
[0177] In this embodiment, the time series data of the existing original data is shown in Table 8.
[0178] Table 8 Time series of original data
[0179]
[0180] It is believed that the changes in environmental factors such as temperature and humidity in a short period of time basically conform to the law of uniform change. 12:03 is taken as the reference time, and the time interval δ is 10 minutes. The time intervals of the internal and external environments are consistent, but the reference time is not unified. The external environment time scale is unified to be consistent with the internal time scale, and the environmental factor data is processed accordingly. For example, the temperature at 12:00 is 16.79℃, and the temperature at 12:10 is 16.82℃. The temperature at 12:03 is calculated to be 16.799℃. The processed data sequence is shown in Table 9.
[0181] Table 9 Time series after benchmark alignment
[0182]
[0183] The above are only preferred implementations of the present invention. It should be pointed out that a number of modifications and improved technical solutions made by those skilled in the art without departing from the technical solution should also be deemed to fall within the scope of protection required by the claims.
Claims
1. A method for predicting a confined space microenvironment, characterized in that: The method comprises: Collecting the internal and external environmental data of the confined space; preprocessing the internal and external environmental data of the confined space to obtain the internal and external preprocessed environmental data; A type of data K in the preprocessed environmental data is selected as the data basis, and the microenvironment lag number corresponding to the highest Spearman correlation coefficient is determined; Based on the microenvironmental lag number, the model input and output sequences are determined, and Ne sensitive environmental factors of the model input sequence are confirmed based on the correlation coefficient; Model construction and training to obtain the final prediction model; Based on the confined space environmental data and the final prediction model, the microenvironment of the confined space is predicted.
2. The method for predicting the microenvironment of a confined space according to claim 1, characterized in that: When collecting the environmental data inside and outside the confined space: When the external environment of the enclosed space is an outdoor exposure environment, the external environment data of the enclosed space at least includes external temperature, external humidity, external solar radiation intensity, and external wind speed; When the external environment of the enclosed space is a storage environment in a warehouse, the external environment data of the enclosed space at least includes external temperature and external humidity; The internal environment data of the enclosed space includes at least temperature and humidity; The preprocessing of the environmental data inside and outside the enclosed space at least includes alignment processing.
3. The method for predicting the microenvironment of a confined space according to claim 1, characterized in that: One of the data K in the optional pre-processed environmental data is used as the data basis to determine the content of the microenvironment hysteresis number corresponding to the highest Spearman correlation coefficient: Take Q cycles of external K-type preprocessing environment data sequences as comparison sequence s1; Q is greater than 2; A typical periodic sequence s2 is intercepted from the internal K-type preprocessing environment data in the same time period as the Q-period external K-type preprocessing environment data sequence, and the starting time position X of s2 is recorded; Slide the typical periodic sequence s2 on the comparison sequence s1 in turn to obtain the correlation coefficient; Determine the sliding position S where the correlation coefficient is the largest d ; The microenvironment hysteresis number n was calculated; nδ=(XS d )d; S d is negative, indicating that sequence s2 is ahead of sequence s1; S d is positive, indicating that sequence s2 lags behind sequence s1; δ is the time corresponding to the lag unit.
4. The method for predicting the microenvironment of a confined space according to claim 3, characterized in that: The sensitive environmental factors of the input sequence confirmed based on the correlation coefficient select environmental factors with a medium sensitive environmental factor level.
5. The method for predicting the microenvironment of a confined space according to claim 1 or 4, characterized in that: The model construction and training obtain the model construction content in the final prediction model as follows: Determine the model time series input and output: Ne sensitive environmental factors are used as time series input; Output one of the internal environment data predicted by the model as a time series; Input Ne sensitive environmental factors into the main structure of the prediction model, and finally output the constructed model.
6. The method for predicting the microenvironment of a confined space according to claim 5, characterized in that: The model construction and training to obtain the final prediction model includes at least the following steps: Data normalization and denormalization processing, deep learning model hyperparameter tuning processing, and k-fold cross validation processing.
7. The method for predicting the microenvironment of a confined space according to claim 2, characterized in that: Based on the confined space environment data and the final prediction model, when predicting the microenvironment of the confined space, a sliding window is used to predict the L-type data of the internal environment of the confined space; The inversion method is used to predict the internal environment data other than the L category; The L-type data is a type of internal environment data.
8. The method for predicting the microenvironment of a confined space according to claim 1, characterized in that: The method also includes an error analysis step for the microenvironment prediction data, which at least includes calculating the mean square error (MSE), the correlation coefficient (r 2 , one of the average error E.
9. A terminal device, characterized in that: The terminal device also includes a data acquisition device for the internal and external environment of the confined space, a processor, and a memory. The processor is used to execute the control program of the memory to implement: the confined space microenvironment prediction method as described in claims 1-8.
10. A storage medium, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement: the confined space microenvironment prediction method as described in any one of claims 1-8.
