Commodity traceability method and system based on block chain

By generating unique product identifiers and storing them on the blockchain, and combining blockchain and graph database technologies, a product propagation ecosystem graph is constructed. This solves the problems of reliable product data sources and low efficiency of cross-system data integration in complex supply chains, and achieves transparent traceability and transaction credibility assurance throughout the entire product lifecycle.

CN120822975AInactive Publication Date: 2025-10-21FOSHAN HUIBOTONG INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202511147426.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-15
Publication Date
2025-10-21
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In complex supply chain environments, the reliability of product data sources is difficult to guarantee, and the efficiency of cross-system data integration is low, leading to a break in the traceability chain and an inability to accurately reconstruct the product's transmission path.

Method used

By generating unique product identifiers and storing them on the blockchain, an immutable distributed ledger is constructed using blockchain technology. Combined with graph database technology, a product propagation ecosystem graph is built. Data standardization protocol conversion and dynamic weight analysis are performed to achieve visualized modeling and intelligent integration of product propagation relationships. Anomaly detection and blockchain verification are also performed to generate traceability reports.

Benefits of technology

It enables authentic traceability of product lifecycle data, optimizes traceability efficiency, ensures the credibility of transactions and the transparency of the supply chain network, and solves the problems of data source credibility and cross-system data integration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120822975A_ABST
    Figure CN120822975A_ABST
Patent Text Reader

Abstract

The invention discloses a commodity traceability method and system based on a block chain. The method comprises the following steps: acquiring basic information data of a commodity to generate a unique identifier of the commodity, and constructing a distributed account book in combination with a transaction hash value and an operation timestamp; constructing a commodity propagation ecological map by using a graph database technology based on a distributed account book; aggregating the full-node circulation data, and performing standardization processing to form a cross-platform integrated data set to obtain commodity propagation path data; analyzing to obtain transaction data of the commodity propagation path data, and dynamically adjusting graph node weights; and finally, performing anomaly detection and block chain verification on the updated commodity propagation ecological map to generate a commodity traceability report. The problem that in a complex propagation network, it is difficult to ensure the credibility of a commodity data source and achieve cross-system efficient integration is solved, and the effects of improving the transparency and authenticity of supply chain data, optimizing the commodity traceability efficiency and guaranteeing the transaction credibility are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blockchain technology, and in particular to a product traceability method and system based on blockchain. Background Art

[0002] Amidst the increasing complexity of global supply chains, product traceability has become a critical component in ensuring transparency and consumer trust. This is particularly true in highly sensitive sectors like food and pharmaceuticals, where accuracy directly impacts safety oversight and accountability. Effective product data management is fundamental to building a trusted traceability system, ensuring that information throughout the entire process, from raw materials to end-consumer, is authentic, complete, and verifiable. Currently, with the acceleration of digital transformation, the need for refined and standardized product process management is becoming increasingly prominent, providing a crucial application scenario for blockchain technology.

[0003] Current blockchain-based product traceability technology primarily relies on centralized data or a single platform to record product information, but this approach has significant limitations in complex supply chain scenarios. Enterprises or third-party organizations maintain centralized databases, linking product information through serial numbers, QR codes, and other methods. However, when conducting cross-platform transactions or disseminating information through multiple channels, inconsistent data formats and a lack of trust mechanisms hinder seamless information integration. For example, during the movement of goods across e-commerce platforms, offline channels, and cross-border channels, product data management lacks coordination across various links, potentially leading to tampering or loss of key information, resulting in a break in the traceability chain and an inability to accurately restore the complete transmission path.

[0004] Therefore, how to ensure the credibility of data sources and achieve efficient cross-system integration in complex communication networks has become a technical problem that blockchain product traceability technology urgently needs to solve. Summary of the Invention

[0005] The embodiments of the present application provide a blockchain-based product traceability method and system to solve the problem of difficulty in ensuring the credibility of product data sources and achieving efficient cross-system integration in complex communication networks, thereby achieving the effects of improving the transparency and authenticity of supply chain data, optimizing product traceability efficiency, and ensuring transaction credibility.

[0006] This embodiment of the present application provides a blockchain-based product traceability method, which includes: Obtain product information data, product unique identification data and chain timestamp, generate product unique identification, and generate a distributed ledger based on the product unique identification, transaction hash value and operation timestamp; Based on the transaction data in the distributed ledger, a blockchain commodity dissemination ecological map is constructed using graph database technology; Aggregate commodity full-node circulation record data, and after standardized protocol conversion processing, form a cross-platform integrated data set containing the commodity unique identifier and the operation timestamp, and obtain commodity propagation path data; Analyze the transaction hash value and the operation timestamp in the commodity propagation path data, adjust the node connection weights in the commodity propagation ecological map, and generate a real-time updated commodity propagation ecological map; Anomaly detection and blockchain verification are performed on the real-time updated commodity dissemination ecological map to identify trusted nodes and trusted paths and generate a commodity traceability report.

[0007] Optionally, the step of aggregating the commodity full-node circulation record data and converting it into a cross-platform integrated data set including the commodity unique identifier and the operation timestamp after standardized protocol conversion, and obtaining the commodity propagation path data includes: Obtaining the commodity full-node circulation record data and converting the format based on the data standardization protocol to generate the cross-platform integrated data set; Detecting whether there is data breakage in the cross-platform integrated dataset, and if so, extracting breakpoints to generate a breakpoint dataset; Perform node signature verification on the breakpoint dataset. If the digital signature passes the integrity check, the missing data is completed based on the transaction characteristics of adjacent operation timestamps. The product propagation path is reconstructed based on the completed data to obtain complete product propagation path data.

[0008] Optionally, the step of performing anomaly detection and blockchain verification on the real-time updated commodity dissemination ecological map, identifying trusted nodes and trusted paths, and generating a commodity traceability report includes: Extracting transaction feature data of the target propagation path from the commodity propagation ecological map, wherein the transaction feature data includes a transaction hash value sequence and an operation timestamp sequence; Calculating the time interval distribution characteristics of adjacent transactions based on the operation timestamp sequence, and combining the correlation relationship of the transaction hash value sequence to perform anomaly detection and determine suspicious transaction nodes; Perform digital signature verification and conflict rule verification on the suspicious transaction node, and generate an authenticity verification report based on the verification results; Blockchain verification is performed based on the authenticity verification report, the trusted path is identified, and the product traceability report is generated.

[0009] Optionally, the step of performing anomaly detection and blockchain verification on the real-time updated commodity dissemination ecological map, identifying trusted nodes and trusted paths, and generating a commodity traceability report further includes: Perform anomaly detection on the real-time updated commodity dissemination ecological map, identify trusted nodes, and generate authenticity verification results; Based on the authenticity verification result, obtaining the unique identifier of the product and the transaction hash value from the blockchain network to generate a trusted transaction record; Extracting the operation timestamp and blockchain structure of the trusted transaction record, determining the block location and associated path of the transaction hash value, and obtaining trusted path data; Mark the trusted nodes in the communication ecological map according to the trusted path data and the node signature verification result, and generate path marking data containing the unique identifier of the commodity and the transaction hash value; The operation timestamp and the transaction hash value are integrated through the path mark data to generate the product traceability report.

