Tea garden drought monitoring data management method and system
By constructing a multimodal tea garden drought prediction model and hybrid encryption technology, the problem of insufficient security of the tea garden drought monitoring system was solved, efficient and secure data management and accurate prediction were achieved, and the security and reliability of the system were improved.
Patent Information
- Application Number
- CN202510782200.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-12
- Publication Date
- 2025-09-23
AI Technical Summary
The existing tea garden drought monitoring system has insufficient security issues in the data transmission and storage process, including the key encryption mechanism is vulnerable to attacks, lack of data integrity verification, and model parameters are vulnerable to reverse engineering attacks, resulting in a decrease in the security and accuracy of monitoring data management.
A tea garden drought prediction model is constructed using a multimodal feature extraction layer, feature fusion layer, soil entropy prediction layer, and drought mapping output layer. Containerization technology and the HSM deployment model are combined, and the TLS protocol is used to encrypt data transmission. SM4, AES-256-CBC, ChaCha20, and RSA hybrid encryption are used, combined with RC6 and SM9 algorithms to encrypt and store data. Distributed backup is performed, and multiple security measures are set for data management.
It improves the security and accuracy of tea garden drought monitoring data management, prevents data from being maliciously modified, ensures data integrity and transmission security, enhances the robustness and reliability of the model, and supports efficient data management and decision support.
Smart Images

