Intelligent Agricultural Environment Regulation Method and System Based on Cloud Platform

Through multi-source sensor data cleaning and multi-head self-attention encoder model, the data fusion and lag problems in traditional agricultural environment monitoring and regulation are solved, and the precise and intelligent regulation of the agricultural environment and resource optimization are achieved.

CN120238842BActive Publication Date: 2025-07-29YUNNAN HANZHE TECHN CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510702815.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-29
Publication Date
2025-07-29
Estimated Expiration
2045-05-29

AI Technical Summary

Technical Problem

Traditional agricultural environmental monitoring and regulation technologies have problems such as difficulty in fusion of multi-source sensor data, difficulty in modeling the correlation between environmental parameters and crop physiological state, delayed data processing, resource waste and yield loss.

Method used

Data is collected through multi-source sensors, edge computing nodes are filtered and transmitted to the cloud platform, data cleaning and feature extraction are carried out, prediction models are built using multi-head self-attention encoder, real-time control instructions are generated, and precise control is issued to irrigation and temperature control equipment through the Internet of Things protocol for precise regulation.

Benefits of technology

It realizes efficient integration and dynamic feature modeling of multi-source data, improves the accuracy and resource utilization efficiency of agricultural environment regulation, and supports intelligent regulation of second-level response.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120238842B_ABST
    Figure CN120238842B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of intelligent regulation of agricultural environment, and specifically relates to an intelligent regulation method and system for agricultural environment based on a cloud platform, including: collecting farmland environment parameters and crop image data through multi-source sensors, filtering through edge computing nodes and then transmitting them to the cloud platform; preprocessing the farmland environment parameters and crop image data, and extracting time-domain and space-domain features; constructing a prediction model for agricultural environment state indicators based on a multi-head self-attention encoder, training the prediction model for agricultural environment state indicators through historical data, and deploying it as a cloud service API to perform online processing on real-time input farmland environment parameters and crop image data, generating control instructions according to the prediction results, and sending them to devices through the Internet of Things protocol to complete the precise and intelligent regulation of the agricultural environment. The present invention significantly improves the accuracy of agricultural environment regulation and the resource utilization efficiency through dynamic feature modeling and multi-index collaborative optimization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent regulation of agricultural environment, and more particularly, to an intelligent regulation method and system for agricultural environment based on a cloud platform. Background Art

[0002] Precision agriculture, as an important direction of modern agricultural development, is gradually moving towards a new stage of data-driven and intelligent decision-making. Farmland environmental parameters are the key factors determining the growth status of crops, and the dynamic changes and complex interactions of these environmental parameters have a profound impact on crop growth. At present, there are many limitations in the practical application of traditional agricultural environment monitoring and regulation technologies. On the one hand, the heterogeneity of multi-source sensors and image data leads to difficulties in feature fusion, and it is difficult to model the dynamic relationship between environmental parameters and crop physiological states. Relying solely on threshold judgment easily ignores the synergistic effect between indicators. On the other hand, in the data processing flow, edge computing nodes often use fixed rules to filter noise, which is difficult to adapt to the outlier interference of different farmland scenarios, and the training of cloud models is mostly based on single-time slice data, lacking the ability to capture spatio-temporal continuous features. In addition, the generation of regulation instructions usually lags behind environmental changes, not only unable to respond to sudden meteorological events in a timely manner, but also the device control strategy has a low matching degree with the actual needs of crops, resulting in waste of resources and loss of yield. Summary of the Invention

[0003] The purpose of the present invention is to provide an intelligent regulation method and system for agricultural environment based on a cloud platform, which realizes multi-source data fusion and cleaning, dynamic feature modeling and multi-index collaborative optimization, and significantly improves the accuracy of agricultural environment regulation and resource utilization efficiency through cloud-edge collaborative computing and real-time control instruction issuance.

[0004] The present invention is realized through the following technical solutions:

[0005] An intelligent regulation method for agricultural environment based on a cloud platform, the steps of the method include:

[0006] Collect farmland environmental parameters and crop image data through multi-source sensors, and transmit them to the cloud platform after being filtered by edge computing nodes;

[0007] Normalize and clean outliers of farmland environmental parameters, denoise and enhance crop image data, and extract time-domain and space-domain features;

[0008] Construct a prediction model for agricultural environment state indicators based on a multi-head self-attention encoder, and complete the training of the prediction model for agricultural environment state indicators through historical time-domain and space-domain features extracted from historical data;

[0009] Deploy the trained prediction model for agricultural environment status indicators as a cloud service API, perform online processing on the time-domain and space-domain features of real-time input, generate control instructions according to the prediction results, and send them to irrigation and temperature control devices through the Internet of Things protocol to execute operations, so as to complete the precise and intelligent regulation of the agricultural environment.

[0010] Optionally, the edge computing node is specifically:

[0011] According to the farmland scale and network topology, configure a local edge computing gateway for areas where sensors reach the set density and are sensitive to communication delay;