[0010] Optionally, the step of constructing a blockchain commodity dissemination ecological map using graph database technology based on the transaction data in the distributed ledger includes: Obtaining the transaction hash value, operation timestamp, and product unique identifier from the transaction data, and using a graph database to store nodes and edges to obtain an initial set of product propagation nodes and edges; the nodes represent the product unique identifier, the edges represent the transaction hash value, and the edge attributes include the operation timestamp; Based on the commodity propagation nodes and edge sets, a blockchain structure is constructed, and a propagation direction attribute is added to each edge to determine a blockchain link graph of the commodity propagation path; Calculating the transaction frequency and ecological relevance of nodes in the blockchain link graph, obtaining node weights and propagation path lengths, and obtaining a propagation path graph including node weights and path lengths; If the node weight in the propagation path map is greater than a preset weight threshold, the propagation path map is partitioned to obtain a subgraph of the propagation direction and ecological association to generate the commodity propagation ecological map.

[0011] Optionally, the step of analyzing the transaction hash value and the operation timestamp in the commodity propagation path data, adjusting the node connection weights in the commodity propagation ecological map, and generating a real-time updated commodity propagation ecological map includes: Obtaining the transaction hash value and the operation timestamp, and obtaining a feature matrix of the node connections based on the initial weights of the node connections; According to the feature matrix, combined with transaction frequency and propagation speed, the connection weights are dynamically adjusted to obtain an updated weight matrix; According to the weight matrix, combined with the operation timestamp, the node importance and propagation speed are analyzed to generate a real-time updated ecological map of the commodity propagation.

[0012] Optionally, after the steps of obtaining product information data, product unique identification data and on-chain timestamp, generating a product unique identification, and generating a distributed ledger based on the product unique identification, transaction hash value and operation timestamp, the following steps are included: Obtain the unique product identifiers, transaction hash values, and operation timestamps of different product source nodes in the distributed ledger to obtain a preliminary data set; Comparing the commodity unique identifiers and the transaction hash values ​​of different commodity source nodes in the preliminary data set, and generating a conflict record set based on the comparison result; A consistency check is performed on the conflicting record set, the record with the earliest operation timestamp in the unique identifier of the same product is retained and other conflicting records are removed to obtain a unified distributed ledger.

[0013] In addition, to achieve the above objectives, an embodiment of the present invention further provides a blockchain-based product traceability system, the system comprising: The product data collection and identification generation module is used to obtain product information data, product unique identification data and chain timestamp, and generate a standardized product unique identification; A distributed ledger construction and storage module, configured to generate a distributed ledger based on the unique identifier of the commodity, the transaction hash value, and the operation timestamp, and to complete distributed storage of the ledger; A commodity dissemination ecological map construction and optimization module is used to construct a commodity dissemination ecological map based on the distributed ledger, and dynamically adjust node weights by analyzing the transaction hash value and the operation timestamp to achieve real-time updating of the map; Anomaly detection and trusted verification module, used to detect anomalies in the commodity dissemination ecological map and identify trusted nodes and trusted paths through blockchain verification technology; The traceability analysis and report generation module is used to integrate anomaly detection and trusted verification results to generate a complete product traceability report.

[0014] In addition, to achieve the above-mentioned purpose, an embodiment of the present invention also provides a terminal device, including a memory, a processor, and a blockchain-based product traceability program stored on the memory and runnable on the processor. When the processor executes the blockchain-based product traceability program, the method described above is implemented.

[0015] In addition, to achieve the above-mentioned purpose, an embodiment of the present invention also provides a computer-readable storage medium, on which a blockchain-based product traceability program is stored. When the blockchain-based product traceability program is executed by a processor, the method described above is implemented.

[0016] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages: 1. The present invention collaboratively constructs a commodity dissemination ecological map through blockchain distributed ledgers and graph databases, effectively solving the problems of low credibility of commodity data sources and opaque supply chain network relationships, and achieving the effect of authentic traceability of commodity data throughout its entire life cycle and dynamic visualization of its circulation paths.

[0017] 2. After generating a preliminary commodity dissemination ecological map, the present invention monitors the data during commodity circulation through the product data management system, and updates the commodity dissemination ecological map in real time by combining standardized protocol conversion with dynamic weight analysis, effectively solving the problems of multi-system data islands and lagging traditional traceability updates, and thus achieving the effect of cross-platform data intelligent integration and autonomous optimization of the dissemination network.

[0018] 3. The present invention uses anomaly detection and blockchain verification to link the real-time updated commodity dissemination ecological map to build a reliable commodity traceability report, solving the problems of low efficiency of manual verification and difficulty in identifying trusted nodes, and achieving the effect of automatic identification of trusted paths and real-time generation of intelligent reports. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 This is a flowchart of the first embodiment of the blockchain-based product traceability method of this application; Figure 2 This is a flowchart of Example 2 of the blockchain-based product traceability method of this application; Figure 3 This is a schematic diagram of the terminal structure of the hardware operating environment involved in an embodiment of the present application. DETAILED DESCRIPTION

[0020] To address the challenges of ensuring the credibility of commodity data sources and inefficient cross-system data integration in complex supply chain environments, this application first generates unique identifiers for commodities and stores them on-chain. Using blockchain technology, it builds an unalterable distributed ledger to ensure the authenticity and credibility of the data source. Graph database technology is then used to construct a communication ecosystem graph to enable visual modeling and dynamic analysis of commodity communication relationships. Standardized protocol conversion is used to intelligently integrate multi-source heterogeneous data, and the graph structure is dynamically optimized through intelligent analysis of transaction data. Finally, a reliable commodity traceability report is output through anomaly detection and blockchain verification. This approach achieves authentic traceability of commodity data throughout its entire life cycle, real-time visual monitoring of the supply chain network, and efficient cross-platform data collaboration, optimizing commodity traceability efficiency and ensuring transaction credibility.

[0021] To better understand the above technical solutions, exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. Instead, these embodiments are provided to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.

[0022] In order to better understand the above technical solution, the above technical solution will be described in detail below with reference to the accompanying drawings and specific implementation methods. Example 1

[0023] In this embodiment, a product traceability method based on blockchain is provided.

[0024] Reference Figure 1 The method of this embodiment includes the following steps: Step S100: Obtain product information data, product unique identification data and chain timestamp, generate product unique identification, and generate a distributed ledger based on the product unique identification, transaction hash value and operation timestamp; In this embodiment, product information data includes basic product information such as product name, production batch, and net weight. Product unique identification data is the product's globally unified code, typically presented in the form of a barcode or QR code. The on-chain timestamp is typically the production date. Operation timestamps include various timestamps during the product's distribution process, such as warehousing timestamps, outbound timestamps, shelf timestamps, and sales timestamps.

[0025] As an optional implementation method, product information data and corresponding product unique identification data are obtained from the supply chain node to generate basic product information, and then the SHA-256 algorithm is used to hash the basic product information to generate a fixed-length hash value to obtain a preliminary product unique identification.

[0026] For example, product information data is obtained from various supply chain nodes, including production plants, logistics warehouses, and retail stores. For example, at a mineral water production plant, RFID tags are used to record the product name, production batch (batch number A20251001), production date (2025-10-01 08:00:00), and net volume (500ml). The data is formatted as JSON and contains the fields {name: "Mineral Water", batch: "A20251001", date: "2025-10-01 08:00:00", volume: 500}. The product's unique identifier, also known as the Global Uniform Number (GTIN-13) from the GS1 standard, is generated to generate a 13-digit numeric identifier (e.g., 6901234567890). The product information data is then concatenated with the product's unique identifier and the on-chain timestamp using the SHA-256 algorithm to generate a 64-bit hash value, the product's unique identifier, ensuring uniqueness.

