Agricultural product quality detection method based on big data analysis
By processing agricultural product quality testing data using weighted K-nearest neighbor interpolation and Z-score standardization, and combining Hotelling T² control charts and the two-factor EWMA method, a dynamic quality benchmark is constructed and multi-indicator judgment is performed. This solves the problem of insufficient multi-source data processing and achieves accuracy in agricultural product quality testing and closed-loop management.
Patent Information
- Application Number
- CN202611386966.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-08
- Publication Date
- 2026-11-24
AI Technical Summary
Existing agricultural product quality testing methods lack the ability to process multi-source heterogeneous data, making it difficult to eliminate the impact of missing data, outliers, and dimensional differences. They also lack dynamic modeling capabilities, cannot accurately reflect quality fluctuations, leading to misjudgments or omissions, and have weak early warning capabilities for potential risks.
The weighted K-nearest neighbor interpolation algorithm and Z-score standardization method are used to process quality inspection data, construct a dynamic quality benchmark for agricultural product batches, and use Hotelling T² control charts and two-factor adaptive EWMA method to jointly determine deviations of multiple indicators, generate quality status color labels, and trigger corresponding management strategies.
It improved the completeness and accuracy of data processing, enhanced the dynamic adaptability of quality judgment and the efficiency of batch sorting, and realized the closed-loop management of agricultural product quality.
Smart Images

