A product content prediction method and system based on big data
By considering environmental factors during the growth of agricultural products in the prediction of pesticide residues, and using big data technology and linear regression models to calculate environmental impact factors and volatility, the problem of low prediction accuracy in the existing technology is solved and a higher level is achieved. Accuracy of pesticide residue prediction.
Patent Information
- Application Number
- CN202410892209.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-07-04
AI Technical Summary
The existing technology ignores the diverse environmental factors in the growth process of agricultural products when predicting pesticide residues, resulting in low accuracy of prediction results.
A method based on big data is adopted to collect pesticide dosage and environmental parameters, use linear regression and Pearson correlation coefficient to calculate environmental impact factors, and adjust prediction values based on deviation values and volatility to establish a more accurate pesticide residue prediction model.
It improves the accuracy of pesticide residue prediction, makes the prediction results closer to the real situation, and provides a more reliable basis for pesticide use strategies in agricultural products.
Smart Images

Figure CN118427495B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of agricultural product content prediction, and in particular to a product content prediction method and system based on big data. Background Art
[0002] Product content prediction of agricultural products is the process of estimating the content of specific ingredients, such as nutrients, harmful substances, and drug residues, in future or current batches of agricultural products through scientific methods and technical means in the field of agricultural production and research. Pesticide residue prediction is a specific application branch of product content prediction, which mainly predicts the content of pesticide components remaining on the surface of crops after pesticide application. The prediction ensures that agricultural products meet safe consumption standards and protects food safety and human health.
[0003] In the process of pesticide residue prediction in the prior art, the common practice is to collect historical data, analyze it as a sample and build a prediction model, and predict the pesticide residue based on the prediction model. For example, the patent document with the authorization announcement number CN111667122B mainly analyzes the distribution and change rules of the pesticide residue content in agricultural products within a preset time period, establishes a pesticide residue risk prediction model and a pesticide residue risk knowledge base based on risk level, uses the average value of the pesticide residue content value of the agricultural product in the previous time as the input sample data and inputs it into the pesticide residue risk prediction model, obtains the predicted value of the pesticide residue of the agricultural product in the next time period, and conducts a preliminary risk assessment of pesticide residue.
[0004] However, the above scheme only builds a prediction model based on the distribution pattern of pesticide residues in historical sample data, which to a certain extent ignores the profound impact of diverse environmental factors on pesticide residues during the growth of agricultural products. This neglect may lead to low accuracy in the prediction results of pesticide residues. Summary of the invention
[0005] In order to solve the problem that the prediction results of pesticide residues are not accurate enough when the prediction model is constructed based on the pesticide residues in the historical sample data, the present invention proposes a product content prediction method and system based on big data. The specific technical scheme is as follows:
[0006] In one aspect, the present invention provides a method for predicting product content based on big data, comprising:
[0007] Collect pesticide residues and multiple environmental parameters corresponding to the amount of pesticides used during the growth of agricultural products;
[0008] The deviation between the predicted value and the actual value of the pesticide residue is obtained by linear regression, and the Pearson correlation coefficient between the environmental parameter and the deviation value is used as the weight, and the environmental parameter is weighted and normalized, and the obtained value is used as the environmental impact factor of the deviation value;
[0009] Preset adjacent intervals of the pesticide dosage, and calculate the volatility of the deviation value in the adjacent interval based on the difference between the deviation value and the average deviation value in the adjacent interval, and the range of the deviation value, wherein the volatility is positively correlated with the difference and negatively correlated with the range;
[0010] An adjustment coefficient of the predicted value is determined based on the volatility, wherein the adjustment coefficient is positively correlated with the volatility; and a final prediction range is determined based on the adjustment coefficient and the influencing factor, wherein the middle value of the final prediction range is used as the final prediction value, wherein the final prediction range is positively correlated with both the adjustment coefficient and the influencing factor.
[0011] The beneficial effect lies in that: the present invention establishes a linear correlation function between pesticide dosage and pesticide residue, uses it as a prediction model, predicts the pesticide residue corresponding to each pesticide dosage, obtains the environmental impact factor of the deviation value according to the deviation value of the pesticide residue corresponding to each pesticide dosage and each environmental parameter data, and can reflect the differentiated impact of environmental factors on the pesticide residue, further obtains adjacent intervals similar to each pesticide dosage, and obtains the adjustment coefficient of the predicted value of the residue corresponding to each pesticide dosage according to the deviation value of the pesticide residue corresponding to the pesticide dosage in the interval, and the adjustment coefficient can reflect the volatility of the predicted value of the pesticide residue in the adjacent interval of each pesticide dosage. Finally, according to the environmental impact factor and the adjustment coefficient, the predicted value of the pesticide residue obtained by the prediction model is adjusted to obtain the final predicted value of each pesticide residue, so that the prediction result is closer to the actual situation and has higher accuracy, which can provide a basis for subsequent agricultural product drug use strategies.
[0012] Furthermore, the environmental impact factor of the deviation value satisfies the following relationship:
[0013]
[0014] In the formula, For the The environmental impact factor of the deviation value is For the The deviation value is Pearson correlation coefficients between environmental parameters, For the The deviation value corresponds to the The value of an environmental parameter. is the item number of the environmental parameter, is the total number of environmental parameters, The value of ] all integers in the range. The beneficial effect is that by comprehensively considering the influence of each environmental parameter on the deviation value and its correlation with the deviation, the weighted summation and normalization processing of the Pearson coefficient is used to effectively quantify the comprehensive influence of environmental factors on the deviation, thereby improving the accuracy of model prediction.
[0015] Furthermore, the adjustment coefficient of the predicted value is ,in, For the The adjustment coefficient of the predicted value of pesticide residue corresponding to the pesticide application amount is For the The beneficial effect is that by analyzing the specific adjustment coefficient of each predicted value and the deviation volatility of the residue in the pesticide dosage interval, the model's adaptability to complex data is enhanced.
[0016] Furthermore, the volatility of the deviation value satisfies the following relationship:
[0017]
[0018] In the formula, For the The number of pesticide application amounts in adjacent intervals of pesticide application amounts, is the serial number of the pesticide usage in the adjacent interval, The value of All integers in the range, For the The adjacent intervals of pesticide application The deviation value of pesticide residue corresponding to the pesticide dosage is is the mean of the deviation values in the adjacent intervals, The beneficial effect is that by calculating the volatility of the pesticide residue deviation in each dosage interval and combining the mean and range of the deviation in the interval, a refined consideration of the dynamic adjustment of the prediction model is achieved, and the accuracy and robustness of the prediction are improved when dealing with complex data fluctuations.
[0019] Further, the method for determining the final prediction range corresponding to the predicted value according to the adjustment coefficient and the influencing factor is: any pesticide dosage is selected as the point to be predicted, and the final prediction range of the pesticide residue corresponding to the point to be predicted is determined as:
[0020] ,in, is the predicted value of the pesticide residue, is the adjustment coefficient of the predicted value, is the maximum positive deviation of the pesticide residue in the adjacent interval of the predicted point, is the maximum negative deviation value, and They are and The corresponding environmental impact factors. The beneficial effect is that the method provides a predicted range of residues for specific pesticide dosages by comprehensively considering the adjustment coefficient, deviation and environmental impact factors, and selects the median as the final prediction result, which enhances the accuracy and practicality of the model prediction and can provide a basis for pesticide management decisions.
[0021] Furthermore, the method for presetting the adjacent intervals of the pesticide dosage is: calculating the difference between the pesticide dosage and other pesticide dosages; dividing the difference into The other pesticide usage in the range is taken as the adjacent interval. The beneficial effect is that by comparing the difference in pesticide dosage to define adjacent intervals and selecting similar dosage as a reference, the pertinence of the model prediction is improved, ensuring that the estimation of pesticide residues is closer to the actual application scenario.
[0022] Furthermore, the method for obtaining the positive deviation and the negative deviation is: among the pesticide residues corresponding to all pesticide dosages in the adjacent interval of the predicted point, if the actual value of the pesticide residue is greater than the predicted value, the deviation value corresponding to the pesticide residue is a positive deviation; if the actual value of the pesticide residue is less than the predicted value, the deviation value corresponding to the pesticide residue is a negative deviation. The beneficial effect is that by directly comparing the actual residue with the predicted value, the positive and negative deviations of each dosage are clearly identified, the direction of the predicted deviation is intuitively reflected, and the accuracy of the model in classifying data deviations and the effectiveness of subsequent processing are improved.
[0023] On the other hand, the present invention also provides a pesticide residue prediction system for agricultural products based on big data, comprising a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the steps of the pesticide residue prediction method for agricultural products described in any one of the above items are implemented.
[0024] The present invention has the following effects:
[0025] The present invention adjusts the predicted value of pesticide residue obtained by the prediction model by analyzing the differentiated impact of the environment on pesticide residues and the volatility of the predicted value of pesticide residues, thereby obtaining a predicted value that is closer to the actual situation, improving the accuracy of pesticide residue prediction, and providing an effective basis for subsequent agricultural product drug use strategies. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0027] Figure 1 It is a schematic diagram of the method flow of the present invention. DETAILED DESCRIPTION
[0028] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0029] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0030] Reference Figure 1 , a product content prediction method based on big data, including S1-S5, as follows:
[0031] S1: Collect pesticide usage and its corresponding pesticide residues and multiple environmental parameters.
[0032] In the process of research on the prediction of pesticide residues in agricultural products, it is necessary to systematically collect relevant data and information. These data and information cover a number of key indicators in the entire growth cycle of agricultural products, including but not limited to pesticide dosage, pesticide residues and multiple environmental parameter data, among which multiple environmental factors can be temperature, humidity, wind speed, wind direction, sunlight intensity, light time, etc.
[0033] In order to ensure that the data can truly reflect the actual growth status of agricultural products, this embodiment presets a collection frequency during the data collection process, for example, collecting data once every two hours, but in actual operation it can be flexibly adjusted according to specific circumstances. Taking temperature and humidity as an example, the ambient climate conditions are continuously monitored at the set frequency through thermometers and hygrometers, and the amount of pesticide used each time is recorded.
[0034] In order to deeply analyze the intrinsic relationship between the pesticide residues in agricultural products and various production data, this embodiment needs to rely on big data analysis methods. To this end, it is necessary to accumulate multiple batches of agricultural product production data as the basis for analysis. Specifically, the average temperature, humidity, average pesticide usage per unit area and pesticide residues of each batch of agricultural products during the entire growth cycle are calculated, and these are used as the pesticide usage, pesticide residues and multiple environmental parameter data of the batch of agricultural products. Among them, the average pesticide usage per unit area refers to the total amount of pesticides used in the production process of the batch of agricultural products divided by the area used for the cultivation of agricultural products.
[0035] By scientifically and orderly collecting and integrating various production data of multiple batches of agricultural products during their growth cycle, we can predict and analyze the pesticide residues in agricultural products.
[0036] S2: Obtaining the deviation between the predicted value and the actual value of the pesticide residue.
[0037] In the process of predicting pesticide residues based on big data, this embodiment uses a support vector regression algorithm to construct a linear function to reveal the actual correlation between pesticide usage and pesticide residue. Since the linear regression function is only fitted based on the support vector, it is necessary to select support vectors with strong representativeness and high accuracy for regression analysis. It is worth noting that due to accidental errors in data collection or special events in the agricultural production process, some data may be abnormal, resulting in the relationship between pesticide usage and residue not being completely linear. In order to ensure that the linear regression function can more accurately reflect the actual correlation between pesticide residue and usage, this embodiment needs to preprocess the collected data.
[0038] The specific operations include the following:
[0039] First, the support vector regression algorithm is used to construct a linear regression model between the collected pesticide residues and pesticide usage data sets. In the coordinate system of the linear regression model, the horizontal axis is usually the independent variable, that is, the pesticide usage, and the vertical axis is the dependent variable, that is, the pesticide residue. Each collected pesticide usage and its corresponding pesticide residue are used as sample data sets. Each data point in the sample data set consists of a pesticide usage and a pesticide residue. In other words, the model attempts to predict the pesticide residue that may be produced at different pesticide usage levels by establishing a linear relationship between pesticide usage and pesticide residue.
[0040] Then, based on the model, the residual sum of squares between all data points and the regression line is calculated. The size of the residual sum of squares directly reflects the degree of deviation of each data point from the regression prediction value. If the residual sum of squares of the overall data points is low, it means that the current regression function fits the actual data well. Set a suitable residual sum of squares threshold , according to the current linear regression function, calculate the residual sum of squares corresponding to all data points. If the residual sum of squares is greater than , it indicates that there may be abnormal data points with significant deviations. In this case, the iterative optimization strategy is followed to remove the data points with the largest residuals first, and then the support vector regression method is re-applied to update the linear regression function. This process will continue until the residual sum of squares of all data points is reduced to less than or equal to the threshold So far, a linear regression function that can better describe the actual relationship between pesticide residues and usage is obtained, which is recorded as Through the above rigorous data screening and optimization steps, this embodiment obtains a high-quality support vector set and establishes a linear regression function that can accurately reflect the relationship between pesticide dosage and residue. Based on the linear regression function, the predicted value of pesticide residue corresponding to each pesticide dosage is obtained.
[0041] Finally, the deviation between the predicted value and the actual value of pesticide residue is calculated, and the deviation is equal to ,in is the difference between the predicted value and the actual value of pesticide residue. , the actual value is , then the deviation value is In the scenario of pesticide residue prediction in this embodiment, the deviation value of each pesticide residue can be used to measure the error degree of the prediction model for the pesticide residue prediction.
[0042] S3: Calculate the environmental impact factor of the deviation value of the predicted value of pesticide residues.
[0043] The method for calculating the environmental impact factor of the deviation value of the predicted value of the pesticide residue is as follows: taking the Pearson correlation coefficient of the environmental parameter and the deviation value as weight, weighted summing the environmental parameters, and taking the obtained value as the environmental impact factor of the deviation value.
[0044] The specific steps include:
[0045] First, the Pearson correlation coefficient between the deviation value of the pesticide residue corresponding to each pesticide dosage and the numerical value of each environmental data corresponding to the pesticide dosage was calculated. The Pearson correlation coefficient is a statistic used to measure the strength of the relationship between two variables. Its value range is between -1 and 1. When the correlation coefficient is 1, it means that the two variables have a strong positive correlation. When the correlation coefficient is -1, it means that the two variables have a strong negative correlation. When the correlation coefficient is 0, it means that the two variables have no linear relationship. The strength of the relationship between the two variables can be obtained, thereby judging the linear correlation between them.
[0046] Specifically, the deviation values of all pesticide residues corresponding to all pesticide dosages are obtained as a set of data, and then the values of each environmental parameter data corresponding to all pesticide dosages are obtained, and the values of each environmental parameter data are taken as a set of data, so as to obtain a plurality of sets of environmental parameter values and a set of pesticide residue deviation values;
[0047] Then, a Pearson correlation analysis was performed based on a set of deviation values of pesticide residues and each set of environmental parameter values, and the Pearson correlation between the deviation value of each pesticide residue in the set of deviation values of pesticide residues and each set of environmental parameter values was calculated, that is, the Pearson correlation coefficient between the deviation value of each pesticide residue and each environmental parameter value. If the calculated Pearson correlation coefficient is close to 1, it can be considered that there is a strong linear relationship between the two variables. If the correlation coefficient is close to 0, it can be considered that there is no linear relationship between the two variables. The Pearson correlation coefficient between the deviation value of the pesticide residue corresponding to each pesticide dosage and the values of each environmental data is helpful to analyze the relationship between environmental factors and the prediction error of pesticide residues.
[0048] Finally, the Pearson correlation coefficient of the environmental parameter and the deviation value is used as the weight, and the environmental parameter is weighted and summed, and the obtained value is used as the environmental impact factor of the deviation value, which satisfies the following relationship:
[0049]
[0050] In the formula, For the Deviation value ( The environmental impact factor of the deviation value of the predicted value of pesticide residue corresponding to the pesticide dosage is For the The deviation value is Pearson correlation coefficient between environmental parameter data, No. The pesticide residues correspond to The value of the environmental parameter data, is the item number of the environmental parameter, is the total number of environmental parameters, The value of ] all integers in the range.
[0051] This step analyzes the Pearson correlation coefficient between each environmental factor data and the deviation value. The Pearson correlation coefficient reflects the degree of influence of each environmental factor on the accuracy of pesticide residue prediction. Specifically, the numerator is a weighted calculation that comprehensively considers the correlation between each environmental factor and the deviation value of pesticide residue. If the Pearson correlation coefficient between an environmental factor and the deviation value of pesticide residue is high, it means that the environmental factor has a greater impact on the accuracy of pesticide residue prediction, and the corresponding comprehensive influence coefficient is higher. The denominator is the cumulative sum of the Pearson coefficients.
[0052] The formula is designed to calculate the environmental impact factor of the deviation value corresponding to each pesticide dosage. It is obtained by quantitatively analyzing the relationship between multiple environmental parameters and the deviation value of pesticide residues. The numerator of the formula reflects the multiplication and accumulation effect of various environmental factors and the prediction error of pesticide residues, and the denominator reflects the overall correlation degree of all environmental factors on the prediction error of pesticide residues. The environmental impact factor is calculated by dividing the two. The numerator expresses the comprehensive influence of environmental factors on the prediction error of pesticide residues, that is, the quantitative superposition effect of the influence of each environmental factor. The denominator plays a normalization role, ensuring that the environmental impact factor is a relative proportional value, reflecting the relative importance of various environmental factors to the accuracy of pesticide residue prediction. Therefore, the higher the value of the environmental impact factor, it means that among all the environmental factors considered, the environmental factor corresponding to the pesticide dosage has a greater impact on the accuracy of its pesticide residue prediction.
[0053] The significance of calculating the environmental impact factor of the deviation value in this step is that it quantifies the impact of environmental factors on the prediction results of pesticide residues, helps to identify which environmental factors play a key role in the accuracy of pesticide residue prediction, and can be used to optimize and adjust the pesticide residue prediction model, correct the prediction results according to changes in environmental factors, and improve the prediction accuracy.
[0054] S4: Preset adjacent intervals of the pesticide usage, calculate the volatility of all deviation values within the adjacent intervals, and determine an adjustment coefficient of the predicted value based on the volatility.
[0055] When predicting the pesticide residue in agricultural products, considering that different environmental factors have different degrees of influence on the prediction results, this implementation takes each pesticide dosage as a benchmark, analyzes the adjacent intervals of the pesticide dosage, and makes detailed adjustments to the predicted value of the pesticide residue corresponding to the pesticide dosage. An adjacent interval is set, and the interval size is L, where L is a preset value and the empirical value is 3. In practical applications, it can be flexibly adjusted according to actual conditions, that is, all pesticide dosages that differ from the pesticide dosage within L are obtained as the adjacent intervals of the pesticide dosage. The adjacent intervals are used to obtain other pesticide dosages similar to the pesticide dosage. By finding pesticide residue instances similar to the pesticide dosage to be predicted in the collected data and analyzing the deviation values corresponding to their residues, the nonlinear relationship between the pesticide dosage and the pesticide residue or potential environmental impact factors can be further analyzed. Based on this information, the prediction model can be corrected or optimized to obtain a more accurate pesticide residue prediction value adjustment coefficient, which is of great significance for improving the accuracy and practicality of pesticide residue prediction.
[0056] Further, the Take the pesticide usage as an example, and obtain all the pesticide usage in its adjacent intervals. The volatility of the deviation value is calculated by the deviation value of the pesticide residue corresponding to all pesticide dosages in adjacent intervals. The specific calculation is based on the following formula:
[0057]
[0058] In the formula, For the The volatility of the deviation value of pesticide residues corresponding to all pesticide dosages in adjacent intervals of pesticide dosages, For the The number of all pesticide application amounts in the adjacent interval of each pesticide application amount, For the The adjacent intervals of pesticide application The deviation value of pesticide residue corresponding to the pesticide dosage is is the mean of the deviation values of pesticide residues in the adjacent intervals, is the range of all deviation values in the adjacent interval (the difference between the maximum and minimum values of all deviation values), Indicates the adjacent interval The difference between the deviation value of pesticide residue corresponding to each pesticide dosage and the mean deviation value is positively correlated with the volatility and negatively correlated with the range.
[0059] Furthermore, the adjustment coefficient of the predicted value of the residue corresponding to the pesticide dosage is ,in, For the The adjustment factor for the predicted value is For the The volatility of the deviation value of the pesticide residue corresponding to all pesticide dosages in the adjacent interval of the pesticide dosage, the adjustment coefficient The meaning is: when the volatility of the deviation value (deviation value of the predicted value of pesticide residue) in adjacent intervals of the predicted pesticide dosage increases, it indicates that the pesticide residue produced near the pesticide dosage may have greater variability. Therefore, a higher adjustment coefficient should be given to expand the prediction range and improve the inclusiveness and robustness of the prediction. It can be seen that the adjustment coefficient is positively correlated with volatility.
[0060] The adjustment coefficient of the predicted value of pesticide residue corresponding to the pesticide dosage calculated in this formula is mainly to reflect the variability of pesticide residue in the adjacent interval near the pesticide dosage, and to make appropriate adjustments to the predicted value accordingly to improve the robustness and accuracy of the prediction. The value of the adjustment coefficient of the predicted value of pesticide residue corresponding to the pesticide dosage will increase with the increase of the volatility of the residual of pesticide residue in the neighborhood. Used to standardize the adjustment coefficient to ensure comparability between different adjacent intervals, reflects the local differences in prediction errors for each pesticide dosage, It reflects the average level of forecast error in adjacent intervals. It is used to measure the fluctuation range of the prediction error of pesticide residues in adjacent intervals. The essence of this formula is to quantify the possible uncertainty of the predicted value of pesticide residues by calculating the standardized variability of the deviation value in adjacent intervals. When the variability of the prediction error of pesticide residues in adjacent intervals increases, The value of will increase, suggesting that a larger adjustment range should be given when making predictions to better accommodate the larger possible range of variation, and then make the predicted value closer to the actual value through the adjustment range.
[0061] This step screens out multiple pesticide residue records that are similar to the pesticide dosage to be predicted, analyzes the differences between the actual pesticide residue values corresponding to these similar pesticide dosages and their predicted values, and calculates their respective deviation values. Based on these deviation value data, an adjustment mechanism for the pesticide residue predicted value applicable to the pesticide dosage to be predicted can be obtained, thereby ensuring that the prediction result is closer to the actual situation.
[0062] S5: Determine a final prediction value corresponding to the prediction value according to the adjustment coefficient and the influencing factor.
[0063] The specific operations include:
[0064] (1) Each pesticide dosage is used as a prediction point;
[0065] (2) Based on the adjustment coefficient of the predicted value of the pesticide residue corresponding to the predicted point and the maximum positive deviation and maximum negative deviation of the pesticide residue in the adjacent interval of the predicted point, determine the preliminary range of the predicted value of the pesticide residue corresponding to the predicted point: ;
[0066] This preliminary range has taken into account the impact of the variability of pesticide residues in the neighborhood of the predicted point on the predicted value by adjusting the coefficient A preliminary expansion has been made to a broad and robust prediction interval, which covers the possible range of variation of the predicted value of the pesticide residue at the predicted point after considering the variability within the neighborhood. The advantage of this is that it can provide more comprehensive information to help decision makers better assess risks, while also improving the robustness of the prediction model in the face of unknown conditions. If the actual measured pesticide residue falls within this range, then the model's prediction can be considered to be more accurate and reliable.
[0067] in, is the predicted value of the pesticide residue, is the adjustment coefficient of the predicted value, is the maximum positive deviation of the pesticide residue in the adjacent interval of the predicted point, is the maximum negative deviation value. The predicted value of the pesticide residue corresponding to the predicted point is obtained through a linear correlation function, and the method for obtaining the positive deviation and negative deviation is: among the pesticide residues corresponding to all pesticide dosages in the adjacent interval of the predicted point, if the actual value of the pesticide residue is greater than the predicted value, the deviation value corresponding to the pesticide residue is a positive deviation, and if the actual value of the pesticide residue is less than the predicted value, the deviation value corresponding to the pesticide residue is a negative deviation.
[0068] In order to make up for the shortcomings of historical data and deviation analysis, the additional disturbances that may be caused by environmental factors are taken into account to make the prediction range closer to the actual situation. The environmental impact factor corresponding to the maximum positive deviation and the environmental impact factor corresponding to the maximum negative deviation are used to adjust the preliminary range to obtain the final prediction range of the pesticide residue corresponding to the predicted point:
[0069] in, and They are and The corresponding environmental impact factor is obtained by: and The corresponding pesticide dosage, pesticide residue, and each environmental parameter data, because each pesticide dosage corresponds to a pesticide residue, a predicted value of pesticide residue, and multiple environmental parameter data, and then use the environmental impact factor calculation formula in S3 to calculate and environmental influencing factors, and it can be seen that the final prediction range is positively correlated with both the adjustment coefficient and the influencing factor.
[0070] (4) The median of the final prediction range is selected as the final prediction value of the pesticide residue corresponding to the predicted point, because the median is more resistant to the influence of extreme values and can better reflect the central trend of the predicted value than the mean value (if there are extreme values). In summary, through the above operations, not only can the robustness of the prediction model be enhanced, but also the influence of environmental factors on pesticide residues can be combined to improve the prediction accuracy and provide support for pesticide residue management decisions.
[0071] In a specific example, Take the pesticide dosage as an example and calculate the corresponding predicted value of pesticide residue , No. The adjustment coefficient of the predicted value of pesticide residue corresponding to the pesticide application amount , No. The maximum positive deviation in adjacent intervals of pesticide application is , the maximum negative deviation is , the environmental impact factor of the deviation value corresponding to the maximum positive deviation is , the environmental impact factor of the deviation value corresponding to the maximum negative deviation is , then The final range of predicted values of pesticide residues corresponding to the pesticide dosage is:
[0072]
[0073] In this way, the final range of predicted values of pesticide residues corresponding to each pesticide dosage can be obtained. and As the upper and lower limit adjustment values of the final prediction range, the environmental impact factor is added to calculate and , which can reflect the specific impact of environmental factors on the predicted range of pesticide residues, and take the middle value of the final range as the final predicted value to obtain a more accurate and comprehensive prediction result.
[0074] The present invention also provides a product content prediction system based on big data technology. The system is configured with a high-performance processor unit and a large-scale storage device. The storage device is loaded with a computer program that can be executed on the processor unit. When the program is executed, the steps in the product content prediction method based on big data technology can be implemented:
[0075] Through the pre-set data collection frequency, the pesticide usage, pesticide residues and related environmental parameter data during the growth period of agricultural products are collected and stored;
[0076] Based on the large amount of stored data, a linear regression algorithm is used to build a mathematical model between pesticide usage and pesticide residues, so as to obtain the initial value of pesticide residue prediction corresponding to each pesticide usage;
[0077] The environmental impact factor of the deviation value is calculated by combining the predicted deviation value of the pesticide residue corresponding to each pesticide usage amount with the Pearson correlation coefficient between the environmental parameter data;
[0078] For each pesticide usage, set the adjacent pesticide usage interval, and determine the adjustment coefficient of the predicted value of pesticide residue according to the residual of pesticide residue corresponding to all pesticide usage in the interval;
[0079] According to the calculated environmental impact factors and the adjustment coefficients of the predicted values, the initial values of the pesticide residue prediction are finely adjusted to obtain a more accurate final prediction result;
[0080] In addition, the system has a data preprocessing function that can automatically identify and remove outliers to ensure the data quality of the input model. The system supports custom adjacent intervals of pesticide usage and can automatically select the maximum positive and negative values of the pesticide residue prediction error (i.e., the maximum positive deviation and the maximum negative deviation) according to the set interval range. The system is equipped with a user-friendly interface that can display the prediction results, environmental parameter change trends, and prediction error analysis in real time, and can update the prediction model in real time based on the newly entered data to ensure the accuracy and timeliness of the prediction results.
[0081] In the description of this specification, "plurality" or "several" means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.
[0082] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.
Claims
1. A product content prediction method based on big data, characterized in that: include: Collect pesticide residues and multiple environmental parameters corresponding to the amount of pesticides used during the growth of agricultural products; Obtain the predicted value of the pesticide residue by linear regression, take the absolute value of the difference between the predicted value and the actual value as the deviation value of the predicted value, take the Pearson correlation coefficient of the environmental parameter and the deviation value as the weight, perform weighted summation on the environmental parameter, and take the obtained value as the environmental impact factor of the deviation value; Preset adjacent intervals of the pesticide dosage, and calculate the volatility of all deviation values in the adjacent intervals according to the difference between the deviation value in the adjacent intervals and the average deviation value, and the range of the deviation value, wherein the volatility is positively correlated with the difference and negatively correlated with the range; The volatility of all the deviation values satisfies the following relationship: ; In the formula, For the The volatility of the deviation values of all predicted values in the adjacent interval of pesticide usage corresponding to the predicted value, For the The number of pesticide usage in adjacent intervals corresponding to the predicted value, is the serial number of the pesticide dosage, The value of All integers in the range, For the The adjacent interval of pesticide application corresponding to the predicted value The deviation value of the predicted value of pesticide residue corresponding to the pesticide dosage, is the mean of the deviation values of all predicted values in the adjacent intervals, is the range of deviation values of all predicted values in the adjacent interval; An adjustment coefficient for the predicted value is determined based on the volatility, and the adjustment coefficient for the predicted value is: ,in, For the The adjustment factor for the predicted value is For the The volatility of the deviation values of all predicted values in the adjacent intervals of the pesticide dosage corresponding to the predicted value, the adjustment coefficient is positively correlated with the volatility, and the method for determining the final prediction range according to the adjustment coefficient and the environmental impact factor is: any pesticide dosage is selected as the point to be predicted, and the final prediction range of the pesticide residue corresponding to the point to be predicted is determined as: ;in, is the predicted value of the pesticide residue corresponding to the point to be predicted, is the adjustment coefficient of the predicted value, is the maximum positive deviation of all predicted values in the adjacent interval of the point to be predicted, is the maximum negative deviation, and They are and The corresponding environmental impact factor, the final prediction range is positively correlated with the adjustment coefficient and the environmental impact factor, and the middle value of the final prediction range is taken as the final prediction value.
2. The method for predicting product content based on big data according to claim 1, characterized in that: The environmental impact factor of the deviation value satisfies the following relationship: ; In the formula, For the The environmental factors affecting the deviation of the predicted values are: For the The deviation value of the predicted value is Pearson correlation coefficients between environmental parameters, For the The deviation value of the predicted value corresponds to the The value of an environmental parameter. is the item number of the environmental parameter, is the total number of environmental parameters, The value of ] all integers in the range.
3. The method for predicting product content based on big data according to claim 1, characterized in that: The method for presetting the adjacent intervals of the pesticide dosage is: Calculate the difference between the amount of the pesticide used and the amount of other pesticides used, and divide the difference into The other pesticide dosages within the range are taken as the adjacent intervals of the pesticide dosage. is the default value.
4. The method for predicting product content based on big data according to claim 1, characterized in that: The method for obtaining the positive deviation and the negative deviation is: Among all the pesticide residues corresponding to all the pesticide usages in the adjacent interval of the point to be predicted, if the actual value of a certain pesticide residue is greater than the predicted value, the deviation value of the predicted value of the pesticide residue is a positive deviation; if the actual value of a certain pesticide residue is less than the predicted value, the deviation value of the predicted value of the pesticide residue is a negative deviation.
5. A product content prediction system based on big data technology, characterized in that: The method comprises a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the steps in the prediction method according to any one of claims 1 to 4 can be implemented.