[0027] As another optional implementation, after generating a unique product identifier, the preliminary unique product identifier, transaction hash value, and operation timestamp are encrypted using AES-128 encryption via a data encryption transmission protocol to produce an encrypted data packet. This encrypted data packet is then uploaded to a distributed ledger using a blockchain recording mechanism, and data consistency is verified using a consensus algorithm to produce the on-chain data. This on-chain data is stored on multiple nodes using distributed storage technology, organized using a Merkle tree structure, and data integrity is determined to generate an immutable distributed ledger.

[0028] For example, data encryption transmission utilizes the TLS 1.3 protocol and the AES-256 algorithm for dual security. Encrypted data is pushed to blockchain nodes via an API. Asymmetric encryption utilizes a 2048-bit RSA key pair (public key publicly available, private key securely held by the node). The blockchain layer is built on the Ethereum platform. Smart contracts written in Solidity fully record the unique product identifier (generated using SHA-256 from basic product information, a global unified code, and the on-chain timestamp), millisecond-accurate operation timestamps (e.g., 2025-10-01 08:05:00.123), and transaction details (including logistics status changes and sales records). Each transaction generates a unique transaction hash value (e.g., 0x1a2b3c...) that serves as a blockchain evidence index. Raw data files are distributed and stored using the IPFS protocol. After sharding, content-addressed hashes (e.g., QmX...) are generated. Storage nodes are dynamically allocated using the consistent hashing algorithm, ensuring data immutability from the underlying storage layer. When verifying data authenticity, the locally calculated SHA-256 hash value is automatically compared with the original blockchain record. A match indicates that the data has not been tampered with. In actual business operations, retail stores can verify the authenticity of product blockchain evidence in real time through smart contract interfaces. Consumers can scan the QR code on the product packaging to obtain complete traceability information including production location and logistics track. The entire process is operated in a closed loop through an automated system, improving data flow efficiency by 30% compared to traditional models, and the response time for consumer-side traceability queries is strictly controlled within 1 second.

[0029] As another optional implementation, after generating a distributed ledger, conflict detection can be performed on the data in the distributed ledger to ensure data consistency, as the data is obtained from different supply chain nodes. Data records submitted by each node are obtained from the distributed ledger, including the product's unique identifier, operation timestamp, and transaction hash value. These records are stored in a hash table to generate a preliminary data set. Within the preliminary data set, the product's unique identifier and transaction hash value from different product source nodes are compared. If the product's unique identifier is the same but the transaction hash value is inconsistent, these records are marked as conflicting, resulting in a conflict record set. The conflict record set is then checked for consistency using timestamp comparison logic. If the operation timestamp of a node record is earlier than that of a record with the same product identifier from another node, this record is retained and the remaining records are discarded, resulting in a verified record set. Using this verified record set, the automated execution logic of the smart contract is used to consolidate and store the records in the distributed ledger, creating a unified distributed ledger.

[0030] For example, assume that there are three nodes A, B, and C in a supply chain blockchain network, each of which submits a commodity transaction record with the unique identifier of the commodity being G12345. The timestamp recorded by node A is 2025-07-21 10:00:00, and the transaction hash value is H1=SHA256("G12345|1000|2025-07-21 10:00:00")=a1b2c3; the timestamp recorded by node B is 2025-07-21 10:00:05, and the hash value is H2=SHA256("G12345|1000|2025-07-21 10:00:05")=d4e5f6; the timestamp recorded by node C is 2025-07-21 10:00:00, but the hash value is H3=SHA256("G12345|500|2025-07-2110:00:00")=g7h8i9. The smart contract first invokes a conflict detection rule, comparing the item's unique identifier, operation timestamp, and transaction hash. The detection algorithm uses a majority voting mechanism to check the consistency of the record fields submitted by each node: if at least two nodes have the same field value, the record is considered valid. The comparison results show that the timestamps of records A and B are close (less than 10 seconds apart, with the threshold defined by business rules), and both have 1000 item quantities, while record C has 500 items, indicating a possible error in record C. The smart contract then performs a consistency check, discarding the inconsistent record C and retaining the records of A and B. Finally, based on the timestamp priority principle, record A (with the earliest timestamp) is selected as the unified data, generating the record set {G12345, 1000, 2025-07-21 10:00:00, a1b2c3}, which is broadcast to all nodes to update the ledger. To ensure logical rigor, if the timestamp difference is too large (for example, exceeding 60 seconds), a secondary verification is triggered, calling an oracle to obtain an external time source (such as an NTP server) to confirm the timestamp's accuracy. This mechanism uses automated algorithms to perform conflict detection and consistency checks, ensuring data consistency while avoiding human intervention and improving efficiency and credibility.

[0031] Step S200: Based on the transaction data in the distributed ledger, a blockchain commodity dissemination ecological map is constructed using graph database technology; In this embodiment, transaction data includes transaction hash values, operation timestamps, and unique product identifiers. Based on blockchain transaction data, graph database technology is used to construct a product distribution ecosystem map, enabling visual tracking of full-chain relationships.

[0032] As an optional implementation method, the transaction hash value, operation timestamp and unique identifier of the product are obtained from the transaction data, and the nodes and edges are stored in the graph database Neo4j. The node represents the unique identifier of the product, the edge represents the transaction hash value, and the edge attributes include the operation timestamp and transaction time, so as to obtain the initial set of product propagation nodes and edges. Based on the set of product propagation nodes and edges, a blockchain structure is constructed, and a propagation direction attribute is added to each edge to determine the block link graph of the product propagation path. The transaction frequency and ecological correlation of the nodes in the block link graph are calculated, the node weight and the propagation path length are obtained, and a propagation path graph containing the node weight and path length is obtained. If the node weight in the propagation path graph is greater than the preset weight threshold, the propagation path graph is partitioned to obtain a subgraph of the propagation direction and ecological correlation, and the product propagation ecological graph is generated.

[0033] For example, assume a distributed ledger contains 1,000 transaction records. Each record includes a transaction hash (e.g., a 64-bit hash generated by SHA-256, such as "a1b2c3...d4e5"), an operation timestamp (e.g., 2025-07-20 09:05:23), the sender's address, the receiver's address, and the product ID. During data preprocessing, a Python script parses the transaction data in CSV format, filtering out invalid records (e.g., those with incorrect timestamp format or missing hash values), retaining approximately 950 valid records. Next, nodes and relationships are created in Neo4j. Nodes represent transaction participants (sender and receiver, approximately 500 unique addresses), while relationships represent transactions, with attributes including the transaction hash and operation timestamp. Using the Cypher query language to perform batch inserts, for example, "CREATE (n1:Address {id:'addr1'})-[:TRANSACT {hash:'a1b2c3...',timestamp:'2025-07-20 09:05:23'}]->(n2:Address {id:'addr2'})" constructs a directed graph with 950 edges. Product propagation paths are sorted by timestamps and associated with transaction hash values. A depth-first search (DFS) algorithm is used to trace the flow of product IDs. For example, from address A to B to C, the path length is 3, and the time required is 0.002 seconds. Analysis of the propagation paths revealed that 30% of the products were transferred within three transactions, with the maximum path length being 7. Based on this, a propagation ecosystem map was generated. The PageRank algorithm was used to analyze node importance, with a damping coefficient of 0.85 and 10 iterations. Ten key nodes (PageRank values ​​> 0.01) were identified, reflecting the core transaction participants. The graph visualization uses D3.js to display transaction density and time-series changes between nodes. Node size is proportional to PageRank, and edge color changes over time, from blue (early) to red (late). The resulting product distribution ecosystem map shows that transactions are concentrated in five key nodes, accounting for 60% of total transaction volume, indicating potential supply chain bottlenecks. The entire process is automated, requiring no human intervention for data processing, graph construction, and analysis, ensuring logical rigor and efficient execution.

