Commodity data management method based on block chain
By adopting blockchain-based commodity data governance methods in cross-border e-commerce cloud warehousing, problems such as data standardization, consistency and traceability management in commodity data management are solved, and the standardized management of data, secure storage and trusted traceability of data are realized, and the value of data assets is enhanced.
Patent Information
- Application Number
- CN202411968155.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2044-12-30
AI Technical Summary
Cross-border e-commerce cloud warehousing faces technical challenges such as data standardization, data consistency, product traceability data collection and management in terms of product data management.
The blockchain-based commodity data governance method is adopted to standardize commodity attribute data by establishing a standardized mapping table for commodity attributes, and the distributed ledger storage architecture and smart contracts are used to realize automated routing storage and traceability management of data.
It realizes standardized management, secure storage, trusted traceability, dynamic update and quality governance of product data, and enhances the value of data assets.
Smart Images

Figure CN119848139A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information technology, and in particular to a commodity data governance method based on blockchain. Background Art
[0002] Cross-border e-commerce cloud warehousing faces many technical challenges in commodity data management. The first is the difficulty of standardizing commodity attribute data. Due to the wide variety of commodities, the attributes of different commodities are different, and it is difficult to unify the data fields and formats. How to ensure the flexibility and scalability of the system while taking into account data integrity is a technical contradiction that needs to be solved urgently. This requires that when designing the database table structure, it is necessary to cover the key attributes of various commodities as comprehensively as possible, and to reserve enough custom fields to meet the entry requirements of special commodities.
[0003] At the same time, it is also necessary to formulate corresponding conversion rules and processing logic for data in different formats in the data input, storage, and call process to ensure data consistency and availability. Secondly, the collection and management of product traceability data also faces many challenges. Cross-border e-commerce involves a complex supply chain network, and it is difficult to obtain and verify key traceability data such as the origin of goods, supplier information, and transportation methods.
[0004] To this end, it is necessary to establish a data docking mechanism with various channels and suppliers. However, due to the inconsistency of the data formats provided by all parties, how to efficiently and accurately complete the collection, cleaning, conversion and storage of data is a technical difficulty. In addition, it is also necessary to establish a strict data verification mechanism to conduct multi-dimensional cross-verification of the collected traceability data to ensure the authenticity and reliability of the data. At the same time, a unique traceability identification code is generated for each product, and a mapping relationship between the product and the source information is established to provide support for subsequent traceability queries and management. Summary of the invention
[0005] The present invention provides a commodity data management method based on blockchain, which mainly includes: Obtain commodity attribute data, standardize the commodity attribute data according to a pre-established commodity attribute standardization mapping table, and obtain standardized commodity attribute data; write the standardized commodity attribute data into the target data shard of the distributed ledger storage architecture according to the preset data routing rules, and use the Merkle tree data structure for indexing; verify the legitimacy and integrity of the data writing operation through the smart contract automation mechanism, and generate data index information; send the commodity source attribute data to the blockchain network, verify it according to the preset consensus algorithm, generate a transaction ID as a traceability identification code, and bind the transaction ID with the corresponding attribute data for storage; The data integrity and immutability are determined by the block hash value, the traceability rules in the smart contract are obtained, the data security is judged, and an automated traceability process is obtained; when the commodity data standard changes, the difference between the old and new data standards is identified through the data standard mapping table, and the data conversion rules are automatically generated according to the difference, the historical commodity attribute data is converted according to the new standard, and the newly added and changed commodity attribute data are synchronized to the on-chain block; a commodity data quality governance mechanism based on blockchain is established, and compliance checks are performed on data entry and modification operations through smart contract rules, and the integrity and accuracy of commodity attribute data are verified by multiple parties using the consensus mechanism.
[0006] Furthermore, the method of acquiring commodity attribute data and performing standardization processing on the commodity attribute data according to a pre-established commodity attribute standardization mapping table to obtain standardized commodity attribute data includes: acquiring commodity attribute data and judging whether the attribute value is a standard attribute value according to the commodity attribute standardization 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 with a preset missing value filling rule, splitting multi-valued attributes with a preset multi-valued attribute splitting rule, and flattening hierarchical attributes; merging the standardized, filled, split and flattened attribute data, aggregating the values of the same attributes to obtain merged standardized commodity attribute data; performing word segmentation on the standardized commodity attribute data, extracting keywords of attribute names and attribute values, and using the extracted keywords as commodity attribute feature vectors.
[0007] Furthermore, the source attribute data of the commodity is sent to the blockchain network, verified according to a preset consensus algorithm, a transaction ID is generated as a traceability identification code, and the transaction ID is bound and stored with the corresponding attribute data, including: obtaining the source attribute data of the commodity when it is put into storage, and for the source attribute data, using a pre-stored public key to verify the identity of the data source through an asymmetric encryption algorithm; if the identity authentication is passed, the sensitive attributes are encrypted with the key of the symmetric encryption algorithm to obtain the encrypted sensitive attribute data; obtaining the current timestamp, binding the encrypted sensitive attribute data with the current timestamp to obtain a commodity source attribute data packet; sending the commodity source attribute data packet to the blockchain network to trigger a consensus verification process; after receiving the commodity source attribute data packet, the nodes in the blockchain network vote according to the preset consensus rules and determine whether the commodity source attribute data packet has passed the consensus verification.
[0008] Furthermore, according to the commodity attributes and transaction identification code, the data integrity and non-tamperability are determined through the block hash value, the traceability rules in the smart contract are obtained, the data security is judged, and the automated traceability process is obtained, including: obtaining commodity attributes and transaction identification codes, calculating the block hash value using a specific algorithm, and storing the block hash value in the blockchain; using an encryption algorithm to generate a public key and a private key pair for asymmetric encryption, and storing the encrypted data in the blockchain; assigning corresponding data access rights to different roles to achieve fine-grained permission management; embedding the traceability rules into the blockchain through smart contract technology, defining the conditions and execution logic of the traceability rules, and deploying the smart contract to the blockchain network; obtaining the traceability rules defined in the smart contract, combining the data security judgment result, using a specific library to interact with the smart contract, and dynamically adjusting the traceability process.
[0009] Furthermore, when the commodity data standard changes, the difference between the new and old data standards is identified through the data standard mapping table, and data conversion rules are automatically generated according to the difference, the historical commodity attribute data is converted according to the new standard, and the newly added and changed commodity attribute data are synchronized to the on-chain block, including: obtaining commodity data standard change information, and identifying the newly added, modified and deleted attribute fields by comparing and analyzing the differences between the new and old data standards; according to the changes in the attribute fields, using predefined data conversion rules to convert the historical commodity attribute data into an attribute data format that conforms to the new standard; matching and comparing the converted commodity attribute data with the on-chain data according to the commodity ID, and identifying the newly added and changed commodity attribute data; synchronizing the newly added commodity attribute data to the on-chain block, deleting the old attribute data corresponding to the changed commodity attribute data from the on-chain block, and then writing the updated new attribute data to the on-chain block.
[0010] Furthermore, the construction of a blockchain-based commodity data quality governance mechanism performs compliance checks on data entry and modification operations through smart contract rules, and uses a consensus mechanism to perform multi-party verification of the integrity and accuracy of commodity attribute data, including: deploying a consortium chain architecture, which adopts a practical Byzantine fault-tolerant consensus mechanism to determine the consistency and credibility of data on the consortium chain; converting preset data specifications into compliance check rules in smart contracts, and deploying the smart contracts to the consortium chain network; obtaining commodity data, and uploading the commodity data to the consortium chain network; triggering the smart contract, performing a compliance check on the commodity data, and obtaining a compliance check result for the commodity data; if the compliance check result is compliant, storing the commodity data in the consortium chain to determine the authenticity and reliability of the commodity data throughout its life cycle.
[0011] Furthermore, the method also includes: obtaining data assets, the data assets including metadata and original data; writing the metadata into a smart contract and deploying it to a blockchain; modeling the original data using a federated learning algorithm to obtain model parameters; writing the model parameters into the smart contract; through the smart contract, regulating and auditing the behaviors of data collection, storage, sharing and use; using zero-knowledge proof technology to generate a zero-knowledge proof of the original data; writing the zero-knowledge proof into the smart contract; and proving the authenticity and integrity of the original data by verifying the zero-knowledge proof without providing the original data.
[0012] The technical solution provided by the embodiment of the present invention may have the following beneficial effects: The present invention discloses a method for managing commodity data throughout its life cycle based on blockchain. The method performs standardized processing on commodity attribute data by establishing a standardized mapping table for commodity attributes; adopts a distributed ledger storage architecture and smart contracts to automatically route and store standardized data; obtains and encrypts commodity source attributes from a trusted data source when commodities are put into storage; uses a blockchain consensus mechanism to verify commodity source data and generate a unique traceability identification code; automatically converts historical data when data standards change; constructs a data quality governance mechanism based on blockchain to perform compliance checks and multi-party verification on data; formulates a global data governance strategy to standardize behaviors in all links. The present invention realizes standardized management, secure storage, trusted traceability, dynamic updating and quality governance of commodity data, provides a complete solution for commodity data management throughout its life cycle, and effectively enhances the value of data assets. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1This is a flowchart of a commodity data management method based on blockchain of the present invention. DETAILED DESCRIPTION
[0014] In order to further understand the content of the present invention, the present invention is described in detail in conjunction with the accompanying drawings and embodiments. The present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are only used to explain the relevant inventions, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the invention are shown in the accompanying drawings.
[0015] like Figure 1 In this embodiment, a commodity data governance method based on blockchain may specifically include: S101. Obtain commodity attribute data, and perform standardization processing on the commodity attribute data according to a pre-established commodity attribute standardization mapping table, map non-standardized attribute values to standardized attribute values, fill missing values using preset missing value filling rules, split multi-valued attributes using preset multi-valued attribute splitting rules, and flatten hierarchical attributes to obtain standardized commodity attribute data.
[0016] Obtain commodity attribute data, perform standardization on the commodity attribute data according to a pre-established commodity attribute standardization mapping table, and map non-standardized attribute values to standardized attribute values. For missing values, fill in the missing value filling rules according to the preset missing value filling rules. If the attribute value is empty, fill in the default value or the most common value according to the filling rules. For multi-valued attributes, split them according to the preset multi-valued attribute splitting rules, split multiple attribute values according to the preset separators to obtain a single attribute value. For hierarchical attributes, flattening is used to convert the hierarchical attribute structure into a flat attribute structure, and a new attribute name is generated according to the preset naming rules. The attribute data after standardization, filling, splitting and flattening are merged, and the values of the same attributes are aggregated by matching the attribute names to obtain the merged standardized commodity attribute data. The standardized commodity attribute data is segmented, and the keywords of the attribute names and attribute values are extracted. The attribute data is segmented into keyword sequences using the preset segmentation algorithm and dictionary. The extracted keywords are used as commodity attribute feature vectors, and the keyword sequences are converted into numerical feature vectors according to the preset vectorization rules. According to the commodity attribute feature vector, a clustering algorithm is used to cluster the commodities, and by calculating the attribute similarity between commodities, commodities with similar attributes are classified into the same category. According to the clustering result, a standardized classification result of the commodities is obtained, and the classification result is written into the commodity attribute database, and a mapping relationship is established with the original commodity attribute data to facilitate subsequent data query and analysis.
[0017] Specifically, for the product attribute "color", non-standard values such as "red", "dark red", and "wine red" are mapped to the standard value "red". For missing brand attributes, fill in the most common "other" value. Split the values of the multi-valued attribute "applicable scenarios" "daily, sports, and commuting" into "daily", "sports", and "commuting" by commas. Flatten the hierarchical attribute "fabric" and convert "fabric-material-cotton" to "fabric material" and "cotton". Merge the values of the attributes with the same name "marketing time" and "shelf time". Use Jieba word segmentation to extract the keywords of "brand" and "model". Convert keywords to product feature vectors based on the TF-IDF algorithm. Use the K-means clustering algorithm to calculate attribute similarity with cosine similarity and cluster products. Classify products based on the clustering results, write them into the product category collection of the MongoDB database, and record the mapping relationship between product ID and category ID.
[0018] S102: Determine appropriate filling values by analyzing common attribute values of the category to which the product belongs, and obtain filled attribute data.
[0019] Obtain commodity attribute data, and determine whether the attribute value is a standard attribute value according to a preset commodity attribute standardization mapping table. If the attribute value is not a standard attribute value, map the non-standard attribute value to a standard attribute value according to the mapping table to obtain standardized attribute data. Determine appropriate filling values by analyzing common attribute values of the category to which the commodity belongs, and obtain filled attribute data. Split and flatten the standardized and filled attribute data, split the attribute data into attribute names and attribute values, and flatten the attribute values into a single value to obtain split and flattened attribute data. Merge the split and flattened attribute data, aggregate the values of the same attribute by matching the attribute names, and obtain merged standardized commodity attribute data. Segment the merged standardized commodity attribute data, extract keywords of the attribute names and attribute values, and use the extracted keywords as commodity attribute feature vectors. Cluster the commodities according to the commodity attribute feature vectors using a clustering algorithm, classify commodities with similar attributes into the same category, and obtain standardized classification results of the commodities. According to the commodity attributes and transaction identification code, the data integrity and immutability are determined through the block hash value, and the access rights of data encryption and role control are adopted to obtain the traceability rules in the smart contract and judge the data security. According to the result of data security judgment, the corresponding traceability process is automatically triggered to obtain the automated traceability result, ensuring the credibility and traceability of commodity attribute data.
[0020] Specifically, first obtain the product attribute data, such as "Brand: Apple, Model: iPhone 12, Color: Black", etc., and then determine whether the attribute value is standard according to the preset mapping table, such as mapping "black" to the standard value "Obsidian Black". For missing attributes, by analyzing the common attribute values of similar products, such as "Memory: 64GB, 256GB, 512GB", etc., select appropriate values such as "128GB" for filling. Then split and flatten the attribute data, split "Color: Obsidian Black" into "Color" and "Obsidian Black", and flatten "Obsidian Black" into a single value. Then, by matching the attribute names, aggregate the values of the same attributes, such as aggregating the "color" attributes of multiple products into "Obsidian Black, Silver White, Gold". Segment the aggregated attribute data, extract keywords as feature vectors, and use the K-means clustering algorithm for clustering, and divide the products into different categories according to attribute similarity. Finally, the hash value of the product attributes and transaction identification code is calculated through the SHA-256 algorithm, and the data integrity is ensured by using blockchain technology, and data security is ensured through AES encryption and role-based access control. According to the preset traceability rules in the smart contract, such as "when data integrity verification fails, trigger the data audit process", the traceability of product attribute data is automatically executed to ensure the credibility and traceability of the data.
[0021] S103. For the standardized commodity attribute data, a distributed ledger storage architecture and a smart contract automation mechanism are used to automatically route the standardized commodity attribute data of different types and sources to corresponding data shards for storage according to preset data routing rules, and index the data of each shard through a Merkle tree data structure.
[0022] Obtain commodity attribute data, standardize the commodity attribute data according to preset standardization rules, and obtain standardized commodity attribute data; determine the type and source of the standardized commodity attribute data according to preset data routing rules, and determine its corresponding target data shard; write the standardized commodity attribute data into the target data shard, and store it through a distributed ledger storage architecture; during the data writing process, use a smart contract automation mechanism to verify the legitimacy and integrity of the write operation, use a Merkle tree data structure for indexing, and generate data index information; write the data index information into a special index shard of the distributed ledger, and establish a mapping relationship with the corresponding data shard; when performing data query, locate the data shard where the target data is located through the index information in the index shard, and obtain specific standardized commodity attribute data in the corresponding data shard.
[0023] Specifically, the commodity attribute data is standardized according to the commodity attribute standard to obtain standardized commodity attribute data. The preset data routing rules are used to determine the corresponding target data shard according to the type and source of the standardized commodity attribute data. The standardized commodity attribute data is written into the corresponding target data shard and stored through the distributed ledger storage architecture. During the data writing process, the legality and integrity of the write operation are verified by the intelligent contract automation mechanism to ensure the correctness and consistency of the data writing. The standardized commodity attribute data written into each data shard is indexed using the Merkle tree data structure to generate data index information. The generated data index information is written into a special index shard in the distributed ledger, and a mapping relationship is established with the corresponding data shard. When performing data query, the data shard where the target data is located is first located through the index information in the index shard, and then the specific standardized commodity attribute data is obtained in the corresponding data shard, thereby improving the data query efficiency. During the data standardization process, the original commodity attribute data can be converted and normalized according to the preset standardization rules by using regular expressions or string matching. For data routing judgment, 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 verify the written data to ensure data compliance and integrity.
[0024] Standardization of commodity attribute data is the basic work of e-commerce systems. Taking the clothing category as an example, the size attributes in the original data may contain multiple expressions, such as "extra large size", "extended size", "loose size", etc., which need to be uniformly mapped to the standard size system "extra large size". 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, shard routing can be performed according to the price range and sales area of the product. For example, in the refrigerator category, high-end product data with a price of more than 10,000 yuan is routed to a dedicated high-end home appliance shard, which is convenient for differentiated operations and precision marketing. Distributed ledger storage architecture ensures data reliability and consistency. Taking mobile phone products as an example, when a new mobile phone product is added, its attribute data will be synchronously written to multiple storage nodes. Through the smart contract mechanism, the system will automatically verify the rationality of product parameters, such as the screen size must be a positive number and within a reasonable range, and the processor model must be in the preset valid list. The use of Merkle tree in the data index structure can improve query efficiency. Taking books as an example, the system constructs attributes such as the author, publisher, and publication year of the book into a tree index. When a user searches for books from a specific publisher, the system first locates the corresponding data shard through the index, and then obtains the specific book information, which significantly reduces the 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 attributes of the product must comply with industry specifications. For example, the shelf life of facial mask products must not exceed three years. The system automatically verifies these rules through smart contracts to ensure data compliance. The design of distributed storage architecture should take into account data access characteristics. Taking footwear as an example, the attribute data of hot-selling products is stored in high-performance storage nodes, and the data of clearance special products is stored in ordinary nodes to achieve a reasonable allocation of storage resources. This differentiated storage strategy not only ensures system performance, but also saves storage costs. The design of index shards needs to balance query efficiency and storage overhead. Taking jewelry as an example, the system establishes special indexes for high-frequency query attributes such as price, material, and brand, and uses simplified indexes for low-frequency query attributes such as packaging specifications and care instructions, which not only ensures the response speed of common queries, but also controls the index storage space.
[0025] S104. When goods are put into storage, according to the preset rules for collecting goods source attributes, the goods source attributes are obtained from the trusted data source through the digital signature authentication mechanism, and the sensitive attributes are encrypted using an asymmetric encryption algorithm. The data collection time is recorded through the timestamp recording mechanism, and the encrypted goods source attributes are bound to the timestamp and stored in the blockchain network.
[0026] According to the preset commodity source attribute collection rules, the source attribute data of the commodity when it enters the warehouse is obtained; for the source attribute data, the pre-stored public key is used to verify the identity of the data source through the RSA asymmetric encryption algorithm; if the identity authentication is passed, the key of the AES symmetric encryption algorithm is obtained from the preset key library, and the sensitive attributes are encrypted using the key to obtain the encrypted sensitive attribute data; the current timestamp is obtained, and the encrypted sensitive attribute data is bound to the current timestamp to obtain a commodity source attribute data packet; the commodity source attribute data packet is sent to the blockchain network based on the PBFT protocol to trigger a consensus verification process; after receiving the commodity source attribute data packet, each node in the blockchain network votes according to the preset consensus rules and determines whether the commodity source attribute data packet passes the consensus verification; if the consensus verification is passed, the commodity source attribute data packet is written into the distributed ledger of the blockchain, and the distributed ledger is synchronously updated between each node through the P2P protocol.
[0027] Specifically, according to the commodity source attribute collection rules, the source attribute data of the commodity when it enters the warehouse is obtained. Through the digital signature authentication mechanism, the RSA algorithm is used to verify the identity of the data source to ensure that the data comes from a trusted source. If the identity is authenticated, the sensitive attributes are encrypted using the AES symmetric encryption algorithm and bound to the current timestamp to form a complete commodity source attribute data packet. The commodity source attribute data packet is verified through the PBFT-based blockchain network consensus mechanism, and each node reaches a consensus through voting to ensure the authenticity and non-tamperability of the data. After consensus is reached, the data packet is stored in the distributed ledger of the blockchain, and the ledger is updated synchronously between each node to achieve permanent storage and traceable query of the data. The blockchain network adopts a consortium chain architecture, and the nodes are deployed by multiple trusted institutions. Communication is carried out through the P2P protocol to ensure the security and reliability of the network.
[0028] The rules for collecting commodity source attributes are the basis for ensuring data authenticity. Taking the food category as an example, the system needs to collect key attributes such as supplier qualifications, production date, and place of origin. For dried fruit snacks, it is necessary to collect source certificates such as certificates of origin and import licenses. These data will serve as an important basis for commodity traceability. Digital signature authentication ensures that the data source is credible. The system verifies the signature through the supplier's public key to confirm that the data is indeed from the registered supplier. Sensitive attribute encryption protects data security. Taking cosmetics as an example, confidential information such as the formula and production process of cosmetics needs to be encrypted and stored. The system uses a symmetric encryption algorithm to encrypt these data, and the key is securely managed by the authorized agency. For example, the preparation process of a newly developed drug, only authorized agencies can view the original information after encryption. The blockchain consensus mechanism ensures that data cannot be tampered with. Taking luxury goods as an example, when a famous watch is put into storage, its authenticity certificate, sales authorization and other information need to be verified by multiple nodes. For example, the authorization certificate data of a certain brand of watch requires confirmation from multiple parties such as the brand, authorized dealers, and quality inspection agencies before it can be stored on the chain. Distributed ledgers enable permanent data preservation. Taking jewelry as an example, once the diamond's certificate of origin, cutting parameters and other attribute data are stored in the blockchain, they will be synchronized on all nodes to form a complete traceability chain. For example, the clarity, weight and other parameters of a diamond ring can be traced back to its source and circulation process through the blockchain account book. The alliance chain architecture ensures network security and reliability. Taking alcoholic beverages as an example, the blockchain network is jointly maintained by brands, distributors, logistics companies and other institutions. Each node keeps data synchronized through a point-to-point communication protocol and jointly witnesses the commodity circulation process. For example, the entire process information of a bottle of cosmetics from its origin to the sales terminal is recorded and verified by all nodes in the alliance chain.
[0029] S105. With respect to commodity source attribute data, the consensus verification mechanism of the blockchain is utilized to verify and confirm the commodity source attribute data by the blockchain nodes, and a unique blockchain transaction ID is generated as the traceability identification code of the data, and the transaction ID is bound to the corresponding attribute data for storage.
[0030] Obtain commodity source attribute data, pre-process the attribute data, extract key field information, and convert it into a data format supported by the blockchain network; send the pre-processed attribute data to the blockchain network, and the blockchain node verifies and confirms the received attribute data according to a preset consensus algorithm; if the attribute data passes the verification, the attribute data is packaged into a block, and a unique block hash value of the block is generated; extract the transaction ID corresponding to the attribute data in the block, and use the transaction ID as the traceability identification code of the attribute data; establish an index of commodity ID and transaction ID, and when it is necessary to trace the source of the commodity, query the corresponding transaction ID according to the commodity ID, and then retrieve the relevant attribute data on the blockchain through the transaction ID to achieve reliable traceability of the source of the commodity.
[0031] Specifically, the source attribute data of the commodity is obtained, the attribute data is preprocessed, key field information is extracted, and converted into a data format supported by the blockchain network; the preprocessed attribute data is sent to the blockchain network through a secure and reliable data transmission channel; the blockchain node verifies and confirms the received attribute data according to a preset consensus algorithm, then packs the attribute data into a block, and generates a unique block hash value for the block; in the block data structure, a special field is set to store the corresponding relationship between the commodity attribute data and the transaction ID; the transaction ID corresponding to the attribute data in the block is extracted, and the transaction ID is used as the traceability identification code of the attribute data; A commodity attribute data table is created in the database, wherein the fields in the data table include commodity ID, attribute field, transaction ID, timestamp, and data hash value; the commodity attribute data is serialized and bound to the corresponding transaction ID, and stored in the data table by means of hash pointer to establish data association; cryptography technology is introduced to encrypt and store sensitive data, and a role-based access control mechanism is set up; an index of commodity ID and transaction ID is established to improve data query efficiency; when it is necessary to trace the source of the commodity, the corresponding transaction ID is quickly queried in the index according to the commodity ID, and then the relevant attribute data is retrieved on the blockchain through the transaction ID to achieve trusted traceability of the source of the commodity.
[0032] The preprocessing of commodity source attribute data is a key link to ensure 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 example, the origin information is standardized as a hierarchical structure of "province-city-county", and the inspection report extracts key indicator values and standardizes the units. The security of the data transmission channel directly affects the credibility of the traceability information. Taking the cosmetics supply chain as an example, cosmetics manufacturers transmit production batch information through a dedicated encrypted channel. The transport layer security protocol is used to ensure that the data is not stolen or tampered with during the transmission process. For example, sensitive information such as the production date and expiration date of a batch of cosmetics must be encrypted before it can be sent to the blockchain network. The consensus algorithm is the core mechanism to ensure data consistency. Taking the traceability of dried fruits as an example, the origin certification information needs to be verified by multiple regulatory nodes. For example, the origin certificate of a batch of dried fruits requires consensus among authoritative nodes such as the agricultural department and quality inspection agency to confirm the validity of the data. The design of the block data structure is related to the traceability efficiency. Taking the traceability of luxury goods as an example, the unique identification code of each product is established in correspondence with the block transaction. For example, the serial number of a certain watch is bound to the transaction number in the block, and the product information can be quickly located through the transaction number. The database table structure needs to take into account both query efficiency and security. Taking the traceability of imported goods as an example, multi-level indexes are set to improve query performance. For example, indexes are established through multiple dimensions such as product category, origin, and import date to quickly locate the traceability information of the target product. Cryptography technology plays an important role in data protection. Taking jewelry traceability as an example, core information such as diamond cutting parameters and authenticity certificates need to 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. Taking beverage products as an example, time- and role-based access rules are set. For example, the production information of beverages is only open to specific users for query during a specific time period, and cannot be accessed after the validity period expires or the permissions are insufficient. These rules are automatically executed through smart contracts, which not only ensures data security but also improves traceability efficiency.
[0033] S106. According to the commodity attributes and transaction identification code, the data integrity and immutability are determined by the block hash value, and the access rights of data encryption and role control are adopted to obtain the traceability rules in the smart contract, judge the data security, and obtain the automated traceability process.
[0034] Obtain the commodity attributes and transaction identification code, use the SHA-256 algorithm to calculate the block hash value, and store the block hash value in the blockchain. The formula is as follows: 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.
[0035] The RSA algorithm is used to generate a public key and a private key pair for asymmetric encryption, and the encrypted data is stored in the blockchain. Corresponding data access rights are assigned to different roles to achieve fine-grained permission management; the traceability rules are embedded in the blockchain through smart contract technology, and the smart contract is written in Solidity language to define the conditions and execution logic of the traceability rules, and the smart contract is deployed to the blockchain network; the traceability rules defined in the smart contract are obtained, and the Web3js library is used to interact with the smart contract in combination with the data security judgment result to dynamically adjust the traceability process; the commodity attributes and transaction identification codes are used as transaction data sets, and the Apriori algorithm is used to generate frequent item sets and association rules. The formula is: Supp(X) represents support, X represents the set of commodity attributes, T represents all transaction data sets, and t represents a transaction. The numerator represents the number of transactions containing the attribute set X, and the denominator represents the total number of transactions. According to the support and confidence of the association rule, the abnormal transaction pattern is identified; if the data security judgment result shows that there is a risk of data tampering, the early warning mechanism is triggered, and the message queue is used to send the early warning message to notify the relevant parties to verify and process the data; through the distributed consensus mechanism of the blockchain, the PBFT consensus algorithm is used to reach a consensus in the blockchain network, and each step of the traceability process is submitted to the blockchain network in the form of a transaction, which is automatically executed after consensus verification to reduce manual intervention.
[0036] Specifically, according to the commodity attributes and transaction identification code, the block hash value is calculated through blockchain technology to ensure the integrity and immutability of the data. The commodity attributes and transaction identification code are used as input, and the block hash value is calculated using the SHA-256 algorithm, and the hash value is stored in the blockchain. Sensitive data is asymmetrically encrypted, and the public key and private key pair are generated using the RSA algorithm. The public key is used to encrypt the data, and the private key is used to decrypt the data. The encrypted data is stored in the blockchain to ensure the confidentiality of the data. Combined with the role-based access control mechanism, corresponding data access rights are assigned to different roles to achieve fine-grained permission management. Through smart contract technology, the traceability rules are embedded in the blockchain. Use the Solidity language to write smart contracts to define the conditions and execution logic of the traceability rules. Deploy the smart contract to the blockchain network to ensure the transparency and immutability of the traceability rules. Obtain the traceability rules defined in the smart contract, and dynamically adjust the traceability process based on the data security judgment results. Use the Webjs library to interact with the smart contract to obtain the conditions and execution logic of the traceability rules. According to the data security judgment results, such as data integrity verification failure or access control violation, 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 identification codes to discover potential abnormal transaction behaviors. The product attributes and transaction identification codes are used as transaction data sets, and the Apriori algorithm is used to generate frequent item sets and association rules. According to the support and confidence of the association rules, abnormal transaction patterns are identified, such as abnormal combinations of product attributes and transaction identification codes. If the data security judgment results indicate that there is a risk of data tampering, the early warning mechanism is triggered. Use message queues (such as Kafka) to send early warning messages to notify relevant parties to verify and process the data. The early warning message includes detailed information on the abnormal data and recommended processing measures. The distributed consensus mechanism of the blockchain is used to realize the automated execution of the traceability process. The PBFT (Practical Byzantine Fault Tolerance) consensus algorithm is used to reach a consensus in the blockchain network to ensure 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 is automatically executed after consensus verification, reducing manual intervention.
[0037] Blockchain technology ensures data integrity through hash calculation. Taking food traceability as an example, the origin information, inspection report 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 the hash value to change, thereby effectively preventing data tampering. Data encryption is crucial to protecting sensitive information. Taking the cosmetics supply chain as an example, the core information of the manufacturer, such as the formula process and quality inspection data, is stored using asymmetric encryption. The enterprise holds the private key for decryption, and the regulatory authorities and consumers verify the authenticity of the data through the public key, which not only protects commercial secrets but also ensures data credibility. Role-based access control realizes refined permission management. Taking luxury goods traceability as an example, brand owners can view all supply chain data, retailers can only access sales information, and consumers can only query basic anti-counterfeiting information. These permission rules are automatically executed through smart contracts to avoid security risks caused by human operations. Smart contracts ensure the transparent execution of traceability rules. Taking beverage traceability as an example, the quality standards of raw material procurement, production and brewing, warehousing and logistics are written into smart contracts. If the raw material content does not meet the standard or the storage temperature is abnormal, the system automatically triggers an early warning to ensure product quality. Correlation analysis helps to discover abnormal transactions. Taking jewelry traceability as an example, by analyzing the correlation between the origin, cut, price and other attributes of diamonds and transaction records, suspicious transaction patterns can be identified. If the price of a diamond is obviously inconsistent with its quality characteristics, the system will automatically issue an early warning. The early warning mechanism is an important means of risk prevention and control. Taking the traceability of imported goods as an example, when it is found that the customs clearance information of the goods is inconsistent with the certificate of origin, the system immediately sends an early warning to the customs and quality inspection departments. The early warning information contains specific data anomalies, which facilitates timely processing by relevant departments. Distributed consensus ensures the trusted execution of the traceability process.
[0038] S107. When the commodity data standard changes, the difference between the old and new data standards is identified through the data standard mapping table, and data conversion rules are automatically generated based on the difference. The historical commodity attribute data is converted according to the new standard using the data mapping mechanism, and the newly added and changed commodity attribute data is identified through the timestamp comparison mechanism and synchronized to the on-chain block.
[0039] Obtain the information on the change of commodity data standards, and identify the newly added, modified and deleted attribute fields by comparing and analyzing the differences between the new and old data standards; according to the changes of the attribute fields, use predefined data conversion rules to convert the historical commodity attribute data into the attribute data format that conforms to the new standard, and the conversion rules include field mapping, data type conversion and default value filling; update the timestamp information in the converted commodity attribute data; query the existing commodity attribute data from the on-chain block through the blockchain browser or node API interface, and extract its timestamp information; match and compare the converted commodity attribute data with the on-chain data according to the commodity ID, and identify the newly added and changed commodity attribute data; synchronize the newly added commodity attribute data to the on-chain block; delete the old attribute data corresponding to the changed commodity attribute data from the on-chain block, and then write the updated new attribute data to the on-chain block; when the newly added or changed commodity attribute data reaches the preset threshold, write it to the on-chain block in batches; after the synchronization is completed, query the on-chain block data again to verify whether the commodity attribute data is written correctly.
[0040] Specifically, obtain the information on the change of commodity data standards, and identify the newly added, modified and deleted attribute fields by comparing and analyzing the differences between the new and old data standards. According to the changes in the attribute fields, use the predefined data conversion rules to convert the historical commodity attribute data into the attribute data format that conforms to the new standard. The conversion rules include field mapping, data type conversion, default value filling, etc. The converted commodity attribute data needs to update the timestamp information so that it can be synchronized with the on-chain block data. Through the blockchain browser or node API interface, query the existing commodity attribute data from the on-chain block and extract its timestamp information. Match and compare the converted commodity attribute data with the on-chain data according to the commodity ID to identify the newly added and changed commodity attribute data. For the newly added commodity attribute data, directly synchronize it to the on-chain block; for the changed commodity attribute data, it is necessary to delete the old attribute data from the on-chain block first, and then write the updated new attribute data. In order to ensure the consistency of on-chain data and off-chain data, after each synchronization is completed, it is necessary to query the on-chain block data again to verify whether the commodity attribute data is written correctly. At the same time, in order to avoid performance problems caused by frequent block writing, a batch synchronization threshold can be set, and batch writing can be performed when the newly added or changed product attribute data reaches a certain amount. After the synchronization is completed, the product attribute data in the on-chain block is updated and consistent with the product attribute data in the off-chain system.
[0041] Data standard changes are a common requirement for product traceability systems. Taking food traceability as an example, the original standard only includes the province and city level in the origin information, and the new standard requires it to be refined to the district and county level. At this time, it is necessary to convert historical data. For example, the origin of a batch of snacks, "Hangzhou, Zhejiang", needs to be expanded to "Xihu District, Hangzhou City, Zhejiang Province", and set default value filling rules to handle missing district and county information. Attribute field mapping involves the adjustment of data structure. Taking cosmetics traceability as an example, the expiration date in the original standard is represented by a single date field, and the new standard is divided into two fields: production date and validity period. The conversion rule needs to split the original field, such as the expiration date of a batch of cosmetics "December 31, 2023" is split into the production date "January 1, 2023" and the validity period "twelve months". Timestamp synchronization ensures data version consistency. Taking luxury goods traceability as an example, product information is frequently updated, and the time of each change needs to be accurately recorded. After the anti-counterfeiting code of a watch is updated, the timestamp of its attribute data will be updated to the latest operation time, which is convenient for version comparison with blockchain data. Data matching and comparison is a key link in the update. Taking the traceability of imported goods as an example, there may be hundreds of product information updates every day. The system sets a threshold of fifty, and only triggers block writing when the accumulated update data reaches the threshold to avoid frequent on-chain operations. Data verification ensures the accuracy of synchronization. Taking jewelry traceability as an example, after the quality parameters of diamonds are changed, it is necessary to verify whether the on-chain data has been updated successfully. The cut level of a diamond is upgraded from excellent to excellent. After the update, the blockchain browser is used to query and confirm that the new data has been correctly written. Smart contracts can automate the data standard upgrade process.
[0042] S108. Build a blockchain-based commodity data quality governance mechanism, conduct compliance checks on data entry, modification and other operations through smart contract rules, and use the consensus mechanism to conduct multi-party verification of quality indicators such as the integrity and accuracy of commodity attribute data. For data that fails the verification, trigger the preset smart contract rules to automatically repair it or send an alarm to the administrator.
[0043] A consortium chain architecture is obtained in which multiple business stakeholders are deployed as nodes, and the consortium chain architecture adopts a practical Byzantine fault-tolerant consensus mechanism to determine the consistency and credibility of data on the consortium chain; the preset data specifications are converted into compliance check rules in the smart contract, the development of the smart contract is implemented using a reliability language, and the smart contract is deployed to the consortium chain network; commodity data is obtained, and the commodity data is uploaded to the consortium chain network; the smart contract is triggered, and a compliance check is performed on the commodity data to obtain a compliance check result of the commodity data; if the compliance check result is compliant, the commodity data is stored in the consortium chain; based on the tamper-proof and traceable characteristics of the consortium chain, the authenticity and reliability of the commodity data throughout its life cycle are judged.
[0044] Specifically, according to the needs of commodity data quality governance, a data governance solution based on blockchain is designed. The alliance chain architecture is adopted, and multiple business stakeholders are deployed as nodes, and the consistency and credibility of data are guaranteed through the PBFT consensus mechanism. For commodity attribute data, a unified data entry and modification specification is formulated to clarify the requirements such as data format and value range. These specifications are converted into compliance check rules in smart contracts, and smart contracts are developed using the Solidity language, and deployed to the blockchain network. During the data entry and modification process, the smart contract automatically performs compliance checks to verify the integrity and format correctness of the data. For data that does not meet the specifications, the smart contract refuses to write it into the blockchain and returns an error message to the data submitter, prompting it to make corrections. Through the multi-party verification mechanism of the blockchain, multiple nodes review and confirm the commodity attribute data. The specific process is: the data submitter sends the data to the blockchain network, multiple nodes verify the data, and check the accuracy and compliance of the data through the smart contract rules. For the data that passes the verification, the nodes reach a consensus and write the data into the blockchain; for the data that fails the verification, the nodes refuse to write it into 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, and standardizes the data according to preset rules, such as removing illegal characters and filling 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 the problematic data is corrected in a timely manner. The immutability and traceability of the blockchain ensure the authenticity and reliability of commodity data throughout its life cycle. By recording every data operation on the blockchain, including data entry, modification, and verification, the traceability management of the data throughout its life cycle is achieved. Once a data quality problem is discovered, the time and operator of the problem can be quickly located, providing a basis for data governance and continuously optimizing the data governance process. The alliance chain architecture is the basis for commodity data governance. Taking food traceability as an example, it is jointly participated by manufacturers, logistics companies, retailers, and other parties. Each participant acts as a blockchain node to jointly maintain the authenticity of the data. Data specification and smart contract inspection are the core of data governance. Taking the traceability of cosmetics as an example, the smart contract stipulates that the name of the drug must use the standard common name, the production date format is "year-month-day", and the validity period must be greater than the current date. When a batch of cosmetics submits data, the smart contract automatically checks whether its common name meets the standard, whether the production date is filled in according to the prescribed format, and whether the validity period is within a reasonable range. The multi-party verification mechanism ensures the credibility of the data. Taking the traceability of snacks and dried fruits as an example, the origin certification requires joint confirmation by multiple institutions such as the agricultural department, 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 record. The data can only be uploaded to the chain after the three parties reach an agreement. Data repair rules ensure data quality. Taking clothing traceability as an example, smart contracts set automatic repair rules to handle common data problems. The size information of a certain brand of clothing contains illegal characters "L", and the system automatically converts it to the standard format "large"; the fabric composition lacks the "%" unit, and the system automatically completes it; the origin information mixes uppercase and lowercase "Hangzhou", and the system automatically unifies it into Chinese "Hangzhou". Data traceability supports quality management. Taking beverage traceability as an example, the system records detailed information for each data change. Through the blockchain, the time, operator, and reason for each change can be queried. It is found that human errors occurred when the data was initially entered, and the data entry process was corrected and optimized in a timely manner. The effect of data governance continues to be optimized.
[0045] S109. Formulate a global commodity data governance strategy based on blockchain, encapsulate commodity data standards, data permissions, data usage methods and other governance rules into smart contracts, and use the immutability and traceability of blockchain to regulate and audit the behavior of various business entities in data collection, storage, sharing, use and other links. Build a decentralized data asset trading platform based on blockchain to realize the confirmation of ownership, pricing, trading and profit sharing of commodity data assets.
[0046] Acquire data assets, which include metadata and raw data; write the metadata into a smart contract and deploy it to the blockchain; use a federated learning algorithm to model the raw data and obtain model parameters; write the model parameters into the smart contract; through the smart contract, standardize and audit the behaviors of data collection, storage, sharing and use; use zero-knowledge proof technology to generate a zero-knowledge proof of the raw data; write the zero-knowledge proof into the smart contract; verify the zero-knowledge proof to 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 aggregate query and statistical analysis operations on the encrypted data without decryption; based on the metadata and the model parameters, realize the confirmation of ownership, pricing, transaction and profit sharing of data assets through the smart contract.
[0047] Specifically, according to the immutability and traceability of blockchain, smart contracts are designed to encapsulate governance rules such as data standards, permissions and usage rules. Through smart contracts, behaviors in data collection, storage, sharing and use are regulated and audited to ensure that all business entities comply with data governance rules. Under the specifications of smart contracts, federated learning algorithms such as FedAvg are used to achieve multi-party data fusion and modeling under the premise of protecting data privacy, thereby enhancing data value. All parties participate in federated modeling with local data in accordance with the rules of smart contracts. After the model is trained locally, only model parameters are exchanged without leaking the original data. Based on blockchains such as Ethereum, a decentralized data asset trading platform is built to realize the confirmation, pricing, trading and profit sharing of data assets through smart contracts. The seller encrypts and hashes the data assets, writes the metadata into the smart contract and deploys it to the blockchain. The buyer can verify the authenticity of the data and automatically settle through the smart contract. In the process of data asset transactions, zero-knowledge proof technology such as zk-SNARK is used to prove the authenticity and integrity of the data without providing the original data, thereby protecting the privacy of both parties to the transaction. The seller generates a zero-knowledge proof of the data, and the buyer can verify the proof off-chain to complete the transaction while ensuring privacy. In order to protect privacy during data use, homomorphic encryption algorithms such as Paillier encryption are used to achieve direct calculation and analysis of encrypted data. After the data user obtains the homomorphically encrypted data, it can perform operations such as aggregate query and statistical analysis without decryption, thereby protecting data privacy to the maximum extent. Through blockchain evidence storage, the entire life cycle of data assets from collection to transaction is recorded and traced. The data hash value and timestamp are uploaded to the chain to form a digital ID card for data assets to ensure that the data source is credible. The transaction process and results are written into the blockchain to be open and transparent and to safeguard the rights and interests of all parties. Through the above steps, blockchain, smart contracts, federated learning, zero-knowledge proof, homomorphic encryption and other technologies are organically combined to build a trusted data governance and transaction platform based on privacy protection to promote the confirmation, circulation and value realization of data assets.
[0048] Smart contracts regulate data governance and are the foundation. Federated learning protects data privacy. Taking insurance claims as an example, multiple insurance companies hope to build anti-fraud models through data collaboration, but cannot directly share user data. Through federated learning, each company trains the model locally and only provides model parameters to the central node. When an insurance company finds a suspicious claim case, it can call the jointly trained model for risk assessment. Data asset trading platform realizes value realization. Taking retail data as an example, large supermarkets hope to sell consumer behavior data as data products to brands. Through the blockchain platform, supermarkets hash the desensitized data and set transaction rules in smart contracts. Brands can verify the authenticity of the data and complete the payment according to the contract rules. Zero-knowledge proof protects transaction privacy. Taking credit data as an example, banks need to prove that they have enough high-quality loan data, but cannot expose specific customer information. Through zero-knowledge proof technology, banks prove to data buyers that they have a specified number of loan data that meets specific conditions without providing original data. Homomorphic encryption supports privacy computing. Taking demographic data as an example, multiple cities need to summarize and analyze population mobility, but cannot share original data. Each city uses a homomorphic encryption algorithm to encrypt the data before submitting it. Data users can directly perform operations such as population statistics and flow trend analysis on the encrypted data. Blockchain evidence storage ensures data credibility. Taking intellectual property protection as an example, the creator of the work hashes the content of the work and writes it into the blockchain to form a proof of creation time. When a copyright dispute occurs, the earliest evidence record of the work can be queried through the blockchain to determine the ownership. After a design company completes the logo design, it immediately records the hash value and timestamp of the design drawing on the chain for subsequent rights protection.
[0049] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A commodity data management method based on blockchain, characterized in that: include: Acquire commodity attribute data, and perform standardization processing on the commodity attribute data according to a pre-established commodity attribute standardization mapping table to obtain standardized commodity attribute data; According to the preset data routing rules, the standardized commodity attribute data is written into the target data shard of the distributed ledger storage architecture and indexed using the Merkle tree data structure; The legitimacy and integrity of data writing operations are verified through the smart contract automation mechanism to generate data index information; The commodity source attribute data is sent to the blockchain network, verified according to the preset consensus algorithm, a transaction ID is generated as a traceability identification code, and the transaction ID is bound and stored with the corresponding attribute data; According to the commodity attributes and transaction identification code, the data integrity and immutability are determined through the block hash value, the traceability rules in the smart contract are obtained, the data security is judged, and an automated traceability process is obtained; When the commodity data standard changes, the difference between the old and new data standards is identified through the data standard mapping table, and data conversion rules are automatically generated based on the difference, the historical commodity attribute data is converted according to the new standard, and the newly added and changed commodity attribute data is synchronized to the on-chain block; Build a blockchain-based commodity data quality governance mechanism, conduct compliance checks on data entry and modification operations through smart contract rules, and use a consensus mechanism to conduct multi-party verification of the integrity and accuracy of commodity attribute data.
2. The commodity data management method based on blockchain according to claim 1 is characterized in that: The obtaining of commodity attribute data, and standardizing the commodity attribute data according to a pre-established commodity attribute standardization mapping table to obtain standardized commodity attribute data, includes: Acquire commodity attribute data, and determine whether the attribute value is a standard attribute value according to the commodity attribute standardization mapping table; 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, missing values are filled using a preset missing value filling rule, multi-valued attributes are split using a preset multi-valued attribute splitting rule, and hierarchical attributes are flattened; Merge the attribute data after standardization, filling, splitting and flattening, aggregate the values of the same attribute, and obtain the merged standardized commodity attribute data; The standardized commodity attribute data is segmented, keywords of attribute names and attribute values are extracted, and the extracted keywords are used as commodity attribute feature vectors.
3. The commodity data management method based on blockchain according to claim 2 is characterized in that: It also includes determining appropriate filling values by analyzing common attribute values of the category to which the product belongs, and obtaining filled attribute data, including: Get the common attribute list and corresponding common attribute value range under the target product category; Acquire existing attribute information of the target product; Matching the existing attribute names of the target product with the common attribute list to obtain the missing attributes of the target product; For each missing attribute, determine the importance weight of the missing attribute according to its frequency of occurrence in similar products; Apriori association rule mining algorithm is used to analyze the correlation between different attributes of similar products and obtain association rules; According to the existing attributes of the target product and the association rule, the value of the missing attribute of the target product is predicted.
4. The commodity data management method based on blockchain according to claim 1 is characterized in that: The commodity source attribute data is sent to the blockchain network, verified according to a preset consensus algorithm, a transaction ID is generated as a traceability identification code, and the transaction ID is bound and stored with the corresponding attribute data, including: Obtain source attribute data when the goods are put into storage, and use a pre-stored public key to verify the identity of the data source through an asymmetric encryption algorithm for the source attribute data; If the identity authentication is passed, the sensitive attribute is encrypted using the key of the symmetric encryption algorithm to obtain the encrypted sensitive attribute data; Obtaining a current timestamp, binding the encrypted sensitive attribute data to the current timestamp, and obtaining a commodity source attribute data packet; Send the commodity source attribute data packet to the blockchain network to trigger the consensus verification process; After receiving the commodity source attribute data packet, the nodes in the blockchain network vote according to the preset consensus rules and determine whether the commodity source attribute data packet passes the consensus verification.
5. The commodity data management method based on blockchain according to claim 1 is characterized in that: According to the commodity attributes and transaction identification code, the data integrity and immutability are determined by the block hash value, the traceability rules in the smart contract are obtained, the data security is judged, and the automated traceability process is obtained, including: Obtaining commodity attributes and transaction identification codes, calculating block hash values using a specific algorithm, and storing the block hash values in a blockchain; Using an encryption algorithm to generate a public key and a private key pair for asymmetric encryption, and storing the encrypted data in the blockchain; Assign corresponding data access permissions to different roles to achieve fine-grained permission management; By using smart contract technology, the traceability rules are embedded into the blockchain, the conditions and execution logic of the traceability rules are defined, and the smart contract is deployed into the blockchain network; The traceability rules defined in the smart contract are obtained, and combined with the data security judgment results, a specific library is used to interact with the smart contract to dynamically adjust the traceability process.
6. The commodity data management method based on blockchain according to claim 5 is characterized in that: The obtaining of commodity attributes and transaction identification codes, calculating block hash values using a specific algorithm, and storing the block hash values in a blockchain includes: The SHA-256 algorithm is used to calculate the block hash value, and the block hash value is stored in the blockchain. The RSA algorithm is used to generate a public key and a private key pair for asymmetric encryption, and the encrypted data is stored in the blockchain. Corresponding data access rights are assigned to different roles to achieve fine-grained permission management; Through smart contract technology, the traceability rules are embedded in the blockchain, the smart contract is written in Solidity language, the conditions and execution logic of the traceability rules are defined, and the smart contract is deployed in the blockchain network.
7. The commodity data management method based on blockchain according to claim 6 is 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.
8. The commodity data management method based on blockchain according to claim 1 is characterized in that: When the commodity data standard changes, the difference between the new and old data standards is identified through the data standard mapping table, and data conversion rules are automatically generated according to the difference, the historical commodity attribute data is converted according to the new standard, and the newly added and changed commodity attribute data is synchronized to the on-chain block, including: Obtaining product data standard change information, and identifying newly added, modified, and deleted attribute fields by comparing and analyzing the differences between the new and old data standards; According to the change of the attribute field, the historical commodity attribute data is converted into an attribute data format that conforms to the new standard by using a predefined data conversion rule; Matching and comparing the converted commodity attribute data with the on-chain data according to the commodity ID to identify newly added and changed commodity attribute data; The newly added commodity attribute data is synchronized to the on-chain block, the old attribute data corresponding to the changed commodity attribute data is deleted from the on-chain block, and then the updated new attribute data is written into the on-chain block.
9. The commodity data management method based on blockchain according to claim 1 is characterized in that: The aforementioned construction of a blockchain-based commodity data quality governance mechanism uses smart contract rules to conduct compliance checks on data entry and modification operations, and uses a consensus mechanism to conduct multi-party verification of the integrity and accuracy of commodity attribute data, including: Deploy a consortium chain architecture, which uses a practical Byzantine fault-tolerant consensus mechanism to determine the consistency and credibility of data on the consortium chain; Converting preset data specifications into compliance check rules in smart contracts, and deploying the smart contracts to the consortium chain network; Acquire commodity data, and upload the commodity data to the alliance chain network; triggering the smart contract, performing a compliance check on the commodity data, and obtaining a compliance check result of the commodity data; If the compliance check result is compliant, the product data is stored in the alliance chain to determine the authenticity and reliability of the product data throughout its life cycle.
10. The commodity data management method based on blockchain according to claim 1 is characterized in that: The method further comprises: Acquire data assets, wherein the data assets include metadata and original data; For the metadata, write it into a smart contract and deploy it to the blockchain; For the original data, a federated learning algorithm is used to model it to obtain model parameters; Writing the model parameters into the smart contract; Through the smart contract, the behaviors in data collection, storage, sharing and use are regulated and audited; Using zero-knowledge proof technology to generate zero-knowledge proof of the original data; Writing the zero-knowledge proof into the smart contract; By verifying the zero-knowledge proof, the authenticity and integrity of the original data are proved 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
Method for reducing node storage space occupation in block chain traceability application
CN115630118A
Grain block chain information tracing method based on master-slave multiple chains
CN115994770A
Intelligent system for improving data integrity through blockchain-based contracts
DE202024106330U1
Cited By
Selective data aggregation method and system based on conditional classification coding
CN120030577A
Heterogeneous data source right confirmation method based on block chain
CN120086818A
Natural resource data dynamic monitoring and tracing method and system
CN120296076A
Copyright data security management method and management system based on block chain
CN120744992A
Self-adaptive data management method and system
CN120763141A