[0012] Set up independent edge computing nodes for the remaining areas respectively;

[0013] The cloud platform is interconnected with the local edge computing gateway and independent edge computing nodes through the Internet;

[0014] The local edge computing gateway and independent edge computing nodes perform data exchange through a distributed message queue.

[0015] Optionally, the data exchange through the distributed message queue is specifically:

[0016] Each edge computing node packs the multi-source sensor data collected according to the timestamp and writes it into the message queue;

[0017] When other edge computing nodes subscribe to new messages, align and deduplicate them through the timestamp and sequence number carried in the message body;

[0018] Determine whether an abnormal event has occurred in the network. If not, return to the previous step; if so, until the network resumes, each edge computing node replays the unprocessed messages to make up for the missing data and restore the time sequence, where the abnormal event includes network fluctuations or interruptions.

[0019] Optionally, the extraction of time-domain and space-domain features is specifically:

[0020] For farmland environmental parameters: after normalization and outlier cleaning, perform short-time Fourier transform on the farmland environmental parameters through a sliding time window to obtain the time-domain features of the farmland environmental parameters, and construct an adjacency matrix based on the sensor deployment coordinates to derive the space-domain features of the farmland environmental parameters;

[0021] For crop image data: after denoising and enhancement processing, obtain the sequence change according to the acquisition timestamp of the crop image data, which is characterized as the time-domain feature of the crop image data, and analyze the pixel distribution of the crop image data to extract the space-domain feature of the crop image data;

[0022] Perform weighted fusion on the time-domain and space-domain features of farmland environmental parameters and crop image data according to the acquisition time, sensor, and image position, and output a comprehensive spatio-temporal feature vector.

[0023] Optionally, the agricultural environment status index prediction model is constructed based on a multi-head self-attention encoder, specifically:

[0024] Characterize the comprehensive spatio-temporal feature vector as the first tensor and input it into the next step;

[0025] Divide the comprehensive spatio-temporal feature vector into multiple subspaces, calculate the attention scores among the query vector, key vector, and value vector within each subspace, and perform parallel concatenation on the attention outputs of each subspace to obtain the second tensor;

[0026] Perform element-wise addition of the second tensor and a preset embedding vector to obtain the third tensor;

[0027] Input the third tensor into a feed-forward network composed of multiple layers of fully connected networks and non-linear activation functions, and after calculation, output the fourth tensor;

[0028] Map the fourth tensor to the target output dimension through linear mapping and output the predicted value of the crop health score.

[0029] Optionally, the training of the agricultural environment status index prediction model is completed by extracting historical time-domain and space-domain features from historical data, specifically:

[0030] Extract historical comprehensive spatio-temporal feature vectors and corresponding crop health score labels from historical data to form an input tensor and a target label;

[0031] Pass the input tensor layer by layer to the agricultural environment status index prediction model and output the predicted score;

[0032] Compare the predicted score with the target label and calculate the loss value through the mean square error;

[0033] Iteratively update the parameters of the agricultural environment status index prediction model, the embedding vector, and the weights and bias terms of the output layer through the AdamW optimization algorithm;

[0034] Until the maximum number of iterations is reached, complete the training of the agricultural environment status index prediction model.

[0035] Optionally, the iterative update of the parameters of the agricultural environment status index prediction model, the embedding vector, and the weights and bias terms of the output layer through the AdamW optimization algorithm is specifically:

[0036] Obtain the gradients corresponding to the parameters of the agricultural environment status index prediction model;

[0037] Exponentially weight and fuse the current gradient with the first moment of the previous iteration to obtain the first moment of this iteration;

[0038] Exponentially weight and fuse the square of the current gradient with the second moment of the previous iteration to obtain the second moment of this iteration;

[0039] Perform bias correction on the first moment and the second moment of this iteration;

[0040] Solve for the update amount through the bias-corrected first moment, second moment, and weight decay term, and subtract the update amount from the agricultural environment state index prediction model parameters with the learning rate as the step size to obtain the new agricultural environment state index prediction model parameters;

[0041] Repeat the above process until the maximum number of iterations is reached to complete the training of the agricultural environment state index prediction model.

[0042] Optionally, the agricultural environment state index prediction model specifically aims to optimize the overall coordination of the farmland environment parameters, and its calculation formula is:

[0043]

[0044] where, is the objective function, K is the total number of farmland environment parameters, is the predicted value of the agricultural environment state index prediction model for the k-th farmland environment parameter, is the agronomic ideal value of the k-th farmland environment parameter, is the allowable deviation range of the k-th farmland environment parameter, is the sensitivity coefficient, is the weight coefficient, is the balance term strength coefficient, is the co-variation tolerance threshold between the i-th and j-th farmland environment parameters, is the predicted value of the agricultural environment state index prediction model for the i-th farmland environment parameter, is the predicted value of the agricultural environment state index prediction model for the j-th farmland environment parameter.

