Wheat raw material pesticide residue and nutrient traceability detection method
By setting up multiple collection points and cloud-based analysis in wheat storage batches, temperature, humidity, and spectral energy data are collected and processed in real time, solving the error problem in pesticide residue detection in wheat under high temperature and humidity conditions, and achieving high-precision and reliable pesticide residue traceability.
Patent Information
- Application Number
- CN202511689621.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-18
- Publication Date
- 2026-02-06
AI Technical Summary
Existing wheat pesticide residue detection systems fail to effectively distinguish between humidity disturbance signals and pesticide residue signals under high temperature and humidity conditions, resulting in high error rates in detection results, lack of adaptive adjustment capabilities, and neglect of the influence of stratified moisture fields on wheat samples during storage.
Multiple sampling points are set up in the wheat storage batch to collect temperature, humidity and spectral energy data in real time. The data are transmitted to the local edge computing node for preprocessing via LoRa wireless communication. The temperature and humidity disturbance correction coefficient Hdc is calculated in the cloud detection and analysis server. Combined with the degradation rate inversion mechanism and the residue traceability comprehensive index Qsr, adaptive spectral signal correction and detection reliability assessment are achieved.
It significantly improves the detection accuracy under high humidity conditions, reduces the error rate by about 35%, enhances the reliability of the detection results and the robustness of the system, and ensures the stability and adaptability of the detection model in dynamic storage environments.
Smart Images

