Grain depot temperature and humidity cooperative control system and method based on time sequence attention mechanism

CN122593541BActive Publication Date: 2026-10-16SICHUAN ZHONGTIAN YINGYAN INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611079555.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-07-21
Publication Date
2026-10-16
Estimated Expiration
2046-07-21

AI Technical Summary

Technical Problem

[0003]现有粮库温湿调控通常依据粮温或粮湿监测值与预设阈值进行通风启停控制,或结合仓外环境条件进行简单经验调节,缺乏对粮情历史演化规律的建模与预测能力,难以及时识别温湿发展趋势

Benefits of technology

1、构建温湿扩散趋势与粮情预测结果一致化融合的空间时序状态,实现粮堆温湿扩散方向、强度及未来演化的统一表征,解决现有粮库调控难以反映粮堆内部温湿空间扩散演化的问题;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122593541B_ABST
    Figure CN122593541B_ABST
Patent Text Reader

Abstract

The application discloses a grain depot temperature and humidity cooperative control system and method based on a time sequence attention mechanism, relates to the technical field of regulation and control, and comprises the following steps: constructing a grain condition time sequence including grain temperature, grain humidity, air temperature outside the warehouse, humidity outside the warehouse and running information of ventilation equipment, extracting grain condition evolution representation by using the time sequence attention mechanism, establishing a grain condition prediction model, obtaining grain temperature prediction values and grain humidity prediction values of each monitoring position in a future period, further calculating a spatial gradient vector and a time sequence change rate based on a temperature distribution field and a humidity distribution field, constructing temperature and humidity diffusion trend characteristics, and uniformly fusing the temperature and humidity diffusion trend characteristics with grain condition prediction results to form a spatial time sequence state, and on the basis of the spatial time sequence state, establishing a ventilation coupling model driven by mechanism and data, generating candidate ventilation parameters according to the spatial time sequence state, and determining optimal ventilation parameters by constraint screening and comprehensive evaluation to form a cooperative control strategy and perform rolling prediction regulation and control, so that the prediction driving and cooperative optimization control of the temperature and humidity of the grain depot are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of regulation and control technology, specifically to a grain depot temperature and humidity coordinated control system and method based on a time-series attention mechanism. Background Technology

[0002] During grain storage, the internal temperature and humidity of the grain pile are key environmental parameters affecting grain quality, safety, and storage stability. Therefore, continuously regulating the temperature and humidity of the grain pile through ventilation and other control measures throughout the storage period to maintain it within a safe range is an important technical aspect of grain depot safety management.

[0003] Current grain depot temperature and humidity control methods typically rely on monitoring grain temperature or humidity values ​​and preset thresholds to control ventilation, or on simple empirical adjustments based on external environmental conditions. These methods lack the ability to model and predict the historical evolution of grain conditions, making it difficult to identify temperature and humidity trends in a timely manner. Furthermore, existing methods often treat grain pile temperature and humidity as independent point parameters, failing to consider the spatial diffusion and transmission characteristics within the grain pile, thus failing to reflect the overall risk distribution of the grain pile. In addition, ventilation parameters are usually set according to fixed empirical ranges, lacking a coupled analysis and optimization decision-making mechanism with grain condition status, making it difficult to balance the effectiveness of temperature and humidity control with energy consumption levels.

[0004] Therefore, there is an urgent need for a grain depot temperature and humidity collaborative control method that can integrate the temporal evolution and spatial diffusion patterns of grain conditions and optimize ventilation parameters based on temperature and humidity development trends. Summary of the Invention

[0005] This invention addresses the shortcomings of existing technologies by proposing a grain depot temperature and humidity collaborative control system and method based on a temporal attention mechanism.

[0006] The technical solution to achieve the purpose of this invention is as follows: On the one hand, the grain depot temperature and humidity coordinated control method based on the temporal attention mechanism includes the following steps: Collect grain temperature and moisture, outside air temperature and humidity, and ventilation equipment operation status and duration at various monitoring locations in the grain pile. After preprocessing, extract historical windows of a preset length to form a grain condition time series. The grain condition time series is subjected to feature encoding to obtain the grain condition encoding sequence. Attention weights are calculated based on temporal correlation. The grain condition evolution representation is obtained through weighted aggregation and a grain condition prediction model is constructed. The predicted grain temperature and grain moisture values ​​are output to form the grain condition prediction result. Based on the grain condition time series, temperature distribution field and humidity distribution field are constructed. The spatial gradient vector of grain temperature, the spatial gradient vector of grain moisture and the temporal change rate of adjacent time windows at each monitoring location are calculated to form the temperature and humidity diffusion trend characteristics and integrate them with the grain condition prediction results to obtain the spatial temporal state. Based on the response relationship between ventilation behavior and temperature and humidity changes in historical grain condition time series, a ventilation coupling model is established. A candidate ventilation parameter set is generated according to the spatial time series status, and the optimal ventilation parameter is selected and determined to form a collaborative control strategy.

[0007] The ventilation equipment is controlled according to the collaborative control strategy, and the grain condition time sequence is updated continuously to execute the prediction until the predicted grain temperature and grain moisture values ​​enter the target safe range and then the ventilation is terminated.

[0008] Furthermore, a ventilation coupling model is established, including: The ventilation coupling model adopts a hybrid architecture of ventilation mass and heat transfer mechanism layer and data-driven correction layer; The hybrid architecture is constructed based on the response relationship between the operating status and operating time of ventilation equipment and the changes in grain temperature and moisture in the corresponding time period in the historical grain condition time series. The ventilation mass transfer and heat transfer mechanism layer is used to characterize the mechanism correlation between ventilation behavior and the evolution of grain pile temperature and moisture, and the data-driven correction layer is used to perform data fitting calibration on the mechanism layer parameters. The ventilation mass and heat transfer mechanism layer is based on the mass and heat transfer theory of porous media in grain piles to construct a temperature and humidity coupling transfer equation. It introduces the grain pile thermal diffusivity coefficient, convective heat transfer coefficient, temperature and humidity coupling coefficient, moisture diffusivity coefficient, convective mass transfer coefficient and temperature and humidity reverse coupling coefficient. Each coefficient is determined based on the characteristics of grain condition and ventilation conditions such as grain pile porosity, specific heat capacity, moisture content, ventilation velocity and air humidity difference. It is used to quantify the relationship between ventilation velocity and running time on the grain temperature time change rate and grain moisture time change rate. The data-driven correction layer uses a lightweight BP neural network. It takes the predicted deviations of the grain temperature change and grain moisture change values ​​output by the ventilation, mass transfer and heat transfer mechanism layer relative to the historical actual changes as input. Based on historical grain condition samples, it performs backpropagation iterative optimization of the core parameters of the ventilation, mass transfer and heat transfer mechanism layer to make the output of the mechanism layer consistent with the historical temperature and moisture change samples.

[0009] Furthermore, the spatial-temporal state is obtained by integrating the temperature and humidity diffusion trend characteristics with the grain condition forecast results, including: The spatial gradient vectors of grain temperature, grain moisture, and the temporal change rates of grain temperature and grain moisture at each monitoring location are normalized and then concatenated. After compression and fusion by a convolutional layer, the characteristic vector of temperature and moisture diffusion trend is obtained. The spatial gradient vectors of grain temperature and grain moisture are derived from the three-dimensional spatial gradient calculation results of the temperature distribution field and the humidity distribution field, and the temporal change rates of grain temperature and grain moisture are derived from the difference calculation results of the distribution field after smoothing of adjacent time windows. The current time window temperature and humidity diffusion trend feature vector is matched with the grain condition prediction results by time step. The predicted grain temperature and grain humidity values ​​at each monitoring location in the grain condition prediction results are mapped to a three-dimensional spatial grid according to spatial coordinates. After being stitched together with the spatial nodes of the temperature and humidity diffusion trend feature vector, the grid is structured according to the spatial coordinate index of the grain pile, so that each spatial node contains both the temperature and humidity diffusion trend features and future temperature and humidity prediction information, thus obtaining the spatial temporal state.

[0010] Furthermore, a grain condition prediction model is constructed based on the grain condition evolution representation, including: The grain condition prediction model adopts a four-level architecture consisting of a grain condition spatial attention layer, a temperature and humidity coupling interaction layer, a Transformer encoder, and an adaptive fully connected output layer. The grain condition evolution representation is derived from the temporal feature representation obtained by temporal attention weighted aggregation of the grain condition encoding sequence. The grain situation spatial attention layer introduces the spatial coordinate features of monitoring locations on the basis of temporal attention. It inputs the spatial coordinates of each monitoring location and the grain situation evolution representation into the attention calculation module to calculate the spatial correlation weight between each monitoring location, thereby realizing the collaborative extraction of temporal and spatial features. The temperature and humidity coupling interaction layer sets up grain temperature feature branches and grain humidity feature branches, processes the output features of the grain condition spatial attention layer according to the temperature and humidity variable types, performs bidirectional interactive fusion through the cross attention mechanism, and introduces the temperature and humidity coupling coefficient to balance the contribution weights of the two branches. The adaptive fully connected output layer is grouped according to the grain pile layer. The output features of the temperature and humidity coupling interaction layer are mapped to the corresponding output nodes according to the spatial layer. The predicted grain temperature and grain moisture values ​​are output at each monitoring location.