[0034] Optionally, during the data preprocessing phase, transaction data can be cleansed and combined with the semantic validation rules of smart contracts to improve the recognition rate of invalid records. When operating on graph databases, Neo4j Fabric sharding technology is used to enable parallel insertion of multiple nodes, combined with LRU caching of hot address nodes to shorten the construction time of 950 edges. At the path analysis level, Cypher queries are optimized for both time and space, adding geospatial indexing and time series filtering conditions, and integrating a time-series graph neural network (TGAT) to predict abnormal paths. This reduces the response time of complex queries while improving the accuracy of abnormal transaction predictions. Finally, the centrality analysis dimension is expanded to incorporate the weights of multiple indicators such as transaction frequency and spatiotemporal clustering, and a dynamic weighted PageRank algorithm is used to generate more accurate key node portraits.

[0035] Step S300: Aggregate the commodity full-node circulation record data, and after standardized protocol conversion processing, form a cross-platform integrated data set containing the commodity unique identifier and the operation timestamp, and obtain commodity propagation path data; In this embodiment, after generating a commodity distribution ecosystem map based on static commodity data, the commodity distribution path data is then updated based on dynamic data from the commodity distribution process. The commodity's full-node distribution record data includes distribution records across different e-commerce platforms and offline channels. Because different platforms use different data recording methods, it is necessary to unify the format of the data collected by different platforms through standardized protocols.

[0036] As an optional implementation method, full-node commodity circulation record data carrying the commodity unique identifier, operation timestamp and platform identifier is received, and the data is formatted using a data standardization protocol to obtain a standardized transaction record set in a unified format.

[0037] For example, an e-commerce platform might provide transaction records containing a product unique identifier (e.g., a UUID), an operation timestamp (e.g., 2025-07-2010:15:30), and a platform identifier (e.g., "PlatformA"). Offline channels, however, might generate records containing the same product unique identifier (e.g., a UUID) but in a different format through their POS systems. This heterogeneous data can be unified into a consistent format through a data standardization protocol. JSON Schema can be used to define a unified data structure, specifying fields such as product unique identifiers as strings, operation timestamps in ISO8601 format, and platform identifiers as fixed enumeration values. During conversion, the e-commerce platform's CSV data and the offline channel's XML data are parsed by a script and mapped into a standard JSON format. For example, a product's transaction record is converted from {"item_id":"12345","time":"2025 / 07 / 2010:15"} to {"uuid":"12345","timestamp":"2025-07-20T10:15:30Z","platform":"PlatformA"}, generating a standardized set of approximately 10,000 records. This unified format facilitates subsequent analysis and ensures data consistency across platforms.

[0038] As another optional implementation, after standardizing the data format, the timestamp records in the standardized transaction record set are cleaned to remove duplicate and invalid records, generating a time series dataset. The PageRank algorithm is used to calculate the ecological weight of the unique product identifiers in the time series dataset. If the ecological weight exceeds a preset threshold, a cross-platform integrated dataset is generated by combining channel associations and platform identifiers.

[0039] For example, duplicate records and invalid data are detected and processed. For example, if two duplicate records with the same operation timestamp of 2025-07-2010:15:30 are found, the earliest record is retained; invalid timestamps such as "2025-13-01" are discarded. After data cleaning, approximately 9,500 valid records are recorded, generating a time series dataset. The PageRank algorithm is then used to calculate ecological weights, measuring the importance of products in the trading network. The product's unique identifier serves as a node, and transaction records serve as edges, constructing a directed graph. For example, if product ID "12345" has 10 transactions on both e-commerce platforms and offline channels, the node weight is calculated using PageRank, with a damping coefficient of 0.85. After 8 iterations, the resulting weight is 0.015. If the node exceeds the preset threshold of 0.01, the product is considered a high-influence node. This analysis based on transaction frequency and connectivity can effectively identify hot-selling products in the supply chain, providing data support for inventory optimization.

[0040] The processed data is then integrated, linking product transaction records across different channels to construct a dataset encompassing the complete flow path. For example, the complete path of product "12345" from its sale on an e-commerce platform at 10:15 AM on July 20, 2025, to its completion in offline channels the following day is tracked. Analysis reveals that approximately 20% of products can be transferred across platforms within 24 hours, demonstrating efficient collaboration between channels and providing important insights for supply chain optimization. For example, analyzing the transaction paths of high-value products reveals that certain products are concentrated in offline channels in a specific region, suggesting opportunities for optimizing logistics distribution. This analysis supports precise inventory allocation and marketing strategy development, improving transaction efficiency.

[0041] As another optional implementation, after generating a cross-platform integrated data set, detect whether there is a data break. If so, extract the breakpoint and generate a breakpoint data set; perform node signature verification on the breakpoint data set. If the digital signature passes the integrity check, complete the missing data based on the transaction characteristics of adjacent operation timestamps; reconstruct the commodity propagation path based on the completed data to obtain complete commodity propagation path data.

[0042] For example, when integrating datasets across platforms, if data gaps are discovered, for example, a product on supply chain platform A records an outbound timestamp and unique product identifier (e.g., UUID: abc123) at 10:00 on July 1, 2025, but lacks a corresponding inbound record on platform B, time series analysis combined with node signature verification can be used to fill the gap. First, extract the time series data from platforms A and B. Suppose that platform A records {[t1=2025-07-01 10:00, UUID=abc123, Quantity=100, Status=Outbound], [t2=2025-07-01 12:00, UUID=abc123, Quantity=80, Status=In Transit]}, and platform B records {[t3=2025-07-01 14:00, UUID=abc123, Quantity=80, Status=Sold Outbound]}. It is discovered that the inbound link is missing between t1 and t3. Using a time series interpolation algorithm (such as linear interpolation), we calculate the possible timestamp t_missing between t2 and t3 using the formula t_missing = t2 + (t3 - t2) * 0.5 = 2025-07-01 13:00. We infer that the missing record likely occurred at this time. Next, combined with node signature verification, we check the node signature of Platform B (e.g., SHA-256 hash value: xyz789). We then query the blockchain log for consistency between the signatures before and after t3 to confirm that the data has not been tampered with. If the signatures match, we generate a complete record [t_missing = 2025-07-01 13:00, UUID = abc123, quantity = 80, status = in storage] and insert it into the Platform B dataset. If the signatures don't match, the validity of t_missing is inferred by correlating business data (such as shipping logs, assuming the logistics record shows a shipping completion time of 2025-07-01 12:30 and waybill number L123). This ultimately creates a complete propagation path {[t1, outbound], [t_missing, inbound], [t3, inventory]}. This method fills the data gaps and improves path integrity to over 99%, meeting supply chain tracking requirements.

