Organic tea quality data safety monitoring method and system
By generating quality event units and assigning unique deterministic keys, and utilizing Verkle trees and KZG vector commitment calculations, the challenges of verifying and locating organic tea quality data in cross-entity exchanges are solved, enabling data to be verifiable and recoverable, and ensuring data authenticity and integrity.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- YUNNAN SHUNNING BLACK TEA IND GROUP CO LTD
- Filing Date
- 2025-12-31
- Publication Date
- 2026-04-17
AI Technical Summary
Existing technologies struggle to independently verify and quickly locate organic tea quality data in cross-entity exchange scenarios, and lack deterministic indexing and coding constraints for individual events, making it difficult to verify risks such as missing records, replacements, or rollbacks.
By generating quality event units and assigning unique deterministic keys, using Verkle tree structures for encoding and indexing, and combining KZG vector commitments to calculate existence and consistency proofs, the verifiability and recoverability of data are achieved.
It enables consistent expression and location of organic tea quality data across different entities, reducing traceability difficulties and verification costs, and ensuring the authenticity and integrity of the data.
Smart Images

Figure CN121881418A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of quality safety and data security technology, and in particular to a method and system for monitoring the quality data security of organic tea. Background Technology
[0002] With the advancement of organic agricultural product supervision, origin traceability and supply chain digitalization, the quality data generated in the production, testing and circulation of organic tea is gradually being collected on a platform, centrally stored and shared across entities. Currently, the industry generally uses business systems to structurally input batches, processes and test results, and achieves record keeping and traceability through centralized databases, electronic signatures, timestamp services, blockchain evidence storage or log auditing.
[0003] Existing data management and evidence preservation technologies still have limitations. On the one hand, centralized databases and conventional log mechanisms rely heavily on access control and post-event auditing, making it difficult to provide independently verifiable evidence of the "existence" of a single record in cross-entity exchange scenarios. They also struggle to establish verifiable continuity between data versions at different points in time, resulting in a lack of consistent criteria for external verification of risks such as missing, replaced, or rolled-back records. On the other hand, some evidence preservation solutions only solidify batches of data or single on-chain results, lacking deterministic indexes and unified coding constraints for batch identifiers, process identifiers, and event sequences, making it difficult to quickly locate, verify, and track discrepancies in individual events.
[0004] Therefore, how to provide a method and system for safe monitoring of organic tea quality data is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] One objective of this invention is to propose a method and system for monitoring the quality data of organic tea. This invention unifies and deterministically identifies quality events in the production, testing, and distribution processes, writes event data into a tree-like path structure and generates root-level snapshots, and generates verifiable proofs of record existence and cross-version consistency to support third-party verification. In abnormal or breakpoint scenarios, it completes structural reconstruction and reconciliation recovery based on snapshots and discrepancy information.
[0006] A method and system for safe monitoring of organic tea quality data according to an embodiment of the present invention includes the following steps: The quality event generation module collects data on the production, testing, and distribution of organic tea, generates quality event units based on batch identifiers, process identifiers, and event sequence numbers, and assigns a unique deterministic key. The event encoding module receives quality event units, performs field standardization and structure serialization processing, generates fixed-length vector encoded data, and forms key-value pairs with deterministic keys; The path mapping module receives key-value pairs, maps deterministic keys to paths in the Verkle tree key space, writes encoded data to leaf nodes, and records path information in index nodes. The commitment generation module receives the set of child nodes of the index node, performs KZG vector commitment calculation, generates the commitment value of the index node, and aggregates them to form the root commitment. The snapshot recording module stores the root commitment and timestamp to generate a root commitment snapshot; The proof generation module generates an existence proof based on the root commitment and the deterministic key, and generates an incremental consistency proof based on the two root commitments. The verification module receives the root commitment, the deterministic key, and two types of proofs, performs verification, and outputs the quality data security monitoring results. The structure recovery module calls the root commitment snapshot and incremental consistency proof to rebuild the Verkle tree path and perform reconciliation, outputting the monitoring results after recovery.
[0007] Optionally, modules can be integrated using the following methods: Data on organic tea production, testing, and distribution is collected. Quality event units are constructed based on batch identifiers, process identifiers, and event serial numbers, and a unique deterministic key is assigned to each quality event unit. The quality event unit is subjected to field standardization and structure serialization to generate fixed-length vector encoded data, and the fixed-length vector encoded data is combined with the corresponding deterministic key to form key-value pairs; Deterministic keys are mapped to Verkle tree key space paths, fixed-length vector encoded data is written to the corresponding leaf nodes, and structural index information is recorded in the index nodes on the path; Obtain the set of child nodes for each index node, perform KZG vector commitment calculation based on the set of child nodes to generate the commitment value for each index node, and generate the root commitment through path aggregation calculation; The root commitment is combined with a timestamp to form a root commitment snapshot, and the root commitment snapshot is stored for subsequent structure restoration; An existence proof is generated based on the root commitment and the deterministic key, and an incremental consistency proof is generated based on the structural difference between the two root commitments. Receive root commitment, deterministic key, existence proof and incremental consistency proof, execute the verification process, and output the corresponding quality data security monitoring results based on the verification results; When data anomalies or system breakpoints occur, the root commitment snapshot and incremental consistency proof are invoked to rebuild the Verkle tree path structure, perform data reconciliation processing, and output the restored quality data security monitoring results.
[0008] Optionally, generating fixed-length vector-encoded data and key-value pairs includes: Establish a quality event unit field set. The field set should include at least event identification information, event time information, subject identity information, process identity information, batch identity information, quality data payload information, data version information, and integrity verification information. The collected data should be parsed and loaded into the corresponding fields of the field set. Perform field standardization processing on the field set, perform type encoding mapping on event identifier information, perform format normalization and convert event time information into a unified time expression, perform identifier normalization and generate standard identifiers on subject identity information, process identity information and batch identity information, and perform field name normalization and field position normalization on quality data payload information; Field alignment processing is performed on the quality data payload information to ensure that the field set meets the preset field order and preset field boundary constraints. Missing fields are written with null placeholders, and redundant fields are removed to form a structured field group with a defined field order and defined field domain. Perform structured serialization processing on the structured field group, convert each field into a byte sequence according to the preset encoding rules and concatenate them in the field order to generate fixed-length vector encoded data whose length is constrained by the field set; Key-value pairs are formed by using deterministic keys as keys and fixed-length vector-encoded data as values.
[0009] Optionally, the record structure index information includes: The deterministic key is parsed into three parts: batch field, stage field, and event field. Three path segments are generated according to the order in which the fields appear, which serve as the index path segments of the first, second, and third levels of the Verkle tree, respectively. Starting from the root node of the Verkle tree, key space paths are established sequentially based on the three path segments. If the level node pointed to by the path segment does not exist, a corresponding child node is added under the current index node, and the path segment identifier and tree level position identifier are bound. Write fixed-length vector encoded data at the leaf node position located in the third-level path segment, and write a complete set of deterministic key fields bound to the fixed-length vector encoded data into the leaf node. Record the set of deterministic key fields in the leaf node metadata area in a structured manner. In the first and second level index nodes, the corresponding path segment identifier, the node number of the child node it points to, the leaf node identifier associated with the index child node, and the field summary of the deterministic key in the leaf node are recorded to form a complete structure index information entry. Output the Verkle tree structure write results, which include the path structure from the root node to the leaf node, the path segment hierarchy mapping relationship of all nodes, the deterministic key content bound in the leaf node, and the set of structure index information entries written in the index node.
[0010] Optionally, the generation of root commitments includes: For each index node in the Verkle tree, process each slot in ascending order of slot number, performing the following processing for each slot: If the slot is a leaf node, then read the fixed-length vector encoded data from the data field of the leaf node and use it as the input byte sequence for that slot; If the slot contains an index node, then the node commitment value is read from the commitment field of the index node, and the commitment value is encoded into a fixed-length byte sequence as the input byte sequence. If no node is attached to the slot, a fixed-length all-zero byte sequence is generated for that slot as the input byte sequence. Write the input byte sequence obtained from the above operations into a slot input sequence according to the slot number order; Perform a numerical conversion operation on the slot input sequence, convert each byte sequence in the sequence to an integer in big-endian mode, convert the integer to a finite field element value according to a fixed finite field modulus, and write all finite field elements into a finite field input sequence in slot number order; Based on the input sequence of the finite field, construct an interpolation polynomial and perform the following operations: The slot number is used as the independent variable of the interpolation point, and the finite field input value of the corresponding slot is used as the function value of the interpolation point to establish a set of data points item by item. For each interpolation point in the data point set, calculate the corresponding interpolation basis function weights, and sum the weighted results of all interpolation basis functions to obtain an interpolation polynomial that can obtain the corresponding finite field input value at all slot numbers; Analyze all the coefficients of the interpolation polynomial and write them into a polynomial coefficient sequence in order of order; Generate the KZG vector commitment value of the current index node based on the polynomial coefficient sequence, and perform the following operations: Given a generator in a group, prepare a sequence of consecutive powers of the generator. Initialize a commitment cumulative variable as a group identity element; Starting with the zeroth order coefficient in the polynomial coefficient sequence, execute the following steps in order of order: read the current order coefficient, raise the corresponding order of the generator to the exponent value represented by the coefficient, multiply the result of the exponentiation operation with the commitment cumulative variable and update the commitment cumulative variable; After all order coefficients have completed the exponential multiplication accumulation operation, the final value of the committed accumulated variable is written to the commitment field of the index node. After the commitment fields of all index nodes are written, a path commitment collection operation is performed on each path extending from the leaf node to the root node in the Verkle tree. Starting from the bottom node of the path, the commitment field values of each level of the path are read up level by level, and the read commitment values are written into a path commitment value sequence in hierarchical order. For each path commitment value sequence, construct a path-level interpolation polynomial and perform the following operations: The path-level data point set is established by sequentially using the path level numbers as the interpolation point independent variables, converting the corresponding level commitment values into finite field elements, and using them as the function values of the interpolation points. A path-level interpolation polynomial is constructed based on the path-level data point set, and all order coefficients are extracted and written into the path-level polynomial coefficient sequence. Based on the path-level polynomial coefficient sequence, the repeated commitment accumulation operation process is used to generate the path-level commitment value of the path, and the path-level commitment value is written into the path commitment record; After all path-level commitment values have been generated, write all path-level commitment values into the root commitment input sequence in path number order, and perform the following operations: The path number is used as the interpolation point independent variable, and the value of each item in the root commitment input sequence is converted into a finite field element as the function value of the interpolation point; Construct the root-level interpolation polynomial and extract all order coefficients of the root-level polynomial; Based on the coefficient sequence of the root polynomial, the root commitment value is generated by repeated commitment accumulation operations; Write the root commitment value into the root node of the Verkle tree, and make it the root commitment of the current Verkle tree structure.
[0011] Optionally, combining the root commitment with the timestamp to form a root commitment snapshot and storing the root commitment snapshot includes: after obtaining the current root commitment at the root node, reading the system time to generate a timestamp, encoding the timestamp into a fixed-length time stamp byte sequence according to the year, month, day, hour, minute, and second fields, serializing the root commitment into a fixed-length root commitment byte sequence according to its output encoding rules, concatenating the timestamp byte sequence and the root commitment byte sequence in a fixed order to form a root commitment snapshot record, writing the starting storage position and length of the snapshot record into the snapshot index record, appending the snapshot record to the snapshot storage area in the writing order, and synchronously writing the snapshot index record to the index storage area.
[0012] Optionally, generating incremental consistency proofs includes: Construct a path segment sequence based on the deterministic key field, parse the path structure segment by segment according to the field order, and locate each level index node and the final leaf node in the Verkle tree structure corresponding to the target root commitment, starting from the root node and following the path segment sequence order. During the path localization process, the slot number, child node commitment value, interpolation polynomial coefficients, and corresponding KZG vector commitment of each index node are recorded and assembled into structured path proof data. At the end of the path, the data record and field summary corresponding to the deterministic key are read from the leaf node and written to the end of the path existence proof to form a complete existence proof record. Starting from the root node, compare the slot values level by level down along the overlapping paths in both versions, and perform the following operations for each index node: parse all slot numbers and corresponding child nodes of the current node; Compare the identifiers or commitment values of two version child nodes with the same slot number. If they match, skip the current slot. If there is a discrepancy, record the slot number and add the path under that slot to the structural difference path table; For each path in the structural difference path table, read all its index nodes and leaf nodes in the two versions, generate a difference path mapping table, and record the identifier, parent node number, and slot number in the parent node for each node according to the path hierarchy. Based on the difference path mapping table, in each difference path, the changed nodes are extracted by tracing back from the leaf node to the top level, and the parent-child structure information of all newly added nodes and replaced nodes on the path is assembled into a structure evolution sequence. After comparing each pair of adjacent nodes in the structural evolution sequence, the commitment value of the newly added child node and its original commitment value in the first version are extracted and combined into a differential commitment input group. For each difference commitment input group, consistency verification information is generated, specifically including: Construct interpolation pairs with the slot number before the change as the horizontal axis and the independent variable, and the previous and subsequent commitment values as the vertical axis and the dependent variable. Construct an interpolation polynomial and extract its coefficient sequence; A KZG vector commitment is generated based on the coefficient sequence, serving as a consistency proof fragment for the differential slot; All structural evolution sequences of the differential paths, differential slot numbers and their corresponding consistency proof fragments are uniformly combined into incremental consistency proof records and output as structured consistency proof datasets.
[0013] Optionally, the corresponding quality data safety monitoring results output may include: The root commitment encoding content, the deterministic key field content, the path structure segment information, and the commitment value structure data are parsed separately. Construct a path segment sequence based on the deterministic key field, and combine it with the index node slot number, interpolation coefficient sequence, and KZG vector commitment from the existence proof, then perform the following verification process: Traverse the path structure from the root node to the leaf node in sequence; At each index node, the interpolation polynomial of the corresponding slot is reconstructed using the slot number and the interpolation coefficient sequence; Consistency verification is performed using the interpolation polynomial and vector commitment value of the corresponding slot to confirm the mathematical matching relationship between the slot input value and the node commitment; At the leaf node, extract the field summary to determine whether the deterministic key matches the target record, and verify that the set of deterministic key fields bound in the leaf node is consistent with the target key fields; If the commitment verification of all path nodes is successful, and the key value bound to the leaf node is consistent with the input deterministic key, then the existence proof is deemed valid, and the first-stage verification result is output as "record exists". The incremental consistency proof structure is parsed, and the structural evolution sequence, difference slot numbers, and corresponding consistency proof fragments are extracted. The legality of the structural evolution of each slot is verified according to the following process: The interpolation function is reconstructed by taking the previous and subsequent version commitment values of each difference slot as input and combining them with the interpolation polynomial coefficients. Consistency verification was performed using the reconstructed interpolation function and the KZG commitment value; If the function value at the slot number is consistent with the difference between the two versions' commitments, then the slot change is confirmed to be a one-way append; The results of all differential slot verifications are statistically analyzed. If all consistency verifications pass, the incremental evolution verification is successful, and the second-stage verification result is output as "structure not rolled back". Based on the joint judgment of the verification results of the first and second phases: if the record exists and the structure has not been rolled back, the output quality data security monitoring result is "data is true and complete"; if the record is missing or the structure has been rolled back, the output quality data security monitoring result is "data is unreliable" and the abnormal path and node are marked.
[0014] The beneficial effects of this invention are: This invention constructs quality event units from organic tea production, testing, and circulation data and assigns unique deterministic keys. It combines field standardization and structural serialization to form fixed-length coded data, and then maps key-value pairs into a tree-like path structure to form a structural index. This enables quality events to have consistent data expression and a locatable index foundation in cross-entity and cross-system environments, thereby reducing traceability difficulties and verification costs caused by inconsistent field definitions, scattered records, and uncertain indexes. Attached Figure Description
[0015] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1This is a flowchart of a method and system for safe monitoring of organic tea quality data proposed in this invention; Figure 2 This is a flowchart illustrating the processing of the Verkle tree structure path proposed in this invention. Detailed Implementation
[0016] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0017] refer to Figure 1 - Figure 2 A method and system for safe monitoring of organic tea quality data, comprising the following steps: The quality event generation module collects data on the production, testing, and distribution of organic tea, generates quality event units based on batch identifiers, process identifiers, and event sequence numbers, and assigns a unique deterministic key. The event encoding module receives quality event units, performs field standardization and structure serialization processing, generates fixed-length vector encoded data, and forms key-value pairs with deterministic keys; The path mapping module receives key-value pairs, maps deterministic keys to paths in the Verkle tree key space, writes encoded data to leaf nodes, and records path information in index nodes. The commitment generation module receives the set of child nodes of the index node, performs KZG vector commitment calculation, generates the commitment value of the index node, and aggregates them to form the root commitment. The snapshot recording module stores the root commitment and timestamp to generate a root commitment snapshot; The proof generation module generates an existence proof based on the root commitment and the deterministic key, and generates an incremental consistency proof based on the two root commitments. The verification module receives the root commitment, the deterministic key, and two types of proofs, performs verification, and outputs the quality data security monitoring results. The structure recovery module calls the root commitment snapshot and incremental consistency proof to rebuild the Verkle tree path and perform reconciliation, outputting the monitoring results after recovery.
[0018] In this embodiment, the modules are interconnected using the following method: Data on organic tea production, testing, and distribution is collected. Quality event units are constructed based on batch identifiers, process identifiers, and event serial numbers, and a unique deterministic key is assigned to each quality event unit. The quality event unit is subjected to field standardization and structure serialization to generate fixed-length vector encoded data, and the fixed-length vector encoded data is combined with the corresponding deterministic key to form key-value pairs; Deterministic keys are mapped to Verkle tree key space paths, fixed-length vector encoded data is written to the corresponding leaf nodes, and structural index information is recorded in the index nodes on the path; Obtain the set of child nodes for each index node, perform KZG vector commitment calculation based on the set of child nodes to generate the commitment value for each index node, and generate the root commitment through path aggregation calculation; The root commitment is combined with a timestamp to form a root commitment snapshot, and the root commitment snapshot is stored for subsequent structure restoration; An existence proof is generated based on the root commitment and the deterministic key, and an incremental consistency proof is generated based on the structural difference between the two root commitments. Receive root commitment, deterministic key, existence proof and incremental consistency proof, execute the verification process, and output the corresponding quality data security monitoring results based on the verification results; When data anomalies or system breakpoints occur, the root commitment snapshot and incremental consistency proof are invoked to rebuild the Verkle tree path structure, perform data reconciliation processing, and output the restored quality data security monitoring results.
[0019] In this embodiment, generating fixed-length vector encoded data and key-value pairs includes: Establish a quality event unit field set. The field set should include at least event identification information, event time information, subject identity information, process identity information, batch identity information, quality data payload information, data version information, and integrity verification information. The collected data should be parsed and loaded into the corresponding fields of the field set. Perform field standardization processing on the field set, perform type encoding mapping on event identifier information, perform format normalization and convert event time information into a unified time expression, perform identifier normalization and generate standard identifiers on subject identity information, process identity information and batch identity information, and perform field name normalization and field position normalization on quality data payload information; Field alignment processing is performed on the quality data payload information to ensure that the field set meets the preset field order and preset field boundary constraints. Missing fields are written with null placeholders, and redundant fields are removed to form a structured field group with a definite field order and definite field domain. Perform structured serialization processing on the structured field group, convert each field into a byte sequence according to the preset encoding rules and concatenate them in the field order to generate fixed-length vector encoded data whose length is constrained by the field set; Key-value pairs are formed by using deterministic keys as keys and fixed-length vector-encoded data as values.
[0020] In this embodiment, the recorded structure index information includes: The deterministic key is parsed into three parts: batch field, stage field, and event field. Three path segments are generated according to the order in which the fields appear, which serve as the index path segments of the first, second, and third levels of the Verkle tree, respectively. Starting from the root node of the Verkle tree, key space paths are established sequentially based on the three path segments. If the level node pointed to by the path segment does not exist, a corresponding child node is added under the current index node, and the path segment identifier and tree level position identifier are bound. Write fixed-length vector encoded data at the leaf node position located in the third-level path segment, and write a complete set of deterministic key fields bound to the data into the leaf node, and record the set in a structured manner in the leaf node metadata area. In the first and second level index nodes, the corresponding path segment identifier, the node number of the child node it points to, the leaf node identifier associated with the child node, and the field summary of the deterministic key in the leaf node are recorded to form a complete structural index information entry. Output the Verkle tree structure write results, which include the path structure from the root node to the leaf node, the path segment hierarchy mapping relationship of all nodes, the deterministic key content bound in the leaf node, and the set of structure index information entries written in the index node.
[0021] In this embodiment, the Verkle tree includes: The deterministic key is divided into a first field, a second field, and a third field according to the field boundaries, and a path segment sequence is formed according to the field order; Generate a path segment assembly table for the path segment sequence. The path segment assembly table records the field values, target level number and parent level number of each path segment in sequence to define the correspondence between path segments and hierarchical structures. Based on the path segment assembly table, perform hierarchical layout processing before assembling the tree structure. Establish hierarchical layout records at each level and write the number of nodes to be created at that level, the path segment field value, and the target slot number into the hierarchical layout records, so that the path segment sequence and the tree structure have a clear hierarchical positioning before assembly. Based on the hierarchical layout record, the node assembly process is executed sequentially starting from the root node, performing the following steps for each segment in the path segment sequence: Read the target level number and parent level number of this segment; Create an index node corresponding to the path segment at the slot number of the parent node, and write the field value of the path segment into the node field of the index node; Write the node number of the index node back to the slot field of the parent node to establish a one-to-one correspondence between parent and child nodes; Create a leaf node at the index node position corresponding to the last path segment in the path segment sequence, write fixed-length vector encoded data into the data field of the leaf node, and write a complete deterministic key field set into the metadata field of the leaf node. Establish the record relationship between the leaf node and the path segment sequence through this field set. After the leaf nodes are created, the backfill path chain construction process is initiated, executing sequentially in the reverse order of the path segment sequence: Write the parent node number, the slot number in the parent node, and the path segment field value into the current node; Write the child node number into the parent node and register the correspondence between the child node and the path segment field value; Repeat the above steps until the root node, so that the entire path forms a path chain that can be traced from the leaf node to the root node. The path segment assembly table, hierarchical layout record, node assembly field, leaf node metadata, and path backfill field are combined to form a structured Verkle tree.
[0022] In this embodiment, the generation of root commitments includes: For each index node in the Verkle tree, process each slot in ascending order of slot number, performing the following processing for each slot: If the slot contains a leaf node, then read the fixed-length vector encoded data from the data field of the leaf node and use it as the input byte sequence for the slot. If the slot contains an index node, then read the node commitment value from the commitment field of the index node and encode the commitment value into a fixed-length byte sequence as the input byte sequence; If no node is attached to the slot, a fixed-length all-zero byte sequence is generated for the slot as the input byte sequence. Write the input byte sequence obtained from the above operations into a slot input sequence according to the slot number order; Perform a numerical conversion operation on the slot input sequence, convert each byte sequence in the sequence to an integer in big-endian mode, then convert the integer to a finite field element value according to a fixed finite field modulus, and write all finite field elements into a finite field input sequence in slot number order; Based on the input sequence of the finite field, construct an interpolation polynomial and perform the following operations: The slot number is used as the independent variable of the interpolation point, and the finite field input value of the corresponding slot is used as the function value of the interpolation point to establish a set of data points item by item. For each interpolation point in the data point set, calculate the corresponding interpolation basis function weights, and sum the weighted results of all interpolation basis functions to obtain an interpolation polynomial that can obtain the corresponding finite field input value at all slot numbers; Analyze all the coefficients of the interpolation polynomial and write them into a polynomial coefficient sequence in order of order; Generate the KZG vector commitment value of the current index node based on the polynomial coefficient sequence, and perform the following operations: Given a generator g in a group, prepare a continuous exponential sequence of generators. Initialize a commitment cumulative variable as a group identity element; Starting with the zeroth order coefficient in the polynomial coefficient sequence, execute the following steps in order of order: read the current order coefficient, raise the corresponding order of the generator to the exponent value represented by the coefficient, multiply the result of the exponentiation operation with the commitment cumulative variable and update the commitment cumulative variable; After all order coefficients have completed the exponential multiplication accumulation operation, the final value of the committed accumulated variable is written to the commitment field of the index node. After the commitment fields of all index nodes are written, a path commitment collection operation is performed on each path extending from the leaf node to the root node in the Verkle tree. Starting from the bottom node of the path, the commitment field values of each level of the path are read up level by level, and the read commitment values are written into a path commitment value sequence in hierarchical order. For each path commitment value sequence, construct a path-level interpolation polynomial and perform the following operations: The path-level data point set is established by sequentially using the path level numbers as the interpolation point independent variables, converting the corresponding level commitment values into finite field elements, and using them as the function values of the interpolation points. A path-level interpolation polynomial is constructed based on the path-level data point set, and all order coefficients are extracted and written into the path-level polynomial coefficient sequence. Based on the path-level polynomial coefficient sequence, the repeated commitment accumulation operation process is used to generate the path-level commitment value for the path, and the path-level commitment value is written into the path commitment record. After all path-level commitment values have been generated, write all path-level commitment values into the root commitment input sequence in order of path number, and perform the following operations on this sequence: The path number is used as the interpolation point independent variable, and the value of each item in the root commitment input sequence is converted into a finite field element as the function value of the interpolation point; Construct the root-level interpolation polynomial and extract all order coefficients of the root-level polynomial; Based on the coefficient sequence of the root polynomial, the root commitment value is generated by repeated commitment accumulation operations; Write the root commitment value to the root node of the Verkle tree, and use it as the root commitment identifier for the current Verkle tree structure.
[0023] In this embodiment, the construction rule of the interpolation polynomial is: the set of interpolation points is denoted as... ,in Take the structure index number involved in the interpolation, specifically the slot number for slot-level interpolation, the hierarchy number for path-level interpolation, and the path number for root-level interpolation. Take and For one-to-one correspondence of finite field input values, specifically for slot-level interpolation, the finite field element is obtained by converting the slot input byte sequence to an integer and taking the modulus according to a fixed finite field modulus. For path-level interpolation, the finite field element is obtained by converting the commitment value of the node at that level according to the same rule. For root-level interpolation, the finite field element is obtained by converting the path-level commitment value according to the same rule. To reduce the number of interpolation points by one, a Lagrange interpolation method is used based on this set of interpolation points to construct a method that satisfies the condition for all interpolation points. All interpolation polynomial Its construction formula is and will Expand as To extract the coefficient sequence, where All are elements of finite fields and .
[0024] In this embodiment, generating the KZG vector commitment includes: in a finite field Obtain the coefficient sequence to be committed and treat it as a polynomial The coefficients of each order are obtained by reading the primitive sequence in the common parameters that corresponds one-to-one with the order. ,in For the group The elements in and with the first Order coefficient binding, initial commitment cumulative as group identity element, then according to order from arrive Perform exponentiation sequentially And The final commitment value is obtained by performing a group multiplication update with the accumulated commitments. ,in For finite field elements, For the highest order, For common parameter primitives, This is the KZG vector commitment output value corresponding to the coefficient sequence.
[0025] In this embodiment, combining the root commitment and the timestamp to form a root commitment snapshot includes: after obtaining the current root commitment at the root node, reading the system time to generate a timestamp, encoding the timestamp into a fixed-length time stamp byte sequence according to the year, month, day, hour, minute, and second fields, serializing the root commitment into a fixed-length root commitment byte sequence according to its output encoding rules, concatenating the timestamp byte sequence and the root commitment byte sequence in a fixed order to form a root commitment snapshot record, writing the starting storage position and length of the snapshot record into the snapshot index record, appending the snapshot record to the snapshot storage area in the writing order, and synchronously writing the snapshot index record to the index storage area.
[0026] In this embodiment, generating incremental consistency proofs includes: Construct a path segment sequence based on the deterministic key field, parse the path structure segment by segment according to the field order, and locate each level index node and the final leaf node in the Verkle tree structure corresponding to the target root commitment, starting from the root node and following the path segment sequence order. During the path localization process, the slot number, child node commitment value, interpolation polynomial coefficients, and corresponding KZG vector commitment of each index node are recorded and assembled into structured path proof data. At the end of the path, the data record and field summary corresponding to the deterministic key are read from the leaf node and written to the end of the path existence proof to form a complete existence proof record. Starting from the root node, compare the slot values level by level down along the overlapping paths in both versions, and perform the following operations for each index node: parse all slot numbers and corresponding child nodes of the current node; Compare the identifiers or commitment values of two version child nodes with the same slot number. If they match, skip the current slot. If there is a discrepancy, record the slot number and add the path under that slot to the structural difference path table; For each path in the structural difference path table, read all its index nodes and leaf nodes in the two versions, generate a difference path mapping table, and record the identifier, parent node number, and slot number in the parent node for each node according to the path hierarchy. Based on the difference path mapping table, in each difference path, the changed nodes are extracted by tracing back from the leaf node to the top level, and the parent-child structure information of all newly added nodes and replaced nodes on the path is assembled into a structure evolution sequence. After comparing each pair of adjacent nodes in the structural evolution sequence, the commitment value of the newly added child node and its original commitment value in the first version are extracted and combined into a differential commitment input group. For each difference commitment input group, consistency verification information is generated, specifically including: Construct interpolation pairs with the slot number before the change as the horizontal axis and the independent variable, and the previous and subsequent commitment values as the vertical axis and the dependent variable. Construct an interpolation polynomial and extract its coefficient sequence; A KZG vector commitment is generated based on the coefficient sequence, serving as a consistency proof fragment for the differential slot; All structural evolution sequences of the differential paths, differential slot numbers and their corresponding consistency proof fragments are uniformly combined into incremental consistency proof records and output as structured consistency proof datasets.
[0027] In this embodiment, the corresponding quality data safety monitoring results output include: Construct a path segment sequence based on the deterministic key field, and combine it with the index node slot number, interpolation coefficient sequence, and KZG vector commitment from the existence proof, then perform the following verification process: Traverse the path structure from the root node to the leaf node in sequence; At each index node, the interpolation polynomial of the corresponding slot is reconstructed using the slot number and the interpolation coefficient sequence; The polynomial and vector commitment values are used for consistency verification to confirm the mathematical matching relationship between slot input values and node commitments; At the leaf node, extract the field summary to determine whether the deterministic key matches the target record, and verify that the set of deterministic key fields bound in the leaf node is consistent with the target key fields; If the commitment verification of all path nodes is successful, and the key value bound to the leaf node is consistent with the input deterministic key, then the existence proof is deemed valid, and the first-stage verification result is output as "record exists". The incremental consistency proof structure is parsed, and the structural evolution sequence, difference slot numbers, and corresponding consistency proof fragments are extracted. The legality of the structural evolution of each slot is verified according to the following process: The interpolation function is reconstructed by taking the previous and subsequent version commitment values of each difference slot as input and combining them with the interpolation polynomial coefficients. Consistency verification was performed using the reconstructed interpolation function and the KZG commitment value; If the function value at the slot number is consistent with the difference between the two versions' commitments, then the slot change is confirmed to be a one-way append; The results of all differential slot verifications are statistically analyzed. If all consistency verifications pass, the incremental evolution verification is successful, and the second-stage verification result is output as "structure not rolled back". Based on the joint judgment of the verification results of the first and second phases: if the record exists and the structure has not been rolled back, the output quality data security monitoring result is "data is true and complete"; if the record is missing or the structure has been rolled back, the output quality data security monitoring result is "data is unreliable" and the abnormal path and node are marked.
[0028] In this embodiment, the output of the restored quality data security monitoring results includes: Receive data anomaly flags or breakpoint flags, read the most recent root commitment snapshot index record associated with the flag, locate and read the root commitment snapshot record based on the index record, parse the timestamp byte sequence and root commitment byte sequence, and restore them to the target root commitment and target snapshot time point; Receive the incremental consistency proof corresponding to the target root commitment, parse to obtain the structural difference path table, structural evolution sequence, difference slot number and consistency proof fragment, and sort the structural evolution sequence according to the parent node number and slot number to form a path reconstruction task list for the breakpoint interval; For each task in the path reconstruction task list, the path segment sequence is parsed based on the deterministic key field. Starting from the Verkle tree root node corresponding to the target root commitment, the index node is located level by level according to the path segment sequence. At each level of the index node, the slot number and child node identifier recorded in the task are written until the corresponding leaf node is located and reconstructed. During the leaf node reconstruction process, the deterministic key field set in the leaf node metadata field is read, and its consistency with the deterministic key corresponding to the task is verified. The fixed-length vector encoded data in the leaf node data field is also read to form the reconstruction record set of the breakpoint interval. Perform data reconciliation on the reconstructed record set, compare the reconstructed record set with the local cached record set key by key based on the deterministic key, generate a reconciliation difference list, identify each record in the difference list as missing, inconsistent, or inconsistent, and map the difference items back to the node path identifier in the structure difference path table. Based on the discrepancy list, extract the corresponding consistency proof fragments, execute the consistency verification process, confirm that the path to which the discrepancy item belongs satisfies the one-way append relationship between the target root commitment and the version after the breakpoint, and generate the reconciliation verification results. Based on the reconciliation and verification results, the output includes the quality data security monitoring results after recovery. The output includes the target snapshot time point, the target root commitment, the discrepancy list, the reconciliation and verification results, and the abnormal path identifier.
[0029] Example: To verify the feasibility of this invention, it was applied to a multi-entity collaborative organic tea quality data management scenario. This scenario covers raw material collection, processing control, quality testing, warehousing and inventory management, distribution and delivery, and external review. Upstream, there are multiple raw material suppliers; midstream, multiple processing lines and multiple business systems operate in parallel; and downstream, distribution and review nodes request verification of quality data. Existing technologies typically use batch numbers or order numbers as the linking clues, storing production, testing, and distribution records in different systems. Field naming, field location, time representation, and payload structure lack unified constraints, leading to the need for exporting reports and manual verification for cross-system reconciliation. In the event of missing records, replacements, or version rollback disputes, external nodes usually rely on internal enterprise permissions, manual endorsement, or screenshots from the other party's system, making it difficult to form an independently verifiable chain of evidence. When system links are interrupted or nodes fail, data recovery often relies on log tracing and manual entry, resulting in low recovery efficiency and difficulty in proving that the recovery process did not introduce the risk of secondary changes. The above issues constitute the core business pain point in this scenario: data is "visible but difficult to prove" in the data chain, and "can be repaired but difficult to prove" when data anomalies occur.
[0030] To address the aforementioned pain points, this invention uses a "quality event" as the smallest governance unit in this scenario, fully implementing the key technical features defined in the claims into the production, testing, and distribution data chain. The system first connects to the data sources of each stage on the acquisition side, uniformly constructing each processing action record, each test result generation, and each inbound / outbound and delivery action into a quality event unit. The quality event unit contains a set of fields including event identifier information, event time information, subject identity information, stage identity information, batch identity information, quality data payload information, data version information, and integrity verification information. The system generates a unique deterministic key based on the batch identifier, stage identifier, and event sequence number. This deterministic key is the first key technical feature of this invention for achieving verifiability and recoverability, because it can be repeatedly generated on different nodes and different systems and uniquely points to the same event, ensuring that subsequent "location, proof, and reconciliation" are based on a deterministic identity rather than weakly related fields.
[0031] After the quality event unit is generated, the system enters the event coding process. The system performs field standardization on the field set, mapping event types to specific type codes, normalizing time expressions to a unified time format, and standardizing the identifiers for subject identity, process identity, and batch identity to generate standard identifiers. Simultaneously, the system performs field name standardization and field position normalization on the quality data payload information, ensuring that data from different systems meets preset field order and boundary constraints at the structural level. Missing fields are written with null placeholders, and redundant fields are removed, resulting in a structured field group with a definite field order and definite field fields. Subsequently, the system performs structure serialization on the structured field group, converting each field into a byte sequence according to preset encoding rules and concatenating them in field order to generate fixed-length vector encoded data constrained by the field set. The deterministic key is then combined with the fixed-length vector encoded data to form key-value pairs. The chain of "field standardization + structure serialization + fixed-length vector encoding" is the second key technical feature of this invention. It brings forward the cross-system caliber drift problem to the standardization stage before writing, so that the subsequent tree structure indexing, commitment calculation and proof generation have definite input, thereby avoiding the repeated rework caused by the traditional solution only exposing structural differences during back-end verification.
[0032] After key-value pair generation is completed, the system enters the Verkle tree structure path processing flow, which is the third key technical feature of this invention. Upon receiving the key-value pair, the system parses the deterministic key into three parts: batch field, stage field, and event field. It then generates three path segments according to the order of field appearance, serving as the three-level index path segments of the tree structure. Starting from the root node, the system sequentially establishes key space paths based on the path segments. If the node pointed to by a path segment does not exist, a corresponding child node is added under the current index node, and the path segment identifier and tree level position identifier are bound. After locating the path to the third level, the system writes fixed-length vector-encoded data at the leaf node position and writes the complete set of deterministic key fields bound to this data in the leaf node metadata area, forming a consistent binding relationship between "leaf node data—leaf node metadata—deterministic key." Simultaneously, the system records structural index information entries in the first and second level index nodes, including the path segment identifier, the node number of its pointed-to child node, the leaf node identifier associated with the child node, and the field summary of the deterministic key in the leaf node, used for rapid reproduction of the path structure in subsequent proof generation, verification, and recovery stages. The structure's writing method and index record method enable any event to be stably mapped to a unique path through a deterministic key, and can reproduce the "root to leaf" structural positioning link without business database semantic queries.
[0033] After the tree structure is written, the system performs commitment generation to solidify the data state, which is the fourth key technical feature of this invention. For each index node, the system collects its child node set and assembles the slot input sequence according to the slot number order. When the slot is a leaf node, the data field of the leaf node is read as the input byte sequence; when the slot is an index node, the commitment field of that index node is read and encoded into a fixed-length byte sequence as input; when the slot is empty, a fixed-length all-zero byte sequence is written. The system converts the slot input sequence into a finite-field input sequence, constructs an interpolation polynomial and extracts the polynomial coefficient sequence, and then performs vector commitment calculation based on the coefficient sequence to obtain the commitment value of the current index node. This commitment value is generated layer by layer from bottom to top in the entire tree and forms a root commitment through path aggregation. The root commitment serves as a unique identifier of the current tree structure state and is used for external verification and version evolution comparison.
[0034] After generating the root commitment, the system combines the root commitment with a timestamp to form a root commitment snapshot and stores it. This is the fifth key technical feature of the present invention. The system reads the system time to generate a timestamp, encodes the timestamp into a fixed-length time stamp byte sequence according to the year, month, day, hour, minute, and second fields, and serializes the root commitment into a fixed-length root commitment byte sequence according to the output encoding rules. The two are concatenated in a fixed order to form a snapshot record, and the starting storage position and length of the snapshot record are written into the snapshot index record. The snapshot record is appended to the snapshot storage area in the writing order, and the snapshot index record is synchronously written to the index storage area. This snapshot mechanism provides a "state anchor" in anomaly recovery and cross-version consistency proof generation, enabling the system to locate historical states based on snapshots rather than relying on log inference.
[0035] In the multi-entity collaborative verification stage, the system generates two types of proof data and provides verification capabilities, which is the sixth key technical feature of this invention. The system generates existence proofs based on root commitments and deterministic keys: the system constructs a path segment sequence according to the deterministic key field, and locates each level of index node and the final leaf node segment by segment in the tree structure corresponding to the root commitment, starting from the root node. During the location process, it records the slot number, child node commitment value, interpolation polynomial coefficients, and vector commitment structure data of each level of index node, assembling them into structured path proof data. At the leaf node, it reads the data record and field summary corresponding to the deterministic key and writes them to the end of the proof, enabling the verification end to verify the consistency of commitments and key attribution layer by layer, thereby determining whether the record truly exists in the root commitment state. The system also generates incremental consistency proofs based on the structural differences between the two root commitments: the system performs a slot-level comparison of the two versions of the tree structure to obtain a structural difference path table, further forming a difference path mapping table and a structural evolution sequence for the difference paths, and assembling the consistency proof fragments of the difference slots into consistency proof records, enabling the verification end to verify whether version changes comply with unidirectional append constraints, thereby identifying risks such as rollback and replacement.
[0036] During the verification phase, the verification end receives the root commitment, deterministic key, existence proof, and consistency proof. It then reconstructs the slot interpolation relationship layer by layer according to the path structure and verifies the commitment consistency. At the leaf nodes, it verifies that the set of deterministic key fields in the leaf node metadata matches the input deterministic key, and combines the field digest to determine the key value attribution, thus outputting the conclusion "record exists / record is missing". Simultaneously, it parses the structural evolution sequence, difference slot number, and consistency fragment in the consistency proof, verifying whether the difference slots satisfy consistency constraints between the two versions, thus outputting the conclusion "structure not rolled back / risk of rollback or replacement exists". The system merges these two conclusions to output the quality data security monitoring result, which can include abnormal path and node location information for business-side handling and review.
[0037] When link interruption, node failure, or data anomaly occurs, the system utilizes root commitment snapshots and incremental consistency proofs to perform structural recovery and reconciliation. This is the seventh key technical feature of this invention. The system locates the most recent snapshot index based on the anomaly identifier, reads and parses the snapshot records to obtain the target root commitment and snapshot status; the system parses the consistency proof to obtain the structural difference path table and structural evolution sequence, and sorts the structural evolution sequence by parent node number and slot number to form a path reconstruction task. The system locates index nodes level by level according to the task and writes slot numbers and child node identifiers to reconstruct the path until the leaf node is reconstructed; at the leaf node, it reads the set of deterministic key fields from the metadata and verifies their consistency with the target deterministic key, then reads the leaf node data fields to form a reconstructed record set; the system compares the reconstructed record set with the local cached record set key by key based on the deterministic key to generate a difference list, and maps the difference items back to the structural difference path table; the system then extracts the corresponding consistency proof fragments to perform consistency verification, confirming that the path to which the difference item belongs meets the expected evolution constraints, and finally outputs the monitoring results after recovery, achieving a "recoverable and provable" closed-loop recovery.
[0038] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A system for organic tea leaf quality data security monitoring, characterized by, include: The quality event generation module collects data on the production, testing, and distribution of organic tea, generates quality event units based on batch identifiers, process identifiers, and event sequence numbers, and assigns a unique deterministic key. The event encoding module receives quality event units, performs field standardization and structure serialization processing, generates fixed-length vector encoded data, and forms key-value pairs with deterministic keys; The path mapping module receives key-value pairs, maps deterministic keys to paths in the Verkle tree key space, writes encoded data to leaf nodes, and records path information in index nodes. The commitment generation module receives the set of child nodes of the index node, performs KZG vector commitment calculation, generates the commitment value of the index node, and aggregates them to form the root commitment. The snapshot recording module stores the root commitment and timestamp to generate a root commitment snapshot; The proof generation module generates an existence proof based on the root commitment and the deterministic key, and generates an incremental consistency proof based on the two root commitments. The verification module receives the root commitment, the deterministic key, and two types of proofs, performs verification, and outputs the quality data security monitoring results. The structure recovery module calls the root commitment snapshot and incremental consistency proof to rebuild the Verkle tree path and perform reconciliation, outputting the monitoring results after recovery.
2. An organic tea leaf quality data security monitoring method characterized by comprising: The modules are connected in the following way: Data on organic tea production, testing, and distribution is collected. Quality event units are constructed based on batch identifiers, process identifiers, and event serial numbers, and a unique deterministic key is assigned to each quality event unit. The quality event unit is subjected to field standardization and structure serialization to generate fixed-length vector encoded data, and the fixed-length vector encoded data is combined with the corresponding deterministic key to form key-value pairs; Deterministic keys are mapped to Verkle tree key space paths, fixed-length vector encoded data is written to the corresponding leaf nodes, and structural index information is recorded in the index nodes on the path; Obtain the set of child nodes for each index node, perform KZG vector commitment calculation based on the set of child nodes to generate the commitment value for each index node, and generate the root commitment through path aggregation calculation; The root commitment is combined with a timestamp to form a root commitment snapshot, and the root commitment snapshot is stored for subsequent structure restoration; An existence proof is generated based on the root commitment and the deterministic key, and an incremental consistency proof is generated based on the structural difference between the two root commitments. Receive root commitment, deterministic key, existence proof and incremental consistency proof, execute the verification process, and output the corresponding quality data security monitoring results based on the verification results; When data anomalies or system breakpoints occur, the root commitment snapshot and incremental consistency proof are invoked to rebuild the Verkle tree path structure, perform data reconciliation processing, and output the restored quality data security monitoring results.
3. The method for safe monitoring of organic tea quality data according to claim 2, characterized in that, Generating fixed-length vector encoded data and key-value pairs includes: Establish a quality event unit field set. The field set should include at least event identification information, event time information, subject identity information, process identity information, batch identity information, quality data payload information, data version information, and integrity verification information. The collected data should be parsed and loaded into the corresponding fields of the field set. Perform field standardization processing on the field set, perform type encoding mapping on event identifier information, perform format normalization and convert event time information into a unified time expression, perform identifier normalization and generate standard identifiers on subject identity information, process identity information and batch identity information, and perform field name normalization and field position normalization on quality data payload information; Field alignment processing is performed on the quality data payload information to ensure that the field set meets the preset field order and preset field boundary constraints. Missing fields are written with null placeholders, and redundant fields are removed to form a structured field group with a defined field order and defined field domain. Perform structured serialization processing on the structured field group, convert each field into a byte sequence according to the preset encoding rules and concatenate them in the field order to generate fixed-length vector encoded data whose length is constrained by the field set; Key-value pairs are formed by using deterministic keys as keys and fixed-length vector-encoded data as values.
4. The method for safe monitoring of organic tea quality data according to claim 2, characterized in that, Record structure index information includes: The deterministic key is parsed into three parts: batch field, stage field, and event field. Three path segments are generated according to the order in which the fields appear, which serve as the index path segments of the first, second, and third levels of the Verkle tree, respectively. Starting from the root node of the Verkle tree, key space paths are established sequentially based on the three path segments. If the level node pointed to by the path segment does not exist, a corresponding child node is added under the current index node, and the path segment identifier and tree level position identifier are bound. Write fixed-length vector encoded data at the leaf node position located in the third-level path segment, and write a complete set of deterministic key fields bound to the fixed-length vector encoded data into the leaf node. Record the set of deterministic key fields in the leaf node metadata area in a structured manner. In the first and second level index nodes, the corresponding path segment identifier, the node number of the child node it points to, the leaf node identifier associated with the index child node, and the field summary of the deterministic key in the leaf node are recorded to form a complete structure index information entry. Output the Verkle tree structure write results, which include the path structure from the root node to the leaf node, the path segment hierarchy mapping relationship of all nodes, the deterministic key content bound in the leaf node, and the set of structure index information entries written in the index node.
5. The method for safe monitoring of organic tea quality data according to claim 2, characterized in that, The root generation commitment includes: For each index node in the Verkle tree, process each slot in ascending order of slot number, performing the following processing for each slot: If the slot is a leaf node, then read the fixed-length vector encoded data from the data field of the leaf node and use it as the input byte sequence for that slot; If the slot contains an index node, then the node commitment value is read from the commitment field of the index node, and the commitment value is encoded into a fixed-length byte sequence as the input byte sequence. If no node is attached to the slot, a fixed-length all-zero byte sequence is generated for that slot as the input byte sequence. Write the input byte sequence obtained from the above operations into a slot input sequence according to the slot number order; Perform a numerical conversion operation on the slot input sequence, convert each byte sequence in the sequence to an integer in big-endian mode, convert the integer to a finite field element value according to a fixed finite field modulus, and write all finite field elements into a finite field input sequence in slot number order; Constructing interpolation polynomials based on input sequences from finite fields; Analyze all the coefficients of the interpolation polynomial and write them into a polynomial coefficient sequence in order of order; Generate the KZG vector commitment value of the current index node based on the polynomial coefficient sequence, and perform the following operations: Given a generator in a group, prepare a sequence of consecutive powers of the generator. Initialize a commitment cumulative variable as a group identity element; Starting with the zeroth order coefficient in the polynomial coefficient sequence, execute the following steps in order of order: read the current order coefficient, raise the corresponding order of the generator to the exponent value represented by the coefficient, multiply the result of the exponentiation operation with the commitment cumulative variable and update the commitment cumulative variable; After all order coefficients have completed the exponential multiplication accumulation operation, the final value of the committed accumulated variable is written to the commitment field of the index node. After the commitment fields of all index nodes are written, a path commitment collection operation is performed on each path extending from the leaf node to the root node in the Verkle tree. Starting from the bottom node of the path, the commitment field values of each level of the path are read up level by level, and the read commitment values are written into a path commitment value sequence in hierarchical order. For each path commitment value sequence, construct a path-level interpolation polynomial to generate the path-level commitment value of the path, and write the path-level commitment value into the path commitment record; After all path-level commitment values are generated, all path-level commitment values are written into the root commitment input sequence in the order of path number to generate the root commitment value. The root commitment value is then written into the root node of the Verkle tree to serve as the root commitment of the current Verkle tree structure.
6. The method for safe monitoring of organic tea quality data according to claim 2, characterized in that, The process of combining the root commitment with the timestamp to form a root commitment snapshot and storing the root commitment snapshot includes: after obtaining the current root commitment at the root node, reading the system time to generate a timestamp, encoding the timestamp into a fixed-length time stamp byte sequence according to the year, month, day, hour, minute, and second fields, serializing the root commitment into a fixed-length root commitment byte sequence according to its output encoding rules, concatenating the timestamp byte sequence and the root commitment byte sequence in a fixed order to form a root commitment snapshot record, writing the starting storage position and length of the snapshot record into the snapshot index record, appending the snapshot record to the snapshot storage area in the writing order, and synchronously writing the snapshot index record to the index storage area.
7. The method for safe monitoring of organic tea quality data according to claim 2, characterized in that, Generating incremental consistency proofs includes: Construct a path segment sequence based on the deterministic key field, parse the path structure segment by segment according to the field order, and locate each level index node and the final leaf node in the Verkle tree structure corresponding to the target root commitment, starting from the root node and following the path segment sequence order. During the path localization process, the slot number, child node commitment value, interpolation polynomial coefficients, and corresponding KZG vector commitment of each index node are recorded and assembled into structured path proof data. At the end of the path, the data record and field summary corresponding to the deterministic key are read from the leaf node and written to the end of the path existence proof to form a complete existence proof record. Starting from the root node, compare the slot values level by level down along the overlapping paths in both versions, and perform the following operations for each index node: parse all slot numbers and corresponding child nodes of the current node; Compare the identifiers or commitment values of two version child nodes with the same slot number. If they match, skip the current slot. If there is a discrepancy, record the slot number and add the path under that slot to the structural difference path table; For each path in the structural difference path table, read all its index nodes and leaf nodes in the two versions, generate a difference path mapping table, and record the identifier, parent node number, and slot number in the parent node for each node according to the path hierarchy. Based on the difference path mapping table, in each difference path, the changed nodes are extracted by tracing back from the leaf node to the top level, and the parent-child structure information of all newly added nodes and replaced nodes on the path is assembled into a structure evolution sequence. After comparing each pair of adjacent nodes in the structural evolution sequence, the commitment value of the newly added child node and its original commitment value in the first version are extracted and combined into a differential commitment input group. For each difference commitment input group, consistency verification information is generated, specifically including: Construct interpolation pairs with the slot number before the change as the horizontal axis and the independent variable, and the previous and subsequent commitment values as the vertical axis and the dependent variable. Construct an interpolation polynomial and extract its coefficient sequence; A KZG vector commitment is generated based on the coefficient sequence, serving as a consistency proof fragment for the differential slot; All structural evolution sequences of the different paths, different slot numbers and their corresponding consistency proof fragments are uniformly combined into an incremental consistency proof record.
8. The method for safe monitoring of organic tea quality data according to claim 2, characterized in that, The corresponding quality data and safety monitoring results output include: Construct a path segment sequence based on the deterministic key field, and combine it with the index node slot number, interpolation coefficient sequence, and KZG vector commitment from the existence proof, then perform the following verification process: Traverse the path structure from the root node to the leaf node in sequence; At each index node, the interpolation polynomial of the corresponding slot is reconstructed using the slot number and the interpolation coefficient sequence; Consistency verification is performed using the interpolation polynomial and vector commitment value of the corresponding slot to confirm the mathematical matching relationship between the slot input value and the node commitment; At the leaf node, extract the field summary to determine whether the deterministic key matches the target record, and verify that the set of deterministic key fields bound in the leaf node is consistent with the target key fields; If the commitment verification of all path nodes is successful, and the key value bound to the leaf node is consistent with the input deterministic key, then the existence proof is deemed valid, and the first-stage verification result is output as "record exists". The incremental consistency proof structure is parsed, and the structural evolution sequence, difference slot numbers, and corresponding consistency proof fragments are extracted. The legality of the structural evolution of each slot is verified according to the following process: The interpolation function is reconstructed by taking the previous and subsequent version commitment values of each difference slot as input and combining them with the interpolation polynomial coefficients. Consistency verification was performed using the reconstructed interpolation function and the KZG commitment value; If the function value at the slot number is consistent with the difference between the two version commitments, then the slot change is confirmed to be a one-way append; The results of all differential slot verifications are statistically analyzed. If all consistency verifications pass, the incremental evolution verification is successful, and the second-stage verification result is output as "structure not rolled back". Based on the joint judgment of the verification results of the first and second phases: if the record exists and the structure has not been rolled back, the output quality data security monitoring result is "data is true and complete"; if the record is missing or the structure has been rolled back, the output quality data security monitoring result is "data is unreliable" and the abnormal path and node are marked.