An intelligent temperature and humidity control method and system for low-temperature fresh-keeping metal granary
Environmental prediction is carried out through the TFT model, multi-source data fusion is used to judge the pest index, and DQN reinforcement learning is used to optimize temperature and humidity control, which solves the problem of insufficient intelligence and adaptability of the granary temperature and humidity control system, and realizes an efficient and safe storage environment in the granary.
Patent Information
- Application Number
- CN202510090347.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-21
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2045-01-21
AI Technical Summary
The existing granary temperature and humidity control system cannot achieve accurate and efficient dynamic control, resulting in local temperature and humidity fluctuations exceeding the standard, which can easily cause pest or mildew problems. It is also insufficient intelligence and adaptability, making it difficult to meet the needs of efficient and safe granary management.
TFT model is used for timing prediction, combined with multi-source data fusion to judge the pest index, and optimize the temperature and humidity control strategy through the DQN reinforcement learning model to achieve intelligent and adaptive temperature and humidity control.
It realizes accurate prediction and pest detection of the granary environment, improves the intelligence level and adaptability of temperature and humidity control, ensures the optimal storage environment in the granary, and improves the quality and safety of grain preservation.
Smart Images

Figure CN119512289B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of temperature and humidity control, and in particular to an intelligent temperature and humidity control method and system for a low-temperature fresh-keeping metal granary. Background Art
[0002] Granaries are core facilities for grain storage and preservation, and are widely used to maintain grain quality, reduce losses, and ensure food safety. Their main function is to preserve grain for a long time through suitable environmental conditions, while preventing pests, mildew, and other storage problems. Temperature and humidity control in granaries is a key factor in ensuring grain storage safety. Reasonable temperature and humidity can not only inhibit the reproduction of mold and pests, but also slow down the deterioration of grain quality, extend the storage period, and ensure the economic and social value of grain. Therefore, achieving scientific management of granary temperature and humidity is of great significance to the stability of national grain reserves and the sustainable development of the grain industry.
[0003] However, there are still many defects in the temperature and humidity control of granaries at this stage. Traditional granaries mostly rely on manual regular inspections and mechanical adjustments, which cannot achieve accurate and efficient dynamic control, and easily lead to local temperature and humidity fluctuations exceeding the standard, thereby causing pests or mildew problems. Although some modern granaries have introduced automation systems, existing methods often lack the ability to comprehensively analyze multi-dimensional data in complex environments, and cannot fully combine environmental changes inside and outside the warehouse, gas data, and pest and disease conditions to optimize the control strategy. In addition, most control strategies are based on fixed threshold settings, and fail to adjust the control scheme in combination with real-time environmental data. They lack intelligence and adaptability, and it is difficult to meet the needs of efficient and safe granary management.
[0004] Therefore, an intelligent temperature and humidity control method and system for low-temperature fresh-keeping metal granary is proposed. Summary of the invention
[0005] The purpose of the present invention is to provide an intelligent temperature and humidity control method and system for a low-temperature preservation metal granary. First, the present invention uses the TFT model to perform time series prediction on the granary environmental data, accurately predicts short-term changes in the warehouse environment, and ensures the foresight and timeliness of environmental control; secondly, the present invention uses multi-source data fusion to achieve comprehensive judgment of pest and disease indexes, and improves the accuracy and sensitivity of pest detection by integrating multiple monitoring data such as images and sounds; finally, the present invention optimizes the temperature and humidity control strategy through the DQN reinforcement learning model, combines the warehouse environmental data, disease index and pest index, and realizes the intelligent and adaptive temperature and humidity control, ensuring the optimal storage environment in the granary and improving the quality and safety of grain preservation.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] An intelligent temperature and humidity control method for a low-temperature fresh-keeping metal granary, comprising:
[0008] Collecting raw data of the metal granary, attaching a timestamp to the raw data and storing it in a database; the raw data includes environmental data inside the granary, gas data inside the granary, environmental data outside the granary and equipment data;
[0009] Read the raw data and construct a time series data set, and input the time series data set into the TFT model to obtain a pre-trained model; obtain meteorological data for the next 24 hours, and predict the short-term in-warehouse environmental data of the metal granary through the pre-trained model;
[0010] Inputting the in-warehouse environment data and the in-warehouse gas data into a disease index calculation formula, and obtaining a disease index through the disease calculation formula;
[0011] Collecting insect monitoring images and insect monitoring audio frequencies, pre-processing the insect monitoring images and the insect monitoring audio frequencies and inputting them into a multi-source data recognition model to determine the insect pest status and obtain an insect pest index;
[0012] According to the original data, the short-term warehouse environment data, the disease index and the pest index, the state space, action space and reward function of the DQN algorithm are designed, and the reward function is maximized by training and updating the online Q network and target Q network of the DQN algorithm and minimizing the loss function to obtain the optimal DQN model;
[0013] The temperature controller and humidity modulator are adjusted according to the optimal DQN model to complete temperature and humidity control.
[0014] Furthermore, the in-warehouse environmental data includes in-warehouse temperature and in-warehouse humidity, the in-warehouse gas data includes carbon dioxide concentration, oxygen concentration and volatile organic compound concentration, the out-warehouse environmental data includes out-warehouse temperature and out-warehouse humidity, and the equipment data includes a preset temperature of a temperature adjuster and a preset humidity of a humidity modulator.
[0015] Furthermore, the short-term in-silo environmental data of the metal granary are predicted to include:
[0016] Preprocessing the original data to obtain a preprocessed data set;
[0017] Sorting the preprocessed data set according to the timestamps to construct the time series data set;
[0018] Dividing the time series data set into a training set and a validation set, inputting the training set into the TFT model training, and validating it through the validation set to obtain the pre-trained model;
[0019] The meteorological data for the next 24 hours is obtained, and the short-term in-silo environmental data of the metal silo is predicted by the pre-trained model.
[0020] Furthermore, the disease index calculation formula is:
[0021]
[0022] Wherein, DI represents the disease index, sigmoid() represents the activation function, k represents the disease growth rate, T represents the actual temperature in the warehouse, H represents the actual humidity in the warehouse, exp() represents the exponential function, T opt Indicates the optimal temperature for the disease, H opt represents the optimal humidity for the disease, a represents the temperature sensitivity coefficient, b represents the humidity sensitivity coefficient, n represents the type of gas in the warehouse, including carbon dioxide, oxygen and volatile organic compounds, ω i represents the weight of gas i, V i represents the concentration of gas i.
[0023] Further, obtaining the pest index includes:
[0024] The insect monitoring image and the insect monitoring sound frequency are collected by a high-resolution camera and an acoustic sensor, and the number of times the statistical data is collected;
[0025] Performing mean filtering on the insect body monitoring image to obtain a preprocessed monitoring image, and converting the insect body monitoring audio into an audio frequency graph;
[0026] splicing the preprocessed monitoring image and the audio frequency image to obtain a multi-source spliced image;
[0027] Inputting the multi-source mosaic image into the multi-source data recognition model to obtain the pest confidence level;
[0028] The number of times that the insect pest confidence is greater than the credible threshold is recorded as the effective number, and the proportion of the effective number to the collection number is calculated to obtain the insect pest index.
[0029] Further, converting the insect body monitoring audio into an audio frequency graph comprises:
[0030] Preprocessing the insect body monitoring sound frequency to obtain a preprocessed sound frequency;
[0031] Converting the pre-processed audio from the time domain to the frequency domain by short-time Fourier transform, and calculating the Fourier spectrum of the pre-processed audio in the frequency domain;
[0032] Convert the Fourier spectrum into a Mel spectrum, and perform discrete cosine transform on the Mel spectrum to obtain Mel frequency cepstrum coefficients;
[0033] The Mel-frequency cepstrum coefficients are matrixed to obtain the audio frequency graph.
[0034] Further, obtaining the optimal DQN model includes:
[0035] S501: constructing a state vector and defining a state space according to the original data, the short-term warehouse environment data, the disease index and the insect pest index;
[0036] S502: Input the state vector into the DQN model, and define the action space through the temperature and humidity adjustment action;
[0037] S503: Designing a reward function to calculate a reward value corresponding to each of the adjustment actions through temperature and humidity errors, the disease index, and the insect pest index;
[0038] S504: Initialize the online Q network, target Q network and experience replay pool;
[0039] S505: randomly extracting N samples from the experience replay pool, and using the Bellman equation to calculate the target Q value of the target Q network for each of the samples;
[0040] S506: updating online parameters of the online Q network by minimizing the online Q value of the online Q network and the target Q value of the target Q network;
[0041] S507: Update the target parameters of the target Q network according to the online parameters;
[0042] S508: Determine whether the update stop condition is met. If so, obtain the optimal DQN model and save the target parameters of the optimal DQN model; otherwise, re-execute S505.
[0043] Further, adjusting the temperature controller and the humidity modulator according to the optimal DQN model includes:
[0044] The optimal DQN model is loaded; the raw data, the short-term warehouse environment data, the disease index and the insect pest index are collected in real time and input into the optimal DQN model; a control action is selected through the optimal DQN model; the temperature controller and the humidity modulator perform temperature and humidity control through the control action.
[0045] The present invention also provides an intelligent temperature and humidity control system for a low-temperature fresh-keeping metal granary, comprising:
[0046] The data acquisition module is used to collect the original data of the metal granary, attach a time stamp to the original data and store it in the database; the original data includes the environment data inside the granary, the gas data inside the granary, the environment data outside the granary and the equipment data;
[0047] The in-warehouse environment prediction module reads the raw data and constructs a time series data set, and inputs the time series data set into the TFT model to obtain a pre-trained model; obtains the meteorological data for the next 24 hours, and predicts the short-term in-warehouse environment data of the metal granary through the pre-trained model;
[0048] A disease index acquisition module, used for inputting the in-warehouse environment data and the in-warehouse gas data into a disease index calculation formula, and obtaining a disease index through the disease calculation formula;
[0049] The pest index acquisition module is used to collect insect monitoring images and insect monitoring audio frequencies, pre-process the insect monitoring images and the insect monitoring audio frequencies, and input them into the multi-source data recognition model to judge the pest status and obtain the pest index;
[0050] A reinforcement learning module is used to design the state space, action space and reward function of the DQN algorithm according to the original data, the short-term warehouse environment data, the disease index and the pest index, and to maximize the reward function by training and updating the online Q network and target Q network of the DQN algorithm and minimizing the loss function, thereby obtaining an optimal DQN model;
[0051] The temperature and humidity control module is used to adjust the temperature controller and the humidity modulator according to the optimal DQN model to complete the temperature and humidity control.
[0052] Further, obtaining the optimal DQN model includes:
[0053] S501: constructing a state vector and defining a state space according to the original data, the short-term warehouse environment data, the disease index and the insect pest index;
[0054] S502: Input the state vector into the DQN model, and define the action space through the temperature and humidity adjustment action;
[0055] S503: Designing a reward function to calculate a reward value corresponding to each of the adjustment actions through temperature and humidity errors, the disease index, and the insect pest index;
[0056] S504: Initialize the online Q network, target Q network and experience replay pool;
[0057] S505: randomly extracting N samples from the experience replay pool, and using the Bellman equation to calculate the target Q value of the target Q network for each of the samples;
[0058] S506: updating online parameters of the online Q network by minimizing the online Q value of the online Q network and the target Q value of the target Q network;
[0059] S507: Update the target parameters of the target Q network according to the online parameters;
[0060] S508: Determine whether the update stop condition is met. If so, obtain the optimal DQN model and save the target parameters of the optimal DQN model; otherwise, re-execute S505.
[0061] Compared with the prior art, the present invention has the following beneficial effects:
[0062] 1. The present invention combines the TFT model with various information such as the internal and external environmental data and meteorological data to accurately predict the short-term environmental changes of the metal granary in the next 24 hours, dynamically capture key features, and improve the reliability and interpretability of time series prediction. This method makes full use of various time series data to achieve accurate prediction of granary temperature and humidity, providing effective data support for intelligent granary management.
[0063] 2. The present invention collects insect monitoring images and audio, and uses a recognition model that fuses multi-source data to comprehensively analyze the multi-dimensional characteristics of insect pests and improve the accuracy of judging the pest status. Image data provides visual information, and audio data captures the acoustic characteristics of insect activity. The combination of the two can make up for the limitations of a single data source, effectively improve the sensitivity and reliability of insect pest detection, and also provide a reliable data decision-making basis for the subsequent temperature and humidity control of the granary.
[0064] 3. The present invention combines the original data, short-term warehouse environment data, disease index and pest index to design the state space, action space and reward function of the DQN algorithm, and uses the reinforcement learning method to optimize the control strategy, maximize the reward function, and obtain the optimal DQN model. The model can intelligently learn and adjust the granary temperature and humidity control strategy, improve the accuracy and intelligence level of granary environmental control, and provide efficient and reliable technical support for long-term grain storage and pest and disease prevention and control. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 A flow chart of an intelligent temperature and humidity control method for a low-temperature fresh-keeping metal granary provided by the present invention;
[0066] Figure 2 A flowchart of obtaining the optimal DQN model of the present invention;
[0067] Figure 3 A schematic structural diagram of an intelligent temperature and humidity control system for a low-temperature fresh-keeping metal granary provided by the present invention. DETAILED DESCRIPTION
[0068] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0069] The first embodiment provided by the present invention is as follows:
[0070] An intelligent temperature and humidity control method for a low-temperature fresh-keeping metal granary, such as Figure 1 As shown, including:
[0071] S100: Collecting raw data of the metal granary, attaching a timestamp to the raw data and storing it in a database; the raw data includes environmental data inside the granary, gas data inside the granary, environmental data outside the granary and equipment data;
[0072] Furthermore, the in-warehouse environmental data includes in-warehouse temperature and in-warehouse humidity, the in-warehouse gas data includes carbon dioxide concentration, oxygen concentration and volatile organic compound concentration, the out-warehouse environmental data includes out-warehouse temperature and out-warehouse humidity, and the equipment data includes a preset temperature of a temperature adjuster and a preset humidity of a humidity modulator.
[0073] By introducing multi-dimensional data sources, the dynamic changes in the internal and external environment of the granary and the operating status of the equipment are fully reflected. The comprehensive application of multi-type data not only improves the monitoring accuracy of the storage environment, but also provides a sufficient basis for the intelligent control of temperature and humidity.
[0074] S200: reading the raw data and constructing a time series data set, and inputting the time series data set into the TFT model to obtain a pre-trained model; obtaining meteorological data for the next 24 hours, and predicting the short-term in-warehouse environmental data of the metal granary through the pre-trained model;
[0075] Furthermore, the short-term in-silo environmental data of the metal granary are predicted to include:
[0076] Preprocessing the original data to obtain a preprocessed data set;
[0077] Sorting the preprocessed data set according to the timestamps to construct the time series data set;
[0078] Dividing the time series data set into a training set and a validation set, inputting the training set into the TFT model training, and validating it through the validation set to obtain the pre-trained model;
[0079] The meteorological data for the next 24 hours is obtained, and the short-term in-silo environmental data of the metal silo is predicted by the pre-trained model.
[0080] Specifically, the TFT (Temporal Fusion Transformer) model is a deep learning model designed specifically for time series prediction, which can effectively capture the long-term dependencies of complex time series data. In the process of predicting the short-term in-warehouse environmental data of metal granaries, data preprocessing includes checking data integrity, processing missing values and outliers, and data normalization; dividing the time series data set into a training set and a validation set with a ratio of 7:3; and the meteorological data for the next 24 hours includes temperature and humidity.
[0081] By constructing a time series data set based on the original data and preprocessing it, the timing and quality of the data are ensured, providing a reliable data foundation for model training; the TFT model is used to train and verify the data, fully exploring the dynamic correlation and long-term dependence characteristics between the data to obtain an accurate pre-training model; combined with the meteorological data of the next 24 hours for prediction, accurate estimation of the short-term environmental data in the metal granary is achieved, providing an efficient and reliable decision-making basis for subsequent intelligent control.
[0082] S300: Inputting the in-warehouse environment data and the in-warehouse gas data into a disease index calculation formula, and obtaining a disease index through the disease calculation formula;
[0083] Furthermore, the disease index calculation formula is:
[0084]
[0085] Wherein, DI represents the disease index, sigmoid() represents the activation function, k represents the disease growth rate, T represents the actual temperature in the warehouse, H represents the actual humidity in the warehouse, exp represents the exponential function, T opt Indicates the optimal temperature for the disease, H opt represents the optimal humidity for the disease, a represents the temperature sensitivity coefficient, b represents the humidity sensitivity coefficient, n represents the type of gas in the warehouse, including carbon dioxide, oxygen and volatile organic compounds, ω i represents the weight of gas i, V i represents the concentration of gas i.
[0086] In a feasible implementation manner, in the disease index calculation formula, the preset parameters are as shown in Table 1.
[0087] By combining the in-warehouse environmental data with the in-warehouse gas data, a comprehensive assessment of mold activity and disease risk is conducted based on the disease index calculation formula, which can fully reflect the impact of the warehouse environment on grain diseases. This method effectively utilizes key indicators such as temperature, humidity, and gas concentration to achieve quantitative analysis of potential disease risks, improve the scientificity and accuracy of disease monitoring, and provide an important reference for optimizing the regulation of the granary environment and grain storage safety.
[0088] Table 1. Some preset parameters and parameter values of the disease index calculation formula
[0089] Preset Parameters Parameter Value Disease growth rate 1.25 Optimum temperature for disease 33℃ Optimal humidity for disease 70% Temperature sensitivity coefficient 0.5 Humidity sensitivity coefficient 0.5 CO2 Weight 0.3 Oxygen Weight 0.1 Volatile organic compound weight 0.6
[0090] S400: collecting insect monitoring images and insect monitoring audio frequencies, pre-processing the insect monitoring images and the insect monitoring audio frequencies, and inputting them into a multi-source data recognition model to determine the insect pest status and obtain an insect pest index;
[0091] Further, obtaining the pest index includes:
[0092] The insect monitoring image and the insect monitoring sound frequency are collected by a high-resolution camera and an acoustic sensor, and the number of times the statistical data is collected;
[0093] Performing mean filtering on the insect body monitoring image to obtain a preprocessed monitoring image, and converting the insect body monitoring audio into an audio frequency graph;
[0094] splicing the preprocessed monitoring image and the audio frequency image to obtain a multi-source spliced image;
[0095] Inputting the multi-source mosaic image into the multi-source data recognition model to obtain the pest confidence level;
[0096] The number of times that the insect pest confidence is greater than the credible threshold is recorded as the effective number, and the proportion of the effective number to the collection number is calculated to obtain the insect pest index.
[0097] Specifically, insect monitoring images and insect monitoring audio are collected in real time through high-resolution cameras and acoustic sensors, wherein the insect monitoring images and insect monitoring audio are collected synchronously; mean filtering is performed on the insect monitoring images to remove image noise and improve image quality; the insect monitoring audio is converted into an audio graph through the Mel-frequency cepstral coefficient method, and the audio graph has the same spatial size as the pre-processed monitoring image, which is convenient for subsequent fusion processing; the pre-processed image and audio graph are spliced into a multi-source spliced graph, thereby combining visual information and audio information; the multi-source spliced graph is input into a Enter into a multi-source data recognition model, analyze visual and sound information through the model, and thus obtain the pest confidence. The multi-source data recognition model can be a commonly used recognition model at this stage, such as VGG, ResNet and ViT and other visual recognition models. When using the recognition of multi-source mosaics, you only need to modify the number of input channels; compare the calculated pest confidence with the credible threshold, where the credible threshold is 85%. If the pest confidence is greater than the set credible threshold, it is considered that the collection is valid. Finally, the proportion of valid times to the collection times is calculated to obtain the pest index. In a feasible implementation, Table 2 compares the pest detection rates of multiple visual recognition models under different data sources.
[0098] Table 2. Comparison of pest detection rates between insect monitoring images and multi-source mosaic images under different recognition models
[0099] Model Pest detection rate of monitoring images Pest detection rate of multi-source mosaics VGG 82% 89% ResNet 91% 94% ViT 93% 95%
[0100] By synchronously collecting insect monitoring images and audio data through high-resolution cameras and acoustic sensors, the multi-source information of visual and auditory signals is fully utilized to improve the ability to fully capture the characteristics of insect activity. The audio data is converted into an audio graph, which is spliced with the pre-processed monitoring image to generate a multi-source spliced graph, and then input into the multi-source data recognition model for pest analysis, effectively integrating image and audio features, and significantly enhancing the accuracy and robustness of pest identification.
[0101] Further, converting the insect body monitoring audio into an audio frequency graph comprises:
[0102] Preprocessing the insect body monitoring sound frequency to obtain a preprocessed sound frequency;
[0103] Converting the pre-processed audio from the time domain to the frequency domain by short-time Fourier transform, and calculating the Fourier spectrum of the pre-processed audio in the frequency domain;
[0104] Convert the Fourier spectrum into a Mel spectrum, and perform discrete cosine transform on the Mel spectrum to obtain Mel frequency cepstrum coefficients;
[0105] The Mel-frequency cepstrum coefficients are matrixed to obtain the audio frequency graph.
[0106] Specifically, the preprocessing step includes denoising, removing silent segments, and enhancing audio signals; the calculation formula for converting the preprocessed audio from the time domain space to the frequency domain space through short-time Fourier transform is:
[0107]
[0108] Where, X(t,f) represents the frequency domain signal of the preprocessed audio, t represents the time variable, f represents the frequency variable, x(τ) represents the time domain signal of the preprocessed audio, w(t-τ) represents the window function, e -j2πfτ Represents a complex exponential, and the formula for calculating the Fourier spectrum in the frequency domain is:
[0109]
[0110] Where |X(t,f)| represents the Fourier spectrum, R e {X(t,f)} represents the real part of the frequency domain signal, R e {X(t,f)} represents the imaginary part of the frequency domain signal; the calculation formula for converting the Fourier spectrum to the Mel spectrum is:
[0111] M m =∑ f |X(t,f)|·H m (f);
[0112] Among them, M m represents the spectrum of the mth Mel band, the index of the mth Mel band, H m (f) represents the response of the mth Mel filter to the frequency. The Mel frequency cepstrum coefficient is obtained by performing discrete cosine transform on the Mel spectrum. The calculation formula is:
[0113]
[0114] Among them, MFCC represents Mel frequency cepstral coefficient, M represents the total number of frequency bands of Mel spectrum, and k represents the frequency index of discrete cosine transform; finally, the Mel frequency cepstral coefficient is matrixed to obtain the audio frequency graph.
[0115] By converting the insect monitoring audio from the time domain to the frequency domain, combined with short-time Fourier transform, Mel spectrum transform and discrete cosine transform and other multi-step processing, the key acoustic features of insect activity are extracted, the Mel frequency cepstrum coefficients are generated and matrixed into an audio graph. This method effectively retains the time-frequency characteristics of the audio signal, improves the ability to identify the acoustic features of insect activity, and provides a high-resolution, accurate and reliable data basis for pest monitoring.
[0116] S500: Designing the state space, action space and reward function of the DQN algorithm according to the original data, the short-term warehouse environment data, the disease index and the insect pest index, maximizing the reward function by training and updating the online Q network and target Q network of the DQN algorithm and minimizing the loss function, and obtaining the optimal DQN model;
[0117] Furthermore, the process of obtaining the optimal DQN model is as follows: Figure 2 As shown, including:
[0118] S501: constructing a state vector and defining a state space according to the original data, the short-term warehouse environment data, the disease index and the insect pest index;
[0119] S502: Input the state vector into the DQN model, and define the action space through the temperature and humidity adjustment action;
[0120] S503: Designing a reward function to calculate a reward value corresponding to each of the adjustment actions through temperature and humidity errors, the disease index, and the insect pest index;
[0121] S504: Initialize the online Q network, target Q network and experience replay pool;
[0122] S505: randomly extracting N samples from the experience replay pool, and using the Bellman equation to calculate the target Q value of the target Q network for each of the samples;
[0123] S506: updating online parameters of the online Q network by minimizing the online Q value of the online Q network and the target Q value of the target Q network;
[0124] S507: Update the target parameters of the target Q network according to the online parameters;
[0125] S508: Determine whether the update stop condition is met. If so, obtain the optimal DQN model and save the target parameters of the optimal DQN model; otherwise, re-execute S505.
[0126] Specifically, the original data, short-term warehouse environment data, disease index and pest index are used to construct state vectors, and all state vectors constitute the state space; the action space is the adjustment range of the temperature controller and the humidity modulator. In a feasible implementation, the adjustment range of the temperature controller is 15℃±10℃, and each adjustment is 0.1℃. The adjustment range of the humidity controller is 50%±30%, and each adjustment is 0.5%. The calculation formula of the reward function is:
[0127] R=α·(-|T current -T target|-|H current -H target |)+β·(1-DI)+γ·(1-PI);
[0128] Among them, α, β, γ represent weight coefficients, T current Indicates the current temperature, T target Indicates the target temperature, H current Indicates the current humidity, H target Represents the target humidity, DI represents the disease index, and PI represents the pest index; initialize the online Q network and the target Q network. The two networks have the same structure and parameters, but the parameters of the target Q network are updated less frequently during the training process. The initialization experience replay pool is used to store each interaction experience. The interaction experience includes state, action, reward, and next state; randomly select N samples from the replay pool to obtain a batch of initialized interaction experience samples, and use the Bellman equation to calculate the target Q value of each sample. The calculation formula is:
[0129]
[0130] Among them, Q target represents the target Q value, r t represents the immediate reward, γ represents the discount factor, s t+1 represents the next state, a' represents the optimal action corresponding to the next state, θ - represents the target parameters of the target Q network, Represents the maximum Q value of the next state given by the target Q network, that is, the expected reward of the optimal action taken in the next state; the mean square error is used to measure the difference between the target Q value and the online Q value, and the error calculation formula is:
[0131] L(θ)=E[(Q target -Q online (s t ,a t ;θ)) 2 ];
[0132] Among them, L(θ) represents the loss function, E represents the mean square error, Q online represents the online Q value, which is also calculated by the Bellman equation, s t Indicates the current state, a trepresents the current action, θ represents the online parameters of the online Q network; the target parameters of the target Q network are updated according to the online parameters of the online Q network, and the parameters of the online Q network are directly copied to the target Q network; it is determined whether the update stop condition is met, if so, the optimal DQN model is obtained and the target parameters are saved; otherwise, S505 is re-executed, wherein the update stop condition is that the maximum number of iterations is reached or the mean square error is less than the error threshold. In a feasible implementation manner, the maximum number of iterations is 2000 and the mean square error is 0.05.
[0133] By introducing the DQN algorithm, the original data, short-term warehouse environmental data, disease index and pest index are organically combined to construct a scientific and reasonable state space, action space and reward function. The loss function is minimized and the reward function is maximized through the training and updating of the online Q network and the target Q network. Finally, the optimal DQN model is obtained, which can accurately and real-time optimize the temperature and humidity control strategy of the granary, effectively reduce the risk of diseases and pests, and improve the intelligence level of granary environmental management and grain storage safety.
[0134] S600: Adjusting the temperature controller and the humidity modulator according to the optimal DQN model to complete temperature and humidity control.
[0135] Further, adjusting the temperature controller and the humidity modulator according to the optimal DQN model includes:
[0136] The optimal DQN model is loaded; the raw data, the short-term warehouse environment data, the disease index and the insect pest index are collected in real time and input into the optimal DQN model; a control action is selected through the optimal DQN model; the temperature controller and the humidity modulator perform temperature and humidity control through the control action.
[0137] By loading the optimal DQN model, collecting environmental and status data in real time, selecting control actions and executing equipment operations, real-time dynamic adjustment of temperature and humidity is completed to ensure the stability of the warehouse environment.
[0138] By building a comprehensive data collection and analysis system and combining multi-source data from metal granaries, including environmental data inside and outside the granary, gas data, insect monitoring images and audio, short-term environmental prediction is achieved based on time series data and the TFT model, and the safety status in the granary is comprehensively evaluated by calculating the disease index and pest index. In addition, the DQN algorithm of reinforcement learning is used to design the state space, action space and reward function for complex multivariable environments, dynamically optimize the temperature and humidity control strategy, and realize intelligent regulation of the granary environment. This method effectively improves the automation level of granary management, reduces the risk of pests and diseases, and ensures the long-term safety and quality stability of grain storage.
[0139] The second embodiment provided by the present invention is as follows:
[0140] During the grain storage process, the temperature and humidity in a certain granary are difficult to control, resulting in frequent pests and diseases in the grain in the granary and the rapid spread of pests and diseases. In order to reduce the pests and diseases caused by the large error in temperature and humidity control, the granary uses an intelligent temperature and humidity control system for low-temperature preservation metal granaries, such as Figure 3 As shown, including:
[0141] The data acquisition module is used to collect the original data of the metal granary, attach a time stamp to the original data and store it in the database; the original data includes the environment data inside the granary, the gas data inside the granary, the environment data outside the granary and the equipment data;
[0142] The in-warehouse environment prediction module is used to read the raw data and construct a time series data set, and input the time series data set into the TFT model to obtain a pre-trained model; obtain the meteorological data for the next 24 hours, and predict the short-term in-warehouse environment data of the metal granary through the pre-trained model;
[0143] A disease index acquisition module, used for inputting the in-warehouse environment data and the in-warehouse gas data into a disease index calculation formula, and obtaining a disease index through the disease calculation formula;
[0144] The pest index acquisition module is used to collect insect monitoring images and insect monitoring audio frequencies, pre-process the insect monitoring images and the insect monitoring audio frequencies, and input them into the multi-source data recognition model to judge the pest status and obtain the pest index;
[0145] A reinforcement learning module is used to design the state space, action space and reward function of the DQN algorithm according to the original data, the short-term warehouse environment data, the disease index and the pest index, and to maximize the reward function by training and updating the online Q network and target Q network of the DQN algorithm and minimizing the loss function, thereby obtaining an optimal DQN model;
[0146] The temperature and humidity control module is used to adjust the temperature controller and the humidity modulator according to the optimal DQN model to complete the temperature and humidity control.
[0147] Further, obtaining the optimal DQN model includes:
[0148] S501: constructing a state vector and defining a state space according to the original data, the short-term warehouse environment data, the disease index and the insect pest index;
[0149] S502: Input the state vector into the DQN model, and define the action space through the temperature and humidity adjustment action;
[0150] S503: Designing a reward function to calculate a reward value corresponding to each of the adjustment actions through temperature and humidity errors, the disease index, and the insect pest index;
[0151] S504: Initialize the online Q network, target Q network and experience replay pool;
[0152] S505: randomly extracting N samples from the experience replay pool, and using the Bellman equation to calculate the target Q value of the target Q network for each of the samples;
[0153] S506: updating online parameters of the online Q network by minimizing the online Q value of the online Q network and the target Q value of the target Q network;
[0154] S507: Update the target parameters of the target Q network according to the online parameters;
[0155] S508: Determine whether the update stop condition is met, if so, save the target parameter; otherwise, re-execute S505.
[0156] After using the intelligent temperature and humidity control method for low-temperature fresh-keeping metal granary proposed by the present invention, the change trends of temperature error, humidity error, disease index and pest index in the granary within 30 days are shown in Table 3. It can be seen from the table that the temperature error and humidity error both show a downward trend within 30 days, and the area is stable, while the disease index and pest index increase relatively slowly, which shows that the present invention can effectively operate the temperature and humidity control device through the DQN model to realize the intelligent temperature and humidity control of the metal granary, thereby effectively inhibiting the spread of diseases and pests.
[0157] Table 3. Trends of granary temperature error, humidity error, disease index and pest index within 30 days
[0158] Time Temperature error (℃) Humidity error Disease index Pest index Day 1-3 ±1.3 ±4.0% 0.23 0.18 Day 4-6 ±1.1 ±3.0% 0.26 0.22 Day 7-9 ±1.0 ±2.5% 0.27 0.24 Day 10-15 ±0.9 ±2.5% 0.27 0.25 Day 16-20 ±0.8 ±2.0% 0.28 0.26 Day 21-30 ±0.8 ±1.5% 0.29 0.26
[0159] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. An intelligent temperature and humidity control method for a low-temperature fresh-keeping metal granary, characterized in that: include: Collecting raw data of the metal granary, attaching a timestamp to the raw data and storing it in a database; the raw data includes environmental data inside the granary, gas data inside the granary, environmental data outside the granary and equipment data; Read the raw data and construct a time series data set, and input the time series data set into the TFT model to obtain a pre-trained model; obtain meteorological data for the next 24 hours, and predict the short-term in-warehouse environmental data of the metal granary through the pre-trained model; Inputting the in-warehouse environment data and the in-warehouse gas data into a disease index calculation formula, and obtaining a disease index through the disease index calculation formula; The disease index calculation formula is: Wherein, DI represents the disease index, sigmoid() represents the activation function, k represents the disease growth rate, T represents the actual temperature in the warehouse, H represents the actual humidity in the warehouse, exp() represents the exponential function, T opt Indicates the optimal temperature for the disease, H opt represents the optimal humidity for the disease, a represents the temperature sensitivity coefficient, b represents the humidity sensitivity coefficient, n represents the type of gas in the warehouse, including carbon dioxide, oxygen and volatile organic compounds, ω i represents the weight of gas i, V i represents the concentration of gas i; Collecting insect monitoring images and insect monitoring audio frequencies, pre-processing the insect monitoring images and the insect monitoring audio frequencies and inputting them into a multi-source data recognition model to determine the insect pest status and obtain an insect pest index; According to the original data, the short-term warehouse environment data, the disease index and the pest index, the state space, action space and reward function of the DQN algorithm are designed, and the reward function is maximized by training and updating the online Q network and target Q network of the DQN algorithm and minimizing the loss function to obtain the optimal DQN model; The temperature controller and humidity modulator are adjusted according to the optimal DQN model to complete temperature and humidity control.
2. The intelligent temperature and humidity control method for a low-temperature fresh-keeping metal granary according to claim 1 is characterized in that: The in-warehouse environmental data includes the in-warehouse temperature and the in-warehouse humidity, the in-warehouse gas data includes the carbon dioxide concentration, the oxygen concentration and the volatile organic compound concentration, the out-warehouse environmental data includes the out-warehouse temperature and the out-warehouse humidity, and the equipment data includes the preset temperature of the temperature adjuster and the preset humidity of the humidity modulator.
3. The intelligent temperature and humidity control method for a low-temperature fresh-keeping metal granary according to claim 1 is characterized in that: The short-term environmental data of the metal grain silo are predicted to include: Preprocessing the original data to obtain a preprocessed data set; Sorting the preprocessed data set according to the timestamps to construct the time series data set; Dividing the time series data set into a training set and a validation set, inputting the training set into the TFT model training, and validating it through the validation set to obtain the pre-trained model; The meteorological data for the next 24 hours is obtained, and the short-term in-silo environmental data of the metal silo is predicted by the pre-trained model.
4. The intelligent temperature and humidity control method for a low-temperature fresh-keeping metal granary according to claim 1 is characterized in that: Obtaining the pest index includes: The insect monitoring image and the insect monitoring sound frequency are collected by a high-resolution camera and an acoustic sensor, and the number of times the statistical data is collected; Performing mean filtering on the insect body monitoring image to obtain a preprocessed monitoring image, and converting the insect body monitoring audio into an audio frequency graph; splicing the preprocessed monitoring image and the audio frequency image to obtain a multi-source spliced image; Inputting the multi-source mosaic image into the multi-source data recognition model to obtain the pest confidence level; The number of times that the insect pest confidence is greater than the credible threshold is recorded as the effective number, and the proportion of the effective number to the collection number is calculated to obtain the insect pest index.
5. The intelligent temperature and humidity control method for a low-temperature fresh-keeping metal granary according to claim 4 is characterized in that: Converting the insect body monitoring audio frequency into an audio frequency graph comprises: Preprocessing the insect body monitoring sound frequency to obtain a preprocessed sound frequency; Converting the pre-processed audio from the time domain to the frequency domain by short-time Fourier transform, and calculating the Fourier spectrum of the pre-processed audio in the frequency domain; Convert the Fourier spectrum into a Mel spectrum, and perform discrete cosine transform on the Mel spectrum to obtain Mel frequency cepstrum coefficients; The Mel-frequency cepstrum coefficients are matrixed to obtain the audio frequency graph.
6. The intelligent temperature and humidity control method for a low-temperature fresh-keeping metal granary according to claim 1 is characterized in that: Obtaining the optimal DQN model includes: S501: constructing a state vector and defining a state space according to the original data, the short-term warehouse environment data, the disease index and the insect pest index; S502: Input the state vector into the DQN model, and define the action space through the temperature and humidity adjustment action; S503: Designing a reward function to calculate a reward value corresponding to each of the adjustment actions through temperature and humidity errors, the disease index, and the insect pest index; S504: Initialize the online Q network, target Q network and experience replay pool; S505: randomly extracting N samples from the experience replay pool, and using the Bellman equation to calculate the target Q value of the target Q network for each of the samples; S506: updating online parameters of the online Q network by minimizing the online Q value of the online Q network and the target Q value of the target Q network; S507: Update the target parameters of the target Q network according to the online parameters; S508: Determine whether the update stop condition is met. If so, obtain the optimal DQN model and save the target parameters of the optimal DQN model; otherwise, re-execute S505.
7. The intelligent temperature and humidity control method for a low-temperature fresh-keeping metal granary according to claim 1 is characterized in that: Adjusting the temperature controller and the humidity modulator according to the optimal DQN model includes: The optimal DQN model is loaded; the raw data, the short-term warehouse environment data, the disease index and the insect pest index are collected in real time and input into the optimal DQN model; a control action is selected through the optimal DQN model; the temperature controller and the humidity modulator perform temperature and humidity control through the control action.
8. An intelligent temperature and humidity control system for a low-temperature fresh-keeping metal granary, characterized in that: include: The data acquisition module is used to collect the original data of the metal granary, attach a time stamp to the original data and store it in the database; the original data includes the environment data inside the granary, the gas data inside the granary, the environment data outside the granary and the equipment data; The in-warehouse environment prediction module is used to read the raw data and construct a time series data set, and input the time series data set into the TFT model to obtain a pre-trained model; obtain the meteorological data for the next 24 hours, and predict the short-term in-warehouse environment data of the metal granary through the pre-trained model; A disease index acquisition module, used for inputting the in-warehouse environment data and the in-warehouse gas data into a disease index calculation formula, and obtaining a disease index through the disease index calculation formula; The disease index calculation formula is: Wherein, DI represents the disease index, sigmoid() represents the activation function, k represents the disease growth rate, T represents the actual temperature in the warehouse, H represents the actual humidity in the warehouse, exp() represents the exponential function, T opt Indicates the optimal temperature for the disease, H opt represents the optimal humidity for the disease, a represents the temperature sensitivity coefficient, b represents the humidity sensitivity coefficient, n represents the type of gas in the warehouse, including carbon dioxide, oxygen and volatile organic compounds, ω i represents the weight of gas i, V i represents the concentration of gas i; The pest index acquisition module is used to collect insect monitoring images and insect monitoring audio frequencies, pre-process the insect monitoring images and the insect monitoring audio frequencies, and input them into the multi-source data recognition model to judge the pest status and obtain the pest index; A reinforcement learning module is used to design the state space, action space and reward function of the DQN algorithm according to the original data, the short-term warehouse environment data, the disease index and the pest index, and to maximize the reward function by training and updating the online Q network and target Q network of the DQN algorithm and minimizing the loss function, thereby obtaining an optimal DQN model; The temperature and humidity control module is used to adjust the temperature controller and the humidity modulator according to the optimal DQN model to complete the temperature and humidity control.
9. The intelligent temperature and humidity control system for a low-temperature fresh-keeping metal granary according to claim 8 is characterized in that: Obtaining the optimal DQN model includes: S501: constructing a state vector and defining a state space according to the original data, the short-term warehouse environment data, the disease index and the insect pest index; S502: Input the state vector into the DQN model, and define the action space through the temperature and humidity adjustment action; S503: Designing a reward function to calculate a reward value corresponding to each of the adjustment actions through temperature and humidity errors, the disease index, and the insect pest index; S504: Initialize the online Q network, target Q network and experience replay pool; S505: randomly extracting N samples from the experience replay pool, and using the Bellman equation to calculate the target Q value of the target Q network for each of the samples; S506: updating online parameters of the online Q network by minimizing the online Q value of the online Q network and the target Q value of the target Q network; S507: Update the target parameters of the target Q network according to the online parameters; S508: Determine whether the update stop condition is met. If so, obtain the optimal DQN model and save the target parameters of the optimal DQN model; otherwise, re-execute S505.
Citation Information
Patent Citations
Grain main pollutant risk prediction and control method
CN114819538A
Air conditioner temperature control method based on deep reinforcement learning
CN116358114A
Grain storage ventilation temperature prediction method for optimizing CNN-BiGRU-Attention network model based on IPSO algorithm
CN116720620A
Multi-modal perception crop disease and insect pest intelligent identification and precise early warning system
CN118658077A