[0043] Step S400: Analyze the transaction hash value and the operation timestamp in the commodity propagation path data, adjust the node connection weights in the commodity propagation ecological map, and generate a real-time updated commodity propagation ecological map; In this embodiment, the commodity propagation path data is generated based on the commodity circulation data collected from each supply chain, and the node connection weights of the commodity propagation ecological map are adjusted to generate a real-time updated commodity propagation ecological map.

[0044] As an optional implementation method, the transaction hash value and operation timestamp are obtained from the propagation path data, and the characteristic matrix of the node connection is obtained based on the initial weight of the node connection; according to the characteristic matrix, combined with the transaction frequency and propagation speed, the connection weight is dynamically adjusted to obtain an updated weight matrix; according to the weight matrix, combined with the operation timestamp, the node importance and propagation speed are analyzed to generate a real-time updated product propagation ecological map.

[0045] For example, let's collect transaction data. Assume a blockchain network generates 10,000 transactions daily. Each transaction contains a hash value (e.g., "0xabc123") and an operation timestamp (e.g., "2025-07-21 12:00:00"). An initial graph structure is constructed, where nodes represent transaction accounts (1,000 accounts) and edges represent transaction relationships. Initial weights are set to 1.0. The GraphSAGE algorithm is used to process the graph data and extract node features, including transaction frequency (account A averages 5 transactions per day), amount (mean 1,000 units), and time interval (the average interval between transactions is 3,600 seconds). The resulting feature matrix is ​​[[transaction frequency, mean amount, time interval], ...] = [5, 1,000, 3,600], [3, 1,500, 7,200], ...]. To update the edge weights based on time decay and transaction characteristics, we need to normalize the time difference. The time difference between account A and account B is 7200 seconds, which is normalized to 0.2 (range [0,1]). Combined with hash similarity (compared by the first 8 bits of the SHA-256 hash value, with a similarity of 0.8), the updated edge weights are: =0.6*(1-normalized time difference)+0.4*hash similarity=0.8 (where 0.6 and 0.4 are obtained based on the historical data training regression model). When dynamically adjusting the weight, an exponential decay function is used. ,λ=0.005s -1 , Δt is the time difference (seconds), if Δt=86400 (1 day), then The weight matrix is ​​obtained based on the adjusted weights. Finally, the weight matrix is ​​integrated with the dynamic graph structure of the timestamp to generate a commodity dissemination ecological map reflecting the latest transaction patterns.

[0046] Optionally, when analyzing the importance of nodes, you can use the PageRank algorithm, taking the weight matrix as input, the PageRank value of account A is 0.015 (assuming the threshold of 0.01 is a key node), and then analyze the propagation speed, for example, calculate the average path time difference, the average path time difference from path A to B to C Second.

[0047] It's important to note that nodes with high transaction frequency receive increased weight, reflecting their activity; edges with short transaction intervals receive higher weight, indicating close connections; and edges with high hash value similarity receive increased weight, indicating potential related transactions. For example, in anti-fraud detection, edges with abnormal weights (above 0.9 or below 0.1) trigger alerts, and fraud patterns are analyzed in combination with historical data to ensure that the graph reflects the dynamics of the ecosystem in real time.

[0048] Step S500: Perform anomaly detection and blockchain verification on the real-time updated commodity dissemination ecological map, identify trusted nodes and trusted paths, and generate a commodity traceability report.

[0049] In this embodiment, in order to ensure the accuracy of the data, it is also necessary to perform anomaly detection and blockchain detection on the product dissemination ecological map, and finally generate a product traceability report.

[0050] As an optional implementation method, transaction feature data of the target propagation path is extracted from the real-time updated commodity propagation ecological map, including transaction hash value sequence and operation timestamp sequence; the time interval distribution characteristics of adjacent transactions are calculated based on the operation timestamp sequence, and combined with the correlation relationship of the transaction hash value sequence, anomaly detection is performed to determine suspicious transaction nodes; digital signature verification and conflict rule verification are performed on the suspicious transaction nodes, and an authenticity verification report is generated based on the verification results.

[0051] For example, within the real-time, updated commodity distribution ecosystem, the complete transaction path data for target item G123 was first extracted, including transaction hash sequences (e.g., 0x7b9a...3f2c, 0x8c4b...5d1a, etc.) and corresponding operation timestamps (three transaction records between 12:06:00 and 12:10:15 on July 21, 2025). Analysis of the time intervals between adjacent transactions revealed that the transfer from node B2 to C3 took only 90 seconds, significantly shorter than the historical average of 300 seconds for this logistics route. Furthermore, the transaction amount was detected to have suddenly increased to 600 kg, exceeding the daily inventory capacity of node C3 by 150%. Using the isolation forest algorithm to detect anomalies in the time intervals and transaction frequency, the anomaly score for node C3 reached 0.65 (with a threshold of 0.6), triggering a risk warning. Subsequent in-depth verification revealed that while the digital signature of transaction hash 0x8c4b...5d1a passed ECDSA verification, it was discovered that node C3's operating qualification certificate had expired and duplicate transactions with the same timestamp existed, violating blockchain anti-replay rules. The resulting authenticity verification report revealed the trusted propagation path was A1→B2→D4. Node C3 was identified as a risky node due to unreasonable shipping times, inventory anomalies, and identity verification failures. The associated transaction 0x8c4b...5d1a was marked invalid on the blockchain.

[0052] As another optional implementation, based on the authenticity verification report, the trusted nodes verified by node signatures and the trusted paths based on the blockchain structure in the commodity dissemination ecological map are marked to generate the commodity traceability report.

[0053] For example, based on the authenticity verification report's results, the product distribution ecosystem is dynamically annotated and path reconstructed. First, nodes that have passed digital signature verification and have no business conflicts (e.g., farm A1, logistics provider B2, supermarket D4) are marked as green trusted nodes, with their node icons indicating a valid digital certificate. Node C3, which failed verification, is marked as a red abnormal node, and all associated transaction edges are hidden. Leveraging the blockchain's immutable nature, the distribution path A1→B2→D4, consisting of consecutive trusted nodes, is automatically extracted. The edges along this path are bolded and displayed in blue, with the corresponding transaction hash's on-chain time annotated next to each edge (e.g., edge B2→D4 displays "0x9d5c...6e3b | 2025-07-21 12:10:15"). The resulting product traceability report includes three core modules: a visual trusted path map highlighting the legitimate product distribution process from production to sales; a detailed abnormal transaction list detailing the reasons for node C3 verification failures (including specific detection indicators such as certificate expiration and time conflicts); and blockchain evidence, listing the block heights (#782341, #782345) and Merkle tree verification paths of all trusted transactions. This report is stored both in PDF and on the blockchain. Consumers can scan the product QR code to view the CA-certified electronically signed report and verify its authenticity in real time using the Ethereum smart contract address 0x5a3...e8f.

[0054] In this embodiment, by integrating blockchain and graph database technology, credible evidence storage of commodity data throughout its life cycle, dynamic tracking of transmission relationships, and risk detection are achieved, ultimately achieving the technical effect of transparent traceability of the entire supply chain and assurance of transaction authenticity. Example 2