[0045] Optionally, the calculation steps of the objective function of the agricultural environment state index prediction model are:

[0046] For each farmland environment parameter, calculate the matching degree of the predicted value of the k-th farmland environment parameter based on the agronomic ideal value and the allowable deviation range of the farmland environment parameter;

[0047] For different farmland environmental parameters, compare the relative magnitudes of the differences in the predicted values of the farmland environmental parameters with respect to the co-variation tolerance threshold, and form a cross-index balance term by accumulating all the differences and applying a balance term intensity coefficient;

[0048] Multiply the product of the matching degrees of all the farmland environmental parameters by the cross-index balance term to obtain the objective function of the agricultural environmental state index prediction model.

[0049] An intelligent agricultural environment regulation system based on a cloud platform, comprising:

[0050] A collection unit that collects farmland environmental parameters and crop image data through multi-source sensors;

[0051] An edge computing unit that filters the farmland environmental parameters and crop image data;

[0052] A first processing unit that normalizes and cleans outliers of the farmland environmental parameters, denoises and enhances the crop image data, and extracts time-domain and space-domain features;

[0053] A second processing unit that constructs an agricultural environmental state index prediction model based on a multi-head self-attention encoder and completes the training of the agricultural environmental state index prediction model through historical time-domain and space-domain features extracted from historical data;

[0054] An execution unit that performs online processing on the real-time input time-domain and space-domain features through the trained agricultural environmental state index prediction model, generates control instructions according to the prediction results, and issues them to irrigation and temperature control devices through the Internet of Things protocol to perform operations, completing the precise and intelligent regulation of the agricultural environment.

[0055] The technical solution of the present invention has at least the following advantages and beneficial effects:

[0056] The present invention significantly optimizes the agricultural environment regulation effect through multi-modal data fusion and adaptive modeling. On the one hand, based on the dynamic filtering mechanism of the edge computing node and the cloud normalization cleaning process, the noise interference of multi-source data is effectively reduced, and the data representation ability is enhanced by combining time-domain - space-domain feature extraction. On the other hand, introducing a multi-head self-attention encoder to construct a prediction model can not only capture the cross-modal associations between environmental parameters and crop images, but also dynamically weight key features through the self-attention mechanism, improving the prediction accuracy in complex farmland scenarios. In addition, a multi-index balance optimization strategy is incorporated into the objective function to drive the model to take into account the co-variation of key environmental parameters while predicting the crop health, so that the generated regulation instructions not only meet the real-time needs of the crops, but also avoid conflicts and redundancies in equipment operations. Finally, through the real-time linkage of the cloud service API and the Internet of Things protocol, precise and intelligent regulation with second-level response is achieved. Description of the Drawings

[0057] Figure 1 Schematic flow chart of the intelligent agricultural environment regulation method based on the cloud platform provided by the present invention;

[0058] Figure 2 Schematic diagram of the principle of the intelligent agricultural environment regulation system based on the cloud platform provided by the present invention. Detailed implementation manners

[0059] To make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below with reference to the accompanying drawings in the present invention. Obviously, what is described is a part rather than all of the present invention. Usually, the components of the present invention described and illustrated in the accompanying drawings here can be arranged and designed in various different configurations.

[0060] Refer to Figure 1 as shown, Figure 1 Schematic flow chart of the intelligent agricultural environment regulation method based on the cloud platform provided by the present invention.

[0061] In one embodiment, for the intelligent agricultural environment regulation method based on the cloud platform, the steps of the method include:

[0062] Collect farmland environment parameters and crop image data through multi-source sensors, and transmit them to the cloud platform after being filtered by the edge computing node;

[0063] Normalize the farmland environment parameters and clean the outliers, denoise and enhance the crop image data, and extract time-domain and space-domain features;

[0064] Construct a prediction model for agricultural environment state indicators based on a multi-head self-attention encoder, and complete the training of the prediction model for agricultural environment state indicators through the historical time-domain and space-domain features extracted from historical data;

[0065] Deploy the trained prediction model for agricultural environment state indicators as a cloud service API, perform online processing on the real-time input time-domain and space-domain features, generate control instructions according to the prediction results, and send them to the irrigation and temperature control devices through the Internet of Things protocol to execute operations, so as to complete the precise and intelligent regulation of the agricultural environment.

