Grain dryer control method and device and storage medium
The process of grain data through the gated circulation unit model has solved the problem of unstable control of grain dryers in the prior art, and an efficient and accurate drying process has been achieved, which has improved the stability and product quality of grain drying.
Patent Information
- Application Number
- CN202411123225.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-12-17
AI Technical Summary
The existing grain dryer control system, especially the PID algorithm and feedforward neural network, is difficult to accurately predict complex nonlinear drying processes, resulting in unstable drying and low energy consumption, affecting the quality of grains and storage life.
Using the gated loop unit model, by collecting and segmenting the grain data set, the initial gated loop unit model includes sequential model, gated loop unit layer, discarded layer and fully connected layer, leveraging its powerful time series processing capabilities. , optimize model parameters to learn complex characteristics of the drying process and apply them to actual control.
It improves the stability and efficiency of the drying process, reduces manual intervention, realizes automated control, ensures operation stability and consistency, and significantly improves product quality.
Smart Images

Figure CN119148781A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of agricultural engineering technology, and in particular to a control method, device and storage medium for a grain dryer. Background Art
[0002] Grain drying is an indispensable process in agricultural production, which is directly related to the storage and quality of grain. Over-drying or under-drying will lead to the deterioration of grain quality or even loss, so it is particularly important to accurately control the grain drying process.
[0003] At present, the control system of grain dryers mainly adopts proportional-integral-derivative algorithm (PID) or feedforward neural network algorithm. PID algorithm performs well in simple linear systems, but it is difficult to cope with complex nonlinear processes such as grain drying. Although feedforward neural network can make predictions, it cannot handle the time dependence of data, resulting in low accuracy in modeling dynamic processes.
[0004] Therefore, it is difficult for traditional PID algorithms and feedforward neural networks to accurately predict the future state of the grain drying process, which can easily cause over-drying or under-drying; the control method fails to effectively adjust the energy consumption during the drying process, resulting in low energy efficiency and affecting economic benefits; improper control during the drying process can lead to the loss of nutrients and taste of the grains, and even affect the storage life of the grains. Therefore, how to improve the stability of grain drying has become an urgent problem to be solved. The above content is only used to assist in understanding the technical solution of this application, and does not mean that the above content is recognized as prior art. Summary of the invention
[0005] The purpose of the present application is to provide a control method, device and storage medium for a grain dryer, aiming to solve the technical problem of how to improve the stability of grain drying.
[0006] To achieve the above objectives, the present application proposes a control method for a grain dryer, the method comprising:
[0007] Acquire a target grain dataset, and divide the target grain dataset into a training set and a test set;
[0008] Construct an initial GRU model based on the sequential model, GRU layer, dropout layer, fully connected layer, and output layer.
[0009] Using the training set and the test set to train and test the initial gated recurrent unit model to obtain a target gated recurrent unit model;
[0010] The target gated recurrent unit model is used to control a grain dryer.
[0011] In one embodiment, the step of controlling a grain dryer using the target gated recurrent unit model comprises:
[0012] Acquire current grain data, and obtain predicted grain moisture content, predicted grain temperature, grain surface temperature-time curve, and grain moisture content-time curve according to the current grain data and the target gated cyclic unit model;
[0013] According to the predicted moisture content of the grain, the predicted temperature of the grain and the target gated circulation unit model, the drying gas temperature, the relative humidity of the drying gas and the drying gas wind speed required in the drying process are obtained;
[0014] Calculate the grain drying rate according to the grain moisture content-time curve and the grain surface temperature-time curve;
[0015] adjusting the drying gas temperature, the drying gas relative humidity, and the drying gas wind speed according to the grain drying rate;
[0016] The grain dryer is controlled according to the drying gas temperature, the drying gas relative humidity and the drying gas wind speed.
[0017] In one embodiment, the step of obtaining the drying gas temperature, the drying gas relative humidity and the drying gas wind speed required in the drying process according to the predicted grain moisture content, the predicted grain temperature and the target gated circulation unit model comprises:
[0018] constructing an inverse model according to the target grain data set, the predicted grain moisture content, the predicted grain temperature, and the target gated recurrent unit model;
[0019] Using the test set to test the inverse model, to obtain a target inverse model;
[0020] The predicted moisture content of the grain and the predicted temperature of the grain are input into the target inverse model to obtain the drying gas temperature, the drying gas relative humidity and the drying gas wind speed required in the drying process.
[0021] In one embodiment, after the step of obtaining the predicted grain moisture content, predicted grain temperature and grain moisture content-time curve according to the current grain data and the target gated recurrent unit model, the method further includes:
[0022] Performing median filtering on the current grain data and performing range normalization processing on the current grain data to obtain target grain data;
[0023] extracting samples from the target grain data through a sliding window;
[0024] Inputting the sample into the target gated recurrent unit model to obtain a predicted value;
[0025] The parameters of the target gated recurrent unit model are adjusted according to the predicted value until an average error between the predicted value and an actual value in the sample is less than or equal to a preset error.
[0026] In one embodiment, the step of constructing an initial gated recurrent unit model according to the sequential model, the gated recurrent unit layer, the drop layer, the fully connected layer, and the output layer comprises:
[0027] Initializing a sequential model and adding a preset number of gated recurrent unit layers to the sequential model;
[0028] adding a dropout layer after each of the gated recurrent unit layers;
[0029] adding a fully connected layer after the dropout layer;
[0030] An output layer is added after the fully connected layer to obtain an initial gated recurrent unit model.
[0031] In one embodiment, the step of training and testing the initial gated recurrent unit model using the training set and the test set to obtain a target gated recurrent unit model comprises:
[0032] Using the training set to train the initial gated recurrent unit model to obtain a reference gated recurrent unit model;
[0033] Using the test set to test the reference gated recurrent unit model, to obtain a test result;
[0034] When the test result does not meet the preset requirement, return to the step of training the initial gated recurrent unit model using the training set until the test result meets the preset requirement to obtain a target gated recurrent unit model.
[0035] In one embodiment, the step of using the training set to train the initial gated recurrent unit model to obtain a reference gated recurrent unit model comprises:
[0036] Inputting the input data in the training set into the initial gated recurrent unit model to obtain predicted data;
[0037] The loss value is calculated based on the grain discharge data in the training set, the predicted data and the mean square error formula;
[0038] Calculate the gradient of the input data according to the loss value;
[0039] Adaptive moment estimation is performed on the parameters of the initial gated recurrent unit model according to the gradient until the loss value is less than or equal to a preset loss threshold, thereby obtaining a reference gated recurrent unit model.
[0040] In one embodiment, the step of obtaining the target grain dataset includes:
[0041] Acquire an initial grain data set, wherein the initial grain data set includes input parameters and target variables;
[0042] Normalizing the initial grain data set by range normalization to obtain an intermediate grain data set;
[0043] converting the intermediate grain dataset into a time series dataset and using the input parameters of the time series dataset as subsequences;
[0044] The target variables of the subsequence and the time series data set are converted into a three-dimensional array form to obtain a target grain data set.
[0045] In addition, to achieve the above-mentioned purpose, the present application also proposes a control device for a grain dryer, the device comprising:
[0046] A data acquisition module, used for acquiring a target grain data set and dividing the target grain data set into a training set and a test set;
[0047] A model building module for building an initial GRU model from a sequential model, GRU layers, dropout layers, fully connected layers, and an output layer;
[0048] A training module, used to train and test the initial gated recurrent unit model using the training set and the test set to obtain a target gated recurrent unit model;
[0049] A control module is used to control a grain dryer using the target gated recurrent unit model.
[0050] In addition, to achieve the above-mentioned objectives, the present application also proposes a control device for a grain dryer, the device comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the control method for the grain dryer as described above.
[0051] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the control method of the grain dryer as described above are implemented.
[0052] One or more technical solutions proposed in this application have at least the following technical effects:
[0053] A target grain data set is obtained, and the target grain data set is divided into a training set and a test set; an initial gated recurrent unit model is constructed according to a sequential model, a gated recurrent unit layer, a discard layer, a fully connected layer, and an output layer; the initial gated recurrent unit model is trained and tested using the training set and the test set to obtain a target gated recurrent unit model; and a grain dryer is controlled using the target gated recurrent unit model. First, by collecting real-time grain data sets and dividing them into training sets and test sets, the data quality and reliability of model establishment and verification are ensured; secondly, an initial gated recurrent unit model including a sequential model, a gated recurrent unit layer, a discard layer, a fully connected layer and an output layer is constructed. These components can effectively process time series data and improve the generalization ability and prediction accuracy of the model; then, the model is trained using the training set, and the model parameters are optimized through the back propagation algorithm to learn and capture the complex patterns and features in the grain drying process. At the same time, the performance and generalization ability of the model are evaluated through the test set to ensure that the model can effectively predict unseen data; finally, the trained target gated recurrent unit model is applied to the actual grain dryer control to realize the prediction and adjustment of the grain drying process, thereby improving the drying efficiency and product quality, reducing manual intervention, and realizing automatic control, ensuring the stability and consistency of operation. This application combines data analysis, machine learning modeling and real-time control to improve the stability of grain drying and provide an efficient, accurate and reliable solution for the grain drying process. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0055] In order to more clearly illustrate the embodiments of the present application 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.
[0056] Figure 1 A flow chart of a control method for a grain dryer according to the present invention;
[0057] Figure 2 A schematic diagram of the internal structure of a GRU neuron provided in Example 1 of the control method for a grain dryer of the present application;
[0058] Figure 3A schematic diagram of the target gated cycle unit model structure provided in Example 1 of the control method for a grain dryer of the present application;
[0059] Figure 4 A schematic diagram of a flow chart provided for the second embodiment of the control method for a grain dryer of the present application;
[0060] Figure 5 A schematic diagram of a grain surface temperature-time curve provided in Example 2 of the control method for a grain dryer of the present application;
[0061] Figure 6 A schematic diagram of a grain moisture content-time curve provided in Example 2 of the control method for a grain dryer of the present application;
[0062] Figure 7 A brief flow chart of a control method for a grain dryer provided in Example 2 of the present application;
[0063] Figure 8 A schematic diagram of a simplified model of a grain drying barrel provided in Embodiment 2 of the control method for a grain dryer of the present application;
[0064] Fig. 9 This is a schematic diagram of the module structure of the control device of the grain dryer according to the embodiment of the present application;
[0065] Fig.10 Schematic diagram of the equipment structure of the hardware operating environment involved in the control method of the grain dryer in the embodiment of the present application.
[0066] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0067] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0068] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0069] Grain drying is crucial to ensuring grain quality and storage, but existing control methods such as PID and feedforward neural networks have limitations in dealing with nonlinear drying processes and time dependencies. This leads to the inability to accurately predict the drying state, increasing the risk of quality degradation and economic losses, which may affect grain nutrition and taste and shorten storage life.
[0070] The main solution of the embodiment of this application is to carefully collect and divide the grain data set, build and train a gated recurrent unit (GRU) model with multiple levels, and use its powerful time series processing capabilities to optimize model parameters to learn the complex characteristics of the grain drying process. After verifying the generalization ability of the model through the test set, the model is applied to the prediction and control of the drying process of the grain dryer, realizing an automated, efficient and stable drying process, significantly improving product quality and reducing manual intervention.
[0071] It should be noted that the execution subject of the embodiment of the present application can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a grain dryer, a control system of a grain dryer, a host computer, etc. The following takes the control system of a grain dryer as an example to illustrate this embodiment and the following embodiments.
[0072] Based on this, the embodiment of the present application provides a control method for a grain dryer, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the control method for a grain dryer of the present application.
[0073] In this embodiment, the control method of the grain dryer includes steps S10 to S40:
[0074] Step S10, obtaining a target grain dataset, and dividing the target grain dataset into a training set and a test set;
[0075] It should be noted that the target grain dataset is a preprocessed and processed dataset, which may include the original data collected from actual operations (such as grain moisture content, grain surface temperature, external environment temperature, external environment relative humidity, drying gas temperature, drying gas relative humidity, drying gas wind speed, etc.) After cleaning, conversion, feature extraction and other steps, the final dataset is obtained. These data are used as input for machine learning or data analysis. The training set is a subset divided from the target grain dataset. These datasets are used to train machine learning models so that they can learn and understand the complex relationships and patterns between different parameters in the grain drying process. The training set usually includes input features and corresponding target outputs, such as grain moisture content and grain surface temperature. The test set is an independent subset divided from the target grain dataset. After the model training is completed, the test set is used to evaluate the performance and generalization ability of the model. The performance on the test set can verify the prediction ability and accuracy of the model on new data.
[0076] It is understandable that a sensor network needs to be deployed first to collect various data about the target grain drying process. These sensors include measuring grain moisture content, grain surface temperature, external environment temperature, external environment relative humidity, drying gas temperature, drying gas relative humidity, drying gas wind speed, etc. The sensors will continuously monitor and record these data to ensure the comprehensiveness and accuracy of the data. The collected raw data will undergo a preprocessing step, which may include data cleaning, missing value processing, feature selection and transformation, and possible standardization or normalization. The purpose of preprocessing is to prepare a data set for machine learning model training. Next, 80% of the data group samples are randomly selected from the target grain data set as the training sample data set, and the remaining 20% of the data group is used as the test set. The training set will be used to train the machine learning model so that the model can learn the patterns and relationships in the data, and the test set will be reserved for evaluating the generalization ability and prediction accuracy of the model on unseen data. This partitioning strategy helps to verify the effectiveness of the model and ensure that the model can reliably predict and optimize various parameters and conditions in the grain drying process in practical applications.
[0077] As an example, the step of obtaining a target grain data set includes: obtaining an initial grain data set, the initial grain data set including input parameters and target variables; normalizing the initial grain data set by range normalization to obtain an intermediate grain data set; converting the intermediate grain data set into a time series data set, and taking the input parameters of the time series data set as a subsequence; converting the subsequence and the target variables of the time series data set into a three-dimensional array form to obtain a target grain data set.
[0078] The initial grain data set is obtained from the original data actually collected or obtained, usually including grain moisture content, grain surface temperature, external environment temperature, external environment relative humidity, drying gas temperature, drying gas relative humidity, drying gas wind speed, etc. Input parameters are various variables or characteristics that affect or describe the grain drying process, such as external environment temperature, external environment relative humidity, drying gas temperature, drying gas relative humidity, drying gas wind speed, etc. The target variable is the variable that you want to predict or optimize through the model, such as grain moisture content, grain surface temperature, etc. Range normalization is a method of data normalization, which processes the data by mapping it to the range of [0,1]. Normalization is to adjust the data to the same scale, usually by mapping the data to a specific range, such as [0,1] or [-1,1]. The intermediate grain data set is the data set obtained after range normalization (Minimum Maximum Scaler, MinMaxScaler), and all features are in the range of [0,1]. The specific formula is:
[0079]
[0080] In the formula, X scaled is the scaled data, ranging from [0,1], X is the original data, and X min is the minimum value of the original data, X max is the maximum value of the original data.
[0081] A time series dataset is a dataset arranged in chronological order, and each time point records the parameters and conditions of the grain drying process. In a time series dataset, a subsequence is a small time range of data cut out from the overall time series. In this embodiment, the subsequence length is 10, and each subsequence is used as an input parameter sample, and the corresponding target variable is a data point after the subsequence. The three-dimensional array form refers to the data form in which the subsequence and the target variable are converted into a three-dimensional NumPy array (3DNumPy array), which is usually to meet the input requirements of the machine learning model, such as the format of (number of samples, number of time steps, number of features).
[0082] First, the original data are collected from the field, including various input parameters in the grain drying process (such as ambient temperature, humidity, drying gas temperature and humidity, drying gas wind speed, etc.) and target variables (such as grain surface temperature, grain moisture content). Then, these initial data are normalized using the range normalization method so that all eigenvalues are mapped to the range of [0,1] to obtain the intermediate grain data set. Subsequently, the intermediate grain data set is converted into a time series data set, arranged in chronological order, and the input parameters are used as subsequences. Finally, these subsequences and the corresponding target variables are converted into a three-dimensional array form to facilitate the subsequent training and predictive analysis of the machine learning model.
[0083] Step S20, constructing an initial gated recurrent unit model according to the sequential model, the gated recurrent unit layer, the dropout layer, the fully connected layer, and the output layer;
[0084] It should be noted that the sequential model refers to a basic model organization method in the deep learning framework, such as the Sequential model in Keras. It allows users to build a neural network model by stacking layers, and the output of each layer is used as the input of the next layer, thus forming a linear network structure. The Gated Recurrent Unit (GRU) layer is a variant of the Recurrent Neural Network (RNN) with a gating mechanism that helps capture long-term dependencies in sequence data. The dropout layer is a technique that randomly drops neurons during training, which helps reduce overfitting and enhances the generalization ability of the model. The fully connected layer is also called a densely connected layer (Dense layer), in which each input neuron in the neural network is connected to each output neuron. The output layer is the last layer of the neural network and is responsible for generating the final output of the model. The initial gated recurrent unit model refers to the initial version of the recurrent neural network model built based on the gated recurrent unit layer, which can be further optimized and adjusted on this basis.
[0085] It can be understood that, first, a sequential model is adopted as the basic framework, which allows different types of neural network layers to be stacked layer by layer in sequence. Secondly, a gated recurrent unit layer is added. This special recurrent neural network layer (such as a long short-term memory unit or a gated recurrent unit) can effectively process time series data, maintain long-term dependencies and reduce the gradient vanishing problem. Next, a dropout layer is introduced, the purpose of which is to randomly discard the outputs of some neurons to prevent the model from overfitting. Then, fully connected layers are added, which can connect all neurons in the previous layer with all neurons in the next layer, thereby effectively learning the complex features of the input data. Finally, an output layer is added, which is the last layer of the model and is responsible for generating the final prediction results or classification outputs. Combining the above steps, the constructed initial gated recurrent unit model can adapt to and process the grain dataset required in this scheme, and achieve effective time series prediction or classification tasks.
[0086] As an example, the steps of constructing an initial gated recurrent unit model according to a sequential model, a gated recurrent unit layer, a dropout layer, a fully connected layer, and an output layer include: initializing the sequential model, and adding a preset number of gated recurrent unit layers to the sequential model; adding a dropout layer after each of the gated recurrent unit layers; adding a fully connected layer after the dropout layer; and adding an output layer after the fully connected layer to obtain an initial gated recurrent unit model.
[0087] First, initialize the sequential model as the basic architecture of the model. Then, add a preset number of gated recurrent unit layers to the sequential model in sequence. These layers are designed to effectively process time series data and maintain the ability to learn long-term dependencies. Add a dropout layer after each gated recurrent unit layer. The function of the dropout layer is to randomly discard the output of some neurons during the training process, which helps prevent the model from overfitting. Then, add a fully connected layer after each dropout layer. The fully connected layer can connect all neurons in the previous layer with all neurons in the next layer to effectively learn the complex features of the input data. Finally, add an output layer after the last fully connected layer. The output layer is responsible for generating the final model prediction or classification results. Through these steps, an initial gated recurrent unit model that meets the requirements of this scheme can be constructed for time series prediction or classification tasks of grain datasets.
[0088] First, initialize a sequential model. The sequential model allows adding neural networks layer by layer. By comparing the accuracy of the neural network model with 1-5 GRU layers, it is found that when the main network of the model is 3 GRU layers, the model has the highest accuracy, reaching 96.1%. By comparing different numbers of neuron combinations, when the number of neurons is (128, 64, 32), the model has the highest accuracy, reaching 92.7%. The GRU layer of neurons can process time series data and capture the time dependency in the data. The operation process of a single neuron in the GRU neural network model is shown in the following formula:
[0089] z t =σ(w z ×[h t-1 ,x t ])
[0090] Where z t represents the update gate, σ represents the sigmoid activation function, and w z represents the weight matrix, h t-1 Indicates the previous node information state, x t Represents the input of the current node.
[0091] r t =σ(w r ×[h t-1 ,x t ])
[0092] Where r t represents the reset gate, w r represents the weight matrix.
[0093] N t =tanh(w×[r t ×h t-1 ,x t ])
[0094] Where N t represents the candidate hidden state, and w represents the weight matrix.
[0095] h t =(1-z t )×h t-1 +z t ×N t
[0096] Where h t Indicates the current node information state.
[0097] y t =σ(w o ×h t +b y )
[0098] Where y t Indicates the output of a new candidate state, w o represents the weight matrix, b y Indicates the offset.
[0099] A Dropout layer with a random dropout rate of 0.2 is added after each GRU layer to reduce overfitting. A Dense layer with 32 units is added after the last Dropout layer, i.e., a fully connected layer. The calculation formula of the fully connected layer is as follows:
[0100] y=ReLU(wx+b)
[0101] In the formula, y represents the output of the Dense layer, x represents the input of the Dense layer, w represents the weight parameter, and b represents the bias parameter. The ReLU function is an activation function, and the specific formula is as follows:
[0102]
[0103] Finally, an output layer is added with an output dimension of 2, namely the surface temperature of the grain and the moisture content of the grain. The model uses the Adam optimizer to automatically adjust the learning rate. The Adam optimizer can set different learning rates by observing the changes in the loss function during the iteration process to make the model converge faster. Finally, the mean square error (MSE) is used as the loss function to show the degree of fit of the model.
[0104] Please refer to Figure 2 , Figure 2A schematic diagram of the internal structure of a GRU neuron provided in Example 1 of the control method for a grain dryer of the present application shows the internal structure of a GRU neuron and reveals how the GRU model effectively processes time series data through its unique gating mechanism. In the GRU model, each neuron contains an update gate and a reset gate, which control the flow and update of information. The update gate is responsible for determining how much of the past state should be retained, while the reset gate determines how much of the past information is discarded, allowing the model to ignore the previous hidden state and focus on the current input. The tan h in the figure represents an activation function, which is used to introduce nonlinearity so that the model can capture more complex data patterns. Nt represents the current neuron output, and Xt represents the input of the current time step. Through this structure, GRU can solve the problem of gradient disappearance or gradient explosion in traditional recurrent neural networks, especially when processing long sequence data. In the present application, this feature of the GRU model is used to accurately predict the moisture content and surface temperature during grain drying, thereby realizing intelligent control of the drying process, optimizing drying efficiency and ensuring grain quality.
[0105] Please refer to Figure 3 , Figure 3The schematic diagram of the target gated recurrent unit model structure provided for the control method embodiment 1 of the grain dryer of the present application shows the core components and information flow path of the GRU unit. It can be seen from the figure that the model starts with the input layer and receives characteristic parameters such as the temperature, relative humidity, temperature, relative humidity, and wind speed of the external environment, as well as target variables such as the moisture content and surface temperature of the grain. These input data are processed by three GRU unit layers, and each layer of GRU units contains an update gate and a reset gate to control the flow and update of information and maintain the hidden state h. Each GRU unit layer is followed by a Dropout layer with a random dropout rate of 0.2, which helps to reduce the overfitting phenomenon of the model and improve the generalization ability of the model. In the GRU unit, the tan h activation function is used to generate candidate hidden states, and the sigmoid function is used to calculate the values of the update gate and the reset gate. The weight matrix W and the bias β are used in the model to adjust the input and the previous hidden state to generate a new hidden state. The hidden state h is passed through the time step t to capture the dynamic characteristics in the time series data. The output layer of the model ultimately outputs the predicted grain surface temperature and moisture content, which are used to control the drying parameters of the dryer to ensure the uniformity and stability of the grain drying process. The entire GRU model is trained using the Adam optimizer, using the mean square error (MSE) as the loss function to minimize the difference between the model prediction and the actual observation. Through this structured design, the model is able to learn the complex patterns and features of the grain drying process, achieve precise control of the drying rate and surface temperature, and thus improve drying efficiency and product quality.
[0106] Step S30, training and testing the initial gated recurrent unit model using the training set and the test set to obtain a target gated recurrent unit model;
[0107] It should be noted that training refers to using the training set data to adjust the parameters of the gated recurrent unit model so that it can learn from the data and adapt to specific tasks, such as grain moisture content prediction. Testing refers to using the test set data to evaluate the performance and generalization ability of the trained gated recurrent unit model, that is, the performance of the model on unseen data. The target gated recurrent unit model refers to the final model that performs well on both the training set and the test set after training and adjustment, and can effectively handle the grain dataset task.
[0108] It can be understood that, first, the acquired training set data is used to train the initial gated recurrent unit model. Through repeated iterations of the training process, the model will adjust the parameters according to the input parameters and target variables in the training set to minimize the difference between the predicted results and the actual targets. Next, the test set data is used to evaluate the performance and generalization ability of the trained gated recurrent unit model. This step is to verify the performance of the model on unseen data to ensure that the model can effectively generalize to new data. Finally, through the process of training and testing, the target gated recurrent unit model is obtained, which performs well in the grain dataset task and can accurately predict or classify the required target variables.
[0109] As an example, the initial gated recurrent unit model is trained and tested using the training set and the test set to obtain a target gated recurrent unit model, including the steps of: training the initial gated recurrent unit model using the training set to obtain a reference gated recurrent unit model; testing the reference gated recurrent unit model using the test set to obtain a test result; when the test result does not meet the preset requirements, returning to the step of training the initial gated recurrent unit model using the training set until the test result meets the preset requirements to obtain a target gated recurrent unit model.
[0110] The reference gated recurrent unit model refers to the model obtained by training the initial gated recurrent unit model using the training set. This model has been parameter adjusted and optimized on the training set, but has not been verified on the test set. The test result refers to the performance index or prediction accuracy or error size obtained after evaluating the reference gated recurrent unit model using the test set. The preset requirements refer to the performance standards or indicators set during the training and testing process, which are used to evaluate the performance of the model on the test set. When the test results do not meet the preset requirements, it means that the model performs poorly on unseen data and needs to return to the training stage to continue adjusting the model until the preset performance requirements are met, thereby obtaining the final target gated recurrent unit model, which generally includes accuracy requirements (the classification accuracy of the model on the test set reaches a certain percentage, such as an accuracy of more than 85%), loss function requirements (the loss function value of the model on the test set reaches a certain threshold, such as a loss function value lower than 0.5) and error requirements (the mean square error (MSE) or mean absolute error (MAE) of the model on the test set is less than the preset value).
[0111] First, the training set is used to train the initial gated recurrent unit model. This step involves adjusting the model parameters through backpropagation and optimization algorithms (such as stochastic gradient descent) to minimize the loss function on the training set, thereby obtaining a reference gated recurrent unit model. Next, the performance of the reference model is evaluated using the test set. This step involves inputting the test set into the model and calculating the model's prediction results on the test set. If the test results fail to meet the preset performance requirements (for example, the accuracy or loss function reaches a specific threshold), the training phase is returned to the initial model and the training set is retrained. This process continues until the model reaches the preset performance standard on the test set, thereby obtaining the final target gated recurrent unit model.
[0112] As an example, the steps of using the training set to train the initial gated recurrent unit model to obtain a reference gated recurrent unit model include: inputting the input data in the training set into the initial gated recurrent unit model to obtain predicted data; calculating a loss value based on the grain output data in the training set, the predicted data and a mean square error formula; calculating a gradient of the input data based on the loss value; and performing adaptive moment estimation on the parameters of the initial gated recurrent unit model based on the gradient until the loss value is less than or equal to a preset loss threshold, thereby obtaining a reference gated recurrent unit model.
[0113] Input data refers to the data in the training set used to train the gated recurrent unit model, including various feature data collected during the grain processing process, such as external environment temperature, external environment relative humidity, drying gas temperature, drying gas relative humidity, drying gas wind speed, etc. Prediction data refers to the prediction result output by the model after the input data is input into the initial gated recurrent unit model, that is, the target variable predicted by the model based on the input data, such as grain moisture content, grain surface temperature, etc. Grain output data refers to the actual target variable value in the training set, that is, the output data in the actual grain processing process, such as certain specific parameters of the grain after drying (such as grain moisture content, grain surface temperature, etc.). Mean square error is an indicator to measure the degree of difference between the predicted value and the true value, and is usually used to calculate the difference between the predicted data and the grain output data. The calculation formula of mean square error (MSE) is as follows:
[0114]
[0115] Where MSE is the mean square error, n is the number of samples, and y i is the true value of the i-th sample, is the predicted value of the i-th sample.
[0116] The loss value refers to a quantitative indicator calculated by the mean square error or other loss functions, which is used to measure the accuracy of model prediction or the size of the error. The gradient refers to the derivative or gradient of the loss function with respect to the model parameters, which is used to guide the direction and step size of parameter updates and is an important basis for adjusting model parameters in the optimization algorithm. Adaptive moment estimation (Adam) is an optimization algorithm, which usually refers to dynamically adjusting the learning rate or the step size of parameter updates based on the statistical information of the gradient to improve training efficiency and convergence speed. The preset loss threshold refers to the upper limit or target value of the loss value set during the training process. When the loss value reaches or falls below the threshold, the training process can terminate or enter the next stage. For example, setting the preset loss threshold to 0.01 means that the loss value is expected to not exceed 0.01 during the training process.
[0117] First, the training set is used to input the input data into the initial gated recurrent unit model, and the model obtains the predicted data through learning and iteration. Next, the actual grain machine data and predicted data in the training set are used to calculate the loss value using the mean square error formula. This step quantifies the degree of error between the predicted result and the actual result. Subsequently, the gradient of the input data is calculated based on the loss value, and the gradient indicates the change trend of the loss function with respect to the model parameters. Finally, the adaptive moment estimation method is used to adjust the parameters of the gated recurrent unit model according to the gradient until the loss value is reduced to below the preset loss threshold. The experimental comparison shows that when the GRU neural network model sample training times is 200, it can be considered to converge, and the model accuracy rate reaches 93.14%, thereby obtaining an optimized reference gated recurrent unit model, which performs well on the training set and can accurately predict the target variables in the grain processing process.
[0118] Step S40: Controlling the grain dryer using the target gated recurrent unit model.
[0119] It should be noted that a grain dryer refers to a device or system used for grain drying, which is usually used to control parameters such as the temperature, humidity, and wind speed of the drying gas during the drying process to ensure that the grain reaches an ideal drying state.
[0120] It can be understood that, first, the real-time data of the grain dryer are input into the trained target gated recurrent unit model, and these data include grain temperature, grain moisture content, external environment temperature, external environment relative humidity, drying gas temperature, drying gas relative humidity, drying gas wind speed, etc.; secondly, the model predicts the current drying state of the grain and the optimal operation strategy based on these input data; finally, according to the control instructions output by the model, the operating parameters of the grain dryer are adjusted, such as adjusting the temperature, humidity and wind speed of the drying gas, so as to achieve a more efficient and precise grain drying process and ensure that the grain obtains the ideal drying effect and quality in the dryer.
[0121] The present embodiment provides a control method for a grain dryer, which comprises obtaining a target grain data set, and dividing the target grain data set into a training set and a test set; constructing an initial gated recurrent unit model according to a sequential model, a gated recurrent unit layer, a discard layer, a fully connected layer, and an output layer; training and testing the initial gated recurrent unit model using the training set and the test set to obtain a target gated recurrent unit model; and controlling the grain dryer using the target gated recurrent unit model. First, by collecting real-time grain data sets and dividing them into training sets and test sets, the data quality and reliability of model establishment and verification are ensured; secondly, an initial gated recurrent unit model including a sequential model, a gated recurrent unit layer, a discard layer, a fully connected layer and an output layer is constructed. These components can effectively process time series data and improve the generalization ability and prediction accuracy of the model; then, the model is trained using the training set, and the model parameters are optimized by the back propagation algorithm to learn and capture the complex patterns and features in the grain drying process. At the same time, the performance and generalization ability of the model are evaluated by the test set to ensure that the model can effectively predict unseen data; finally, the trained target gated recurrent unit model is applied to the actual grain dryer control to realize the prediction and adjustment of the grain drying process, thereby improving the drying efficiency and product quality, reducing manual intervention, and realizing automatic control, ensuring the stability and consistency of operation. This embodiment combines data analysis, machine learning modeling and real-time control, improves the stability of grain drying, and provides an efficient, accurate and reliable solution for the grain drying process.
[0122] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can refer to the above introduction, and will not be repeated later. Figure 4 , Figure 4 This is a flow chart of the second embodiment of the control method of the grain dryer of the present application. Step S40 of the control method of the grain dryer includes steps S41 to S45:
[0123] Step S41, obtaining current grain data, and obtaining predicted grain moisture content, predicted grain temperature, grain surface temperature-time curve, and grain moisture content-time curve according to the current grain data and the target gated recurrent unit model;
[0124] It should be noted that the current grain data refers to various parameters of grain obtained from real-time monitoring, such as the actual moisture content and surface temperature of grain, which are used as input data for model prediction. The predicted moisture content of grain refers to the moisture content value of grain at a future moment predicted by the target gated cyclic unit model, which is predicted and calculated based on the current input data and the learning ability of the model. The predicted temperature of grain refers to the surface temperature value of grain at a future moment predicted by the target gated cyclic unit model, which is also calculated and predicted based on the current input data and the prediction ability of the model. The grain surface temperature-time curve refers to a graph of the change of grain surface temperature over time drawn based on the prediction results of the target gated cyclic unit model. This curve shows the predicted change of grain surface temperature during the drying process, thereby reflecting the model's understanding and prediction ability of the drying process. By observing this curve, we can understand how the grain surface temperature changes over time during the drying process, thereby evaluating the efficiency and effect of the drying process. The grain moisture content-time curve refers to a curve chart of the change of grain moisture content over time drawn based on the prediction results of the target gated cyclic unit model. It shows the predicted change of moisture content during the grain drying process and reflects the model's understanding and prediction ability of the drying process.
[0125] Please refer to Figure 5 , Figure 5 A schematic diagram of the grain surface temperature-time curve provided for the second embodiment of the control method of the grain dryer of the present application shows the curve of the surface temperature of the grain changing with time during the drying process, wherein the horizontal axis represents time (minutes) and the vertical axis represents the surface temperature of the grain (°C). The two curves in the figure represent the measured value and the predicted value of the grain surface temperature respectively: one curve is a measured value curve drawn based on the data collected during the actual drying process, and the other is a grain surface temperature value curve predicted by the GRU model based on the same time interval. By comparing the two curves, the accuracy and reliability of the GRU model prediction can be evaluated. The measured value curve shows the actual change of the grain surface temperature over time, while the predicted value curve reflects the future trend predicted by the model based on the input parameters and historical data. This kind of curve chart is crucial for monitoring and adjusting the drying process, and can ensure that the surface temperature of the grain during the drying process does not exceed the maximum temperature it can withstand, thereby avoiding irreversible damage to the quality of the grain. Through this real-time monitoring and prediction, the grain dryer control system can more accurately adjust the drying parameters, optimize the drying process, and improve the drying efficiency and product quality.
[0126] Please refer to Figure 6 , Figure 6The grain moisture content-time curve diagram provided for the control method embodiment 2 of the grain dryer of the present application shows the curve of the moisture content of the grain changing with time during the drying process, with the horizontal axis representing time (minutes) and the vertical axis representing the moisture content percentage of the grain. The two curves in the figure track the measured value and predicted value of the grain moisture content respectively: the grain moisture content measured value curve reflects the real data of the grain moisture content obtained by the sensor during the actual drying process, while the grain moisture content predicted value curve is based on the GRU model, combining historical data and real-time input parameters to predict the moisture content change trend. By comparing these two curves, the accuracy of the GRU model for predicting the moisture content during the grain drying process can be intuitively evaluated. This curve diagram is of great significance for intelligent control of grain dryers. It not only helps monitor the drying state of grains to avoid insufficient or excessive drying, but also adjusts the drying parameters in advance through the prediction model to ensure that the grains are dried at the optimal rate and conditions throughout the drying process, thereby ensuring the quality and nutritional value of the grains. Through this real-time monitoring and prediction, the drying efficiency can be significantly improved, energy consumption can be reduced, and the automation and intelligence of the grain drying process can be realized.
[0127] It is understandable that various data of the current grains are first obtained from real-time monitoring, including parameters such as the actual moisture content of the grains, the surface temperature of the grains, the temperature of the drying gas, and the humidity of the drying gas. Subsequently, the target gated recurrent unit model trained in advance is used to input these current grain data into the model, and the predicted moisture content and predicted surface temperature of the grains at future moments are calculated through the prediction ability of the model. At the same time, based on these prediction results, a graph of the changes of the grain surface temperature and the grain moisture content over time can be drawn, namely, the grain surface temperature-time curve and the grain moisture content-time curve. These prediction results and graphs can help to control the grain drying process in real time, optimize the operation of the dryer, and ensure the stability and improvement of the grain drying effect and quality.
[0128] As an example, after the step of obtaining the predicted grain moisture content, predicted grain temperature and grain moisture content-time curve according to the current grain data and the target gated recurrent unit model, it also includes: performing median filtering on the current grain data and performing range normalization on the current grain data to obtain target grain data; extracting samples from the target grain data through a sliding window; inputting the samples into the target gated recurrent unit model to obtain predicted values; adjusting the parameters of the target gated recurrent unit model according to the predicted values until the average error between the predicted values and the actual values in the samples is less than or equal to a preset error.
[0129] Median filtering refers to a signal processing technique used to smooth data and remove noise. It calculates the median value of the data point to replace the value of each data point, thereby reducing the impact of outliers on the data. Range normalization is a data preprocessing method used to adjust the range of the data to have a uniform scale. It maps the data to a specific range, such as [0,1] or [-1,1], so that the model can learn and process more effectively. The target grain data is the grain data after median filtering and range normalization, which is used for subsequent sample extraction and model input. Sliding window is a data processing technique used to extract subsequences from time series data. It generates continuous subsets for training and testing models by moving a fixed-size window on the data sequence. The sample is a data subset extracted from the target grain data, and its size and stride are usually defined by the sliding window. The predicted value is the model output obtained by inputting the sample into the target gated recurrent unit model, which is used to predict the moisture content, temperature or other variables of interest of the grain. The average error is the average of the differences between the predicted value and the actual value in the sample, which is used to evaluate the prediction accuracy of the model. The preset error is an error threshold (5% in this embodiment) set during the training process, that is, the prediction accuracy level that the model is expected to achieve when adjusting parameters.
[0130] The current grain data is processed by median filtering, which is a step aimed at smoothing the data to reduce the impact of noise, and performing range normalization to scale the data to a uniform range to obtain the target grain data. Subsequently, samples are extracted from the target grain data through a sliding window, and each sample is sent as input to the target gated recurrent unit model to obtain a predicted value. Based on these predicted values, the parameters of the target gated recurrent unit model are adjusted, and this process is repeated until the average error between the predicted value and the actual value in the sample is less than or equal to the preset error. The purpose of these steps is to optimize the performance of the model and ensure its accuracy and stability in predicting actual data.
[0131] Step S42, obtaining the drying gas temperature, the drying gas relative humidity and the drying gas wind speed required in the drying process according to the predicted grain moisture content, the predicted grain temperature and the target gated circulation unit model;
[0132] It should be noted that the drying gas temperature refers to the air temperature used to transfer heat and control the drying effect during the grain drying process. The relative humidity of the drying gas refers to the percentage of the water vapor content in the air during the drying process relative to the saturated water vapor content at that temperature, which is used to measure the humidity level in the air. The drying gas wind speed refers to the air speed at which the air flows through the grain drying equipment to accelerate the drying process.
[0133] It can be understood that, first, the predicted grain moisture content and temperature are used as inputs to calculate the required drying gas temperature, drying gas relative humidity and drying gas wind speed during the drying process through the target gated cycle unit model. These parameters are adjusted according to the predicted grain state to ensure that appropriate environmental conditions are maintained during the drying process, thereby effectively controlling the drying speed and quality of the grain.
[0134] As an example, the steps of obtaining the drying gas temperature, drying gas relative humidity and drying gas wind speed required in the drying process according to the predicted grain moisture content, the predicted grain temperature and the target gated circulation unit model include: constructing an inverse model according to the target grain data set, the predicted grain moisture content, the predicted grain temperature and the target gated circulation unit model; testing the inverse model using the test set to obtain a target inverse model; inputting the predicted grain moisture content and the predicted grain temperature into the target inverse model to obtain the drying gas temperature, drying gas relative humidity and drying gas wind speed required in the drying process.
[0135] The inverse model refers to the inverse model of the target gated recurrent unit model, which is used to infer the input based on the output of the target gated recurrent unit model. Specifically, in this step, the inverse model is constructed based on the target grain dataset, predicted grain moisture content, predicted grain temperature, and the target gated recurrent unit model. Its task is to infer the drying gas temperature, relative humidity, and wind speed required in the drying process based on the predicted grain moisture content and temperature. The target inverse model refers to the inverse model that has been trained and tested and verified, and is used to actually predict and control the gas environment parameters in the drying process.
[0136] First, an inverse model is constructed based on the target grain dataset, predicted grain moisture content, predicted grain temperature, and target gated recurrent unit model. The inverse model is the inverse model of the target gated recurrent unit model. Its purpose is to infer the drying gas temperature, relative humidity, and wind speed required in the drying process based on the predicted moisture content and predicted temperature output by the target gated recurrent unit model. Then, the inverse model is tested using a test set to verify its accuracy and reliability, thereby obtaining the target inverse model. Finally, the predicted grain moisture content and predicted temperature are used as inputs, and the drying gas temperature, relative humidity, and wind speed required in the drying process are calculated by the target inverse model. This process ensures that in practical applications, the environmental parameters in the drying process can be effectively controlled and adjusted according to the predicted data to achieve the expected drying effect and quality requirements.
[0137] Step S43, calculating the grain drying rate according to the grain moisture content-time curve and the grain surface temperature-time curve;
[0138] It should be noted that the grain drying rate refers to the rate of change or reduction of grain moisture content over time during the drying process. It reflects the change in moisture content of grains under given drying conditions. It is usually expressed as the reduction in moisture content within a time unit, such as the percentage or absolute amount of moisture reduction per hour. Assume that the initial moisture content of a certain grain is 30% during the drying process. After a certain period of time, the moisture content of the grain is reduced to 20%. Calculate the reduction in moisture. The initial moisture content is 30%, and the final moisture content is 20%. Therefore, the moisture reduction is 30%-20%=10%; determine the elapsed time, assuming that this moisture reduction process is completed within 24 hours; based on the above data, the grain drying rate can be calculated to be 0.42% / hour. This means that the moisture content of the grain decreases by an average of 0.42% per hour.
[0139] It is understood that the calculation of grain drying rate is carried out by analyzing two curves predicted by the model - the curve of grain moisture content changing with time and the curve of grain surface temperature changing with time. First, the grain moisture content-time curve predicted by the model is used to select the moisture content values at two different time points on the curve, calculate the moisture content difference between the two time points, and then divide it by the time difference to obtain the average drying rate in the time period. At the same time, the grain surface temperature-time curve provides intuitive information about the heat transfer and distribution of grains during the drying process. The change of grain surface temperature directly affects the evaporation rate of water, because the higher the temperature, the greater the driving force for water evaporation. By analyzing the temperature curve, it can be understood whether the grain surface has reached or exceeded the activation temperature for water evaporation, and whether there is uneven drying caused by temperature gradient. If the grain surface temperature rises rapidly, it may mean that the water is evaporating rapidly, which may increase the drying rate; on the contrary, if the temperature rises slowly or unsteadily, the drying conditions may need to be adjusted to improve efficiency. Combining the information of these two curves, the drying rate of grain can be evaluated more accurately. If the moisture content drops rapidly and the surface temperature stabilizes within a suitable range, this indicates that the drying process is efficient and uniform; if the surface temperature curve shows temperature fluctuations or local overheating, the drying strategy may need to be adjusted to avoid deterioration of grain quality. By comprehensively considering the changing trends of these two parameters, the drying rate can be calculated more accurately, and the drying strategy can be adjusted accordingly to achieve the best drying effect.
[0140] Step S44, adjusting the drying gas temperature, the drying gas relative humidity and the drying gas wind speed according to the grain drying rate;
[0141] It can be understood that, first, the rate of water loss during the current drying process is determined by monitoring and calculating the grain drying rate; second, based on the real-time drying rate data, it is evaluated whether the currently set drying gas temperature, relative humidity and wind speed can achieve the expected drying effect; then, based on the comparison between the grain drying rate and the maximum drying rate that the grain can withstand (if this rate is exceeded, the grain will be damaged or even "burst"), the drying gas temperature, relative humidity or wind speed is adjusted to achieve a more accurate drying effect and grain quality. This process ensures that the grain can maintain an ideal moisture content and quality during the drying process by adjusting the drying parameters in real time, thereby improving production efficiency and energy utilization.
[0142] Step S45, controlling the grain dryer according to the drying gas temperature, the drying gas relative humidity and the drying gas wind speed.
[0143] It can be understood that, first, according to the preset drying conditions and the target grain moisture content, the temperature, relative humidity and wind speed parameters of the drying gas are set; second, the moisture content of the grain and the environmental conditions inside the dryer are monitored in real time; then, according to the real-time monitored data, the temperature, relative humidity and wind speed of the drying gas are adjusted to ensure that the grain can be evenly and efficiently dehydrated during the drying process to achieve the expected drying effect. In this process, controlling the parameters of the dryer can improve drying efficiency, reduce energy consumption, and ensure the quality and safety of the grain.
[0144] This embodiment obtains the current grain data, and obtains the predicted grain moisture content, predicted grain temperature, grain surface temperature-time curve and grain moisture content-time curve according to the current grain data and the target gated recurrent unit model; obtains the drying gas temperature, relative humidity of the drying gas and wind speed of the drying gas required in the drying process according to the predicted grain moisture content, the predicted grain temperature and the target gated recurrent unit model; calculates the grain drying rate according to the grain moisture content-time curve and the grain surface temperature-time curve; adjusts the drying gas temperature, relative humidity of the drying gas and wind speed of the drying gas according to the grain drying rate; and controls the grain dryer according to the drying gas temperature, relative humidity of the drying gas and wind speed of the drying gas. First, the current grain data, including moisture content, temperature, etc., are obtained through sensors or data acquisition equipment, and then the pre-trained target gated recurrent unit model is used to combine these data for prediction, and the predicted moisture content, predicted temperature and curve of moisture content changing with time of the grain are obtained, which provides real-time grain status information and basic data for parameter adjustment in the subsequent drying process. Based on the predicted grain moisture content, predicted temperature and target gated circulation unit model, the required drying gas temperature, drying gas relative humidity and drying gas wind speed in the drying process are calculated. These parameters are calculated by the model to maximize the drying efficiency while ensuring the grain quality. Next, the drying rate of the grain is calculated based on the curves of the grain moisture content and grain surface temperature over time. The rate of water loss in the grain during the drying process is evaluated by analyzing the slope of the curve to provide real-time feedback for adjusting the dryer parameters. According to the calculated grain drying rate, the temperature, relative humidity and wind speed of the drying gas are adjusted. The adjustment of these parameters is to control the drying rate to match the expected drying rate, thereby ensuring the quality and safety of the grain during the drying process. Finally, the grain dryer is controlled in real time based on the adjusted drying gas temperature, relative humidity and wind speed, ensuring the optimal drying conditions of the grain during the drying process, improving the drying efficiency, and reducing energy consumption and grain quality loss.
[0145] For example, in order to help understand the implementation process of the control method of the grain dryer obtained by combining this embodiment with the above-mentioned embodiment 1, please refer to Figure 7 , Figure 7 A brief flow chart of a control method for a grain dryer is provided, specifically:
[0146] The figure shows a brief flow of the grain dryer control method based on the GRU model, which clearly describes the entire grain drying control process from start to finish. The process starts with detecting the initial moisture content of the grain, the initial temperature of the grain, and the temperature and humidity of the environment, which are important inputs to the drying process. Then, these initial conditions are imported into the GRU model, and the model predicts the temperature-time curve of the drying gas during the drying process based on the input parameters, and heats the drying chamber to the required maximum temperature accordingly, preparing for the start of the grain drying operation. After the grain is placed in the drying barrel, the GRU model continues to work, predicting the drying rate and surface temperature of the grain. These predicted values are used to monitor the drying process and compared with the maximum drying rate and the maximum temperature that the grain can withstand. If the predicted drying rate is greater than the maximum drying rate of the grain or the surface temperature exceeds the maximum temperature that the grain can withstand, the system will automatically adjust the parameters of the drying gas, such as reducing the temperature or wind speed, to protect the grain from heat damage. As the drying process proceeds, the system will continuously detect the moisture content of the grain. When the moisture content of the grain drops to close to the storage moisture content, the GRU model intervenes again to predict and adjust the temperature of the drying gas until the grain reaches conditions suitable for storage. Once the moisture content and surface temperature of the grains reach the predetermined standards, the grains can be discharged from the drying barrel to complete the drying operation. The entire process is a closed-loop control system that combines real-time monitoring and model prediction to ensure that the drying process is both efficient and safe, avoiding over-drying or heat damage, while improving drying quality and efficiency. This intelligent control method makes full use of the advantages of the GRU model in time series prediction and realizes precise regulation of the grain drying process.
[0147] Please refer to Figure 8 , Figure 8A simplified model schematic diagram of a grain drying barrel provided for the second embodiment of the control method of the grain dryer of the present application shows the flow path and key components of grains and hot air inside the drying barrel. The grain inlet is marked in the figure, through which the grain enters the drying barrel and starts its drying process. The drying barrel is designed with a hot air inlet, from which the hot air enters and exchanges heat with the grain to accelerate the evaporation of water in the grain. The hot air flow curve depicts the flow trajectory of the hot air in the drying barrel. Usually, the hot air rises from the bottom and passes through the grain layer evenly to achieve effective heat exchange. In addition, the figure also shows the hot air auxiliary outlet, which is a discharge point for the hot air after the heat exchange is completed, which helps to adjust the pressure and humidity in the barrel. The hot air main outlet is the main channel for the hot air to finally discharge the drying barrel. By controlling these outlets, the drying efficiency and the drying uniformity of the grain can be adjusted. The grain outlet valve is another key component. Through the controllable design with valves, the flow rate and drying time of the grain can be accurately controlled. The grain flow curve represents the movement path of grain in the drying barrel. Usually, grain will fall naturally under the action of gravity. Through the design of internal structure, such as the material conveying auger, the grain can be evenly turned and mixed to ensure the consistency and efficiency of the drying process. The moisture content of grain is detected in real time, and the future grain time-moisture content curve is predicted by the GRU prediction model. When it is close to the storage moisture content of grain, the temperature of the drying gas is gradually reduced by the GRU prediction model until it is reduced to room temperature. The grain continues to be dried until the moisture content of the grain drops to the storage moisture content, and the moisture content of the grain is maintained at the storage moisture content ± 0.2% for 15 minutes to complete the cooling stage of the grain. The outlet below the drying barrel is opened, and the internal material conveying auger rotates clockwise to discharge the grain in the drying barrel to complete the grain drying operation. The design of the entire model is to optimize the drying process. By accurately controlling the flow of hot air and grain, as well as the opening and closing of valves, the drying environment can be accurately adjusted, thereby improving the drying efficiency, ensuring the quality of grain drying, and reducing energy consumption. This design is part of this application, which realizes the automation and intelligence of the grain drying process by combining intelligent control strategy with the physical design of the grain drying barrel.
[0148] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the control method of the grain dryer of the present application. More simple transformations based on this technical concept are all within the protection scope of the present application.
[0149] This application also provides a control device for a grain dryer, please refer to Fig. 9 , the control device of the grain dryer comprises:
[0150] A data acquisition module 10 is used to acquire a target grain dataset and divide the target grain dataset into a training set and a test set;
[0151] A model building module 20, for building an initial gated recurrent unit model based on the sequential model, the gated recurrent unit layer, the drop layer, the fully connected layer, and the output layer;
[0152] A training module 30, configured to train and test the initial gated recurrent unit model using the training set and the test set to obtain a target gated recurrent unit model;
[0153] The control module 40 is used to control the grain dryer using the target gated recurrent unit model.
[0154] The control device of the grain dryer provided in the present application adopts the control method of the grain dryer in the above embodiment, which can solve the technical problem of how to improve the stability of grain drying. Compared with the prior art, the beneficial effects of the control device of the grain dryer provided in the present application are the same as the beneficial effects of the control method of the grain dryer provided in the above embodiment, and other technical features in the control device of the grain dryer are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0155] The present application provides a control device for a grain dryer, the control device for the grain dryer comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the control method for the grain dryer in the above-mentioned embodiment one.
[0156] Reference below Fig.10 , which shows a schematic diagram of the structure of a control device for a grain dryer suitable for implementing the embodiment of the present application. The control device for the grain dryer in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.10 The control device of the grain dryer shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0157] like Fig.10As shown, the control device of the grain dryer may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the control device of the grain dryer are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the control device of the grain dryer to communicate wirelessly or wired with other devices to exchange data. Although the control device of the grain dryer with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0158] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0159] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0160] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the control method of the grain dryer in the above-mentioned embodiment.
[0161] The computer-readable storage medium provided in this application may be a USB flash drive, and may also include other electrical, magnetic, optical, electromagnetic, infrared or semiconductor media, and combinations thereof. Specific forms include, but are not limited to, electrical connections, disks, hard disks, RAM, ROM, EPROM, flash memory, optical fibers, CD-ROMs, other optical and magnetic storage devices, and appropriate combinations. These media may be used to store programs for use by or in conjunction with the execution system, and program codes may be transmitted via transmission media such as wires, optical cables, and radio frequencies.
[0162] The computer-readable storage medium may be included in the control device of the grain dryer; or may exist independently without being assembled into the control device of the grain dryer.
[0163] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the control device of the grain dryer, the control device of the grain dryer executes the control method of the grain dryer in the above embodiment. The computer program code for executing the operations of the present application can be written in one or more programming languages or a combination thereof, such as Java, C++, etc. The execution method is flexible and can be run on a local or remote computer. It supports independent software packages or distributed execution modes. When executing remotely, the user computer can be connected via LAN, WAN or Internet service. The implementation methods are diverse and can be completed entirely on a remote server or in combination with local and remote hardware and instructions.
[0164] The processes and block diagrams shown in the accompanying drawings represent a possible implementation architecture of the system, method and computer program product in the present application. The boxes represent modules or code snippets, instructions that perform specific functions. The order of function execution can be changed, and can also be executed in parallel or in reverse order. These functions can be implemented by dedicated hardware or a combination of software and hardware. The module names described in this application do not limit their implementation methods, which can be software or hardware. The above embodiments do not limit the scope of the patent of this application. Any equivalent structural transformation or application in other technical fields based on the technical concept of this application through the specification and drawings is within the scope of patent protection of this application.
Claims
1. A control method for a grain dryer, characterized in that: The method comprises: Acquire a target grain dataset, and divide the target grain dataset into a training set and a test set; Construct an initial GRU model based on the sequential model, GRU layer, dropout layer, fully connected layer, and output layer. Using the training set and the test set to train and test the initial gated recurrent unit model to obtain a target gated recurrent unit model; The target gated recurrent unit model is used to control a grain dryer.
2. The method according to claim 1, characterized in that The step of controlling the grain dryer using the target gated recurrent unit model comprises: Acquire current grain data, and obtain predicted grain moisture content, predicted grain temperature, grain surface temperature-time curve, and grain moisture content-time curve according to the current grain data and the target gated cyclic unit model; According to the predicted moisture content of the grain, the predicted temperature of the grain and the target gated circulation unit model, the drying gas temperature, the relative humidity of the drying gas and the drying gas wind speed required in the drying process are obtained; Calculate the grain drying rate according to the grain moisture content-time curve and the grain surface temperature-time curve; adjusting the drying gas temperature, the drying gas relative humidity, and the drying gas wind speed according to the grain drying rate; The grain dryer is controlled according to the drying gas temperature, the drying gas relative humidity and the drying gas wind speed.
3. The method according to claim 2, characterized in that The step of obtaining the drying gas temperature, the drying gas relative humidity and the drying gas wind speed required in the drying process according to the predicted grain moisture content, the predicted grain temperature and the target gated cycle unit model comprises: constructing an inverse model according to the target grain data set, the predicted grain moisture content, the predicted grain temperature, and the target gated recurrent unit model; Using the test set to test the inverse model, to obtain a target inverse model; The predicted moisture content of the grain and the predicted temperature of the grain are input into the target inverse model to obtain the drying gas temperature, the drying gas relative humidity and the drying gas wind speed required in the drying process.
4. The method according to claim 2, characterized in that After the step of obtaining the predicted grain moisture content, predicted grain temperature and grain moisture content-time curve according to the current grain data and the target gated recurrent unit model, the method further includes: Performing median filtering on the current grain data and performing range normalization processing on the current grain data to obtain target grain data; extracting samples from the target grain data through a sliding window; Inputting the sample into the target gated recurrent unit model to obtain a predicted value; The parameters of the target gated recurrent unit model are adjusted according to the predicted value until an average error between the predicted value and an actual value in the sample is less than or equal to a preset error.
5. The method according to claim 1, characterized in that The step of constructing an initial gated recurrent unit model according to the sequential model, the gated recurrent unit layer, the discard layer, the fully connected layer, and the output layer comprises: Initializing a sequential model and adding a preset number of gated recurrent unit layers to the sequential model; adding a dropout layer after each of the gated recurrent unit layers; adding a fully connected layer after the dropout layer; An output layer is added after the fully connected layer to obtain an initial gated recurrent unit model.
6. The method according to claim 1, characterized in that The step of using the training set and the test set to train and test the initial gated recurrent unit model to obtain a target gated recurrent unit model comprises: Using the training set to train the initial gated recurrent unit model to obtain a reference gated recurrent unit model; Using the test set to test the reference gated recurrent unit model, to obtain a test result; When the test result does not meet the preset requirement, return to the step of training the initial gated recurrent unit model using the training set until the test result meets the preset requirement to obtain a target gated recurrent unit model.
7. The method according to claim 6, characterized in that The step of using the training set to train the initial gated recurrent unit model to obtain a reference gated recurrent unit model comprises: Inputting the input data in the training set into the initial gated recurrent unit model to obtain predicted data; The loss value is calculated based on the grain discharge data in the training set, the predicted data and the mean square error formula; Calculate the gradient of the input data according to the loss value; Adaptive moment estimation is performed on the parameters of the initial gated recurrent unit model according to the gradient until the loss value is less than or equal to a preset loss threshold, thereby obtaining a reference gated recurrent unit model.
8. The method according to any one of claims 1 to 7, characterized in that The step of obtaining the target grain data set comprises: Acquire an initial grain data set, wherein the initial grain data set includes input parameters and target variables; Normalizing the initial grain data set by range normalization to obtain an intermediate grain data set; converting the intermediate grain dataset into a time series dataset and using the input parameters of the time series dataset as subsequences; The target variables of the subsequence and the time series data set are converted into a three-dimensional array form to obtain a target grain data set.
9. A control device for a grain dryer, characterized in that: The device comprises: A data acquisition module, used for acquiring a target grain data set and dividing the target grain data set into a training set and a test set; A model building module for building an initial GRU model from a sequential model, GRU layers, dropout layers, fully connected layers, and an output layer; A training module, used to train and test the initial gated recurrent unit model using the training set and the test set to obtain a target gated recurrent unit model; A control module is used to control a grain dryer using the target gated recurrent unit model.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the control method for a grain dryer according to any one of claims 1 to 8 are implemented.
Citation Information
Cited By
Intelligent monitoring method and system for grain drying process based on machine vision
CN122493451A