[0055] Based on the first embodiment, another embodiment of the present application is proposed, referring to Figure 2 , performing anomaly detection and blockchain verification on the real-time updated commodity dissemination ecological map, identifying trusted nodes and trusted paths, and generating a commodity traceability report also includes the following steps: Step S510: performing anomaly detection on the real-time updated commodity dissemination ecological map, identifying trusted nodes, and generating authenticity verification results; In this embodiment, through the deep collaboration of blockchain and graph database, intelligent identification of trusted nodes and accurate restoration of transmission paths in the commodity circulation process are achieved, and finally a commodity traceability report with a complete blockchain verification evidence chain is generated.

[0056] As an optional implementation, a dynamic graph neural network analyzes node behavioral characteristics, including transaction frequency, time interval, and associated path topology. A pre-trained anomaly detection model (e.g., a combination of an isolation forest and time series prediction algorithm) is used to calculate an anomaly score for each node. Nodes with abnormal transaction timestamps (e.g., short-term high-frequency trading), path conflicts (e.g., closed-loop transactions), or signature verification failures are automatically flagged as suspicious. The blockchain network then verifies the transaction hash associated with the suspicious node to verify that it is included in a legitimate block and has not been tampered with. Nodes that simultaneously meet the following criteria: a digital signature that passes ESDSA verification, a transaction hash that exists on the blockchain with ≥6 block confirmations, a timestamp sequence that conforms to business logic (e.g., logistics time ≥ geographic distance / minimum transport speed), and a failure to trigger anomaly detection rules (anomaly score < 0.5) are deemed untrusted. The authenticity verification results include a list of trusted nodes, details about the anomalous node, and a chain of evidence for verification.

[0057] For example, in a mineral water product traceability scenario, a real-time, updated communication ecosystem map automatically detected unusual trading behavior within a 24-hour period at a particular distributor node. This node typically processed an average of three to four transactions per day, but the system detected 12 consecutive mineral water outbound transactions within a short period of time. The intervals between transactions fluctuated erratically, with the shortest interval between transactions being just 15 minutes. A deep verification process was immediately initiated, first verifying the validity of the digital signatures of these transactions. The ECDSA signature of each transaction was verified using the pre-installed distributor digital certificate to confirm its authenticity. The blockchain network was then queried to verify that all transaction hashes had been consolidated and uploaded to the blockchain. The earliest transaction, 0xa1b2...c3d4, had received 28 block confirmations, and the latest, 0xd4e5...f6g7, had received six block confirmations. The block timestamp sequence indicated that the transactions were uploaded to the blockchain in normal chronological order.

[0058] Further analysis of the logistics information associated with the transaction revealed a complete transportation trajectory for this batch of mineral water. GPS track data from the production base to the regional warehouse and then to various distribution outlets matched the transaction timestamps accurately. Temperature monitoring data also showed that the temperature remained within the specified range of 15-25 degrees Celsius throughout the entire transportation process. Despite the unusual transaction frequency, the system ultimately marked the distributor's node as trusted, taking into account blockchain verification results, logistics data, and environmental monitoring records. In the generated mineral water traceability report, this node appears as a green trusted node and is accompanied by a complete chain of verification evidence, including a transaction hash list, block height, logistics track map, and temperature records. The unusual transaction frequency event was noted in the remarks column, with a recommendation for subsequent manual review of the transaction's legitimacy. The entire verification process ensured both traceability efficiency and the credibility of the results through multi-dimensional cross-validation.

[0059] Step S520: Based on the authenticity verification result, obtain the unique identifier of the product and the transaction hash value from the blockchain network to generate a trusted transaction record; Step S530: extracting the operation timestamp and blockchain structure of the trusted transaction record, determining the block location and associated path of the transaction hash value, and obtaining trusted path data; Step S540: Mark the trusted nodes in the communication ecological map according to the trusted path data and the node signature verification result, and generate path marking data including the unique identifier of the product and the transaction hash value; Step S550: Integrate the operation timestamp and the transaction hash value through the path tag data to generate the product traceability report.

[0060] In this embodiment, after the authenticity verification result is generated, blockchain verification is also required to ensure that each circulation link is cryptographically notarized by the distributed ledger, so that the final product traceability report has the ability to be independently verified.

[0061] As an optional implementation, the unique identifier of the product and the transaction hash value are obtained from the blockchain network, and the data integrity of the unique identifier of the product and the transaction hash value is determined through digital signature verification to obtain a trusted transaction record. The timestamp record and blockchain structure are extracted based on the trusted transaction record, and the block location and associated path of the transaction hash value are determined through on-chain data query to obtain trusted path data. The trusted path data and node signature verification results are used to mark the trusted nodes in the propagation ecosystem map, and path marking data containing the unique identifier of the product and the transaction hash value is generated. The timestamp record and the transaction hash value are integrated with the path marking data to generate a product traceability report containing the timestamp record of the unique identifier of the product and the transaction hash value, and the final traceability report data is obtained.