[0066] In this embodiment, environmental parameters such as soil humidity, temperature, and light intensity, as well as crop image data, are obtained by deploying multi-source sensors in the farmland area. The edge computing nodes are used to filter abnormal or duplicate data in real time and then transmit it to the cloud platform. In the cloud, the environmental parameters are normalized and outlier-cleaned, the crop image data is denoised and enhanced, and time-domain and spatial-domain features are extracted to fully explore the complex correlations between the farmland environment and crop growth. The multi-head self-attention encoder is used to encode the processed comprehensive spatio-temporal features. With the help of the multi-head attention mechanism, the context information in different subspaces is captured in parallel, and it is added element-wise to the preset embedding vector and then input into the multi-layer feed-forward network. Finally, the prediction result is output through linear mapping. During the model training process based on historical data, optimization algorithms such as AdamW are used to iteratively update the model parameters and the output layer. By calculating the loss against the true labels, the weights and bias terms are continuously corrected, enabling the model to accurately predict the farmland environment state and crop health. After training, the agricultural environment state index prediction model is deployed as a cloud service API, which receives inputs from multi-source sensors and crop images in real time, performs online inference on them, and generates corresponding control instructions according to the prediction results. These control instructions can be sent to irrigation and temperature control devices through the Internet of Things protocol to automatically adjust key environmental factors, reduce resource waste, and provide the best growth conditions, realizing precise and intelligent control of the farmland environment. This method can significantly improve the response speed and control accuracy of environmental factors in modern agricultural production, helping agricultural practitioners to grasp the crop growth dynamics in real time and make scientific decisions, thereby increasing the yield and quality and promoting the sustainable development of agricultural production.

[0067] Based on the above implementation, the edge computing node is specifically:

[0068] According to the farmland scale and network topology, local edge computing gateways are configured for areas where the sensors reach the set density and are sensitive to communication delay;

[0069] Separate independent edge computing nodes are set for the remaining areas;

[0070] The cloud platform is interconnected with the local edge computing gateways and independent edge computing nodes through the Internet;

[0071] The local edge computing gateways and independent edge computing nodes perform data exchange through a distributed message queue.

[0072] In implementation, according to the farmland area and the sensor installation density, this embodiment configures a local edge computing gateway for areas where the number of sensors reaches the set threshold and is sensitive to communication latency, ensuring timely processing and quick response of key data; for the remaining areas, independent edge computing nodes are set up to undertake computing tasks such as digital filtering and data aggregation in a decentralized manner. The cloud platform is interconnected with the local edge computing gateway and each independent edge computing node through the Internet. All edge nodes perform data exchange using a distributed message queue, thereby providing more robust off-site data synchronization and fault tolerance capabilities. On this basis, environmental parameters such as soil humidity, temperature, and light intensity, as well as crop image data collected by the sensors, will first be preliminarily cleaned and filtered on the corresponding edge side, and then uploaded to the cloud platform for unified management and storage, laying a foundation for subsequent model training and online inference.

[0073] In further implementation, the data exchange performed through the distributed message queue is specifically as follows:

[0074] Each edge computing node packs the multi-source sensor data collected according to the timestamp and writes it into the message queue;

[0075] When other edge computing nodes subscribe to a new message, alignment and deduplication are performed through the timestamp and sequence number carried in the message body;

[0076] Determine whether a network abnormal event has occurred. If not, return to the previous step; if so, until the network recovers, each edge computing node replays the unprocessed messages to make up for the missing data and restore the chronological order, where the abnormal event includes network fluctuations or interruptions.

[0077] Specifically, each edge computing node is connected to on-site sensors and is responsible for collecting basic data such as soil humidity, environmental temperature, and light intensity, as well as information such as crop images from cameras. When an edge computing node obtains new sensor data, it generates a timestamp based on the collection time or reception time of the data and assigns a unique sequence number. The node packs the multi-source data into the distributed message queue in timestamp order. In this way, other edge computing nodes that have subscribed to this message queue can receive the data. When a node subscribes to a new message, alignment and deduplication are performed through the timestamp and sequence number carried in the message body to ensure that each node has a consistent understanding of the same sensor data at the same moment and can avoid data redundancy caused by repeated reception.

[0078] During operation, it is necessary to monitor network connectivity. When it is determined that the network is normal, the edge computing nodes continuously publish and subscribe to data normally according to the above process; if it is determined that abnormal events such as network fluctuations or interruptions occur, to prevent data loss, each node will temporarily stop normal external pushing and record the data packets that have not been completed for alignment. Until the network is restored, the nodes with data gaps can request other nodes to replay the unprocessed historical messages to make up for the missing content and restore temporal consistency in chronological order. This distributed data exchange and anomaly recovery mechanism based on message queues can effectively reduce the risk of data loss caused by network failures in large-scale farmland monitoring, and ensure that cloud services such as model training and online prediction continuously obtain complete spatio-temporal correlation information, so as to support the stable and precise control of the agricultural production environment.

[0079] In this embodiment, the extraction of temporal and spatial features is specifically as follows:

[0080] For the farmland environmental parameters: after normalization and outlier cleaning, perform short-time Fourier transform on the farmland environmental parameters through a sliding time window to obtain the temporal features of the farmland environmental parameters, and construct an adjacency matrix based on the sensor deployment coordinates to derive the spatial features of the farmland environmental parameters;