[0011] Further, the optimal ventilation parameters are determined through screening, including: The comprehensive evaluation system includes temperature and humidity control effect indicators, energy consumption and economic indicators, and diffusion inhibition effect indicators. The temperature and humidity control effect indicators are calculated based on the degree to which the predicted values ​​of grain temperature change and grain moisture change obtained from the ventilation coupling model satisfy the target range of grain temperature and the safe range of grain moisture. The energy consumption and economic indicators are determined based on the correlation between the number of ventilation equipment groups turned on, the running time, and the rated power of the equipment to determine the ventilation energy consumption per unit time. The diffusion inhibition effect indicators are determined based on the change in the magnitude of the temperature and humidity spatial gradient vector before and after ventilation to determine the reduction rate of grain temperature diffusion intensity and the reduction rate of grain moisture diffusion intensity. The entropy weight method is used to determine the objective weights based on the information entropy of each indicator. The TOPSIS method is used to construct a standardized decision matrix. After normalizing the evaluation indicators corresponding to the selected candidate ventilation parameter combinations, the Euclidean distance between them and the positive and negative ideal solutions is calculated to obtain the comprehensive closeness. The parameters are then sorted in descending order of comprehensive closeness, and the parameter combination with the highest comprehensive closeness is selected as the optimal ventilation parameter.

[0012] Furthermore, a candidate ventilation parameter set is generated based on the spatial temporal state, including: The core parameters of the candidate ventilation parameter set include ventilation speed, ventilation duration and number of ventilation equipment groups to be turned on. Each parameter is divided into a value gradient at set intervals within the performance range of the ventilation equipment and the allowable range of grain storage technology. Among them, ventilation speed and duration are derived from the limited range of ventilation equipment operating capacity and grain condition control requirements. By combining spatial temporal states to generate differentiated parameter combinations, for spatial nodes where temperature and humidity are in a high-risk state, parameter combinations of high wind speed and medium-to-long-term operation time are generated based on the predicted grain temperature, predicted grain humidity and diffusion trend characteristics in the spatial temporal state. For spatial nodes where temperature and humidity are within a safe range but diffusion trends are obvious, parameter combinations for low to medium wind speeds and short operating durations are generated based on the spatial gradient vector and temporal rate of change in the diffusion trend characteristics. For spatial nodes with stable temperature and humidity, parameter combinations with low wind speed and short operating time are generated based on the stability characteristics of predicted values ​​in the spatial temporal state; logically conflicting parameter combinations are eliminated, and each effective parameter combination is associated with a unique identifier and the characteristics of the adapted spatial region.

[0013] Furthermore, the temperature distribution field and humidity distribution field are constructed, including: A three-dimensional spatial grid model of the grain pile is constructed based on the spatial coordinates of each monitoring location. The spatial coordinates are derived from the monitoring location markers of the grain pile in layers and zones. The grain temperature and grain moisture data of each monitoring location are mapped to the corresponding grid nodes according to the spatial coordinates. The Kriging interpolation method is used to construct a Gaussian variogram model based on the spatial distance of the monitoring location. Interpolation calculations are performed on all grid nodes to expand the grain temperature and moisture data of discrete monitoring points into a continuous temperature distribution field and a continuous humidity distribution field covering the entire space of the grain pile. The temperature distribution field and humidity distribution field are respectively subjected to a three-dimensional Gaussian filter kernel and a neighborhood weighted average with Gaussian distribution weights. The node values ​​are updated by weighting the neighborhood data of each grid node. The smoothed temperature distribution field and humidity distribution field are obtained by traversing all nodes.

[0014] Furthermore, the spatial gradient vectors of grain temperature and grain moisture at each monitoring location, as well as their temporal rates of change, are calculated, including: The Sobel gradient operator is used to calculate the partial derivatives of each grid node in the three-dimensional coordinate axis direction of the smoothed temperature distribution field using the central difference method. The partial derivatives in the three directions are combined to form the grain temperature spatial gradient vector, where the vector direction is determined by the relative magnitudes of the three partial derivatives and the vector magnitude is determined by the combination of the three partial derivatives. Perform the same operation on the smoothed humidity distribution field to obtain the grain moisture spatial gradient vector; The differences between the grain temperature and grain moisture values ​​of the corresponding nodes in the smoothed distribution field of the current time window and the previous adjacent time window are calculated and normalized according to the time interval to obtain the temporal change rate of grain temperature and the temporal change rate of grain moisture.

[0015] Furthermore, after preprocessing, a historical window of a preset length is extracted to form a grain condition time series, including: Time mapping is performed based on the correspondence between the timestamps of each sampling source and the unified time benchmark, so as to unify the information on grain temperature, grain moisture, outside air temperature, outside humidity and ventilation equipment operation to the same time scale; A time series integrity identification matrix is ​​constructed to locate missing segments and missing points. For continuous missing segments, trend extension interpolation is performed based on the slope of changes in effective data before and after. For discrete missing points, spatial interpolation is performed based on the monitoring position values ​​of the same spatial neighborhood with the inverse distance weight, so that the multivariate time series is continuous and complete. Historical statistical intervals and rate of change intervals are constructed according to variable type. Data outside the intervals are marked as outliers, and joint repair is performed based on the consistency of temporal neighborhood trends and the consistency of spatial neighborhood values. Using the current control time as the end point, the data is extracted backwards according to the preset historical window length. The restored information on grain temperature, grain moisture, outside air temperature, outside humidity, and ventilation equipment operation at each monitoring location is organized in a structured manner according to time sequence and spatial coordinate index to form a grain condition time sequence.

[0016] Secondly, the grain depot temperature and humidity collaborative control system based on the temporal attention mechanism includes a data acquisition module, a grain condition prediction module, a diffusion and fusion module, a decision generation module, and a collaborative control module: The data acquisition module collects grain temperature and moisture, outside air temperature and humidity, and ventilation equipment operating status and duration at various monitoring locations in the grain pile. After preprocessing, it extracts a preset length of historical window to form a grain condition time series. The grain condition prediction module performs feature encoding on the grain condition time series to obtain the grain condition coded sequence, calculates attention weights based on temporal correlation, obtains the grain condition evolution representation through weighted aggregation, constructs the grain condition prediction model, and outputs the predicted grain temperature and grain moisture values ​​to form the grain condition prediction result. The diffusion fusion module constructs temperature and humidity distribution fields based on the grain condition time series, calculates the spatial gradient vector of grain temperature, the spatial gradient vector of grain moisture and the temporal change rate of adjacent time windows at each monitoring location, forms temperature and humidity diffusion trend characteristics and integrates them with the grain condition prediction results to obtain the spatial temporal state. The decision generation module establishes a ventilation coupling model based on the response relationship between ventilation behavior and temperature and humidity changes in the historical grain condition time series. It generates a set of candidate ventilation parameters based on the spatial time series status, selects and determines the optimal ventilation parameters, and forms a collaborative control strategy.

[0017] The collaborative control module controls the ventilation equipment according to the collaborative control strategy and continuously updates the grain condition time sequence to perform predictions until the predicted grain temperature and grain moisture values ​​enter the target safe range and then terminates ventilation.

[0018] Compared with the prior art, the significant advantages of this invention are: 1. Construct a spatial-temporal state that is consistent with and integrates the temperature and humidity diffusion trend with the grain condition prediction results, so as to realize a unified representation of the direction, intensity and future evolution of temperature and humidity diffusion in grain piles, and solve the problem that existing grain depot regulation is difficult to reflect the spatial diffusion evolution of temperature and humidity inside grain piles; 2. Establish a mechanism-data dual-driven ventilation coupling model and candidate ventilation parameter optimization decision-making mechanism to achieve coupled optimization of ventilation parameters and the spatiotemporal evolution of grain conditions, and solve the problem that existing ventilation control relies on experience setting and lacks optimization decision-making basis. Attached Figure Description

[0019] Figure 1 The flowchart is shown below for a grain depot temperature and humidity collaborative control method based on a temporal attention mechanism. Figure 2 This is a schematic diagram of the grain pile space monitoring layout and ventilation implementation in this invention; Figure 3 A flowchart illustrating the spatial temperature and humidity diffusion trend characteristics in this invention; Figure 4 This is a schematic diagram of the grain depot temperature and humidity collaborative control system based on the temporal attention mechanism in this invention. Detailed Implementation

[0020] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments.

[0021] Example 1 This invention discloses a method for coordinated control of temperature and humidity in grain depots based on a temporal attention mechanism, comprising the following steps: S1: Collect grain temperature and moisture, outside air temperature and humidity, and ventilation equipment operation status and duration at various monitoring locations in the grain pile. Perform time alignment, missing data filling and anomaly removal on each data point. Extract a preset length of historical window from the current control time to form a grain condition time sequence.