Figure CN121476110A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of agricultural product management technology, specifically to a method for tracing and detecting pesticide residues and nutrients in wheat raw materials. Background Technology
[0002] With the continuous improvement of the agricultural product quality and safety supervision system and the rapid development of intelligent detection technology, the field of agricultural product testing is gradually shifting from traditional chemical analysis methods to intelligent detection based on the fusion of spectroscopy and sensing. Especially in the grain storage and quality traceability process, the dynamic monitoring of pesticide residues and nutrient content in wheat, as a major grain crop, has become an important research direction for ensuring food safety and quality stability.
[0003] Currently, in the field of wheat pesticide residue detection, detection systems typically perform one-time smoothing or baseline correction on the entire sample based on a single-layer spectral signal, failing to fully consider the spectral energy differences caused by uneven vertical temperature and humidity distribution in the storage environment. Especially under high temperature and humidity conditions, the difference in moisture content between the sample surface and inner layers can cause spectral absorption peak drift, baseline tilt, and energy distortion, leading the detection algorithm to misinterpret some humidity-induced signals as pesticide residue signals. Furthermore, traditional smoothing algorithms can only reduce random noise and cannot effectively distinguish between "true residue change signals" and "humidity disturbance signals," resulting in a significantly increased error rate in high humidity environments, and lacking adaptive adjustment capabilities, leading to poor stability of the detection model.
[0004] The root cause of these problems lies in the fact that existing detection systems typically treat wheat samples as homogeneous media, ignoring the "layered moisture field" formed during storage due to humidity gradients. This neglect causes varying degrees of spectral shift between surface and internal signals when environmental humidity or temperature fluctuates, leading algorithms to mistakenly interpret "spectral energy shifts caused by humidity changes" as "pesticide degradation characteristic changes." Once this misjudgment occurs, it can result in: misclassifying actually safe samples as exceeding pesticide residue limits; or misclassifying samples with actual exceeding limits as acceptable; and over long-term operation, causing detection model drift, distorted residue trend analysis, and traceability results deviating from the actual storage conditions. Therefore, there is an urgent need to propose an adaptive humidity disturbance decoupling algorithm that can adaptively identify the effects of humidity disturbances and decouple them from the actual pesticide residue signals. This would enable dynamic separation and physical consistency correction of multi-layer spectral signals, thereby significantly improving detection accuracy and traceability reliability under high humidity conditions. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides a method for tracing and detecting pesticide residues and nutrients in wheat raw materials, thus solving the problems mentioned in the background art.
[0006] To achieve the above objectives, the present invention provides the following technical solution, comprising the following steps: S1. Set up collection points in the wheat storage batches and set up detection devices in the collection points to collect temperature and humidity data sets and multi-layer spectral energy data sets in real time, and transmit them to the local edge computing node of the detection terminal for preprocessing to obtain humidity standard dataset and multi-layer spectral energy standard dataset, and then package and transmit them to the cloud detection and analysis server. S2. In the cloud-based detection and analysis server, calculate the temperature and humidity disturbance correction coefficient Hdc based on the humidity standard dataset and the multi-layer spectral energy standard dataset, and conduct a preliminary comparative evaluation. Based on the preliminary comparative evaluation results, trigger relevant measures. S3. After triggering the pesticide residue degradation rate inversion mechanism based on the preliminary comparative evaluation, the residue concentration Ct is calculated and output based on the temperature and humidity disturbance correction coefficient Hdc, and the residue source traceability comprehensive index Qsr is calculated and output based on the residue concentration Ct. S4. Based on the output of the residue traceability comprehensive index Qsr, evaluate the reliability of residue detection, and control the detection accuracy and stability of residue traceability based on the residue detection reliability evaluation results.
[0007] Preferably, S1 includes S11; S11. By setting up collection points at fixed intervals in the vertical direction of the wheat storage batch, and setting up a detection device at each collection point, the temperature and humidity data set and multi-layer spectral energy data set of the current wheat storage batch are collected in real time. The collection points include surface collection point P1, middle collection point P2, and bottom collection point P3; Among them, the surface sampling point P1 is set at 5cm from the surface of the storage silo; the middle sampling point P2 is set at 25cm from the surface of the storage silo; and the bottom sampling point P3 is set at 50cm from the surface of the storage silo. The detection device includes an infrared spectroscopy detection probe, a humidity probe, and an infrared thermometer; The multilayer spectral energy data set includes surface spectral signal energy E1, middle spectral signal energy E2, and bottom spectral signal energy E3; The temperature and humidity data set includes surface humidity data H1 and surface temperature data T1, middle layer humidity data H2, middle layer temperature data T2, bottom layer humidity data H3 and bottom layer temperature data T3.
[0008] Preferably, S1 further includes S12; S12. Based on the wireless communication module of the detection device in all collection points, a stable data link is established with the local edge computing node of the detection terminal through LoRa. The collected temperature and humidity data set and multi-layer spectral energy data set are sent to the local edge computing node of the detection terminal in real time in time series format. Preprocessing is performed in the local edge computing node of the detection terminal to obtain the humidity standard dataset and the multi-layer spectral energy standard dataset. The local edge computing node of the detection terminal encapsulates the humidity standard dataset and the multi-layer spectral energy standard dataset into a unified structured data packet through the secure data transmission protocol TLS encrypted channel, and packages it into JSON-Stream format and uploads it to the cloud detection and analysis server through the message queue communication channel; The preprocessing includes data integrity verification, noise removal, time synchronization, and normalization. The data integrity verification detects and identifies packet loss by comparing the sequence numbers of consecutive sampled frames, and fills in the missing data using a linear interpolation algorithm. The noise removal is achieved by using an improved Savitzky–Golay smoothing filter algorithm to remove high-frequency noise interference from the spectral signal. The time synchronization is achieved by unifying the time reference of data from each collection point based on the timing signal from the main control terminal. The normalization process uses a minimax method to normalize the temperature and humidity data set and the multi-layer spectral energy data set, eliminating the influence of unit dimensions.
[0009] Preferably, S2 includes S21; S21. Extract the humidity standard dataset and multi-layer spectral energy standard dataset from the cloud detection and analysis server, calculate the average humidity Havg and average temperature Tavg in the cloud server computing unit, and use the humidity perturbation correction calculation formula to perform comprehensive calculation and output the temperature and humidity perturbation correction coefficient Hdc, and analyze the ratio of temperature and humidity spatial gradient to spectral energy difference.
[0010] Preferably, S2 further includes S22; S22. After calculating and outputting the temperature and humidity disturbance correction coefficient Hdc, the cloud-based detection and analysis server performs a preliminary comparative evaluation of the temperature and humidity disturbance correction coefficient Hdc by using a preset first disturbance threshold F1 and a second disturbance threshold F2 to determine the signal disturbance intensity level and subsequent processing path; the specific evaluation content is as follows. When the temperature and humidity disturbance correction coefficient Hdc ≤ the first disturbance threshold F1, it is determined to be a level 1 temperature and humidity disturbance, which directly triggers the pesticide residue degradation rate inversion mechanism. When the first perturbation threshold F1 < temperature and humidity perturbation correction coefficient Hdc ≤ second perturbation threshold F2, it is determined to be a level 2 temperature and humidity perturbation. At this time, a second noise removal is performed on the temperature and humidity dataset and the multi-layer spectral energy dataset, and a preliminary comparison evaluation is performed on the temperature and humidity dataset and the multi-layer spectral energy dataset after the second noise removal. If it is still at the level 2 temperature and humidity perturbation, it is upgraded to the level 3 temperature and humidity perturbation. When the temperature and humidity disturbance correction coefficient Hdc is greater than the second disturbance threshold F2, it is determined to be a level three temperature and humidity disturbance. At this time, the main detection channel data update is paused and sampling is delayed. The delayed sampling time is 60 seconds. After the multi-point average correction is started, the pesticide residue degradation rate inversion mechanism is triggered again.
[0011] Preferably, S2 further includes S23; S23. The multi-point averaging correction obtains a multi-layer spectral energy standard dataset after delayed sampling and preprocessing. It then continues to perform averaging to obtain the average spectral signal energy Eavg. Based on the average spectral signal energy Eavg, the difference between the average spectral signal energy Eavg and the mid-layer spectral signal energy E2 obtained by delayed sampling is calculated to obtain the signal fluctuation value ΔE. If the signal fluctuation value ΔE < 0.02, it is considered that the signal fluctuation has recovered to a controllable range. If it does not meet the requirement, the delayed sampling process is repeated 3 times. If it still does not meet the requirement after 3 times, the current humidity standard dataset and the multi-layer spectral energy standard dataset are isolated and stored in the abnormal cache area and marked as pending manual verification. After the signal fluctuations have been recovered, the mean spectral signal energy Eavg is replaced with the mid-layer spectral signal energy E2 in the humidity disturbance correction calculation formula, and the output temperature and humidity disturbance correction coefficient Hdc is recalculated.
[0012] Preferably, S3 includes S31; S31. After triggering the pesticide residue degradation rate inversion mechanism, and based on the currently obtained temperature and humidity disturbance correction coefficient Hdc and storage time t, the actual residue concentration Ct in the current test sample is calculated and output through the degradation equation, and the degradation law between pesticide residue and storage time is deduced.
[0013] Preferably, S3 further includes S32; S32. The cloud-based detection and analysis server receives the current residual concentration Ct and the initial concentration C0 in the standard sample database, calculates the ratio, and performs a secondary ratio calculation based on the ratio result and the temperature and humidity disturbance correction coefficient Hdc, outputting the residual traceability comprehensive index Qsr to analyze the reliability of residual detection under temperature and humidity correction conditions.
[0014] Preferably, S4 includes S41; S41. The cloud-based detection and analysis server classifies and automatically determines the reliability of sample detection based on the numerical range of the residual traceability comprehensive index Qsr, including the following three types of determination results: When the residual traceability comprehensive index Qsr ≥ 0.9, it is determined to be of a reliable level for the test results; When 0.7 ≤ residual traceability comprehensive index Qsr < 0.9, it is judged as the controllable level of detection deviation; When the residual traceability comprehensive index Qsr < 0.7, it is judged as an abnormal sample level.
[0015] Preferably, S4 further includes S42; S42. When the residual traceability comprehensive index Qsr is determined to be at different levels, the cloud-based detection and analysis server executes the corresponding feedback strategy, specifically including: When the test result is determined to be of a certain level of reliability, the cloud-based test analysis server automatically generates a qualified test report. The test report includes the sample number, batch information, temperature and humidity data set, multi-layer spectral energy data set, residual concentration Ct, initial concentration C0 in the standard sample database, temperature and humidity disturbance correction coefficient Hdc, residual traceability comprehensive index Qsr, and the level of reliability of the test result. It is also automatically archived to the cloud-based quality archive database. When the detection deviation is determined to be within a controllable range, the cloud-based detection and analysis server executes a fixed-step correction strategy. This fixed-step correction strategy adjusts the humidity correction factor 'a' and the temperature influence factor in the residual concentration Ct calculation formula. A linear iterative adjustment was performed, specifically: the humidity correction factor 'a' was increased by a fixed value of 0.05, and the temperature influence factor was adjusted when the average temperature Tavg was above 20℃. A fixed increase of 0.05 is applied when the average temperature Tavg is below or equal to 20℃, which is the temperature influence factor. The parameters are fixedly reduced by 0.05, causing the residual concentration Ct and the residual source traceability comprehensive index Qsr to be recalculated after correction, until the confidence level of the detection results is reached and the iteration stops. When a sample is determined to be abnormal, the cloud-based detection and analysis server automatically generates an abnormal detection report, sends it to the operation and maintenance client, prompts for manual review, and moves it to the abnormal cache area for isolation marking. The abnormal detection report includes the abnormal sample number, abnormal sample batch information, abnormal sample temperature and humidity data set, abnormal sample multilayer spectral energy data set, abnormal sample residual concentration Ct, abnormal sample temperature and humidity disturbance correction coefficient Hdc, abnormal sample residual traceability comprehensive index Qsr, and abnormal sample level.
[0016] This invention provides a method for tracing and detecting pesticide residues and nutrients in wheat raw materials. It has the following beneficial effects: (1) This method deploys surface sampling points P1, middle sampling points P2, and bottom sampling points P3 in the vertical direction of wheat storage batches. It combines infrared spectral detection probes, humidity sensors, and infrared thermometers to collect temperature, humidity, and spectral energy signals. The data is then transmitted in real time to the local edge computing node of the detection terminal for preprocessing using a LoRa wireless communication module. This achieves accurate monitoring of multi-dimensional environmental disturbances without changing the hardware structure. The structured preprocessing process, including data integrity verification, noise removal, time synchronization, and normalization, significantly improves the stability of the data input end. It increases the signal-to-noise ratio of the humidity standard dataset and the spectral energy standard dataset by about 20%, ensuring the consistency and repeatability of the input for subsequent algorithm calculations. This avoids the calculation deviations caused by delays and dimensional differences in multi-point asynchronous sampling in traditional detection systems.
[0017] (2) This method introduces a “temperature and humidity disturbance correction coefficient Hdc” into the cloud-based detection and analysis server. By combining a two-factor ratio normalization model of average temperature (Tavg) and average humidity (Havg), an adaptive correction mechanism with three-dimensional coupling of "spectral energy difference—humidity gradient—temperature drift" is formed. This algorithm can dynamically identify spectral drift caused by both humidity and temperature, and achieve nonlinear environmental disturbance correction through multiplicative compensation terms. Without changing the spectral detection band, it improves the accuracy of pesticide residue detection in high-humidity environments by approximately 35%, exhibiting higher environmental robustness and algorithm stability than traditional one-time smoothing algorithms. Furthermore, the model can automatically adjust the processing strategy based on the threshold classification (F1, F2) of the temperature and humidity disturbance correction coefficient Hdc, achieving adaptive level control of the algorithm and self-adjustment of the detection process.
[0018] (3) This method establishes a correlation model of "residual concentration Ct, standard concentration C0, and temperature and humidity disturbance correction coefficient Hdc", outputs a comprehensive traceability credibility index Qsr, and automatically determines the sample level based on its value: credible, controllable, and abnormal. When determined to be credible, the system automatically generates a qualified test report and archives it; when determined to be controllable, a fixed step size correction strategy is implemented to adjust the humidity correction factor a and the temperature influence factor. Linear fine-tuning is performed to achieve model self-correction. When an anomaly is detected, the system automatically triggers resampling and manual review processes, and isolates the abnormal dataset to prevent error propagation. Through this closed-loop mechanism of grading, correction, resampling, and archiving, the detection system achieves self-learning and self-evolution in a dynamic storage environment, ensuring full-cycle controllability of detection accuracy, model stability, and data reliability during long-term operation. Attached Figure Description
[0019] Figure 1 This is a schematic diagram of the steps in the method for tracing and detecting pesticide residues and nutrients in wheat raw materials according to the present invention.
[0020] Figure 2 This is a schematic diagram of the overall structure for a temperature and humidity spectral detection system for wheat storage. Detailed Implementation
[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. Example
[0022] Example 1; please refer to Figure 1 This invention provides a method for tracing and detecting pesticide residues and nutrients in wheat raw materials. To achieve the above objectives, this invention is implemented through the following technical solution, including the following steps:
[0023] S1. Set up collection points in the wheat storage batches and set up detection devices in the collection points to collect temperature and humidity data sets and multi-layer spectral energy data sets in real time, and transmit them to the local edge computing node of the detection terminal for preprocessing to obtain humidity standard dataset and multi-layer spectral energy standard dataset, and then package and transmit them to the cloud detection and analysis server. S2. In the cloud-based detection and analysis server, calculate the temperature and humidity disturbance correction coefficient Hdc based on the humidity standard dataset and the multi-layer spectral energy standard dataset, and conduct a preliminary comparative evaluation. Based on the preliminary comparative evaluation results, trigger relevant measures. S3. After triggering the pesticide residue degradation rate inversion mechanism based on the preliminary comparative evaluation, the residue concentration Ct is calculated and output based on the temperature and humidity disturbance correction coefficient Hdc, and the residue source traceability comprehensive index Qsr is calculated and output based on the residue concentration Ct. S4. Based on the output of the residue traceability comprehensive index Qsr, evaluate the reliability of residue detection, and control the detection accuracy and stability of residue traceability based on the residue detection reliability evaluation results.
[0024] In this embodiment, to ensure the stability and accuracy of pesticide residue and nutrient content detection results during wheat storage testing, the invention employs a multi-layered sampling point structure within the wheat storage batch. Multi-dimensional detection devices at the surface, middle, and bottom layers simultaneously collect temperature, humidity, and spectral energy signals to address common issues in grain storage environments such as uneven vertical humidity gradients and heat stratification. Data collection in a single layer can easily lead to spectral response shifts and absorption peak broadening caused by localized high humidity, resulting in distorted detection signals. Through layered sampling, the system can reflect the spatial variation characteristics of moisture and temperature in the storage area in real time, making the collected signals more representative and complete. The collected data is transmitted in real time to the local edge computing node of the detection terminal via a LoRa wireless transmission module. Preprocessing is performed at this node, including data integrity verification, noise filtering, and normalization, thereby achieving structured and temporally consistent spectral and environmental data and avoiding temporal errors caused by signal delay or sampling drift. The preprocessed humidity standard dataset and multi-layered spectral energy standard dataset are then packaged and transmitted to the cloud-based detection and analysis server, achieving a continuous data loop from the acquisition end to the cloud. In the cloud-based detection and analysis server, an adaptive correction for humidity and temperature dual factors was achieved by establishing a temperature and humidity perturbation correction coefficient (Hdc). This coefficient uses the inter-layer energy difference in the spectrum as the dominant variable and average humidity and average temperature as auxiliary variables for ratio normalization correction. Its physical meaning is that changes in molecular vibrational energy levels due to temperature increases cause spectral baseline drift, while humidity differences cause absorption peak energy shifts. Hdc, through synergistic decoupling of these two types of perturbations, ensures that the spectral signal maintains a stable response under different storage environments, thus guaranteeing the physical consistency of subsequent pesticide residue concentration calculations. Based on the calculation results of Hdc, a preliminary comparative evaluation and perturbation level classification are performed to achieve dynamic response control under different levels of environmental perturbation. When the perturbation intensity is low, the system directly enters the degradation rate inversion stage; when the perturbation exceeds the threshold range, signal stability is restored through delayed sampling and multi-point averaging correction, effectively preventing false residue reduction under high humidity conditions. Based on this, the system calculates the residue concentration Ct based on the temperature and humidity perturbation correction coefficient Hdc and storage time t, and dynamically inverts the true degradation rate of pesticides in wheat samples through a modified first-order degradation equation. Unlike traditional fixed-rate models, the Ct calculated in this invention not only reflects the time-related degradation process but also comprehensively considers the indirect effects of temperature and humidity disturbances on chemical kinetics. Therefore, the results can more accurately describe the actual residue variation patterns. Furthermore, the residue source tracing comprehensive index Qsr is calculated using Ct, standard concentration C0, and Hdc to assess the reliability of the detection results.When Qsr is within the reliable range, the system automatically generates and archives a qualified test report; when Qsr is within the deviation range, the system automatically adjusts the humidity correction factor and temperature influence coefficient through a parameter self-correction mechanism; when Qsr exceeds the abnormal range, the system triggers a resampling and manual review process and isolates and stores the abnormal dataset. Through the above implementation methods, this invention achieves full-process optimization from multi-layer environmental signal acquisition, temperature and humidity dual-factor perturbation correction, dynamic inversion of degradation rate to intelligent feedback of detection reliability. This structure not only improves the stability and robustness of the detection signal in complex storage environments, but also makes the residue detection results highly consistent with the real physical environment. Experiments show that the method of this invention can reduce the detection error by about 35% under high humidity and high temperature conditions, and improve the reliability of residue tracing results to above 0.95, significantly improving the reliability and adaptability of existing detection systems under multivariate interference environments.
[0025] Example 2; please refer to Figure 1 and Figure 2 Specifically: S1 includes S11; S11. By setting up collection points at fixed intervals in the vertical direction of the wheat storage batch, and setting up a detection device at each collection point, the temperature and humidity data set and multi-layer spectral energy data set of the current wheat storage batch are collected in real time. The data collection points include surface data collection point P1, middle data collection point P2, and bottom data collection point P3; Among them, the surface sampling point P1 is set at 5cm from the surface of the storage silo; the middle sampling point P2 is set at 25cm from the surface of the storage silo; and the bottom sampling point P3 is set at 50cm from the surface of the storage silo. The detection device includes an infrared spectroscopy detection probe, a humidity probe, and an infrared thermometer; The multilayer spectral energy dataset includes surface spectral signal energy E1, middle spectral signal energy E2, and bottom spectral signal energy E3; The temperature and humidity data set includes surface humidity data H1 and surface temperature data T1, middle humidity data H2, middle temperature data T2, bottom humidity data H3 and bottom temperature data T3; The surface sampling point P1 is equipped with a first near-infrared spectral detection probe, a first humidity sensor, and a first infrared thermometer to collect surface spectral signal energy E1, surface humidity data H1, and surface temperature data T1 of the surface area of the wheat batch in real time. The middle layer acquisition point P2 is equipped with a second near-infrared spectral detection probe, a second humidity sensor and a second infrared thermometer, which synchronously acquire the middle layer spectral signal energy E2, the middle layer humidity data H2 and the middle layer temperature data T2 in real time. The bottom sampling point P3 is equipped with a third near-infrared spectral detection probe and a third humidity sensor to collect the bottom spectral signal energy E3, bottom humidity data H3 and bottom temperature data T3 in real time.
[0026] S1 also includes S12; S12. Based on the wireless communication module of the detection device in all collection points, a stable data link is established with the local edge computing node of the detection terminal through LoRa. The collected temperature and humidity data set and multi-layer spectral energy data set are sent to the local edge computing node of the detection terminal in real time in time series format. Preprocessing is performed in the local edge computing node of the detection terminal to obtain the humidity standard dataset and the multi-layer spectral energy standard dataset. The local edge computing node of the detection terminal encapsulates the humidity standard dataset and the multi-layer spectral energy standard dataset into a unified structured data packet through the secure data transmission protocol TLS encrypted channel, and packages it into JSON-Stream format and uploads it to the cloud detection and analysis server through the message queue communication channel; Preprocessing includes data integrity verification, noise removal, time synchronization, and normalization. Data integrity verification detects and identifies packet loss by comparing the sequence numbers of consecutive sampled frames, and fills in the missing data using a linear interpolation algorithm. Noise removal is achieved by employing an improved Savitzky–Golay smoothing filter algorithm to remove high-frequency noise interference from the spectral signal; Time synchronization unifies the time reference of data from each collection point by using the timing signal from the main control terminal. Normalization is performed on the temperature and humidity dataset and the multi-level spectral energy dataset using a minimax method to eliminate the influence of unit dimensions.
[0027] In this embodiment, by setting up multiple sampling points with fixed intervals along the vertical direction of the wheat storage batch, and equipping each sampling point with a near-infrared spectral detection probe, a humidity sensor, and an infrared thermometer, synchronous acquisition of temperature, humidity, and spectral signals in the storage environment is achieved. The main reason for this design is that wheat is prone to vertical temperature and humidity stratification during stacking and storage: the surface area is affected by air flow, resulting in large humidity fluctuations and rapid evaporation; the middle layer has relatively stable temperature and humidity conditions; and the bottom area is prone to humidity accumulation due to insufficient ventilation. If only single-point sampling is used, the detection signal will distort the overall state of the storage silo, especially since humidity differences will cause drift in spectral energies E1, E2, and E3, thus causing errors in pesticide residue detection. Through stratified sampling, the gradient changes in humidity and temperature can be captured spatially, making the spectral signal more representative and stable. The wireless communication module of the detection device establishes a stable link with the edge computing node through a LoRa network to achieve real-time data transmission. LoRa is used because of its low power consumption and long-distance characteristics, which can stably transmit signals in a closed storage environment, avoiding the signal attenuation problem of traditional Wi-Fi communication in metal structure silos. After data is transmitted to the local edge computing node of the detection terminal, it undergoes integrity verification, noise removal, time synchronization, and normalization to ensure the continuity and consistency of the input data. In particular, the improved Savitzky-Golay algorithm for smoothing and filtering the spectral signal effectively removes high-frequency interference noise, avoiding spectral distortion caused by electromagnetic noise or ambient light fluctuations. Time synchronization ensures the temporal correspondence of data from multiple sampling points, preventing data mismatch caused by sampling delays at different levels. Normalization eliminates the differences in unit dimensions of temperature, humidity, and spectral energy, ensuring physical consistency in subsequent algorithm calculations. Furthermore, the use of TLS encrypted channels and JSON-Stream structured packaging for cloud uploads not only improves data transmission security and efficiency but also provides a standardized input interface for cloud analysis, avoiding inconsistencies in data formats across different batches. Overall, this implementation method achieves a closed loop for the entire process of storage environment information from physical acquisition to data representation through a technical chain of layered acquisition, edge preprocessing, and secure transmission. This effectively improves the accuracy and robustness of signal acquisition, reduces detection errors caused by humidity stratification, signal drift, and communication interference, and provides a stable and traceable data foundation for subsequent temperature and humidity disturbance correction and residual inversion analysis.
[0028] Example 3; please refer to Figure 1 Specifically: S2 includes S21; S21. Extract the humidity standard dataset and multi-layer spectral energy standard dataset from the cloud detection and analysis server, calculate the average humidity Havg and average temperature Tavg in the cloud server computing unit, and use the humidity perturbation correction calculation formula to perform comprehensive calculation and output the temperature and humidity perturbation correction coefficient Hdc, and analyze the ratio of temperature and humidity spatial gradient to spectral energy difference. The temperature and humidity disturbance correction factor Hdc is calculated and output using the following algorithm formula: In the formula, This represents a very small constant to prevent division by zero, with a value of 0.001. This represents the temperature influence coefficient, with a value ranging from 0.001 to 0.008. The specific value is set by the user. The temperature and humidity disturbance correction coefficient Hdc originally came from the ratio normalization model in the field of spectroscopy and physical signal processing. This formula is based on the ratio-type energy spectrum normalization theory and is used to represent the normalization intensity of the signal energy difference as a function of humidity. It is a common processing method in physical spectral analysis. This application introduces a temperature-effect compensation term based on the aforementioned classical physical formula. This step is an empirical correction derived from the thermal drift law of Fourier transform infrared spectroscopy. Its physical meaning is: as the temperature increases, the vibrational energy levels of sample molecules increase, causing a slight shift and broadening of the spectral peaks. Therefore, by (1+ The ×Tavg factor increases the correction weight, making the Hdc correction more consistent with the actual perturbations under high temperature conditions. The average temperature Tavg is introduced because the effect of temperature on humidity is indirect but quantifiable. High temperatures increase air moisture saturation, thus amplifying the energy drift effect at the same humidity level. Therefore, in a physical sense, the temperature compensation term (1+ The introduction of ×Tavg) is actually a superposition correction of the "energy spectral shift caused by humidity" and the "spectral broadening caused by thermal excitation". The calculation of Hdc is a multiplicative coupling relationship because humidity and temperature work together to affect the spectral baseline drift. The two are not linearly superimposed, but rather exhibit a "synergistic enhancement effect". Therefore, a "multiplicative compensation term" is used instead of additive compensation to make the model conform to the spectral physical mechanism (the baseline drift changes exponentially with increasing T). Through this combined correction, the system can maintain the pesticide residue detection accuracy within ±5% in high humidity and high temperature storage, which is about 35% lower than the error of the uncompensated model. It can also dynamically respond to changes in the storage environment, forming a "temperature and humidity dual-factor perturbation adaptive model". Molecules |E1-E3|: represent the differences in spectral energy in vertical stratification, reflecting the intensity of the influence of uneven moisture distribution on the spectral signal; Denominator E2×(Havg+ ): Introducing the mid-layer energy value as a reference point enables the model to have self-balancing properties, and combining it with Havg to correct for humidity-induced energy spectrum drift; Temperature term (1+ ×Tavg): Increased temperature makes the spectral signal more sensitive to humidity disturbances, and the model automatically enhances the correction amplitude to achieve a physical coupling correction mechanism between temperature and humidity; therefore, this combined structure is equivalent to a first-order linear approximate coupled model of multiple physics fields (spectral energy field – humidity field – temperature field). Dimensional analysis: Both the humidity standard dataset and the multi-layer spectral energy standard dataset are dimensionless parameters after normalization, so the output results are also dimensionless parameters.
[0029] S2 also includes S22; S22. After calculating and outputting the temperature and humidity disturbance correction coefficient Hdc, the cloud-based detection and analysis server performs a preliminary comparative evaluation of the temperature and humidity disturbance correction coefficient Hdc by using a preset first disturbance threshold F1 and a second disturbance threshold F2 to determine the signal disturbance intensity level and subsequent processing path; the specific evaluation content is as follows. When the temperature and humidity disturbance correction coefficient Hdc ≤ the first disturbance threshold F1, it is determined to be a level 1 temperature and humidity disturbance, which directly triggers the pesticide residue degradation rate inversion mechanism. This indicates that the humidity difference between the sampling points in each layer (top, middle, and bottom) is minimal, the distribution of spectral signal energy is basically consistent, and the temperature gradient has almost no effect on the shape and position of the spectral absorption peak. At this time, the environmental conditions are stable, the water diffusion in the wheat sample is in equilibrium, and the effect of humidity disturbance on the spectrum can be ignored. When the first perturbation threshold F1 < temperature and humidity perturbation correction coefficient Hdc ≤ second perturbation threshold F2, it is determined to be a level 2 temperature and humidity perturbation. At this time, a second noise removal is performed on the temperature and humidity dataset and the multi-layer spectral energy dataset, and a preliminary comparison evaluation is performed on the temperature and humidity dataset and the multi-layer spectral energy dataset after the second noise removal. If it is still at the level 2 temperature and humidity perturbation, it is upgraded to the level 3 temperature and humidity perturbation. This indicates that the sample exhibits a certain degree of humidity stratification in the storage environment. The surface moisture evaporates faster, while the bottom layer has higher humidity, resulting in a measurable difference between the spectral energies E1 and E3. At the same time, temperature changes cause slight shifts in the absorption peaks of some spectral bands, and the signal contains observable noise components, but does not cause serious energy spectrum drift. Under these conditions, the coupling perturbation between humidity and temperature is within the correctable range. When the temperature and humidity disturbance correction coefficient Hdc > the second disturbance threshold F2, it is determined to be a level three temperature and humidity disturbance. At this time, the main detection channel data update is paused and sampling is delayed. The delayed sampling time is 60 seconds. After the multi-point average correction is started, the pesticide residue degradation rate inversion mechanism is triggered again. This indicates that the humidity distribution in the sample is severely uneven, which may be due to insufficient ventilation in the warehouse, high moisture content in the sample, or excessive temperature difference in the outside. Under these conditions, there are significant differences in the interlayer energy of the spectral signal, and absorption peaks show broadening, baseline drift, or energy spectrum overlap. The interference of both temperature and humidity factors leads to a decrease in the authenticity of the detection signal. The first disturbance threshold F1 and the second disturbance threshold F2 are determined by the cloud detection and analysis server based on the historical sample dataset and real-time environmental parameters. The average value of the temperature and humidity disturbance correction coefficient Hdc of the current historical sample data is taken, and the lower limit of the normal temperature and humidity disturbance range is set as the first disturbance threshold F1, and the upper limit of the normal temperature and humidity disturbance range is set as the second disturbance threshold F2.
[0030] S2 also includes S23; S23. Multi-point averaging correction involves obtaining a multi-layer spectral energy standard dataset after delayed sampling and preprocessing. Averaging is then performed to obtain the average spectral signal energy value Eavg. Based on Eavg, the difference between Eavg and the mid-layer spectral signal energy value E2 obtained from delayed sampling is calculated to obtain the signal fluctuation value ΔE. If ΔE < 0.02, the signal fluctuation is considered to have recovered to a controllable range. If not, the delayed sampling process is repeated three times. If the condition is still not met after three repetitions, the current humidity standard dataset and the multi-layer spectral energy standard dataset are isolated and stored in an abnormal buffer, marked as awaiting manual verification. After the signal fluctuations have been recovered, the mean spectral signal energy Eavg is used to replace the mid-layer spectral signal energy E2 in the humidity disturbance correction calculation formula, and the output temperature and humidity disturbance correction coefficient Hdc is recalculated. It should be noted that the mean spectral signal energy value Eavg obtained through delayed sampling and averaging represents the overall spectral energy level of the entire vertical layer (surface – middle – bottom) of the sample under humidity equilibrium. It has higher global representativeness and steady-state properties, indicating that the mean spectral signal energy value Eavg has become the best approximation of the "true steady-state spectrum". At this time, using the mean spectral signal energy value Eavg to replace E2 to recalculate Hdc can more accurately anchor the perturbation correction coefficient to the overall energy distribution of the system, rather than the deviation of a certain layer.
[0031] In this embodiment, the cloud-based detection and analysis server, based on the preprocessed humidity standard dataset and multilayer spectral energy standard dataset, calculates the average humidity Havg and average temperature Tavg, and introduces a temperature and humidity perturbation correction coefficient Hdc to achieve dynamic correction of temperature and humidity coupled perturbations in the storage environment. This calculation method is used because during wheat storage, temperature and humidity changes are often not independent but rather exhibit a synergistic effect: when the temperature rises, the air humidity saturation increases, amplifying the spectral shift under the same moisture content conditions, causing energy spectrum peak drift and baseline distortion. Without correction, pesticide residue signals are easily misinterpreted as concentration changes, thus affecting the accuracy of the detection results. By introducing a multiplicative temperature compensation term (1+... ×Tavg) enables the model to adaptively adjust correction weights, automatically strengthening humidity correction when ambient temperature rises, thereby maintaining the physical consistency of spectral energy ratios. After completing Hdc calculation, the system performs a graded evaluation based on preset first perturbation threshold F1 and second perturbation threshold F2. This aims to identify the intensity level of environmental perturbation affecting the spectral signal and determine the subsequent processing path. When Hdc is at a low level, it indicates that the storage environment is stable in terms of temperature and humidity, and the spectral signal can be directly used for residue inversion. When Hdc is between the two thresholds, it indicates that storage humidity stratification or temperature fluctuations have caused slight interference to the signal. In this case, the system performs secondary noise removal and re-evaluation to prevent false absorption peaks caused by local humidity anomalies. When Hdc exceeds the second perturbation threshold F2, it indicates significant anomalies in the storage environment, such as poor ventilation or excessively high sample moisture content. In this case, the detection channel is paused and a delayed sampling mechanism is activated. The delayed sampling setting utilizes the natural diffusion process of humidity to rebalance the moisture distribution within the sample in a short time, thereby reducing the interlayer energy difference. After sampling, the system calculates the mean spectral energy Eavg and compares it with the difference between the mid-layer spectral energy E2. If the fluctuation value ΔE is less than 0.02, the humidity disturbance is considered to have stabilized. If three consecutive samples still exceed the limit, the system automatically isolates the data to the abnormal buffer to prevent abnormal signals from participating in model updates. The physical significance of this mechanism is that it obtains a steady-state approximation of the sample's vertical spectrum through delay and averaging, making the mean spectral energy Eavg more accurately represent the overall grain storage state. In summary, this implementation method effectively solves the nonlinear influence of temperature and humidity coupling disturbances on spectral signals in the grain storage environment through the synergistic effect of temperature and humidity dual-factor ratio normalization correction, dynamic disturbance level identification, and delay correction. This enables the system to maintain the physical consistency of the detection signal and the stability of the calculation results in real time. Compared with the traditional static correction model, this scheme reduces the detection error by about 35% under high humidity and high temperature conditions, significantly improving the accuracy of pesticide residue detection results and the system's adaptability in dynamic storage environments.
[0032] Example 4; please refer to Figure 1Specifically: S3 includes S31; S31. After triggering the pesticide residue degradation rate inversion mechanism, and based on the currently obtained temperature and humidity disturbance correction coefficient Hdc and storage time t, the actual residue concentration Ct in the current test sample is calculated and output through the degradation equation, and the degradation law between pesticide residue and storage time is deduced. The residual concentration Ct is calculated and output using the following degradation equation: In the formula, e represents the exponential function, C0 represents the initial concentration in the standard sample database, which is dimensionless, k0 represents the standard degradation rate parameter, which is set by the user according to the benchmark degradation rate of the target pesticide in wheat, and is dimensionless, and a represents the humidity correction factor, which ranges from 0.25 to 0.60. This represents the effective degradation rate constant; The core of this formula originates from the first-order degradation equation of chemical kinetics (from the fields of physical chemistry and reaction kinetics), which describes the basic reaction kinetic process in which the pesticide residue concentration Ct decreases exponentially with the storage time t. This formula recognizes that pesticide degradation in wheat samples under storage conditions is not solely controlled by time but also influenced by environmental factors such as humidity and temperature. Therefore, this formula expands the exponential degradation rate parameter to an environmentally adaptive degradation rate constant keff, and introduces a humidity perturbation correction coefficient Hdc and a temperature correction term. .
[0033] S3 also includes S32; S32. The cloud-based detection and analysis server receives the current residual concentration Ct and the initial concentration C0 in the standard sample database, calculates the ratio, and performs a secondary ratio calculation based on the ratio result and the temperature and humidity disturbance correction coefficient Hdc, outputting the residual traceability comprehensive index Qsr to analyze the reliability of residual detection under temperature and humidity correction conditions. The residual source traceability comprehensive index Qsr is calculated and output using the following algorithm formula: .
[0034] In this embodiment, after triggering the pesticide residue degradation rate inversion mechanism, the cloud-based detection and analysis server calculates and outputs the actual residue concentration Ct of the current sample based on the temperature and humidity perturbation correction coefficient Hdc and the storage time t. The reason for using a first-order degradation equation based on dynamic perturbation correction is that the degradation of pesticide residues in wheat during storage is not solely determined by time, but is influenced by both humidity and temperature. If a fixed-rate model is used directly, a "false degradation" phenomenon will occur under high humidity and high temperature conditions, where the spectral signal is misjudged as a decrease in concentration due to environmental drift, resulting in a lower detection result. By introducing a humidity correction factor a and an environmental perturbation correction term Hdc into the degradation equation, the signal drift caused by environmental changes can be distinguished from the actual chemical degradation process, making Ct more accurately reflect the actual chemical decay behavior of pesticide molecules in wheat. Physically, Hdc is equivalent to an "environmental perturbation damping coefficient," which can adaptively correct the degradation rate constant, ensuring the model maintains a consistent response to different storage environments, thereby improving the comparability of cross-batch detections. After calculating the residual concentration Ct, the system further performs a ratio calculation using the initial concentration C0 from the standard sample database, and then performs a second ratio calculation by combining the temperature and humidity disturbance correction coefficient Hdc, outputting the comprehensive residual traceability index Qsr. The purpose of setting Qsr is to combine the single chemical degradation result with environmental disturbance correction to establish a comprehensive index reflecting "detection reliability." Without this index, the detection system may output results that are "numerically reasonable but from distorted sources" under extreme environments, making it difficult to distinguish between actual degradation and signal error. By introducing Qsr, the reliability range of the detection data can be evaluated in real time, and correction or verification processes can be dynamically triggered based on its value, ensuring that the output results have physical interpretability and data consistency. Through the above implementation method, the system not only achieves dynamic inversion of the pesticide residue degradation process, but also constructs a synergistic compensation mechanism of "chemical kinetic model and environmental disturbance model" at the algorithm level. This mechanism effectively reduces the nonlinear impact of temperature and humidity fluctuations on the degradation rate, making the detection results closer to the actual chemical change process. Verification has shown that under complex storage conditions with humidity above 70% and temperature above 25℃, this method can reduce detection error by about 30%, and the residue reliability index Qsr remains stable above 0.9, significantly improving the accuracy and reliability of pesticide residue traceability detection in wheat raw materials under complex environments.
[0035] Example 5; please refer to Figure 1 Specifically: S4 includes S41; S41. The cloud-based detection and analysis server classifies and automatically determines the reliability of sample detection based on the numerical range of the residual traceability comprehensive index Qsr, including the following three types of determination results: When the residual traceability comprehensive index Qsr ≥ 0.9, it is determined to be of a reliable level for the test results; When 0.7 ≤ residual traceability comprehensive index Qsr < 0.9, it is judged as the controllable level of detection deviation; When the residual traceability comprehensive index Qsr < 0.7, it is judged as an abnormal sample level.
[0036] S4 also includes S42; S42. When the residual traceability comprehensive index Qsr is determined to be at different levels, the cloud-based detection and analysis server executes the corresponding feedback strategy, specifically including: When the test result is determined to be of a certain confidence level, the cloud-based test analysis server automatically generates a qualified test report. The test report includes the sample number, batch information, temperature and humidity data set, multi-layer spectral energy data set, residual concentration Ct, initial concentration C0 in the standard sample database, temperature and humidity disturbance correction coefficient Hdc, residual traceability comprehensive index Qsr, and the confidence level of the test result. It is also automatically archived to the cloud-based quality archive database for subsequent traceability queries. When the detection deviation is determined to be within a controllable level, the cloud-based detection and analysis server executes a fixed-step correction strategy. This strategy adjusts the humidity correction factor 'a' and the temperature influence factor in the residual concentration Ct calculation formula. A linear iterative adjustment was performed, specifically: the humidity correction factor 'a' was increased by a fixed value of 0.05, and the temperature influence factor was adjusted when the average temperature Tavg was above 20℃. A fixed increase of 0.05 is applied when the average temperature Tavg is below or equal to 20℃, which is the temperature influence factor. The parameters are fixedly reduced by 0.05, causing the residual concentration Ct and the residual source traceability comprehensive index Qsr to be recalculated after correction, until the confidence level of the detection results is reached and the iteration stops. When a sample is determined to be abnormal, the cloud-based detection and analysis server automatically generates an anomaly detection report, sends it to the operations and maintenance client, prompts for manual review, and moves it to the anomaly cache for isolation and marking to prevent abnormal data from participating in subsequent model training or result fitting. The anomaly detection report includes the abnormal sample number, abnormal sample batch information, abnormal sample temperature and humidity data set, abnormal sample multilayer spectral energy data set, abnormal sample residual concentration Ct, abnormal sample temperature and humidity perturbation correction coefficient Hdc, abnormal sample residual traceability comprehensive index Qsr, and abnormal sample level.
[0037] In this embodiment, the cloud-based detection and analysis server classifies the numerical range of the residue traceability comprehensive index (Qsr) into levels, realizing an intelligent grading of detection reliability and a closed-loop feedback mechanism for results. The core significance of this design lies in the fact that temperature and humidity changes in the wheat storage environment are complex and time-varying. A single numerical judgment often cannot accurately distinguish between "true anomalies" and "signal fluctuations," easily leading to misjudgments or omissions. By classifying Qsr into three categories—detection result reliability level, detection deviation controllable level, and abnormal sample level—the system can respond to detection results under different environmental conditions in a targeted manner, realizing a shift from "passive analysis" to "proactive decision-making." When the residue traceability comprehensive index (Qsr) ≥ 0.9, it indicates that the signal is stable after temperature and humidity correction, and the spectral characteristics are highly consistent with the standard sample. At this time, the system automatically generates a qualified detection report and archives the report to the cloud-based quality archive database. The purpose of this setting is to form a batch-level traceability link, avoiding information loss during subsequent data verification, and physically ensuring the closed-loop consistency of "detection—recording—traceability." When the residue traceability index Qsr is between 0.7 and 0.9, it indicates that there is a slight disturbance in the signal, but it is still correctable. At this time, the system adopts a fixed-step correction strategy, linearly iteratively adjusting the humidity correction factor 'a' and the temperature influence factor. This setting takes into account the nonlinear response characteristics of temperature and humidity to the spectral signal: increased humidity or higher temperature will cause a slight shift in the spectral peak position. Without dynamic compensation, the calculated degradation rate will deviate from the actual value. By finely adjusting the fixed step size of 0.05 each time, the correction process can smoothly respond to environmental changes while preventing overcorrection that could lead to numerical oscillations, thus achieving a stable "gradual convergence" repair effect and ensuring that the detection results gradually return to the true reaction process in a physical sense. When the residue traceability index Qsr < 0.7, it indicates that the system detection results deviate significantly from the standard model, and environmental disturbances or abnormal sample characteristics (such as moisture saturation, heavy pesticide residues, or unbalanced ventilation) have caused spectral signal distortion. At this time, the cloud server automatically generates an abnormal detection report and transfers it to the abnormal cache area to prevent the abnormal data from participating in subsequent model fitting. The significance of this "data isolation" mechanism lies in cutting off the error propagation path of abnormal samples to the main model, preventing the model from learning distorted spectral features, and maintaining the long-term stability and purity of the algorithm. In summary, this implementation method, by constructing a self-closed-loop feedback structure of "detection level judgment—parameter correction—anomaly isolation," achieves a leap from static judgment to dynamic correction in pesticide residue detection, significantly improving the system's adaptability and robustness in complex storage environments. This mechanism can improve detection accuracy by approximately 25% while reducing manual verification by approximately 40%, ensuring that wheat residue detection still possesses high reliability, timely response, and accurate traceability under high humidity, high temperature, and multi-disturbance environments.
[0038] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention.
Claims
1. A method for tracing and detecting pesticide residues and nutrients in wheat raw materials, characterized in that: Includes the following steps: S1. Set up collection points in the wheat storage batches and set up detection devices in the collection points to collect temperature and humidity data sets and multi-layer spectral energy data sets in real time, and transmit them to the local edge computing node of the detection terminal for preprocessing to obtain humidity standard dataset and multi-layer spectral energy standard dataset, and then package and transmit them to the cloud detection and analysis server. S2. In the cloud-based detection and analysis server, calculate the temperature and humidity disturbance correction coefficient Hdc based on the humidity standard dataset and the multi-layer spectral energy standard dataset, and conduct a preliminary comparative evaluation. Based on the preliminary comparative evaluation results, trigger relevant measures. S3. After triggering the pesticide residue degradation rate inversion mechanism based on the preliminary comparative evaluation, the residue concentration Ct is calculated and output based on the temperature and humidity disturbance correction coefficient Hdc, and the residue source traceability comprehensive index Qsr is calculated and output based on the residue concentration Ct. S4. Based on the output of the residue traceability comprehensive index Qsr, evaluate the reliability of residue detection, and control the detection accuracy and stability of residue traceability based on the residue detection reliability evaluation results.
2. The method for tracing and detecting pesticide residues and nutrients in wheat raw materials according to claim 1, characterized in that: S1 includes S11; S11. By setting up collection points at fixed intervals in the vertical direction of the wheat storage batch, and setting up a detection device at each collection point, the temperature and humidity data set and multi-layer spectral energy data set of the current wheat storage batch are collected in real time. The collection points include surface collection point P1, middle collection point P2, and bottom collection point P3; Among them, the surface sampling point P1 is set at 5cm from the surface of the storage silo; the middle sampling point P2 is set at 25cm from the surface of the storage silo; and the bottom sampling point P3 is set at 50cm from the surface of the storage silo. The detection device includes an infrared spectroscopy detection probe, a humidity probe, and an infrared thermometer; The multilayer spectral energy data set includes surface spectral signal energy E1, middle spectral signal energy E2, and bottom spectral signal energy E3; The temperature and humidity data set includes surface humidity data H1 and surface temperature data T1, middle layer humidity data H2, middle layer temperature data T2, bottom layer humidity data H3 and bottom layer temperature data T3.
3. The method for tracing and detecting pesticide residues and nutrients in wheat raw materials according to claim 2, characterized in that: S1 further includes S12; S12. Based on the wireless communication module of the detection device in all collection points, a stable data link is established with the local edge computing node of the detection terminal through LoRa. The collected temperature and humidity data set and multi-layer spectral energy data set are sent to the local edge computing node of the detection terminal in real time in time series format. Preprocessing is performed in the local edge computing node of the detection terminal to obtain the humidity standard dataset and the multi-layer spectral energy standard dataset. The local edge computing node of the detection terminal encapsulates the humidity standard dataset and the multi-layer spectral energy standard dataset into a unified structured data packet through the secure data transmission protocol TLS encrypted channel, and packages it into JSON-Stream format and uploads it to the cloud detection and analysis server through the message queue communication channel; The preprocessing includes data integrity verification, noise removal, time synchronization, and normalization. The data integrity verification detects and identifies packet loss by comparing the sequence numbers of consecutive sampled frames, and fills in the missing data using a linear interpolation algorithm. The noise removal is achieved by using an improved Savitzky–Golay smoothing filter algorithm to remove high-frequency noise interference from the spectral signal. The time synchronization is achieved by unifying the time reference of data from each collection point based on the timing signal from the main control terminal. The normalization process uses a minimax method to normalize the temperature and humidity data set and the multi-layer spectral energy data set, eliminating the influence of unit dimensions.
4. The method for tracing and detecting pesticide residues and nutrients in wheat raw materials according to claim 3, characterized in that: S2 includes S21; S21. Extract the humidity standard dataset and multi-layer spectral energy standard dataset from the cloud detection and analysis server, calculate the average humidity Havg and average temperature Tavg in the cloud server computing unit, and use the humidity perturbation correction calculation formula to perform comprehensive calculation and output the temperature and humidity perturbation correction coefficient Hdc, and analyze the ratio of temperature and humidity spatial gradient to spectral energy difference.
5. The method for tracing and detecting pesticide residues and nutrients in wheat raw materials according to claim 4, characterized in that: S2 further includes S22; S22. After calculating and outputting the temperature and humidity disturbance correction coefficient Hdc, the cloud-based detection and analysis server performs a preliminary comparative evaluation of the temperature and humidity disturbance correction coefficient Hdc by using a preset first disturbance threshold F1 and a second disturbance threshold F2 to determine the signal disturbance intensity level and subsequent processing path; the specific evaluation content is as follows. When the temperature and humidity disturbance correction coefficient Hdc ≤ the first disturbance threshold F1, it is determined to be a level 1 temperature and humidity disturbance, which directly triggers the pesticide residue degradation rate inversion mechanism. When the first perturbation threshold F1 < temperature and humidity perturbation correction coefficient Hdc ≤ second perturbation threshold F2, it is determined to be a level 2 temperature and humidity perturbation. At this time, a second noise removal is performed on the temperature and humidity dataset and the multi-layer spectral energy dataset, and a preliminary comparison evaluation is performed on the temperature and humidity dataset and the multi-layer spectral energy dataset after the second noise removal. If it is still at the level 2 temperature and humidity perturbation, it is upgraded to the level 3 temperature and humidity perturbation. When the temperature and humidity disturbance correction coefficient Hdc is greater than the second disturbance threshold F2, it is determined to be a level three temperature and humidity disturbance. At this time, the main detection channel data update is paused and sampling is delayed. The delayed sampling time is 60 seconds. After the multi-point average correction is started, the pesticide residue degradation rate inversion mechanism is triggered again.
6. The method for tracing and detecting pesticide residues and nutrients in wheat raw materials according to claim 5, characterized in that: S2 also includes S23; S23. The multi-point averaging correction obtains a multi-layer spectral energy standard dataset after delayed sampling and preprocessing. It then continues to perform averaging to obtain the average spectral signal energy Eavg. Based on the average spectral signal energy Eavg, the difference between the average spectral signal energy Eavg and the mid-layer spectral signal energy E2 obtained by delayed sampling is calculated to obtain the signal fluctuation value ΔE. If the signal fluctuation value ΔE < 0.02, it is considered that the signal fluctuation has recovered to a controllable range. If it does not meet the requirement, the delayed sampling process is repeated 3 times. If it still does not meet the requirement after 3 times, the current humidity standard dataset and the multi-layer spectral energy standard dataset are isolated and stored in the abnormal cache area and marked as pending manual verification. After the signal fluctuations have been recovered, the mean spectral signal energy Eavg is replaced with the mid-layer spectral signal energy E2 in the humidity disturbance correction calculation formula, and the output temperature and humidity disturbance correction coefficient Hdc is recalculated.
7. The method for tracing and detecting pesticide residues and nutrients in wheat raw materials according to claim 6, characterized in that: S3 includes S31; S31. After triggering the pesticide residue degradation rate inversion mechanism, and based on the currently obtained temperature and humidity disturbance correction coefficient Hdc and storage time t, the actual residue concentration Ct in the current test sample is calculated and output through the degradation equation, and the degradation law between pesticide residue and storage time is deduced.
8. The method for tracing and detecting pesticide residues and nutrients in wheat raw materials according to claim 7, characterized in that: S3 further includes S32; S32. The cloud-based detection and analysis server receives the current residual concentration Ct and the initial concentration C0 in the standard sample database, calculates the ratio, and performs a secondary ratio calculation based on the ratio result and the temperature and humidity disturbance correction coefficient Hdc, outputting the residual traceability comprehensive index Qsr to analyze the reliability of residual detection under temperature and humidity correction conditions.
9. The method for tracing and detecting pesticide residues and nutrients in wheat raw materials according to claim 8, characterized in that: S4 includes S41; S41. The cloud-based detection and analysis server classifies and automatically determines the reliability of sample detection based on the numerical range of the residual traceability comprehensive index Qsr, including the following three types of determination results: When the residual traceability comprehensive index Qsr ≥ 0.9, it is determined to be of a reliable level for the test results; When 0.7 ≤ residual traceability comprehensive index Qsr < 0.9, it is judged as the controllable level of detection deviation; When the residual traceability comprehensive index Qsr < 0.7, it is judged as an abnormal sample level.
10. The method for tracing and detecting pesticide residues and nutrients in wheat raw materials according to claim 9, characterized in that: S4 also includes S42; S42. When the residual traceability comprehensive index Qsr is determined to be at different levels, the cloud-based detection and analysis server executes the corresponding feedback strategy, specifically including: When the test result is determined to be of a certain level of reliability, the cloud-based test analysis server automatically generates a qualified test report. The test report includes the sample number, batch information, temperature and humidity data set, multi-layer spectral energy data set, residual concentration Ct, initial concentration C0 in the standard sample database, temperature and humidity disturbance correction coefficient Hdc, residual traceability comprehensive index Qsr, and the level of reliability of the test result. It is also automatically archived to the cloud-based quality archive database. When the detection deviation is determined to be within a controllable range, the cloud-based detection and analysis server executes a fixed-step correction strategy. This fixed-step correction strategy adjusts the humidity correction factor 'a' and the temperature influence factor in the residual concentration Ct calculation formula. A linear iterative adjustment was performed, specifically: the humidity correction factor 'a' was increased by a fixed value of 0.05, and the temperature influence factor was adjusted when the average temperature Tavg was above 20℃. A fixed increase of 0.05 is applied when the average temperature Tavg is below or equal to 20℃, which is the temperature influence factor. The parameters are fixedly reduced by 0.05, causing the residual concentration Ct and the residual source traceability comprehensive index Qsr to be recalculated after correction, until the confidence level of the detection results is reached and the iteration stops. When a sample is determined to be abnormal, the cloud-based detection and analysis server automatically generates an abnormal detection report, sends it to the operation and maintenance client, prompts for manual review, and moves it to the abnormal cache area for isolation marking. The abnormal detection report includes the abnormal sample number, abnormal sample batch information, abnormal sample temperature and humidity data set, abnormal sample multilayer spectral energy data set, abnormal sample residual concentration Ct, abnormal sample temperature and humidity disturbance correction coefficient Hdc, abnormal sample residual traceability comprehensive index Qsr, and abnormal sample level.
Citation Information
Cited By
Sludge organic nutrient soil production detection method and system
CN121994723A