Traceability System and Method Based on Blockchain Technology
By verifying the operation timestamp and plot number, assessing the compliance of growth data, and performing joint confidence calculation of quality inspection parameters and judgment of environmental parameter deviations, the problem of data consistency and accuracy in traditional traceability systems has been solved, improving the completeness of agricultural product traceability queries and consumer trust.
Patent Information
- Application Number
- CN202511254925.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-04
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2045-09-04
AI Technical Summary
Traditional traceability systems lack operational logic verification at the data source, leading to risks of batch information conflicts, incomplete environmental parameter verification, lack of dynamic matching of quality inspection data, lack of time series rationality review in the logistics stage, and fragmented query results, which affects consumer trust.
The system verifies the operation timestamp and plot number through the land rights registration module, assesses the compliance of growth data through the parameter verification module, calculates the joint confidence level of quality inspection parameters through the quality inspection label module, judges the deviation of environmental parameters through the logistics locking module, and generates labels and aggregates data through the traceability audit module, ensuring the logical consistency and accuracy of the data.
It enables a systematic assessment of the growth conditions of agricultural products, identifies abnormal behaviors, improves the completeness and accuracy of traceability query results, and enhances consumer trust.
Smart Images

Figure CN120765274B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of product traceability technology, and in particular to a traceability system and method based on blockchain technology. Background Technology
[0002] Product traceability technology involves collecting, recording, and managing information throughout the entire product lifecycle, including production, processing, transportation, warehousing, and sales, to achieve traceability and data verifiability at each stage. This technology is widely used in food safety, drug regulation, and supply chain management. By constructing a multi-node information recording system, it achieves data integrity, tamper-proofing, and transparent management. Specifically, it includes multiple technical modules such as a coding generation mechanism for identifying product identity, a distributed data collection interface, traceability information structure modeling, and information uploading and verification protocols, as well as a visual query terminal for governments, businesses, and consumers.
[0003] Among them, the traceability system based on blockchain technology is a solution that utilizes the immutable and fully traceable characteristics of blockchain to build a trusted information recording system for agricultural products from production to consumption. By recording data generated at each stage of agricultural product production, including planting, harvesting, processing, packaging, logistics, and sales, the system ensures the authenticity and consistency of data across multiple nodes, enhances the efficiency of agricultural product quality and safety management, and increases consumer trust in the product's origin and quality.
[0004] Traditional traceability systems lack a verification mechanism based on operational logic and land cycle at the data generation source, leading to the risk of overlap and conflict between different batches of information. In terms of environmental parameter verification, they rely solely on single-stage data uploads, lacking dynamic matching and judgment with agronomic indicators, making it easy for non-compliant data to be recorded on the chain. Quality inspection data does not undergo offset analysis based on its relationship with the average of all batches, making it impossible to determine significant anomalies in a single batch. Although the logistics stage includes data from multiple nodes, it lacks a collaborative review mechanism for the rationality of time series and the fluctuation range of environmental parameters, making it difficult to identify potential abnormal operations. At the query level, a result aggregation strategy centered on traceability identifiers has not been built, resulting in query responses that present a scattered set of tags, making it difficult to fully reflect the complete link status from operation to sales, thus affecting consumers' trust and understanding of the query results. Summary of the Invention
[0005] The purpose of this invention is to address the shortcomings of existing technologies by proposing a traceability system and method based on blockchain technology.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: a traceability system based on blockchain technology, the system comprising:
[0007] The land rights registration module obtains the operation timestamp, operation number, plot number, and IoT device number for each batch of agricultural products, determines whether the operation timestamp meets the operation cycle sorting logic within the plot, cross-checks the IoT device number with the plot number to see if there is a matching item, and generates a land rights batch binding record.
[0008] Based on the confirmed batch binding records, the parameter verification module compares the growth agronomic standard value range set within the plot cycle to assess whether the growth data is compliant and generates growth parameter verification status data.
[0009] The quality inspection label module calls the growth parameter verification status data to obtain four quality inspection parameters for the batch: moisture content, fruit color value, pesticide residue content, and soluble solids content. It then performs a joint confidence calculation to generate a writeable data structure for the corresponding batch, thus generating a writeable quality inspection trusted data structure.
[0010] Based on the writable quality inspection trusted data structure, the logistics locking module performs a time-series comparison between the storage time period and the handling timestamp, and makes an offset judgment on the number of changes per unit time in the two environmental parameter sequences and the set fluctuation tolerance value. If they meet the standard, a logistics information binding block structure is generated.
[0011] The present invention improves upon the following: the batch binding record for confirming rights includes the registration status of the job number, the corresponding relationship of IoT devices, and the job time sequence identifier; the growth parameter verification status data specifically includes environmental parameter legality markers, land plot cycle matching markers, and offset compliance result items; the writable quality inspection trusted data structure includes trusted label values, confidence score results, and on-chain write field sets; and the logistics information binding block structure specifically refers to node binding indexes, warehousing time sequence lock values, and environmental parameter fluctuation records.
[0012] The present invention is improved in that the rights registration module includes:
[0013] The time sequence verification submodule obtains the operation timestamp, operation number, plot number, and IoT device number for each batch of agricultural products. Based on the operation timestamp, it extracts all operation time point sequences corresponding to the same operation number, sorts the time point sequences in chronological order, and checks whether there is a reverse order. If there is no reverse order, the number is marked as valid and operation sequence validity mark information is generated.
[0014] The operation plot verification submodule, based on the operation sequence validity marking information, calls the corresponding operation number and plot number for combination mapping, performs unique screening on all operation numbers in the mapping group, and determines whether there are duplicate or unregistered operation numbers. If there are no abnormal numbers, the plot ownership logic is clear, and the operation plot binding accuracy information is obtained.
[0015] The equipment plot matching submodule extracts the IoT device numbers recorded under the plot number based on the accuracy information of the work plot binding, compares the device numbers with the plots bound to the current work number one by one, filters the ratio of the number of combination items with corresponding numbers to the total number of all combinations, and establishes a batch binding record for confirmation of rights.
[0016] The present invention is improved in that the parameter verification module includes:
[0017] Based on the confirmed batch binding records, the parameter extraction submodule calls four environmental monitoring parameters corresponding to the plot number and operation timestamp: relative humidity, sunshine duration, soil pH value, and soil temperature. It filters out outliers and duplicate sampling records based on data validity and generates a group of plot operation environmental parameter values.
[0018] The standard comparison submodule is based on the group of operational environment parameters of the plot. According to the growth agronomic standard value range set for each environmental parameter under its respective crop category, it extracts the maximum and minimum values in the parameter sequence, calculates the center value of the standard range, and obtains the boundary adaptation judgment range information.
[0019] The legality calculation submodule calculates the parameter legality score based on the boundary adaptation judgment interval information and the plot operation environment parameter value group, according to each group of parameters and the corresponding standard interval center value. It then compares the score with the compliance score threshold. If the score is greater than the threshold, it outputs a compliance mark and obtains the growth parameter verification status data.
[0020] The present invention is improved in that the quality inspection label module includes:
[0021] The parameter extraction submodule calls the growth parameter verification status data and, based on the batch number marked as passed, obtains four quality inspection parameters for each batch: moisture content, fruit color value, pesticide residue content, and soluble solids content, and establishes a set of quality inspection parameter values.
[0022] The difference calculation submodule obtains the mean of the same parameter in the total batch based on the set of quality inspection parameter values and the batch parameter values corresponding to each parameter item. It also obtains the sample variation degree and maximum detection error limit of each parameter in the batch, calculates and obtains the joint parameter difference confidence index, and obtains the confidence difference index sequence.
[0023] The trusted structure generation submodule compares the confidence difference index sequence with the set confidence threshold. If the index value is less than or equal to the confidence threshold, the corresponding batch number, four quality inspection parameters and calculation results are encapsulated to generate a standard field structure and marked as writable, thus establishing a writable trusted quality inspection data structure.
[0024] The present invention is improved in that the logistics locking module includes:
[0025] Based on the writable quality inspection trusted data structure, the time matching submodule obtains the storage time period and handling record timestamp of the corresponding batch according to the batch number, determines whether the handling timestamp is within the boundary of the storage time period, calculates whether the time offset length is less than the time offset limit value, and obtains the time series matching stability evaluation result.
[0026] The environmental offset submodule calls the corresponding batch of warehouse temperature change sequence and warehouse relative humidity sequence based on the time series matching stability evaluation result, counts the number of changes per unit time in the two sequences, obtains the offset distance between the set temperature and humidity fluctuation tolerance value, constructs a composite index quantification index by combining the fluctuation duration and the number of abrupt changes, calculates the environmental offset sensitivity index, compares the index with the tolerance boundary, and obtains the fluctuation offset sensitivity evaluation result.
[0027] The structure generation submodule, based on the fluctuation offset sensitivity assessment result and the time series matching stability assessment result, if both pass, generates structured tag information according to the batch number and logistics node identification code, and establishes a logistics information binding block structure.
[0028] The present invention has an improvement, wherein the system further includes:
[0029] The traceability audit module binds the logistics information to the block structure, generates a traceability identifier value according to the block structure content and batch number, and writes the traceability identifier value, operation number and plot number together as the blockchain into the anchor field. When receiving the agricultural product query parameters input by the user, it calls the trusted label, quality inspection status, confirmation status and logistics location data bound to the number in the block, aggregates them into the query return format according to the preset display structure, and generates a two-way traceability dataset for agricultural products.
[0030] The agricultural product two-way traceability dataset includes user-searched batch index numbers, a trusted parameter display structure, quality control traceability chain node paths, traceability return timestamps, and a data source traceability mapping table.
[0031] The identifier generation submodule binds the logistics information to the block structure, performs hash calculation on the batch number according to the block content and the corresponding batch number to generate a batch traceability fingerprint value, and concatenates the traceability fingerprint value with the node identifier in the block to convert it into a string field. Based on the conversion rules, it establishes a structured encoding result to generate batch traceability identifier information.
[0032] The field writing submodule calls the corresponding operation number and land parcel number information according to the batch traceability identification information, combines the three numbers and writes them into the blockchain anchor field, and marks the field with a timestamp and operation node number, obtains the on-chain write position index value of the batch, and establishes the anchor field block index information.
[0033] Based on the anchored field block index information, the data aggregation submodule calls the batch number bound in the received agricultural product query parameters, and sequentially retrieves the trusted label content, quality inspection status result, ownership confirmation status, and logistics location coordinate value recorded in the anchored block. The four results are aggregated and assembled into bidirectional display fields according to the query structure definition fields to obtain the agricultural product bidirectional traceability dataset.
[0034] A traceability method based on blockchain technology, used to implement the aforementioned traceability system based on blockchain technology, includes the following steps:
[0035] S1: Obtain the operation timestamp, operation number, plot number, and IoT device number for each batch of agricultural products; determine whether the operation timestamp meets the operation cycle sorting logic within the plot; cross-check the IoT device number with the plot number to see if there is a matching item; and generate a batch binding record for confirmation of rights.
[0036] S2: Based on the confirmed batch binding records, compare the growth agronomic standard value range set within the plot cycle, assess whether the growth data is compliant, and generate growth parameter verification status data;
[0037] S3: Call the growth parameter verification status data, obtain four quality inspection parameters of the batch: moisture content, fruit color value, pesticide residue content, and soluble solids content, perform joint confidence calculation, generate a writeable data structure for the corresponding batch, and generate a writeable quality inspection reliable data structure.
[0038] S4: Based on the writable quality inspection trusted data structure, perform time-series comparison between the storage time period and the handling timestamp, and determine the offset between the number of changes per unit time in the two environmental parameter sequences and the set fluctuation tolerance value. If they meet the standard, generate a logistics information binding block structure.
[0039] S5: Based on the logistics information binding block structure, generate a traceability identifier value according to the block structure content and batch number. Write the traceability identifier value, operation number, and plot number together as the blockchain into the anchor field. When receiving the agricultural product query parameters input by the user, call the trusted label, quality inspection status, confirmation status, and logistics location data bound to the number in the block, aggregate them into the query return format according to the preset display structure, and generate a two-way traceability dataset for agricultural products.
[0040] Compared with the prior art, the advantages and positive effects of the present invention are as follows:
[0041] In this invention, by cross-validating the operation timestamp with the operation number, plot number, and IoT device number, a logical consistency judgment rule can be established for the registration information of operation batches, avoiding the risk of data failure caused by omissions or disordered order in operation registration. By combining the environmental parameters bound to the operation time period and plot information with the agronomic standard boundary for compliance assessment, a systematic judgment of the plot growth conditions can be achieved. At the quality inspection data layer, confidence modeling is performed based on the difference amplitude and batch mean to form reliable label data for batch quality. By comparing the sequence of storage time period and transportation timestamp and judging the frequency shift of environmental parameter changes, abnormal transportation behavior and storage fluctuations can be identified. In the query response stage, a two-way verification mechanism of traceability identifier value and quality traceability code is introduced, and reliable labels, quality inspection status, and location information are aggregated and displayed, significantly improving the completeness, accuracy, and reliability of traceability query results. Attached Figure Description
[0042] Figure 1 This is a schematic diagram of the system structure of the present invention;
[0043] Figure 2 This is a schematic diagram of the structure of the rights registration module of the present invention;
[0044] Figure 3 This is a schematic diagram of the parameter verification module of the present invention;
[0045] Figure 4 This is a schematic diagram of the structure of the quality inspection label acquisition module of the present invention;
[0046] Figure 5 This is a schematic diagram of the structure of the logistics locking module of the present invention;
[0047] Figure 6 This is a schematic diagram of the structure of the source tracing and auditing module of the present invention. Detailed Implementation
[0048] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0049] In the description of this invention, it should be understood that the terms "length," "width," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships, are based on the orientation or positional relationships shown in the accompanying drawings and are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, in the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0050] Please see Figure 1 The present invention provides a technical solution: a traceability system based on blockchain technology, the system including a rights registration module, a parameter verification module, a quality inspection label module, a logistics locking module, and a traceability audit module;
[0051] The rights registration module obtains the operation timestamp, operation number, plot number, and IoT device number for each batch of agricultural products. It compares the operation number with the plot number to see if there are any unregistered numbers, determines whether the operation timestamp meets the operation cycle sorting logic within the plot, and cross-checks the IoT device number with the plot number to see if there are any matching items, and generates a rights registration batch binding record.
[0052] The parameter verification module is based on the record of the batch of land rights confirmation. According to the plot number and the operation timestamp, it calls the four parameters of relative humidity, sunshine duration, soil pH value and soil temperature recorded in the corresponding time period of the plot. It compares them with the growth agronomic standard value range set within the plot cycle, determines whether the parameter deviation is within the boundary range, evaluates whether the growth data is compliant, and generates growth parameter verification status data.
[0053] The quality inspection label module calls the growth parameter verification status data. Based on the batches marked as passed, it obtains four quality inspection parameters of the passed batches: moisture content, fruit color value, pesticide residue content, and soluble solids content. Based on the four parameters in the current batch, it calculates the difference between the parameters and the average value of the total batches, and performs a joint confidence calculation on the difference. If the score exceeds the confidence threshold, it generates a writable data structure on the chain for the corresponding batch, thus generating a writable quality inspection reliable data structure.
[0054] The logistics locking module is based on a writable quality inspection trusted data structure. According to the corresponding batch number, it obtains the storage time period, logistics node identification code, handling record timestamp, warehouse temperature change sequence and warehouse relative humidity sequence corresponding to the batch. It performs time-series comparison of storage time period and handling timestamp, and judges the offset between the number of changes per unit time in the two environmental parameter sequences and the set fluctuation tolerance value. If they meet the standard, it generates logistics chain node marking instructions based on batch number and node identification code, and generates logistics information binding block structure.
[0055] The traceability audit module is based on the logistics information binding block structure. According to the block structure content and batch number, it generates traceability identification value. The traceability identification value, along with the operation number and plot number, is written into the anchor field of the blockchain. After the writing process is completed, a quality traceability code and a related relationship dataset are attached to each traceability record. When receiving the agricultural product query parameters input by the user, it calls the trusted label, quality inspection status, rights confirmation status, and logistics location data bound to the number in the block, aggregates them into a query return format according to the preset display structure, and generates a two-way traceability dataset for agricultural products.
[0056] The batch binding record for rights confirmation includes the registration status of the operation number, the corresponding relationship of IoT devices, and the operation time sequence identifier. The growth parameter verification status data specifically includes the environmental parameter legality mark, the plot cycle matching mark, and the offset compliance result item. The writable quality inspection trusted data structure includes trusted label values, confidence score results, and on-chain write field sets. The logistics information binding block structure specifically refers to the node binding index, the storage time sequence lock value, and the environmental parameter fluctuation record. The agricultural product two-way traceability dataset includes the user-searched batch index number, trusted parameter display structure, quality control traceability chain node path, traceability return timestamp, and data source traceability mapping table.
[0057] Please see Figure 2 The property rights registration module includes:
[0058] The time sequence verification submodule obtains the operation timestamp, operation number, plot number, and IoT device number for each batch of agricultural products. Based on the operation timestamp, it extracts all operation time point sequences corresponding to the same operation number, sorts the time point sequences in chronological order, and checks whether there is a reverse order. If there is no reverse order, the number is marked as valid and operation sequence validity mark information is generated.
[0059] Obtain the operation timestamp and operation number for each batch of agricultural products. Use the operation number as the primary key and extract the time sequence composed of the corresponding timestamps from the operation log database. For example, the timestamps corresponding to operation number A1001 are 12, 18, and 22 minutes. Convert this time sequence into a numerical array and sort it in ascending order. Then, calculate the difference between the preceding and following time points and check for negative values. If there are no negative differences, mark the time sequence as valid. In this example, the time sequence of A1001 is correct, while the time sequence of A1002 is 05, 11, and 07 minutes. Since 07 is less than 11, the time sequence is reversed. Therefore, this batch of operations is not valid. The numbers will be marked as invalid in sequence. During the judgment process, the sequence judgment threshold Δt is set to 0, that is, any time difference less than 0 is considered reverse order. The basis for setting this threshold is that the time recorded in the job system is in minutes, and each job is triggered by the system according to the plan. Setting Δt to 0 is to strictly filter out all non-sequential data entries. Δt is not adjusted with fluctuations of other parameters. The result is obtained from the timestamp of the log with a time accuracy of 1 minute, so no normalization processing is required. This time series verification process is performed once for each job number, and finally the job sequence validity marking information of all job numbers is obtained.
[0060] The operation plot verification submodule uses the operation sequence validity marking information to call the corresponding operation number and plot number for combination mapping. It performs a unique screening on all operation numbers in the mapping group to determine whether there are duplicate or unregistered operation numbers. If there are no abnormal numbers, it indicates that the plot ownership logic is clear and obtains the operation plot binding accuracy information.
[0061] Based on the above-obtained job sequence validity marking information, the marked valid job numbers are extracted and combined with their corresponding land parcel numbers to form a job-land parcel mapping set. Then, each job number in the mapping set is checked to see if there are multiple land parcel number mapping items. If so, it is marked as duplicate land parcel ownership. Next, it is determined whether each job number exists in the land parcel registration list. If the job number is not listed in the registration list, it is marked as an unregistered number. The logical judgment conditions are set as follows: the duplicate job ownership judgment condition is that the number of mapping records is greater than 1, and the registration judgment condition is that the job number appears in the land parcel configuration table. If neither condition is triggered, the land parcel ownership logic is output as clear. Combining the data example, A1001 and D001 are a one-to-one mapping and are registered, so they are compliant data. However, A1004 maps to D001 but is not registered, so it is marked as non-compliant. After the compliance status of all records is counted in this process, the land parcel binding accuracy information of each job number is summarized and output.
[0062] The equipment plot matching submodule extracts the IoT device numbers recorded under the plot number based on the accuracy information of the work plot binding, compares the device numbers with the plots bound to the current work number one by one, filters the ratio of the number of combination items with corresponding numbers to the total number of all combinations, and establishes a batch binding record for confirmation of rights.
[0063] Based on the plot number in the plot binding accuracy information, a list of device numbers under the corresponding plot is extracted from the IoT platform database. These device numbers are then cross-referenced with the operation numbers bound to that plot. For example, if plot number D001 has four registered device numbers, and the operation records also show four identical device numbers, then a match is considered complete, with a matching ratio of 4 / 4 = 1.00. If only two match, the ratio is 2 / 3 = 0.67. The formula for determining the matching ratio is as follows: ,in For the number of matches, The total number of devices registered for each plot is calculated, and the ratio is output as the evaluation standard. The benchmark value for the matching ratio is set to 0.95. This value is set based on the system's requirement for complete recording of IoT devices. When the ratio is greater than or equal to 0.95, it is considered a complete match; otherwise, it is marked as having a binding defect. This benchmark value remains unchanged as the number of devices increases. Because the system's device configuration is fixed for each plot, and the independence of the plots is highly consistent, this constant ratio setting ensures the stability and reproducibility of the judgment. The binding is considered complete. By filtering records that are higher than the matching threshold, a batch binding record for the confirmation of rights is established. This record includes the operation number, land parcel number, equipment number set and ratio, which is used for subsequent confirmation of rights blocks. Table 1 lists the equipment matching results of each land parcel.
[0064] Table 1. Equipment Matching Ratio for Land Parcels
[0065] Plot Number Total number of bound device IDs There are matching numbers. Matching ratio D001 4 4 1.00 D002 3 2 0.67 D003 5 5 1.00
[0066] As shown in Table 1, Plot 1 and Plot 3 achieved a matching baseline value of 1.00 in terms of equipment binding integrity, while Plot 2, due to the lack of one equipment number, only achieved 0.67, which is lower than the set baseline value of 0.95. This result is used to determine whether the corresponding batch of data is allowed to enter the rights confirmation chain writing process, thereby supporting the integrity of traceability data.
[0067] Please see Figure 3 The parameter verification module includes:
[0068] The parameter extraction submodule is based on the record of the confirmation batch. According to the plot number and the operation timestamp, it calls the four environmental monitoring parameters corresponding to the plot number and the operation timestamp: relative humidity, sunshine duration, soil pH value and soil temperature. It filters out outliers and duplicate sampling records according to the data validity and generates a group of plot operation environmental parameter values.
[0069] After obtaining the plot number and operation timestamp from the batch confirmation record, environmental monitoring data for the current operation cycle is extracted. Four environmental parameters collected by the monitoring terminal are retrieved: relative humidity, sunshine duration, soil pH, and soil temperature. Record points within the corresponding time period are then selected based on the operation timestamp. To eliminate interference from abnormal records, a five-point sliding median processing is first performed on the relative humidity data. Abnormal points deviating from the median by more than 15% within the sliding window are removed. This 15% abnormality removal threshold is based on historical monitoring data showing that the relative humidity variation during the normal growth cycle is consistently between 5% and 12%. Therefore, by increasing... To add safety redundancy, the fluctuation identification threshold is set at 15%. For sunshine duration data, if multiple records exist within the same time period, the latest collection time is used as the basis for selecting and retaining a single record, while the rest are discarded. For soil pH value, the average drift amplitude of continuous measurement points does not exceed 0.2 during screening; if it exceeds this, the sequence segment is deleted. For soil temperature data, records with excessively high collection frequencies are standardized by sampling at 5-minute intervals. Finally, through the above screening rules, an effective monitoring data structure for the operation cycle is formed, which includes four parameters and is expressed as the average value per unit time. This data structure is the plot operation environment parameter value group, which is used for subsequent legality comparison and evaluation.
[0070] The standard comparison submodule is based on the plot operation environment parameter value group. According to the growth agronomic standard value range set for each environmental parameter under the crop category, it extracts the maximum and minimum values in the parameter sequence, calculates the center value of the standard range, and obtains the boundary adaptation judgment range information.
[0071] Based on the generated set of field operation environment parameters, the agronomic standard range for each parameter under its respective crop category is extracted. Maximum and minimum value identification is performed for each parameter category to construct an effective response range. For example, if the standard range for soil temperature is set to 17°C to 24°C, the center value of the range can be obtained as follows: The standard interval is set as the optimal temperature zone for crop root activity. For example, if the minimum measured temperature during the field operation period is 16.8°C and the maximum is 23.9°C, the calculated interval span is 7.1°C, with a center value of 20.35°C. This results in a standard comparison interval of ±3.55°C, symmetrically expanded on both sides. Similarly, the interval span and center value are calculated for relative humidity, pH, and sunshine duration according to the set upper and lower limits of the standard. Finally, a set of center point values and boundary distances for the four environmental indicators is formed, which serves as the basis for the validity formula. and The source basis;
[0072] Table 2. Growth Standard Value Range and Center Value Table
[0073] Parameter name Standard lower limit Standard upper limit Standard interval span Central value Relative humidity (%) 60 80 20 70.0 Sunshine duration (h) 6 10 4 8.0 Soil pH 5.5 7.5 2.0 6.5 Soil temperature (°C) 17 24 7 20.5
[0074] As shown in Table 2, the standard interval span The center value is calculated directly from the difference between the upper and lower limits of the standard. It is the arithmetic mean of the corresponding upper and lower limits, used to measure the offset position of the monitored value.
[0075] The legality calculation submodule, based on boundary adaptation judgment interval information and land parcel operation environment parameter value sets, uses the following formula according to each set of parameters and the corresponding standard interval center value:
[0076] ;
[0077] The algorithm calculates the validity score of the parameters, compares the score with the compliance score threshold, and outputs a compliance flag if the score is greater than the threshold, thus obtaining the verification status data of the growth parameters.
[0078] in, This represents the legality score. Indicates the first Normalized values of environmental monitoring parameters Indicates the first The normalized value of the corresponding standard interval center value. Indicates the first The normalized value of the standard interval span. This represents the measurement stability factor (a dimensionless value that indicates the rate of deviation of the monitoring continuity mean within the period). This represents the equipment synchronization rate factor (a dimensionless value that reflects the cumulative synchronization rate of equipment in the same plot within that time period). Indicates the total number of parameters;
[0079] Based on the boundary adaptation determination interval information obtained above, and combined with the average value of each parameter within the operation cycle, the offset is calculated, and the measured average value is set to... The standard center value is The standard interval span is The degree of standardized offset is measured by the ratio of the absolute value of the offset to the span. For example, if the measured average relative humidity is 73%, the corresponding standard center value is 70%, and the span is 20%, then the standardized offset is 1 / 3. After processing all four parameters in sequence, the standardized total offset is obtained by summing them up.
[0080] formula:
[0081] ;
[0082] The calculation logic for each part is as follows:
[0083] Part One : indicates all Each parameter item undergoes standardized offset calculation by comparing the normalized values of environmental monitoring parameters. Normalized value of the standard interval center value The difference was normalized to the standard interval span. The standard offset of each parameter is obtained, and the total offset is obtained by summing all parameter items.
[0084] Part Two : Indicates the measurement stability correction factor. This is the stability coefficient of the sampling points within the operation cycle. A higher value indicates greater fluctuation. Used to shrink the offset to reduce the interference of unstable data on the evaluation;
[0085] Part Three : This is the equipment synchronization rate correction factor. The actual synchronization rate of the equipment during this cycle (dimensionless). It can effectively amplify the impact of low synchronization rates and stretch and amplify the overall offset index to reflect the potential risks under synchronization loss.
[0086] The three components work together to construct a composite scoring system that unifies the measurement of offset, measurement stability, and equipment consistency. Each factor participates in the weighting or scaling process and influences each other, reflecting the multidimensional constraint logic of data quality. The overall function of the formula is to construct a compliance score, i.e., a legality score, for the growth environment monitoring parameters during the operational cycle. The lower the value, the smaller the offset, the more stable the data, the stronger the device consistency, and the higher the compliance; the higher the value, the greater the data offset or the poorer the quality.
[0087] Combined with the score Compared to the system's set compliance score threshold of 0.500, which is the maximum acceptable deviation limit calculated by the agronomic department based on crop tolerance boundaries, if... If the measured average offset of the aforementioned four parameters is 0.66, then the environmental data is considered compliant; otherwise, it is marked as non-compliant. , ,but:
[0088] ;
[0089] Will After comparing with the threshold, it can be seen that it is within the compliance range, so the system can output growth parameter verification status data accordingly.
[0090] The core value of this calculation logic lies in the fact that it not only considers whether the parameters themselves are close to the standard range, but also combines the reliability of monitoring and the integrity of equipment synchronization, so as to avoid false compliance judgments caused by problems such as sampling anomalies and synchronization delays, thereby ensuring the authenticity and reliability of data in the subsequent certification and supervision of agricultural products.
[0091] Please see Figure 4 The quality inspection label module includes:
[0092] The parameter extraction submodule calls the growth parameter verification status data. Based on the batch number marked as passed, it obtains four quality inspection parameters for each batch: moisture content, fruit color value, pesticide residue content, and soluble solids content, and establishes a set of quality inspection parameter values.
[0093] The system retrieves batch numbers marked as "passed" from the growth parameter verification status data to obtain four quality inspection parameters for each batch: moisture content, fruit color value, pesticide residue content, and soluble solids content. Specifically, the system sequentially indexes the corresponding database records for each verified batch number to obtain batch-level quality inspection data. During each retrieval, it ensures the data timestamp is within the valid sample period, deletes expired records, and confirms the data based on the latest test result. For example, extracting quality inspection parameters for batch number A001 yields the following results: moisture content 84%, color value 6.8, and pesticide residue content 0.042 mg / L. kg, soluble solids 9.3%, repeat the above steps to complete the operation for multiple batches, merge the four test data corresponding to each batch and store them as a structured data vector, that is, establish a batch-level quality inspection parameter value set. The set is arranged in matrix form, with each batch number as the row and the four parameter items as the column. For example, batches A001, A002, A003, etc. correspond to four columns of test parameters. The set structure is verified to see if there are any missing items or abnormal values (such as negative values or exceeding the reasonable upper limit). If so, the corresponding sample is removed or correctable data is filled in to establish the quality inspection parameter value set.
[0094] The difference calculation submodule, based on the set of quality inspection parameter values and the batch parameter values corresponding to each parameter item, obtains the mean value of the same parameter in the total batch, and calculates the sample variation degree and maximum detection error upper limit of each parameter within the batch, using the following formula:
[0095] ;
[0096] The combined difference confidence index of the parameters is obtained through calculation, resulting in a confidence difference index sequence;
[0097] in, This indicates the confidence index of the joint difference of parameters. Indicates the first Normalized values of quality inspection parameters Indicates the first The item corresponds to the normalized value of the full batch mean. Indicates the first Item parameter correlation coefficient (range of values) (Measured by the Pearson correlation between parameters). This represents the normalized value of the maximum detection error upper limit among the four parameters in this batch. The coefficient of variation within the sample (normalized by standard deviation) represents the degree of variation. Indicates the total number of parameter items;
[0098] Based on the batch parameter value corresponding to each parameter item in the quality inspection parameter value set, the sample mean is first extracted for each column of parameter items. For example, if the average of all batch moisture content parameters is 82.6%, this is taken as the benchmark mean of the moisture content of the entire batch, and is denoted as [reference value]. Simultaneously, the standard deviation of each parameter within this batch is calculated and normalized to obtain the sample variation coefficient. Extract the sample with the largest detection error from the batch, such as the pesticide residue detection error of 0.008 mg / kg, and obtain the result after normalization. After calculating the Pearson correlation coefficient matrix based on the previous training data, the corresponding parameters were extracted. The following is a list of correlation data between some parameters:
[0099] Table 3. Correlation coefficient matrix among quality inspection parameters
[0100] Parameters Moisture content Fruit color value pesticide residue content Soluble solids content Moisture content 1.000 0.678 0.212 0.793 Fruit color value 0.678 1.000 0.344 0.702 pesticide residue content 0.212 0.344 1.000 0.233 Soluble solids content 0.793 0.702 0.233 1.000
[0101] As shown in Table 3, there is a strong correlation between the parameters, such as the relationship between moisture content and soluble solids content. In batch difference analysis, the amplifying effect of this parameter on the offset must be considered. Therefore, the following formula is used for unified measurement:
[0102] ;
[0103] The calculation logic of this formula is as follows: the numerator represents the degree of difference among all parameters. A perturbation weighting factor based on the square root of the Pearson correlation coefficient is introduced into each term to emphasize the joint shift effect of differences between related terms. The denominator uses a composite measure of the coefficient of variability and the error factor. Used to suppress the interference of uneven detection errors on the overall offset. The overall composition parameters, combined with the difference confidence index, reflect the uncertainty risk brought about by the volatility of the data itself. For a certain batch of values: moisture content Average of all batches Correlation coefficient Detection error Sample standard deviation ,but:
[0104] ;
[0105] This value represents the confidence difference between the overall quality inspection parameters of the current batch and the average level. The lower the value, the smaller the deviation and the stronger the confidence, thus obtaining a confidence difference index sequence.
[0106] The trusted structure generation submodule compares the confidence difference index sequence with the set confidence threshold. If the index value is less than or equal to the confidence threshold, the corresponding batch number, four quality inspection parameters and calculation results are encapsulated to generate a standard field structure and marked as writable, thus establishing a writable trusted quality inspection data structure.
[0107] The system compares the confidence difference index sequence with a preset confidence threshold. The confidence threshold is set at 0.120, a value determined by the parameter fluctuation range and error acceptance assessment of different crop varieties in the previous training samples. This value is suitable for crop populations with moderate physiological parameter fluctuations. If the batch is marked as a trusted quality inspection record, the corresponding batch number and four quality inspection parameters are encapsulated, along with the calculation results of the indicators, forming a standard field structure. This field structure includes parameter key names, value items, sampling time, calculation indicators, and more. Finally, a writable status record is constructed, outputting a writable trusted quality inspection data structure. This structure will subsequently be used in scenarios such as the generation of standard trusted blocks and consistency verification on the logistics information chain.
[0108] Please see Figure 5 The logistics locking module includes:
[0109] The time matching submodule is based on a writable quality inspection trusted data structure. According to the batch number, it obtains the storage time period and handling record timestamp of the corresponding batch, determines whether the handling timestamp is within the boundary of the storage time period, calculates whether the time offset length is less than the time offset limit value, and obtains the time series matching stability evaluation result.
[0110] Based on the batch number in the writable quality inspection trusted data structure, the start and end times of the storage period and the actual handling record timestamp of each batch are obtained in the cold chain system. Data items consisting of "start time-end time" pairs and single timestamps are extracted. The timestamps are converted into a continuous time value sequence after the format is unified. Boundary judgment is performed on the timestamp of each handling record and its corresponding storage period. It is calculated whether the timestamp is between the start and end times. If the timestamp is earlier than the start time or later than the end time, it is counted as "outside the boundary". Otherwise, it is counted as "inside the boundary". For the "outside the boundary" case, its time difference is compared with the set time offset limit value (such as 10 minutes). If it is less than the limit value, it is marked as an acceptable offset. After calling multiple batches, the judgment results are aggregated by batch number and classified with three levels of flags: "complete match", "small offset within the boundary" and "non-compliant outside the boundary". Finally, the stable matching ratio of each batch is calculated to obtain the time series matching stability evaluation result.
[0111] The environmental offset submodule, based on the time-series matching stability assessment results, calls the corresponding batch's in-warehouse temperature change sequence and in-warehouse relative humidity sequence, counts the number of changes per unit time in both sequences, obtains the offset distance from the set temperature and humidity fluctuation tolerance value, and constructs a composite index quantification index by combining the fluctuation duration and the number of abrupt changes, using the formula:
[0112] ;
[0113] The environmental offset sensitivity index is obtained through calculation, and the index is compared with the tolerance boundary to obtain the fluctuation offset sensitivity assessment result.
[0114] in, This indicates the results of the fluctuation offset sensitivity assessment. Indicates the first Normalized value of the number of temperature changes over a time period Indicates the first The normalized value of the temperature fluctuation tolerance for each time period. Indicates the first Normalized value of the number of humidity changes over a time period Indicates the first The normalized value of the humidity fluctuation tolerance for each time period. The normalized value representing the duration of total fluctuations. This indicates the number of temperature and humidity sensors in the warehouse. Indicates the total number of time periods;
[0115] Based on the time-series matching stability assessment results, the temperature and humidity change sequences uploaded by the temperature and humidity monitoring devices bound to the corresponding batch are extracted. After unifying the sampling frequency, the number of changes per unit time is obtained. For each unit time period, such as 5 minutes, the number of temperature changes is extracted. With the number of humidity changes and respectively with the set temperature tolerance With humidity tolerance Perform a normalized comparison. If the temperature changes 5 times within a single time period, while the temperature tolerance is 4 times, then the offset ratio is [value missing]. After collecting data items for all time periods, the offset results are calculated using the following formula:
[0116] ;
[0117] The numerator is the sum of the absolute values of the temperature and humidity deviation ratios over each time period, reflecting the overall degree of deviation of the number of fluctuations from the standard tolerance; the denominator is the environmental fluctuation penalty term. This represents the increased sensitivity and penalty effect resulting from the increased duration of fluctuations. This represents the reliability compensation caused by cross-monitoring from multiple sensors, quantifying the compensation for offset noise caused by high-frequency redundant monitoring. The overall formula structure reflects the combined effects of individual offsets, overall disturbances, and the sensor network, ultimately yielding the calculated environmental offset sensitivity index. For example, when the numerator is 2.85, , ,but:
[0118] ;
[0119] This value is used to determine whether the overall fluctuation exceeds the warning tolerance. The system sets the threshold to 0.300. If it is lower than this value, the fluctuation control is judged to be compliant, and a fluctuation offset sensitivity assessment result is generated.
[0120] To aid in the numerical comparison process, the temperature and humidity fluctuation data for some batches are summarized and statistically analyzed as follows:
[0121] Table 4. Statistical Table of Temperature and Humidity Fluctuations
[0122]
[0123] As shown in Table 4, the calculated value of the fluctuation sensitivity of batch A001 is 0.238, which is less than the threshold of 0.300, so it is judged to be compliant.
[0124] The structure generation submodule is based on the fluctuation offset sensitivity assessment results and the time series matching stability assessment results. If both are passed, it generates structured tag information according to the batch number and logistics node identification code, and establishes a logistics information binding block structure.
[0125] The structure generation submodule is based on the fluctuation offset sensitivity assessment results and the time series matching stability assessment results. If both are passed, it generates structured tag information according to the batch number and logistics node identification code, and establishes a logistics information binding block structure.
[0126] Based on the aforementioned time-series matching stability assessment results and fluctuation offset sensitivity assessment results, if both are marked as compliant by the system, the system extracts the bound logistics node identification code according to the corresponding batch number, assembles a structured tag field, which contains five data units: batch number, node identification code, handling time marker, sensitivity value, and matching status marker. The system then calls the block construction module to write this data onto the blockchain to establish a logistics information binding block structure. This structure will subsequently be used in traceability and auditing scenarios such as full-process logistics information chain verification and offset signal tracing.
[0127] Please see Figure 6 The source tracing and auditing module includes:
[0128] The identifier generation submodule is based on the logistics information binding block structure. According to the block content and the corresponding batch number, the batch number is hashed to generate a batch traceability fingerprint value. The traceability fingerprint value is concatenated with the node identifier in the block and converted into a string field. The structured encoding result is established according to the conversion rules to generate batch traceability identifier information.
[0129] After obtaining the block content in the logistics information binding block structure, the batch number is converted into a one-time digest using the SHA-256 cryptographic hash function according to the batch number contained in each structure. A fixed-length hash output is obtained as the batch traceability fingerprint value. This value is unique and irreversible. Then, the logistics node identification field, such as node code ID, transit link code, etc., is parsed from the structure and combined with the hash fingerprint value to form a string field, such as the format "HashValue_NodeID". According to the field structure rules defined by the system, such as adding a separator every 6 bits and reserving byte bits, the structure conversion is completed. Finally, a traceability identification code result with fixed field length, uniform format and unique content is established, that is, the batch traceability identification information.
[0130] The field writing submodule calls the corresponding operation number and plot number information according to the batch traceability identification information, combines the three numbers and writes them into the blockchain anchor field, and marks the field with the timestamp and operation node number, obtains the on-chain write position index value of the batch, and establishes the anchor field block index information.
[0131] Based on the batch traceability identifier information generated above, the operation number and plot number bound to it are obtained. An anchorable block field string is constructed by concatenating the numbers with a fixed length. The structure order is "traceability identifier-operation number-plot number". After the field is merged, the current system record timestamp value and the node number that performed the operation are added. The node number is automatically marked by the execution server or verification node to form a complete field content with traceability and operation trace. The blockchain write interface is called to write it into the current chain structure. The system assigns an on-chain index number as a unique access entry for each written content. The number format is "BlockPos_0045". When writing multiple batches in parallel, the index is ensured not to conflict. Finally, a unique on-chain access index is established for each batch to form the anchor field block index information.
[0132] The data aggregation submodule, based on the anchor field block index information, calls the batch number bound in the received agricultural product query parameters, and sequentially retrieves the trusted label content, quality inspection status result, rights confirmation status, and logistics location coordinate value recorded in the anchor block. It then aggregates and assembles the four results into bidirectional display fields according to the query structure definition fields to obtain the agricultural product bidirectional traceability dataset.
[0133] Based on the aforementioned anchor field block index information, upon receiving user-input agricultural product query parameters such as "batch number B10023", the system parses the block location it points to from the index information and extracts the four core traceability fields recorded in that block: trusted label content such as "organic mark" and "green certification code", quality inspection status results such as "qualified" and "under re-inspection", ownership status such as "ownership confirmed" and "not verified", and logistics location coordinates such as "113.2564°E, 29.8765°N". The above content is aggregated according to the system-defined visualization fields to generate a form-based, list-style two-way display format. This field structure supports forward tracing to the place of origin and reverse tracing back to the distribution path, completing the assembly of the agricultural product two-way traceability dataset. The display fields for some batches are shown in the table below:
[0134] Table 5. Illustration of Agricultural Product Traceability Fields
[0135] Batch number Trusted Labels Quality Inspection Status Confirmation of property rights status Logistics Coordinates B10023 Organic certification qualified Property rights have been confirmed 113.2564E, 29.8765N B10024 Green label qualified Property rights have been confirmed 113.2611E, 29.8811N B10025 —— To be tested Unverified ——
[0136] As shown in Table 5, different batches may have fields with complete or missing information. The corresponding field values are then filled back based on the results of the records on the chain. The structure is used as the data input source for the user-side backtracking function interface.
[0137] The traceability method based on blockchain technology includes the following steps:
[0138] S1: Obtain the operation timestamp, operation number, plot number, and IoT device number for each batch of agricultural products; determine whether the operation timestamp meets the operation cycle sorting logic within the plot; cross-check the IoT device number with the plot number to see if there is a matching item; and generate a batch binding record for confirmation of rights.
[0139] S2: Based on the record of the confirmation batch, compare the growth agronomic standard value range set within the period of the land parcel, assess whether the growth data is compliant, and generate growth parameter verification status data;
[0140] S3: Call the growth parameter verification status data, obtain four quality inspection parameters of the batch: moisture content, fruit color value, pesticide residue content, and soluble solids content, perform joint confidence calculation, generate a writable data structure for the corresponding batch, and generate a writable quality inspection reliable data structure.
[0141] S4: Based on a writable quality inspection trusted data structure, perform time-series comparison between warehousing time period and handling timestamp, and determine the offset between the number of changes per unit time in the two environmental parameter sequences and the set fluctuation tolerance value. If they meet the standard, generate a logistics information binding block structure.
[0142] S5: Based on the logistics information binding block structure, generate traceability identification value according to the block structure content and batch number. Write the traceability identification value, operation number and plot number together as the blockchain into the anchor field. When receiving the agricultural product query parameters input by the user, call the trusted label, quality inspection status, confirmation status and logistics location data bound to the number in the block, aggregate them into the query return format according to the preset display structure, and generate a two-way traceability dataset for agricultural products.
[0143] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.
Claims
1. A traceability system based on blockchain technology, characterized in that, The system includes: The land rights registration module obtains the operation timestamp, operation number, plot number and IoT device number for each batch of agricultural products, determines whether the operation timestamp meets the operation cycle sorting logic within the plot, cross-checks the IoT device number with the plot number to see if there is a matching item, and generates a land rights batch binding record. Based on the confirmed batch binding records, the parameter verification module compares the growth agronomic standard value range set within the plot cycle to assess whether the growth data is compliant and generates growth parameter verification status data. The quality inspection label module calls the growth parameter verification status data to obtain four quality inspection parameters for the batch: moisture content, fruit color value, pesticide residue content, and soluble solids content. It then performs a joint confidence calculation to generate a writeable data structure for the corresponding batch, thus generating a writeable quality inspection trusted data structure. The quality inspection label module includes: The parameter extraction submodule calls the growth parameter verification status data, and according to the batch number marked as passed, obtains four quality inspection parameters for each batch: moisture content, fruit color value, pesticide residue content, and soluble solids content, and establishes a set of quality inspection parameter values. The difference calculation submodule obtains the mean of the same parameter in the total batch based on the set of quality inspection parameter values and the batch parameter values corresponding to each parameter item. It also obtains the sample variation degree and maximum detection error limit of each parameter in the batch, calculates and obtains the joint parameter difference confidence index, and obtains the confidence difference index sequence. The trusted structure generation submodule compares the confidence difference index sequence with the set confidence threshold. If the index value is less than or equal to the confidence threshold, the corresponding batch number, four quality inspection parameters and calculation results are encapsulated to generate a standard field structure and marked as writable, thus establishing a writable trusted quality inspection data structure. Based on the writable quality inspection trusted data structure, the logistics locking module performs a time-series comparison between the storage time period and the handling timestamp, and makes an offset judgment on the number of changes per unit time in the two environmental parameter sequences and the set fluctuation tolerance value. If they meet the standard, a logistics information binding block structure is generated. The traceability audit module binds the logistics information to the block structure, generates a traceability identifier value according to the block structure content and batch number, and writes the traceability identifier value, operation number and plot number together as the blockchain into the anchor field. When receiving the agricultural product query parameters input by the user, it calls the trusted label, quality inspection status, rights confirmation status and logistics location data bound to the number in the block, aggregates them into the query return format according to the preset display structure, and generates a two-way traceability dataset for agricultural products. The agricultural product two-way traceability dataset includes user-searched batch index numbers, a trusted parameter display structure, quality control traceability chain node paths, traceability return timestamps, and a data source traceability mapping table.
2. The traceability system based on blockchain technology according to claim 1, characterized in that, The batch binding record for rights confirmation includes the registration status of the operation number, the corresponding relationship of IoT devices, and the operation time sequence identifier. The growth parameter verification status data specifically includes the environmental parameter legality mark, the plot cycle matching mark, and the offset compliance result item. The writable quality inspection trusted data structure includes trusted label value, confidence score result, and on-chain write field set. The logistics information binding block structure specifically refers to the node binding index, the warehouse time sequence lock value, and the environmental parameter fluctuation record.
3. The traceability system based on blockchain technology according to claim 1, characterized in that, The property rights registration module includes: The time sequence verification submodule obtains the operation timestamp, operation number, plot number and IoT device number for each batch of agricultural products. Based on the operation timestamp, it extracts all operation time point sequences corresponding to the same operation number, sorts the time point sequences in chronological order, and checks whether there is a reverse order. If there is no reverse order, the number is marked as valid and operation sequence validity mark information is generated. The operation plot verification submodule, based on the operation sequence validity marking information, calls the corresponding operation number and plot number for combination mapping, performs unique screening on all operation numbers in the mapping group, and determines whether there are duplicate or unregistered operation numbers. If there are no abnormal numbers, the plot ownership logic is clear, and the operation plot binding accuracy information is obtained. The equipment plot matching submodule extracts the IoT device numbers recorded under the plot number based on the accuracy information of the work plot binding, compares the device numbers with the plots bound to the current work number one by one, filters the ratio of the number of combination items with corresponding numbers to the total number of all combinations, and establishes a batch binding record for confirmation of rights.
4. The traceability system based on blockchain technology according to claim 1, characterized in that, The parameter verification module includes: Based on the confirmed batch binding records, the parameter extraction submodule calls four environmental monitoring parameters corresponding to the plot number and operation timestamp: relative humidity, sunshine duration, soil pH value and soil temperature. It then filters out outliers and duplicate sampling records based on data validity and generates a group of plot operation environmental parameter values. The standard comparison submodule is based on the group of operational environment parameters of the plot. According to the growth agronomic standard value range set for each environmental parameter under its respective crop category, it extracts the maximum and minimum values in the parameter sequence, calculates the center value of the standard range, and obtains the boundary adaptation judgment range information. The legality calculation submodule calculates the parameter legality score based on the boundary adaptation judgment interval information and the plot operation environment parameter value group, according to each group of parameters and the corresponding standard interval center value. It then compares the score with the compliance score threshold. If the score is greater than the threshold, it outputs a compliance mark and obtains the growth parameter verification status data.
5. The traceability system based on blockchain technology according to claim 1, characterized in that, The logistics locking module includes: Based on the writable quality inspection trusted data structure, the time matching submodule obtains the storage time period and handling record timestamp of the corresponding batch according to the batch number, determines whether the handling timestamp is within the boundary of the storage time period, calculates whether the time offset length is less than the time offset limit value, and obtains the time series matching stability evaluation result. The environmental offset submodule calls the corresponding batch of warehouse temperature change sequence and warehouse relative humidity sequence based on the time series matching stability evaluation result, counts the number of changes per unit time in the two sequences, obtains the offset distance between the set temperature and humidity fluctuation tolerance value, constructs a composite index quantification index by combining the fluctuation duration and the number of abrupt changes, calculates the environmental offset sensitivity index, compares the index with the tolerance boundary, and obtains the fluctuation offset sensitivity evaluation result. The structure generation submodule, based on the fluctuation offset sensitivity assessment result and the time series matching stability assessment result, if both pass, generates structured tag information according to the batch number and logistics node identification code, and establishes a logistics information binding block structure.
6. The traceability system based on blockchain technology according to claim 1, characterized in that, The source tracing and auditing module includes: The identifier generation submodule binds the logistics information to the block structure, performs hash calculation on the batch number according to the block content and the corresponding batch number to generate a batch traceability fingerprint value, and concatenates the traceability fingerprint value with the node identifier in the block to convert it into a string field. Based on the conversion rules, it establishes a structured encoding result to generate batch traceability identifier information. The field writing submodule calls the corresponding operation number and land parcel number information according to the batch traceability identification information, combines the three numbers and writes them into the blockchain anchor field, and marks the field with a timestamp and operation node number, obtains the on-chain write position index value of the batch, and establishes the anchor field block index information. Based on the anchored field block index information, the data aggregation submodule calls the batch number bound in the received agricultural product query parameters, and sequentially retrieves the trusted label content, quality inspection status result, ownership confirmation status and logistics location coordinate value recorded in the anchored block. The four results are aggregated and assembled into bidirectional display fields according to the query structure definition fields to obtain the agricultural product bidirectional traceability dataset.
7. A traceability method based on blockchain technology, characterized in that, The method is used to implement the blockchain-based traceability system according to any one of claims 1-6, and includes the following steps: S1: Obtain the operation timestamp, operation number, plot number and IoT device number for each batch of agricultural products, determine whether the operation timestamp meets the operation cycle sorting logic within the plot, cross-check the IoT device number with the plot number to see if there is a matching item, and generate a batch binding record for confirmation of rights. S2: Based on the confirmed batch binding records, compare the growth agronomic standard value range set within the plot cycle, assess whether the growth data is compliant, and generate growth parameter verification status data; S3: Call the growth parameter verification status data, obtain four quality inspection parameters of the batch: moisture content, fruit color value, pesticide residue content and soluble solids content, perform joint confidence calculation, generate a writeable data structure for the corresponding batch, and generate a writeable quality inspection reliable data structure. S4: Based on the writable quality inspection trusted data structure, perform time-series comparison between the storage time period and the handling timestamp, and determine the offset between the number of changes per unit time in the two environmental parameter sequences and the set fluctuation tolerance value. If they meet the standard, generate a logistics information binding block structure. S5: Based on the logistics information binding block structure, generate a traceability identifier value according to the block structure content and batch number. Write the traceability identifier value, operation number and plot number together as the blockchain into the anchor field. When receiving the agricultural product query parameters input by the user, call the trusted label, quality inspection status, confirmation status and logistics location data bound to the number in the block, aggregate them into the query return format according to the preset display structure, and generate a two-way traceability dataset for agricultural products.
Citation Information
Patent Citations
Agricultural product quality control traceability platform based on block chain
CN111680865A
Food traceability method based on intelligent Internet of Things information
CN119558870A