[0022] S2: Perform feature encoding on the grain condition time series according to variable type to obtain the grain condition encoding sequence. Calculate the attention weight of each moment based on the temporal correlation of the grain condition encoding sequence within the historical window. Weight and aggregate the encoding vectors of each moment within the historical window to obtain the grain condition evolution representation. Construct a grain condition prediction model based on the grain condition evolution representation and corresponding historical grain temperature and moisture change samples. Input the current grain condition time series into the grain condition prediction model to obtain the predicted grain temperature and moisture values ​​for each monitoring location in the future period, thus forming the grain condition prediction result.

[0023] S3: Based on the grain temperature and moisture at each monitoring location in the grain condition time series, spatial interpolation and neighborhood smoothing are performed on discrete monitoring points using the spatial coordinates of the grain pile as an index to obtain the temperature distribution field and humidity distribution field. In the temperature distribution field and humidity distribution field, the spatial gradient vector of grain temperature and the spatial gradient vector of grain moisture are calculated for each monitoring location. At the same time, the temporal change rate of the distribution field of adjacent time windows is calculated. The spatial gradient vector of grain temperature, the spatial gradient vector of grain moisture, and the temporal change rate are used to characterize the direction and intensity of temperature and humidity diffusion, forming the temperature and humidity diffusion trend characteristics and integrating them with the grain condition prediction results to obtain the spatial temporal state.

[0024] S4: Based on the response relationship between ventilation behavior and temperature and humidity changes in historical grain condition time series, a ventilation coupling model is established. A candidate ventilation parameter set is generated according to the spatial time series status and input into the ventilation coupling model to obtain the predicted values ​​of grain temperature change and grain humidity change for each candidate ventilation parameter. Constraint screening and comprehensive ranking are performed according to the grain temperature target range and grain humidity safe range to determine the optimal ventilation parameters and form a collaborative control strategy.

[0025] S5: Based on the collaborative control strategy, control the ventilation equipment to start and stop and adjust the running time, continuously update the grain condition time sequence and input it into the grain condition prediction model to perform rolling prediction, until the grain temperature prediction value and grain moisture prediction value enter the target safe range and terminate ventilation.

[0026] refer to Figure 1 , Figure 1 This is a flowchart of a grain depot temperature and humidity collaborative control method based on a temporal attention mechanism.

[0027] Figure 1 The paper illustrates the overall process of the grain depot temperature and humidity coordinated control method, from grain condition data acquisition and preprocessing, grain condition prediction result generation, construction of temperature and humidity diffusion trend characteristics and spatial temporal state formation, ventilation coupling model decision optimization to ventilation execution and rolling prediction termination.

[0028] Step S1: Collect grain temperature and moisture, outside air temperature, outside humidity, and ventilation equipment operating status and duration at various monitoring locations in the grain pile. After cleaning and processing, extract historical time windows to construct a grain condition time series, including: S101: Deployment of multi-source monitoring nodes and data acquisition.

[0029] Inside the grain pile, grain temperature and moisture sensors are arranged in a layered and zoned manner according to the structural dimensions and height of the grain silo. Monitoring positions are set at equal intervals along the radial and axial directions of the grain pile in each layer and assigned unique spatial coordinate identifiers. Temperature and humidity sensors are installed on the air intake and exhaust sides of the ventilation system outside the silo to characterize the external environment. An operating status acquisition unit and a running time measurement unit are connected to the ventilation equipment control loop to obtain the start-stop status and continuous running time of the ventilation equipment.

[0030] According to a unified sampling cycle, the grain temperature and moisture, the outside air temperature and humidity, the outside humidity, and the operating status and duration of ventilation equipment at each monitoring location are collected synchronously and the collection timestamp and spatial coordinate identifier are recorded.

[0031] S102: Multivariate time alignment processing.

[0032] Time mapping is performed based on the correspondence between the timestamps of each sampling source and the unified time base, unifying the data from different acquisition channels to the same time scale, so that each variable has a corresponding value at the same time, and eliminating the timing misalignment caused by asynchronous acquisition.

[0033] S103: Data missing imputation and integrity repair.

[0034] A time series integrity identification matrix is ​​constructed for the time-aligned data according to the monitoring location and variable type to locate continuous missing measurement segments and discrete missing measurement points.

[0035] For continuous missing measurement sections, segmented trend extension and segment interpolation are performed based on the slope of the change in effective data before and after the start and end times of the missing measurement. For discrete missing measurement points, the nearest neighbor monitoring location with the same grain pile layer is selected within the same time section and spatially interpolated according to the inverse distance weight to ensure that each monitoring data is continuous and complete.

[0036] S104: Outlier Identification and Joint Repair.

[0037] After the data is supplemented, historical statistical intervals and rate of change intervals are constructed according to variable type. The historical statistical interval is determined by the quantile range of the variable in the long-term historical sample, and the rate of change interval is determined by the statistical range of the difference sequence of adjacent time scales. For example, the historical statistical interval is taken as the last 30 days in the routine grain storage monitoring scenario, the last 7 days in the ventilation operation control scenario, and the last 24 hours in the high temperature, high humidity and high risk early warning scenario. The corresponding grain temperature change rate interval is -0.8℃ / h to +0.8℃ / h, and the grain moisture change rate interval is -0.5% / h to +0.5% / h.

[0038] Data that exceeds the historical statistical range or the rate of change range is identified as outliers and marked as outlier locations. For outlier locations, joint repair is performed based on the trend consistency of effective values ​​before and after in the time neighborhood and the consistency of monitoring values ​​in the same layer in the spatial neighborhood, so that the repair results simultaneously meet the constraints of temporal continuity and spatial smoothness.

[0039] S105: Structured construction of grain condition time series.

[0040] Using the current control time as the endpoint, locate continuous time segments forward in the repaired data according to the preset historical window length. For example, in the daily grain storage monitoring scenario, 24 hours is preferred, corresponding to a 10-minute sampling cycle. In the real-time control scenario of ventilation operation, 2 hours is preferred, corresponding to a 1-minute sampling cycle. Extract the grain temperature and moisture, outside air temperature, outside humidity, and ventilation equipment operation status and duration data of all monitoring locations within the segment.

[0041] Arranged chronologically and structured according to the spatial coordinate index of the monitoring location, a time-series sequence of grain conditions is formed, reflecting the historical temperature and humidity evolution and ventilation behavior of the grain pile.

[0042] refer to Figure 2 , Figure 2 This is a schematic diagram of the layout and ventilation implementation for grain pile space monitoring.

[0043] Figure 2 The spatial arrangement of the grain pile inside the warehouse is shown. The grain pile is divided into four monitoring layers: surface, middle, lower and bottom, with multiple grain temperature and humidity monitoring points. At the same time, temperature and humidity monitoring points are set outside the warehouse. Air ducts are set at the bottom of the warehouse and fans are configured on both sides to form ventilation airflow paths. The operating status and running time are collected at the ventilation equipment side for status feedback and data update during the ventilation process.

[0044] Step S2 involves encoding the grain condition time series by features and aggregating them into a grain condition evolution representation using an attention mechanism. Based on this representation, a grain condition prediction model is constructed, which outputs predicted grain temperature and moisture values ​​for each monitoring location in future time periods, including: S201: Variable classification and feature preprocessing.

[0045] The constructed grain condition time series was classified into variable types, and discrete and continuous variables were identified. The discrete variable is the operating status of the ventilation equipment, and the continuous variable includes grain temperature, grain moisture, outside air temperature, outside humidity and the operating time of the ventilation equipment at each monitoring location of the grain pile.

[0046] For continuous variables, normalization is performed. The Min-Max normalization method is used to map the values ​​of each continuous variable to the [0,1] interval, eliminating the interference of the difference in the scale of different variables on subsequent encoding and model training. For discrete variables, the operating status of ventilation equipment is encoded using one-hot encoding. The "running" and "stopping" states are mapped to two-dimensional one-hot vectors respectively, realizing the numerical representation of discrete variables and ensuring that all types of variables can meet the input requirements of feature encoding.

[0047] S202: Grain situation time series feature encoding.

[0048] For the various preprocessed variables, a temporal feature encoding network is used to perform feature extraction and encoding to generate a unified-dimensional grain condition encoding sequence. The temporal feature encoding network is adapted to the characteristics of grain condition time-series data variables and includes a core feature processing network containing continuous and discrete variables. Its core purpose is to transform raw time-series data of different types and scales into a unified-dimensional standardized feature vector sequence that can be used for subsequent attention calculation and prediction model training. It adopts a "branch processing + fusion encoding" architecture, specifically divided into three parts: continuous variable encoding branch, discrete variable encoding branch, and feature fusion encoding.