Figure CN120688087A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of smart agricultural technology, and in particular to a tea garden drought monitoring data management method and system. Background Art
[0002] Drought will have a significant impact on the growth, physiological metabolism, tea quality and yield of tea trees. Drought stress will at least have the following effects on tea trees: 1. It will cause the tea leaves to become smaller and thinner, the leaf length and width to shorten, the number of leaves to decrease, and the plants to become dwarfed; 2. It will increase the number of lateral roots of tea trees, but the overall development of the root system will be restricted, the root hairs will dry up and die, and the absorption capacity will decrease; 3. Long-term drought will cause the growth and development of tea trees to stagnate, the new shoots to grow slowly, the buds and leaves to shrink, and even die; 4. It will inhibit the photosynthesis of tea trees, resulting in a decrease in the photosynthetic rate; 5. It will lead to changes in the content of quality components such as caffeine, amino acids, and tea polyphenols in tea.
[0003] Faced with these severe challenges, building an accurate tea garden drought monitoring and early warning system has become a core requirement for modern tea garden management. Current mainstream systems typically employ a three-layer architecture: perception layer, transmission layer, and application layer. These systems deploy a variety of sensors, using a hybrid LoRa / ZigBee network to collect minute-by-minute data, which is then uploaded to a cloud-based analysis platform via 4G / 5G channels. However, practitioners in this field have discovered that existing technologies suffer from serious security shortcomings:
[0004] Traditional RSA or AES single-key encryption mechanisms face three threats during data transmission: First, the storage of pre-shared keys across distributed nodes presents the risk of side-channel attacks, with a MITM attack success rate of up to 32%. Second, the fixed format of encrypted data packets results in a chosen-plaintext attack (CPA) success rate exceeding 40%. Third, the development of quantum computing has reduced the cracking time of a 2048-bit RSA key to 72 hours. Even more critical, existing systems lack effective data integrity verification mechanisms.
[0005] At the data storage level, centralized cloud storage architectures present a single point of failure. Penetration tests of major cloud service providers revealed unauthorized access vulnerabilities in the role-based access control (RBAC) permission management system, with an 18% probability of attackers obtaining the original key through privilege escalation.
[0006] In particular, the parameter storage of existing drought prediction models lacks effective protection. Through reverse engineering, attackers can obtain the LSTM neural network weight matrix and then launch adversarial attack samples, reducing prediction accuracy by 45%-60%.
[0007] Therefore, how to provide a tea garden drought monitoring data management method and system to improve the security of tea garden drought monitoring data management has become a technical problem that needs to be solved urgently. Summary of the Invention
[0008] The technical problem to be solved by the present invention is to provide a method and system for managing drought monitoring data in a tea garden, so as to improve the security of drought monitoring data management in a tea garden.
[0009] In a first aspect, the present invention provides a method for managing drought monitoring data in a tea garden, comprising the following steps:
[0010] Step S1: collecting a large amount of historical sensor data from the tea garden through a sensor array, and preprocessing each of the historical sensor data to construct a data set;
[0011] Step S2: creating a tea garden drought prediction model based on the sequentially connected multimodal feature extraction layer, feature fusion layer, soil entropy prediction layer, and drought mapping output layer, and setting a loss function of the tea garden drought prediction model;
[0012] Step S3: training a tea garden drought prediction model using the data set and the loss function, and deploying the trained tea garden drought prediction model to a server using containerization technology and HSM;
[0013] Step S4: setting an upload period, collecting real-time sensor data from the tea garden through the sensor array, pre-processing the real-time sensor data collected during the upload period, encrypting the encrypted sensor data, and uploading it to the server through the TLS protocol;
[0014] Step S5: The server decrypts and verifies the received encrypted sensor data to obtain real-time sensor data;
[0015] Step S6: the server inputs the real-time sensor data into the deployed tea garden drought prediction model to obtain a tea garden drought prediction result, and displays the tea garden drought prediction result on a visualization interface built based on Shiny and DynNom frameworks;
[0016] Step S7: The server encrypts the tea garden drought monitoring data including the real-time sensing data and the tea garden drought prediction result into encrypted monitoring data, and stores the encrypted monitoring data in a pre-created database;
[0017] Step S8: After verifying the received database access request, the server releases the access rights to the database and decrypts the encrypted monitoring data stored in the database to perform online management of the tea garden drought monitoring data.
[0018] Furthermore, the step S1 is specifically as follows:
[0019] A large amount of historical sensor data is collected from the tea garden through a sensor array including humidity sensors, light intensity sensors, temperature sensors, carbon dioxide sensors, air pressure sensors, particulate matter sensors, global solar radiation sensors, pH sensors, salinity sensors, conductivity sensors, rainfall sensors, wind speed and direction sensors, and positioners;
[0020] The historical sensor data at least includes maximum light intensity, average light intensity, sunshine duration, maximum temperature, minimum temperature, average temperature, average daytime temperature, average nighttime temperature, daily temperature difference, maximum air humidity, minimum air humidity, average relative humidity, average daytime air humidity, average nighttime air humidity, maximum carbon dioxide concentration, minimum carbon dioxide concentration, average carbon dioxide concentration, average daytime carbon dioxide concentration, average nighttime carbon dioxide concentration, maximum air pressure value, minimum air pressure value, average air pressure value, average daytime air pressure value, average nighttime air pressure value, air pressure difference, daily average PM2.5, daily average PM10, maximum TBQ global radiation, minimum TBQ global radiation, daily average TBQ global radiation, maximum soil temperature, minimum soil temperature, daily average soil temperature, soil temperature difference, maximum soil pH value, minimum soil pH value, average soil pH value, maximum soil salinity value, minimum soil salinity value, average soil salinity value, maximum soil electrical conductivity, minimum soil electrical conductivity, average soil electrical conductivity, rainfall, wind direction, wind speed, sampling location and sampling time;
[0021] After filling missing values and repairing outliers in each of the historical sensor data, each of the historical sensor data is labeled with soil entropy, drought level, and time segment labels to complete the preprocessing of each of the historical sensor data. A data set is constructed based on the preprocessed historical sensor data, and a sample expansion operation is performed on the data set using an autoregressive model; the time segment label is the month in which the sampling time occurs;
[0022] The missing value filling is based on the K-nearest neighbor filling method; the outlier repair is based on the Z-score algorithm and the K-means clustering algorithm, specifically:
[0023] Perform Z-score normalization on each of the historical sensor data, calculate the Z-score value of each of the historical sensor data after Z-score normalization, and compare the Z-score value with a preset abnormality threshold to screen out abnormal values; cluster the historical sensor data after Z-score normalization using a K-means clustering algorithm to obtain several cluster centers, and repair each abnormal value in turn based on the nearest cluster center.
[0024] Furthermore, in step S2, the multimodal feature extraction layer is constructed based on the meteorological time series encoding module, the soil dynamic encoding module and the spatiotemporal embedding module;
[0025] The meteorological time series encoding module is used to extract time-dependent features from the sensor data through a bidirectional LSTM network; the soil dynamic encoding module is used to extract soil dynamic features from the sensor data through a fully connected network with residual connections; the spatiotemporal embedding module is used to extract spatiotemporal features from the sensor data through an embedding layer;
[0026] The feature fusion layer is used to adjust the weights of time-dependent features, soil dynamic features, and spatiotemporal features through a multi-head attention mechanism, and fuse and output multimodal features through a 1D convolutional layer;
[0027] The soil entropy prediction layer is used to infer multimodal features through gated recurrent units and feature decoupling heads to calculate soil entropy values;
[0028] The drought mapping output layer is used to map the soil entropy value according to the set drought classification rules, and output the tea garden drought prediction results with drought period, drought level and drought location;
[0029] The specific drought classification rules are as follows:
[0030] The quantile of soil entropy value is (75,100], which corresponds to the first-level drought; the quantile is (25,75], which corresponds to the second-level drought; the quantile is (5,25], which corresponds to the third-level drought; the quantile is (0,5], which corresponds to the fourth-level drought;
[0031] The formula of the loss function is:
[0032] L=α·L_soil+β·L_drought+γ·L_reg;
[0033] Among them, L represents the loss value of the loss function; α and β both represent weight coefficients; γ represents the regularization term coefficient; L_soil represents the regression loss of soil entropy prediction, using the mean square error function; L_drought represents the discrete loss of drought level classification, using the cross entropy loss function; L_reg represents the L2 regularization term, which is used to control the complexity of the feature fusion layer weight.
[0034] Furthermore, the step S3 is specifically as follows:
[0035] Using a stratified sampling technique, the dataset is divided into a training set, a validation set, and a test set in a ratio of 8:1:1. The tea garden drought prediction model is trained using the training set. During the training process, the hyperparameters of the tea garden drought prediction model, including at least a learning rate, a batch size, and a number of training rounds, are continuously optimized until the loss function converges or a preset early stopping condition is met;
[0036] The trained tea garden drought prediction model is verified by the validation set to determine whether the prediction accuracy is greater than a preset accuracy threshold. If not, the verification fails and the training set is expanded to continue training. If so, the verification passes, and an ROC curve and a calibration curve are drawn using the test set to test the tea garden drought prediction model.
[0037] Create a root key, pre-set the root key into the HSM of the server, deploy the trained tea garden drought prediction model to the server through containerization technology, obtain the root key from the HSM, perform SHA-256 calculation on the root key to obtain a hash value, intercept the hash value based on preset interception rules to obtain hash interception data, and use the hash interception data as the AES key to encrypt the deployed tea garden drought prediction model.
[0038] Furthermore, the step S4 is specifically as follows:
[0039] Setting an upload cycle, collecting real-time sensor data from preset sampling points in the tea garden through a sensor array, and pre-processing the real-time sensor data collected during the upload cycle by filtering through a bandpass filter;
[0040] Obtain the current timestamp, perform MD5 calculation on the preprocessed real-time sensor data and timestamp to obtain an MD5 value, concatenate the real-time sensor data, timestamp, and MD5 value to obtain first concatenated data, convert the first concatenated data into a byte stream according to UTF-8 encoding, fill the byte stream with random bytes to an integer multiple of 3 in length to obtain padding data, record the padding length, divide the padding data equally into Block_A, Block_B, and Block_C, encrypt Block_A using the SM4 algorithm to obtain Block_A_ciphertext, encrypt Block_B using the AES-256-CBC algorithm to obtain Block_B_ciphertext, encrypt Block_C using the ChaCha20 algorithm to obtain Block_C_ciphertext, and encrypt the ciphertext according to Block_B_ciphertext+Block_C_ciphertext+Block_A_ciphertext. ext to obtain second spliced data, encrypt the second spliced data and the padding length into encrypted sensing data using an RSA algorithm, and upload the encrypted sensing data to a server using a TLS protocol;
[0041] The step S5 is specifically as follows:
[0042] The server receives the encrypted sensor data in real time, decrypts the encrypted sensor data into second spliced data and a padding length using an RSA algorithm, parses the second spliced data based on a splicing order to obtain Block_A_ciphertext, Block_B_ciphertext, and Block_C_ciphertext, decrypts the Block_A_ciphertext using an SM4 algorithm to obtain Block_A, decrypts the Block_B_ciphertext using an AES-256-CBC algorithm to obtain Block_B, and decrypts the Block_C_ciphertext using a ChaCha20 algorithm to obtain Block_C;
[0043] splicing Block_A, Block_B, and Block_C into padding data, removing random bytes from the padding data based on the padding length to obtain a byte stream, performing UTF-8 encoding inverse conversion on the byte stream to obtain first spliced data, and parsing the first spliced data to obtain real-time sensor data, a timestamp, and an MD5 value;
[0044] After performing integrity check on the real-time sensor data and the timestamp using the MD5 value, performing timeliness check using the timestamp;
[0045] The step S6 is specifically as follows:
[0046] After performing the authentication operation, the server obtains a root key from the HSM, performs a SHA-256 calculation on the root key to obtain a hash value, intercepts the hash value based on a preset interception rule to obtain hash interception data, uses the hash interception data as an AES key to decrypt the deployed tea garden drought prediction model, inputs the real-time sensor data into the decrypted tea garden drought prediction model to obtain a tea garden drought prediction result, and displays the tea garden drought prediction result on a visualization interface built based on the Shiny and DynNom frameworks;
[0047] The step S7 is specifically as follows:
[0048] The server encrypts the tea garden drought monitoring data including the real-time sensor data and the tea garden drought prediction results into first-level encrypted data through the RC6 algorithm, converts the first-level encrypted data into hexadecimal data, swaps the numbers 3, 4, and 5 in the hexadecimal data with the letters B, C, and D respectively to obtain second-level encrypted data, encrypts the second-level encrypted data into third-level encrypted data through the SM9 algorithm, shifts each character of the third-level encrypted data 5 bits to the right to obtain encrypted monitoring data, stores the encrypted monitoring data in a pre-created database, and performs distributed backup.
[0049] In a second aspect, the present invention provides a tea garden drought monitoring data management system, comprising the following modules:
[0050] a data set construction module, configured to collect a large amount of historical sensor data from the tea garden through a sensor array, and pre-process each of the historical sensor data to construct a data set;
[0051] A tea garden drought prediction model creation module is used to create a tea garden drought prediction model based on the sequentially connected multimodal feature extraction layer, feature fusion layer, soil entropy prediction layer, and drought mapping output layer, and set the loss function of the tea garden drought prediction model;
[0052] A tea garden drought prediction model deployment module is used to train the tea garden drought prediction model using the data set and loss function, and deploy the trained tea garden drought prediction model to a server using containerization technology and HSM;
[0053] The real-time sensor data collection and upload module is used to set an upload cycle, collect real-time sensor data from the tea garden through the sensor array, pre-process the real-time sensor data collected within the upload cycle, encrypt it into encrypted sensor data, and upload it to the server through the TLS protocol;
[0054] An encrypted sensor data decryption module is used for the server to decrypt and verify the received encrypted sensor data to obtain real-time sensor data;
[0055] A tea garden drought prediction result display module is used for the server to input the real-time sensor data into the deployed tea garden drought prediction model to obtain a tea garden drought prediction result, and display the tea garden drought prediction result on a visualization interface built based on Shiny and DynNom frameworks;
[0056] a tea garden drought monitoring data encryption storage module, configured for the server to encrypt the tea garden drought monitoring data including the real-time sensor data and the tea garden drought prediction result into encrypted monitoring data, and store the encrypted monitoring data in a pre-created database;
[0057] The monitoring data online management module is used for the server to verify the received database access request, release the access rights of the database, decrypt the encrypted monitoring data stored in the database, and manage the tea garden drought monitoring data online.
[0058] Furthermore, the dataset construction module is specifically used to:
[0059] A large amount of historical sensor data is collected from the tea garden through a sensor array including humidity sensors, light intensity sensors, temperature sensors, carbon dioxide sensors, air pressure sensors, particulate matter sensors, global solar radiation sensors, pH sensors, salinity sensors, conductivity sensors, rainfall sensors, wind speed and direction sensors, and positioners;
[0060] The historical sensor data at least includes maximum light intensity, average light intensity, sunshine duration, maximum temperature, minimum temperature, average temperature, average daytime temperature, average nighttime temperature, daily temperature difference, maximum air humidity, minimum air humidity, average relative humidity, average daytime air humidity, average nighttime air humidity, maximum carbon dioxide concentration, minimum carbon dioxide concentration, average carbon dioxide concentration, average daytime carbon dioxide concentration, average nighttime carbon dioxide concentration, maximum air pressure value, minimum air pressure value, average air pressure value, average daytime air pressure value, average nighttime air pressure value, air pressure difference, daily average PM2.5, daily average PM10, maximum TBQ global radiation, minimum TBQ global radiation, daily average TBQ global radiation, maximum soil temperature, minimum soil temperature, daily average soil temperature, soil temperature difference, maximum soil pH value, minimum soil pH value, average soil pH value, maximum soil salinity value, minimum soil salinity value, average soil salinity value, maximum soil electrical conductivity, minimum soil electrical conductivity, average soil electrical conductivity, rainfall, wind direction, wind speed, sampling location and sampling time;
[0061] After filling missing values and repairing outliers in each of the historical sensor data, each of the historical sensor data is labeled with soil entropy, drought level, and time segment labels to complete the preprocessing of each of the historical sensor data. A data set is constructed based on the preprocessed historical sensor data, and a sample expansion operation is performed on the data set using an autoregressive model; the time segment label is the month in which the sampling time occurs;
[0062] The missing value filling is based on the K-nearest neighbor filling method; the outlier repair is based on the Z-score algorithm and the K-means clustering algorithm, specifically:
[0063] Perform Z-score normalization on each of the historical sensor data, calculate the Z-score value of each of the historical sensor data after Z-score normalization, and compare the Z-score value with a preset abnormality threshold to screen out abnormal values; cluster the historical sensor data after Z-score normalization using a K-means clustering algorithm to obtain several cluster centers, and repair each abnormal value in turn based on the nearest cluster center.
[0064] Furthermore, in the tea garden drought prediction model creation module, the multimodal feature extraction layer is constructed based on the meteorological time series coding module, the soil dynamic coding module and the spatiotemporal embedding module;
[0065] The meteorological time series encoding module is used to extract time-dependent features from the sensor data through a bidirectional LSTM network; the soil dynamic encoding module is used to extract soil dynamic features from the sensor data through a fully connected network with residual connections; the spatiotemporal embedding module is used to extract spatiotemporal features from the sensor data through an embedding layer;
[0066] The feature fusion layer is used to adjust the weights of time-dependent features, soil dynamic features, and spatiotemporal features through a multi-head attention mechanism, and fuse and output multimodal features through a 1D convolutional layer;
[0067] The soil entropy prediction layer is used to infer multimodal features through gated recurrent units and feature decoupling heads to calculate soil entropy values;
[0068] The drought mapping output layer is used to map the soil entropy value according to the set drought classification rules, and output the tea garden drought prediction results with drought period, drought level and drought location;
[0069] The specific drought classification rules are as follows:
[0070] The quantile of soil entropy value is (75,100], which corresponds to the first-level drought; the quantile is (25,75], which corresponds to the second-level drought; the quantile is (5,25], which corresponds to the third-level drought; the quantile is (0,5], which corresponds to the fourth-level drought;
[0071] The formula of the loss function is:
[0072] L=α·L_soil+β·L_drought+γ·L_reg;
[0073] Among them, L represents the loss value of the loss function; α and β both represent weight coefficients; γ represents the regularization term coefficient; L_soil represents the regression loss of soil entropy prediction, using the mean square error function; L_drought represents the discrete loss of drought level classification, using the cross entropy loss function; L_reg represents the L2 regularization term, which is used to control the complexity of the feature fusion layer weight.
[0074] Furthermore, the tea garden drought prediction model deployment module is specifically used to:
[0075] Using a stratified sampling technique, the dataset is divided into a training set, a validation set, and a test set in a ratio of 8:1:1. The tea garden drought prediction model is trained using the training set. During the training process, the hyperparameters of the tea garden drought prediction model, including at least a learning rate, a batch size, and a number of training rounds, are continuously optimized until the loss function converges or a preset early stopping condition is met;
[0076] The trained tea garden drought prediction model is verified by the validation set to determine whether the prediction accuracy is greater than a preset accuracy threshold. If not, the verification fails and the training set is expanded to continue training. If so, the verification passes, and an ROC curve and a calibration curve are drawn using the test set to test the tea garden drought prediction model.
[0077] Create a root key, pre-set the root key into the HSM of the server, deploy the trained tea garden drought prediction model to the server through containerization technology, obtain the root key from the HSM, perform SHA-256 calculation on the root key to obtain a hash value, intercept the hash value based on preset interception rules to obtain hash interception data, and use the hash interception data as the AES key to encrypt the deployed tea garden drought prediction model.
[0078] Furthermore, the real-time sensor data collection and upload module is specifically used to:
[0079] Setting an upload cycle, collecting real-time sensor data from preset sampling points in the tea garden through a sensor array, and pre-processing the real-time sensor data collected during the upload cycle by filtering through a bandpass filter;
[0080] Obtain the current timestamp, perform MD5 calculation on the preprocessed real-time sensor data and timestamp to obtain an MD5 value, concatenate the real-time sensor data, timestamp, and MD5 value to obtain first concatenated data, convert the first concatenated data into a byte stream according to UTF-8 encoding, fill the byte stream with random bytes to an integer multiple of 3 in length to obtain padding data, record the padding length, divide the padding data equally into Block_A, Block_B, and Block_C, encrypt Block_A using the SM4 algorithm to obtain Block_A_ciphertext, encrypt Block_B using the AES-256-CBC algorithm to obtain Block_B_ciphertext, encrypt Block_C using the ChaCha20 algorithm to obtain Block_C_ciphertext, and encrypt the ciphertext according to Block_B_ciphertext+Block_C_ciphertext+Block_A_ciphertext. ext to obtain second spliced data, encrypt the second spliced data and the padding length into encrypted sensing data using an RSA algorithm, and upload the encrypted sensing data to a server using a TLS protocol;
[0081] The encrypted sensor data decryption module is specifically used for:
[0082] The server receives the encrypted sensor data in real time, decrypts the encrypted sensor data into second spliced data and a padding length using an RSA algorithm, parses the second spliced data based on a splicing order to obtain Block_A_ciphertext, Block_B_ciphertext, and Block_C_ciphertext, decrypts the Block_A_ciphertext using an SM4 algorithm to obtain Block_A, decrypts the Block_B_ciphertext using an AES-256-CBC algorithm to obtain Block_B, and decrypts the Block_C_ciphertext using a ChaCha20 algorithm to obtain Block_C;
[0083] splicing Block_A, Block_B, and Block_C into padding data, removing random bytes from the padding data based on the padding length to obtain a byte stream, performing UTF-8 encoding inverse conversion on the byte stream to obtain first spliced data, and parsing the first spliced data to obtain real-time sensor data, a timestamp, and an MD5 value;
[0084] After performing integrity check on the real-time sensor data and the timestamp using the MD5 value, performing timeliness check using the timestamp;
[0085] The tea garden drought prediction result display module is specifically used for:
[0086] After performing the authentication operation, the server obtains a root key from the HSM, performs a SHA-256 calculation on the root key to obtain a hash value, intercepts the hash value based on a preset interception rule to obtain hash interception data, uses the hash interception data as an AES key to decrypt the deployed tea garden drought prediction model, inputs the real-time sensor data into the decrypted tea garden drought prediction model to obtain a tea garden drought prediction result, and displays the tea garden drought prediction result on a visualization interface built based on the Shiny and DynNom frameworks;
[0087] The tea garden drought monitoring data encryption storage module is specifically used for:
[0088] The server encrypts the tea garden drought monitoring data including the real-time sensor data and the tea garden drought prediction results into first-level encrypted data through the RC6 algorithm, converts the first-level encrypted data into hexadecimal data, swaps the numbers 3, 4, and 5 in the hexadecimal data with the letters B, C, and D respectively to obtain second-level encrypted data, encrypts the second-level encrypted data into third-level encrypted data through the SM9 algorithm, shifts each character of the third-level encrypted data 5 bits to the right to obtain encrypted monitoring data, stores the encrypted monitoring data in a pre-created database, and performs distributed backup.
[0089] The advantages of the present invention are:
[0090] 1. A large amount of historical sensor data is collected from the tea garden through the sensor array to build a data set; then a tea garden drought prediction model is created based on the sequentially connected multimodal feature extraction layer, feature fusion layer, soil entropy prediction layer, and drought mapping output layer, and the loss function of the tea garden drought prediction model is set. The tea garden drought prediction model is trained through the data set and the loss function, and the trained tea garden drought prediction model is deployed to the server through containerization technology and HSM; then real-time sensor data is collected from the tea garden through the sensor array, and the real-time sensor data collected during the upload period is pre-processed, encrypted into encrypted sensor data, and uploaded to the server through the TLS protocol; the server decrypts the encrypted sensor data to obtain real-time sensor data, and inputs the real-time sensor data into the deployed tea garden drought prediction model to obtain the tea garden drought prediction result, and the tea garden drought prediction result is displayed on a visual display built based on the Shiny and DynNom framework. On the user interface, the tea garden drought monitoring data including the real-time sensor data and the tea garden drought prediction results are encrypted into encrypted monitoring data, and the encrypted monitoring data is stored in a pre-created database; after verifying the received database access request, the server releases the database access rights and decrypts the encrypted monitoring data stored in the database to manage the tea garden drought monitoring data online; that is, in the process of tea garden drought monitoring, multiple security measures are taken in the whole process from the deployment of the tea garden drought prediction model, the uploading of real-time sensor data, the storage of the tea garden drought monitoring data to the online management of the tea garden drought monitoring data, overcoming the defects of the traditional single-key encryption mechanism, and performing distributed backup of the encrypted monitoring data to overcome the single point failure risk of the centralized cloud storage architecture. By encrypting the tea garden drought prediction model, the model parameters can be prevented from being maliciously modified, which ultimately greatly improves the security of the tea garden drought monitoring data management.
[0091] 2. By adopting 13 types of sensors including humidity, light, soil pH, wind speed, etc., covering multi-dimensional data such as meteorology, soil, and environment, a comprehensive monitoring system is formed to ensure the diversity and integrity of data sources.
[0092] 3. By combining the Z-score algorithm to filter outliers and repairing them through K-means clustering centers, data quality is effectively improved; by adopting the K-nearest neighbor filling method, which is better than traditional mean filling, the data distribution characteristics are retained; by labeling soil entropy, drought level and time segment labels, data interpretability is enhanced, which facilitates the model to learn temporal and spatial correlations; by expanding the data set through the autoregressive model, the small sample problem is alleviated and the model generalization ability is improved; using the autoregressive model to generate synthetic data, not only expand the sample size, but also simulate the data distribution under different seasons and weather combinations, enhancing the model's prediction ability for extreme climate events (such as continuous droughts).
[0093] 4. Dynamically adjust the weights of multimodal features through a multi-head attention mechanism, combined with 1D convolution fusion, to solve the problem of feature redundancy and improve the model's ability to represent complex data; dynamically adjust the contribution of meteorological, soil, and spatiotemporal features through attention weights to solve the problem of feature redundancy (for example, temperature and light may be strongly correlated) and improve the model's efficiency in capturing nonlinear relationships.
[0094] 5. By setting the loss function to integrate regression loss (mean square error), classification loss (cross entropy) and L2 regularization term, the prediction accuracy of soil entropy value and the classification accuracy of drought level are taken into account, while the model complexity is controlled to prevent overfitting.
[0095] 6. Use SM4+AES-256-CBC+ChaCha20 hybrid encryption to process data in blocks, combined with RSA encrypted transmission to achieve algorithm diversity defense and resist the risk of a single algorithm being compromised; use the TLS protocol to ensure transport layer security and prevent man-in-the-middle attacks.
[0096] 7. Before the tea garden drought monitoring data is stored, it undergoes four-level processing: RC6 encryption → character replacement → SM9 encryption → cyclic shift, combined with asymmetric encryption and obfuscation technology, which greatly increases the difficulty of data cracking; and data disaster recovery capabilities are ensured through distributed backup.
[0097] 8. By pre-placing the root key in the HSM (Hardware Security Module) and generating the AES key through SHA-256 hash interception, the root key is prevented from being exposed in plain text, meeting financial-grade security standards.
[0098] 9. Build an interactive visualization interface through the Shiny+DynNom framework to display drought forecast results (level, location, time period) in real time, support user-defined parameter input and result interpretation, and improve decision-making efficiency.
[0099] 10. By setting the dataset to be divided into training set, validation set, and test set in an 8:1:1 ratio, combined with automatic hyperparameter tuning (learning rate, batch size, etc.), the robustness of the model is ensured; the model performance is verified through the ROC curve and calibration curve, and the prediction accuracy is scientifically evaluated.
[0100] 11. By setting the upload cycle, the entire process of data collection → preprocessing → encryption → transmission can be automated to reduce manual intervention.
[0101] 12. Set the database access to pass the permission verification and open access after decryption to prevent unauthorized operations.
[0102] 13. By marking the sampling time as a month label, the model can identify seasonal changes (such as rainy season and dry season). Combined with bidirectional LSTM, it can extract long-term time series dependency features and improve the adaptability of drought prediction to climate cycles.
[0103] 14. By introducing a decoupled head in the soil entropy prediction layer, the main features of soil entropy and interference features (such as the masking effect of instantaneous rainfall on long-term drought) are separated, noise interference is reduced, and prediction robustness is improved.
[0104] 15. After data segmentation, SM4 (national encryption), AES-256-CBC (international standard), and ChaCha20 (lightweight) encryption are used respectively, combined with RSA asymmetric encryption to form a multi-algorithm collaborative defense system. Even if a single algorithm is cracked, the overall data remains safe.
[0105] 16. By using a bandpass filter to filter out invalid frequency band noise before uploading real-time data, the amount of redundant data transmission is reduced, the server storage and computing load is reduced, and energy consumption is saved.
[0106] 17. By automatically optimizing parameters such as learning rate and batch size during the training of the tea garden drought prediction model, the waste of resources caused by manual parameter adjustment can be avoided, the model convergence speed can be accelerated, and the consumption of GPU / CPU computing resources can be reduced.
[0107] 18. Double verification of MD5 value and timestamp is used to prevent historical data replay attacks and ensure the freshness and credibility of real-time sensor data.
[0108] 19. Comprehensively collect meteorological, soil and environmental data of tea gardens through multimodal sensor arrays, combine intelligent preprocessing (K-nearest neighbor filling, clustering to repair outliers) and autoregressive sample expansion to build a high-quality data set; based on multimodal feature fusion models (bidirectional LSTM, residual network, multi-head attention) and joint loss functions, accurate soil entropy prediction and dynamic mapping of drought levels are achieved, and hybrid encryption (SM4 / AES-256 / ChaCha20+RSA) and HSM hardware-level key protection are used to ensure the security of the entire data link, and combined with containerized deployment and Shiny visual interaction to improve the usability of the system; at the same time, through bandpass filtering noise reduction and dynamic hyperparameter optimization, resource consumption is reduced, and compatibility with national secret algorithms and distributed storage meets compliance and disaster recovery requirements, with high-precision prediction, strong security protection, low operation and maintenance costs and multi-scenario expansion capabilities, providing smart agriculture with a set of efficient, reliable and feasible drought monitoring and management solutions. BRIEF DESCRIPTION OF THE DRAWINGS
[0109] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0110] Figure 1 The present invention is a flow chart of a tea garden drought monitoring data management method.
[0111] Figure 2The present invention is a structural diagram of a tea garden drought monitoring data management system. DETAILED DESCRIPTION
[0112] The technical solution in the embodiments of the present application has the following overall idea: in the process of tea garden drought monitoring, multiple security measures are adopted in the entire process from tea garden drought prediction model deployment, real-time sensor data upload, tea garden drought monitoring data storage to tea garden drought monitoring data online management, overcoming the defects of the traditional single-key encryption mechanism, and performing distributed backup of the encrypted monitoring data to overcome the single point failure risk of the centralized cloud storage architecture. By encrypting the tea garden drought prediction model, the model parameters can be prevented from being maliciously modified, thereby improving the security of tea garden drought monitoring data management.
[0113] Please refer to Figures 1 to 2 As shown, a preferred embodiment of a tea garden drought monitoring data management method of the present invention includes the following steps:
[0114] Step S1: collecting a large amount of historical sensor data from the tea garden through a sensor array, and preprocessing each of the historical sensor data to construct a data set;
[0115] Step S2: creating a tea garden drought prediction model based on the sequentially connected multimodal feature extraction layer, feature fusion layer, soil entropy prediction layer, and drought mapping output layer, and setting a loss function of the tea garden drought prediction model;
[0116] Step S3: training a tea garden drought prediction model using the data set and the loss function, and deploying the trained tea garden drought prediction model to a server using containerization technology and HSM;
[0117] Step S4: setting an upload period, collecting real-time sensor data from the tea garden through the sensor array, pre-processing the real-time sensor data collected during the upload period, encrypting the encrypted sensor data, and uploading it to the server through the TLS protocol;
[0118] Step S5: The server decrypts and verifies the received encrypted sensor data to obtain real-time sensor data;
[0119] Step S6: the server inputs the real-time sensor data into the deployed tea garden drought prediction model to obtain a tea garden drought prediction result, and displays the tea garden drought prediction result on a visualization interface built based on Shiny and DynNom frameworks;
[0120] Step S7: The server encrypts the tea garden drought monitoring data including the real-time sensing data and the tea garden drought prediction result into encrypted monitoring data, and stores the encrypted monitoring data in a pre-created database;
[0121] Step S8: After verifying the received database access request, the server releases the database access rights and decrypts the encrypted monitoring data stored in the database to manage the tea garden drought monitoring data online. By setting the database access permission verification and opening access after decryption, unauthorized operations are prevented.
[0122] Through a multimodal sensor array, comprehensive meteorological, soil and environmental data from the tea garden are collected. Combined with intelligent preprocessing (K-nearest neighbor filling, clustering to repair outliers) and autoregressive sample expansion, a high-quality dataset is constructed. Based on a multimodal feature fusion model (bidirectional LSTM, residual network, multi-head attention) and a joint loss function, accurate soil entropy prediction and dynamic mapping of drought levels are achieved. Hybrid encryption (SM4 / AES-256 / ChaCha20+RSA) and HSM hardware-level key protection are used to ensure the security of the entire data link. Containerized deployment and Shiny visual interaction are combined to improve the system's usability. At the same time, bandpass filtering for noise reduction and dynamic hyperparameter optimization are used to reduce resource consumption. Compatibility with national secret algorithms and distributed storage meets compliance and disaster recovery requirements. It has high-precision prediction, strong security protection, low operation and maintenance costs, and multi-scenario expansion capabilities, providing smart agriculture with an efficient, reliable, and feasible drought monitoring and management solution.
[0123] The step S1 is specifically as follows:
[0124] A large amount of historical sensor data is collected from the tea garden through a sensor array including humidity sensors, light intensity sensors, temperature sensors, carbon dioxide sensors, air pressure sensors, particulate matter sensors, global solar radiation sensors, pH sensors, salinity sensors, conductivity sensors, rainfall sensors, wind speed and direction sensors, and positioners;
[0125] By adopting 13 types of sensors including humidity, light, soil pH, wind speed, etc., covering multi-dimensional data such as meteorology, soil, and environment, a comprehensive monitoring system is formed to ensure the diversity and integrity of data sources.
[0126] The historical sensor data at least includes maximum light intensity, average light intensity, sunshine duration, maximum temperature, minimum temperature, average temperature, average daytime temperature, average nighttime temperature, daily temperature difference, maximum air humidity, minimum air humidity, average relative humidity, average daytime air humidity, average nighttime air humidity, maximum carbon dioxide concentration, minimum carbon dioxide concentration, average carbon dioxide concentration, average daytime carbon dioxide concentration, average nighttime carbon dioxide concentration, maximum air pressure value, minimum air pressure value, average air pressure value, average daytime air pressure value, average nighttime air pressure value, air pressure difference, daily average PM2.5, daily average PM10, maximum TBQ global radiation, minimum TBQ global radiation, daily average TBQ global radiation, maximum soil temperature, minimum soil temperature, daily average soil temperature, soil temperature difference, maximum soil pH value, minimum soil pH value, average soil pH value, maximum soil salinity value, minimum soil salinity value, average soil salinity value, maximum soil electrical conductivity, minimum soil electrical conductivity, average soil electrical conductivity, rainfall, wind direction, wind speed, sampling location and sampling time;
[0127] After filling missing values and repairing outliers in each of the historical sensor data, each of the historical sensor data is labeled with soil entropy, drought level, and time segment labels to complete the preprocessing of each of the historical sensor data. A data set is constructed based on the preprocessed historical sensor data, and a sample expansion operation is performed on the data set using an autoregressive model; the time segment label is the month in which the sampling time occurs;
[0128] By marking the sampling time as a month label, the model can identify seasonal changes (such as rainy season and dry season), and combine it with bidirectional LSTM to extract long-term time series dependency features, thereby improving the adaptability of drought prediction to climate cycles.
[0129] The missing value filling is based on the K-nearest neighbor filling method; the outlier repair is based on the Z-score algorithm and the K-means clustering algorithm, specifically:
[0130] Perform Z-score normalization on each of the historical sensor data, calculate the Z-score value of each of the historical sensor data after Z-score normalization, and compare the Z-score value with a preset abnormality threshold to screen out abnormal values; cluster the historical sensor data after Z-score normalization using a K-means clustering algorithm to obtain several cluster centers, and repair each abnormal value in turn based on the nearest cluster center.
[0131] By combining the Z-score algorithm to filter outliers and repairing them through K-means clustering centers, data quality is effectively improved; by adopting the K-nearest neighbor filling method, which is better than traditional mean filling, the data distribution characteristics are retained; by labeling soil entropy, drought level and time segment labels, data interpretability is enhanced, facilitating the model to learn temporal and spatial correlations; by expanding the data set through the autoregressive model, the small sample problem is alleviated and the model generalization ability is improved; using the autoregressive model to generate synthetic data, not only expand the sample size, but also simulate the data distribution under different seasons and weather combinations, enhancing the model's prediction ability for extreme climate events (such as continuous droughts).
[0132] In step S2, the multimodal feature extraction layer is constructed based on the meteorological time series encoding module, the soil dynamic encoding module and the spatiotemporal embedding module;
[0133] The meteorological time series encoding module is used to extract time-dependent features (light, temperature and humidity, carbon dioxide, air pressure, PM, radiation, etc.) from the sensor data through a bidirectional LSTM network. The soil dynamic encoding module is used to extract soil dynamic features (temperature, pH, salinity, and conductivity) from the sensor data through a fully connected network with residual connections, introducing residual connections to enhance gradient propagation. The spatiotemporal embedding module is used to extract spatiotemporal features from the sensor data through an embedding layer (mapping longitude and latitude into high-dimensional vectors and decomposing the sampling time into periodic codes of year / month / day / time period).
[0134] The bidirectional LSTM network is used to capture the long-term and short-term temporal dependencies of meteorological factors (such as the cumulative effects of continuous droughts); the residual fully connected network is used to model the dynamic nonlinear relationships of soil parameters (such as the coupled changes in salinity and electrical conductivity); and the spatiotemporal embedding module is used to encode the joint distribution characteristics of spatial position and time (such as the impact of slope aspect on water evaporation).
[0135] The long-term dependence of meteorological parameters such as light and temperature is captured through meteorological time series coding (bidirectional LSTM), the mutation characteristics of soil indicators such as soil pH and salinity are learned through soil dynamic coding (residual FCN), and the joint features of geographic location and timestamp are fused through the spatiotemporal embedding module. That is, the parallel extraction of three types of heterogeneous features fully explores the potential correlation of data, thereby greatly improving the accuracy of tea garden drought prediction.
[0136] By setting the soil dynamic encoding module to adopt a residual fully connected network (instead of a complex CNN), the number of parameters can be reduced while avoiding gradient vanishing; combined with the GRU gated recurrent unit (lighter than LSTM), a balance between high-precision prediction and low computing resources is achieved, and it is suitable for edge computing devices (such as field embedded terminals).
[0137] The feature fusion layer is used to adjust the weights of time-dependent features, soil dynamic features, and spatiotemporal features through a multi-head attention mechanism, and fuse and output multimodal features through a 1D convolutional layer;
[0138] By dynamically adjusting the weights of multimodal features through a multi-head attention mechanism and combining it with 1D convolutional fusion, we can solve the problem of feature redundancy and enhance the model's ability to represent complex data. By dynamically adjusting the contribution of meteorological, soil, and spatiotemporal features through attention weights, we can solve the problem of feature redundancy (e.g., temperature and light may be strongly correlated) and enhance the model's efficiency in capturing nonlinear relationships.
[0139] The soil entropy prediction layer is used to infer multimodal features through a gated recurrent unit (GRU) and a feature decoupling head to calculate the soil entropy value;
[0140] By introducing a decoupled head in the soil entropy prediction layer, the main features of soil entropy are separated from the interference features (such as the masking effect of instantaneous rainfall on long-term drought), reducing noise interference and improving prediction robustness.
[0141] The drought mapping output layer is used to map the soil entropy value according to the set drought classification rules, and output the tea garden drought prediction results with the drought period, drought level and drought location. The drought mapping output layer outputs the probability of drought level (level 1 drought / level 2 drought / level 3 drought / level 4 drought), the probability of drought period, and the probability of drought location through the fully connected layer + Softmax, and introduces temperature scaling technology to calibrate the prediction confidence.
[0142] The specific drought classification rules are as follows:
[0143] The quantile of soil entropy value is (75,100], which corresponds to the first-level drought; the quantile is (25,75], which corresponds to the second-level drought; the quantile is (5,25], which corresponds to the third-level drought; the quantile is (0,5], which corresponds to the fourth-level drought;
[0144] The formula of the loss function is:
[0145] L=α·L_soil+β·L_drought+γ·L_reg;
[0146] Among them, L represents the loss value of the loss function; α and β both represent weight coefficients; γ represents the regularization term coefficient; L_soil represents the regression loss of soil entropy prediction, using the mean square error function; L_drought represents the discrete loss of drought level classification, using the cross entropy loss function; L_reg represents the L2 regularization term, which is used to control the complexity of the feature fusion layer weight.
[0147] By setting the loss function to fuse regression loss (mean square error), classification loss (cross entropy) and L2 regularization term, the prediction accuracy of soil entropy value and the classification accuracy of drought level are taken into account, while the model complexity is controlled to prevent overfitting.
[0148]
[0149] L_reg=||W||2;
[0150] Where N represents the number of samples; Represents the output value of the soil entropy prediction layer (continuous quantity); y_soi l represents the measured soil moisture value (label); y_drought represents the one-hot encoding of the actual drought level; Represents the probability distribution of the output of the drought mapping layer (softmax processing); W represents the parameter matrix of the feature fusion layer.
[0151] The step S3 is specifically as follows:
[0152] The data set is divided into a training set, a validation set, and a test set in a ratio of 8:1:1 using a stratified sampling technique. A tea garden drought prediction model is trained using the training set. During the training process, the hyperparameters of the tea garden drought prediction model, including at least the learning rate, batch size, and number of training rounds, are continuously optimized until the loss function converges or a preset early stopping condition is met. The AdamW optimizer is used during the training process, combined with cosine annealing learning rate scheduling;
[0153] The trained tea garden drought prediction model is verified by the validation set to determine whether the prediction accuracy is greater than a preset accuracy threshold. If not, the verification fails and the training set is expanded to continue training. If so, the verification passes, and an ROC curve and a calibration curve are drawn using the test set to test the tea garden drought prediction model.
[0154] By setting the dataset to be divided into training set, validation set, and test set in an 8:1:1 ratio and combining it with automatic hyperparameter tuning (learning rate, batch size, etc.), the robustness of the model is ensured. The model performance is verified through the ROC curve and calibration curve, and the prediction accuracy is scientifically evaluated.
[0155] By automatically optimizing parameters such as learning rate and batch size during the training of the tea garden drought prediction model, we can avoid the waste of resources caused by manual parameter adjustment, accelerate the model convergence speed, and reduce GPU / CPU computing resource consumption.
[0156] The ROC curve is used to evaluate the discriminative ability of the tea plantation drought prediction model. The area under the ROC curve (AUC) measures the model's efficiency. An ideal model's ROC curve is as close to the upper left corner as possible, indicating a high TPR and a low FPR, demonstrating excellent discriminative ability. The AUC quantifies the model's overall discriminative ability. In statistical analysis, an AUC value greater than 0.7 is considered to indicate excellent discriminative performance. Higher AUC values indicate a stronger model's ability to distinguish between positive and negative classes.
[0157] A calibration curve is a method used to assess the accuracy of a disease risk model in predicting the probability of future occurrence. In the present invention, a calibration curve is used to assess the degree of fit between the drought level changes in a tea garden under different key factor parameters and the actual values.
[0158] Create a root key, pre-set the root key into the HSM of the server, deploy the trained tea garden drought prediction model to the server through containerization technology, obtain the root key from the HSM, perform SHA-256 calculation on the root key to obtain a hash value, intercept the hash value based on preset interception rules to obtain hash interception data, and use the hash interception data as the AES key to encrypt the deployed tea garden drought prediction model.
[0159] By pre-placing the root key in an HSM (hardware security module) and generating an AES key through SHA-256 hash interception, the root key is prevented from being exposed in plain text, meeting financial-grade security standards.
[0160] The step S4 is specifically as follows:
[0161] Setting an upload cycle, collecting real-time sensor data from preset sampling points in the tea garden through a sensor array, and pre-processing the real-time sensor data collected during the upload cycle by filtering through a bandpass filter;
[0162] By setting the upload cycle, the entire process of data collection → preprocessing → encryption → transmission can be automated, reducing manual intervention.
[0163] By using a bandpass filter to filter out invalid frequency band noise before uploading real-time data, the amount of redundant data transmission is reduced, the server storage and computing load is reduced, and energy consumption is saved.
[0164] Obtain the current timestamp, perform MD5 calculation on the preprocessed real-time sensor data and timestamp to obtain an MD5 value, concatenate the real-time sensor data, timestamp, and MD5 value to obtain first concatenated data, convert the first concatenated data into a byte stream according to UTF-8 encoding, fill the byte stream with random bytes to an integer multiple of 3 in length to obtain padding data, record the padding length, divide the padding data equally into Block_A, Block_B, and Block_C, encrypt Block_A using the SM4 algorithm to obtain Block_A_ciphertext, encrypt Block_B using the AES-256-CBC algorithm to obtain Block_B_ciphertext, encrypt Block_C using the ChaCha20 algorithm to obtain Block_C_ciphertext, and encrypt the ciphertext according to Block_B_ciphertext+Block_C_ciphertext+Block_A_ciphertext. ext to obtain second spliced data, encrypt the second spliced data and the padding length into encrypted sensing data using an RSA algorithm, and upload the encrypted sensing data to a server using a TLS protocol;
[0165] SM4+AES-256-CBC+ChaCha20 hybrid encryption is used to process data in blocks, combined with RSA encrypted transmission to achieve algorithm diversity defense and resist the risk of a single algorithm being compromised; the TLS protocol is used to ensure transport layer security and prevent man-in-the-middle attacks.
[0166] By using SM4 (national encryption), AES-256-CBC (international standard), and ChaCha20 (lightweight) encryption after data segmentation, combined with RSA asymmetric encryption, a multi-algorithm collaborative defense system is formed. Even if a single algorithm is cracked, the overall data remains safe.
[0167] Double verification of MD5 value and timestamp is used to prevent historical data replay attacks and ensure the freshness and credibility of real-time sensor data.
[0168] The step S5 is specifically as follows:
[0169] The server receives the encrypted sensor data in real time, decrypts the encrypted sensor data into second spliced data and a padding length using an RSA algorithm, parses the second spliced data based on a splicing order to obtain Block_A_ciphertext, Block_B_ciphertext, and Block_C_ciphertext, decrypts the Block_A_ciphertext using an SM4 algorithm to obtain Block_A, decrypts the Block_B_ciphertext using an AES-256-CBC algorithm to obtain Block_B, and decrypts the Block_C_ciphertext using a ChaCha20 algorithm to obtain Block_C;
[0170] splicing Block_A, Block_B, and Block_C into padding data, removing random bytes from the padding data based on the padding length to obtain a byte stream, performing UTF-8 encoding inverse conversion on the byte stream to obtain first spliced data, and parsing the first spliced data to obtain real-time sensor data, a timestamp, and an MD5 value;
[0171] After performing integrity check on the real-time sensor data and the timestamp using the MD5 value, performing timeliness check using the timestamp;
[0172] The step S6 is specifically as follows:
[0173] After performing the authentication operation, the server obtains a root key from the HSM, performs a SHA-256 calculation on the root key to obtain a hash value, intercepts the hash value based on a preset interception rule to obtain hash interception data, uses the hash interception data as an AES key to decrypt the deployed tea garden drought prediction model, inputs the real-time sensor data into the decrypted tea garden drought prediction model to obtain a tea garden drought prediction result, and displays the tea garden drought prediction result on a visualization interface built based on the Shiny and DynNom frameworks;
[0174] An interactive visualization interface is built through the Shiny+DynNom framework to display drought forecast results (level, location, time period) in real time, support user-defined parameter input and result interpretation, and improve decision-making efficiency.
[0175] The step S7 is specifically as follows:
[0176] The server encrypts the tea garden drought monitoring data including the real-time sensor data and the tea garden drought prediction results into first-level encrypted data through the RC6 algorithm, converts the first-level encrypted data into hexadecimal data, swaps the numbers 3, 4, and 5 in the hexadecimal data with the letters B, C, and D respectively to obtain second-level encrypted data, encrypts the second-level encrypted data into third-level encrypted data through the SM9 algorithm, shifts each character of the third-level encrypted data 5 bits to the right to obtain encrypted monitoring data, stores the encrypted monitoring data in a pre-created database, and performs distributed backup.
[0177] The tea garden drought monitoring data is processed through four levels of RC6 encryption → character replacement → SM9 encryption → cyclic shift before storage, combined with asymmetric encryption and obfuscation technology to greatly increase the difficulty of data cracking; data disaster recovery capabilities are ensured through distributed backup.
[0178] A preferred embodiment of a tea garden drought monitoring data management system of the present invention includes the following modules:
[0179] a data set construction module, configured to collect a large amount of historical sensor data from the tea garden through a sensor array, and pre-process each of the historical sensor data to construct a data set;
[0180] A tea garden drought prediction model creation module is used to create a tea garden drought prediction model based on the sequentially connected multimodal feature extraction layer, feature fusion layer, soil entropy prediction layer, and drought mapping output layer, and set the loss function of the tea garden drought prediction model;
[0181] A tea garden drought prediction model deployment module is used to train the tea garden drought prediction model using the data set and loss function, and deploy the trained tea garden drought prediction model to a server using containerization technology and HSM;
[0182] The real-time sensor data collection and upload module is used to set an upload cycle, collect real-time sensor data from the tea garden through the sensor array, pre-process the real-time sensor data collected within the upload cycle, encrypt it into encrypted sensor data, and upload it to the server through the TLS protocol;
[0183] An encrypted sensor data decryption module is used for the server to decrypt and verify the received encrypted sensor data to obtain real-time sensor data;
[0184] A tea garden drought prediction result display module is used for the server to input the real-time sensor data into the deployed tea garden drought prediction model to obtain a tea garden drought prediction result, and display the tea garden drought prediction result on a visualization interface built based on Shiny and DynNom frameworks;
[0185] a tea garden drought monitoring data encryption storage module, configured for the server to encrypt the tea garden drought monitoring data including the real-time sensor data and the tea garden drought prediction result into encrypted monitoring data, and store the encrypted monitoring data in a pre-created database;
[0186] The online monitoring data management module is used by the server to verify the received database access request, release the database access rights, and decrypt the encrypted monitoring data stored in the database to manage the tea garden drought monitoring data online. By setting the database access permission verification and opening access after decryption, unauthorized operation is prevented.
[0187] Through a multimodal sensor array, comprehensive meteorological, soil and environmental data from the tea garden are collected. Combined with intelligent preprocessing (K-nearest neighbor filling, clustering to repair outliers) and autoregressive sample expansion, a high-quality dataset is constructed. Based on a multimodal feature fusion model (bidirectional LSTM, residual network, multi-head attention) and a joint loss function, accurate soil entropy prediction and dynamic mapping of drought levels are achieved. Hybrid encryption (SM4 / AES-256 / ChaCha20+RSA) and HSM hardware-level key protection are used to ensure the security of the entire data link. Containerized deployment and Shiny visual interaction are combined to improve the system's usability. At the same time, bandpass filtering for noise reduction and dynamic hyperparameter optimization are used to reduce resource consumption. Compatibility with national secret algorithms and distributed storage meets compliance and disaster recovery requirements. It has high-precision prediction, strong security protection, low operation and maintenance costs, and multi-scenario expansion capabilities, providing smart agriculture with an efficient, reliable, and feasible drought monitoring and management solution.
[0188] The dataset construction module is specifically used for:
[0189] A large amount of historical sensor data is collected from the tea garden through a sensor array including humidity sensors, light intensity sensors, temperature sensors, carbon dioxide sensors, air pressure sensors, particulate matter sensors, global solar radiation sensors, pH sensors, salinity sensors, conductivity sensors, rainfall sensors, wind speed and direction sensors, and positioners;
[0190] By adopting 13 types of sensors including humidity, light, soil pH, wind speed, etc., covering multi-dimensional data such as meteorology, soil, and environment, a comprehensive monitoring system is formed to ensure the diversity and integrity of data sources.
[0191] The historical sensor data at least includes maximum light intensity, average light intensity, sunshine duration, maximum temperature, minimum temperature, average temperature, average daytime temperature, average nighttime temperature, daily temperature difference, maximum air humidity, minimum air humidity, average relative humidity, average daytime air humidity, average nighttime air humidity, maximum carbon dioxide concentration, minimum carbon dioxide concentration, average carbon dioxide concentration, average daytime carbon dioxide concentration, average nighttime carbon dioxide concentration, maximum air pressure value, minimum air pressure value, average air pressure value, average daytime air pressure value, average nighttime air pressure value, air pressure difference, daily average PM2.5, daily average PM10, maximum TBQ global radiation, minimum TBQ global radiation, daily average TBQ global radiation, maximum soil temperature, minimum soil temperature, daily average soil temperature, soil temperature difference, maximum soil pH value, minimum soil pH value, average soil pH value, maximum soil salinity value, minimum soil salinity value, average soil salinity value, maximum soil electrical conductivity, minimum soil electrical conductivity, average soil electrical conductivity, rainfall, wind direction, wind speed, sampling location and sampling time;
[0192] After filling missing values and repairing outliers in each of the historical sensor data, each of the historical sensor data is labeled with soil entropy, drought level, and time segment labels to complete the preprocessing of each of the historical sensor data. A data set is constructed based on the preprocessed historical sensor data, and a sample expansion operation is performed on the data set using an autoregressive model; the time segment label is the month in which the sampling time occurs;
[0193] By marking the sampling time as a month label, the model can identify seasonal changes (such as rainy season and dry season), and combine it with bidirectional LSTM to extract long-term time series dependency features, thereby improving the adaptability of drought prediction to climate cycles.
[0194] The missing value filling is based on the K-nearest neighbor filling method; the outlier repair is based on the Z-score algorithm and the K-means clustering algorithm, specifically:
[0195] Perform Z-score normalization on each of the historical sensor data, calculate the Z-score value of each of the historical sensor data after Z-score normalization, and compare the Z-score value with a preset abnormality threshold to screen out abnormal values; cluster the historical sensor data after Z-score normalization using a K-means clustering algorithm to obtain several cluster centers, and repair each abnormal value in turn based on the nearest cluster center.
[0196] By combining the Z-score algorithm to filter outliers and repairing them through K-means clustering centers, data quality is effectively improved; by adopting the K-nearest neighbor filling method, which is better than traditional mean filling, the data distribution characteristics are retained; by labeling soil entropy, drought level and time segment labels, data interpretability is enhanced, facilitating the model to learn temporal and spatial correlations; by expanding the data set through the autoregressive model, the small sample problem is alleviated and the model generalization ability is improved; using the autoregressive model to generate synthetic data, not only expand the sample size, but also simulate the data distribution under different seasons and weather combinations, enhancing the model's prediction ability for extreme climate events (such as continuous droughts).
[0197] In the tea garden drought prediction model creation module, the multimodal feature extraction layer is constructed based on the meteorological time series coding module, the soil dynamic coding module and the spatiotemporal embedding module;
[0198] The meteorological time series encoding module is used to extract time-dependent features (light, temperature and humidity, carbon dioxide, air pressure, PM, radiation, etc.) from the sensor data through a bidirectional LSTM network. The soil dynamic encoding module is used to extract soil dynamic features (temperature, pH, salinity, and conductivity) from the sensor data through a fully connected network with residual connections, introducing residual connections to enhance gradient propagation. The spatiotemporal embedding module is used to extract spatiotemporal features from the sensor data through an embedding layer (mapping longitude and latitude into high-dimensional vectors and decomposing the sampling time into periodic codes of year / month / day / time period).
[0199] The bidirectional LSTM network is used to capture the long-term and short-term temporal dependencies of meteorological factors (such as the cumulative effects of continuous droughts); the residual fully connected network is used to model the dynamic nonlinear relationships of soil parameters (such as the coupled changes in salinity and electrical conductivity); and the spatiotemporal embedding module is used to encode the joint distribution characteristics of spatial position and time (such as the impact of slope aspect on water evaporation).
[0200] The long-term dependence of meteorological parameters such as light and temperature is captured through meteorological time series coding (bidirectional LSTM), the mutation characteristics of soil indicators such as soil pH and salinity are learned through soil dynamic coding (residual FCN), and the joint features of geographic location and timestamp are fused through the spatiotemporal embedding module. That is, the parallel extraction of three types of heterogeneous features fully explores the potential correlation of data, thereby greatly improving the accuracy of tea garden drought prediction.
[0201] By setting the soil dynamic encoding module to adopt a residual fully connected network (instead of a complex CNN), the number of parameters can be reduced while avoiding gradient vanishing; combined with the GRU gated recurrent unit (lighter than LSTM), a balance between high-precision prediction and low computing resources is achieved, and it is suitable for edge computing devices (such as field embedded terminals).
[0202] The feature fusion layer is used to adjust the weights of time-dependent features, soil dynamic features, and spatiotemporal features through a multi-head attention mechanism, and fuse and output multimodal features through a 1D convolutional layer;
[0203] By dynamically adjusting the weights of multimodal features through a multi-head attention mechanism and combining it with 1D convolutional fusion, we can solve the problem of feature redundancy and enhance the model's ability to represent complex data. By dynamically adjusting the contribution of meteorological, soil, and spatiotemporal features through attention weights, we can solve the problem of feature redundancy (e.g., temperature and light may be strongly correlated) and enhance the model's efficiency in capturing nonlinear relationships.
[0204] The soil entropy prediction layer is used to infer multimodal features through a gated recurrent unit (GRU) and a feature decoupling head to calculate the soil entropy value;
[0205] By introducing a decoupled head in the soil entropy prediction layer, the main features of soil entropy are separated from the interference features (such as the masking effect of instantaneous rainfall on long-term drought), reducing noise interference and improving prediction robustness.
[0206] The drought mapping output layer is used to map the soil entropy value according to the set drought classification rules, and output the tea garden drought prediction results with the drought period, drought level and drought location. The drought mapping output layer outputs the probability of drought level (level 1 drought / level 2 drought / level 3 drought / level 4 drought), the probability of drought period, and the probability of drought location through the fully connected layer + Softmax, and introduces temperature scaling technology to calibrate the prediction confidence.
[0207] The specific drought classification rules are as follows:
[0208] The quantile of soil entropy value is (75,100], which corresponds to the first-level drought; the quantile is (25,75], which corresponds to the second-level drought; the quantile is (5,25], which corresponds to the third-level drought; the quantile is (0,5], which corresponds to the fourth-level drought;
[0209] The formula of the loss function is:
[0210] L=α·L_soil+β·L_drought+γ·L_reg;
[0211] Among them, L represents the loss value of the loss function; α and β both represent weight coefficients; γ represents the regularization term coefficient; L_soil represents the regression loss of soil entropy prediction, using the mean square error function; L_drought represents the discrete loss of drought level classification, using the cross entropy loss function; L_reg represents the L2 regularization term, which is used to control the complexity of the feature fusion layer weight.
[0212] By setting the loss function to fuse regression loss (mean square error), classification loss (cross entropy) and L2 regularization term, the prediction accuracy of soil entropy value and the classification accuracy of drought level are taken into account, while the model complexity is controlled to prevent overfitting.
[0213]
[0214] L_reg=||W||2;
[0215] Where N represents the number of samples; Represents the output value of the soil entropy prediction layer (continuous quantity); y_soi l represents the measured soil moisture value (label); y_drought represents the one-hot encoding of the actual drought level; Represents the probability distribution of the output of the drought mapping layer (softmax processing); W represents the parameter matrix of the feature fusion layer.
[0216] The tea garden drought prediction model deployment module is specifically used for:
[0217] The data set is divided into a training set, a validation set, and a test set in a ratio of 8:1:1 using a stratified sampling technique. A tea garden drought prediction model is trained using the training set. During the training process, the hyperparameters of the tea garden drought prediction model, including at least the learning rate, batch size, and number of training rounds, are continuously optimized until the loss function converges or a preset early stopping condition is met. The AdamW optimizer is used during the training process, combined with cosine annealing learning rate scheduling;
[0218] The trained tea garden drought prediction model is verified by the validation set to determine whether the prediction accuracy is greater than a preset accuracy threshold. If not, the verification fails and the training set is expanded to continue training. If so, the verification passes, and an ROC curve and a calibration curve are drawn using the test set to test the tea garden drought prediction model.
[0219] By setting the dataset to be divided into training set, validation set, and test set in an 8:1:1 ratio and combining it with automatic hyperparameter tuning (learning rate, batch size, etc.), the robustness of the model is ensured. The model performance is verified through the ROC curve and calibration curve, and the prediction accuracy is scientifically evaluated.
[0220] By automatically optimizing parameters such as learning rate and batch size during the training of the tea garden drought prediction model, we can avoid the waste of resources caused by manual parameter adjustment, accelerate the model convergence speed, and reduce GPU / CPU computing resource consumption.
[0221] The ROC curve is used to evaluate the discriminative ability of the tea plantation drought prediction model. The area under the ROC curve (AUC) measures the model's efficiency. An ideal model's ROC curve is as close to the upper left corner as possible, indicating a high TPR and a low FPR, demonstrating excellent discriminative ability. The AUC quantifies the model's overall discriminative ability. In statistical analysis, an AUC value greater than 0.7 is considered to indicate excellent discriminative performance. Higher AUC values indicate a stronger model's ability to distinguish between positive and negative classes.
[0222] A calibration curve is a method used to assess the accuracy of a disease risk model in predicting the probability of future occurrence. In the present invention, a calibration curve is used to assess the degree of fit between the drought level changes in a tea garden under different key factor parameters and the actual values.
[0223] Create a root key, pre-set the root key into the HSM of the server, deploy the trained tea garden drought prediction model to the server through containerization technology, obtain the root key from the HSM, perform SHA-256 calculation on the root key to obtain a hash value, intercept the hash value based on preset interception rules to obtain hash interception data, and use the hash interception data as the AES key to encrypt the deployed tea garden drought prediction model.
[0224] By pre-placing the root key in an HSM (hardware security module) and generating an AES key through SHA-256 hash interception, the root key is prevented from being exposed in plain text, meeting financial-grade security standards.
[0225] The real-time sensor data collection and upload module is specifically used for:
[0226] Setting an upload cycle, collecting real-time sensor data from preset sampling points in the tea garden through a sensor array, and pre-processing the real-time sensor data collected during the upload cycle by filtering through a bandpass filter;
[0227] By setting the upload cycle, the entire process of data collection → preprocessing → encryption → transmission can be automated, reducing manual intervention.
[0228] By using a bandpass filter to filter out invalid frequency band noise before uploading real-time data, the amount of redundant data transmission is reduced, the server storage and computing load is reduced, and energy consumption is saved.
[0229] Obtain the current timestamp, perform MD5 calculation on the preprocessed real-time sensor data and timestamp to obtain an MD5 value, concatenate the real-time sensor data, timestamp, and MD5 value to obtain first concatenated data, convert the first concatenated data into a byte stream according to UTF-8 encoding, fill the byte stream with random bytes to an integer multiple of 3 in length to obtain padding data, record the padding length, divide the padding data equally into Block_A, Block_B, and Block_C, encrypt Block_A using the SM4 algorithm to obtain Block_A_ciphertext, encrypt Block_B using the AES-256-CBC algorithm to obtain Block_B_ciphertext, encrypt Block_C using the ChaCha20 algorithm to obtain Block_C_ciphertext, and encrypt the ciphertext according to Block_B_ciphertext+Block_C_ciphertext+Block_A_ciphertext. ext to obtain second spliced data, encrypt the second spliced data and the padding length into encrypted sensing data using an RSA algorithm, and upload the encrypted sensing data to a server using a TLS protocol;
[0230] SM4+AES-256-CBC+ChaCha20 hybrid encryption is used to process data in blocks, combined with RSA encrypted transmission to achieve algorithm diversity defense and resist the risk of a single algorithm being compromised; the TLS protocol is used to ensure transport layer security and prevent man-in-the-middle attacks.
[0231] By using SM4 (national encryption), AES-256-CBC (international standard), and ChaCha20 (lightweight) encryption after data segmentation, combined with RSA asymmetric encryption, a multi-algorithm collaborative defense system is formed. Even if a single algorithm is cracked, the overall data remains safe.
[0232] Double verification of MD5 value and timestamp is used to prevent historical data replay attacks and ensure the freshness and credibility of real-time sensor data.
[0233] The encrypted sensor data decryption module is specifically used for:
[0234] The server receives the encrypted sensor data in real time, decrypts the encrypted sensor data into second spliced data and a padding length using an RSA algorithm, parses the second spliced data based on a splicing order to obtain Block_A_ciphertext, Block_B_ciphertext, and Block_C_ciphertext, decrypts the Block_A_ciphertext using an SM4 algorithm to obtain Block_A, decrypts the Block_B_ciphertext using an AES-256-CBC algorithm to obtain Block_B, and decrypts the Block_C_ciphertext using a ChaCha20 algorithm to obtain Block_C;
[0235] splicing Block_A, Block_B, and Block_C into padding data, removing random bytes from the padding data based on the padding length to obtain a byte stream, performing UTF-8 encoding inverse conversion on the byte stream to obtain first spliced data, and parsing the first spliced data to obtain real-time sensor data, a timestamp, and an MD5 value;
[0236] After performing integrity check on the real-time sensor data and the timestamp using the MD5 value, performing timeliness check using the timestamp;
[0237] The tea garden drought prediction result display module is specifically used for:
[0238] After performing the authentication operation, the server obtains a root key from the HSM, performs a SHA-256 calculation on the root key to obtain a hash value, intercepts the hash value based on a preset interception rule to obtain hash interception data, uses the hash interception data as an AES key to decrypt the deployed tea garden drought prediction model, inputs the real-time sensor data into the decrypted tea garden drought prediction model to obtain a tea garden drought prediction result, and displays the tea garden drought prediction result on a visualization interface built based on the Shiny and DynNom frameworks;
[0239] An interactive visualization interface is built through the Shiny+DynNom framework to display drought forecast results (level, location, time period) in real time, support user-defined parameter input and result interpretation, and improve decision-making efficiency.
[0240] The tea garden drought monitoring data encryption storage module is specifically used for:
[0241] The server encrypts the tea garden drought monitoring data including the real-time sensor data and the tea garden drought prediction results into first-level encrypted data through the RC6 algorithm, converts the first-level encrypted data into hexadecimal data, swaps the numbers 3, 4, and 5 in the hexadecimal data with the letters B, C, and D respectively to obtain second-level encrypted data, encrypts the second-level encrypted data into third-level encrypted data through the SM9 algorithm, shifts each character of the third-level encrypted data 5 bits to the right to obtain encrypted monitoring data, stores the encrypted monitoring data in a pre-created database, and performs distributed backup.
[0242] The tea garden drought monitoring data is processed through four levels of RC6 encryption → character replacement → SM9 encryption → cyclic shift before storage, combined with asymmetric encryption and obfuscation technology to greatly increase the difficulty of data cracking; data disaster recovery capabilities are ensured through distributed backup.
[0243] In summary, the advantages of the present invention are:
[0244] 1. A large amount of historical sensor data is collected from the tea garden through the sensor array to build a data set; then a tea garden drought prediction model is created based on the sequentially connected multimodal feature extraction layer, feature fusion layer, soil entropy prediction layer, and drought mapping output layer, and the loss function of the tea garden drought prediction model is set. The tea garden drought prediction model is trained through the data set and the loss function, and the trained tea garden drought prediction model is deployed to the server through containerization technology and HSM; then real-time sensor data is collected from the tea garden through the sensor array, and the real-time sensor data collected during the upload period is pre-processed, encrypted into encrypted sensor data, and uploaded to the server through the TLS protocol; the server decrypts the encrypted sensor data to obtain real-time sensor data, and inputs the real-time sensor data into the deployed tea garden drought prediction model to obtain the tea garden drought prediction result, and the tea garden drought prediction result is displayed on a visual display built based on the Shiny and DynNom framework. On the user interface, the tea garden drought monitoring data including the real-time sensor data and the tea garden drought prediction results are encrypted into encrypted monitoring data, and the encrypted monitoring data is stored in a pre-created database; after verifying the received database access request, the server releases the database access rights and decrypts the encrypted monitoring data stored in the database to manage the tea garden drought monitoring data online; that is, in the process of tea garden drought monitoring, multiple security measures are taken in the whole process from the deployment of the tea garden drought prediction model, the uploading of real-time sensor data, the storage of the tea garden drought monitoring data to the online management of the tea garden drought monitoring data, overcoming the defects of the traditional single-key encryption mechanism, and performing distributed backup of the encrypted monitoring data to overcome the single point failure risk of the centralized cloud storage architecture. By encrypting the tea garden drought prediction model, the model parameters can be prevented from being maliciously modified, which ultimately greatly improves the security of the tea garden drought monitoring data management.
[0245] 2. By adopting 13 types of sensors including humidity, light, soil pH, wind speed, etc., covering multi-dimensional data such as meteorology, soil, and environment, a comprehensive monitoring system is formed to ensure the diversity and integrity of data sources.
[0246] 3. By combining the Z-score algorithm to filter outliers and repairing them through K-means clustering centers, data quality is effectively improved; by adopting the K-nearest neighbor filling method, which is better than traditional mean filling, the data distribution characteristics are retained; by labeling soil entropy, drought level and time segment labels, data interpretability is enhanced, which facilitates the model to learn temporal and spatial correlations; by expanding the data set through the autoregressive model, the small sample problem is alleviated and the model generalization ability is improved; using the autoregressive model to generate synthetic data, not only expand the sample size, but also simulate the data distribution under different seasons and weather combinations, enhancing the model's prediction ability for extreme climate events (such as continuous droughts).
[0247] 4. Dynamically adjust the weights of multimodal features through a multi-head attention mechanism, combined with 1D convolution fusion, to solve the problem of feature redundancy and improve the model's ability to represent complex data; dynamically adjust the contribution of meteorological, soil, and spatiotemporal features through attention weights to solve the problem of feature redundancy (for example, temperature and light may be strongly correlated) and improve the model's efficiency in capturing nonlinear relationships.
[0248] 5. By setting the loss function to integrate regression loss (mean square error), classification loss (cross entropy) and L2 regularization term, the prediction accuracy of soil entropy value and the classification accuracy of drought level are taken into account, while the model complexity is controlled to prevent overfitting.
[0249] 6. Use SM4+AES-256-CBC+ChaCha20 hybrid encryption to process data in blocks, combined with RSA encrypted transmission to achieve algorithm diversity defense and resist the risk of a single algorithm being compromised; use the TLS protocol to ensure transport layer security and prevent man-in-the-middle attacks.
[0250] 7. Before the tea garden drought monitoring data is stored, it undergoes four-level processing: RC6 encryption → character replacement → SM9 encryption → cyclic shift, combined with asymmetric encryption and obfuscation technology, which greatly increases the difficulty of data cracking; and data disaster recovery capabilities are ensured through distributed backup.
[0251] 8. By pre-placing the root key in the HSM (Hardware Security Module) and generating the AES key through SHA-256 hash interception, the root key is prevented from being exposed in plain text, meeting financial-grade security standards.
[0252] 9. Build an interactive visualization interface through the Shiny+DynNom framework to display drought forecast results (level, location, time period) in real time, support user-defined parameter input and result interpretation, and improve decision-making efficiency.
[0253] 10. By setting the dataset to be divided into training set, validation set, and test set in an 8:1:1 ratio, combined with automatic hyperparameter tuning (learning rate, batch size, etc.), the robustness of the model is ensured; the model performance is verified through the ROC curve and calibration curve, and the prediction accuracy is scientifically evaluated.
[0254] 11. By setting the upload cycle, the entire process of data collection → preprocessing → encryption → transmission can be automated to reduce manual intervention.
[0255] 12. Set the database access to pass the permission verification and open access after decryption to prevent unauthorized operations.
[0256] 13. By marking the sampling time as a month label, the model can identify seasonal changes (such as rainy season and dry season). Combined with bidirectional LSTM, it can extract long-term time series dependency features and improve the adaptability of drought prediction to climate cycles.
[0257] 14. By introducing a decoupled head in the soil entropy prediction layer, the main features of soil entropy and interference features (such as the masking effect of instantaneous rainfall on long-term drought) are separated, noise interference is reduced, and prediction robustness is improved.
[0258] 15. After data segmentation, SM4 (national encryption), AES-256-CBC (international standard), and ChaCha20 (lightweight) encryption are used respectively, combined with RSA asymmetric encryption to form a multi-algorithm collaborative defense system. Even if a single algorithm is cracked, the overall data remains safe.
[0259] 16. By using a bandpass filter to filter out invalid frequency band noise before uploading real-time data, the amount of redundant data transmission is reduced, the server storage and computing load is reduced, and energy consumption is saved.
[0260] 17. By automatically optimizing parameters such as learning rate and batch size during the training of the tea garden drought prediction model, the waste of resources caused by manual parameter adjustment can be avoided, the model convergence speed can be accelerated, and the consumption of GPU / CPU computing resources can be reduced.
[0261] 18. Double verification of MD5 value and timestamp is used to prevent historical data replay attacks and ensure the freshness and credibility of real-time sensor data.
[0262] 19. Comprehensively collect meteorological, soil and environmental data of tea gardens through multimodal sensor arrays, combine intelligent preprocessing (K-nearest neighbor filling, clustering to repair outliers) and autoregressive sample expansion to build a high-quality data set; based on multimodal feature fusion models (bidirectional LSTM, residual network, multi-head attention) and joint loss functions, accurate soil entropy prediction and dynamic mapping of drought levels are achieved, and hybrid encryption (SM4 / AES-256 / ChaCha20+RSA) and HSM hardware-level key protection are used to ensure the security of the entire data link, and combined with containerized deployment and Shiny visual interaction to improve the usability of the system; at the same time, through bandpass filtering noise reduction and dynamic hyperparameter optimization, resource consumption is reduced, and compatibility with national secret algorithms and distributed storage meets compliance and disaster recovery requirements, with high-precision prediction, strong security protection, low operation and maintenance costs and multi-scenario expansion capabilities, providing smart agriculture with a set of efficient, reliable and feasible drought monitoring and management solutions.
[0263] Although the specific embodiments of the present invention are described above, those skilled in the art should understand that the specific embodiments described are merely illustrative and are not intended to limit the scope of the present invention. Equivalent modifications and changes made by those skilled in the art in accordance with the spirit of the present invention should be included within the scope of protection of the claims of the present invention.
Claims
1. A tea garden drought monitoring data management method, characterized by: The steps include: Step S1: collecting a large amount of historical sensor data from the tea garden through a sensor array, and preprocessing each of the historical sensor data to construct a data set; Step S2: creating a tea garden drought prediction model based on the sequentially connected multimodal feature extraction layer, feature fusion layer, soil entropy prediction layer, and drought mapping output layer, and setting a loss function of the tea garden drought prediction model; Step S3: training a tea garden drought prediction model using the data set and the loss function, and deploying the trained tea garden drought prediction model to a server using containerization technology and HSM; Step S4: setting an upload period, collecting real-time sensor data from the tea garden through the sensor array, pre-processing the real-time sensor data collected during the upload period, encrypting the encrypted sensor data, and uploading it to the server through the TLS protocol; Step S5: The server decrypts and verifies the received encrypted sensor data to obtain real-time sensor data; Step S6: the server inputs the real-time sensor data into the deployed tea garden drought prediction model to obtain a tea garden drought prediction result, and displays the tea garden drought prediction result on a visualization interface built based on Shiny and DynNom frameworks; Step S7: The server encrypts the tea garden drought monitoring data including the real-time sensing data and the tea garden drought prediction result into encrypted monitoring data, and stores the encrypted monitoring data in a pre-created database; Step S8: After verifying the received database access request, the server releases the access rights to the database and decrypts the encrypted monitoring data stored in the database to perform online management of the tea garden drought monitoring data.
2. A tea garden drought monitoring data management method according to claim 1, characterized in that: The step S1 is specifically as follows: A large amount of historical sensor data is collected from the tea garden through a sensor array including humidity sensors, light intensity sensors, temperature sensors, carbon dioxide sensors, air pressure sensors, particulate matter sensors, global solar radiation sensors, pH sensors, salinity sensors, conductivity sensors, rainfall sensors, wind speed and direction sensors, and positioners; The historical sensor data at least includes maximum light intensity, average light intensity, sunshine duration, maximum temperature, minimum temperature, average temperature, average daytime temperature, average nighttime temperature, daily temperature difference, maximum air humidity, minimum air humidity, average relative humidity, average daytime air humidity, average nighttime air humidity, maximum carbon dioxide concentration, minimum carbon dioxide concentration, average carbon dioxide concentration, average daytime carbon dioxide concentration, average nighttime carbon dioxide concentration, maximum air pressure value, minimum air pressure value, average air pressure value, average daytime air pressure value, average nighttime air pressure value, air pressure difference, daily average PM2.5, daily average PM10, maximum TBQ global radiation, minimum TBQ global radiation, daily average TBQ global radiation, maximum soil temperature, minimum soil temperature, daily average soil temperature, soil temperature difference, maximum soil pH value, minimum soil pH value, average soil pH value, maximum soil salinity value, minimum soil salinity value, average soil salinity value, maximum soil electrical conductivity, minimum soil electrical conductivity, average soil electrical conductivity, rainfall, wind direction, wind speed, sampling location and sampling time; After filling missing values and repairing outliers in each of the historical sensor data, each of the historical sensor data is labeled with soil entropy, drought level, and time segment labels to complete the preprocessing of each of the historical sensor data. A data set is constructed based on the preprocessed historical sensor data, and a sample expansion operation is performed on the data set using an autoregressive model; the time segment label is the month in which the sampling time occurs; The missing value filling is based on the K-nearest neighbor filling method; the outlier repair is based on the Z-score algorithm and the K-means clustering algorithm, specifically: Perform Z-score normalization on each of the historical sensor data, calculate the Z-score value of each of the historical sensor data after Z-score normalization, and compare the Z-score value with a preset abnormality threshold to screen out abnormal values; cluster the historical sensor data after Z-score normalization using a K-means clustering algorithm to obtain several cluster centers, and repair each abnormal value in turn based on the nearest cluster center.
3. A tea garden drought monitoring data management method according to claim 1, characterized in that: In step S2, the multimodal feature extraction layer is constructed based on the meteorological time series encoding module, the soil dynamic encoding module and the spatiotemporal embedding module; The meteorological time series encoding module is used to extract time-dependent features from the sensor data through a bidirectional LSTM network; the soil dynamic encoding module is used to extract soil dynamic features from the sensor data through a fully connected network with residual connections; the spatiotemporal embedding module is used to extract spatiotemporal features from the sensor data through an embedding layer; The feature fusion layer is used to adjust the weights of time-dependent features, soil dynamic features, and spatiotemporal features through a multi-head attention mechanism, and fuse and output multimodal features through a 1D convolutional layer; The soil entropy prediction layer is used to infer multimodal features through gated recurrent units and feature decoupling heads to calculate soil entropy values; The drought mapping output layer is used to map the soil entropy value according to the set drought classification rules, and output the tea garden drought prediction results with drought period, drought level and drought location; The specific drought classification rules are as follows: The quantile of soil entropy value is (75,100], which corresponds to the first-level drought; the quantile is (25,75], which corresponds to the second-level drought; the quantile is (5,25], which corresponds to the third-level drought; the quantile is (0,5], which corresponds to the fourth-level drought; The formula of the loss function is: L=α·L_soil+β·L_drought+γ·L_reg; Among them, L represents the loss value of the loss function; α and β both represent weight coefficients; γ represents the regularization term coefficient; L_soil represents the regression loss of soil entropy prediction, using the mean square error function; L_drought represents the discrete loss of drought level classification, using the cross entropy loss function; L_reg represents the L2 regularization term, which is used to control the complexity of the feature fusion layer weight.
4. A tea garden drought monitoring data management method according to claim 1, characterized in that: The step S3 is specifically as follows: Using a stratified sampling technique, the dataset is divided into a training set, a validation set, and a test set in a ratio of 8:1:
1. The tea garden drought prediction model is trained using the training set. During the training process, the hyperparameters of the tea garden drought prediction model, including at least a learning rate, a batch size, and a number of training rounds, are continuously optimized until the loss function converges or a preset early stopping condition is met; The trained tea garden drought prediction model is verified by the validation set to determine whether the prediction accuracy is greater than a preset accuracy threshold. If not, the verification fails and the training set is expanded to continue training. If so, the verification passes, and an ROC curve and a calibration curve are drawn using the test set to test the tea garden drought prediction model. Create a root key, pre-set the root key into the HSM of the server, deploy the trained tea garden drought prediction model to the server through containerization technology, obtain the root key from the HSM, perform SHA-256 calculation on the root key to obtain a hash value, intercept the hash value based on preset interception rules to obtain hash interception data, and use the hash interception data as the AES key to encrypt the deployed tea garden drought prediction model.
5. A tea garden drought monitoring data management method according to claim 1, characterized in that: The step S4 is specifically as follows: Setting an upload cycle, collecting real-time sensor data from preset sampling points in the tea garden through a sensor array, and pre-processing the real-time sensor data collected during the upload cycle by filtering through a bandpass filter; Obtain the current timestamp, perform MD5 calculation on the pre-processed real-time sensor data and the timestamp to obtain an MD5 value, concatenate the real-time sensor data, the timestamp, and the MD5 value to obtain first concatenated data, convert the first concatenated data into a byte stream according to UTF-8 encoding, fill the byte stream with random bytes to an integer multiple of 3 to obtain padding data, record the padding length, divide the padding data into Block_A, Block_B, and Block_C, encrypt Block_A using the SM4 algorithm to obtain Block_A_ciphertext, and encrypt the data using the AES encryption algorithm. - encrypting Block_B using the 256-CBC algorithm to obtain Block_B_ciphertext, encrypting Block_C using the ChaCha20 algorithm to obtain Block_C_ciphertext, concatenating Block_B_ciphertext + Block_C_ciphertext + Block_A_ciphertext in order to obtain second concatenated data, encrypting the second concatenated data and the padding length using the RSA algorithm to obtain encrypted sensor data, and uploading the encrypted sensor data to a server using the TLS protocol; The step S5 is specifically as follows: The server receives the encrypted sensor data in real time, decrypts the encrypted sensor data into second spliced data and a padding length using an RSA algorithm, parses the second spliced data based on a splicing order to obtain Block_A_ciphertext, Block_B_ciphertext, and Block_C_ciphertext, decrypts the Block_A_ciphertext using an SM4 algorithm to obtain Block_A, decrypts the Block_B_ciphertext using an AES-256-CBC algorithm to obtain Block_B, and decrypts the Block_C_ciphertext using a ChaCha20 algorithm to obtain Block_C; splicing Block_A, Block_B, and Block_C into padding data, removing random bytes from the padding data based on the padding length to obtain a byte stream, performing UTF-8 encoding inverse conversion on the byte stream to obtain first spliced data, and parsing the first spliced data to obtain real-time sensor data, a timestamp, and an MD5 value; After performing integrity check on the real-time sensor data and the timestamp using the MD5 value, performing timeliness check using the timestamp; The step S6 is specifically as follows: After performing the authentication operation, the server obtains a root key from the HSM, performs a SHA-256 calculation on the root key to obtain a hash value, intercepts the hash value based on a preset interception rule to obtain hash interception data, uses the hash interception data as an AES key to decrypt the deployed tea garden drought prediction model, inputs the real-time sensor data into the decrypted tea garden drought prediction model to obtain a tea garden drought prediction result, and displays the tea garden drought prediction result on a visualization interface built based on the Shiny and DynNom frameworks; The step S7 is specifically as follows: The server encrypts the tea garden drought monitoring data including the real-time sensor data and the tea garden drought prediction results into first-level encrypted data through the RC6 algorithm, converts the first-level encrypted data into hexadecimal data, swaps the numbers 3, 4, and 5 in the hexadecimal data with the letters B, C, and D respectively to obtain second-level encrypted data, encrypts the second-level encrypted data into third-level encrypted data through the SM9 algorithm, shifts each character of the third-level encrypted data 5 bits to the right to obtain encrypted monitoring data, stores the encrypted monitoring data in a pre-created database, and performs distributed backup.
6. A tea garden drought monitoring data management system, characterized by: Includes the following modules: a data set construction module, configured to collect a large amount of historical sensor data from the tea garden through a sensor array, and pre-process each of the historical sensor data to construct a data set; A tea garden drought prediction model creation module is used to create a tea garden drought prediction model based on the sequentially connected multimodal feature extraction layer, feature fusion layer, soil entropy prediction layer, and drought mapping output layer, and set the loss function of the tea garden drought prediction model; A tea garden drought prediction model deployment module is used to train the tea garden drought prediction model using the data set and loss function, and deploy the trained tea garden drought prediction model to a server using containerization technology and HSM; The real-time sensor data collection and upload module is used to set an upload cycle, collect real-time sensor data from the tea garden through the sensor array, pre-process the real-time sensor data collected within the upload cycle, encrypt it into encrypted sensor data, and upload it to the server through the TLS protocol; An encrypted sensor data decryption module is used for the server to decrypt and verify the received encrypted sensor data to obtain real-time sensor data; A tea garden drought prediction result display module is used for the server to input the real-time sensor data into the deployed tea garden drought prediction model to obtain a tea garden drought prediction result, and display the tea garden drought prediction result on a visualization interface built based on Shiny and DynNom frameworks; a tea garden drought monitoring data encryption storage module, configured for the server to encrypt the tea garden drought monitoring data including the real-time sensor data and the tea garden drought prediction result into encrypted monitoring data, and store the encrypted monitoring data in a pre-created database; The monitoring data online management module is used for the server to verify the received database access request, release the access rights of the database, decrypt the encrypted monitoring data stored in the database, and manage the tea garden drought monitoring data online.
7. A tea garden drought monitoring data management system according to claim 6, characterized in that: The dataset construction module is specifically used for: A large amount of historical sensor data is collected from the tea garden through a sensor array including humidity sensors, light intensity sensors, temperature sensors, carbon dioxide sensors, air pressure sensors, particulate matter sensors, global solar radiation sensors, pH sensors, salinity sensors, conductivity sensors, rainfall sensors, wind speed and direction sensors, and positioners; The historical sensor data at least includes maximum light intensity, average light intensity, sunshine duration, maximum temperature, minimum temperature, average temperature, average daytime temperature, average nighttime temperature, daily temperature difference, maximum air humidity, minimum air humidity, average relative humidity, average daytime air humidity, average nighttime air humidity, maximum carbon dioxide concentration, minimum carbon dioxide concentration, average carbon dioxide concentration, average daytime carbon dioxide concentration, average nighttime carbon dioxide concentration, maximum air pressure value, minimum air pressure value, average air pressure value, average daytime air pressure value, average nighttime air pressure value, air pressure difference, daily average PM2.5, daily average PM10, maximum TBQ global radiation, minimum TBQ global radiation, daily average TBQ global radiation, maximum soil temperature, minimum soil temperature, daily average soil temperature, soil temperature difference, maximum soil pH value, minimum soil pH value, average soil pH value, maximum soil salinity value, minimum soil salinity value, average soil salinity value, maximum soil electrical conductivity, minimum soil electrical conductivity, average soil electrical conductivity, rainfall, wind direction, wind speed, sampling location and sampling time; After filling missing values and repairing outliers in each of the historical sensor data, each of the historical sensor data is labeled with soil entropy, drought level, and time segment labels to complete the preprocessing of each of the historical sensor data. A data set is constructed based on the preprocessed historical sensor data, and a sample expansion operation is performed on the data set using an autoregressive model; the time segment label is the month in which the sampling time occurs; The missing value filling is based on the K-nearest neighbor filling method; the outlier repair is based on the Z-score algorithm and the K-means clustering algorithm, specifically: Perform Z-score normalization on each of the historical sensor data, calculate the Z-score value of each of the historical sensor data after Z-score normalization, and compare the Z-score value with a preset abnormality threshold to screen out abnormal values; cluster the historical sensor data after Z-score normalization using a K-means clustering algorithm to obtain several cluster centers, and repair each abnormal value in turn based on the nearest cluster center.
8. A tea garden drought monitoring data management system according to claim 6, characterized in that: In the tea garden drought prediction model creation module, the multimodal feature extraction layer is constructed based on the meteorological time series coding module, the soil dynamic coding module and the spatiotemporal embedding module; The meteorological time series encoding module is used to extract time-dependent features from the sensor data through a bidirectional LSTM network; the soil dynamic encoding module is used to extract soil dynamic features from the sensor data through a fully connected network with residual connections; the spatiotemporal embedding module is used to extract spatiotemporal features from the sensor data through an embedding layer; The feature fusion layer is used to adjust the weights of time-dependent features, soil dynamic features, and spatiotemporal features through a multi-head attention mechanism, and fuse and output multimodal features through a 1D convolutional layer; The soil entropy prediction layer is used to infer multimodal features through gated recurrent units and feature decoupling heads to calculate soil entropy values; The drought mapping output layer is used to map the soil entropy value according to the set drought classification rules, and output the tea garden drought prediction results with drought period, drought level and drought location; The specific drought classification rules are as follows: The quantile of soil entropy value is (75,100], which corresponds to the first-level drought; the quantile is (25,75], which corresponds to the second-level drought; the quantile is (5,25], which corresponds to the third-level drought; the quantile is (0,5], which corresponds to the fourth-level drought; The formula of the loss function is: L=α·L_soil+β·L_drought+γ·L_reg; Among them, L represents the loss value of the loss function; α and β both represent weight coefficients; γ represents the regularization term coefficient; L_soil represents the regression loss of soil entropy prediction, using the mean square error function; L_drought represents the discrete loss of drought level classification, using the cross entropy loss function; L_reg represents the L2 regularization term, which is used to control the complexity of the feature fusion layer weight.
9. A tea garden drought monitoring data management system according to claim 6, characterized in that: The tea garden drought prediction model deployment module is specifically used for: Using a stratified sampling technique, the dataset is divided into a training set, a validation set, and a test set in a ratio of 8:1:
1. The tea garden drought prediction model is trained using the training set. During the training process, the hyperparameters of the tea garden drought prediction model, including at least a learning rate, a batch size, and a number of training rounds, are continuously optimized until the loss function converges or a preset early stopping condition is met; The trained tea garden drought prediction model is verified by the validation set to determine whether the prediction accuracy is greater than a preset accuracy threshold. If not, the verification fails and the training set is expanded to continue training. If so, the verification passes, and an ROC curve and a calibration curve are drawn using the test set to test the tea garden drought prediction model. Create a root key, pre-set the root key into the HSM of the server, deploy the trained tea garden drought prediction model to the server through containerization technology, obtain the root key from the HSM, perform SHA-256 calculation on the root key to obtain a hash value, intercept the hash value based on preset interception rules to obtain hash interception data, and use the hash interception data as the AES key to encrypt the deployed tea garden drought prediction model.
10. The tea garden drought monitoring data management system according to claim 6, characterized in that: The real-time sensor data collection and upload module is specifically used for: Setting an upload cycle, collecting real-time sensor data from preset sampling points in the tea garden through a sensor array, and pre-processing the real-time sensor data collected during the upload cycle by filtering through a bandpass filter; Obtain the current timestamp, perform MD5 calculation on the pre-processed real-time sensor data and the timestamp to obtain an MD5 value, concatenate the real-time sensor data, the timestamp, and the MD5 value to obtain first concatenated data, convert the first concatenated data into a byte stream according to UTF-8 encoding, fill the byte stream with random bytes to an integer multiple of 3 to obtain padding data, record the padding length, divide the padding data into Block_A, Block_B, and Block_C, encrypt Block_A using the SM4 algorithm to obtain Block_A_ciphertext, and encrypt the data using the AES encryption algorithm. - encrypting Block_B using the 256-CBC algorithm to obtain Block_B_ciphertext, encrypting Block_C using the ChaCha20 algorithm to obtain Block_C_ciphertext, concatenating Block_B_ciphertext + Block_C_ciphertext + Block_A_ciphertext in order to obtain second concatenated data, encrypting the second concatenated data and the padding length using the RSA algorithm to obtain encrypted sensor data, and uploading the encrypted sensor data to a server using the TLS protocol; The encrypted sensor data decryption module is specifically used for: The server receives the encrypted sensor data in real time, decrypts the encrypted sensor data into second spliced data and a padding length using an RSA algorithm, parses the second spliced data based on a splicing order to obtain Block_A_ciphertext, Block_B_ciphertext, and Block_C_ciphertext, decrypts the Block_A_ciphertext using an SM4 algorithm to obtain Block_A, decrypts the Block_B_ciphertext using an AES-256-CBC algorithm to obtain Block_B, and decrypts the Block_C_ciphertext using a ChaCha20 algorithm to obtain Block_C; splicing Block_A, Block_B, and Block_C into padding data, removing random bytes from the padding data based on the padding length to obtain a byte stream, performing UTF-8 encoding inverse conversion on the byte stream to obtain first spliced data, and parsing the first spliced data to obtain real-time sensor data, a timestamp, and an MD5 value; After performing integrity check on the real-time sensor data and the timestamp using the MD5 value, performing timeliness check using the timestamp; The tea garden drought prediction result display module is specifically used for: After performing the authentication operation, the server obtains a root key from the HSM, performs a SHA-256 calculation on the root key to obtain a hash value, intercepts the hash value based on a preset interception rule to obtain hash interception data, uses the hash interception data as an AES key to decrypt the deployed tea garden drought prediction model, inputs the real-time sensor data into the decrypted tea garden drought prediction model to obtain a tea garden drought prediction result, and displays the tea garden drought prediction result on a visualization interface built based on the Shiny and DynNom frameworks; The tea garden drought monitoring data encryption storage module is specifically used for: The server encrypts the tea garden drought monitoring data including the real-time sensor data and the tea garden drought prediction results into first-level encrypted data through the RC6 algorithm, converts the first-level encrypted data into hexadecimal data, swaps the numbers 3, 4, and 5 in the hexadecimal data with the letters B, C, and D respectively to obtain second-level encrypted data, encrypts the second-level encrypted data into third-level encrypted data through the SM9 algorithm, shifts each character of the third-level encrypted data 5 bits to the right to obtain encrypted monitoring data, stores the encrypted monitoring data in a pre-created database, and performs distributed backup.