[0081] For the crop image data: after denoising and enhancement processing, obtain the sequence change according to the acquisition timestamp of the crop image data, which is characterized as the temporal feature of the crop image data, and analyze the pixel distribution of the crop image data to extract the spatial feature of the crop image data;

[0082] Weightedly fuse the temporal and spatial features of the farmland environmental parameters and the crop image data according to the acquisition time, sensor, and image position, and output a comprehensive spatio-temporal feature vector.

[0083] In this embodiment, for the farmland environmental parameters, after normalization and outlier cleaning are completed, short-time Fourier transform (STFT) is performed on them through a sliding time window to capture the frequency-domain changes of the environmental parameters in different time periods, so as to extract the time-domain features. At the same time, an adjacency matrix is constructed according to the deployment coordinates of the sensors to represent the spatial distribution relationship and distance weight between the sensors, effectively reflecting the spatial correlation degree and influence range of the environmental parameters, and forming the spatial domain features of the environmental parameters. After denoising and enhancement processing of the crop image data, in this embodiment, an image sequence is constructed according to the acquisition timestamp of the image and converted into time-domain features that can characterize the dynamic growth and changes of the crops; at the same time, the pixel distribution of the image is analyzed, and the spatial domain features of the crop image data are extracted by means of color distribution, texture features, regional differences, etc. to reveal key information such as crop appearance changes and leaf features. The time-domain and spatial domain features of the obtained farmland environmental parameters and the time-domain and spatial domain features of the crop image data are weighted and fused according to the acquisition time and the location of the sensor or the image to generate a comprehensive spatio-temporal feature vector.

[0084] In the specific application of this embodiment, the agricultural environment state index prediction model constructed based on the multi-head self-attention encoder is specifically as follows:

[0085] The comprehensive spatio-temporal feature vector is represented as the first tensor and input into the next step;

[0086] The comprehensive spatio-temporal feature vector is divided into multiple subspaces, and the attention scores among the query vector, key vector, and value vector are calculated within each subspace. The attention outputs of each subspace are concatenated in parallel to obtain the second tensor;

[0087] The second tensor is added element-wise to a preset embedding vector to obtain the third tensor;

[0088] The third tensor is input into a feed-forward network composed of a multi-layer fully connected network and a non-linear activation function. After calculation, the fourth tensor is output;

[0089] The fourth tensor is mapped to the target output dimension through a linear mapping, and the predicted value of the crop health score is output.

[0090] Specifically, the agricultural environment state index prediction model in this embodiment is mainly composed of the following core structures: a multi-head self-attention module, an embedded vector fusion module, a multi-layer feed-forward network, and a final linear mapping output layer. The "comprehensive spatio-temporal feature vector" obtained after normalization, denoising, and enhancement processing is regarded as the first tensor and input into the multi-head self-attention encoder. The comprehensive spatio-temporal feature vector contains temporal features and spatial features extracted from farmland environmental parameters and crop image sequences. To facilitate the model to process this information in parallel, the first tensor is first split into multiple sub-spaces in the channel or feature dimension. Then, the attention scores between the query vector (Q), key vector (K), and value vector (V) are calculated separately within each sub-space, and the attention results of each sub-space are concatenated in parallel to obtain the second tensor. The multi-head attention mechanism can capture the potential interaction relationships between farmland environmental parameters and crop image features from different perspectives within the same layer, avoiding information loss or over-concentration in a single attention channel. The second tensor is added element-wise to the embedded vector preset in the agricultural environment state index prediction model to obtain the third tensor; this embedded vector usually contains position encoding and feature mapping of the input data in the spatial, temporal, or other dimensions. By continuously adding this embedded vector in the data processing flow, the model's recognition ability for different spatio-temporal positions can be further enhanced. Immediately afterwards, the third tensor is fed into a feed-forward network composed of multiple fully connected layers and non-linear activation functions (such as ReLU, GELU, etc.). During this process, high-order abstraction and screening of multi-source fusion features are completed, and the fourth tensor is output. The fourth tensor is projected to the target dimension through linear mapping to obtain the final predicted value of the crop health score. This output represents a specific measurement of the agricultural environment state index or crop health, and can be directly used to guide the next step of environmental regulation and management. Through the cooperation of the multi-head self-attention and the feed-forward network in this embodiment, the agricultural environment state index prediction model can comprehensively utilize the multi-source features of the farmland environment and crop images, make more targeted and accurate predictions in complex spatio-temporal interactions, and provide efficient and stable technical support for intelligent agricultural production.

[0091] Further, the training of the agricultural environment state index prediction model is completed by extracting historical temporal and spatial features from historical data, specifically:

[0092] Extract the historical comprehensive spatio-temporal feature vector and the corresponding crop health score label from the historical data to form the input tensor and the target label;

[0093] The input tensor is passed layer by layer to the agricultural environment state index prediction model to output the predicted score;

[0094] Compare the predicted score with the target label and calculate the loss value through the mean square error;