[0049] For continuous variables, a one-dimensional convolutional neural network is used as the core structure. By setting multi-scale convolutional kernels, the local temporal features of each continuous variable in the time dimension are extracted. The convolutional kernels can be set to different sizes according to the temporal change pattern of grain conditions to capture the variable change features under different time spans. Then, the pooling layer compresses redundant information and retains key local features to achieve efficient extraction of continuous temporal features. For discrete variables, the vector after one-hot encoding is input into the embedding layer, which maps the high-dimensional sparse one-hot vector into a low-dimensional, dense feature vector. This reduces the data dimensionality and effectively represents the semantic information of discrete states, thus achieving numerical and efficient representation of discrete variables.

[0050] The local time-series features of continuous variables are concatenated with the embedding vectors of discrete variables according to variable type. The concatenated mixed features are then mapped to a feature space of uniform dimension through a fully connected layer, resulting in a grain condition coding sequence with a length consistent with the historical window length and a feature vector corresponding to each time step. The feature vector at each time step integrates the key feature information of all variables at that time step.

[0051] S203: Calculate the temporal attention weights.

[0052] Based on the temporal attention mechanism, the attention weight of the grain condition coding sequence at each moment within the historical window is calculated to highlight the influence of grain condition characteristics at different moments on the current grain condition evolution trend.

[0053] The grain condition coding sequence is input into the attention calculation module. The coding vector at each time step is mapped to a query vector, a key vector, and a value vector through linear transformation. The similarity between the query vector at each time step and the key vector at all time steps is calculated using the dot product method to obtain the correlation matrix. Softmax normalization is performed on the correlation matrix to convert the similarity at each time step into attention weights that sum to 1. Finally, an attention weight sequence with the same length as the historical window is obtained.

[0054] S204: Obtain the evolution representation of grain conditions.

[0055] Based on the calculated attention weight sequence, a weighted aggregation operation is performed on the encoding vectors at each time point in the grain condition encoding sequence to obtain a grain condition evolution representation that can comprehensively reflect the historical grain condition evolution pattern. The weighted aggregation process uses the attention weights at each time point as weight coefficients to perform a weighted summation on the encoding vectors at the corresponding time points. This grain condition evolution representation vector integrates the grain condition features at all times within the historical window, and through the adjustment of attention weights, it highlights the key time features that have a significant impact on the current grain condition, effectively capturing the evolution trend and dependency relationship of the grain condition in the time dimension.

[0056] S205: Construct a grain condition prediction model.

[0057] Using the evolution of grain conditions as input features, and the changes in grain temperature and moisture at various spatial locations within a preset time period after the end of the corresponding historical window as label samples, a grain condition prediction model based on temporal attention is constructed. The model adopts a customized four-level architecture of "grain condition spatial attention layer + temperature and moisture coupling interaction layer + Transformer encoder + adaptive fully connected output layer", as follows: Grain Condition Spatial Attention Layer: Addressing the significant differences in temperature and humidity distribution across different layers and regions of the grain pile, this layer combines temporal attention with a spatial attention mechanism. It employs a single-head spatial attention structure with one attention head. The input feature dimension is consistent with the dimension of the grain condition evolution representation vector, denoted as D, with a value ranging from 64 to 256. This value is adaptively adjusted based on the number of grain condition variables and feature complexity. This layer not only repeatedly performs the temporal attention weight calculation and weighted aggregation operations of S203-S204, but also introduces the spatial coordinate features of the grain pile monitoring location. It calculates the spatial correlation weights between each monitoring location, weighting and strengthening the grain condition features at different spatial locations. This highlights the feature contributions of key risk areas such as high temperature and high humidity, achieving collaborative extraction of temporal and spatial features. Temperature and humidity coupling interaction layer: Addressing the core characteristics of the mutual influence and coordinated evolution of temperature and humidity parameters in grain piles, a dual-branch interaction structure is designed. Key information from the temperature and humidity feature branches are extracted separately. A cross-attention mechanism is used to achieve bidirectional interactive fusion of temperature and humidity features, and a temperature and humidity coupling coefficient is introduced. Its value is 0.3~0.7, which is adaptively adjusted according to historical temperature and humidity coupling samples to balance the contribution weight of grain temperature and grain humidity features, and solve the problem of insufficient prediction accuracy caused by the general model ignoring the temperature and humidity coupling relationship. The output dimension of this layer is still D to ensure that it matches the feature dimension of subsequent layers. Transformer Encoder: For scenarios requiring rapid response in grain depot ventilation control, a lightweight optimization of the traditional Transformer encoder is implemented, consisting of two layers. Each layer includes a multi-head attention sublayer and an adaptive feedforward neural network sublayer. The number of attention heads in the multi-head attention sublayer is set to 4-6 to adapt to the grain condition feature dimensions and avoid redundant calculations. The feature dimension of each attention head is D / h, where h is the number of attention heads. The number of hidden layer neurons in the feedforward neural network sublayer is set to 2D, using the LeakyReLU activation function. At the same time, a channel attention mechanism is introduced to dynamically select key feature channels, further improving the model inference speed and meeting the timing requirements of real-time grain depot control. Adaptive Fully Connected Output Layer: To address the significant differences in temperature and humidity variations across different regions of the grain pile, such as the surface, middle, and bottom layers, a regional adaptive output structure is adopted. The first-level fully connected layer has D to 2D neurons and uses the ReLU activation function. The second-level fully connected layer employs a grouped output design, dividing the grain pile into groups based on its layer and corresponding to the layered distribution of monitoring points. The number of neurons in each group is set to the number of monitoring locations at the corresponding layer, enabling differentiated and accurate prediction of grain temperature and humidity at different layers. Each monitoring location corresponds to one predicted grain temperature value and one predicted grain humidity value, balancing global prediction with local accuracy.

[0058] During model training, mean squared error (MSE) was used as the loss function to measure the deviation between the model's predicted values ​​and historical true values. The Adam optimizer was used to iteratively optimize the model parameters. The initial learning rate was set to 1e-5 to 1e-3. A cosine annealing strategy was used to achieve adaptive decay of the learning rate. The number of iterations was set to 50 to 200 rounds. The batch size was set to 32 to 128 based on the training hardware performance and the amount of data. The early stopping strategy was set to monitor the loss value on the validation set. When the loss value on the validation set did not decrease for 10 to 15 consecutive rounds, the model training was terminated to prevent overfitting. The training continued until the loss value of the model on the validation set stabilized and did not fluctuate significantly, thus completing the training and optimization of the grain condition prediction model.

[0059] S206: Grain situation forecast results generated.

[0060] The grain condition time series corresponding to the current control time is processed according to steps S201-S204, including feature preprocessing, feature encoding, attention weight calculation and weighted aggregation, to obtain the grain condition evolution representation at the current time. This grain condition evolution representation is then input into the trained grain condition prediction model, which outputs the predicted grain temperature and grain moisture values ​​for each spatial location within a preset time period. The preset time period can be set according to the actual grain depot control requirements, such as 1 hour, 2 hours, or 24 hours.

[0061] The output predicted values ​​are inversely normalized to restore the actual physical quantity values. Finally, using the spatial coordinates of each monitoring location of the grain pile as an index, the corresponding predicted grain temperature and grain moisture values ​​are structured and organized to form a grain condition prediction result containing spatial location information, prediction time, and prediction value, providing data support for subsequent temperature and moisture diffusion trend analysis and collaborative control strategy formulation.

[0062] Step S3 involves constructing a temperature and humidity distribution field through spatial interpolation, calculating its spatial gradient and temporal rate of change to characterize the temperature and humidity diffusion trend, and finally integrating this temperature and humidity diffusion trend characteristic with the grain condition prediction results into a spatial-temporal state, including: S301: Spatial alignment and grid construction of discrete monitoring data.

[0063] Based on the unique spatial coordinates of each monitoring location in the grain pile, a three-dimensional spatial mesh model of the grain pile is constructed, with a mesh resolution set to [value missing]. Each grid node is mapped one-to-one with the actual physical space of the grain pile, and the three-dimensional coordinates of each grid node are clearly defined. ,in, , The axis corresponds to the radial and axial directions of the grain pile. The axis corresponds to the height of the grain pile and is one-to-one with the layer position of the grain pile's layered layout.

[0064] Grain temperature and moisture data at each monitoring location in the grain condition time series are mapped to corresponding nodes in a three-dimensional spatial grid according to spatial coordinates, forming a discrete set of spatial data points for grain temperature and moisture, ensuring accurate alignment of data spatial locations.

[0065] S302: Spatial interpolation generates temperature and humidity distribution fields.

[0066] To address the sparsity of the discrete monitoring data set, Kriging interpolation is employed to spatially interpolate the discrete grain temperature and moisture data, generating continuous temperature and moisture distribution fields covering the entire grain pile space. During the interpolation process, a semi-variogram is constructed based on the spatial distance between each monitoring location. The variogram model is set to a Gaussian model, and the range parameter is set to... To match the spacing of grain pile monitoring points, the base value is determined by the global variance of grain temperature and moisture data, and the nugget value is set as a fraction of the global variance of the data. It is used to characterize the random error of the monitoring data; the estimated grain temperature and moisture values ​​of each three-dimensional spatial grid node are calculated by interpolation, and finally the continuous temperature distribution field that perfectly matches the three-dimensional spatial grid of the grain pile is output. With humidity distribution field ,in, Using the current time window, we can achieve full-domain visualization and quantitative characterization of the temperature and humidity distribution of the grain pile.