Figure CN123159989A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of agricultural product quality testing technology, and in particular to an agricultural product quality testing method based on big data analysis. Background Technology
[0002] With the continuous expansion of agricultural product circulation and the ongoing improvement of the digitalization level of the agricultural supply chain, agricultural product quality testing and grading management technologies based on multi-source data fusion are gradually becoming important means to ensure food safety and improve circulation efficiency. Existing technologies typically rely on single-indicator testing or rule-based empirical grading methods to statically determine or simply screen agricultural product quality using thresholds. In complex circulation environments, these methods struggle to accurately reflect batch-level quality fluctuations. Existing agricultural product quality testing methods generally suffer from the following problems:
[0003] On the one hand, quality testing data comes from diverse sources, covering multiple stages such as production, warehousing, transportation, and sales feedback. However, existing methods are insufficient in processing multi-source heterogeneous data, often only performing simple normalization or single-dimensional fusion, which is difficult to effectively eliminate the impact of missing data, outliers, and differences in units of measurement. This results in incomplete construction of quality evaluation indicators, affecting the stability and consistency of subsequent analysis results. On the other hand, traditional methods are mostly based on fixed thresholds or static statistical models for quality judgment, lacking the ability to dynamically model the distribution characteristics of historical qualified batch data. They cannot effectively characterize the normal fluctuation range of agricultural product quality under different categories, origins, and circulation conditions, resulting in poor adaptability of quality benchmarks. In the event of environmental changes or supply chain disturbances, misjudgments or omissions are likely to occur. In addition, existing methods are insufficient in batch-level quality evolution analysis, usually ignoring the correlation and synergistic changes between quality indicators. It is difficult to effectively identify the joint deviation behavior of multiple indicators, resulting in weak early warning capabilities for potential quality risks, which in turn affects the effectiveness of hierarchical decision-making and risk control in the agricultural product circulation process.
[0004] Therefore, how to provide a method for agricultural product quality testing based on big data analysis is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] One objective of this invention is to propose a method for agricultural product quality inspection based on big data analysis. This invention fully utilizes the weighted K-nearest neighbor interpolation algorithm, the Hotelling T² control chart method, and the two-factor adaptive EWMA method to preprocess production, storage, transportation, testing, and circulation feedback data of target agricultural product batches, extract quality evaluation indicators, construct target quality feature vectors, update dynamic quality benchmarks, and perform multi-indicator joint deviation judgment. It also triggers corresponding batch diversion and quality management strategies through quality status color identification. It has the advantages of high data processing integrity, high accuracy of quality judgment, strong dynamic adaptability, high batch diversion efficiency, and strong closed-loop quality management.
[0006] According to an embodiment of the present invention, a method for detecting the quality of agricultural products based on big data analysis includes the following steps:
[0007] Step 1: Obtain basic quality inspection data for the target agricultural product batch, and preprocess the basic quality inspection data using the weighted K-nearest neighbor interpolation algorithm and Z-score standardization method to obtain a standard batch quality dataset;
[0008] Step 2: Based on the standard batch quality dataset, extract the agricultural product quality evaluation indicators for the target agricultural product batch;
[0009] Step 3: Based on agricultural product quality evaluation indicators, construct the target quality feature vector for the target agricultural product batch;
[0010] Step 4: Based on qualified historical agricultural product batch data, construct a dynamic quality benchmark for agricultural product batches using the Hotelling T² control chart method;
[0011] Step 5: Dynamically update the batch dynamic quality benchmark of agricultural products using the two-factor adaptive EWMA method;
[0012] Step 6: Based on the target quality feature vector and the dynamic quality benchmark of agricultural product batches, the quality status of the target agricultural product batch is judged by the joint deviation judgment rule of multiple indicators, the quality status color label is obtained, and sent to the batch diversion control terminal;
[0013] Step 7: The batch diversion control terminal triggers the quality management strategy for the target agricultural product batch based on the quality status color indicator;
[0014] Step 8: Write the quality status color code, quality management strategy, and strategy implementation information into the agricultural product quality testing database, and update the batch status of the target agricultural product batch based on the strategy implementation information.
[0015] Optionally, the basic data for quality inspection includes batch identification data, production source data, warehousing environment data, transportation environment data, historical quality inspection data, real-time testing data, and circulation feedback data.
[0016] Optionally, the preprocessing of the basic quality inspection data using the weighted K-nearest neighbor interpolation algorithm and the Z-score normalization method specifically includes:
[0017] Based on batch identity data, production source data, warehousing environment data, transportation environment data, historical quality inspection data, real-time monitoring data, and circulation feedback data are aggregated to obtain a sample set of agricultural product batches;
[0018] Identify missing fields in the agricultural product batch sample set, determine agricultural product batch samples containing missing fields as batch samples to be interpolated, and determine the missing fields in the batch samples to be interpolated as target missing fields;
[0019] Based on the data category to which the target missing field belongs, select agricultural product batch samples from the agricultural product batch sample set that have the same agricultural product category, the same place of origin, and the same harvest season as the batch samples to be interpolated, and whose target missing field has a field value, as candidate neighboring batch samples;
[0020] Read the numeric fields with field values that are both in the batch samples to be interpolated and in each candidate neighboring batch samples, and use them as common reference fields;
[0021] The field weight is determined based on the data category to which each common reference field belongs;
[0022] Based on the field values and corresponding field weights of the common reference field, the weighted Euclidean distance between the batch sample to be interpolated and each candidate neighboring batch sample is calculated.
[0023] The K nearest neighbor sample set is formed by selecting the top K candidate nearest neighbor batches in ascending order of weighted Euclidean distance.
[0024] The reciprocal of the sum of the weighted Euclidean distance and the non-zero constant of each candidate neighbor batch sample in the K-nearest neighbor sample set is used as the interpolation weight;
[0025] Based on the field values and corresponding interpolation weights of each candidate neighboring batch sample in the K-nearest neighbor sample set for the target missing field, the interpolation field value of the target missing field is calculated.
[0026] The interpolation field value is filled into the target missing field of the batch sample to be interpolated, and the numerical missing fields in the agricultural product batch sample set are interpolated sequentially to obtain the complete batch sample set.
[0027] For the numerical fields in the completed batch sample set, the field mean and field standard deviation are calculated, and the numerical fields are standardized using the Z-score method to obtain standardized field values;
[0028] Standardized field values are encapsulated according to the target agricultural product batches to generate a standard batch quality dataset.
[0029] Optionally, the agricultural product quality evaluation indicators include appearance quality indicators, specification grade indicators, freshness indicators, safety risk indicators, storage stability indicators, transportation loss indicators, historical anomaly indicators, and sales feedback indicators.
[0030] Optionally, step three specifically includes:
[0031] Establish a mapping relationship between agricultural product quality evaluation indicators and standardized field values in standard batch quality datasets;
[0032] Based on the indicator mapping relationship, the standardized field values mapped to the same agricultural product quality evaluation indicator are formed into an indicator field value set, and the indicator statistical characteristics of each agricultural product quality evaluation indicator are calculated based on the indicator field value set.
[0033] The statistical features of the indicators include the current value of the indicator, the mean value of the indicator, the maximum value of the indicator, the minimum value of the indicator, the fluctuation value of the indicator, the missing indicator completion flag, and the abnormal indicator flag;
[0034] Based on the order of agricultural product quality evaluation indicators and the order of their statistical characteristics, the statistical characteristics of each agricultural product quality evaluation indicator are vectorized and arranged to construct a target quality feature vector.
[0035] Optionally, step four specifically includes:
[0036] Based on the agricultural product category, place of origin, harvest season, storage conditions and distribution path of the target agricultural product batch, qualified historical agricultural product batch data are screened from the agricultural product quality testing database to obtain a sample set of qualified historical batches.
[0037] The agricultural product quality testing database is used to store historical agricultural product batch data, newly added agricultural product batch data, quality status color indicators, quality management strategies, strategy implementation information, and dynamic quality benchmarks for agricultural product batches.
[0038] Using the same indicator system as the agricultural product quality evaluation indicators, quality features are extracted from each historical qualified batch sample in the historical qualified batch sample set to obtain historical quality feature vectors, and a historical quality feature vector set is formed.
[0039] Calculate the mean vector of the historical quality feature vector set to obtain the mean vector of quality indicators;
[0040] Calculate the sample covariance matrix based on the historical quality feature vector set and the quality index mean vector;
[0041] Based on the sample covariance matrix, the Ledoit-Wolf shrinkage covariance estimation method is used to calculate the shrinkage covariance matrix of the quality index;
[0042] A confidence level was set, and the number of agricultural product quality evaluation indicators was determined as the first degree of freedom, while the difference between the number of historical qualified batches and the number of agricultural product quality evaluation indicators was determined as the second degree of freedom.
[0043] Substitute the confidence level, the first degree of freedom, and the second degree of freedom into the F-distribution quantile function to determine the critical value of the F-distribution.
[0044] The first control limit is obtained by multiplying the number of agricultural product quality evaluation indicators, the number of historical qualified batches plus one, and the number of historical qualified batches minus one.
[0045] The second control limit is obtained by multiplying the number of historical qualified batches and the difference between the number of historical qualified batches and the number of agricultural product quality evaluation indicators.
[0046] The ratio of the first control limit to the second control limit is determined as the control limit scaling factor;
[0047] The product of the control limit scaling coefficient and the critical value of the F distribution is used as the T² control limit;
[0048] The T² control limit is scaled proportionally to obtain a low deviation threshold and a concern deviation threshold, wherein the low deviation threshold is smaller than the concern deviation threshold.
[0049] The mean vector of quality indicators, the shrinkage covariance matrix of quality indicators, the T² control limit, the low deviation threshold, and the deviation threshold of concern are used to form the dynamic quality benchmark for agricultural product batches.
[0050] Optionally, step five specifically includes:
[0051] When newly qualified agricultural product batch data is written into the agricultural product quality testing database, the newly qualified batch sample set is obtained according to the update cycle, and based on the newly qualified batch sample set, the mean vector of candidate quality indicators, the shrinkage covariance matrix of candidate quality indicators, the candidate T² control limit, the candidate low deviation threshold and the candidate attention deviation threshold are calculated.
[0052] Calculate the ratio of the number of newly qualified batch samples in the current update cycle to the total number of baseline updated samples to obtain the sample size proportion; the total number of baseline updated samples includes the number of newly qualified batch samples in the current update cycle and the number of historical qualified batch samples in the previous update cycle.
[0053] Calculate the vector distance between the candidate quality indicator mean vector and the quality indicator mean vector of the previous update period, and determine the mean baseline offset as the ratio between the vector distance and the magnitude of the quality indicator mean vector of the previous update period.
[0054] Calculate the matrix distance between the shrinkage covariance matrix of the candidate quality index and the shrinkage covariance matrix of the quality index in the previous update period, and determine the ratio between the matrix distance and the matrix norm of the shrinkage covariance matrix of the quality index in the previous update period as the covariance benchmark offset.
[0055] The average of the mean baseline offset and the covariance baseline offset is used as the composite baseline offset;
[0056] Calculate the ratio of the comprehensive baseline offset to the constant 1 and the sum of the comprehensive baseline offsets to obtain the baseline offset response ratio;
[0057] The average of the sample size proportion and the baseline offset response proportion is used as the EWMA smoothing coefficient for the current update period.
[0058] The dynamic quality benchmark for agricultural product batches is updated based on the EWMA smoothing coefficient of the current update cycle, specifically as follows:
[0059] The weighted average of each vector element in the candidate quality indicator mean vector and the vector element at the same position in the quality indicator mean vector of the previous update period is updated to obtain the quality indicator mean vector of the current update period.
[0060] The quality index shrinkage covariance matrix of the current update period is obtained by weighted averaging the matrix elements in the candidate quality index shrinkage covariance matrix and the matrix elements in the same position in the quality index shrinkage covariance matrix of the previous update period.
[0061] The candidate T² control limits are updated by weighted averaging with the T² control limits of the previous update period to obtain the T² control limits of the current update period.
[0062] The candidate low deviation threshold is updated by weighted averaging with the low deviation threshold of the previous update period to obtain the low deviation threshold of the current update period.
[0063] The candidate attention deviation threshold is updated by weighted averaging with the attention deviation threshold of the previous update period to obtain the attention deviation threshold of the current update period.
[0064] Optionally, step six specifically includes:
[0065] Calculate the vector difference between the target quality feature vector and the mean vector of quality indicators to obtain the target quality deviation vector;
[0066] The Hotelling T² statistic for the target agricultural product batch is obtained by multiplying the transpose of the target quality deviation vector, the inverse of the quality index shrinkage covariance matrix, and the target quality deviation vector.
[0067] The quality status of a target agricultural product batch is determined by a multi-indicator joint deviation judgment rule, specifically including:
[0068] When the Hotelling T² statistic is less than or equal to the low deviation threshold, the target agricultural product batch is identified as a priority circulation batch, and the quality status color of the target agricultural product batch is set to green.
[0069] When the Hotelling T² statistic is greater than the low deviation threshold and less than or equal to the deviation of concern threshold, the target agricultural product batch is judged as a normal qualified batch, and the quality status color of the target agricultural product batch is determined to be blue.
[0070] When the Hotelling T² statistic is greater than the deviation threshold but less than or equal to the T² control limit, the target agricultural product batch is identified as a batch of quality concern, and the quality status color of the target agricultural product batch is set to yellow.
[0071] When the Hotelling T² statistic exceeds the T² control limit, the target agricultural product batch is identified as an abnormal interception batch, and the quality status color of the target agricultural product batch is set to red.
[0072] The quality status color identifier of the target agricultural product batch is sent to the batch distribution control terminal.
[0073] Optionally, the quality management strategy for the target agricultural product batch specifically includes:
[0074] When the quality status color is green, the priority of the target agricultural product batch for warehousing is set to priority warehousing level, the distribution channel is set to priority distribution channel, and the sales method is set to priority sales method;
[0075] When the quality status color is blue, the warehousing priority of the target agricultural product batch is set to normal warehousing level, the warehousing method is set to regular warehousing method, and the sales method is set to regular sales method.
[0076] When the quality status color is yellow, the sales method for the target agricultural product batch is determined to be a graded sales method, the storage control method is determined to be a storage temperature and humidity control method, and the batch tracking method is determined to be a key tracking method.
[0077] When the quality status color is red, the circulation status of the target agricultural product batch is determined to be circulation interception status, the testing and handling method is determined to be re-inspection method, and the batch verification method is determined to be traceability verification method.
[0078] Optionally, the strategy execution information includes warehousing execution information, circulation execution information, sales execution information, warehousing control execution information, re-inspection execution information, circulation interception execution information, and traceability verification execution information;
[0079] The batch status includes warehousing status, circulation status, tiered sales status, warehousing control status, re-inspection status, circulation interception status, and traceability verification status;
[0080] When the quality status color of the target agricultural product batch is green or blue, and the batch status corresponding to the strategy execution information is in the "in storage" or "circulated" state, the target agricultural product batch will be marked as a newly added qualified batch sample.
[0081] The beneficial effects of this invention are:
[0082] This invention employs a weighted K-nearest neighbor interpolation algorithm and a Z-score standardization method to perform batch aggregation, missing field completion, and dimensional unification processing on the basic quality inspection data of target agricultural product batches. This reduces the impact of missing values, field scale differences, and incomplete batch data in multi-source quality data on subsequent quality analysis, improving the completeness and comparability of the standard batch quality dataset. Furthermore, by establishing an indicator mapping relationship between agricultural product quality evaluation indicators and standardized field values, a target quality feature vector is constructed, enhancing the comprehensiveness and structure of the expression of the quality status of target agricultural product batches. In the dynamic quality benchmark construction stage, based on qualified historical agricultural product batch data, the Hotelling T² control chart method is used to construct a dynamic quality benchmark for agricultural product batches. The Ledoit-Wolf shrinkage covariance estimation method is used to calculate the shrinkage covariance matrix of quality indicators, reducing the impact of insufficient sample size or strong correlation of quality indicators on the instability of the covariance matrix in benchmark construction, and improving the stability of the multi-indicator joint quality benchmark. A two-factor adaptive EWMA method is used to calculate the sample size proportion and benchmark shift response proportion, and the dynamic quality benchmark for agricultural product batches is dynamically updated, improving the adaptability of the quality benchmark under different categories, origins, seasons, storage conditions, and distribution paths. By calculating the Hotelling T² statistic of a target agricultural product batch using a multi-indicator joint deviation judgment rule, and generating green, blue, yellow, or red quality status color indicators, the batch diversion control terminal triggers the corresponding quality management strategy to achieve priority circulation, normal sales, tiered control, and anomaly interception of agricultural product batches. Therefore, this invention can improve the data integrity, quality judgment accuracy, dynamic benchmark adaptability, batch diversion efficiency, and quality management closed-loop capability of agricultural product quality testing. Attached Figure Description
[0083] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0084] Figure 1 This is a schematic diagram of an agricultural product quality testing method based on big data analysis proposed in this invention;
[0085] Figure 2 This is a flowchart illustrating the use of the Hotelling T² control chart method to construct dynamic quality benchmarks for agricultural product batches in a big data-based agricultural product quality testing method proposed in this invention.
[0086] Figure 3 This is a flowchart illustrating how a method for detecting agricultural product quality based on big data analysis, proposed in this invention, uses a multi-indicator joint deviation judgment rule to determine the quality status of a target agricultural product batch. Detailed Implementation
[0087] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0088] refer to Figures 1-3 A method for detecting agricultural product quality based on big data analysis includes the following steps:
[0089] Step 1: Obtain basic quality inspection data for the target agricultural product batch, and preprocess the basic quality inspection data using the weighted K-nearest neighbor interpolation algorithm and Z-score standardization method to obtain a standard batch quality dataset;
[0090] Step 2: Based on the standard batch quality dataset, extract the agricultural product quality evaluation indicators for the target agricultural product batch;
[0091] Step 3: Based on agricultural product quality evaluation indicators, construct the target quality feature vector for the target agricultural product batch;
[0092] Step 4: Based on qualified historical agricultural product batch data, construct a dynamic quality benchmark for agricultural product batches using the Hotelling T² control chart method;
[0093] Step 5: Dynamically update the batch dynamic quality benchmark of agricultural products using the two-factor adaptive EWMA method;
[0094] Step 6: Based on the target quality feature vector and the dynamic quality benchmark of agricultural product batches, the quality status of the target agricultural product batch is judged by the joint deviation judgment rule of multiple indicators, the quality status color label is obtained, and sent to the batch diversion control terminal;
[0095] Step 7: The batch diversion control terminal triggers the quality management strategy for the target agricultural product batch based on the quality status color indicator;
[0096] Step 8: Write the quality status color code, quality management strategy, and strategy implementation information into the agricultural product quality testing database, and update the batch status of the target agricultural product batch based on the strategy implementation information.
[0097] In this invention, the two-factor adaptive EWMA method introduces two factors—sample size proportion and benchmark offset response proportion—based on the exponentially weighted moving average update concept. It adaptively determines the EWMA smoothing coefficient for the current update period and uses this coefficient to update the dynamic quality benchmark for agricultural product batches. Specifically, the sample size proportion represents the percentage of newly added qualified batch samples in the current update period within the total number of updated benchmark samples, while the benchmark offset response proportion represents the degree of deviation of the candidate quality benchmark relative to the quality benchmark of the previous update period. When the number of newly added qualified batch samples is large or the deviation of the candidate quality benchmark is large, the EWMA smoothing coefficient increases accordingly, allowing the dynamic quality benchmark for agricultural product batches to absorb the new batch data more quickly. Conversely, when the number of newly added qualified batch samples is small or the deviation of the candidate quality benchmark is small, the EWMA smoothing coefficient decreases accordingly, keeping the dynamic quality benchmark for agricultural product batches stable.
[0098] In this embodiment, the basic data for quality inspection includes batch identification data, production source data, warehousing environment data, transportation environment data, historical quality inspection data, real-time testing data, and circulation feedback data.
[0099] In this embodiment, the basic data for quality inspection is preprocessed using a weighted K-nearest neighbor interpolation algorithm and a Z-score normalization method, specifically including:
[0100] Based on batch identity data, production source data, warehousing environment data, transportation environment data, historical quality inspection data, real-time monitoring data, and circulation feedback data are aggregated to obtain a sample set of agricultural product batches;
[0101] Identify missing fields in the agricultural product batch sample set, determine agricultural product batch samples containing missing fields as batch samples to be interpolated, and determine the missing fields in the batch samples to be interpolated as target missing fields;
[0102] Based on the data category to which the target missing field belongs, select agricultural product batch samples from the agricultural product batch sample set that have the same agricultural product category, the same place of origin, and the same harvest season as the batch samples to be interpolated, and whose target missing field has a field value, as candidate neighboring batch samples;
[0103] Read the numeric fields with field values that are both in the batch samples to be interpolated and in each candidate neighboring batch samples, and use them as common reference fields;
[0104] The field weight is determined based on the data category to which each common reference field belongs;
[0105] Specifically, when the common reference field and the target missing field belong to the same data category, the field weight of the common reference field is determined as the first field weight; when the common reference field and the target missing field belong to different data categories, the field weight of the common reference field is determined as the second field weight, and the first field weight is greater than the second field weight.
[0106] Based on the field values and corresponding field weights of the common reference field, the weighted Euclidean distance between the batch sample to be interpolated and each candidate neighboring batch sample is calculated.
[0107] The K nearest neighbor sample set is formed by selecting the top K candidate nearest neighbor batches in ascending order of weighted Euclidean distance.
[0108] The reciprocal of the sum of the weighted Euclidean distance and the non-zero constant of each candidate neighbor batch sample in the K-nearest neighbor sample set is used as the interpolation weight;
[0109] The non-zero constant is set to 0.000001 to prevent the denominator of the interpolation weight from being 0 when the weighted Euclidean distance between candidate neighboring batch samples is 0, and to reduce the excessive amplification effect of the minimum distance samples on the interpolation weight.
[0110] Based on the field values and corresponding interpolation weights of each candidate neighboring batch sample in the K-nearest neighbor sample set for the target missing field, the interpolation field value of the target missing field is calculated.
[0111] The interpolation field value is filled into the target missing field of the batch sample to be interpolated, and the numerical missing fields in the agricultural product batch sample set are interpolated sequentially to obtain the complete batch sample set.
[0112] For the numerical fields in the completed batch sample set, the field mean and field standard deviation are calculated, and the numerical fields are standardized using the Z-score method to obtain standardized field values;
[0113] Standardized field values are encapsulated according to the target agricultural product batches to generate a standard batch quality dataset.
[0114] In this embodiment, the agricultural product quality evaluation indicators include appearance quality indicators, specification grade indicators, freshness indicators, safety risk indicators, storage stability indicators, transportation loss indicators, historical anomaly indicators, and sales feedback indicators.
[0115] In this embodiment, step three specifically includes:
[0116] Establish a mapping relationship between agricultural product quality evaluation indicators and standardized field values in standard batch quality datasets;
[0117] Based on the indicator mapping relationship, the standardized field values mapped to the same agricultural product quality evaluation indicator are formed into an indicator field value set, and the indicator statistical characteristics of each agricultural product quality evaluation indicator are calculated based on the indicator field value set.
[0118] The statistical features of the indicators include the current value of the indicator, the mean value of the indicator, the maximum value of the indicator, the minimum value of the indicator, the fluctuation value of the indicator, the missing indicator completion flag, and the abnormal indicator flag;
[0119] Based on the order of agricultural product quality evaluation indicators and the order of their statistical characteristics, the statistical characteristics of each agricultural product quality evaluation indicator are vectorized and arranged to construct a target quality feature vector.
[0120] In this embodiment, step four specifically includes:
[0121] Based on the agricultural product category, place of origin, harvest season, storage conditions and distribution path of the target agricultural product batch, qualified historical agricultural product batch data are screened from the agricultural product quality testing database to obtain a sample set of qualified historical batches.
[0122] The agricultural product quality testing database is used to store historical agricultural product batch data, newly added agricultural product batch data, quality status color indicators, quality management strategies, strategy implementation information, and dynamic quality benchmarks for agricultural product batches.
[0123] Using the same indicator system as the agricultural product quality evaluation indicators, quality features are extracted from each historical qualified batch sample in the historical qualified batch sample set to obtain historical quality feature vectors, and a historical quality feature vector set is formed.
[0124] Calculate the mean vector of the historical quality feature vector set to obtain the mean vector of quality indicators;
[0125] Calculate the sample covariance matrix based on the historical quality feature vector set and the quality index mean vector;
[0126] Based on the sample covariance matrix, the Ledoit-Wolf shrinkage covariance estimation method is used to calculate the quality index shrinkage covariance matrix. Specifically, the following steps are taken: extract each variance term from the diagonal of the sample covariance matrix; calculate the average of each variance term to obtain the average variance value; construct a shrinkage target matrix based on the average variance value, where the diagonal elements of the shrinkage target matrix are all average variance values and the off-diagonal elements are all 0; calculate the estimation error of each matrix element in the sample covariance matrix according to the historical quality feature vector set and the quality index mean vector, and calculate the shrinkage target deviation based on the matrix difference between the sample covariance matrix and the shrinkage target matrix; determine the shrinkage intensity coefficient based on the ratio of the estimation error to the shrinkage target deviation; and perform weighted fusion of the sample covariance matrix and the shrinkage target matrix according to the shrinkage intensity coefficient to obtain the quality index shrinkage covariance matrix.
[0127] A confidence level was set, with the number of agricultural product quality evaluation indicators defined as the first degree of freedom, and the difference between the number of historical qualified batch samples and the number of agricultural product quality evaluation indicators defined as the second degree of freedom; the confidence level was set to 95% during implementation.
[0128] Substitute the confidence level, the first degree of freedom, and the second degree of freedom into the F-distribution quantile function to determine the critical value of the F-distribution.
[0129] The F-distribution quantile function is an existing function in statistics used to determine the critical value of the F-distribution. Given a confidence level, a first degree of freedom, and a second degree of freedom, the F-distribution quantile function uses the confidence level as the cumulative probability input and the first and second degrees of freedom as distribution parameters to output the critical value of the F-distribution corresponding to the confidence level. The first degree of freedom is the number of agricultural product quality evaluation indicators, and the second degree of freedom is the difference between the number of historical qualified batch samples and the number of agricultural product quality evaluation indicators. The critical value of the F-distribution is used to calculate the T² control limit.
[0130] The first control limit is obtained by multiplying the number of agricultural product quality evaluation indicators, the number of historical qualified batches plus one, and the number of historical qualified batches minus one.
[0131] The second control limit is obtained by multiplying the number of historical qualified batches and the difference between the number of historical qualified batches and the number of agricultural product quality evaluation indicators.
[0132] The ratio of the first control limit to the second control limit is determined as the control limit scaling factor;
[0133] The product of the control limit scaling coefficient and the critical value of the F distribution is used as the T² control limit;
[0134] The T² control limit is scaled proportionally to obtain a low deviation threshold and a concern deviation threshold, wherein the low deviation threshold is smaller than the concern deviation threshold.
[0135] The mean vector of quality indicators, the shrinkage covariance matrix of quality indicators, the T² control limit, the low deviation threshold, and the deviation threshold of concern are used to form the dynamic quality benchmark for agricultural product batches.
[0136] In this embodiment, step five specifically includes:
[0137] When newly qualified agricultural product batch data is written into the agricultural product quality testing database, the newly qualified batch sample set is obtained according to the update cycle, and based on the newly qualified batch sample set, the mean vector of candidate quality indicators, the shrinkage covariance matrix of candidate quality indicators, the candidate T² control limit, the candidate low deviation threshold and the candidate attention deviation threshold are calculated.
[0138] Calculate the ratio of the number of newly qualified batch samples in the current update cycle to the total number of baseline updated samples to obtain the sample size proportion; the total number of baseline updated samples includes the number of newly qualified batch samples in the current update cycle and the number of historical qualified batch samples in the previous update cycle.
[0139] Calculate the vector distance between the candidate quality indicator mean vector and the quality indicator mean vector of the previous update period, and determine the mean baseline offset as the ratio between the vector distance and the magnitude of the quality indicator mean vector of the previous update period.
[0140] Calculate the matrix distance between the shrinkage covariance matrix of the candidate quality index and the shrinkage covariance matrix of the quality index in the previous update period, and determine the ratio between the matrix distance and the matrix norm of the shrinkage covariance matrix of the quality index in the previous update period as the covariance benchmark offset.
[0141] The average of the mean baseline offset and the covariance baseline offset is used as the composite baseline offset;
[0142] Calculate the ratio of the comprehensive baseline offset to the constant 1 and the sum of the comprehensive baseline offsets to obtain the baseline offset response ratio;
[0143] The average of the sample size proportion and the baseline offset response proportion is used as the EWMA smoothing coefficient for the current update period.
[0144] The dynamic quality benchmark for agricultural product batches is updated based on the EWMA smoothing coefficient of the current update cycle, specifically as follows:
[0145] The weighted average of each vector element in the candidate quality indicator mean vector and the vector element at the same position in the quality indicator mean vector of the previous update period is updated to obtain the quality indicator mean vector of the current update period.
[0146] The quality index shrinkage covariance matrix of the current update period is obtained by weighted averaging the matrix elements in the candidate quality index shrinkage covariance matrix and the matrix elements in the same position in the quality index shrinkage covariance matrix of the previous update period.
[0147] The candidate T² control limits are updated by weighted averaging with the T² control limits of the previous update period to obtain the T² control limits of the current update period.
[0148] The candidate low deviation threshold is updated by weighted averaging with the low deviation threshold of the previous update period to obtain the low deviation threshold of the current update period.
[0149] The candidate attention deviation threshold is updated by weighted averaging with the attention deviation threshold of the previous update period to obtain the attention deviation threshold of the current update period.
[0150] In this embodiment, step six specifically includes:
[0151] Calculate the vector difference between the target quality feature vector and the mean vector of quality indicators to obtain the target quality deviation vector;
[0152] The Hotelling T² statistic for the target agricultural product batch is obtained by multiplying the transpose of the target quality deviation vector, the inverse of the quality index shrinkage covariance matrix, and the target quality deviation vector.
[0153] The quality status of a target agricultural product batch is determined by a multi-indicator joint deviation judgment rule, specifically including:
[0154] When the Hotelling T² statistic is less than or equal to the low deviation threshold, the target agricultural product batch is identified as a priority circulation batch, and the quality status color of the target agricultural product batch is set to green.
[0155] When the Hotelling T² statistic is greater than the low deviation threshold and less than or equal to the deviation of concern threshold, the target agricultural product batch is judged as a normal qualified batch, and the quality status color of the target agricultural product batch is determined to be blue.
[0156] When the Hotelling T² statistic is greater than the deviation threshold but less than or equal to the T² control limit, the target agricultural product batch is identified as a batch of quality concern, and the quality status color of the target agricultural product batch is set to yellow.
[0157] When the Hotelling T² statistic exceeds the T² control limit, the target agricultural product batch is identified as an abnormal interception batch, and the quality status color of the target agricultural product batch is set to red.
[0158] The quality status color identifier of the target agricultural product batch is sent to the batch distribution control terminal.
[0159] In this embodiment, the quality management strategy for the target agricultural product batch specifically includes:
[0160] When the quality status color is green, the priority of the target agricultural product batch for warehousing is set to priority warehousing level, the distribution channel is set to priority distribution channel, and the sales method is set to priority sales method;
[0161] When the quality status color is blue, the warehousing priority of the target agricultural product batch is set to normal warehousing level, the warehousing method is set to regular warehousing method, and the sales method is set to regular sales method.
[0162] When the quality status color is yellow, the sales method for the target agricultural product batch is determined to be a graded sales method, the storage control method is determined to be a storage temperature and humidity control method, and the batch tracking method is determined to be a key tracking method.
[0163] When the quality status color is red, the circulation status of the target agricultural product batch is determined to be circulation interception status, the testing and handling method is determined to be re-inspection method, and the batch verification method is determined to be traceability verification method.
[0164] In this embodiment, the strategy execution information includes warehousing execution information, circulation execution information, sales execution information, warehouse control execution information, re-inspection execution information, circulation interception execution information, and traceability verification execution information;
[0165] Batch status includes warehousing status, circulation status, tiered sales status, warehouse control status, re-inspection status, circulation interception status, and traceability verification status;
[0166] When the quality status color of the target agricultural product batch is green or blue, and the batch status corresponding to the strategy execution information is in the "in storage" or "circulated" state, the target agricultural product batch will be marked as a newly added qualified batch sample.
[0167] Example 1: To verify the feasibility of this invention in practice, it was applied to a fresh agricultural product distribution center's batch quality inspection scenario for fruits and vegetables. This distribution center receives tomatoes, cucumbers, lettuce, and strawberries daily from different origins. Each batch of agricultural products needs to undergo quality inspection, grading, and distribution before being stored. Existing methods mainly rely on manual sampling and fixed threshold rules, judging batch compliance based on appearance, temperature and humidity records, transportation time, historical complaint records, and limited physicochemical testing data. However, in actual operation, the quality of agricultural products fluctuates significantly depending on the origin, harvest season, and transportation route. Some batches lack data on transportation temperature, humidity, harvest time, real-time detection values, or loss rate. Manual rules struggle to simultaneously consider the correlation between appearance quality, freshness, safety risks, storage stability, transportation losses, and sales feedback, easily leading to problems such as normal batches being mistakenly intercepted, batches with quality concerns being released directly, and delayed detection of abnormal batches.
[0168] In the implementation of this invention, the distribution center uses agricultural product batches as the basic inspection object. Each batch is bound to a batch number, agricultural product category, origin, harvest time, transport vehicle, storage location, and sales flow. Basic quality inspection data is obtained from the warehousing registration system, storage environment sensors, transportation cold chain records, historical quality inspection system, real-time monitoring equipment, and after-sales feedback system, and aggregated according to batch identity data. For missing fields, the system uses a weighted K-nearest neighbor interpolation algorithm to screen candidate neighboring batch samples from similar batches of the same category, origin, and harvest season. Interpolation weights are calculated based on the weighted Euclidean distance of common reference fields to fill in the target missing fields. Subsequently, the Z-score standardization method is used to standardize numerical fields such as weight deviation, color score, temperature deviation, transportation time, loss rate, and complaint rate to obtain a standard batch quality dataset.
[0169] During batch testing, appearance quality indicators, specification grade indicators, freshness indicators, safety risk indicators, storage stability indicators, transportation loss indicators, historical anomaly indicators, and sales feedback indicators are extracted based on a standard batch quality dataset, and a target quality feature vector is constructed. The system selects historical qualified batch samples from the agricultural product quality testing database, based on the same category, origin, harvest season, and distribution path. A dynamic quality benchmark for agricultural product batches is constructed using the Hotelling T² control chart method, and the Ledoit-Wolf shrinking covariance estimation method is used to reduce the impact of instability in the covariance matrix when multiple indicators are highly correlated. As new qualified batches are added to the database, a two-factor adaptive EWMA method is used to dynamically update the quality indicator mean vector, quality indicator shrinking covariance matrix, T² control limits, low deviation threshold, and concern deviation threshold based on the proportion of new sample size and benchmark shift response, ensuring the quality benchmark adapts to changes in season, origin, and cold chain conditions.
[0170] When a batch of target agricultural products passes through the testing equipment, the deviation between the target quality feature vector and the mean vector of quality indicators is calculated to obtain the Hotelling T² statistic. A quality status color identifier is then generated using a multi-indicator joint deviation judgment rule. Green batches are diverted to priority warehousing and priority distribution channels; blue batches enter the normal warehousing and regular sales process; yellow batches enter the graded sales and storage temperature and humidity control process; and red batches are intercepted by the batch diversion control terminal, triggering re-inspection and traceability verification. After the strategy is executed, the system writes the quality status color identifier, quality management strategy, and strategy execution information into the agricultural product quality testing database, and updates the batch status based on warehousing, distribution, re-inspection, interception, and traceability verification.
[0171] In application, the method of this invention was compared and analyzed with manual sampling rule schemes, fixed threshold detection schemes, and static statistical benchmark schemes. The fixed threshold detection scheme involves setting fixed thresholds for individual indicators such as appearance score, freshness score, transportation temperature and humidity deviation, transportation loss rate, safety risk indicators, and sales complaint rate based on manual experience or enterprise quality inspection rules, and judging the quality status of agricultural product batches based on whether the indicators exceed the limits. The static statistical benchmark scheme involves calculating a fixed mean, standard deviation, or covariance matrix based on historical qualified agricultural product batch data, and judging whether the target agricultural product batch deviates from the normal quality range accordingly. The experimental results are shown in Table 1.
[0172] Table 1 Comparison of the Implementation Effects of Batch Quality Testing for Agricultural Products
[0173] Comparison indicators Manual Sampling Inspection Rules and Regulations Fixed threshold detection scheme Static statistical benchmark scheme Method of the present invention Average error of data missing field completion 12.8% 10.6% 8.9% 4.1% Batch quality status determination accuracy 82.4% 86.7% 90.2% 96.3% Abnormal batch interception and recall rate 78.9% 83.5% 88.1% 95.6% Normal batch false interception rate 9.7% 7.8% 5.6% 2.3% Quality Focus Batch Identification Accuracy 75.6% 81.4% 87.3% 94.8% Average testing time per batch 46.5s 31.2s 24.8s 13.6s Number of batches lagging behind dynamic quality benchmark updates Not supported Not supported 186 batches 42 batches Accuracy of matching quality management strategies 80.3% 85.1% 89.6% 96.9% Re-inspection workload percentage 18.5% 15.2% 11.7% 6.4% Batch status closed-loop record completeness rate 71.8% 80.6% 88.5% 98.1%
[0174] As shown in Table 1, the method of this invention demonstrates good implementation results across all comparative indicators. The average error for data missing field completion using the method of this invention is 4.1%, significantly lower than the 12.8% of the manual sampling rule scheme, the 10.6% of the fixed threshold detection scheme, and the 8.9% of the static statistical benchmark scheme. This indicates that the weighted K-nearest neighbor interpolation algorithm can effectively complete missing fields in multi-source quality detection data, improving the completeness of the standard batch quality dataset. Regarding quality judgment, the batch quality status judgment accuracy of the method of this invention reaches 96.3%, the abnormal batch interception and recall rate reaches 95.6%, and the quality-concern batch identification accuracy reaches 94.8%, all higher than the other three schemes. This demonstrates that the method of this invention, through the Hotelling T² control chart method and the Ledoit-Wolf contraction covariance estimation method, can more accurately identify the joint deviation status of multiple indicators in agricultural product batches.
[0175] Furthermore, the false interception rate of normal batches using the method of this invention is only 2.3%, lower than the 5.6% of the static statistical benchmark scheme. This indicates that the two-factor adaptive EWMA method can dynamically update the dynamic quality benchmark of agricultural product batches based on newly added qualified batch samples and benchmark shifts, reducing misjudgments caused by quality benchmark lag. In terms of processing efficiency, the average detection and diversion time per batch using the method of this invention is 13.6 seconds, significantly shorter than other schemes. This shows that triggering the batch diversion control end through quality status color identification can improve the processing efficiency of warehousing, distribution, graded sales, and abnormal interception. The quality management strategy matching accuracy of the method of this invention reaches 96.9%, the batch status closed-loop record completeness rate reaches 98.1%, and the re-inspection workload is reduced to 6.4%. This indicates that the invention can achieve closed-loop management of quality management strategy triggering, strategy execution recording, and batch status updating while completing quality testing, thereby improving the accuracy, dynamic adaptability, diversion efficiency, and management reliability of agricultural product quality testing.
[0176] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method for detecting quality of agricultural products based on big data analysis, characterized in that, Includes the following steps: Step 1: Obtain basic quality inspection data for the target agricultural product batch, and preprocess the basic quality inspection data using the weighted K-nearest neighbor interpolation algorithm and Z-score standardization method to obtain a standard batch quality dataset; Step 2: Based on the standard batch quality dataset, extract the agricultural product quality evaluation indicators for the target agricultural product batch; Step 3: Based on agricultural product quality evaluation indicators, construct the target quality feature vector for the target agricultural product batch; Step 4: Based on qualified historical agricultural product batch data, construct a dynamic quality benchmark for agricultural product batches using the Hotelling T² control chart method; Step 5: Dynamically update the batch dynamic quality benchmark of agricultural products using the two-factor adaptive EWMA method; Step 6: Based on the target quality feature vector and the dynamic quality benchmark of agricultural product batches, the quality status of the target agricultural product batch is judged by the joint deviation judgment rule of multiple indicators, the quality status color label is obtained, and sent to the batch diversion control terminal; Step 7: The batch diversion control terminal triggers the quality management strategy for the target agricultural product batch based on the quality status color indicator; Step 8: Write the quality status color code, quality management strategy, and strategy implementation information into the agricultural product quality testing database, and update the batch status of the target agricultural product batch based on the strategy implementation information.
2. The method for detecting the quality of agricultural products based on big data analysis according to claim 1, characterized in that, The basic data for quality inspection includes batch identification data, production source data, warehousing environment data, transportation environment data, historical quality inspection data, real-time testing data, and circulation feedback data.
3. The method for detecting agricultural product quality based on big data analysis according to claim 1, characterized in that, The preprocessing of the basic data for quality inspection using the weighted K-nearest neighbor interpolation algorithm and the Z-score normalization method specifically includes: Based on batch identity data, production source data, warehousing environment data, transportation environment data, historical quality inspection data, real-time monitoring data, and circulation feedback data are aggregated to obtain a sample set of agricultural product batches; Identify missing fields in the agricultural product batch sample set, determine agricultural product batch samples containing missing fields as batch samples to be interpolated, and determine the missing fields in the batch samples to be interpolated as target missing fields; Based on the data category to which the target missing field belongs, select agricultural product batch samples from the agricultural product batch sample set that have the same agricultural product category, the same place of origin, and the same harvest season as the batch samples to be interpolated, and whose target missing field has a field value, as candidate neighboring batch samples; Read the numeric fields with field values that are both in the batch samples to be interpolated and in each candidate neighboring batch samples, and use them as common reference fields; The field weight is determined based on the data category to which each common reference field belongs; Based on the field values and corresponding field weights of the common reference field, the weighted Euclidean distance between the batch sample to be interpolated and each candidate neighboring batch sample is calculated. The K nearest neighbor sample set is formed by selecting the top K candidate nearest neighbor batches in ascending order of weighted Euclidean distance. The reciprocal of the sum of the weighted Euclidean distance and the non-zero constant of each candidate neighbor batch sample in the K-nearest neighbor sample set is used as the interpolation weight; Based on the field values and corresponding interpolation weights of each candidate neighboring batch sample in the K-nearest neighbor sample set for the target missing field, the interpolation field value of the target missing field is calculated. The interpolation field value is filled into the target missing field of the batch sample to be interpolated, and the numerical missing fields in the agricultural product batch sample set are interpolated sequentially to obtain the complete batch sample set. For the numerical fields in the completed batch sample set, the field mean and field standard deviation are calculated, and the numerical fields are standardized using the Z-score method to obtain standardized field values; Standardized field values are encapsulated according to the target agricultural product batches to generate a standard batch quality dataset.
4. The method for detecting agricultural product quality based on big data analysis according to claim 1, characterized in that, The agricultural product quality evaluation indicators include appearance quality indicators, specification grade indicators, freshness indicators, safety risk indicators, storage stability indicators, transportation loss indicators, historical anomaly indicators, and sales feedback indicators.
5. A method for detecting agricultural product quality based on big data analysis according to claim 1, characterized in that, Step three specifically includes: Establish a mapping relationship between agricultural product quality evaluation indicators and standardized field values in standard batch quality datasets; Based on the indicator mapping relationship, the standardized field values mapped to the same agricultural product quality evaluation indicator are formed into an indicator field value set, and the indicator statistical characteristics of each agricultural product quality evaluation indicator are calculated based on the indicator field value set. The statistical features of the indicators include the current value of the indicator, the mean value of the indicator, the maximum value of the indicator, the minimum value of the indicator, the fluctuation value of the indicator, the missing indicator completion flag, and the abnormal indicator flag; Based on the order of agricultural product quality evaluation indicators and the order of their statistical characteristics, the statistical characteristics of each agricultural product quality evaluation indicator are vectorized and arranged to construct a target quality feature vector.
6. A method for detecting agricultural product quality based on big data analysis according to claim 1, characterized in that, Step four specifically includes: Based on the agricultural product category, place of origin, harvest season, storage conditions and distribution path of the target agricultural product batch, qualified historical agricultural product batch data are screened from the agricultural product quality testing database to obtain a sample set of qualified historical batches. The agricultural product quality testing database is used to store historical agricultural product batch data, newly added agricultural product batch data, quality status color indicators, quality management strategies, strategy implementation information, and dynamic quality benchmarks for agricultural product batches. Using the same indicator system as the agricultural product quality evaluation indicators, quality features are extracted from each historical qualified batch sample in the historical qualified batch sample set to obtain historical quality feature vectors, and a historical quality feature vector set is formed. Calculate the mean vector of the historical quality feature vector set to obtain the mean vector of quality indicators; Calculate the sample covariance matrix based on the historical quality feature vector set and the quality index mean vector; Based on the sample covariance matrix, the Ledoit-Wolf shrinkage covariance estimation method is used to calculate the shrinkage covariance matrix of the quality index; By setting a confidence level, the number of agricultural product quality evaluation indicators is determined as the first degree of freedom, and the difference between the number of historical qualified batch samples and the number of agricultural product quality evaluation indicators is determined as the second degree of freedom. Substitute the confidence level, the first degree of freedom, and the second degree of freedom into the F-distribution quantile function to determine the critical value of the F-distribution. The first control limit is obtained by multiplying the number of agricultural product quality evaluation indicators, the number of historical qualified batches plus one, and the number of historical qualified batches minus one. The second control limit is obtained by multiplying the number of historical qualified batches and the difference between the number of historical qualified batches and the number of agricultural product quality evaluation indicators. The ratio of the first control limit to the second control limit is determined as the control limit scaling factor; The product of the control limit scaling coefficient and the critical value of the F distribution is used as the T² control limit; The T² control limit is scaled proportionally to obtain a low deviation threshold and a concern deviation threshold, wherein the low deviation threshold is smaller than the concern deviation threshold. The mean vector of quality indicators, the shrinkage covariance matrix of quality indicators, the T² control limit, the low deviation threshold, and the deviation threshold of concern are used to form the dynamic quality benchmark for agricultural product batches.
7. A method for detecting agricultural product quality based on big data analysis according to claim 1, characterized in that, Step five specifically includes: When newly qualified agricultural product batch data is written into the agricultural product quality testing database, the newly qualified batch sample set is obtained according to the update cycle, and based on the newly qualified batch sample set, the mean vector of candidate quality indicators, the shrinkage covariance matrix of candidate quality indicators, the candidate T² control limit, the candidate low deviation threshold and the candidate attention deviation threshold are calculated. Calculate the ratio of the number of newly qualified batch samples in the current update cycle to the total number of baseline updated samples to obtain the sample size proportion; the total number of baseline updated samples includes the number of newly qualified batch samples in the current update cycle and the number of historical qualified batch samples in the previous update cycle. Calculate the vector distance between the candidate quality indicator mean vector and the quality indicator mean vector of the previous update period, and determine the mean baseline offset as the ratio between the vector distance and the magnitude of the quality indicator mean vector of the previous update period. Calculate the matrix distance between the shrinkage covariance matrix of the candidate quality index and the shrinkage covariance matrix of the quality index in the previous update period, and determine the ratio between the matrix distance and the matrix norm of the shrinkage covariance matrix of the quality index in the previous update period as the covariance benchmark offset. The average of the mean baseline offset and the covariance baseline offset is used as the composite baseline offset; Calculate the ratio of the comprehensive baseline offset to the constant 1 and the sum of the comprehensive baseline offsets to obtain the baseline offset response ratio; The average of the sample size proportion and the baseline offset response proportion is used as the EWMA smoothing coefficient for the current update period. The dynamic quality benchmark for agricultural product batches is updated based on the EWMA smoothing coefficient of the current update cycle, specifically as follows: The weighted average of each vector element in the candidate quality indicator mean vector and the vector element at the same position in the quality indicator mean vector of the previous update period is updated to obtain the quality indicator mean vector of the current update period. The quality index shrinkage covariance matrix of the current update period is obtained by weighted averaging the matrix elements in the candidate quality index shrinkage covariance matrix and the matrix elements in the same position in the quality index shrinkage covariance matrix of the previous update period. The candidate T² control limits are updated by weighted averaging with the T² control limits of the previous update period to obtain the T² control limits of the current update period. The candidate low deviation threshold is updated by weighted averaging with the low deviation threshold of the previous update period to obtain the low deviation threshold of the current update period. The candidate attention deviation threshold is updated by weighted averaging with the attention deviation threshold of the previous update period to obtain the attention deviation threshold of the current update period.
8. A method for detecting agricultural product quality based on big data analysis according to claim 1, characterized in that, Step six specifically includes: Calculate the vector difference between the target quality feature vector and the mean vector of quality indicators to obtain the target quality deviation vector; The Hotelling T² statistic for the target agricultural product batch is obtained by multiplying the transpose of the target quality deviation vector, the inverse of the quality index shrinkage covariance matrix, and the target quality deviation vector. The quality status of a target agricultural product batch is determined by a multi-indicator joint deviation judgment rule, specifically including: When the Hotelling T² statistic is less than or equal to the low deviation threshold, the target agricultural product batch is identified as a priority circulation batch, and the quality status color of the target agricultural product batch is set to green. When the Hotelling T² statistic is greater than the low deviation threshold and less than or equal to the deviation of concern threshold, the target agricultural product batch is judged as a normal qualified batch, and the quality status color of the target agricultural product batch is determined to be blue. When the Hotelling T² statistic is greater than the deviation threshold but less than or equal to the T² control limit, the target agricultural product batch is identified as a batch of quality concern, and the quality status color of the target agricultural product batch is set to yellow. When the Hotelling T² statistic exceeds the T² control limit, the target agricultural product batch is identified as an abnormal interception batch, and the quality status color of the target agricultural product batch is set to red. The quality status color identifier of the target agricultural product batch is sent to the batch distribution control terminal.
9. The method for detecting agricultural product quality based on big data analysis according to claim 1, characterized in that, The specific quality management strategy for the target agricultural product batch includes: When the quality status color is green, the priority of the target agricultural product batch for warehousing is set to priority warehousing level, the distribution channel is set to priority distribution channel, and the sales method is set to priority sales method; When the quality status color is blue, the warehousing priority of the target agricultural product batch is set to normal warehousing level, the storage method is set to regular storage method, and the sales method is set to regular sales method. When the quality status color is yellow, the sales method for the target agricultural product batch is determined to be a graded sales method, the storage control method is determined to be a storage temperature and humidity control method, and the batch tracking method is determined to be a key tracking method. When the quality status color is red, the circulation status of the target agricultural product batch is determined to be circulation interception status, the testing and disposal method is determined to be re-inspection method, and the batch verification method is determined to be traceability verification method.
10. A method for detecting agricultural product quality based on big data analysis according to claim 1, characterized in that, The strategy execution information includes warehousing execution information, distribution execution information, sales execution information, warehousing control execution information, re-inspection execution information, distribution interception execution information, and traceability verification execution information; The batch status includes warehousing status, circulation status, tiered sales status, warehousing control status, re-inspection status, circulation interception status, and traceability verification status; When the quality status color of the target agricultural product batch is green or blue, and the batch status corresponding to the strategy execution information is either in storage or in circulation, the target agricultural product batch will be marked as a newly added qualified batch sample.