[0062] For example, during the product traceability report generation process, trusted nodes are first identified through node signature verification. Assuming a supply chain consisting of manufacturer A, logistics provider B, and retailer C, each node uses the ECDSA algorithm (Elliptic Curve Digital Signature Algorithm) to generate a public-private key pair. The private key signs the data, and the public key verifies the signature's authenticity. Assuming manufacturer A's public key is 0x1a2b..., a SHA-256 hash is performed on the product batch data (batch number P12345, production date 2025-01-01) to generate the hash value H1 = 0x4f5e..., which is then signed with the private key to obtain S1. After receiving the data, logistics provider B and retailer C use A's public key to verify that S1 matches H1, confirming A as a trusted node. Next, a trusted path is determined based on a blockchain-based architecture. The blockchain uses Hyperledger Fabric, which records transactions at each node, forming a chain with a block height of 1000. The transaction record for item A to item B is Tx1 (transaction hash value 0x7b8c..., operation timestamp 2025-01-02 10:00:00), and the transaction record for item B to item C is Tx2 (transaction hash value 0x9d2e..., operation timestamp 2025-01-03 15:00:00). By querying the block height and transaction hash value, the continuity of Tx1 and Tx2 is verified to ensure that the path has not been tampered with. Finally, a traceability report is generated, including the item's unique identifier (UUID: G123456789), timestamp record (2025-01-01 08:00:00 to 2025-01-03 15:00:00), and transaction hash values ​​(0x7b8c... and 0x9d2e...). The report is output in JSON format and contains the following fields: {"Product ID":"G123456789","Timestamp":["2025-01-01 08:00:00","2025-01-03 15:00:00"], "Transaction Hash":["0x7b8c..."","0x9d2e..."]}.

[0063] It should be noted that if a node signature verification fails, for example, H1 and S1 do not match, the node is marked as untrusted and the path is removed. If a blockchain query finds a break between Tx1 and Tx2, the path is untrusted, report generation fails, and the business-related exception handling mechanism is triggered, notifying the administrator to re-verify data integrity through the API interface.

[0064] In this embodiment, cryptographic signatures and the tamper-proof characteristics of blockchain are used to build a full-link trusted evidence chain from production to sales of goods, ensuring the authenticity and integrity of commodity circulation data and preventing data forgery or tampering in each link of the supply chain. Example 3

[0065] In an embodiment of the present application, a product traceability device based on blockchain is proposed.

[0066] Reference Figure 3 , Figure 3 This is a schematic diagram of the terminal structure of the hardware operating environment involved in an embodiment of the present application.

[0067] like Figure 3 As shown, the control terminal may include: a processor 1001, such as a CPU, a network interface 1003, a memory 1004, and a communication bus 1002. The communication bus 1002 is used to enable communication between these components. The network interface 1003 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1004 may be a high-speed RAM memory or a non-volatile memory, such as a disk drive. The memory 1004 may also be a storage device independent of the processor 1001.

[0068] Those skilled in the art will understand that Figure 3 The terminal structure shown in the figure does not constitute a limitation to the terminal, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0069] like Figure 3 As shown, the memory 1004 as a computer storage medium may include an operating system, a network communication module, and a product traceability program based on blockchain.

[0070] exist Figure 3 In the hardware structure of the blockchain-based commodity traceability device shown, the processor 1001 can call the blockchain-based commodity traceability program stored in the memory 1004 and perform the following operations: Obtain product information data, product unique identification data and chain timestamp, generate product unique identification, and generate a distributed ledger based on the product unique identification, transaction hash value and operation timestamp; Based on the transaction data in the distributed ledger, a blockchain commodity dissemination ecological map is constructed using graph database technology; Aggregate commodity full-node circulation record data, and after standardized protocol conversion processing, form a cross-platform integrated data set containing the commodity unique identifier and the operation timestamp, and obtain commodity propagation path data; Analyze the transaction hash value and the operation timestamp in the commodity propagation path data, adjust the node connection weights in the commodity propagation ecological map, and generate a real-time updated commodity propagation ecological map; Anomaly detection and blockchain verification are performed on the real-time updated commodity dissemination ecological map to identify trusted nodes and trusted paths and generate a commodity traceability report.

[0071] Optionally, the processor 1001 may call a blockchain-based product traceability program stored in the memory 1004 and further perform the following operations: Obtaining the commodity full-node circulation record data and converting the format based on the data standardization protocol to generate the cross-platform integrated data set; Detecting whether there is data breakage in the cross-platform integrated dataset, and if so, extracting breakpoints to generate a breakpoint dataset; Perform node signature verification on the breakpoint dataset. If the digital signature passes the integrity check, the missing data is completed based on the transaction characteristics of adjacent operation timestamps. The product propagation path is reconstructed based on the completed data to obtain complete product propagation path data.

[0072] Optionally, the processor 1001 may call a blockchain-based product traceability program stored in the memory 1004 and further perform the following operations: Extracting transaction feature data of the target propagation path from the commodity propagation ecological map, wherein the transaction feature data includes a transaction hash value sequence and an operation timestamp sequence; Calculating the time interval distribution characteristics of adjacent transactions based on the operation timestamp sequence, and combining the correlation relationship of the transaction hash value sequence to perform anomaly detection and determine suspicious transaction nodes; Perform digital signature verification and conflict rule verification on the suspicious transaction node, and generate an authenticity verification report based on the verification results; Blockchain verification is performed based on the authenticity verification report, the trusted path is identified, and the product traceability report is generated.

[0073] Optionally, the processor 1001 may call a blockchain-based product traceability program stored in the memory 1004 and further perform the following operations: Perform anomaly detection on the real-time updated commodity dissemination ecological map, identify trusted nodes, and generate authenticity verification results; Based on the authenticity verification result, obtaining the unique identifier of the product and the transaction hash value from the blockchain network to generate a trusted transaction record; Extracting the operation timestamp and blockchain structure of the trusted transaction record, determining the block location and associated path of the transaction hash value, and obtaining trusted path data; Mark the trusted nodes in the communication ecological map according to the trusted path data and the node signature verification result, and generate path marking data containing the unique identifier of the commodity and the transaction hash value; The operation timestamp and the transaction hash value are integrated through the path mark data to generate the product traceability report.

[0074] Optionally, the processor 1001 may call a blockchain-based product traceability program stored in the memory 1004 and further perform the following operations: Obtain the transaction hash value, operation timestamp, and product unique identifier from the transaction data, and use a graph database to store nodes and edges, where the nodes represent the product unique identifier, the edges represent the transaction hash value, and the edge attributes include the operation timestamp, to obtain an initial set of product propagation nodes and edges; Based on the commodity propagation nodes and edge sets, a blockchain structure is constructed, and a propagation direction attribute is added to each edge to determine a blockchain link graph of the commodity propagation path; Calculating the transaction frequency and ecological relevance of nodes in the blockchain link graph, obtaining node weights and propagation path lengths, and obtaining a propagation path graph including node weights and path lengths; If the node weight in the propagation path map is greater than a preset weight threshold, the propagation path map is partitioned to obtain a subgraph of the propagation direction and ecological association to generate the commodity propagation ecological map.

[0075] Optionally, the processor 1001 may call a blockchain-based product traceability program stored in the memory 1004 and further perform the following operations: Obtaining the transaction hash value and the operation timestamp, and obtaining a feature matrix of the node connections based on the initial weights of the node connections; According to the feature matrix, combined with transaction frequency and propagation speed, the connection weights are dynamically adjusted to obtain an updated weight matrix; According to the weight matrix, combined with the operation timestamp, the node importance and propagation speed are analyzed to generate a real-time updated ecological map of the commodity propagation.

[0076] Optionally, the processor 1001 may call a blockchain-based product traceability program stored in the memory 1004 and further perform the following operations: Obtain the unique product identifiers, transaction hash values, and operation timestamps of different product source nodes in the distributed ledger to obtain a preliminary data set; Comparing the commodity unique identifiers and the transaction hash values ​​of different commodity source nodes in the preliminary data set, and generating a conflict record set based on the comparison result; A consistency check is performed on the conflicting record set, the record with the earliest operation timestamp in the unique identifier of the same product is retained and other conflicting records are removed to obtain a unified distributed ledger.

[0077] In addition, to achieve the above objectives, an embodiment of the present invention further provides a blockchain-based product traceability system comprising: The product data collection and identification generation module is used to obtain product information data, product unique identification data and chain timestamp, and generate a standardized product unique identification; A distributed ledger construction and storage module, configured to generate a distributed ledger based on the unique identifier of the commodity, the transaction hash value, and the operation timestamp, and to complete distributed storage of the ledger; A commodity dissemination ecological map construction and optimization module is used to construct a commodity dissemination ecological map based on the distributed ledger, and dynamically adjust node weights by analyzing the transaction hash value and the operation timestamp to achieve real-time updating of the map; Anomaly detection and trusted verification module, used to detect anomalies in the commodity dissemination ecological map and identify trusted nodes and trusted paths through blockchain verification technology; The traceability analysis and report generation module is used to integrate anomaly detection and trusted verification results to generate a complete product traceability report.

[0078] In addition, to achieve the above-mentioned purpose, an embodiment of the present invention also provides a terminal device, including a memory, a processor, and a blockchain-based product traceability program stored on the memory and runnable on the processor. When the processor executes the blockchain-based product traceability program, the blockchain-based product traceability method as described above is implemented.

[0079] In addition, to achieve the above-mentioned purpose, an embodiment of the present invention also provides a computer-readable storage medium, on which a blockchain-based product traceability program is stored. When the blockchain-based product traceability program is executed by a processor, the blockchain-based product traceability method as described above is implemented.

[0080] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0081] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0082] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0083] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0084] It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claim. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The present application may be implemented by means of hardware comprising several distinct components and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second and third etc. does not indicate any order. These words may be interpreted as names.