[0067] S303: Neighborhood smoothing and noise reduction processing.

[0068] To eliminate random errors and monitoring data noise introduced during interpolation, neighborhood smoothing was performed on the generated temperature and humidity distribution fields respectively. A three-dimensional Gaussian filter kernel, with the standard deviation of the filter kernel set to... The weight coefficients are distributed according to a Gaussian distribution, with the central node having the highest weight and the gradient decreasing towards neighboring nodes.

[0069] During the smoothing process, each grid node is selected as the center. All node data within the neighborhood are weighted and averaged using Gaussian filtering weights, and the grain temperature and moisture values ​​of that node are updated accordingly. This operation is repeated until all grid nodes are traversed to obtain the smoothed temperature distribution field. With the smoothed humidity distribution field This ensures the spatial continuity of the temperature and humidity distribution field while preserving the distribution characteristics of key high-temperature and high-humidity areas.

[0070] S304: Calculation of spatial gradient vectors for grain temperature and grain moisture.

[0071] Based on the smoothed temperature and humidity distribution fields, the Sobel gradient operator is used to calculate the spatial gradient vectors of grain temperature and grain moisture at the corresponding grid nodes of each monitoring location, representing the diffusion direction of temperature and humidity in three spatial directions.

[0072] Specifically, regarding the smoothed temperature distribution field Calculate each node in , , The partial derivatives in the three directions constitute the spatial gradient vector of grain temperature. The expression is as follows: , in, To smooth the temperature distribution field of the grain Partial derivatives in the axial direction, To smooth the temperature distribution field of the grain Partial derivatives in the axial direction, To smooth the temperature distribution field of the grain The partial derivative along the axial direction represents the dominant direction of grain temperature diffusion, and the magnitude of the vector represents the spatial diffusion intensity of grain temperature at that location. Similarly, for the smoothed humidity distribution field... The grain moisture spatial gradient vector was calculated. The expression is as follows: , in, To smooth the wet distribution field of the grain Partial derivatives in the axial direction, To smooth the wet distribution field of the grain Partial derivatives in the axial direction, To smooth the wet distribution field of the grain The partial derivatives along the axial direction are used to quantitatively characterize the direction and intensity of spatial diffusion of temperature and humidity. In the calculation, the central difference method is used to solve the partial derivatives, with the step size set to the grid resolution. This ensures the accuracy and stability of gradient calculation.

[0073] S305: Calculation of the temporal variation rate of temperature and humidity distribution field.

[0074] Select the current time window Adjacent time window After smoothing the temperature and humidity distribution field, the temporal change rate of both is calculated to characterize the diffusion and evolution speed of temperature and humidity distribution in the time dimension.

[0075] The specific calculation method is as follows: calculate the difference between the grain temperature and grain moisture values ​​of the corresponding grid nodes within the two time windows, and then divide the difference by the time interval between the two time windows. ,in, The sampling period is consistent with the grain condition time series, and the grain temperature time series change rate is obtained. Grain moisture time-series change rate The calculation formula is as follows: , , in, , Each of the preceding adjacent time windows The smoothed temperature and humidity distribution fields; the positive and negative values ​​of the temporal change rate represent the rising and falling trends of temperature and humidity values, and the absolute value represents the speed of temperature and humidity changes, i.e. the diffusion intensity in the time dimension, which, together with the spatial gradient vector, realizes the spatiotemporal quantification of temperature and humidity diffusion.

[0076] S306: Construction of temperature and humidity diffusion trend characteristics.

[0077] The spatial gradient vector of grain temperature at each monitoring location Grain moisture spatial gradient vector Grain temperature change rate over time Grain moisture time-series change rate As the core feature, standardized processing and feature fusion are performed to form a unified-dimensional feature vector of temperature and humidity diffusion trends.

[0078] The Min-Max normalization method is used to map all feature components to The interval was adjusted to eliminate dimensional differences, and the normalization formula was consistent with S201; subsequently, the values ​​at each monitoring location were... , , , Concatenate the vectors to form an 8-dimensional basic diffusion feature vector; then... The convolutional layer compresses and fuses the basic feature vectors to obtain a 16-dimensional feature vector representing the temperature and humidity diffusion trend. This vector fully characterizes the spatial direction, spatial intensity, and temporal evolution rate of temperature and humidity diffusion at the corresponding location.

[0079] S307: Consistent integration of temperature and humidity diffusion trend characteristics with grain condition forecast results.

[0080] To achieve feature alignment between spatial and temporal dimensions, the temperature and humidity diffusion trend features are consistent with the grain condition prediction results generated by S206, ultimately yielding the spatial temporal state.

[0081] The characteristic vector of temperature and humidity diffusion trend in the current time window The predicted grain temperature and moisture values ​​at each monitoring location are matched with the grain condition forecast results for a predetermined future period according to the time step. These values ​​are then mapped onto a three-dimensional spatial grid using spatial coordinates, corresponding one-to-one with spatial nodes representing the temperature and moisture diffusion trend characteristics. Finally, the 16-dimensional temperature and moisture diffusion trend feature vector of each spatial node is concatenated with the corresponding predicted grain temperature and moisture values ​​to form a 20-dimensional spatial temporal state vector. ,in, The future prediction period is identified by the pre-set prediction duration. It is organized in a structured manner according to the spatial coordinate index of the grain pile to obtain the spatial temporal state. This state includes both the prediction information of future temperature and humidity and the diffusion evolution characteristics of current temperature and humidity, providing comprehensive spatiotemporal feature input for the parameter selection and optimization of the subsequent ventilation coupling model.

[0082] refer to Figure 3 , Figure 3 A flowchart was constructed to illustrate the spatial temperature and humidity diffusion trend characteristics.

[0083] Figure 3 The paper demonstrates the construction of temperature and humidity distribution fields based on grain condition time series, and the formation of temperature and humidity diffusion trend characteristics through spatial gradient vector calculation and time series change rate calculation.

[0084] Step S4: Based on the spatial and temporal state, candidate parameters are generated and input into the ventilation coupling model to obtain the corresponding predicted values ​​of grain temperature and grain moisture changes. Finally, based on the target interval, the optimal ventilation parameters are determined to form a coordinated control strategy, including: S401: Construction and parameter calibration of ventilation coupling model.

[0085] Based on historical grain condition time series, we explored the coupling response law between ventilation equipment operating parameters and grain pile temperature and humidity changes, and constructed a ventilation coupling model driven by both "mechanism and data" to achieve accurate characterization of the impact of ventilation behavior on the evolution of grain temperature and humidity.

[0086] First, ventilation behavior data such as the operating status and duration of ventilation equipment in the historical grain condition time series, as well as the changes in grain temperature and humidity at each monitoring location of the grain pile during the corresponding time period, are extracted to construct a ventilation-temperature and humidity response sample set. The sample set is divided into training subset and validation subset according to grain variety, storage period, and seasonal conditions.

[0087] Secondly, the model adopts a hybrid architecture of "mechanism constraint + data fitting", with the core consisting of a ventilation mass and heat transfer mechanism layer and a data-driven correction layer: the mechanism layer is based on the mass and heat transfer theory of porous media in grain piles, constructs a temperature and humidity coupling transfer equation, and quantifies the intrinsic relationship between ventilation velocity, running time and temperature and humidity changes in grain piles. The equation expression is as follows: , , in, The rate of change of grain temperature over time. The rate of change of grain moisture over time; The thermal diffusivity of the grain pile is denoted as , and its value is . The specific heat capacity is determined by the porosity and specific heat capacity of the grain pile. The convective heat transfer coefficient of ventilation to grain temperature is positively correlated with ventilation velocity; The temperature-humidity coupling coefficient characterizes the degree of influence of grain moisture changes on grain temperature. The wet diffusion coefficient of the grain pile is denoted as , and its value is . The value is determined by the moisture content and temperature of the grain pile. The convective mass transfer coefficient of ventilation on grain moisture was obtained by fitting ventilation mass transfer test data and is positively correlated with ventilation velocity and air humidity difference. The temperature-humidity inverse coupling coefficient is derived from a sample regression analysis of the impact of historical grain temperature on grain moisture, characterizing the degree of influence of grain temperature changes on grain moisture. The ventilation wind speed is collected in real time by the wind speed sensor built into the ventilation equipment.

[0088] The data-driven correction layer employs a lightweight backpropagation neural network, using the deviation between the predicted temperature and humidity changes output by the mechanism layer and the historical true values ​​as input. Backpropagation is then used to optimize the core parameters of the mechanism layer. , , , , , To reduce errors caused by mechanistic assumptions, the mean squared error (MSE) is used as the loss function during model training, and the Adam optimizer iterates the parameters with a learning rate set to [value missing]. The number of iterations was set to 120 rounds, and the early stopping strategy was set to terminate training if the loss on the validation set did not decrease for 10 consecutive rounds, to ensure that the model converged and had good generalization ability.