[0095] Iteratively update the parameters, embedding vectors, weights, and bias terms of the output layer of the agricultural environment status index prediction model through the AdamW optimization algorithm;

[0096] After reaching the maximum number of iterations, complete the training of the agricultural environment status index prediction model.

[0097] The iterative update of the parameters, embedding vectors, weights, and bias terms of the output layer of the agricultural environment status index prediction model through the AdamW optimization algorithm is specifically as follows:

[0098] Obtain the gradient corresponding to the parameters of the agricultural environment status index prediction model;

[0099] Exponentially weighted fuse the current gradient with the first moment of the previous iteration to obtain the first moment of this iteration;

[0100] Exponentially weighted fuse the square of the current gradient with the second moment of the previous iteration to obtain the second moment of this iteration;

[0101] Perform bias correction on the first moment and the second moment of this iteration;

[0102] Solve for the update amount through the bias-corrected first moment, second moment, and weight decay term, and subtract the update amount from the parameters of the agricultural environment status index prediction model with the learning rate as the step size to obtain the new parameters of the agricultural environment status index prediction model;

[0103] Repeat the above process until the maximum number of iterations is reached to complete the training of the agricultural environment status index prediction model.

[0104] Before the start of training, a large number of historical samples that can reflect the dynamic changes of farmland are selected from the historical database, and the comprehensive spatio-temporal feature vectors corresponding to each moment are extracted. At the same time, the crop health scores obtained through real measurements or annotations are collected as target labels. These historical comprehensive spatio-temporal feature vectors are constructed into an input tensor, and the corresponding crop health score labels are used as target labels, and are input into the agricultural environmental state index prediction model together to complete the following steps: The input tensor is passed layer by layer to the agricultural environmental state index prediction model, and the predicted score is output. The predicted score is compared with the target label, and the loss value is calculated through the Mean Squared Error (MSE) to measure the deviation between the model prediction result and the true value. Perform backpropagation on the loss value to obtain the gradient corresponding to the parameters of the agricultural environmental state index prediction model; perform exponential weighted fusion on the current gradient and the first moment of the previous iteration to obtain the first moment of this iteration; and perform exponential weighted fusion on the square of the current gradient and the second moment of the previous iteration to obtain the second moment of this iteration. After obtaining the first moment and the second moment, perform bias correction on them to compensate for the underestimation problem caused by the exponential weighted average in the early iteration stage. The update amount of the parameters is calculated jointly through the first moment, the second moment after bias correction, and the preset weight decay term. This weight decay makes the model parameters moderately regularized during training and suppresses overfitting. In this embodiment, the learning rate is used as the step size, and the above update amount is subtracted from the current model parameters to obtain new model parameters, completing one iteration process. Repeat the above processes of forward propagation, loss calculation, and AdamW parameter update. As the iteration progresses, the prediction error of the model gradually decreases and gradually converges on the historical data. When the preset maximum number of iterations is reached, or the performance index on the validation set meets the requirements, the training process is stopped, and at this time, the training of the agricultural environmental state index prediction model is completed.

[0105] In this embodiment, the agricultural environmental state index prediction model specifically aims to optimize the overall coordination of farmland environmental parameters, and its calculation formula is:

[0106]

[0107] Among them, is the objective function, K is the total number of farmland environmental parameters, is the predicted value of the agricultural environmental state index prediction model for the kth farmland environmental parameter, is the agronomic ideal value of the kth farmland environmental parameter, is the allowable deviation range of the kth farmland environmental parameter, is the sensitivity coefficient, is the weight coefficient, is the balance term strength coefficient, is the co - variation tolerance threshold between the farmland environmental parameters i and j, is the predicted value of the agricultural environment status index prediction model for the i - th farmland environmental parameter, is the predicted value of the agricultural environment status index prediction model for the j - th farmland environmental parameter

[0108] In specific implementation, the calculation steps of the objective function are as follows:

[0109] For each farmland environmental parameter, based on the agronomic ideal value and the allowable deviation range of the farmland environmental parameter, calculate the matching degree of the predicted value of the k - th farmland environmental parameter;

[0110] For different farmland environmental parameters, compare the relative magnitude of the difference in the predicted values of the farmland environmental parameters with respect to the co - variation tolerance threshold, and form a cross - index balance term by accumulating all the differences and applying the balance term intensity coefficient;

[0111] Multiply the product of the matching degrees of all farmland environmental parameters by the cross - index balance term to obtain the objective function of the agricultural environment status index prediction model.

[0112] Refer to Figure 2 as shown Figure 2 is the schematic diagram of the principle of the agricultural environment intelligent regulation system based on the cloud platform provided by the present invention.

[0113] In one embodiment, the agricultural environment intelligent regulation system based on the cloud platform includes:

[0114] A collection unit that collects farmland environmental parameters and crop image data through multi - source sensors;

[0115] An edge computing unit that filters the farmland environmental parameters and crop image data;