[0085] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application.

[0086] Obviously, those skilled in the art may make various changes and modifications to the present application without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present application fall within the scope of the claims and their equivalents, the present application is intended to include such modifications and variations.

Claims

1. A commodity traceability method based on blockchain, characterized in that: The method comprises: Obtain product information data, product unique identification data and chain timestamp, generate product unique identification, and generate a distributed ledger based on the product unique identification, transaction hash value and operation timestamp; Based on the transaction data in the distributed ledger, a blockchain commodity dissemination ecological map is constructed using graph database technology; Aggregate commodity full-node circulation record data, and after standardized protocol conversion processing, form a cross-platform integrated data set containing the commodity unique identifier and the operation timestamp, and obtain commodity propagation path data; Analyze the transaction hash value and the operation timestamp in the commodity propagation path data, adjust the node connection weights in the commodity propagation ecological map, and generate a real-time updated commodity propagation ecological map; Anomaly detection and blockchain verification are performed on the real-time updated commodity dissemination ecological map to identify trusted nodes and trusted paths and generate a commodity traceability report.

2. The blockchain-based commodity traceability method according to claim 1, characterized in that: The steps of aggregating the commodity full-node circulation record data and converting it into a cross-platform integrated data set containing the commodity unique identifier and the operation timestamp after standardized protocol conversion to obtain the commodity propagation path data include: Obtaining the commodity full-node circulation record data and converting the format based on the data standardization protocol to generate the cross-platform integrated data set; Detecting whether there is data breakage in the cross-platform integrated dataset, and if so, extracting breakpoints to generate a breakpoint dataset; Perform node signature verification on the breakpoint dataset. If the digital signature passes the integrity check, the missing data is completed based on the transaction characteristics of adjacent operation timestamps. The product propagation path is reconstructed based on the completed data to obtain complete product propagation path data.

3. The blockchain-based commodity traceability method according to claim 1, characterized in that: The steps of performing anomaly detection and blockchain verification on the real-time updated commodity dissemination ecological map, identifying trusted nodes and trusted paths, and generating a commodity traceability report include: Extracting transaction feature data of the target propagation path from the commodity propagation ecological map, wherein the transaction feature data includes a transaction hash value sequence and an operation timestamp sequence; Calculating the time interval distribution characteristics of adjacent transactions based on the operation timestamp sequence, and combining the correlation relationship of the transaction hash value sequence to perform anomaly detection and determine suspicious transaction nodes; Perform digital signature verification and conflict rule verification on the suspicious transaction node, and generate an authenticity verification report based on the verification results; Blockchain verification is performed based on the authenticity verification report, the trusted path is identified, and the product traceability report is generated.

4. The blockchain-based commodity traceability method according to claim 1, wherein: The steps of performing anomaly detection and blockchain verification on the real-time updated commodity dissemination ecological map, identifying trusted nodes and trusted paths, and generating a commodity traceability report also include: Perform anomaly detection on the real-time updated commodity dissemination ecological map, identify trusted nodes, and generate authenticity verification results; Based on the authenticity verification result, obtaining the unique identifier of the product and the transaction hash value from the blockchain network to generate a trusted transaction record; Extracting the operation timestamp and blockchain structure of the trusted transaction record, determining the block location and associated path of the transaction hash value, and obtaining trusted path data; Mark the trusted nodes in the communication ecological map according to the trusted path data and the node signature verification result, and generate path marking data containing the unique identifier of the commodity and the transaction hash value; The operation timestamp and the transaction hash value are integrated through the path mark data to generate the product traceability report.

5. The blockchain-based commodity traceability method according to claim 1, wherein: The step of constructing a blockchain commodity dissemination ecological map using graph database technology based on the transaction data in the distributed ledger includes: Obtaining the transaction hash value, operation timestamp, and product unique identifier from the transaction data, and using a graph database to store nodes and edges to obtain an initial set of product propagation nodes and edges; the nodes represent the product unique identifier, the edges represent the transaction hash value, and the edge attributes include the operation timestamp; Based on the commodity propagation nodes and edge sets, a blockchain structure is constructed, and a propagation direction attribute is added to each edge to determine a blockchain link graph of the commodity propagation path; Calculating the transaction frequency and ecological relevance of nodes in the blockchain link graph, obtaining node weights and propagation path lengths, and obtaining a propagation path graph including node weights and path lengths; If the node weight in the propagation path map is greater than a preset weight threshold, the propagation path map is partitioned to obtain a subgraph of the propagation direction and ecological association to generate the commodity propagation ecological map.

6. The blockchain-based commodity traceability method according to claim 1, wherein: The step of analyzing the transaction hash value and the operation timestamp in the commodity propagation path data, adjusting the node connection weights in the commodity propagation ecological map, and generating a real-time updated commodity propagation ecological map includes: Obtaining the transaction hash value and the operation timestamp, and obtaining a feature matrix of the node connections based on the initial weights of the node connections; According to the feature matrix, combined with transaction frequency and propagation speed, the connection weights are dynamically adjusted to obtain an updated weight matrix; According to the weight matrix, combined with the operation timestamp, the node importance and propagation speed are analyzed to generate a real-time updated ecological map of the commodity propagation.

7. The blockchain-based commodity traceability method according to claim 1, wherein: After the steps of obtaining product information data, product unique identification data and on-chain timestamp, generating a product unique identification, and generating a distributed ledger based on the product unique identification, transaction hash value and operation timestamp, the following steps are included: Obtain the unique product identifiers, transaction hash values, and operation timestamps of different product source nodes in the distributed ledger to obtain a preliminary data set; Comparing the commodity unique identifiers and the transaction hash values ​​of different commodity source nodes in the preliminary data set, and generating a conflict record set based on the comparison result; A consistency check is performed on the conflicting record set, the record with the earliest operation timestamp in the unique identifier of the same product is retained and other conflicting records are removed to obtain a unified distributed ledger.

8. A blockchain-based commodity traceability system, characterized by: The system comprises: The product data collection and identification generation module is used to obtain product information data, product unique identification data and chain timestamp, and generate a standardized product unique identification; A distributed ledger construction and storage module is used to generate a distributed ledger based on the unique identifier of the commodity, the transaction hash value, and the operation timestamp, and complete the distributed storage of the ledger; A commodity dissemination ecological map construction and optimization module is used to construct a commodity dissemination ecological map based on the distributed ledger, and dynamically adjust node weights by analyzing the transaction hash value and the operation timestamp to achieve real-time updating of the map; Anomaly detection and trusted verification module, used to detect anomalies in the commodity dissemination ecological map and identify trusted nodes and trusted paths through blockchain verification technology; The traceability analysis and report generation module is used to integrate anomaly detection and trusted verification results to generate a complete product traceability report.

9. A terminal device, characterized in that: The present invention comprises a memory, a processor, and a blockchain-based product traceability program stored in the memory and executable on the processor. When the processor executes the blockchain-based product traceability program, the method described in any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a blockchain-based product traceability program, and when the blockchain-based product traceability program is executed by the processor, the method described in any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Intelligent contract collaboration method for cross-chain transaction

    CN120996812A

  • A cross-chain transaction-oriented smart contract collaboration method

    CN120996812B

  • Commodity traceability management intelligent anti-counterfeiting method and system based on Internet of Things

    CN121391301A