[0089] Finally, the performance of the calibrated ventilation coupling model is verified by a validation subset. Once the model is determined to meet the usage requirements, the construction and calibration of the ventilation coupling model are completed.

[0090] S402: Generation of candidate ventilation parameter set.

[0091] Based on the spatial and temporal temperature and humidity diffusion characteristics and grain condition prediction results, combined with the hardware constraints of ventilation equipment and the requirements of grain storage technology, a set of candidate ventilation parameters is generated that covers a reasonable parameter range and takes into account both global control and local optimization.

[0092] First, clarify the value range of the core dimensions of ventilation parameters. These core parameters include ventilation velocity, ventilation duration, and the number of ventilation units in operation. Specifically, the ventilation velocity is... The gradient is divided into 0.2 m / s intervals; the ventilation operation time is taken as... The gradient is divided into 30-minute intervals; the number of ventilation equipment groups to be turned on is determined according to the total number of ventilation equipment groups in the grain warehouse, and the gradient is divided into 1-group intervals.

[0093] Parameter selection and optimization are performed by combining spatial and temporal states. For high-temperature and high-humidity risk areas, i.e., spatial nodes corresponding to grain temperature ≥25℃ or grain moisture ≥15%, high wind speeds are prioritized for generation. Medium to long duration The parameter combination is used to generate low to medium wind speeds in areas where temperature and humidity are within a safe range but the diffusion trend is obvious. ,short time The parameter combination generates low wind speeds for areas with stable temperature and humidity and no risk of diffusion. ,short time The parameter combination reduces energy consumption.

[0094] Finally, samples with logical conflicts in the parameter combinations are removed, forming a candidate ventilation parameter set containing 30 to 50 effective parameter combinations. Each parameter combination corresponds to a unique identifier and is associated with the spatial region characteristics it is suitable for, which facilitates subsequent screening and sorting.

[0095] S403: Ventilation Coupled Model Inference.

[0096] The generated set of candidate ventilation parameters and the spatial temporal state vector at the current moment are synchronously input into the calibrated ventilation coupling model to perform batch inference and output the predicted values ​​of grain temperature change and grain moisture change at each monitoring location within the future preset time period corresponding to each candidate ventilation parameter combination.

[0097] During the inference process, the model dynamically adjusts the ventilation mass and heat transfer efficiency by combining the spatial and temporal diffusion trends of temperature and humidity, achieving differentiated predictions of temperature and humidity changes under different parameter combinations. Simultaneously, it records the energy consumption per unit time for each candidate parameter combination. Energy consumption is calculated by multiplying the rated power of a single ventilation unit, the ventilation operating time, and the number of units in operation, where the rated power of a single ventilation unit is a preset constant. After inference is completed, a related dataset of "candidate parameter identifier - grain temperature change prediction - grain moisture change prediction - energy consumption" is constructed to provide data support for subsequent screening and ranking.

[0098] S404: Constraint setting and candidate parameter selection.

[0099] Based on the storage requirements of grain varieties and the safety management standards of grain depots, a target temperature range and a safe moisture range for grain are set as constraints to perform preliminary screening of the candidate ventilation parameter set, eliminating parameter combinations that do not meet the safety constraints.

[0100] If none of the candidate parameter combinations meet the constraints, the upper limit of the grain temperature target range should be appropriately relaxed. For example, if the upper limit of the raw grain temperature target range is 20℃ in a conventional grain storage scenario, it can be relaxed step by step in increments of 2℃, with a maximum relaxation of no more than 5℃. That is, the upper limit should not exceed the critical value of 25℃ for safe grain storage. The parameters should be re-screened to ensure that the number of effective parameter combinations retained after screening is no less than 10. If there are still no effective combinations, an early warning signal should be output to prompt manual intervention to adjust the ventilation strategy.

[0101] S405: Comprehensive evaluation ranking and determination of optimal ventilation parameters.

[0102] For the selected effective candidate parameter combinations, a multi-objective comprehensive evaluation system is constructed. The entropy weight-TOPSIS method is used to calculate the comprehensive evaluation score of each parameter combination. The parameters are sorted from high to low and the parameter combination with the highest score is selected as the optimal ventilation parameter.

[0103] A comprehensive evaluation index system was established, comprising 3 primary indicators and 5 secondary indicators, as follows: Temperature and humidity control effect indicators, including grain temperature compliance rate and grain moisture compliance rate. The grain temperature compliance rate is the proportion of predicted grain temperature values ​​at all monitoring locations falling within the target range, and the grain moisture compliance rate is the proportion of predicted grain moisture values ​​at all monitoring locations falling within the safe range. Energy consumption and economic indicators, i.e., ventilation energy consumption per unit time. Diffusion inhibition effect indicators, including grain temperature diffusion intensity reduction rate and grain moisture diffusion intensity reduction rate. Both reduction rates are calculated using "(current diffusion intensity - diffusion intensity after ventilation) / current diffusion intensity," where the diffusion intensity after ventilation is the mean magnitude of the temperature and humidity spatial gradient vector after ventilation.

[0104] The entropy weight method is used to calculate the weights of each secondary indicator to eliminate subjective weight bias: After standardizing the raw data of each indicator, the information entropy of each indicator is calculated, and then the indicator weight is calculated based on the entropy value. The weight calculation logic is "(1 - information entropy of a certain indicator) / sum of (1 - information entropy) of all indicators". Among them, the total weight of the temperature and humidity control effect indicator is the sum of the weights of the grain temperature compliance rate and the grain moisture compliance rate; the weight of the energy consumption economy indicator is the weight corresponding to the ventilation energy consumption per unit time; and the total weight of the diffusion inhibition effect indicator is the sum of the weights of the grain temperature diffusion intensity reduction rate and the grain moisture diffusion intensity reduction rate. The sum of the weights of the three primary indicators is 1.

[0105] The TOPSIS method is used to calculate the comprehensive score of each candidate parameter combination: a standardized decision matrix is ​​constructed, the positive ideal solution (i.e., the optimal value of each indicator) and the negative ideal solution (i.e., the worst value of each indicator) are determined, the Euclidean distance between each parameter combination and the positive and negative ideal solutions is calculated, and the comprehensive closeness is obtained. The higher the score, the better the regulation effect, economy and diffusion suppression ability of the parameter combination.

[0106] Finally, the effective candidate parameter combinations are sorted from high to low according to the comprehensive evaluation score, and the parameter combination with the highest score is selected as the optimal ventilation parameter. If there are parameter combinations with the same score, the combination with lower energy consumption is selected first to ensure that the optimal parameter takes into account both the control effect and economy.

[0107] S406: Cooperative control strategy is formed.

[0108] The determined optimal ventilation parameters are transformed into executable collaborative control strategies, clarifying the start-up and shutdown logic, operating parameters, and control priorities of ventilation equipment, forming three-dimensional collaborative control instructions covering time, space, and equipment.

[0109] First, based on optimal ventilation parameters, equipment control instructions are generated: the number of ventilation equipment groups to be turned on, ventilation speed, and operating time are specified, and the equipment activation priority is set according to the risk area distribution in the spatial temporal state, that is, ventilation equipment corresponding to high temperature and high humidity risk areas is turned on first, and then equipment in other areas is turned on to achieve spatial coordinated control; the wind speed adjustment logic is set, high wind speed is used in the initial stage to quickly suppress the diffusion of temperature and humidity, medium wind speed is used in the middle stage of operation to maintain the control effect, and low wind speed is used in the final stage of operation to stabilize the temperature and humidity state, thus achieving time-coordinated control.

[0110] Secondly, a safety redundancy mechanism is added. Real-time temperature and humidity monitoring thresholds are set in the control strategy. For example, in the scenario of storing japonica rice at normal temperature, the emergency control trigger threshold is set to trigger an increase in wind speed or an extension of the operation time when the real-time grain temperature in the area is ≥25℃ or the grain moisture is ≥15%. The threshold for preventing excessive ventilation is set to trigger a decrease in wind speed or an early termination of ventilation when the real-time grain temperature in the area is ≤8℃ or the grain moisture is ≤10%. At the same time, the emergency threshold for the external environment is set to automatically stop ventilation when the relative humidity outside the warehouse is ≥85%. If the real-time monitoring during ventilation shows that the grain temperature in a certain area is ≥25℃ or the grain moisture is ≥15%, the emergency control of increasing the wind speed or extending the operation time is automatically triggered. If the real-time monitoring shows that the grain temperature is ≤8℃ or the grain moisture is ≤10%, the wind speed is automatically reduced or the ventilation is terminated early to avoid excessive ventilation leading to energy waste or damage to grain drying.

[0111] Finally, the control strategy is output in a standardized command format, specifying the command execution time, equipment identification, operating parameters, and emergency control logic. It is also linked to the current spatial temporal status and grain condition prediction results to form a complete collaborative control strategy, providing a clear basis for the subsequent execution and rolling optimization of ventilation equipment.

