Data-driven walnut rancidity nondestructive testing method based on edge network
By deploying sensors at nodes in the walnut supply chain to collect waveform data, applying Fourier transform and principal component analysis, generating unique identifiers, and combining them with a cloud database for correlation analysis, the problem of real-time data integration and storage in walnut rancidity detection was solved, achieving efficient quality monitoring and traceability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-04-03
AI Technical Summary
Existing methods for detecting walnut rancidity struggle to achieve real-time data integration and efficient storage within the supply chain, resulting in incomplete quality traceability. Insufficient computing power of edge devices leads to low data processing efficiency, hindering the verification and optimization of detection models.
By deploying sensors at supply chain nodes to collect waveform data, applying Fourier transform and principal component analysis to extract key spectral features, generating refined feature vectors, and generating unique identifiers through hash functions, combined with cloud databases for distributed storage and correlation analysis, abnormal quality labels can be traced back to specific supply chain links.
It enables non-destructive, rapid, and reliable quality monitoring of walnut rancidity detection, improves the efficiency of supply chain quality monitoring and traceability, and ensures the quality and safety of walnuts.
Smart Images

Figure CN121784253A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of edge computing technology, specifically to a data-driven non-destructive detection method for walnut rancidity based on edge networks. Background Technology
[0002] As an important economic crop, walnut quality management is directly related to food safety and supply chain efficiency, making it a crucial link in the agricultural industry chain. With consumers' increasing demands for food quality, walnut rancidity testing has become an important means of ensuring product quality. Rancidity not only affects the taste and nutritional value of walnuts but may also lead to food safety issues. Therefore, building an efficient and reliable testing and traceability system is essential for improving supply chain transparency and trust.
[0003] However, current methods for detecting and tracing the quality of walnut rancidity still face numerous challenges, urgently requiring technological breakthroughs to address the quality management needs of complex supply chains. Existing rancidity detection methods largely rely on laboratory analysis or single-device testing, making them ill-suited to the distributed, multi-stage production scenarios within the walnut supply chain. These methods often suffer from fragmented data collection and storage, with testing equipment scattered across different production nodes, hindering real-time data integration and impacting the integrity of quality traceability. Furthermore, the sheer volume of data generated during testing, especially the raw signal waveforms from high-frequency sampling, results in high storage and transmission costs. Existing systems often lack effective data management and correlation analysis, making it difficult to quickly pinpoint specific batches or stages when quality issues arise. Technically, the core challenge lies in achieving real-time recording and efficient storage of data across the entire supply chain. During testing, each walnut sample needs a unique identifier to link to information such as testing time, equipment parameters, and environmental conditions. However, edge devices in the supply chain typically have limited computing power, making it difficult to process high-frequency sampling data in real-time and generate accurate feature extraction results. This limitation in computing power leads to low data processing efficiency, resulting in delayed updates to cloud-archived feature data and statistical reports, impacting the real-time nature of quality traceability. Therefore, how to efficiently process high-frequency sampling data and generate unique identifiers on edge devices, while ensuring efficient collaboration between edge storage and cloud archiving, has become a key issue in building a walnut rancidity detection and traceability system. Specifically, the walnut supply chain involves multiple stages from harvesting to processing, requiring testing operations in different regions and with different equipment. For example, in a walnut processing plant, testing equipment needs to sample a large number of walnut samples at high frequencies within a short period to generate waveform data reflecting the degree of rancidity and extract key features to determine quality. However, due to insufficient computing power of edge devices, some waveform data may be lost due to processing delays or may fail to generate unique identifiers in a timely manner, making it impossible to accurately link to specific batches. This not only increases the difficulty of tracing quality issues but may also affect the verification and optimization of testing models due to incomplete data. Summary of the Invention
[0004] The purpose of this invention is to provide a data-driven non-destructive detection method for walnut rancidity based on edge networks, thereby solving the problems existing in the prior art.
[0005] To achieve the above objectives, the present invention provides the following technical solution: a data-driven non-destructive detection method for walnut rancidity based on edge networks, comprising: S1, sampling and processing signals with frequencies higher than a preset threshold in walnut samples using sensors deployed at supply chain nodes, and capturing waveform data reflecting the degree of mold-induced rancidity during the sampling process to obtain an original signal sequence; S2, applying Fourier transform extraction to the obtained original signal sequence on an edge device, performing principal component analysis to reduce the dimensionality of the waveform data, and extracting key spectral features through spectral peak identification and spectral line energy calculation to obtain a refined feature vector; S3, if the spectral peak value after signal noise filtering in the refined feature vector exceeds a preset threshold, it is determined to be a potential mold rancidity signal, and generated by associating detection time and device parameters and using waveform amplitude normalization. S4. Initial quality labels are used to obtain a set of labeled features. A hash function is applied to uniquely encode the labeled feature set. During the encoding process, environmental condition information is integrated by embedding temperature data and humidity values, and a unique identifier is obtained by using timestamp association and location coordinate fusion. S5. Based on the unique identifier, the refined feature vector and labeled feature set are uploaded to the cloud database. An integrated dataset is obtained by merging archived data through a distributed storage mechanism and using device ID. S6. An association analysis algorithm is executed on the integrated dataset to match similar unique identifiers from multi-node data and obtain a batch link chain through environmental noise superposition verification. S7. The cloud archived records are queried through the batch link chain. If an abnormal quality label is matched, the supply chain link is traced back, and time-frequency domain conversion is used to confirm the source of mold and rancidity to obtain a complete traceability path.
[0006] Preferably, step S1 includes: deploying sensors at supply chain nodes to sample walnut samples, acquiring waveform data with frequencies higher than a preset threshold, and generating an original signal sequence; decomposing the signal using a fast Fourier transform algorithm based on the original signal sequence, extracting the dominant frequency component, and obtaining a frequency feature sequence; if the amplitude of the dominant frequency component in the frequency feature sequence is higher than a preset threshold, denoising the waveform data using wavelet transform to generate a denoised signal sequence; extracting feature vectors reflecting the degree of mold rancidity using a principal component analysis algorithm based on the denoised signal sequence, and obtaining a rancidity feature sequence; if the matching degree between the feature value of the rancidity feature sequence and the preset rancidity model is higher than a threshold, detecting the feature change trend using a time series analysis method to generate a rancidity trend sequence; classifying the walnut samples using a clustering analysis algorithm based on the rancidity trend sequence, determining the degree of rancidity, and obtaining a classification result; generating rancidity assessment data for the walnut samples based on the classification result, and outputting an assessment sequence.
[0007] Preferably, step S2 includes obtaining the original signal sequence of walnut samples from edge devices at supply chain nodes, uniformly sampling at a preset sampling frequency to generate a time-domain signal dataset; generating a frequency-domain feature dataset by using a fast Fourier transform based on the time-domain signal dataset; performing dimensionality reduction processing on the frequency-domain feature dataset using a principal component analysis algorithm to generate a low-dimensional feature vector set; extracting key spectral features from the low-dimensional feature vector set through spectral line energy calculation to obtain a refined feature vector set; if the energy value of a specific spectral feature in the refined feature vector set exceeds a preset threshold, it is judged as a potential quality anomaly signal, and an anomaly feature dataset is generated; grouping the walnut samples using a clustering analysis algorithm based on the anomaly feature dataset to obtain sample quality classification results; and calculating the quality distribution probability of each group from the sample quality classification results through statistical analysis to generate a quality grading dataset.
[0008] Preferably, step S3 includes acquiring the original vibration signal sequence of walnut samples from the edge device, using high-pass filtering to remove low-frequency noise, and generating a filtered signal sequence; if the peak value of the filtered signal sequence exceeds a preset threshold, it is determined to be a potential mold rancidity signal, resulting in a preliminary abnormal signal set; based on the preliminary abnormal signal set, waveform amplitude normalization is performed to generate a labeled feature set; for the labeled feature set, a fast Fourier transform is used to generate a frequency domain feature sequence, resulting in a frequency domain feature set; based on the frequency domain feature set, principal component analysis is used for dimensionality reduction to generate a low-dimensional feature vector set; if the energy value of a specific spectral feature in the low-dimensional feature vector set exceeds a preset threshold, it is determined to be a quality abnormal signal, resulting in a refined abnormal feature set; based on the refined abnormal feature set, K-means clustering is used to group the walnut samples to obtain a quality classification result.
[0009] Preferably, step S4 includes collecting vibration signal sequences of walnut samples from an edge device, preprocessing and filtering to remove interference, and generating a filtered signal sequence; performing unique encoding processing on the filtered signal sequence using a hash function to generate an initial identifier code sequence; based on the initial identifier code sequence, fusing environmental information by embedding temperature and humidity data to generate an environmental fusion identifier set; if the matching degree between the timestamp information and location coordinates in the environmental fusion identifier set exceeds a preset threshold, then using a weighted average method to integrate time and location information to generate a unique identifier feature set; performing classification processing on the unique identifier feature set using a support vector machine algorithm to generate a quality classification label set; grouping the walnut samples according to the quality classification label set through cluster analysis to generate a grouping result set; and calculating the feature distribution of each group using statistical analysis methods to generate the final quality assessment dataset.
[0010] Preferably, step S5 includes collecting refined feature vectors and labeled feature sets of walnut samples from edge devices, generating unique identifiers using a hash function; allocating data to distributed storage nodes of the cloud database using a sharding algorithm to obtain partitioned storage datasets; if the response time of the storage nodes in the partitioned storage dataset is lower than a preset threshold, adjusting the data distribution through a load balancing mechanism to obtain optimized storage datasets; using the device ID as an index key to associate the refined feature vectors and labeled feature sets to obtain archived datasets; verifying the data integrity of the archived datasets using a consistent hashing algorithm to obtain verified datasets; extracting environmental information from the verified datasets, grouping the walnut samples using cluster analysis to obtain grouped datasets; and calculating the distribution characteristics of environmental information for each group using statistical analysis methods to obtain the final classification dataset.
[0011] Preferably, step S6 includes using an association rule mining algorithm to analyze the patterns of unique identifiers in multi-node data for the integrated dataset, generating a preliminary matching set containing highly similar sample pairs; if the similarity of unique identifiers of sample pairs in the preliminary matching set is higher than a preset threshold, then the batch association of sample pairs is verified by environmental noise superposition analysis to obtain a batch link chain; based on the batch link chain, a clustering analysis method is used to group sample pairs with similar batch associations to obtain a batch grouping set.
[0012] Preferably, step S6 further includes calculating the distribution characteristics of the unique identifiers of each group for the batch grouping set, generating a feature distribution dataset; if the inter-group difference of the feature distribution dataset is higher than a preset threshold, then verifying the data integrity of the batch grouping set through a consistency check algorithm to obtain a verified set; based on the verified set, using statistical analysis methods to extract the environmental noise characteristics of each group to generate a noise feature dataset; and for the noise feature dataset, generating a batch traceability index through the correlation of the batch link chain to obtain the final traceability dataset.
[0013] Preferably, step S7 includes accessing cloud archived records through a batch link chain, using database indexing technology to obtain a set of records containing abnormal quality tags, and determining the abnormal batch dataset; if the abnormal batch dataset contains abnormal quality tags, then tracing the supply chain links corresponding to the abnormal batch through the supply chain node identifier to obtain a set of supply chain links; using a time-frequency domain conversion method to analyze the mold rancidity signals of each link in the supply chain link set, and extracting the signal feature dataset.
[0014] Preferably, step S7 further includes calculating the batch correlation strength of mold rancidity signals in each supply chain link through the signal feature dataset to obtain a batch correlation strength set; if the correlation strength of a certain link in the batch correlation strength set is higher than a preset threshold, the source link of mold rancidity is determined through quality anomaly distribution analysis, and the source link identifier is obtained; based on the source link identifier and combined with the batch link chain, a complete traceability path from cloud archive records to the source of mold rancidity is generated; through the complete traceability path, a data query efficiency optimization technology is used to generate a traceability index dataset containing supply chain links and mold rancidity signal features.
[0015] As can be seen from the above technical solution, the present invention has the following beneficial effects:
[0016] This edge network-based, data-driven, non-destructive detection method for walnut rancidity collects waveform data reflecting the degree of mold rancidity by deploying sensors at supply chain nodes. Fourier transform and principal component analysis are applied to extract key spectral features to generate refined feature vectors, which are then combined with signal noise filtering and threshold judgment to generate preliminary quality labels. Furthermore, a hash function is used to uniquely encode the feature set, fusing temperature, humidity, timestamps, and location coordinates to generate a unique identifier code, which is uploaded to a cloud database to form an integrated dataset. This invention employs a correlation analysis algorithm to match similar identifier codes, combines environmental noise verification to construct batch link chains, queries cloud records to trace abnormal quality labels to specific supply chain links, and uses time-frequency domain conversion to confirm the source of mold rancidity. This invention achieves closed-loop management from signal acquisition to cloud traceability, significantly improving the efficiency of walnut supply chain quality monitoring and traceability, and ensuring the quality and safety of rare walnut varieties. Attached Figure Description
[0017] Figure 1 This is a flowchart of the data-driven non-destructive testing method for walnut rancidity based on edge networks according to the present invention. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] like Figure 1As shown, this invention provides a technical solution: a data-driven non-destructive detection method for walnut rancidity based on edge networks, comprising: S1, sampling and processing signals with frequencies higher than a preset threshold in walnut samples using sensors deployed at supply chain nodes, capturing waveform data reflecting the degree of mold-induced rancidity during the sampling process to obtain an original signal sequence; S2, applying Fourier transform to extract the obtained original signal sequence on an edge device, performing principal component analysis to reduce the dimensionality of the waveform data, and extracting key spectral features through spectral peak identification and spectral line energy calculation to obtain a refined feature vector; S3, if the spectral peak value after signal noise filtering in the refined feature vector exceeds a preset threshold, it is determined to be a potential mold rancidity signal, and preliminary quality control is generated by associating detection time and equipment parameters and using waveform amplitude normalization. S4. Obtain a labeled feature set by measuring the label; S5. Use a hash function to uniquely encode the labeled feature set, integrating environmental condition information through temperature data embedding and humidity values during the encoding process, and using timestamp association and location coordinate fusion to obtain a unique identifier code; S6. Upload the refined feature vector and labeled feature set to the cloud database based on the unique identifier code, and obtain an integrated dataset by merging archived data through a distributed storage mechanism and using device ID; S7. Perform an association analysis algorithm on the integrated dataset, match similar unique identifier codes from multi-node data, and obtain a batch link chain through environmental noise superposition verification; S8. Query cloud archived records through the batch link chain. If an abnormal quality label is matched, trace back to the supply chain link and use time-frequency domain conversion to confirm the source of mold and rancidity to obtain a complete traceability path.
[0020] The core of this method lies in using edge computing combined with a data-driven model to quickly and non-destructively detect walnut rancidity. First, sensors deployed at supply chain nodes sample frequencies exceeding a preset threshold, capturing electromagnetic or acoustic waveform data generated by mold growth in walnuts. Then, edge devices convert the time-domain signal to a frequency-domain signal using Fourier transform and perform dimensionality reduction using principal component analysis, extracting key features such as spectral peaks and spectral line energy to form a refined feature vector. Based on this, the system performs noise filtering and threshold comparison on the features. If the values exceed the limits, it is marked as a potential rancidity signal, and a preliminary quality label is generated through waveform amplitude normalization. This label is further hashed to incorporate environmental conditions such as temperature, humidity, time, and location, forming a unique identifier. All feature data and labeling results are uploaded and stored in a cloud database via a distributed storage mechanism, forming a traceable integrated dataset. Ultimately, the system uses a multi-node correlation analysis algorithm to compare the similarity of different batches using unique identifiers and combines noise superposition verification to generate batch link chains. This allows the system to trace back to specific supply chain links when abnormal quality labels are detected, and to confirm the source of spoilage through time-frequency domain analysis, thus achieving a complete traceability path.
[0021] Compared to traditional manual sampling or laboratory chemical testing methods, this method offers several advantages: Improved performance: Real-time processing of sampled data via edge computing significantly improves detection speed and data processing accuracy; Non-destructive testing: Mold and rancidity can be detected without damaging the walnut sample, ensuring sample integrity; Increased efficiency: Distributed storage and automated analysis reduce manual intervention, improving overall supply chain quality monitoring efficiency; Cost savings: Reduces the high costs associated with laboratory testing equipment and manual testing; Environmental friendliness: Avoids the use of chemical reagents, reducing environmental pollution; Enhanced traceability: Unique identifiers and batch linkages enable cross-node supply chain tracking, improving traceability capabilities and food safety assurance; Security: Noise filtering and multi-dimensional parameter fusion improve the reliability of test results, reducing the risk of misjudgment.
[0022] S1 includes: deploying sensors at supply chain nodes to sample walnut samples, acquiring waveform data with frequencies higher than a preset threshold, and generating an original signal sequence; decomposing the signal using a Fast Fourier Transform algorithm to extract the dominant frequency component, obtaining a frequency feature sequence; if the amplitude of the dominant frequency component in the frequency feature sequence is higher than a preset threshold, denoising the waveform data using wavelet transform to generate a denoised signal sequence; extracting feature vectors reflecting the degree of mold rancidity using a principal component analysis algorithm based on the denoised signal sequence, obtaining a rancidity feature sequence; if the matching degree between the feature values of the rancidity feature sequence and the preset rancidity model is higher than a threshold, detecting the feature change trend using time series analysis to generate a rancidity trend sequence; classifying the walnut samples using a clustering analysis algorithm based on the rancidity trend sequence to determine the degree of rancidity, obtaining the classification result; and generating rancidity assessment data for the walnut samples based on the classification result, outputting an assessment sequence.
[0023] In this implementation, the steps are in a fixed sequence, and the output of each step serves as the input for the next step. Specifically, at the supply chain node, the sensor continuously samples a single walnut sample. The sampling frequency is set to 44,100 Hz, the sampling duration is set to 2 seconds, and the quantization depth is set to 16 bits. After obtaining the original time-domain waveform, a digital high-pass filter is immediately executed to retain only components with frequencies higher than a preset threshold. The high-pass filter cutoff frequency is set to 1,000 Hz, the filter order is set to 64, and the transition bandwidth is set to 200 Hz. After filtering, amplitude normalization is performed on the waveform to fix the amplitude range between 0 and 1, and DC component removal and end-to-end processing are performed. Smoothing ensures continuity in subsequent segments. The normalized waveform is then segmented into equal-length segments of 2048 points each, with 1024-point overlap between segments. A Hanning window is applied to each segment to reduce spectral leakage. A Fast Fourier Transform is then performed on each segment to obtain the amplitude spectrum and corresponding frequency coordinates. The frequency point with the largest amplitude in each segment's amplitude spectrum is searched as the dominant frequency of that segment, and its amplitude is recorded. The dominant frequencies and amplitudes of all segments are then concatenated in chronological order to generate a frequency feature sequence. The system compares the amplitude of each dominant frequency segment with a preset dominant frequency amplitude threshold of 0.35. If the amplitude of a segment's dominant frequency exceeds this threshold, wavelet transform is performed on the corresponding time-domain waveform for denoising. The wavelet basis is fixed as a symmetric wavelet of order 4, and the number of decomposition levels is fixed at 5. A fixed threshold method is applied to the detail coefficients of each level, setting coefficients with an absolute value less than 0.02 to zero and retaining the remaining coefficients. Then, the denoised signal segment is reconstructed in descending order of level. Segments that do not meet the triggering conditions are skipped and the original signal is retained. Finally, the signals of each segment are reassembled in chronological order to form a denoised signal sequence. Segment-level features used to characterize the degree of mold-induced rancidity are extracted from the denoised signal sequence. The fixed extraction items are: main frequency, main frequency amplitude, energy percentage within a fixed bandwidth near the main frequency, width of the main frequency peak at half amplitude, and median absolute value of the difference between two adjacent main frequencies. There are 5 features in total. Each of these 5 features is standardized with zero mean and unit standard deviation. After that, principal component analysis is performed, and three principal components are selected from high to low contribution rate as the comprehensive feature vector of the segment. The comprehensive feature vectors of all segments are connected to form the rancidity feature sequence. The rancidity feature sequence is fed into the preset rancidity model segment by segment to calculate the matching degree. The preset rancidity model consists of the comprehensive feature cluster center and discrete range generated by the labeled normal samples and rancid samples. The system uses the distance from the comprehensive feature of each segment to the rancidity cluster center as the original metric, and then linearly maps it to a matching degree score of 0 to 1 using the minimax method. The matching degree score of any segment is not lower than 0.At 70, this segment was identified as a high-risk segment and entered into time series analysis. The time series analysis used a sliding window of 10 segments with a step size of 1 segment to perform matching score analysis. For each window, the increase rate, average growth rate, and longest consecutive increase were calculated and output in chronological order to form a rancidity trend sequence. After obtaining the rancidity trend sequence, the system used three-class cluster analysis to classify the degree of rancidity. The clustering input was the three comprehensive features of each segment within each sample, the corresponding matching score statistics, and the trend index statistics. After initializing three centers, the following loop was executed: calculating the relationship between each sample and the three centers. The sum of squared differences between each item is used as the distance. Samples are assigned to the center with the smallest distance. The mean values of all indicators from the three centers are recalculated based on the assignment results, and these recalculated values are used as new centers. The maximum difference between the old and new centers is checked to see if it is less than 0.01. If it is, the process stops; otherwise, it continues. The process also stops after 100 iterations. After stopping, the three categories are labeled as Level 1, Level 2, and Level 3 according to the average matching degree of the centers, from low to high. The average matching degree between the category to which each sample belongs and all segments within that sample is used as the rancidity assessment data for that sample. Finally, the assessment sequence is output in sample order.
[0024] A sampling frequency of 44,100 Hz, a sampling duration of 2 seconds, and a quantization depth of 16 bits were used to ensure sufficient frequency resolution and dynamic range without losing valid information above a preset frequency threshold. These parameters were determined through calibration experiments, which included 200 normal samples and 200 rancid samples. The impact of different sampling frequency and duration combinations on the main frequency stability and repeatability consistency was statistically analyzed. A combination with a repeatability consistency of not less than 0.95 and a single-sample end-to-end processing delay of not more than 0.20 seconds was selected. A preset frequency threshold of 1000 Hz, a high-pass filter order of 64, and a transition bandwidth of 200 Hz were also used. The background noise spectrum analysis determined the following: First, 60 minutes of data were collected on the idle environment and the equipment's inherent noise. The false trigger probability curve in the background was calculated. Evaluation was performed point-by-point in 100 Hz steps within a threshold range of 500 Hz to 1500 Hz. The minimum threshold of 1000 Hz was selected, where the false trigger probability was no higher than 0.01 and the pass rate to the sample's main frequency was no lower than 0.99. The filter order and transition bandwidth were determined using Cartesian combinations of scan order from 32 to 128 and transition bandwidth from 100 to 400. The passband flatness and stopband attenuation were calculated, and the minimum threshold of 40 dB stopband attenuation and 1 dB passband ripple was determined. The order combination is 64 and 200; the segment length of 2048 points and the overlap of 1024 points were determined through a joint evaluation of frequency resolution and temporal localization capability. At a sampling frequency of 44100 Hz, the frequency resolution corresponding to this segment length is approximately 22 Hz, achieving a balance between classification accuracy and real-time performance. Experiments have verified that, under the same computing resources, the main frequency localization error is no higher than 5 Hz; the Hanning window is a fixed window type, which improves sidelobe suppression by approximately 30 dB after its introduction. The window type was determined through comparative experiments of rectangular windows, Hanning windows, and Hamming windows, selecting one with high sidelobe suppression and a resolution loss of less than 10 Hz due to main lobe expansion. The scheme was as follows: the dominant frequency amplitude threshold of 0.35 was determined on an independent validation set using the receiver operating characteristic curve method. The ratio of normal samples to rancid samples in the validation set was 1:1. The enumeration threshold ranged from 0.20 to 0.60 with a step size of 0.05. The harmonic level of precision and recall was calculated, and the highest point was selected with a false alarm rate not exceeding 0.10, resulting in 0.35. The wavelet basis was selected as a combination of symmetric wavelet fourth order, decomposition level 5, and detail coefficient threshold of 0.02, which was obtained by joint optimization of signal-to-noise ratio enhancement and dominant frequency stability. The grid search range was from wavelet order 2 to 8, decomposition level 3 to 6, and coefficient threshold 0.01 to 0.05. Select the minimum threshold combination where the signal-to-noise ratio improvement is no less than 3 dB and the dominant frequency offset is no more than 10 Hz; the feature terms are fixed at 5 items: dominant frequency, dominant frequency amplitude, energy proportion within a fixed bandwidth near the dominant frequency, half-amplitude width of the dominant frequency, and median difference between two adjacent dominant frequency segments. The fixed bandwidth near the dominant frequency is set as a symmetrical interval of 200 Hz centered on the dominant frequency. The half-amplitude width is obtained by finding the frequency positions on both sides of the amplitude spectrum that are equal to half the dominant frequency amplitude and calculating the difference between them. The median difference between two adjacent dominant frequency segments is used to measure stability; the number of principal components in the principal component analysis is set to 3. The determination method is to accumulate the contributions in descending order, ensuring that the cumulative contribution rate of the first three principal components is not less than 0.85 and the marginal contribution rate of the fourth principal component is not greater than 0.05. The cumulative contribution rate of 0.90 obtained from the validation set meets the condition. The pre-set rancidity model consists of the cluster centers of the comprehensive features of rancid samples obtained during the calibration phase and the cluster centers of the comprehensive features of normal samples. The matching score is obtained by linearly mapping the distance from the comprehensive features of the test segment to the rancidity cluster center according to the minimum and maximum distances in the calibration set. The matching threshold of 0.70 is obtained by using an independent validation set. The scores from 0.60 to 0.80 are enumerated, and precision, recall, and false alarm rate are calculated with a step size of 0.01. The score with the highest harmonic level and a false alarm rate not exceeding 0.10 is selected. The time series analysis window length of 10 segments and the step size of 1 segment are determined through a joint evaluation of stability and sensitivity. The evaluation criteria are an upward trend detection rate of not less than 0.90 on synthetic data with true trend changes and a response delay of no more than 2 segments to abrupt changes. The threshold for the upward ratio in the window indicators is set to 0.60, and the threshold for the average growth rate is set to 0.01, which are used to mark the window trend as... The cluster size is set to 3, indicating an output level of 3. Initialization centers are selected from samples at the 25th, 50th, and 75th percentiles of the sample feature distribution. The maximum number of iterations (100) and the convergence criterion of 0.01 were determined through multiple batches of repeatability experiments. The consistency across days of testing must be no less than 0.90, and the level change must not exceed one level. The evaluation sequence includes two items: classification results and rancidity assessment data. The classification results are assigned levels 1, 2, and 3, and the rancidity assessment data is the arithmetic mean of the matching scores of all segments within the sample.
[0025] S2 includes acquiring the original signal sequence of walnut samples from edge devices at supply chain nodes, uniformly sampling them at a preset sampling frequency to generate a time-domain signal dataset; generating a frequency-domain feature dataset by using Fast Fourier Transform based on the time-domain signal dataset; performing dimensionality reduction on the frequency-domain feature dataset using Principal Component Analysis (PCA) to generate a low-dimensional feature vector set; extracting key spectral features from the low-dimensional feature vector set through spectral line energy calculation to obtain a refined feature vector set; if the energy value of a specific spectral feature in the refined feature vector set exceeds a preset threshold, it is judged as a potential quality anomaly signal, generating an anomaly feature dataset; grouping the walnut samples using a clustering analysis algorithm based on the anomaly feature dataset to obtain sample quality classification results; and calculating the quality distribution probability of each group from the sample quality classification results through statistical analysis to generate a quality grading dataset.
[0026] In this implementation, the original signal sequence of a single walnut sample is first read from the edge device of the supply chain node. A time-domain signal dataset is generated by uniformly sampling the continuous waveform at a preset sampling frequency. The sampling frequency is set to 44100 Hz, the sampling duration to 2 seconds, and the quantization depth to 16 bits. These three parameters are determined by offline calibration. The calibration uses a set of no less than 200 normal samples and no less than 200 abnormal samples. The stability ratio of the main peak position under repeated sampling and the end-to-end processing delay are measured respectively. The calibration is performed while ensuring that the repeatability consistency is not less than 0.95 and the single-sample processing delay does not exceed [a certain value]. The combination with the smallest data volume is selected as the fixed parameter from all combinations of 0.20 seconds. After generating the time-domain signal dataset, the time-domain sequence of each sample is divided into equal-length data blocks. The data block length is set to 2048 points, and the step between adjacent data blocks is set to 1024 points, so that adjacent data blocks overlap by half their length to balance time continuity and frequency resolution. These two parameters are determined by comparing three combinations of 2048 points and 1024 points, 4096 points and 2048 points, and 1024 points and 512 points in offline scanning. Under the condition of sampling frequency of 44100 Hz, the frequency corresponding to 2048 points is... The interval is approximately 22 Hz. Verification showed that the main peak localization error was no higher than 5 Hz and the anomaly detection rate was no lower than 0.90, therefore 2048 points and 1024 points were fixed. To reduce spectral leakage, a Hanning window was applied to each data block and amplitude normalization was performed. The use of the Hanning window was determined by comparing the sidelobe suppression and main lobe widening of rectangular and Hamming windows, selecting a scheme where sidelobe suppression was improved by no less than 30 dB and the resolution loss corresponding to main lobe widening did not exceed 10 Hz. Subsequently, a Fast Fourier Transform was performed on each data block, with the number of transform points consistent with the data block length, 2048 points, outputting the non-negative frequency range. The amplitude sequence within the range is generated by concatenating the sequences of each data block in chronological order to form a frequency domain feature sequence. The frequency domain feature sequences of all samples are then merged to obtain a frequency domain feature dataset. Principal component analysis is performed on the frequency domain feature dataset for dimensionality reduction. First, the amplitude value at each frequency position is standardized within the sample set using the sample mean and sample standard deviation at that position to eliminate dimensional differences and amplitude shifts. Then, the cooperative variation relationship between each frequency position is calculated and sorted from largest to smallest contribution. The first three comprehensive dimensions are selected as the low-dimensional representation, with the selection criterion being that the cumulative contribution rate is not less than 0.90. The improvement in anomaly detection rate after adding the fourth dimension is insufficient to significantly reduce the false alarm rate. This condition was verified one by one in the independent validation set and then fixed. The values of the three comprehensive dimensions are output in the order of data blocks to form a low-dimensional feature vector set. Spectral line energy calculation is performed on the low-dimensional feature vector set to extract key spectral features. Specifically, the position with the maximum energy in the low-dimensional representation corresponding to each data block is located as the main peak position. Then, a frequency band is symmetrically defined on the left and right sides of the main peak with a fixed bandwidth, and the amplitude within the frequency band is squared and accumulated point by point to obtain the main peak energy. At the same time, the proportion of the main peak energy to the total frequency band energy of the data block and the frequency difference between the main peak frequency and the positions on both sides of the half-peak energy are calculated as the half-energy width. The main peak energy, the proportion of the main peak energy, and the main peak frequency are then used as the half-energy width. The half-energy width, along with other key spectral features, constitutes the critical spectral characteristics of the data block and is summarized into a refined feature vector set. The bandwidth is fixed at 200 Hz, determined by comparing the stability and computation time of the peak energy percentage at 100 Hz, 200 Hz, and 300 Hz under repeated measurements. The bandwidth with the lowest stability (not lower than 0.90) and computation time is selected. The system performs threshold determination block by block on the refined feature vector set, using the peak energy percentage as a specific spectral feature energy indicator and comparing it with a fixed threshold. The peak energy percentage threshold is set to 0.35. This threshold is tested point-by-point on an independent validation set, ranging from 0.20 to 0.60 in steps of 0.05, to calculate the harmonic level of precision and recall. The false alarm rate is constrained to be no higher than 0.10, and the highest point of the comprehensive index is taken as 0.35. When the main peak energy ratio of a data block is not lower than 0.35, it is judged as a potential quality anomaly. The key spectral features of the data block and its corresponding sample number are written into the anomaly feature dataset. Data blocks that do not reach the threshold are not written. The anomaly feature dataset is aggregated by sample and cluster analysis is performed to obtain the quality group of the samples. The number of clusters is fixed at 3. The initial center is determined by the representative sample corresponding to the quartile position of each anomaly feature index. The distance metric is the sum of squares of the differences of each item. The algorithm is executed cyclically by allocating and updating the center. It stops when the maximum change between two adjacent centers does not exceed 0.01 or the number of iterations reaches 100. The three corresponding centers are... The centers are labeled as quality level 1, quality level 2, and quality level 3 in ascending order of the joint level of the main peak energy proportion and half-energy width. The number of categories, initial centers, number of iterations, and stopping conditions are determined by cross-batch consistency evaluation. In repeated tests of no less than 5 batches, the category consistency is required to be no less than 0.90 and the calculation time of a single batch is not more than the set upper limit. Once the conditions are met, it is used as a fixed configuration. Finally, the sample quality classification results are statistically analyzed to generate a quality grading dataset. That is, the sample size of quality level 1, quality level 2, and quality level 3 are counted respectively, and their respective distribution probabilities are calculated. The distribution probability is defined as the sample size of that level divided by the total number of samples. The result is rounded to two decimal places and the sum is corrected to be strictly equal to 1.When rounding results in a difference, this difference is added to the grade with the largest sample size to eliminate error. The quality grading dataset and batch identifiers are archived together for subsequent correlation analysis and traceability.
[0027] S3 includes acquiring the original vibration signal sequence of walnut samples from an edge device, using high-pass filtering to remove low-frequency noise, and generating a filtered signal sequence; if the peak value of the filtered signal sequence exceeds a preset threshold, it is determined to be a potential mold and rancidity signal, resulting in a preliminary abnormal signal set; based on the preliminary abnormal signal set, waveform amplitude normalization is performed to generate a labeled feature set; for the labeled feature set, a fast Fourier transform is used to generate a frequency domain feature sequence, resulting in a frequency domain feature set; based on the frequency domain feature set, principal component analysis is used for dimensionality reduction to generate a low-dimensional feature vector set; if the energy value of a specific spectral feature in the low-dimensional feature vector set exceeds a preset threshold, it is determined to be a quality abnormal signal, resulting in a refined abnormal feature set; based on the refined abnormal feature set, K-means clustering is used to group the walnut samples to obtain the quality classification result.
[0028] In this embodiment, the original vibration signal sequence of walnut samples is first read from the edge device in sample order, generating time-series data containing only time and amplitude. The fixed configuration of the acquisition end is a sampling frequency of 44,100 Hz, a sampling duration of 2 seconds, and a quantization depth of 16 bits. In offline calibration, these three parameters are based on a set of at least 200 normal samples and at least 200 suspected rancid samples. By repeatedly measuring multiple sampling configurations, the repeatability of the main peak position and the end-to-end processing delay are compared. The set with the smallest data volume among all combinations where the repeatability is not less than 0.95 and the single-sample processing delay does not exceed 0.20 seconds is selected as the fixed parameters. After reading the original vibration signal... High-pass filtering was performed to remove low-frequency noise and generate a filtered signal sequence. The high-pass filter was a digital filter with fixed coefficients, a cutoff frequency of 1000 Hz, a filter order of 64, and a transition bandwidth of 200 Hz. These three parameters were determined jointly through background noise spectrum measurement and false trigger control. Specifically, the background low-frequency energy distribution was continuously collected for 60 minutes under no-load and equipment background conditions. Then, the false trigger probability and the effective frequency band retention ratio were evaluated point by point in 100 Hz steps within the cutoff frequency range of 700 Hz to 1500 Hz. The minimum cutoff frequency of 1000 Hz was selected with a false trigger probability of no more than 0.01 and an effective frequency band retention ratio of no less than 0.99. Next, stopband attenuation and passband flatness were calculated for combinations of filter orders from 32 to 128 and transition bandwidths from 100 to 400. The smallest order combination selected with a stopband attenuation of not less than 40 dB and a passband ripple of not more than 1 dB was 64 and 200. After filtering, the filtered signal sequence was segmented into equal-length segments for spectral peak determination. The segment length was set to 2048 points, and the adjacent segment step was set to 1024 points. These two parameters were determined through comparative experiments at a fixed sampling frequency of 44100 Hz, using three combinations: 1024 points and 512 points, 2048 points and 1024 points, and 4096 points and 2048 points. Considering the trade-off between resolution and real-time performance, 2048 points was chosen as the optimal combination. The corresponding frequency interval is approximately 22 Hz, with the main peak localization error not exceeding 5 Hz, and the anomaly detection rate maintained at no less than 0.90. Subsequently, a Fast Fourier Transform is performed on each segment to obtain an amplitude sequence in the non-negative frequency range. The maximum amplitude in this sequence is directly searched as the spectral peak value of that segment, and the corresponding frequency is recorded. The system compares the spectral peak value of each segment with a preset threshold, which is fixed at 0.35. This threshold is tested point by point on an independent validation set in the range of 0.20 to 0.60 with a step size of 0.05. The highest point is selected to obtain 0.35 by calculating the harmonic level of accuracy and recall and using the constraint that the false alarm rate should not exceed 0.10. When the spectral peak value of any segment is not lower than 0.At 35, a potential mold and rancidity signal is identified, and the segment index and its peak information are written into the preliminary abnormal signal set. Segments that do not reach the threshold are not written to avoid dilution of subsequent judgments by low-risk segments. For each segment in the preliminary abnormal signal set, waveform amplitude normalization is performed to eliminate acquisition gain differences. The normalization method is to map the absolute maximum amplitude of the segment to 1 and proportionally map the remaining sampling points to the 0 to 1 interval, while retaining the sample number and segment index to form a labeled feature set. On the labeled feature set, a fast Fourier transform is performed again on each segment to generate a frequency domain feature sequence, which is then summarized into a frequency domain feature set. The number of transform points is consistent with the segment length, which is 2048 points, to avoid spectral distortion caused by interpolation or truncation. The main process is then performed on the frequency domain feature set. Component analysis is used for dimensionality reduction. The dimensionality reduction process involves standardizing the amplitude at each frequency position using the mean and standard deviation of that position within the current set to achieve centering and scale unification. Then, the collaborative changes between frequency positions are calculated and sorted by contribution from largest to smallest. The top three comprehensive dimensions are selected as the low-dimensional representation output as a low-dimensional feature vector set. The three dimensions are determined based on the requirement that the cumulative contribution rate of the top three dimensions is not less than 0.90 in the validation set, and the introduction of a fourth dimension is insufficient to offset the increase in computational latency due to the combined improvement in anomaly detection rate and false alarm rate. After comparison, the three dimensions are fixed. The system calculates the energy value of a specific spectral feature in the low-dimensional feature vector set for secondary judgment. The specific spectral feature is defined as the main peak energy. The energy percentage is calculated as follows: In each segment's low-dimensional representation, the position with the highest energy is identified as the main peak position. A symmetrical frequency band with a total width of 200 Hz is formed by taking 100 Hz intervals to both sides of this position. The amplitude within this frequency band is squared point-by-point and accumulated to obtain the main peak energy. Simultaneously, the amplitude across the entire frequency band is squared point-by-point and accumulated to obtain the total band energy. The ratio of these two values is used as the main peak energy percentage. The threshold for the main peak energy percentage is fixed at 0.40. This threshold is tested point-by-point on an independent validation set with a range of 0.30 to 0.60 and a step size of 0.02, while simultaneously calculating accuracy, recall, and false positive rate. Under the dual constraints of a false positive rate not exceeding 0.10 and a false negative rate not exceeding 0.15, the threshold with the highest accuracy is selected, resulting in 0.40. When the main peak energy of a certain segment... When the proportion is not less than 0.40, its key spectral features and segment index are written into the refined anomaly feature set; other segments are not written. After obtaining the refined anomaly feature set, the key spectral features of all refined anomaly segments to which the sample belongs are aggregated, and the K-means clustering algorithm is performed on the samples to obtain the quality classification results. The number of clusters is fixed at 3 to correspond to the low, medium and high quality levels. The initial center is selected from the 25th, 50th and 75th percentiles of the refined anomaly feature distribution using the quantile method. The distance metric is the sum of squares of the differences between each item. The algorithm is executed in a cyclical order of assigning samples to the nearest center and updating the center to the mean of each indicator of the assigned samples. The convergence criterion is that the maximum change between two adjacent centers does not exceed 0.The clustering process stops when the number of iterations reaches 100 or 01. The number of categories, initialization method, maximum number of iterations, and convergence threshold are determined through repeated experiments across at least five batches. Category consistency must be at least 0.90, and the computation time for a single batch must not exceed the set upper limit. After clustering, the three categories are labeled as quality level 1, quality level 2, and quality level 3 in ascending order of the proportion of the dominant energy at the center, and the quality level of each sample is output as the final quality classification result.
[0029] S4 includes collecting vibration signal sequences of walnut samples from edge devices, preprocessing and filtering to remove interference, generating a filtered signal sequence; for the filtered signal sequence, a hash function is used for unique encoding to generate an initial identifier code sequence; based on the initial identifier code sequence, environmental information is fused by embedding temperature and humidity data to generate an environmental fusion identifier set; if the matching degree between the timestamp information and location coordinates in the environmental fusion identifier set exceeds a preset threshold, a weighted average method is used to integrate time and location information to generate a unique identifier feature set; for the unique identifier feature set, a support vector machine algorithm is used for classification processing to generate a quality classification label set; based on the quality classification label set, walnut samples are grouped through cluster analysis to generate a grouping result set; for the grouping result set, statistical analysis methods are used to calculate the feature distribution of each group to generate the final quality assessment dataset.
[0030] In this embodiment, the vibration signal sequence of the walnut samples is first read in the order of the samples and then preprocessed and filtered to remove interference and generate a filtered signal sequence. The sampling configuration is fixed at a sampling frequency of 44,100 Hz, a sampling duration of 2 seconds, and a quantization depth of 16 bits. In offline calibration, these three parameters are compared one by one with a set of no less than 200 normal samples and no less than 200 abnormal samples. The performance of different sampling combinations in terms of main peak localization consistency and end-to-end processing delay is compared. The repeatability consistency is not less than 0.95 and the single sample processing delay does not exceed 0. The set with the smallest data volume among all combinations within a 20-second timeframe is selected as the fixed configuration. Preprocessing filtering employs a fixed-coefficient digital high-pass filter with a cutoff frequency of 1000 Hz, a filter order of 64, and a transition bandwidth of 200 Hz. These three parameters are determined jointly through background noise spectrum measurement and false trigger control. Specifically, background low-frequency energy distribution is obtained by continuously collecting data for 60 minutes under no-load and equipment background conditions. Then, the false trigger probability and effective frequency band retention ratio are evaluated point-by-point in increments of 100 within the cutoff frequency range of 700 to 1500 Hz. False triggers are selected accordingly. The minimum cutoff frequency, 1000, is obtained with a probability not higher than 0.01 and an effective frequency band retention ratio not lower than 0.99. Then, stopband attenuation and passband flatness are calculated using combinations of filter orders from 32 to 128 and transition bandwidths from 100 to 400. The minimum order combination selected is 64 and 200, where the stopband attenuation is not lower than 40 dB and the passband ripple is not higher than 1 dB. After filtering, a unique initial identifier sequence is generated for each sample. The unique encoding process completes three steps in a predetermined order. The first step is to perform fixed-length compression on the filtered signal sequence. The fixed-length sequence is obtained by dividing the entire signal into segments of 2048 points each, with increments of 1024 points. For each segment, six statistical parameters are calculated: maximum amplitude, minimum amplitude, mean, standard deviation, kurtosis, and energy. These parameters are then concatenated in chronological order to form a fixed-length statistical sequence. The segment length and increment are determined through comparative experiments at 44100 Hz on three combinations: 1024 points and 512 points, 2048 points and 1024 points, and 4096 points and 2048 points. The selection criteria are: a main peak localization error of no more than 5 Hz and an anomaly detection rate of no less than 0.The first step is to calculate the combination of 90 simultaneous calculations with a latency not exceeding a set upper limit, namely 2048 and 1024. The second step is to compress the above statistical sequence to the interval between 0 and 1 using a linear mapping, then round and quantize it to two decimal places and concatenate them into a fixed-length number string. The third step is to input the number string into an irreversible hash function and convert the output into a fixed-length code consisting only of numbers. The code length is fixed at 20 bits, and the length is determined by the collision rate target. The target is that the collision probability in a single batch of 100,000 records is no higher than one in ten thousand. Through offline simulation, the actual collision rate is calculated one by one in the length range of 12 to 24, and the minimum length that meets the target is used as the value to obtain 20 bits. The initial identifier code sequence is obtained; after obtaining the initial identifier code sequence, environmental information fusion is performed to generate an environmental fusion identifier set. Specifically, temperature and humidity data are read from the same acquisition segment corresponding to each initial identifier and written to the end of the code with a fixed decimal place precision to form an extended record. Both temperature and humidity retain 1 decimal place. The number of decimal places is determined by comparing the discrimination and storage overhead of retaining 0, 1, and 2 decimal places under repeated measurements. The smallest decimal place, i.e., 1, is selected with a discrimination of not less than 0.95 and a single record length not exceeding the existing upper limit. After completing environmental fusion, the matching degree between timestamp information and location coordinates is calculated and compared with a threshold. To determine whether to proceed to the integration step, the matching degree is defined as the proportion of records within the same batch that have a time difference of no more than 30 seconds and a spatial distance of no more than 10 meters from the current record, out of the total number of records that can be associated with the current record within the batch. The time threshold of 30 seconds and the distance threshold of 10 meters are determined through grid search in offline calibration. Candidate time thresholds are 10, 20, 30, 40, and 60, and candidate distance thresholds are 5, 10, 15, 20, and 30. The evaluation index is that the aggregation rate of homogeneous records within the batch is not less than 0.95 and the cross-batch erroneous aggregation rate is not higher than 0.05. Finally, 30 and 10 were selected. The matching degree threshold is fixed at 0.85. In independent validation batches, the aggregation accuracy and false aggregation rate are tested point-by-point in increments of 0.05, ranging from 0.70 to 0.95. The highest accuracy point, 0.85, is selected with the false aggregation rate not exceeding 0.05 as a constraint. When the matching degree is not lower than 0.85, a weighted average integration is performed on time and location to generate a unique identifier feature set. The weighting rule is 0.6 for time and 0.4 for location. The weights are determined by comparing temporal consistency and spatial deviation in combinations where time and location each account for 0.5 to 0.7 and 0.3 respectively. The combination of 0.6 and 0.85, where temporal consistency is not lower than 0.95 and spatial deviation is not higher than 5 meters, is selected.4. The integration process involves sorting the records within the window that have passed the matching judgment according to time sequence, mapping the time difference of each record to a 0-1 interval using a 30-second threshold as the time coefficient, and mapping the positional distance of each record to a 0-1 interval using a 10-meter threshold as the position coefficient. Then, the time and position coefficients are weighted and averaged to obtain the integrated time and integrated position, which are then written into a unique identifier feature set along with the initial identifier, temperature, and humidity. Classification processing is then performed on the unique identifier feature set to generate a quality classification label set. The classification algorithm is a radial kernel model of support vector machine, and the input features are fixed as integrated time, integrated longitude, integrated latitude, and... The model uses six numerical statistical summaries: temperature, humidity, and the initial identifier code. Specifically, the numerical statistical summaries include the sum of the encoded digits, the range of the encoded digits, and the dispersion of the encoded digits. The model penalty coefficient is set to 10, the kernel width to 0.5, and the class weight ratio to 1:1. These three values are determined by grid search during offline calibration. The candidate values for the penalty coefficient are 1, 3, 10, 30, and 100; the candidate values for the kernel width are 0.1, 0.3, 0.5, 0.7, and 1.0; and the candidate values for the class weight ratio are 1:1, 1:2, and 2:1. The evaluation metrics are: overall accuracy not less than 0.90, anomaly recall not less than 0.90, and false positive rate not higher than 0.10. The model is the minimum complexity group that satisfies these metrics. The final ratio of cooperation is 10 to 0.5 to 1:1. Model training and validation employ a 5-fold crossover method to balance stability and training time. During the inference phase, a quality label is output for each record, explicitly specifying whether it is normal or abnormal, and these labels are aggregated into a quality classification label set. After obtaining the quality classification label set, cluster analysis is performed on the walnut samples to generate a grouped result set. The clustering method is the bottom-up shortest distance method of hierarchical clustering. The input features are consistent with those in the classification phase. The stopping criterion is that the minimum distance between classes exceeds 2.0 or the number of groups reaches 3; either the threshold of 2.0 and the upper limit of 3 are determined by the group consistency and cross-batch stability assessment of the independent validation batches, requiring a consistency of no less than 0.90. Furthermore, the number of groups should not exceed three to meet the quality management grading requirements. Finally, statistical analysis is performed on the grouped result sets to generate the final quality assessment dataset. The statistics include the sample size and percentage for each group, the median and interquartile range of temperature, the median and interquartile range of humidity, the proportion of integration time during day and night, the proportion of integration location at each supply chain node, and the proportion of abnormal tags within each group. All proportions are rounded to two decimal places and corrected within each group to ensure the sum of all proportions equals 1.00. When rounding results in discrepancies, these discrepancies are added to the group with the largest sample size to eliminate errors. Finally, the quality assessment dataset, along with batch identifiers, parameter version numbers, and effective dates, is archived.
[0031] S5 includes collecting refined feature vectors and labeled feature sets from walnut samples collected from edge devices, and generating unique identifiers using a hash function. For each unique identifier, a sharding algorithm is used to distribute the data to distributed storage nodes in the cloud database, resulting in a partitioned storage dataset. If the response time of a storage node in the partitioned storage dataset is lower than a preset threshold, a load balancing mechanism is used to adjust the data distribution, resulting in an optimized storage dataset. Based on the optimized storage dataset, the device ID is used as the index key to associate the refined feature vectors and labeled feature sets, resulting in an archived dataset. For the archived dataset, a consistent hashing algorithm is used to verify data integrity, resulting in a verified dataset. Environmental information is extracted from the verified dataset, and cluster analysis is used to group the walnut samples, resulting in a grouped dataset. Based on the grouped datasets, statistical analysis methods are used to calculate the distribution characteristics of environmental information in each group, resulting in the final classification dataset.
[0032] In this implementation, the refined feature vector and labeled feature set corresponding to each walnut sample are first received in batches from the edge device and written into the encoding cache. Then, a unique identifier generation process is performed on each record. The process consists of three steps. The first step is quantization and splicing preparation, which involves rounding all values in the refined feature vector and labeled feature set to two decimal places with uniform precision and concatenating them in a fixed field order without separators. The fixed order is: sample number, device ID, collection timestamp, collection location longitude, collection location latitude, refined feature components in ascending order by index, and labeled feature fields in order of generation. The quantization precision and field order are compared in offline calibration by comparing 1-digit, 2-digit, and 3-digit precision and various field arrangements to check the hash collision rate and replay consistency. The impact of the algorithm is determined, and the combination of 2 bits with the above order is selected, which has a deduplication accuracy of not less than 0.99, the lowest collision rate, and a replay consistency of 1.00. The second step is hash calculation, where the concatenated number string is input into an irreversible hash function, and the output is digitized and truncated into a fixed-length code. The code length is fixed at 20 bits. In offline simulation, the actual collision rate of a single batch of 100,000 records is evaluated point by point with alternative lengths from 12 to 24 bits. The minimum length of 20 bits that meets the target is a collision probability of not exceeding one in ten thousand, thus obtaining a unique identifier code. The third step is enqueuing, where the system encapsulates the unique identifier code together with the corresponding refined features and labeled features into a record and enqueues it into the waiting-to-shard queue. After entering the sharding stage... The system employs a sharding algorithm to distribute records to distributed storage nodes in the cloud database. Specifically, it obtains a shard number by taking the remainder of the unique identifier value divided by the sharding granularity number, and then maps this number to storage nodes according to a preset mapping table. The sharding granularity number is fixed at 64, and the number of storage nodes is fixed at 8. These values are determined through capacity assessment and peak playback. The assessment uses the peak arrival rate over the past 12 months as input, requiring that the average node utilization rate under peak insertion per minute not exceed 70%, and the 90th percentile response time not exceed 0.10 seconds. This outputs a partitioned storage dataset. The system continuously monitors the response time of each storage node in the partitioned storage dataset, with a fixed monitoring window length of 60 seconds, a fixed sampling period of 1 second, and the metric defined as... The median round-trip time for write requests within the window is used to trigger load balancing to adjust data distribution when this metric for any storage node falls below a preset threshold. The threshold is fixed at 0.05 seconds and is determined by comparing four candidate values (0.03, 0.05, 0.07, and 0.10) in independent stress replays. The smallest candidate value of 0.05 seconds is selected when the overall throughput improvement is not less than 20% and the proportion of hot nodes is not higher than 10%. After triggering, the system migrates some shards to the low-latency node to improve resource utilization and reduce cross-node differences. The batch size for a single migration is fixed at 4 shards, and the value is determined by comparing the impact of 2, 4, and 8 on migration jitter and success rate. The value is selected when the migration success rate is 1.00 and the average latency improvement does not exceed 0.The minimum value of 0.01 seconds is 4, thus obtaining the optimized storage dataset. On the optimized storage dataset, the system uses the device ID as the unique index key for archiving. This is done by associating the refined feature vector and labeled feature set for the same collection timestamp under the same device ID with each other one-to-one and writing them into the archived dataset. The device ID is chosen as the index key because it is unique across the entire network and its edge and cloud port diameters are consistent. Before going live, a full verification confirmed a conflict rate of 0. To verify the integrity of the archived dataset, the system performs a consistent hash check on each record. Specifically, a fixed number of virtual nodes are configured for each physical node on a hash ring containing all physical nodes, and their unique identifiers are used to recalculate their position on the ring. Simultaneously, the hash digest of the record content is recalculated and compared with the storage digest. The number of virtual nodes is fixed at 100, determined after comparing the impact of 20, 50, and 100 on the uniformity of key distribution. The minimum value of 100, where the key skew is no higher than 5%, is chosen. Only when the ring position and digest are consistent are the records marked as passed and written into the verified dataset. The system then extracts the environmental information field from the verified dataset, with the field fixed as temperature. The data includes temperature, humidity, collection timestamps, and location coordinates. Temperature and humidity are retained to one decimal place, timestamps are converted to hours from 0 to 24, and location coordinates are expressed as longitude and latitude. Next, cluster analysis is performed on the samples to form grouped datasets. The clustering method is fixed at K-means, the number of clusters is fixed at 3 to accommodate subsequent hierarchical requirements, initial centers are initialized using quantiles, the maximum number of iterations is fixed at 100, and the convergence threshold is fixed at 0.01. These three parameters are determined in at least 5 batches of repeated experiments, requiring cross-batch consistency of at least 0.90 and a single batch clustering computation time not exceeding [a certain threshold]. After exceeding the existing upper limit, the clustering process proceeds to the statistical analysis stage to generate the final classification dataset. The statistical items are fixed as follows: number of samples per group, sample percentage, mean, median, and interquartile range of temperature, mean, median, and interquartile range of humidity, proportion by hour, and proportion by supply chain node location. These proportions are uniformly rounded to two decimal places and corrected within groups to ensure the sum of all proportions equals 1.00. When rounding results in differences, these differences are added to the item with the largest sample size to eliminate errors. The final output classification dataset, along with the parameter version number and effective date, is archived.
[0033] S6 includes the following steps: For the integrated dataset, an association rule mining algorithm is used to analyze the patterns of unique identifiers in multi-node data, generating a preliminary matching set containing highly similar sample pairs. If the similarity of unique identifiers of sample pairs in the preliminary matching set is higher than a preset threshold, the batch association of sample pairs is verified through environmental noise superposition analysis to obtain a batch link chain. Based on the batch link chain, a clustering analysis method is used to group sample pairs with similar batch associations to obtain a batch grouping set. For the batch grouping set, the distribution characteristics of unique identifiers in each group are calculated to generate a feature distribution dataset. If the inter-group difference in the feature distribution dataset is higher than a preset threshold, a consistency check algorithm is used to verify the data integrity of the batch grouping set to obtain a verified set. Based on the verified set, a statistical analysis method is used to extract the environmental noise characteristics of each group to generate a noise feature dataset. For the noise feature dataset, a batch traceability index is generated through the association of batch link chains to obtain the final traceability dataset.
[0034] In this implementation, a transaction set for association rule mining is first constructed. Transactions are defined using a joint time and location window. The time window length is set to 30 minutes, and the location window radius is set to 10 meters. These values are determined during the offline calibration phase by comparing the homogeneous sample aggregation rate and cross-batch error aggregation rate of candidate combinations from 10 to 60 minutes and from 5 to 30 meters. The minimum combination meeting the conditions of a homogeneous aggregation rate not lower than 0.95 and a cross-batch error aggregation rate not higher than 0.05 is selected, thus fixing the values at 30 minutes and 10 meters. Within each transaction, unique identifiers are collected, and rule metrics are calculated. The minimum support is set to 0.02, the minimum confidence to 0.60, and the minimum lift to 1.20. These three thresholds are set independently... On the validation batch, rule coverage, false trigger rate, and runtime are evaluated point-by-point within the candidate range of support (0.01-0.05), confidence (0.50-0.80), and lift (1.00-1.50). The minimum threshold combination with rule coverage no lower than 0.90, false trigger rate no higher than 0.10, and runtime not exceeding a predetermined upper limit is selected and fixed. Based on the selected rules, the system calculates a similarity score for any two records. Similarity is defined as the ratio of the number of times two records co-occur in all transactions to the smaller of the two records' occurrence counts. This ratio is then weighted and summed using the lift of the corresponding rule as a fixed weight to form a single score. The similarity threshold is set to 0.85, which is determined by applying a 0.85 threshold to the independent validation batch. The system performs point-by-point testing with a step size of 0.05, ranging from 0.70 to 0.95. Under the dual constraints of a matching accuracy of no less than 0.92 and a recall of no less than 0.85, the point with the highest accuracy is selected. All sample pairs with a score of no less than 0.85 are written into the preliminary matching set. The system then performs environmental noise superposition analysis on the preliminary matching set to verify batch correlation. Environmental noise data is extracted from the integrated dataset by sample pair, including temperature sequence, humidity sequence, background noise energy sequence, and background noise dominant frequency proportion sequence. All four types of sequences are calculated with three sets of quantized values within the same time and location joint window. The three sets of quantized values are the fluctuation amplitude, the median level of the location, and the intraday distribution proportion, respectively. The system combines the three sets of quantized values of the four types obtained from two records to form two noise vectors of equal length. Then, the superimposed vector is obtained by equal weighting and compared with the term-by-term average of the two vectors. The difference comparison index is defined as the median level of the proportion of the absolute difference between each term of the superimposed vector and the term-by-term average to the term-by-term average. At the same time, the proportion of the four types of indicators with consistent direction is calculated. When the difference comparison index is not higher than 0.10 and the proportion of consistent direction is not lower than 0.75, the environmental noise superposition is considered consistent and the sample pair is judged to have batch correlation. The above two thresholds are evaluated point by point on no less than 5 historical batches with a candidate set of difference ratio thresholds of 0.05 to 0.20 and a proportion of consistent direction thresholds of 0.60 to 0.90. Under the premise that the correct acceptance rate is not lower than 0.90 and the false acceptance rate is not higher than 0.08, a difference ratio of 0.10 and a proportion of consistent direction of 0 are selected.75. Solidification: All validated sample pairs are connected in ascending chronological and positional order to form batch link chains. The time interval between adjacent sample pairs in a link chain must not exceed 60 minutes, and the spatial interval must not exceed 50 meters. These two thresholds were determined by evaluating the link integrity rate and cross-link connection rate of four combinations: 60 minutes and 90 minutes, and 50 meters and 100 meters. The link integrity rate is required to be no less than 0.95, and the cross-link connection rate is required to be no more than 0.05. Finally, 60 minutes and 50 meters were fixed. Cluster analysis is performed on the batch link chains to group sample pairs with similar batch correlations. The clustering input is fixed as the length of each link chain, the average time interval, the average spatial interval, and the environmental noise superposition. Five indicators were used for difference comparison, including the median level and the proportion of directions consistent. The number of categories was fixed at 3, the initialization method used quantiles, the maximum number of iterations was fixed at 100, and the convergence threshold was fixed at 0.01. These settings were determined through category consistency and boundary stability evaluation in at least 5 batches of repeated trials, requiring a category consistency of no less than 0.90 and a convergence failure rate of 0. After clustering, batch group sets were obtained. The system then statistically analyzed the distribution characteristics of unique identifiers for each batch group set to generate a feature distribution dataset. The distribution characteristics were fixed and included the number of unique identifiers in each group, the proportion of unique identifiers appearing at each node, the proportion of unique identifiers appearing at each time period, and the proportion of unique identifiers repeating. Proportional data is rounded to two decimal places and corrected within each group to ensure the sum of all proportions equals 1.00. The system uses the inter-group difference index to determine whether to proceed with consistency verification. The inter-group difference index is defined as the median level of the maximum proportion difference of each group's distribution characteristics across all dimensions. The inter-group difference threshold is fixed at 0.20. This threshold is tested point-by-point on independent validation batches with a candidate range of 0.10 to 0.30 and a step size of 0.05. The minimum value that can effectively screen out abnormal groups is selected under the premise that the false alarm rate is not higher than 0.10. When the inter-group difference is not lower than 0.20, the system performs consistency verification on the batch group set to verify data integrity. The consistency verification includes three checks, the first of which is a unique identifier. The first check is the recalculation consistency check, which involves concatenating each record in the group according to a fixed field order, recalculating the unique identifier, and comparing it with the stored value one by one. Only records that are completely consistent with the recalculated identifier pass the check. The second check is the link chain continuity check, which requires that the time order of each link chain in the group must be strictly increasing, and the time and spatial intervals between any adjacent nodes must not exceed 60 minutes and 50 meters, respectively. The third check is the time and location consistency check, which requires that the difference between the span between the earliest and latest times in the same group and the overall path length of the group relative to the average level of the group should not exceed 0.15. This 0.15 threshold is evaluated point by point on historical data using a candidate set of 0.10 to 0.30 and a step size of 0.05, with a false negative rate not exceeding 0.05 and a false positive rate not exceeding 0.Under the constraint of 10, records that pass all three checks constitute the verification pass set. The system performs statistical analysis on the verification pass set to extract environmental noise characteristics for each group, generating a noise feature dataset. The extracted content is fixed as follows: average temperature level and fluctuation amplitude and day / night ratio; average humidity level and fluctuation amplitude and day / night ratio; average background noise energy level and fluctuation amplitude and the proportion of the main noise frequency band. All proportion results are rounded to two decimal places. Finally, the system generates a batch traceability index based on the noise feature dataset and the association relationship of the batch link chain, obtaining the final traceability dataset. The index key is the link chain number, and the index value is the list of samples involved in the link chain, the node order, the time order, and the corresponding noise feature summary. The construction rules are: samples are arranged in ascending order of time, nodes are arranged in order of path sequence, and within the same node, they are arranged in descending order of the proportion of the main noise frequency band. After the index is generated, it is archived together with the parameter version number and the effective time.
[0035] S7 includes accessing cloud-archived records via batch linking, using database indexing technology to obtain a set of records containing abnormal quality tags, and identifying the abnormal batch dataset; if the abnormal batch dataset contains abnormal quality tags, then tracing the supply chain links corresponding to the abnormal batches through supply chain node identifiers to obtain a set of supply chain links; using time-frequency domain transformation methods to analyze the mold and rancidity signals of each link in the supply chain link set and extracting signal feature datasets; using the signal feature datasets, calculating the batch correlation strength of the mold and rancidity signals of each supply chain link to obtain a set of batch correlation strengths; if the correlation strength of a certain link in the batch correlation strength set is higher than a preset threshold, then determining the source link of mold and rancidity through quality anomaly distribution analysis and obtaining the source link identifier; based on the source link identifier and combined with the batch linking chain, generating a complete traceability path from cloud-archived records to the source of mold and rancidity; using the complete traceability path and data query efficiency optimization technology, generating a traceability index dataset containing supply chain links and mold and rancidity signal features.
[0036] In this implementation, the batch link chain is used as the retrieval entry point to access cloud archive records. Database indexing technology is used to complete the location and filtering within a single request. The index structure is fixed as a combination of a multi-way balanced tree composite index and a hash index. The composite retrieval key order is batch link chain number first, quality label second, and timestamp last. The hash index is bound to the quality label field to achieve parallelization of equal-value filtering. Whether to enable the combined method is determined by offline benchmark testing. The benchmark conditions are 50 concurrent requests, 100,000 sample records, and the retrieval condition is a joint query by batch link chain number and abnormal quality label. The evaluation index is the response time to the 90th decimal place. If the response time exceeds 0.05 seconds and the average response time does not exceed 0.02 seconds, the combined index method is enabled; otherwise, only the composite index is enabled. After the retrieval is completed, a set of records containing abnormal quality tags is obtained, and the abnormal batch dataset is determined accordingly. The judgment rule is that if the number of records is not less than 1, it is considered to contain abnormal quality tags and enter the traceability step; if it is 0, an empty set is output and the process ends. When entering the traceability step, the system queries the node basic information table one by one according to the supply chain node identifier in the records of the abnormal batch dataset. The node table is configured with a hash index for equal-value hits. The queried records are concatenated in ascending order of timestamp and in the order of node sequence. If the same record appears on multiple nodes, the system will not retrieve the records. If duplicates occur, only the earliest time is retained, and the rest are added to a duplicate list for consistency verification. After concatenation, a set of supply chain links is obtained. Time-frequency domain transformation analysis is performed on this set to analyze the mold and rancidity signals of each link. The transformation method is fixed as short-time Fourier transform, with a window length of 2048 points, an overlap of 1024 points between adjacent windows, and a Hanning window type. These three parameters were determined after offline comparison of three combinations: 1024 points versus 512 points, 2048 points versus 1024 points, and 4096 points versus 2048 points, and verification via playback at a sampling frequency of 44100 Hz. A frequency interval of approximately 22 Hz and a main peak positioning error of no more than 5 Hz were selected. The parameter group with an anomaly detection rate of not less than 0.90 and a calculation delay not exceeding the set upper limit is 2048, 1024, and the Hanning window. The system calculates six categories of indicators segment by segment on the time-frequency results of each stage and forms signal feature entries. These six categories are the main peak frequency, the proportion of main peak energy, the half-energy width, the spectral centroid, the proportion of abnormal segments, and the proportion of abnormal segments in four time periods within the day. Among them, abnormal segments are judged according to the proportion of main peak energy not less than 0.40. The 0.40 threshold is used to evaluate the accuracy, recall, and false alarm rate point by point on the independent verification batch with a step size of 0.02, from 0.30 to 0.60, and the false alarm rate is not higher than 0.10 and the false negative rate is not higher than 0.Under the dual constraints of 15, the point with the highest accuracy is selected; all entries are merged to form a signal feature dataset; based on the signal feature dataset, the batch correlation strength of the mold rancidity signal for each supply chain link for this batch is calculated. The strength is obtained by adding four components with fixed weights. These four components are the consistency ratio with the temporal order of the batch link chain, the consistency ratio with the spatial order of the batch link chain, the consistency ratio of the upward trend of abnormal segments over time, and the consistency ratio of environmental noise. The temporal consistency ratio is calculated by comparing the time series of abnormal segments in this link with the node time series of the batch link chain and counting the proportion of segments that maintain a sequential relationship to the total number of comparable segments; the spatial order consistency ratio is calculated by comparing the time series of abnormal segments in this link with the node time series of the batch link chain. The node paths of each stage are aligned one by one with the node paths of the batch link chain, and the proportion of adjacent nodes with consistent directions is calculated. The proportion of consistent upward trends is calculated by aggregating the proportion of abnormal segments in the stage into one value per hour according to a fixed window, and calculating the non-decreasing proportion of adjacent hours. The environmental noise consistency proportion is taken from the average of the proportions of consistent directions of temperature, humidity and background energy obtained in the preceding stage. The weights of the four components are fixed at 0.40, 0.30, 0.20 and 0.10. The weights are selected from multiple combinations that increase in time proportion from even distribution in no less than 5 historical batch replays. The combination with the minimum complexity is selected with a source positioning accuracy of no less than 0.92, a false judgment rate of no more than 0.08 and no increase in average traceability path length. Therefore, the above is fixed. The four components are multiplied by their respective weights and then summed to obtain a single intensity score between 0 and 1, which is then aggregated into a batch association intensity set. The system filters the batch association intensity set using a preset threshold, which is fixed at 0.75. The threshold is tested point by point in offline grid search with a step size of 0.65 to 0.85 and a step size of 0.05. The system calculates the localization accuracy, recall, and false alarm rate on labeled historical data. The threshold of 0.75 is selected based on the criterion of achieving the highest harmonic level of accuracy and recall while the false alarm rate is no higher than 0.10. When the association intensity of any link is not lower than 0.75, the system proceeds to quality anomaly distribution analysis to determine the source of mold rancidity. The analysis includes three calculations: the first is the anomaly density, defined as the proportion of the number of abnormal fragments in that link. The first item is the proportion of all segments in this stage; the second item is the anomaly concentration, defined as the proportion of anomaly segments within the most concentrated consecutive hour; the third item is the upstream propagation verification, defined as the proportion of adjacent upstream stages before this stage where both the anomaly density and anomaly concentration are not higher than the current stage; if and only if this stage meets the following conditions: the anomaly density is the largest among all stages and the difference ratio between it and the second largest value is not less than 0.10, the anomaly concentration is not less than 0.60, and the upstream propagation verification ratio is not less than 0.80, then it is identified as the source stage of mold rancidity and the source stage identifier is output. The three thresholds are in the range of 0.05 to 0.20 for the difference ratio, 0.50 to 0.70 for the anomaly concentration, and 0.70 to 0.80 for the upstream propagation verification in no less than 5 historical batches.The candidate set of 90 is evaluated point by point, and determined under the constraints of a false positive rate not exceeding 0.10 and a false negative rate not exceeding 0.10. After obtaining the source link identifier, the system generates a complete traceability path in combination with the batch link chain. The generation rule is to concatenate all records involved in the batch according to the time order of the batch link chain, locate the source link in the path, mark the records before the source as the upstream path, and mark the records after the source as the downstream path. At each node, four feature summaries are attached: the proportion of the main peak energy, the half-energy width, the spectral centroid, and the proportion of abnormal segments, as well as the number of abnormal records and the number of non-abnormal records for verification. If there are duplicate records, only the earliest time is retained and the duplicate number is written into the path annotation. After the complete traceability path is generated, the system uses data query efficiency optimization technology to generate a traceability index dataset. The optimization technology includes three determination measures: first, to establish a coverage index using the batch link chain number and the source link identifier as a composite retrieval key. The system employs several methods to reduce table lookups. First, it partitions data by collection date at a daily granularity and enables partition pruning during queries to reduce the scan range. Second, it caches recent results of execution plans and hot key values for high-frequency query templates. Whether to enable these three methods is determined by offline benchmark testing. The benchmark conditions are 50 concurrent users, 100,000 samples, and a load of path generation queries. The evaluation metric is that the response time at the 90th decimal place does not exceed 0.05 seconds and the average response time does not exceed 0.02 seconds; if these conditions are met, the method is enabled. The record structure of the traceability index dataset is fixed as batch link chain number, source link identifier, path node order, time order of each node, and four feature summaries for each node: peak energy percentage, abnormal segment percentage, half-energy width, and spectral centroid. Proportional values are rounded to two decimal places and adjusted within groups as needed to ensure the sum of all proportions equals 1.00.
[0037] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A data-driven non-destructive detection method for walnut rancidity based on edge networks, characterized in that, include: S1. By sampling and processing signals with frequencies higher than a preset threshold in walnut samples using sensors deployed at nodes in the supply chain, the original signal sequence is obtained by capturing waveform data reflecting the degree of mold-induced rancidity during the sampling process. S2. Based on the obtained original signal sequence, Fourier transform is applied to the edge device for extraction. Principal component analysis is performed on the waveform data for dimensionality reduction. Key spectral features are extracted through spectral peak identification and spectral line energy calculation to obtain a refined feature vector. S3. If the peak value of the spectrum after signal noise filtering in the refined feature vector exceeds the preset threshold, it is determined to be a potential mold rancidity signal. A preliminary quality label is generated by associating the detection time and equipment parameters and using waveform amplitude normalization to obtain the labeled feature set. S4. A hash function is used to uniquely encode the labeled feature set. During the encoding process, environmental condition information is integrated by embedding temperature data and humidity values, and a unique identifier is obtained by using timestamp association and location coordinate fusion. S5. Upload the refined feature vector and labeled feature set to the cloud database according to the unique identifier code, and obtain the integrated dataset by merging the archived data through the distributed storage mechanism and using the device ID. S6. Perform association analysis algorithm on the integrated dataset, match similar unique identifiers from multi-node data, and obtain batch link chains by verifying the superposition of environmental noise. S7. Query cloud archive records through batch link chain. If an abnormal quality label is matched, trace back to the supply chain link and use time-frequency domain conversion to confirm the source of mold and rancidity to obtain a complete traceability path.
2. The data-driven non-destructive detection method for walnut rancidity based on edge networks according to claim 1, characterized in that: S1 includes: By deploying sensors at nodes in the supply chain, signals are sampled from walnut samples to obtain waveform data with frequencies higher than a preset threshold, and the original signal sequence is generated. Based on the original signal sequence, the signal is decomposed using the Fast Fourier Transform algorithm, the main frequency component is extracted, and the frequency feature sequence is obtained. If the amplitude of the dominant frequency component in the frequency feature sequence is higher than the preset threshold, the waveform data is denoised by wavelet transform to generate a denoised signal sequence. Based on the denoised signal sequence, the principal component analysis algorithm is used to extract feature vectors reflecting the degree of mold rancidity, and the rancidity feature sequence is obtained. If the matching degree between the feature value of the rancidity feature sequence and the preset rancidity model is higher than the threshold, the feature change trend is detected by time series analysis method to generate a rancidity trend sequence. Based on the rancidity trend sequence, a cluster analysis algorithm was used to classify the walnut samples, determine the degree of rancidity, and obtain the classification results. Based on the classification results, data on the degree of rancidity of walnut samples are generated, and the evaluation sequence is output.
3. The data-driven non-destructive detection method for walnut rancidity based on edge networks according to claim 1, characterized in that: S2 includes: The original signal sequence of walnut samples is obtained from edge devices at the nodes of the supply chain, and a time-domain signal dataset is generated by uniform sampling at a preset sampling frequency. Based on the time-domain signal dataset, a frequency-domain feature sequence is generated using the Fast Fourier Transform, resulting in a frequency-domain feature dataset. For the frequency domain feature dataset, principal component analysis algorithm is used for dimensionality reduction to generate a low-dimensional feature vector set; By calculating spectral line energy, key spectral features are extracted from the low-dimensional feature vector set to obtain a refined feature vector set; If the energy value of a specific spectral feature in the refined feature vector set exceeds a preset threshold, it is judged as a potential quality anomalous signal, and an anomalous feature dataset is generated. Based on the abnormal feature dataset, a clustering analysis algorithm was used to group the walnut samples to obtain the sample quality classification results; Through statistical analysis, the quality distribution probability of each group is calculated from the sample quality classification results to generate a quality grading dataset.
4. The data-driven non-destructive detection method for walnut rancidity based on edge networks according to claim 1, characterized in that: S3 includes: The original vibration signal sequence of walnut samples was obtained from the edge device, and high-pass filtering was used to remove low-frequency noise to generate a filtered signal sequence. If the peak value of the filtered signal sequence exceeds the preset threshold, it is determined to be a potential mold rancidity signal, and a preliminary abnormal signal set is obtained; Based on the preliminary abnormal signal set, waveform amplitude normalization processing is used to generate a labeled feature set; For the labeled feature set, a fast Fourier transform is used to generate a frequency domain feature sequence, thus obtaining the frequency domain feature set; Based on the frequency domain feature set, the principal component analysis algorithm is used to perform dimensionality reduction processing to generate a low-dimensional feature vector set; If the energy value of a specific spectral feature in the low-dimensional feature vector set exceeds a preset threshold, it is determined to be a signal with abnormal quality, and a refined abnormal feature set is obtained. Based on the refined abnormal feature set, the K-means clustering algorithm was used to group the walnut samples to obtain the quality classification results.
5. The data-driven non-destructive detection method for walnut rancidity based on edge networks according to claim 1, characterized in that: S4 includes: Vibration signal sequences of walnut samples were collected from edge devices, and preprocessing filtering was used to remove interference to generate filtered signal sequences; For the filtered signal sequence, a hash function is used for unique encoding to generate an initial identifier code sequence; Based on the initial identifier sequence, environmental information is fused by embedding temperature and humidity data to generate an environmental fusion identifier set; If the matching degree between the timestamp information and the location coordinates in the environmental fusion identifier set exceeds a preset threshold, a weighted average method is used to integrate the time and location information to generate a unique identifier feature set. For the unique identifier feature set, the support vector machine algorithm is used for classification processing to generate a quality classification label set; Based on the quality classification label set, the walnut samples were grouped through cluster analysis to generate a grouping result set; For the grouped result set, statistical analysis methods are used to calculate the characteristic distribution of each group and generate the final quality assessment dataset.
6. The data-driven non-destructive detection method for walnut rancidity based on edge networks according to claim 1, characterized in that: S5 includes: Refined feature vectors and labeled feature sets of walnut samples were collected from edge devices, and a unique identifier was generated using a hash function; For each unique identifier, a sharding algorithm is used to distribute the data to the distributed storage nodes of the cloud database, resulting in a partitioned storage dataset. If the response time of the storage nodes of the partitioned storage dataset is lower than the preset threshold, the data distribution will be adjusted through the load balancing mechanism to obtain an optimized storage dataset. Based on the optimized storage dataset, the device ID is used as the index key to associate the refined feature vector and the labeled feature set to obtain the archived dataset; For the archived dataset, the data integrity is verified using a consistent hashing algorithm to obtain the verified dataset; Environmental information was extracted from the validated dataset, and cluster analysis was used to group the walnut samples to obtain grouped datasets; Based on the grouped datasets, statistical analysis methods are used to calculate the distribution characteristics of environmental information in each group, resulting in the final classification dataset.
7. The data-driven non-destructive detection method for walnut rancidity based on edge networks according to claim 1, characterized in that: S6 includes: For the integrated dataset, an association rule mining algorithm is used to analyze the pattern of unique identifiers in multi-node data and generate a preliminary matching set containing highly similar sample pairs. If the similarity of the unique identifier codes of sample pairs in the initial matching set is higher than a preset threshold, the batch correlation of the sample pairs is verified by environmental noise superposition analysis to obtain the batch link chain. Based on the batch link chain, cluster analysis is used to group sample pairs with similar batch associations to obtain a batch group set.
8. The data-driven non-destructive detection method for walnut rancidity based on edge networks according to claim 7, characterized in that: S6 further includes: For each batch group set, calculate the distribution characteristics of the unique identifier code of each group to generate a feature distribution dataset; If the inter-group difference in the feature distribution dataset is higher than a preset threshold, the data integrity of the batch group set is verified by a consistency check algorithm to obtain a verified set. Based on the validated set, statistical analysis methods are used to extract the environmental noise characteristics of each group and generate a noise feature dataset. For the noise feature dataset, a batch source index is generated based on the correlation of batch link chains to obtain the final source dataset.
9. The data-driven non-destructive detection method for walnut rancidity based on edge networks according to claim 1, characterized in that: S7 includes: By accessing cloud archived records through batch linking, and using database indexing technology, a set of records containing abnormal quality labels is obtained to determine the abnormal batch dataset; If the abnormal batch dataset contains abnormal quality labels, then the supply chain links corresponding to the abnormal batches can be traced through the supply chain node identifiers to obtain the set of supply chain links; The time-frequency domain transformation method is used to analyze the mold rancidity signals of each link in the supply chain and extract the signal feature dataset.
10. The data-driven non-destructive detection method for walnut rancidity based on edge networks according to claim 9, characterized in that: The S7 also includes: By using the signal feature dataset, the batch correlation strength of mold and rancidity signals in each supply chain link is calculated to obtain the batch correlation strength set; If the correlation strength of a certain link in the batch correlation strength set is higher than the preset threshold, the source link of mold rancidity is determined by quality anomaly distribution analysis, and the source link identifier is obtained. Based on the source link identifier and combined with the batch link chain, a complete traceability path is generated from the cloud archive record to the source of mold and rancidity; By tracing the entire path and employing data query efficiency optimization techniques, a traceability index dataset containing supply chain links and mold rancidity signal characteristics is generated.