[0116] A first processing unit that normalizes and cleans outliers of the farmland environmental parameters, denoises and enhances the crop image data, and extracts time - domain and space - domain features;

[0117] A second processing unit that constructs an agricultural environment status index prediction model based on a multi - head self - attention encoder and completes the training of the agricultural environment status index prediction model through historical time - domain and space - domain features extracted from historical data;

[0118] An execution unit that performs online processing on the real - time input time - domain and space - domain features through the trained agricultural environment status index prediction model, generates control instructions according to the prediction results, and issues them to irrigation and temperature control devices through the Internet of Things protocol to perform operations, completing the precise intelligent regulation of the agricultural environment.

[0119] It can be understood that the intelligent agricultural environment regulation system based on the cloud platform provided in this embodiment and the intelligent agricultural environment regulation method based on the cloud platform provided in the above embodiment are based on the same inventive concept. For the more specific working principles of each unit module in the embodiments of the present invention, reference is made to the above embodiments and will not be elaborated in the embodiments of the present invention.

[0120] The above is only a preference of the present invention and is not used to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. An intelligent regulation method for agricultural environment based on a cloud platform, characterized in that, The steps of the method include: Collecting farmland environmental parameters and crop image data through multi-source sensors, filtering them through edge computing nodes, and then transmitting them to the cloud platform; Normalizing and cleaning outliers of the farmland environmental parameters, denoising and enhancing the crop image data, and extracting time-domain and spatial-domain features; Constructing a prediction model for agricultural environmental state indicators based on a multi-head self-attention encoder, and training the prediction model for agricultural environmental state indicators with historical time-domain and spatial-domain features extracted from historical data; Deploying the trained prediction model for agricultural environmental state indicators as a cloud service API, performing online processing on the real-time input time-domain and spatial-domain features, generating control instructions according to the prediction results, and sending them to irrigation and temperature control devices through the Internet of Things protocol to execute operations, thus completing the precise and intelligent regulation of the agricultural environment; The prediction model for agricultural environmental state indicators specifically takes optimizing the overall coordination of farmland environmental parameters as the optimization goal, and its calculation formula is: Among them, is the objective function, K is the total number of farmland environmental parameters, is the predicted value of the agricultural environmental state index prediction model for the k-th farmland environmental parameter, is the agronomic ideal value of the k-th farmland environmental parameter, is the allowable deviation range of the k-th farmland environmental parameter, is the sensitivity coefficient, is the weight coefficient, is the balance term intensity coefficient, is the co-variation tolerance threshold between the i-th and j-th farmland environmental parameters, is the predicted value of the agricultural environmental state index prediction model for the i-th farmland environmental parameter, is the predicted value of the agricultural environmental state index prediction model for the j-th farmland environmental parameter.

2. The intelligent agricultural environment regulation method based on a cloud platform according to claim 1, wherein, The edge computing node is specifically: According to the farmland scale and network topology, configuring a local edge computing gateway in areas where the sensors reach the set density and are sensitive to communication delays; Setting up independent edge computing nodes in the remaining areas respectively; The cloud platform is interconnected with the local edge computing gateway and independent edge computing nodes through the Internet; The local edge computing gateway and independent edge computing nodes perform data exchange through a distributed message queue.

3. The intelligent agricultural environment regulation method based on a cloud platform according to claim 2, characterized in that The data exchange through the distributed message queue is specifically: Each edge computing node packs the multi-source sensor data collected according to the timestamp and writes it into the message queue; When other edge computing nodes subscribe to new messages, they perform alignment and deduplication through the timestamp and sequence number carried in the message body; Determine whether an abnormal event has occurred in the network. If not, return to the previous step; If so, until the network recovers, each edge computing node replays the unprocessed messages to make up for the missing data and restore the time sequence order, where the abnormal events include network fluctuations or interruptions.

4. The intelligent agricultural environment regulation method based on a cloud platform according to claim 3, characterized in that The extraction of time-domain and spatial-domain features is specifically: For the farmland environmental parameters: after completing normalization and outlier cleaning, perform short-time Fourier transform on the farmland environmental parameters through a sliding time window to obtain the time-domain features of the farmland environmental parameters, and construct an adjacency matrix according to the sensor deployment coordinates to represent the spatial distribution relationship and distance weight between sensors, so as to derive the spatial-domain features of the farmland environmental parameters; For the crop image data: after completing denoising and enhancement processing, obtain the sequence change according to the acquisition timestamp of the crop image data, which is characterized as the time-domain feature of the crop image data, and analyze the pixel distribution of the crop image data to extract the spatial-domain feature of the crop image data; Perform weighted fusion on the time-domain and spatial-domain features of the farmland environmental parameters and crop image data according to the acquisition time, sensor, and image position, and output a comprehensive spatio-temporal feature vector.

