A Blockchain-Based Approach to Commodity Data Governance
By leveraging blockchain technology, standardized processing, encrypted storage, and traceability management of cross-border e-commerce cloud warehousing commodity data are achieved, solving the problems of inconsistent data formats and traceability, realizing data integrity and reliability management, and enhancing the value of data assets.
Patent Information
- Application Number
- CN202411968155.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2044-12-30
AI Technical Summary
Cross-border e-commerce cloud warehousing faces challenges in product data management, such as the standardization of product attribute data, inconsistent data formats, and difficulties in collecting and verifying traceability data, which makes it difficult to guarantee data consistency and availability.
By adopting a blockchain-based commodity data governance approach, and by establishing a standardized mapping table of commodity attributes, a distributed ledger storage architecture, and smart contracts, we can achieve standardized data processing, encrypted storage, consensus verification, and traceability management, thereby constructing a data quality governance mechanism to ensure the integrity and reliability of the data.
It enables standardized management, secure storage, reliable traceability, and dynamic updates of commodity data, enhancing the value of data assets and ensuring the authenticity and reliability of data throughout its entire lifecycle.
Smart Images

Figure CN119848139B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information technology, and in particular to a blockchain-based method for governing commodity data. Background Technology
[0002] Cross-border e-commerce cloud warehousing faces numerous technical challenges in product data management. The first is the standardization of product attribute data. Due to the wide variety of products and their varying attributes, data fields and formats are difficult to unify. How to balance data integrity with system flexibility and scalability is a pressing technical challenge. This requires that the database table structure be designed to comprehensively cover the key attributes of various products while also reserving sufficient custom fields to meet the input needs of special products.
[0003] Simultaneously, it is necessary to formulate corresponding conversion rules and processing logic for data of different formats in the data input, storage, and retrieval stages to ensure data consistency and usability. Secondly, the collection and management of product traceability data also faces numerous challenges. Cross-border e-commerce involves complex supply chain networks, making the acquisition and verification of key traceability data such as product origin, supplier information, and transportation methods difficult.
[0004] Therefore, it is necessary to establish a data connection mechanism with various channels and suppliers. However, due to the inconsistent data formats provided by various parties, efficiently and accurately completing the data collection, cleaning, transformation, and storage is a technical challenge. Furthermore, a rigorous data verification mechanism is needed to conduct multi-dimensional cross-validation of the collected traceability data to ensure its authenticity and reliability. Simultaneously, a unique traceability identification code should be generated for each product to establish a mapping relationship between the product and its origin information, providing support for subsequent traceability queries and management. Summary of the Invention
[0005] This invention provides a blockchain-based method for governing commodity data, mainly comprising:
[0006] The process involves: acquiring product attribute data; standardizing the product attribute data according to a pre-established standardized product attribute mapping table to obtain standardized product attribute data; writing the standardized product attribute data into a target data shard of a distributed ledger storage architecture according to preset data routing rules, and indexing it using a Merkle tree data structure; verifying the legality and integrity of the data writing operation through a smart contract automation mechanism to generate data index information; sending the product source attribute data to the blockchain network, verifying it according to a preset consensus algorithm, generating a transaction ID as a traceability identification code, and binding and storing the transaction ID with the corresponding attribute data; and then, based on the product attributes... The system uses a product attribute identification code and block hash value to determine data integrity and immutability, obtains traceability rules from smart contracts, assesses data security, and automates the traceability process. When product data standards change, a data standard mapping table identifies the differences between the old and new standards, automatically generates data conversion rules based on these differences, converts historical product attribute data according to the new standards, and synchronizes the newly added and changed product attribute data to the on-chain block. A blockchain-based product data quality governance mechanism is constructed, using smart contract rules to perform compliance checks on data entry and modification operations, and utilizing a consensus mechanism to verify the integrity and accuracy of product attribute data from multiple parties.
[0007] Furthermore, the step of acquiring product attribute data and standardizing the product attribute data according to a pre-established standardized product attribute mapping table to obtain standardized product attribute data includes: acquiring product attribute data; determining whether the attribute value is a standard attribute value according to the standardized product attribute mapping table; if the attribute value is not a standard attribute value, mapping the non-standard attribute value to a standard attribute value according to the mapping table; filling missing values using a preset missing value filling rule; splitting multi-value attributes using a preset multi-value attribute splitting rule; and flattening hierarchical attributes; merging the standardized, filled, split, and flattened attribute data; aggregating values of the same attribute to obtain merged standardized product attribute data; and segmenting the standardized product attribute data to extract keywords for attribute names and attribute values, using the extracted keywords as product attribute feature vectors.
[0008] Furthermore, the step of sending the product source attribute data to the blockchain network, verifying it according to a preset consensus algorithm, generating a transaction ID as a traceability identification code, and binding and storing the transaction ID with the corresponding attribute data includes: obtaining the source attribute data when the product enters the warehouse; using a pre-stored public key to verify the identity of the data source through an asymmetric encryption algorithm; if the identity verification is successful, encrypting the sensitive attributes using a symmetric encryption algorithm key to obtain encrypted sensitive attribute data; obtaining the current timestamp, binding the encrypted sensitive attribute data with the current timestamp to obtain a product source attribute data packet; sending the product source attribute data packet to the blockchain network to trigger the consensus verification process; after receiving the product source attribute data packet, the nodes in the blockchain network vote according to preset consensus rules and determine whether the product source attribute data packet passes the consensus verification.
[0009] Furthermore, the process of determining data integrity and immutability based on product attributes and transaction identification codes using block hash values, obtaining traceability rules from smart contracts, assessing data security, and achieving an automated traceability process includes: obtaining product attributes and transaction identification codes; calculating block hash values using a specific algorithm; storing the block hash values in the blockchain; generating public and private key pairs using an encryption algorithm for asymmetric encryption; storing the encrypted data in the blockchain; assigning corresponding data access permissions to different roles to achieve fine-grained permission management; embedding traceability rules into the blockchain using smart contract technology, defining the conditions and execution logic of the traceability rules, and deploying the smart contracts to the blockchain network; obtaining the traceability rules defined in the smart contracts, combining the data security assessment results, and using a specific library to interact with the smart contracts to dynamically adjust the traceability process.
[0010] Furthermore, when the product data standard changes, the differences between the old and new data standards are identified through a data standard mapping table. Data conversion rules are automatically generated based on these differences to convert historical product attribute data according to the new standard. The newly added and changed product attribute data are then synchronized to the on-chain block. This process includes: obtaining product data standard change information; identifying newly added, modified, and deleted attribute fields by comparing and analyzing the differences between the old and new data standards; converting historical product attribute data into an attribute data format conforming to the new standard using predefined data conversion rules based on the changes in the attribute fields; matching the converted product attribute data with the on-chain data according to the product ID to identify newly added and changed product attribute data; synchronizing the newly added product attribute data to the on-chain block; deleting the old attribute data corresponding to the changed product attribute data from the on-chain block; and then writing the updated new attribute data to the on-chain block.
[0011] Furthermore, the construction of a blockchain-based commodity data quality governance mechanism involves using smart contract rules to perform compliance checks on data entry and modification operations, and utilizing a consensus mechanism to verify the completeness and accuracy of commodity attribute data from multiple parties. This includes: deploying a consortium blockchain architecture employing a practical Byzantine fault-tolerant consensus mechanism to determine the consistency and credibility of data on the consortium blockchain; converting preset data specifications into compliance check rules in smart contracts and deploying the smart contracts to the consortium blockchain network; acquiring commodity data and uploading it to the consortium blockchain network; triggering the smart contract to perform compliance checks on the commodity data and obtaining the compliance check results; and if the compliance check results are compliant, storing the commodity data on the consortium blockchain and determining the authenticity and reliability of the commodity data throughout its entire lifecycle.
[0012] Furthermore, the method also includes: acquiring data assets, which include metadata and raw data; writing the metadata into a smart contract and deploying it to the blockchain; modeling the raw data using a federated learning algorithm to obtain model parameters; writing the model parameters into the smart contract; regulating and auditing the data collection, storage, sharing, and usage processes through the smart contract; generating a zero-knowledge proof of the raw data using zero-knowledge proof technology; writing the zero-knowledge proof into the smart contract; and verifying the zero-knowledge proof to prove the authenticity and integrity of the raw data without providing the raw data itself.
[0013] The technical solutions provided by the embodiments of the present invention may include the following beneficial effects:
[0014] This invention discloses a blockchain-based method for managing the entire lifecycle of commodity data. The method standardizes commodity attribute data by establishing a standardized mapping table; it automatically routes and stores standardized data using a distributed ledger storage architecture and smart contracts; upon commodity entry into the warehouse, it retrieves and encrypts the commodity origin attribute from a trusted data source; it verifies the commodity origin data using a blockchain consensus mechanism, generating a unique traceability identifier; it automatically converts historical data when data standards change; it constructs a blockchain-based data quality governance mechanism to perform compliance checks and multi-party verification of data; and it formulates a comprehensive data governance strategy to regulate behavior at each stage. This invention achieves standardized management, secure storage, trusted traceability, dynamic updates, and quality governance of commodity data, providing a complete solution for managing commodity data throughout its lifecycle and effectively enhancing the value of data assets. Attached Figure Description
[0015] Figure 1This is a flowchart of a blockchain-based commodity data governance method according to the present invention. Detailed Implementation
[0016] To further understand the content of this invention, a detailed description of the invention is provided in conjunction with the accompanying drawings and embodiments. The specific embodiments described herein are for illustrative purposes only and are not intended to limit the invention. It should also be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.
[0017] like Figure 1 This embodiment of a blockchain-based commodity data governance method may specifically include:
[0018] S101. Obtain product attribute data. Based on the pre-established standardized mapping table for product attributes, standardize the product attribute data, map non-standardized attribute values to standardized attribute values, fill missing values using a preset missing value filling rule, split multi-value attributes using a preset multi-value attribute splitting rule, and flatten hierarchical attributes to obtain standardized product attribute data.
[0019] Product attribute data is acquired and standardized according to a pre-established standardized mapping table, mapping non-standardized attribute values to standardized ones. For missing values, a preset missing value filling rule is used; if an attribute value is empty, a default value or the most common value is filled according to the filling rule. For multi-valued attributes, a preset multi-valued attribute splitting rule is used to split multiple attribute values according to a preset separator, resulting in a single attribute value. For hierarchical attributes, a flattening process is applied, converting the hierarchical attribute structure into a flat attribute structure and generating new attribute names according to preset naming rules. The standardized, filled, split, and flattened attribute data are merged; values with the same attribute are aggregated through attribute name matching to obtain merged standardized product attribute data. The standardized product attribute data is then segmented, extracting keywords from attribute names and values. A preset segmentation algorithm and dictionary are used to divide the attribute data into keyword sequences. The extracted keywords are used as product attribute feature vectors, and the keyword sequences are converted into numerical feature vectors according to preset vectorization rules. Based on the product attribute feature vectors, a clustering algorithm is used to cluster the products. By calculating the attribute similarity between products, products with similar attributes are grouped into the same category. Based on the clustering results, standardized classification results are obtained and written into the product attribute database, establishing a mapping relationship with the original product attribute data for subsequent data querying and analysis.
[0020] Specifically, for the product attribute "color," non-standard values such as "red," "bright red," and "burgundy" are mapped to the standard value "red." For missing brand attributes, the most common "other" value is filled in. The multi-value attribute "applicable scenarios" values "daily," "sports," and "commuting" are split by commas into "daily," "sports," and "commuting." The hierarchical attribute "fabric" is flattened, with "fabric-material-cotton" converted to "fabric material" and "cotton." The values of the attributes with the same name, "launch time" and "listing time," are merged. Keywords for "brand" and "model" are extracted using Jieba word segmentation. Keywords are converted into product feature vectors using the TF-IDF algorithm. The K-means clustering algorithm is used to calculate attribute similarity using cosine similarity to cluster the products. Based on the clustering results, the products are classified and written into a product category set in the MongoDB database, recording the mapping relationship between product IDs and category IDs.
[0021] S102. By analyzing the common attribute values of the product category, determine the appropriate fill values and obtain the filled attribute data.
[0022] The process begins by acquiring product attribute data and determining whether the attribute values are standard attribute values based on a pre-defined standardized product attribute mapping table. If the attribute value is not a standard attribute value, it is mapped to a standard attribute value according to the mapping table, resulting in standardized attribute data. Common attribute values of the product's category are analyzed to determine appropriate filler values, resulting in filled attribute data. The standardized and filled attribute data is then split and flattened, separating the attribute data into attribute names and attribute values, and flattening the attribute values into individual values, resulting in split and flattened attribute data. The split and flattened attribute data is then merged, aggregating values with the same attribute through attribute name matching, resulting in merged standardized product attribute data. The merged standardized product attribute data is then segmented, extracting keywords from attribute names and attribute values, and using these extracted keywords as product attribute feature vectors. Based on the product attribute feature vectors, a clustering algorithm is used to cluster the products, grouping products with similar attributes into the same category, resulting in standardized product classification results. Based on product attributes and transaction identification codes, data integrity and immutability are determined using block hash values. Data encryption and role-based access control are employed to access traceability rules within the smart contract and assess data security. Based on the data security assessment results, the corresponding traceability process is automatically triggered, yielding automated traceability results and ensuring the reliability and traceability of product attribute data.
[0023] Specifically, the process begins by acquiring product attribute data, such as "Brand: Apple, Model: iPhone 12, Color: Black," etc. Then, it uses a pre-defined mapping table to determine if the attribute values are standard; for example, "Black" is mapped to the standard value "Obsidian Black." For missing attributes, it analyzes common attribute values of similar products, such as "Memory: 64GB, 256GB, 512GB," and selects appropriate values like "128GB" to fill the gaps. Next, the attribute data is split and flattened. "Color: Obsidian Black" is split into "Color" and "Obsidian Black," and "Obsidian Black" is flattened into a single value. Then, by matching attribute names, values with the same attribute are aggregated; for example, the "Color" attribute of multiple products is aggregated into "Obsidian Black, Silver White, Gold." The aggregated attribute data is then segmented into words, keywords are extracted as feature vectors, and K-means clustering is used to cluster the products, classifying them into different categories based on attribute similarity. Finally, the hash values of product attributes and transaction identification codes are calculated using the SHA-256 algorithm. Blockchain technology ensures data integrity, while AES encryption and role-based access control ensure data security. Based on pre-defined traceability rules in the smart contract, such as "triggering a data audit process when data integrity verification fails," the traceability of product attribute data is automatically executed, ensuring data trustworthiness and traceability.
[0024] S103. For the standardized product attribute data, a distributed ledger storage architecture and smart contract automation mechanism are adopted. According to the preset data routing rules, the standardized product attribute data of different types and sources are automatically routed to the corresponding data shards for storage, and the data of each shard is indexed by the Merkle tree data structure.
[0025] The process involves acquiring product attribute data, standardizing it according to preset standardization rules to obtain standardized product attribute data, determining the type and source of the standardized product attribute data based on preset data routing rules, and identifying its corresponding target data shard, writing the standardized product attribute data into the target data shard, and storing it through a distributed ledger storage architecture, verifying the legality and integrity of the write operation using a smart contract automation mechanism, and generating data index information using a Merkle tree data structure, writing the data index information into a dedicated index shard of the distributed ledger, and establishing a mapping relationship with the corresponding data shard, and retrieving the specific standardized product attribute data from the corresponding data shard by using the index information in the index shard during data querying.
[0026] Specifically, product attribute data is standardized according to product attribute standards to obtain standardized product attribute data. Using preset data routing rules, the target data shard is determined based on the type and source of the standardized product attribute data. The standardized product attribute data is written to the corresponding target data shard and stored using a distributed ledger storage architecture. During the data writing process, a smart contract automation mechanism verifies the legality and integrity of the write operation, ensuring the correctness and consistency of the data. The standardized product attribute data written to each data shard is indexed using a Merkle tree data structure to generate data index information. This generated data index information is written to a dedicated index shard in the distributed ledger, establishing a mapping relationship with the corresponding data shard. When querying data, the target data shard is first located using the index information in the index shard, and then the specific standardized product attribute data is retrieved from the corresponding data shard, thereby improving data query efficiency. During the data standardization process, regular expressions or string matching can be used to transform and normalize the original product attribute data according to preset standardization rules. For data routing decisions, logical structures such as conditional statements or decision trees can be used to classify and route data based on characteristics such as data type and source. In smart contracts, predefined rules and conditions, such as data format and value range, can be used to automatically validate written data, ensuring its compliance and integrity.
[0027] Standardizing product attribute data is fundamental to e-commerce systems. Taking clothing as an example, the size attribute in the raw data may contain various expressions, such as "extra-large," "plus-size," and "loose-fitting," which need to be uniformly mapped to the standard size system "extra-large." This standardization not only facilitates data management but also improves the user search experience. The design of data routing rules needs to consider data characteristics and business scenarios. Taking home appliances as an example, routing can be segmented based on price range and sales region. For instance, in the refrigerator category, data for high-end products priced above 10,000 yuan can be routed to a dedicated high-end home appliance segment, facilitating differentiated operations and precise marketing. Distributed ledger storage architecture ensures data reliability and consistency. Taking mobile phones as an example, when a new mobile phone product is added, its attribute data is synchronously written to multiple storage nodes. Through smart contract mechanisms, the system automatically verifies the rationality of product parameters, such as ensuring the screen size is positive and within a reasonable range, and that the processor model is within a preset valid list. Using Merkle trees for the data index structure can improve query efficiency. Taking books as an example, the system constructs a tree index from attributes such as author, publisher, and publication year. When a user searches for books from a specific publisher, the system first locates the corresponding data shard through the index, and then retrieves the specific book information, significantly reducing data retrieval time. The formulation of data verification rules needs to be combined with actual business scenarios. Taking cosmetics as an example, the shelf-life attribute of the product must comply with industry standards; for example, the shelf life of face masks cannot exceed three years. The system automatically verifies these rules through smart contracts to ensure data compliance. The design of the distributed storage architecture must consider data access characteristics. Taking footwear as an example, the attribute data of best-selling products is stored on high-performance storage nodes, while clearance sale products are stored on ordinary nodes, achieving a reasonable allocation of storage resources. This differentiated storage strategy ensures system performance while saving storage costs. The design of index shards needs to balance query efficiency and storage overhead. Taking jewelry as an example, the system creates dedicated indexes for high-frequency query attributes such as price, material, and brand, while using simplified indexes for low-frequency query attributes such as packaging specifications and care instructions, ensuring the response speed of frequently used queries while controlling index storage space.
[0028] S104. When goods are put into storage, according to the preset rules for collecting the source attributes of goods, the source attributes of goods are obtained from trusted data sources through a digital signature authentication mechanism, and sensitive attributes are encrypted using an asymmetric encryption algorithm. The data collection time is recorded through a timestamp recording mechanism, and the encrypted source attributes of goods are bound to the timestamp and stored in the blockchain network.
[0029] According to preset product source attribute collection rules, the source attribute data of the product upon entry into the warehouse is obtained. For the source attribute data, the identity of the data source is verified using a pre-stored public key and an RSA asymmetric encryption algorithm. If the identity verification is successful, the AES symmetric encryption algorithm key is obtained from a preset key library, and the sensitive attributes are encrypted using the key to obtain encrypted sensitive attribute data. The current timestamp is obtained, and the encrypted sensitive attribute data is bound to the current timestamp to obtain a product source attribute data packet. The product source attribute data packet is sent to a blockchain network based on the PBFT protocol to trigger a consensus verification process. After receiving the product source attribute data packet, each node in the blockchain network votes according to preset consensus rules and determines whether the product source attribute data packet passes consensus verification. If the consensus verification passes, the product source attribute data packet is written into the blockchain's distributed ledger, and the distributed ledger is synchronously updated among the nodes using a P2P protocol.
[0030] Specifically, based on the product origin attribute collection rules, the origin attribute data of the product upon entry into the warehouse is obtained. A digital signature authentication mechanism and the RSA algorithm are used to verify the identity of the data source, ensuring that the data originates from a trusted source. If the identity verification is successful, sensitive attributes are encrypted using the AES symmetric encryption algorithm and bound to the current timestamp, forming a complete product origin attribute data packet. This data packet is verified through a PBFT-based blockchain network consensus mechanism. Each node reaches a consensus through voting, ensuring the authenticity and immutability of the data. After consensus is reached, the data packet is stored in the blockchain's distributed ledger. The ledger is synchronously updated across all nodes, achieving permanent data storage and traceable querying. The blockchain network adopts a consortium blockchain architecture, with nodes deployed by multiple trusted institutions and communicating via a P2P protocol, ensuring network security and reliability.
[0031] The rules for collecting product origin attributes are fundamental to ensuring data authenticity. Taking food as an example, the system needs to collect key attributes such as supplier qualifications, production date, and place of origin. For dried fruit and snacks, it needs to collect origin certificates, import licenses, and other source documents; this data will serve as important evidence for product traceability. Digital signature authentication ensures the credibility of data sources. The system verifies signatures using the supplier's public key to confirm that the data indeed comes from a registered supplier. Sensitive attribute encryption protects data security. Taking cosmetics as an example, confidential information such as the formula and manufacturing process needs to be stored encrypted. The system uses a symmetric encryption algorithm to encrypt this data, and the key is securely managed by an authorized institution. For example, the manufacturing process of a newly developed drug is encrypted, and only authorized institutions can view the original information. Blockchain consensus mechanisms ensure data immutability. Taking luxury goods as an example, when a luxury watch enters the warehouse, its authenticity certificate, sales authorization, and other information need to be verified by multiple nodes. For example, the authorization certificate data for a certain brand of watch needs confirmation from the brand owner, authorized distributor, quality inspection agency, and other parties before it can be stored on the blockchain. Distributed ledgers enable permanent data storage. Taking jewelry as an example, once the attribute data of a diamond, such as its certificate of origin and cut parameters, is stored in the blockchain, it will be synchronized across all nodes, forming a complete traceability chain. For instance, parameters such as the clarity and weight of a diamond ring can be traced back to its origin and distribution process through the blockchain ledger. The consortium blockchain architecture ensures network security and reliability. Taking alcoholic beverages as another example, the blockchain network is jointly maintained by brand owners, distributors, logistics providers, and other institutions. Each node maintains data synchronization through peer-to-peer communication protocols, jointly witnessing the circulation process of the goods. For example, the entire information of a bottle of cosmetics from its place of origin to the sales terminal is jointly recorded and verified by all nodes in the consortium blockchain.
[0032] S105. For product source attribute data, the consensus verification mechanism of blockchain is used to verify and confirm the product source attribute data by blockchain nodes, generate a unique blockchain transaction ID as the traceability identification code of the data, and bind and store the transaction ID with the corresponding attribute data.
[0033] The process involves acquiring product origin attribute data, preprocessing the attribute data to extract key field information, and converting it into a data format supported by the blockchain network. The preprocessed attribute data is then sent to the blockchain network, where blockchain nodes verify and confirm the received attribute data according to a preset consensus algorithm. If the attribute data passes verification, it is packaged into a block, and a unique block hash value is generated for that block. The transaction ID corresponding to the attribute data in the block is extracted and used as the traceability identification code for the attribute data. An index is established between product IDs and transaction IDs. When product traceability is required, the corresponding transaction ID is queried based on the product ID, and then relevant attribute data is retrieved on the blockchain using the transaction ID, thus achieving reliable traceability of the product's origin.
[0034] Specifically, the process involves acquiring product origin attribute data, preprocessing the attribute data to extract key field information, and converting it into a data format supported by the blockchain network. The preprocessed attribute data is then sent to the blockchain network via a secure and reliable data transmission channel. Blockchain nodes verify and confirm the received attribute data according to a preset consensus algorithm, then package the attribute data into a block and generate a unique block hash value for that block. A dedicated field is set in the block data structure to store the correspondence between product attribute data and transaction IDs. The transaction ID corresponding to the attribute data in the block is extracted and used as the traceability identification code for the attribute data. A product attribute data table is created in the database. The table includes fields such as product ID, attribute fields, transaction ID, timestamp, and data hash value. Product attribute data is serialized and bound to the corresponding transaction ID, stored in the table using hash pointers to establish a data association. Cryptographic techniques are introduced to encrypt sensitive data and a role-based access control mechanism is implemented. An index is created for product IDs and transaction IDs to improve data query efficiency. When product traceability is required, the corresponding transaction ID is quickly retrieved from the index based on the product ID, and then the relevant attribute data is retrieved on the blockchain using the transaction ID, achieving reliable traceability of the product's origin.
[0035] Preprocessing product origin attribute data is a crucial step in ensuring data quality. Taking food traceability as an example, unstructured data such as certificates of origin and inspection reports need to be converted into standardized formats. For instance, origin information is standardized into a hierarchical structure of "province-city-district / county," and key indicator values are extracted from inspection reports and standardized in units. The security of data transmission channels directly affects the credibility of traceability information. Taking the cosmetics supply chain as an example, cosmetics manufacturers transmit production batch information through dedicated encrypted channels. Transport layer security protocols are used to ensure that data is not stolen or tampered with during transmission. Sensitive information such as the production date and expiration date of a batch of cosmetics must be encrypted before being sent to the blockchain network. Consensus algorithms are the core mechanism for ensuring data consistency. Taking dried fruit traceability as an example, origin certification information needs to be verified by multiple regulatory nodes. For example, the origin certificate of a batch of dried fruit requires consensus from authoritative nodes such as agricultural departments and quality inspection agencies to confirm the validity of the data. The design of the blockchain data structure is related to traceability efficiency. Taking luxury goods traceability as an example, a unique identifier for each product is linked to a blockchain transaction. For example, the serial number of a luxury watch can be linked to a transaction number in the blockchain, allowing for quick location of product information via the transaction number. Database table structures must balance query efficiency and security. Taking imported goods traceability as an example, multi-level indexes are used to improve query performance. For instance, indexes can be created based on multiple dimensions such as product category, country of origin, and import date to quickly locate the traceability information of the target product. Cryptographic technology plays a crucial role in data protection. For jewelry traceability, core information such as diamond cutting parameters and authenticity certificates must be encrypted and stored. Asymmetric encryption algorithms are used to ensure that only authorized users can decrypt and view the original data. Smart contracts automate the traceability process. For example, for beverage products, time- and role-based access rules are set. For instance, beverage production information is only accessible to specific users during specific time periods; access is blocked after the expiration date or if permissions are insufficient. By automatically executing these rules through smart contracts, both data security and traceability efficiency are ensured.
[0036] S106. Based on the product attributes and transaction identification code, determine the data integrity and immutability through the block hash value, use data encryption and role-based access control to obtain the traceability rules in the smart contract, judge the data security, and obtain an automated traceability process.
[0037] Obtain the product attributes and transaction identification code, calculate the block hash value using the SHA-256 algorithm, and store the block hash value in the blockchain. The formula is as follows:
[0038]
[0039] H(B) represents the block hash value, prev_hash represents the hash value of the previous block, timestamp represents the timestamp, nonce represents the random number, and data represents the block data.
[0040] The RSA algorithm is used to generate public and private key pairs for asymmetric encryption. The encrypted data is stored in the blockchain, and corresponding data access permissions are assigned to different roles to achieve fine-grained permission management. Through smart contract technology, traceability rules are embedded into the blockchain. Smart contracts are written in Solidity to define the conditions and execution logic of the traceability rules, and are deployed to the blockchain network. The traceability rules defined in the smart contract are obtained, and combined with the data security judgment results, the Web3js library is used to interact with the smart contract to dynamically adjust the traceability process. The product attributes and transaction identification codes are used as a transaction dataset, and the Apriori algorithm is used to generate frequent itemsets and association rules, with the following formula:
[0041]
[0042] Supp(X) represents the support, X represents the set of product attributes, T represents the entire transaction dataset, and t represents a single transaction. The numerator represents the number of transactions containing the attribute set X, and the denominator represents the total number of transactions. Abnormal transaction patterns are identified based on the support and confidence of the association rules. If the data security assessment indicates a risk of data tampering, an early warning mechanism is triggered, sending an early warning message via a message queue to notify relevant parties to verify and process the data. Through the distributed consensus mechanism of blockchain, using the PBFT consensus algorithm, consensus is reached in the blockchain network. Each step of the traceability process is submitted to the blockchain network as a transaction, and automatically executed after consensus verification, reducing manual intervention.
[0043] Specifically, based on product attributes and transaction identification codes, blockchain technology is used to calculate block hash values to ensure data integrity and immutability. Using product attributes and transaction identification codes as input, the SHA-256 algorithm is used to calculate the block hash value, which is then stored in the blockchain. Sensitive data is asymmetrically encrypted using the RSA algorithm to generate public and private key pairs; the public key is used to encrypt the data, and the private key is used to decrypt it. The encrypted data is stored in the blockchain to ensure confidentiality. A role-based access control mechanism is used to assign appropriate data access permissions to different roles, achieving fine-grained permission management. Smart contract technology embeds traceability rules into the blockchain. Smart contracts are written using the Solidity language to define the conditions and execution logic of the traceability rules. The smart contracts are deployed to the blockchain network to ensure the transparency and immutability of the traceability rules. The traceability rules defined in the smart contracts are retrieved, and the traceability process is dynamically adjusted based on data security assessment results. The Web.js library is used to interact with the smart contracts to obtain the conditions and execution logic of the traceability rules. Based on data security assessment results, such as data integrity verification failure or access control violations, the traceability process is dynamically adjusted, such as triggering an early warning mechanism or interrupting the traceability process. The Apriori algorithm is used to analyze the association between product attributes and transaction identifiers to identify potential abnormal transaction behaviors. Product attributes and transaction identifiers are used as a transaction dataset, and the Apriori algorithm is used to generate frequent itemsets and association rules. Based on the support and confidence of the association rules, abnormal transaction patterns, such as abnormal combinations of product attributes and transaction identifiers, are identified. If the data security assessment indicates a risk of data tampering, an early warning mechanism is triggered. A message queue (such as Kafka) is used to send an early warning message to notify relevant parties to verify and process the data. The early warning message includes detailed information about the abnormal data and suggested handling measures. The traceability process is automated through the distributed consensus mechanism of the blockchain. The PBFT (Practical Byzantine Fault Tolerance) consensus algorithm is used to reach consensus in the blockchain network, ensuring the consistency and credibility of the traceability process. Each step of the traceability process is submitted to the blockchain network in the form of a transaction, and automatically executed after consensus verification, reducing manual intervention.
[0044] Blockchain technology ensures data integrity through hash calculations. Taking food traceability as an example, the origin information, inspection reports, and other attribute data of a batch of snacks and dried fruits are hashed to generate a unique identifier. Any slight change in the data will cause a change in the hash value, effectively preventing data tampering. Data encryption is crucial for protecting sensitive information. In the cosmetics supply chain, core information such as the manufacturer's formula, process, and quality inspection data is stored using asymmetric encryption. The company holds the private key for decryption, while regulatory authorities and consumers verify the data's authenticity using the public key, protecting trade secrets and ensuring data trustworthiness. Role-based access control enables granular permission management. In luxury goods traceability, brands can view all supply chain data, retailers can only access sales-related information, and consumers can only query basic anti-counterfeiting information. Smart contracts automatically execute these permission rules, avoiding security risks caused by human intervention. Smart contracts ensure transparent execution of traceability rules. In beverage traceability, quality standards for raw material procurement, production, brewing, warehousing, and logistics are written into smart contracts. If raw material content is substandard or storage temperature is abnormal, the system automatically triggers an alert to ensure product quality. Correlation analysis helps detect abnormal transactions. Taking jewelry traceability as an example, by analyzing the correlation between diamond attributes such as origin, cut, and price and transaction records, suspicious transaction patterns can be identified. If the price of a diamond is significantly inconsistent with its quality characteristics, the system will automatically issue a warning. This warning mechanism is a crucial means of risk control. Taking imported goods traceability as an example, when inconsistencies are found between customs clearance information and the certificate of origin, the system immediately sends warnings to customs and quality inspection departments. The warning information includes specific data anomalies, facilitating timely handling by relevant departments. Distributed consensus ensures the reliable execution of the traceability process.
[0045] S107. When the commodity data standard changes, the differences between the old and new data standards are identified through the data standard mapping table. Data conversion rules are automatically generated based on the differences. The historical commodity attribute data is converted according to the new standard using the data mapping mechanism. The newly added and changed commodity attribute data are identified through the timestamp comparison mechanism and synchronized to the blockchain.
[0046] The system acquires information on changes to product data standards and identifies newly added, modified, and deleted attribute fields by comparing and analyzing the differences between the old and new data standards. Based on these changes, it uses predefined data conversion rules to convert historical product attribute data into an attribute data format conforming to the new standard. These conversion rules include field mapping, data type conversion, and default value filling. The system updates timestamp information in the converted product attribute data. It then queries existing product attribute data from on-chain blocks using a blockchain explorer or node API to extract its timestamp information. The system matches the converted product attribute data with the on-chain data according to the product ID to identify newly added and modified product attribute data. The system synchronizes the newly added product attribute data to the on-chain blocks. It deletes the old attribute data corresponding to the modified product attribute data from the on-chain blocks and writes the updated new attribute data back to the on-chain blocks. When the number of newly added or modified product attribute data reaches a preset threshold, it performs batch writing to the on-chain blocks. After synchronization, it queries the on-chain block data again to verify that the product attribute data has been written correctly.
[0047] Specifically, the process involves acquiring information on changes to product data standards, comparing the differences between the old and new standards, and identifying newly added, modified, and deleted attribute fields. Based on these changes, predefined data conversion rules are used to convert historical product attribute data into a format conforming to the new standard. These rules include field mapping, data type conversion, and default value filling. The converted product attribute data needs to have its timestamp information updated for synchronization with on-chain block data. Existing product attribute data is queried from the on-chain block using a blockchain explorer or node API to extract its timestamp information. The converted product attribute data is then matched against the on-chain data by product ID to identify newly added and modified product attribute data. Newly added product attribute data is directly synchronized to the on-chain block; for modified product attribute data, the old attribute data is first deleted from the on-chain block before the updated new attribute data is written. To ensure consistency between on-chain and off-chain data, the on-chain block data is queried again after each synchronization to verify that the product attribute data has been correctly written. Meanwhile, to avoid performance issues caused by frequent block writes, a batch synchronization threshold can be set. Batch writes will only occur when a certain number of new or changed product attribute data are added. After synchronization, the product attribute data in the on-chain block will be updated and consistent with the product attribute data in the off-chain system.
[0048] Data standard changes are a common requirement for product traceability systems. Taking food traceability as an example, the original standard only included province and city levels for place of origin information, while the new standard requires refinement to the district and county level. This necessitates the conversion of historical data; for example, the place of origin for a batch of snacks, "Hangzhou, Zhejiang," needs to be expanded to "Xihu District, Hangzhou City, Zhejiang Province," and default value filling rules need to be set to handle missing district and county information. Attribute field mapping involves adjustments to the data structure. Taking cosmetics traceability as an example, the original standard used a single date field to represent the expiration date, while the new standard uses two fields: production date and expiration date. Conversion rules need to split the original fields; for example, the expiration date for a batch of cosmetics, "December 31, 2023," needs to be split into the production date "January 1, 2023" and the expiration date "twelve months." Timestamp synchronization ensures data version consistency. Taking luxury goods traceability as an example, product information is frequently updated, requiring accurate recording of each change time. After the anti-counterfeiting code of a watch is updated, the timestamp of its attribute data will be updated to the latest operation time, facilitating version comparison with blockchain data. Data matching and comparison is a crucial step in the update process. Taking imported goods traceability as an example, hundreds of product information updates may occur daily. The system sets a threshold of fifty updates; only when the accumulated update data reaches this threshold is a block write triggered, avoiding frequent on-chain operations. Data verification ensures the accuracy of synchronization. Taking jewelry traceability as an example, after a diamond's quality parameters change, it's necessary to verify whether the on-chain data has been successfully updated. If a diamond's cut grade is upgraded from Excellent to Very Good, the update is confirmed by querying the blockchain explorer to confirm that the new data has been correctly written. Smart contracts can automate the data standard upgrade process.
[0049] S108. Construct a blockchain-based commodity data quality governance mechanism. Use smart contract rules to conduct compliance checks on data entry, modification and other operations. Use consensus mechanism to verify the integrity, accuracy and other quality indicators of commodity attribute data from multiple parties. For data that fails verification, trigger the preset smart contract rules to automatically repair or send an alarm to the administrator.
[0050] A consortium blockchain architecture is deployed with multiple business stakeholders as nodes. This architecture employs a practical Byzantine fault-tolerant consensus mechanism to determine the consistency and reliability of data on the consortium blockchain. Pre-defined data specifications are transformed into compliance check rules in smart contracts. These smart contracts are developed using a reliability language and deployed to the consortium blockchain network. Product data is acquired and uploaded to the consortium blockchain network. The smart contract is triggered to perform compliance checks on the product data, yielding a compliance check result. If the compliance check result is compliant, the product data is stored on the consortium blockchain. Based on the immutability and traceability of the consortium blockchain, the authenticity and reliability of the product data throughout its entire lifecycle are determined.
[0051] Specifically, based on the needs of commodity data quality governance, a blockchain-based data governance solution is designed. A consortium blockchain architecture is adopted, with multiple business stakeholders deployed as nodes, and the PBFT consensus mechanism ensures data consistency and credibility. For commodity attribute data, unified data entry and modification specifications are established, clearly defining data format, value range, and other requirements. These specifications are translated into compliance check rules in smart contracts, developed using the Solidity language, and deployed to the blockchain network. During data entry and modification, the smart contracts automatically perform compliance checks, verifying data integrity and format correctness. For data that does not conform to the specifications, the smart contract refuses to write it to the blockchain and returns an error message to the data submitter, prompting them to correct it. Through the blockchain's multi-party verification mechanism, multiple nodes review and confirm the commodity attribute data. The specific process is as follows: the data submitter sends data to the blockchain network, multiple nodes verify the data, and check the accuracy and compliance of the data through smart contract rules. For data that passes verification, the nodes reach a consensus and write the data to the blockchain; for data that fails verification, the nodes refuse to write it to the blockchain and trigger the preset smart contract rules for processing. For data that fails verification, the smart contract first attempts to automatically repair or convert the data format, standardizing it according to preset rules, such as removing illegal characters and filling in missing values. If the automatic repair is successful, the repaired data is resubmitted to the blockchain network for verification; if the automatic repair fails, the smart contract sends a data quality alarm to the data administrator, prompting manual intervention to ensure that problematic data is corrected in a timely manner. The immutability and traceability of the blockchain ensure the authenticity and reliability of product data throughout its entire lifecycle. By recording every data operation on the blockchain, including data entry, modification, and verification, traceable management of the entire data lifecycle is achieved. Once a data quality problem is discovered, the time of the problem and the operator can be quickly located, providing a basis for data governance and continuously optimizing the data governance process. The consortium blockchain architecture is the foundation of product data governance. Taking food traceability as an example, multiple parties, including manufacturers, logistics providers, and retailers, participate, with each participant acting as a blockchain node to jointly maintain the authenticity of the data. Data standardization and smart contract checks are the core of data governance. Taking cosmetic traceability as an example, smart contracts stipulate that drug names must use standard generic names, production dates must be in the format of "year, month, day," and the expiration date must be later than the current date. When a batch of cosmetics submits data, the smart contract automatically checks whether its generic name conforms to the standard, whether the production date is filled in according to the prescribed format, and whether the expiration date is within a reasonable range. Multi-party verification mechanisms ensure data credibility. Taking snack and dried fruit traceability as an example, origin certification requires joint confirmation from multiple institutions such as agricultural departments, quality inspection agencies, and industry associations.During the origin certification process of a batch of dried fruits, the agricultural department confirms the qualifications of the planting base, the quality inspection agency verifies the pesticide residue test report, and the industry association verifies the planting records. Only after the three parties reach an agreement can the data be uploaded to the blockchain. The data repair rules ensure data quality. Taking clothing traceability as an example, smart contracts set automatic repair rules to handle common data problems. For a certain brand of clothing, the size information contains the illegal character "L", and the system automatically converts it to the standard format "Large"; the fabric composition is missing the unit "%", and the system automatically completes it; the origin information mixes upper and lower case "HangZhou", and the system automatically unifies it to the Chinese "Hangzhou". Data traceability supports quality management. Taking beverage traceability as an example, the system records the detailed information of each data change. Through the blockchain, the time, operator, and reason for each change can be queried. It is found that there are manual errors when the data is initially entered, and the data entry process is corrected and optimized in a timely manner. The data governance effect is continuously optimized.
[0052] S109. Develop a blockchain-based global data governance strategy for commodities, encapsulate governance rules such as commodity data standards, data permissions, and data usage methods into smart contracts, and use the immutability and traceability of the blockchain to regulate and audit the behaviors of each business entity in all aspects such as data collection, storage, sharing, and usage. Build a decentralized data asset trading platform based on the blockchain to achieve the confirmation of rights, pricing, trading, and profit sharing of commodity data assets.
[0053] Obtain data assets, where the data assets include metadata and raw data; for the metadata, write it into a smart contract and deploy it to the blockchain; for the raw data, use a federated learning algorithm to model it to obtain model parameters; write the model parameters into the smart contract; through the smart contract, regulate and audit the behaviors in the aspects of data collection, storage, sharing, and usage; use zero-knowledge proof technology to generate a zero-knowledge proof of the raw data; write the zero-knowledge proof into the smart contract; by verifying the zero-knowledge proof, prove the authenticity and integrity of the raw data without providing the raw data; use a homomorphic encryption algorithm to encrypt the raw data to obtain encrypted data; provide the encrypted data to the data user; the data user can perform aggregation queries and statistical analysis operations on the encrypted data without decrypting; according to the metadata and the model parameters, achieve the confirmation of rights, pricing, trading, and profit sharing of data assets through the smart contract.
[0054] Specifically, leveraging the immutability and traceability of blockchain, smart contracts are designed to encapsulate governance rules such as data standards, permissions, and usage rules. These smart contracts regulate and audit the processes of data collection, storage, sharing, and use, ensuring that all business entities adhere to data governance rules. Under the guidance of smart contracts, federated learning algorithms such as FedAvg are employed to achieve multi-party data fusion and modeling while protecting data privacy, thereby enhancing data value. Each party participates in federated modeling with its local data according to the smart contract rules. After local training, the model only exchanges model parameters without disclosing the original data. Based on blockchains such as Ethereum, a decentralized data asset trading platform is built, using smart contracts to realize the confirmation, pricing, trading, and profit sharing of data assets. Sellers encrypt and hash their data assets, write metadata into smart contracts, and deploy them to the blockchain. Buyers can verify the authenticity of the data and automatically settle accounts through smart contracts. During data asset transactions, zero-knowledge proof technologies such as zk-SNARK are used to prove the authenticity and integrity of data without providing the original data, protecting the privacy of both parties. The seller generates a zero-knowledge proof for the data, which the buyer can verify off-chain, completing the transaction while ensuring privacy. To protect privacy during data use, homomorphic encryption algorithms such as Paillier encryption are used to enable direct computation and analysis of encrypted data. After obtaining homomorphically encrypted data, data users can perform aggregate queries, statistical analyses, and other operations without decryption, maximizing data privacy. Blockchain notarization records and traces the entire lifecycle of data assets from collection to transaction. Uploading data hash values and timestamps to the blockchain creates a digital identity for the data asset, ensuring the data source is trustworthy. The transaction process and results are written to the blockchain for transparency, protecting the rights of all parties. Through these steps, blockchain, smart contracts, federated learning, zero-knowledge proofs, and homomorphic encryption technologies are organically combined to build a privacy-protected, trustworthy data governance and trading platform, promoting the confirmation, circulation, and value realization of data assets.
[0055] Smart contracts are fundamental to standardized data governance. Federated learning protects data privacy. Take insurance claims as an example: multiple insurance companies want to build anti-fraud models through data collaboration, but cannot directly share user data. Through federated learning, each company trains its model locally, only providing model parameters to the central node. When an insurance company discovers a suspicious claim, it can call the jointly trained model for risk assessment. Data asset trading platforms realize value realization. Take retail data as an example: large supermarkets want to sell consumer behavior data as a data product to brands. Through a blockchain platform, supermarkets hash and store anonymized data and set transaction rules in smart contracts. Brands can verify the authenticity of the data and complete payments according to the contract rules. Zero-knowledge proofs protect transaction privacy. Take credit data as an example: banks need to prove they have sufficient high-quality loan data, but cannot expose specific customer information. Banks use zero-knowledge proof technology to prove to data buyers that they have a specified amount of loan data that meets specific conditions, without providing the original data. Homomorphic encryption supports privacy-preserving computation. Take demographic data as an example: multiple cities need to aggregate and analyze population flow, but cannot share the original data. Each city encrypts its data using homomorphic encryption algorithms before submitting it. Data users can directly perform operations such as population statistics and population flow trend analysis on the encrypted data. Blockchain notarization ensures data trustworthiness. Taking intellectual property protection as an example, creators hash their work's content and write it to the blockchain, forming proof of creation time. In the event of a copyright dispute, the earliest notarized record of the work can be found on the blockchain to determine ownership. A design company, after completing a logo design, immediately records the hash value and timestamp of the design on the blockchain for subsequent rights protection.
[0056] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A blockchain-based method for governing commodity data, characterized in that, include: Obtain product attribute data, and standardize the product attribute data according to a pre-established standardized product attribute mapping table to obtain standardized product attribute data; According to the preset data routing rules, the standardized product attribute data is written into the target data shard of the distributed ledger storage architecture and indexed using a Merkle tree data structure; The legality and integrity of data writing operations are verified through the smart contract automation mechanism, and data index information is generated. The product origin attribute data is sent to the blockchain network, verified according to the preset consensus algorithm, and a transaction ID is generated as a traceability identification code. The transaction ID is then bound and stored with the corresponding attribute data. Based on product attributes and transaction identification codes, the integrity and immutability of data are determined through block hash values, the traceability rules in smart contracts are obtained, data security is assessed, and an automated traceability process is achieved. When the product data standard changes, the differences between the old and new data standards are identified through the data standard mapping table. Based on the differences, data conversion rules are automatically generated to convert the historical product attribute data according to the new standard, and the newly added and changed product attribute data are synchronized to the blockchain. Construct a blockchain-based commodity data quality governance mechanism, conduct compliance checks on data entry and modification operations through smart contract rules, and use consensus mechanisms to verify the completeness and accuracy of commodity attribute data from multiple parties; The process of acquiring product attribute data involves standardizing the product attribute data according to a pre-established standardized product attribute mapping table to obtain standardized product attribute data, including: Obtain product attribute data and determine whether the attribute value is a standard attribute value based on the standardized mapping table of product attributes; If the attribute value is not a standard attribute value, the non-standard attribute value is mapped to a standard attribute value according to the mapping table. For missing values, a preset missing value filling rule is used to fill them. For multi-valued attributes, a preset multi-valued attribute splitting rule is used to split them. For hierarchical attributes, a flattening process is used. The standardized, filled, split, and flattened attribute data are merged, and the values of the same attribute are aggregated to obtain the merged standardized product attribute data. The standardized product attribute data is segmented into words, and keywords for attribute names and attribute values are extracted. The extracted keywords are used as product attribute feature vectors.
2. The blockchain-based commodity data governance method according to claim 1, characterized in that, This also includes analyzing common attribute values of the product category to determine appropriate fill values, resulting in filled attribute data, including: Get a list of common attributes and corresponding ranges of common attribute values for the target product category; Obtain the existing attribute information of the target product; The existing attribute names of the target product are matched with the list of common attributes to obtain the missing attributes of the target product; For each missing attribute, the importance weight of the missing attribute is determined based on its frequency of occurrence among similar products; The Apriori association rule mining algorithm is used to analyze the association between different attributes of similar products and obtain association rules. Based on the existing attributes of the target product and the association rules, predict the value of the missing attributes of the target product.
3. The blockchain-based commodity data governance method according to claim 1, characterized in that, The process of sending product origin attribute data to the blockchain network, verifying it according to a preset consensus algorithm, generating a transaction ID as a traceability identification code, and binding and storing the transaction ID with the corresponding attribute data includes: Obtain the source attribute data when the goods are put into storage, and verify the identity of the data source using a pre-stored public key and an asymmetric encryption algorithm for the source attribute data; If the authentication is successful, the sensitive attributes are encrypted using the key of the symmetric encryption algorithm to obtain the encrypted sensitive attribute data. Obtain the current timestamp, bind the encrypted sensitive attribute data with the current timestamp, and obtain the product source attribute data package; The product origin attribute data packet is sent to the blockchain network to trigger the consensus verification process; After receiving the product origin attribute data packet, the nodes in the blockchain network vote according to the preset consensus rules and determine whether the product origin attribute data packet passes the consensus verification.
4. The blockchain-based commodity data governance method according to claim 1, characterized in that, The process of determining data integrity and immutability based on product attributes and transaction identification codes using block hash values, obtaining traceability rules from smart contracts, assessing data security, and deriving an automated traceability process includes: Obtain product attributes and transaction identification codes, calculate block hash values using the SHA-256 algorithm, and store the block hash values in the blockchain; A public and private key pair is generated using an encryption algorithm for asymmetric encryption, and the encrypted data is stored in the blockchain. Assign appropriate data access permissions to different roles to achieve fine-grained permission management; By using smart contract technology, traceability rules are embedded into the blockchain, defining the conditions and execution logic of the traceability rules, and deploying the smart contract onto the blockchain network; The tracing rules defined in the smart contract are obtained, and combined with the data security judgment results, the Webjs library is used to interact with the smart contract to dynamically adjust the tracing process.
5. The blockchain-based commodity data governance method according to claim 4, characterized in that, The process of obtaining product attributes and transaction identification codes, calculating block hash values using the SHA-256 algorithm, and storing the block hash values in the blockchain includes: The SHA-256 algorithm is used to calculate the block hash value, which is then stored in the blockchain. The RSA algorithm is used to generate a public key and private key pair for asymmetric encryption, and the encrypted data is stored in the blockchain. Corresponding data access permissions are assigned to different roles to achieve fine-grained permission management. By using smart contract technology, traceability rules are embedded into the blockchain. The smart contract is written in Solidity language to define the conditions and execution logic of the traceability rules, and then the smart contract is deployed to the blockchain network.
6. The blockchain-based commodity data governance method according to claim 5, characterized in that, The formula used is: H(B) represents the block hash value, prev_hash represents the hash value of the previous block, timestamp represents the timestamp, nonce represents the random number, and data represents the block data.
7. The blockchain-based commodity data governance method according to claim 1, characterized in that, When the product data standard changes, the differences between the old and new data standards are identified through a data standard mapping table. Data conversion rules are automatically generated based on these differences to convert historical product attribute data according to the new standard. The newly added and changed product attribute data are then synchronized to the on-chain block, including: Obtain information on changes to product data standards, and identify newly added, modified, and deleted attribute fields by comparing and analyzing the differences between the old and new data standards; Based on the changes in the attribute fields, predefined data conversion rules are used to convert historical product attribute data into an attribute data format that conforms to the new standard. The converted product attribute data is matched and compared with the on-chain data according to the product ID to identify newly added and changed product attribute data; The newly added product attribute data is synchronized to the on-chain block, the old attribute data corresponding to the changed product attribute data is deleted from the on-chain block, and then the updated new attribute data is written to the on-chain block.
8. The blockchain-based commodity data governance method according to claim 1, characterized in that, The aforementioned blockchain-based commodity data quality governance mechanism uses smart contract rules to conduct compliance checks on data entry and modification operations, and utilizes a consensus mechanism to perform multi-party verification of the completeness and accuracy of commodity attribute data, including: Deploy a consortium blockchain architecture, which employs a practical Byzantine fault-tolerant consensus mechanism to determine the consistency and trustworthiness of data on the consortium blockchain; The preset data specifications are transformed into compliance check rules in the smart contract, and the smart contract is deployed to the consortium blockchain network; Obtain product data and upload the product data to the consortium blockchain network; The smart contract is triggered to perform a compliance check on the product data and obtain the compliance check result of the product data; If the compliance check result is compliant, the product data will be stored in the consortium blockchain to determine the authenticity and reliability of the product data throughout its entire lifecycle.
9. The blockchain-based commodity data governance method according to claim 1, characterized in that, The method further includes: Acquire data assets, which include metadata and raw data; The aforementioned metadata is written into a smart contract and deployed to the blockchain; The original data is modeled using a federated learning algorithm to obtain model parameters. Write the model parameters into the smart contract; The smart contract is used to regulate and audit the behavior of data collection, storage, sharing, and use. Zero-knowledge proof technology is used to generate a zero-knowledge proof of the original data; Write the zero-knowledge proof into the smart contract; By verifying the zero-knowledge proof, the authenticity and integrity of the original data can be proven without providing the original data.
Citation Information
Patent Citations
Aquatic product block chain traceability optimization system and method
CN113506117A
Complete data asset credible management and value circulation system and method
CN115049398A