[0112] Step S5 involves adjusting the ventilation equipment by implementing a coordinated control strategy and making rolling predictions based on the updated grain condition time series until the predicted value reaches the target, at which point ventilation is terminated. This includes: S501: Collaborative control strategy analysis and device command issuance.

[0113] The collaborative control strategy generated by S406 is analyzed and transformed into executable instructions for ventilation equipment, achieving precise docking between strategy and execution.

[0114] The core parameters of the strategy are broken down to form an associated instruction set of "equipment identification - operating parameters - execution sequence - emergency rules" to ensure that the equipment identification and operating parameters are consistent with the previous ones; bus communication is used to issue instructions and build a status feedback closed loop to start the equipment group by group according to priority to avoid sudden increase in grid load.

[0115] Emergency control rules are simultaneously written into the equipment control unit, specifying the triggering conditions and corresponding actions, so as to realize automatic triggering of emergency control.

[0116] S502: Real-time grain condition data acquisition and synchronous preprocessing.

[0117] During ventilation, multi-source data are continuously collected according to the S101 sampling cycle, and preprocessing is performed simultaneously to support sequence updates.

[0118] The data collection range is consistent with S101, recording timestamps and spatial coordinates; the synchronous preprocessing follows the logic of S102~S104, completing time alignment, missing value imputation and outlier repair to ensure data quality.

[0119] S503: Grain situation time series is updated on a rolling basis.

[0120] Based on preprocessed data, a sliding window mechanism is used to dynamically update the sequence to adapt to the input requirements of the prediction model.

[0121] Keep the historical window length consistent with S105, update using the "add real-time data - remove expired data" method, organize according to the S105 format, perform S201 preprocessing, and simultaneously verify data integrity and continuity.

[0122] S504: Rolling prediction execution and termination condition determination.

[0123] The updated sequence is input into the grain condition prediction model to perform rolling prediction, and it is determined whether the termination condition is met.

[0124] Following the prediction logic of S201~S206, short-term grain temperature and moisture prediction values ​​are output and reverse normalized; the termination condition is "double standard attainment + stable diffusion", which requires that the temperature and moisture prediction values ​​be attained and the diffusion trend be stable at the same time. If the standard is attained for 3 consecutive times, the process will be terminated.

[0125] S505: Ventilation Termination Execution and Data Archiving.

[0126] Once the termination conditions are met, a shutdown operation is performed, and the entire process of data archiving is completed simultaneously, along with supplementary fault fallback handling.

[0127] Issue shutdown commands and record termination data, clear emergency commands; archive and control data throughout the entire process according to specifications to ensure subsequent model optimization and use; output early warnings and save data when equipment fails, and restore the control process after troubleshooting.

[0128] Example 2 This invention discloses a grain depot temperature and humidity collaborative control system based on a temporal attention mechanism, comprising a data acquisition module, a grain condition prediction module, a diffusion fusion module, a decision generation module, and a collaborative control module. The data acquisition module collects grain temperature and moisture, outside air temperature and humidity, and ventilation equipment operation status and duration at various monitoring locations in the grain pile. It performs time alignment, missing data filling, and anomaly removal on each data point, and extracts a preset length of historical window from the current control time to form a grain condition time sequence.

[0129] The grain condition prediction module performs feature encoding on the grain condition time series according to variable type to obtain the grain condition coding sequence. Based on the temporal correlation of the grain condition coding sequence within the historical window, it calculates the attention weight at each moment. It then weights and aggregates the coding vectors at each moment within the historical window to obtain the grain condition evolution representation. Based on the grain condition evolution representation and the corresponding historical grain temperature and moisture change samples, it constructs a grain condition prediction model. The current grain condition time series is input into the grain condition prediction model to obtain the predicted grain temperature and moisture values ​​at each monitoring location in the future period, thus forming the grain condition prediction result.

[0130] The diffusion fusion module, based on the grain temperature and moisture at each monitoring location in the grain condition time series, performs spatial interpolation and neighborhood smoothing on discrete monitoring points using the spatial coordinates of the grain pile as an index to obtain the temperature distribution field and the humidity distribution field. In the temperature distribution field and the humidity distribution field, the spatial gradient vector of grain temperature and the spatial gradient vector of grain moisture are calculated for each monitoring location. At the same time, the temporal change rate of the distribution field of adjacent time windows is calculated. The spatial gradient vector of grain temperature, the spatial gradient vector of grain moisture, and the temporal change rate are used to characterize the direction and intensity of temperature and humidity diffusion, forming the temperature and humidity diffusion trend characteristics and integrating them with the grain condition prediction results to obtain the spatial temporal state.

[0131] The decision generation module establishes a ventilation coupling model based on the response relationship between ventilation behavior and temperature and humidity changes in historical grain condition time series. It generates a set of candidate ventilation parameters based on spatial and temporal status and inputs them into the ventilation coupling model to obtain the predicted values ​​of grain temperature and grain moisture changes for each candidate ventilation parameter. Based on the target grain temperature range and the safe grain moisture range, it performs constraint screening and comprehensive ranking to determine the optimal ventilation parameters and form a collaborative control strategy.

[0132] The collaborative control module controls the ventilation equipment to start, stop, and adjust the running time according to the collaborative control strategy. It continuously updates the grain condition time sequence and inputs it into the grain condition prediction model to perform rolling predictions until the predicted grain temperature and grain moisture values ​​enter the target safe range and then terminates the ventilation.

[0133] refer to Figure 4 , Figure 4 This is a schematic diagram of a grain depot temperature and humidity collaborative control system based on a temporal attention mechanism.

[0134] Figure 4 The structure of a grain depot temperature and humidity collaborative control system, consisting of a data acquisition module, a grain condition prediction module, a diffusion and fusion module, a decision generation module, and a collaborative control module, is shown.

[0135] This invention discloses a grain depot temperature and humidity collaborative control system and method based on a temporal attention mechanism. It constructs a grain condition temporal sequence by collecting information on grain temperature, grain humidity, external environment, and ventilation equipment operation. The temporal attention mechanism is then used to extract the grain condition evolution representation and establish a grain condition prediction model, enabling the acquisition of predicted grain temperature and humidity values ​​at various monitoring locations for future periods. Based on this, spatial gradient vectors and temporal change rates are calculated for the temperature and humidity distribution fields to construct temperature and humidity diffusion trend characteristics. These characteristics are then integrated with the grain condition prediction results to form a spatial temporal state, providing a unified representation of the future changes and diffusion evolution of grain pile temperature and humidity. Furthermore, a mechanism-data dual-driven ventilation coupling model is established based on the spatial temporal state. Candidate ventilation parameters are generated, and the optimal ventilation parameters are determined through constraint screening and comprehensive evaluation. This forms a collaborative control strategy and executes rolling predictive regulation, achieving predictive-driven and collaboratively optimized control of grain depot temperature and humidity, improving the safety, targeting, and energy efficiency of grain condition regulation.

[0136] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.

Claims