5. The intelligent agricultural environment regulation method based on a cloud platform according to claim 4, wherein, The construction of the prediction model for agricultural environmental state indicators based on a multi-head self-attention encoder is specifically: Characterize the comprehensive spatio-temporal feature vector as the first tensor and input it into the next step; The comprehensive spatio-temporal feature vector is divided into multiple subspaces, and the attention scores among the query vector, key vector, and value vector are calculated within each subspace. The attention outputs of each subspace are concatenated in parallel to obtain a second tensor; The second tensor is added element-wise to a preset embedding vector to obtain a third tensor; The third tensor is input into a feed-forward network composed of multiple fully-connected layers and non-linear activation functions. After calculation, a fourth tensor is output; The fourth tensor is mapped to the target output dimension through a linear mapping, and the predicted value of the crop health score is output.

6. The intelligent agricultural environment regulation method based on a cloud platform according to claim 5, characterized in that, The training of the agricultural environment status index prediction model is completed by extracting historical temporal and spatial features from historical data, specifically: Extract historical comprehensive spatio-temporal feature vectors and corresponding crop health score labels from historical data to form an input tensor and a target label; The input tensor is passed layer by layer to the agricultural environment status index prediction model, and a predicted score is output; The predicted score is compared with the target label, and the loss value is calculated through the mean square error; The parameters of the agricultural environment status index prediction model, the embedding vector, and the weights and bias terms of the output layer are iteratively updated through the AdamW optimization algorithm; After reaching the maximum number of iterations, the training of the agricultural environment status index prediction model is completed.

7. The intelligent agricultural environment regulation method based on a cloud platform according to claim 6, characterized in that, The iterative update of the parameters of the agricultural environment status index prediction model, the embedding vector, and the weights and bias terms of the output layer through the AdamW optimization algorithm is specifically: Obtain the gradient corresponding to the parameters of the agricultural environment status index prediction model; Exponentially weighted fuse the current gradient with the first moment of the previous iteration to obtain the first moment of this iteration; Exponentially weighted fuse the square of the current gradient with the second moment of the previous iteration to obtain the second moment of this iteration; Perform bias correction on the first moment and the second moment of this iteration; Solve the update amount through the first moment, second moment, and weight decay term after bias correction, and subtract the update amount from the parameters of the agricultural environment status index prediction model with the learning rate as the step size to obtain new parameters of the agricultural environment status index prediction model; Repeat the above process until the maximum number of iterations is reached or the performance index meets the requirements, and then complete the training of the agricultural environment status index prediction model.

8. The intelligent agricultural environment regulation method based on a cloud platform according to claim 7, characterized in that For the agricultural environment status index prediction model, the calculation steps of the objective function are: For each farmland environment parameter, based on the agronomic ideal value and the allowable deviation range of the farmland environment parameter, calculate the matching degree of the predicted value of the k-th farmland environment parameter; For different farmland environment parameters, compare the relative magnitudes of the differences in the predicted values of the farmland environment parameters with respect to the co-variation tolerance threshold, and form a cross-index balance term by accumulating all the differences and applying the balance term intensity coefficient; Multiply the product of the matching degrees of all farmland environment parameters by the cross-index balance term to obtain the objective function of the agricultural environment status index prediction model.

9. An intelligent agricultural environment control system based on a cloud platform, characterized in that, Including: A collection unit that collects farmland environment parameters and crop image data through multi-source sensors; An edge computing unit that filters the farmland environment parameters and crop image data; The first processing unit normalizes and cleans outliers from farmland environmental parameters, denoises and enhances crop image data, and extracts time-domain and spatial-domain features; The second processing unit constructs a prediction model for agricultural environment state indicators based on a multi-head self-attention encoder, and completes the training of the prediction model for agricultural environment state indicators through historical time-domain and spatial-domain features extracted from historical data; The execution unit performs online processing on the real-time input time-domain and spatial-domain features through the trained prediction model for agricultural environment state indicators, generates control instructions according to the prediction results, and issues them to irrigation and temperature control devices through the Internet of Things protocol to perform operations, completing the precise and intelligent regulation of the agricultural environment; The prediction model for agricultural environment state indicators specifically aims to optimize the overall coordination of farmland environmental parameters, and its calculation formula is: Among them, is the objective function, K is the total number of farmland environmental parameters, is the predicted value of the agricultural environmental state index prediction model for the k-th farmland environmental parameter, is the agronomic ideal value of the k-th farmland environmental parameter, is the allowable deviation range of the k-th farmland environmental parameter, is the sensitivity coefficient, is the weight coefficient, is the balance term intensity coefficient, is the co-variation tolerance threshold between the i-th and j-th farmland environmental parameters, is the predicted value of the agricultural environmental state index prediction model for the i-th farmland environmental parameter, is the predicted value of the agricultural environmental state index prediction model for the j-th farmland environmental parameter.

Citation Information

Patent Citations

  • Method for predicting intention of traffic participant

    CN116665147A

  • Agricultural production monitoring system and method based on multi-source data analysis

    CN118968421A