1. A method for coordinated control of temperature and humidity in grain depots based on a temporal attention mechanism, characterized in that, Includes the following steps: Collect grain temperature and moisture, outside air temperature and humidity, and ventilation equipment operation status and duration at various monitoring locations in the grain pile. After preprocessing, extract a historical window of preset length to form a time series of grain conditions. The grain condition time series is subjected to feature encoding to obtain the grain condition encoded sequence. Attention weights are calculated based on temporal correlation. The grain condition evolution representation is obtained through weighted aggregation. A grain condition prediction model is constructed, and the predicted grain temperature and grain moisture values ​​are output to form the grain condition prediction result. Based on the grain condition time series, temperature distribution field and humidity distribution field are constructed. The spatial gradient vector of grain temperature, the spatial gradient vector of grain moisture and the temporal change rate of adjacent time windows at each monitoring location are calculated to form the temperature and humidity diffusion trend characteristics and integrate them with the grain condition prediction results to obtain the spatial temporal state. Based on the response relationship between ventilation behavior and temperature and humidity changes in historical grain condition time series, a ventilation coupling model is established. A candidate ventilation parameter set is generated according to the spatial time series status, and the optimal ventilation parameters are selected and determined to form a collaborative control strategy. The ventilation equipment is controlled according to the collaborative control strategy, and the grain condition time sequence is updated continuously to execute the prediction until the predicted grain temperature and grain moisture values ​​enter the target safe range and then ventilation is terminated. The ventilation coupling model is established, including: a hybrid architecture of ventilation mass and heat transfer mechanism layer and data-driven correction layer; the ventilation mass and heat transfer mechanism layer constructs temperature and humidity coupling transfer equations based on the mass and heat transfer theory of porous media in grain piles, and introduces the heat diffusivity coefficient, convective heat transfer coefficient, temperature and humidity coupling coefficient, moisture diffusivity coefficient, convective mass transfer coefficient and temperature and humidity reverse coupling coefficient of grain piles to quantify the relationship between ventilation speed and running time on the time change rate of grain temperature and the time change rate of grain moisture; the data-driven correction layer adopts a lightweight BP neural network, takes the prediction deviation output by the ventilation mass and heat transfer mechanism layer as input, and iteratively optimizes the parameters of the ventilation mass and heat transfer mechanism layer through backpropagation. A grain condition prediction model is constructed based on the grain condition evolution representation, including: the grain condition prediction model adopts a four-level architecture: a grain condition spatial attention layer, a temperature and humidity coupling interaction layer, a Transformer encoder, and an adaptive fully connected output layer; the grain condition spatial attention layer introduces the spatial coordinate features of the monitoring location on the basis of temporal attention, calculates the spatial correlation weight between each monitoring location, and realizes the collaborative extraction of temporal and spatial features; the temperature and humidity coupling interaction layer sets up grain temperature feature branches and grain moisture feature branches, performs bidirectional interactive fusion through a cross-attention mechanism, and introduces a temperature and humidity coupling coefficient to balance the contribution weights of the two branches; the adaptive fully connected output layer is grouped according to the grain pile layer, and outputs the predicted grain temperature and grain moisture values ​​corresponding to each monitoring location. The optimal ventilation parameters were determined through a comprehensive evaluation system that included temperature and humidity control effectiveness indicators, energy consumption and economic indicators, and diffusion inhibition effectiveness indicators. Temperature and humidity control effectiveness indicators included grain temperature compliance rate and grain moisture compliance rate. Energy consumption and economic indicators were defined as ventilation energy consumption per unit time. Diffusion inhibition effectiveness indicators included the reduction rate of grain temperature diffusion intensity and the reduction rate of grain moisture diffusion intensity. The entropy weight method was used to determine the objective weights based on the information entropy of each indicator. The TOPSIS method was used to construct a standardized decision matrix. The Euclidean distance between each candidate ventilation parameter combination and the positive and negative ideal solutions was calculated to obtain the comprehensive closeness. The parameters were then sorted in descending order of comprehensive closeness, and the parameter combination with the highest comprehensive closeness was selected as the optimal ventilation parameters. The calculation of attention weights includes: inputting the grain condition coding sequence into the attention calculation module, mapping the coding vector at each time step to a query vector, key vector, and value vector through linear transformation, calculating the similarity between the query vector at each time step and the key vector at all times step using the dot product method to obtain the relevance matrix, performing Softmax normalization on the relevance matrix, converting the similarity at each time step into attention weights that sum to 1, and finally obtaining an attention weight sequence consistent with the historical window length.

2. The grain depot temperature and humidity coordinated control method based on temporal attention mechanism as described in claim 1, characterized in that, The spatial-temporal state is obtained by integrating the characteristics of temperature and humidity diffusion trends with the grain condition forecast results, including: After normalizing the spatial gradient vectors of grain temperature, grain moisture, and the temporal change rates of grain temperature and grain moisture at each monitoring location, the vectors are concatenated and then compressed and fused through a convolutional layer to obtain the feature vector of temperature and moisture diffusion trend. The current time window temperature and humidity diffusion trend feature vector is matched with the grain condition prediction results by time step. The predicted grain temperature and grain moisture values ​​at each monitoring location in the grain condition prediction results are mapped to a three-dimensional spatial grid according to spatial coordinates. After being spliced ​​together with the spatial nodes of the temperature and humidity diffusion trend feature vector, the spatial temporal state is obtained by organizing the data in a structured manner according to the spatial coordinate index of the grain pile.

3. The grain depot temperature and humidity coordinated control method based on temporal attention mechanism as described in claim 1, characterized in that, A candidate ventilation parameter set is generated based on the spatial temporal state, including: The core parameters of the candidate ventilation parameter set include ventilation velocity, ventilation runtime and number of ventilation equipment groups in operation. Each parameter is divided into value gradients according to a set interval within the limits of hardware constraints and storage process requirements. By combining spatial temporal states, differentiated parameter combinations are generated, and for spatial nodes where temperature and humidity are in a high-risk state, parameter combinations with high wind speed and medium-to-long operating time are generated. For spatial nodes where temperature and humidity are within a safe range but the diffusion trend is obvious, generate parameter combinations of low to medium wind speed and short operating time. For spatial nodes with stable temperature and humidity, parameter combinations with low wind speed and short operating time are generated; logically conflicting parameter combinations are eliminated, and each effective parameter combination is associated with a unique identifier and the characteristics of the adapted spatial region.

4. The grain depot temperature and humidity coordinated control method based on temporal attention mechanism as described in claim 1, characterized in that, Constructing temperature and humidity distribution fields includes: A three-dimensional spatial grid model of the grain pile was constructed based on the spatial coordinates of each monitoring location. The grain temperature and grain moisture data at each monitoring location were mapped to the corresponding grid nodes according to the spatial coordinates. A Gaussian variogram model was constructed based on the spatial distance of the monitoring location using the Kriging interpolation method. Interpolation calculations were performed on all grid nodes to generate continuous temperature and humidity distribution fields. The temperature distribution field and humidity distribution field are respectively subjected to a three-dimensional Gaussian filter kernel and a neighborhood weighted average with Gaussian distribution weights. The smoothed temperature distribution field and humidity distribution field are obtained by traversing all nodes.

5. The grain depot temperature and humidity coordinated control method based on temporal attention mechanism as described in claim 4, characterized in that, Calculate the spatial gradient vector of grain temperature, the spatial gradient vector of grain moisture, and the time-series rate of change at each monitoring location, including: The Sobel gradient operator is used to calculate the partial derivatives of each grid node in the three-dimensional coordinate axis direction of the smoothed temperature distribution field using the central difference method. The partial derivatives in the three directions constitute the grain temperature spatial gradient vector. The vector direction represents the dominant direction of grain temperature diffusion, and the vector magnitude represents the spatial diffusion intensity. Perform the same operation on the smoothed humidity distribution field to obtain the grain moisture spatial gradient vector; calculate the difference between the grain temperature and grain moisture values ​​of the corresponding nodes of the smoothed distribution field of the current time window and the previous adjacent time window, and divide by the time interval to obtain the temporal change rate of grain temperature and the temporal change rate of grain moisture.

6. The grain depot temperature and humidity coordinated control method based on temporal attention mechanism as described in claim 1, characterized in that, After preprocessing, a pre-defined historical window length is extracted to form a grain condition time series, including: Time mapping is performed based on the correspondence between the timestamps of each sampling source and the unified time base, so as to unify the data from different acquisition channels to the same time scale; Construct a time series integrity identification matrix to locate missing segments and missing points. For continuous missing segments, perform trend extension interpolation based on the slope of changes in effective data before and after. For discrete missing points, perform spatial interpolation based on the monitoring position values ​​of the same spatial neighborhood according to the inverse distance weight. Historical statistical intervals and rate of change intervals are constructed according to variable type. Data outside the intervals are marked as outliers, and joint repair is performed based on the consistency of time neighborhood trends and the consistency of spatial neighborhood values. Starting from the current control time, the data is extracted backwards according to the preset historical window length, and then organized in a structured manner according to time sequence and spatial coordinate index to form a grain situation time sequence.

7. A grain depot temperature and humidity coordinated control system based on a temporal attention mechanism, used to implement the grain depot temperature and humidity coordinated control method based on a temporal attention mechanism according to any one of claims 1-6, characterized in that, It includes a data acquisition module, a grain condition forecasting module, a diffusion and fusion module, a decision generation module, and a collaborative control module: The data acquisition module collects grain temperature and moisture, outside air temperature and humidity, and ventilation equipment operating status and duration at various monitoring locations in the grain pile. After preprocessing, it extracts a preset length of historical window to form a grain condition time series. The grain condition prediction module performs feature encoding on the grain condition time series to obtain the grain condition coded sequence, calculates attention weights based on temporal correlation, obtains the grain condition evolution representation through weighted aggregation, constructs the grain condition prediction model, and outputs the predicted grain temperature and grain moisture values ​​to form the grain condition prediction result. The diffusion fusion module constructs temperature and humidity distribution fields based on the grain condition time series, calculates the spatial gradient vector of grain temperature, the spatial gradient vector of grain moisture and the temporal change rate of adjacent time windows at each monitoring location, forms temperature and humidity diffusion trend characteristics and integrates them with the grain condition prediction results to obtain the spatial temporal state. The decision generation module establishes a ventilation coupling model based on the response relationship between ventilation behavior and temperature and humidity changes in the historical grain condition time series. It generates a set of candidate ventilation parameters based on the spatial time series status and selects and determines the optimal ventilation parameters to form a collaborative control strategy. The collaborative control module controls the ventilation equipment according to the collaborative control strategy and continuously updates the grain condition time sequence to perform predictions until the predicted grain temperature and grain moisture values ​​enter the target safe range and then terminates ventilation.

Citation Information

Patent Citations

  • Multi-point granary temperature prediction method and prediction system based on Transform model

    CN120162678A

  • Grain depot intelligent ventilation control system and method based on deep reinforcement learning

    CN122195189A