A blockchain-based cross-border e-commerce commodity traceability method and system

By using blockchain technology to generate unique traceability codes and anti-counterfeiting hash values ​​for cross-border e-commerce products, combined with encrypted signatures and anomaly detection, and real-time monitoring of logistics nodes, the problem of data tampering and transparency in traditional traceability methods is solved, realizing full-process reliable traceability and transparent monitoring of products.

CN121120097BActive Publication Date: 2026-06-19GUANGZHOU DORA TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGZHOU DORA TECH CO LTD
Filing Date
2025-09-16
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Traditional cross-border e-commerce traceability methods rely on centralized data storage, which is easily tampered with and cannot monitor the status of goods in real time. This makes it difficult to guarantee the authenticity of goods and the transparency of the supply chain, and also results in insufficient protection of data privacy.

Method used

Blockchain technology is used to generate unique traceability codes for cross-border e-commerce products. Cryptographic hash algorithms and digital signatures are used to ensure that the data is tamper-proof. Anomaly detection algorithms are combined to monitor logistics nodes in real time, and zero-knowledge proofs are used to achieve efficient privacy verification and display the traceability path.

Benefits of technology

It enables full-process credible traceability of cross-border e-commerce goods, ensuring product authenticity and supply chain transparency. The traceability path is displayed through a visual interface, providing transparent and credible product information and supply chain monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121120097B_ABST
    Figure CN121120097B_ABST
Patent Text Reader

Abstract

This application relates to the technical field of cross-border logistics, disclosing a blockchain-based method and system for tracing the origin of cross-border e-commerce goods. The method includes the following steps: generating a unique traceability code for each cross-border e-commerce product; extracting the original information fields of the product; calculating an anti-counterfeiting hash value; structurally encapsulating the original information fields and anti-counterfeiting hash value according to a preset template; confirming the transaction through a consensus mechanism and writing it to the blockchain to generate a block hash value; collecting operational information from each logistics node; identifying anomalies through an anomaly detection algorithm; encrypting and storing the data fingerprints after anomaly identification; submitting the encrypted and signed operational information to the blockchain network; blockchain nodes verify the validity of the digital signature using the producer's public key and verify its legality through a consensus mechanism; and aggregating the verification results using zero-knowledge proofs. This application demonstrates a complete traceability path, achieving transparent management of the entire chain from production to consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of cross-border logistics, and in particular to a blockchain-based method and system for tracing the origin of cross-border e-commerce goods. Background Technology

[0002] Amid the booming global digital economy, cross-border e-commerce, as an important innovative business model in the internet economy, is reshaping the international trade landscape at an unprecedented pace. This new trade model has not only spawned entirely new consumer markets, but also, against the backdrop of deepening economic globalization, is driving increasingly close trade ties between countries around the world, becoming the mainstream trend and core driving force of contemporary international trade development.

[0003] Cross-border e-commerce goods refer to products traded internationally through cross-border e-commerce platforms. These goods typically involve cross-border logistics, payment, and compliance processes. With globalization and the development of internet technology, cross-border e-commerce provides consumers with more convenient global shopping channels and opens up broader international markets for merchants. This industry covers a wide range of product types, including but not limited to electronics, clothing, cosmetics, and home furnishings. It involves multiple areas such as international payment systems, cross-border logistics, and customs management, and is an important part of global trade. Because cross-border e-commerce goods circulate between multiple countries and involve multiple stakeholders, they are prone to problems such as counterfeit and substandard products, unclear origins, and opaque logistics processes. Therefore, it is necessary to establish a traceability mechanism to ensure the authenticity of goods, the traceability of the circulation process, and consumer trust.

[0004] Traditional traceability methods often rely on centralized data storage, which is easily tampered with or forged, and cannot monitor the status of goods at each logistics node in real time, making it difficult to guarantee the authenticity of goods and the transparency of the supply chain. At the same time, there are also risks in data privacy protection, as it is difficult to verify without leaking information. Summary of the Invention

[0005] To address the problems that traditional traceability methods often rely on centralized data storage, which is susceptible to tampering or forgery, and cannot monitor the status of goods at various logistics nodes in real time, making it difficult to guarantee the authenticity of goods and the transparency of the supply chain, this application provides a blockchain-based cross-border e-commerce product traceability method and system.

[0006] Firstly, this application provides a blockchain-based method for tracing the origin of cross-border e-commerce goods. This method includes the following steps:

[0007] S1. In the production process of cross-border e-commerce goods, a unique traceability code is generated for each cross-border e-commerce product, the original information fields of the cross-border e-commerce product are extracted, and the anti-counterfeiting hash value is calculated using a cryptographic hash algorithm.

[0008] S2. The original information fields and anti-counterfeiting hash values ​​are encapsulated in a structured manner according to a preset template. The producer's private key is used for digital signature. After verifying the signature, the blockchain node confirms the transaction through the consensus mechanism and writes it into the blockchain, generating a block hash value.

[0009] S3. In the cross-border e-commerce commodity circulation process, the operation information of each logistics node is collected in real time, the block hash value is used as the data fingerprint, and anomalies are identified through an anomaly detection algorithm. The blockchain node encrypts and stores the data fingerprint after anomaly identification, and the producer uses the node's private key to generate a digital signature.

[0010] S4. Submit the encrypted and signed operation information to the blockchain network. The blockchain nodes verify the validity of the digital signature using the producer's public key and verify its legality through the consensus mechanism. After verification, the transaction is recorded in the blockchain nodes.

[0011] S5. By inputting a unique traceability code, the blockchain node verifies the authenticity of the product, traces back the transaction records of the logistics nodes in chronological order, aggregates the verification results using zero-knowledge proofs, and displays a visual interface showing the product traceability path.

[0012] Optionally, in the production stage of cross-border e-commerce goods, a unique traceability code is generated for each cross-border e-commerce product, the original information fields of the cross-border e-commerce product are extracted, and an anti-counterfeiting hash value is calculated using a cryptographic hash algorithm, including the following steps:

[0013] S11. Generate a unique traceability code for each product during the production stage, including the production batch number, raw material code, and quality inspection report number.

[0014] S12. Extract the production date, origin coordinates, and equipment number as raw information;

[0015] S13. Based on the unique traceability code, use the cryptographic hash algorithm to calculate the original information and generate a unique anti-counterfeiting hash value;

[0016] S14. Store the original information and anti-counterfeiting hash value in the manufacturer's off-chain encrypted database, and mark the anti-counterfeiting hash value as to be uploaded to the chain and store it in the Redis cache queue.

[0017] Optionally, the original information fields and anti-counterfeiting hash values ​​are structurally encapsulated according to a preset template, and digital signatures are performed using the producer's private key. After verifying the signature, the blockchain node confirms the transaction through the consensus mechanism and writes it into the blockchain. Generating a block hash value includes the following steps:

[0018] S21. Using a preset standard structure template, the original information fields and anti-counterfeiting hash values ​​are structured and encapsulated to generate a standardized data packet;

[0019] S22. Digitally sign the standardized data packet using the private key held by the producer;

[0020] S23. Encapsulate structured data, digital signatures, and timestamps into complete transaction data and broadcast it to blockchain nodes for verification. The producer's public key can be obtained through public records on the blockchain.

[0021] S24. After receiving the transaction data, the blockchain node uses the producer's public key to verify the digital signature, ensuring that the data has not been tampered with and was initiated by the producer.

[0022] S25. After verification, the blockchain node verifies the transaction content through the IBFT consensus mechanism and packages the verified transaction content into a new block to generate a block hash value.

[0023] Optionally, after receiving the transaction data, the blockchain node uses the producer's public key to verify the digital signature, ensuring that the data has not been tampered with and was initiated by the producer, including the following steps:

[0024] S241. Blockchain nodes receive broadcast transaction data and extract the producer's public key from the transaction data.

[0025] S242. Verify the digital signature using the producer's public key to obtain the hash value of the transaction data;

[0026] S243. Blockchain nodes recalculate the hash value of transaction data to generate a new hash value;

[0027] S244. Compare the verified hash value with the hash value calculated by the blockchain node;

[0028] S245. When the comparison results match, it proves that the digital signature is valid, the transaction data has not been modified, and it was indeed initiated by the producer. After verification, the transaction is marked as valid.

[0029] Optionally, in the cross-border e-commerce commodity circulation process, operational information of each logistics node is collected in real time, the block hash value is used as the data fingerprint, and anomalies are identified through an anomaly detection algorithm. The blockchain node encrypts and stores the data fingerprint after anomaly identification, and the producer uses the node's private key to generate a digital signature, including the following steps:

[0030] S31. Collect and store operational information of each logistics node in the cross-border e-commerce commodity circulation process;

[0031] S32. Each operation message will be assigned a block hash value as a data fingerprint, whereby the data fingerprint is the unique identifier of the operation record;

[0032] S33. By extracting the feature vector of the operation information, training the anomaly recognition model, continuously updating the weight of the feature vector, and combining it with the generalization risk function to calculate the anomaly score.

[0033] S34. Based on the anomaly score, perform cluster analysis on the feature vector of the operation information, and combine it with the preset dynamic threshold to determine whether there is abnormal behavior.

[0034] S35. Based on the judgment result, encrypt and protect all operation information marked as normal or abnormal, and at the same time use the producer's private key to generate a digital signature for each operation information.

[0035] S36. The encrypted and signed operation information is submitted to the blockchain network. The blockchain nodes verify the validity of the digital signature through the producer's public key and confirm the legality of the data through the IBFT consensus mechanism.

[0036] Alternatively, the expression for the generalized risk function is:

[0037] ;

[0038] In the formula, This indicates the risk of the anomaly detection model generalizing the feature vectors of operational information across various logistics nodes. This represents the empirical risk of the anomaly detection model on the training data; n represents the number of operational information items collected. Indicates the complexity of the anomaly detection model; Represents any specified low probability value; Represents the natural constant.

[0039] Optionally, the expression for calculating the anomaly score is:

[0040] ;

[0041] In the formula, This indicates an abnormal metric value for operational information; This indicates the risk of the anomaly detection model generalizing the feature vectors of operational information across various logistics nodes. This represents the inverse function output of the i-th classifier on the feature vector; The confidence weight assigned to the feature vector by the m-th classifier is given; M represents the total number of weak classifiers; and m represents the m-th weak classifier.

[0042] Optionally, by inputting a unique traceability code, blockchain nodes verify the authenticity of goods, trace back transaction records of logistics nodes in chronological order, aggregate verification results using zero-knowledge proofs, and display a visual interface showing the product traceability path, including the following steps:

[0043] S51. When the verifier enters the unique traceability code of the cross-border e-commerce product, the blockchain node reads the corresponding data fingerprint.

[0044] S52. Verify the authenticity of cross-border e-commerce goods through numerical signatures and anti-counterfeiting hash values;

[0045] S53. Blockchain nodes record the transactions of each logistics node in chronological order, verify the authenticity and continuity of the cross-border e-commerce goods processing process one by one, and finally generate a zero-knowledge proof to efficiently and privately prove the validity of the entire chain.

[0046] S54. Build a visual display interface that dynamically shows the traceability path of cross-border e-commerce products.

[0047] Optionally, blockchain nodes trace back the transaction records of each logistics node in chronological order, verifying the processing of cross-border e-commerce goods at each logistics node one by one, and aggregating the verification results through zero-knowledge proofs, including the following steps:

[0048] S531. Locate the initial data fingerprint of the product on the blockchain based on the traceability code;

[0049] S532. Starting from the production stage, extract the transaction records of logistics nodes in sequence, including transportation, customs clearance, warehousing and distribution.

[0050] S533. Extract the verification elements of all logistics transactions and construct a zero-knowledge proof circuit to verify the signature validity and hash chain continuity of each transaction.

[0051] S534. Map the verification elements to the input of the zero-knowledge proof circuit, perform aggregation encoding, and generate an aggregated zero-knowledge proof.

[0052] S535. Submit a zero-knowledge proof to a smart contract on the blockchain, which will then verify the proof and provide the result.

[0053] Secondly, this application also provides a blockchain-based cross-border e-commerce product traceability system, which is implemented based on the aforementioned blockchain-based cross-border e-commerce product traceability method.

[0054] In summary, this application includes at least one of the following beneficial technical effects:

[0055] 1. This application uses blockchain technology to build a trusted traceability system for cross-border e-commerce products throughout the entire process. It uses unique traceability codes and anti-counterfeiting hash values ​​to ensure the authenticity of products, digital signatures and consensus mechanisms to ensure the immutability of data, anomaly detection algorithms to monitor logistics nodes in real time, zero-knowledge proofs to achieve efficient privacy verification, and finally displays the complete traceability path through a visual interface, realizing transparent management of the entire chain from production to consumption.

[0056] 2. This application collects logistics node operation information in real time and assigns a unique block hash value as a data fingerprint. It uses an anomaly identification model to calculate feature vector weights and anomaly scores, combines dynamic thresholds to perform cluster analysis to determine abnormal behavior, and encrypts and digitally signs all operation information. It also uses blockchain node verification signatures and the IBFT consensus mechanism to ensure the legality and immutability of data, thereby achieving trusted monitoring and anomaly detection of the entire logistics node process.

[0057] 3. This application utilizes zero-knowledge proofs to efficiently and privately aggregate verification results, ensuring the authenticity and continuity of goods at every stage from production to delivery. It displays the complete traceability path through a visual interface, providing transparent and reliable product information and supply chain monitoring. Attached Figure Description

[0058] Figure 1 This is a flowchart of the method in this application. Detailed Implementation

[0059] The embodiments of this application are described in detail below, and examples of the embodiments are shown in the accompanying drawings.

[0060] In the description of this specification, the references to "certain embodiments," "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples" refer to specific features, structures, materials, or characteristics described in connection with the described embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0061] The first embodiment of this application discloses a blockchain-based method for tracing the origin of goods in cross-border e-commerce, referring to... Figure 1 The method for tracing the origin of cross-border e-commerce goods includes the following steps:

[0062] S1. In the production process of cross-border e-commerce goods, a unique traceability code is generated for each cross-border e-commerce product, the original information fields of the cross-border e-commerce product are extracted, and an anti-counterfeiting hash value is calculated using an encrypted hash algorithm.

[0063] Preferably, in the production stage of cross-border e-commerce goods, a unique traceability code is generated for each cross-border e-commerce product, the original information fields of the cross-border e-commerce product are extracted, and an anti-counterfeiting hash value is calculated using an encrypted hash algorithm, including the following steps:

[0064] S11. Generate a unique traceability code for each product during the production stage, including the production batch number, raw material code, and quality inspection report number.

[0065] S12. Extract the production date, origin coordinates, and equipment number as raw information;

[0066] S13. Based on the unique traceability code, use the cryptographic hash algorithm to calculate the original information and generate a unique anti-counterfeiting hash value;

[0067] S14. Store the original information and anti-counterfeiting hash value in the manufacturer's off-chain encrypted database, and mark the anti-counterfeiting hash value as to be uploaded to the chain and store it in the Redis cache queue.

[0068] It should be explained that, in order to ensure that each product can be traced back to its detailed production information (such as production batch, raw materials used, and quality inspection reports), a unique traceability code needs to be generated. The traceability code is typically a composite identifier composed of multiple pieces of information, ensuring that each product has a unique identifier throughout its entire lifecycle, specifically including the following:

[0069] (1) Production batch number: used to identify goods produced in the same batch during the production process; usually a combination of production date and batch number;

[0070] (2) Raw material code: A unique identifier representing the raw materials used in the product, which may be the raw material batch number or product ID provided by the supplier;

[0071] (3) Quality inspection report number: Every product needs to undergo quality inspection, and the quality inspection report number can be used to record the inspection standards and results;

[0072] (4) Production date: Record the actual production date of the goods to ensure that the production time can be accurately traced;

[0073] (5) Origin coordinates: The production location of a commodity is often related to its quality and origin. By recording GPS coordinates, the production location of the commodity can be identified, providing geographical information for future traceability.

[0074] (6) Equipment number: Record the equipment number used in the production process. This can be used to trace the equipment's operating status, maintenance history, and other information to ensure the normal operation of the equipment and its impact on product quality.

[0075] Information such as production batch number, raw material code, quality inspection report number, production date, place of origin coordinates, and equipment number are concatenated. A hash algorithm is used to calculate the concatenated string to generate a unique hash value (e.g., abcdef123456...). Commonly used cryptographic hash algorithms (the cryptographic hash algorithm in this application is SHA-256) include SHA-256, SHA-3, or BLAKE2. This hash value is the anti-counterfeiting hash value of the product. It serves as the product's identity identifier and is recorded in the blockchain for subsequent verification and traceability.

[0076] S2. The original information fields and anti-counterfeiting hash values ​​are encapsulated in a structured manner according to a preset template. The producer's private key is used for digital signature. After verifying the signature, the blockchain node confirms the transaction through the consensus mechanism and writes it into the blockchain, generating a block hash value.

[0077] Preferably, the original information fields and anti-counterfeiting hash values ​​are structurally encapsulated according to a preset template, and digital signatures are performed using the producer's private key. After verifying the signature, the blockchain node confirms the transaction through the consensus mechanism and writes it into the blockchain, generating a block hash value, which includes the following steps:

[0078] S21. Using a preset standard structure template, the original information fields and anti-counterfeiting hash values ​​are structurally encapsulated to generate standardized data packets.

[0079] S22. Digitally sign the standardized data packets using the private key held by the producer.

[0080] S23. The structured data, digital signature, and timestamp are encapsulated into complete transaction data and broadcast to blockchain nodes for verification. The producer's public key can be obtained through public records on the blockchain.

[0081] S24. After receiving the transaction data, the blockchain node uses the producer's public key to verify the digital signature, ensuring that the data has not been tampered with and was initiated by the producer.

[0082] Preferably, after receiving transaction data, the blockchain node uses the producer's public key to verify the digital signature, ensuring that the data has not been tampered with and was initiated by the producer, including the following steps:

[0083] S241. Blockchain nodes receive broadcast transaction data and extract the producer's public key from the transaction data.

[0084] S242. Verify the digital signature using the producer's public key to obtain the hash value of the transaction data;

[0085] S243. Blockchain nodes recalculate the hash value of transaction data to generate a new hash value;

[0086] S244. Compare the verified hash value with the hash value calculated by the blockchain node;

[0087] S245. When the comparison results match, it proves that the digital signature is valid, the transaction data has not been modified, and it was indeed initiated by the producer. After verification, the transaction is marked as valid.

[0088] S25. After verification, the blockchain node verifies the transaction content through the IBFT consensus mechanism and packages the verified transaction content into a new block to generate a block hash value.

[0089] It's important to explain that the IBFT consensus mechanism is a fault-tolerant blockchain consensus algorithm suitable for private or permissioned blockchains requiring high reliability. The IBFT consensus mechanism is designed to ensure the correctness of consensus even when faced with up to one-third malicious nodes. In the IBFT consensus mechanism, participating nodes are divided into proposers and validators. Proposers propose candidate content for new blocks, and validators confirm the validity of the block through voting. To reach consensus, multiple stages of voting are required, and after confirmation by a majority of nodes, a new block is finally generated and broadcast. If the transaction content passes verification, the blockchain nodes will package it into a new block and generate a block hash value, ensuring data security and immutability.

[0090] Specific examples are described below:

[0091] A certain brand produced a batch of imported skincare face creams.

[0092] The factory generates a unique traceability code for this batch of face cream during the production process, for example:

[0093] 1. Production batch number: 20250912-001;

[0094] 2. Raw material code: RM-AH12345 (indicates a batch of hyaluronic acid raw materials from a certain supplier);

[0095] 3. Quality Inspection Report Number: QC-20250912-789;

[0096] After combining all the above information, the resulting unique traceability code is as follows: 20250912-001-RM-AH12345-QC-20250912-789.

[0097] Simultaneous extraction:

[0098] 1. Production date: September 12, 2025;

[0099] 2. Location coordinates: 31.2304°N, 121.4737°E (a production plant in Shanghai);

[0100] 3. Equipment number: EQP-998877;

[0101] The original field and the traceability code are concatenated into a string, and the SHA-256 algorithm is used to calculate the anti-counterfeiting hash value: ab56b4d92b40713acc5af89985d4b786...;

[0102] The factory encapsulates the "original information field + anti-counterfeiting hash value" into a data packet according to a standard template, and digitally signs the data packet using the factory's private key;

[0103] The data packet, along with its digital signature and timestamp, is broadcast to the blockchain network. Upon receiving it, the blockchain nodes use the public key published by the factory on the chain to verify the signature, confirming that the data has not been tampered with and was indeed initiated by the factory.

[0104] After successful verification, the blockchain nodes reach a consensus through the IBFT consensus mechanism, package the transaction and related information into a new block, and generate a new block hash value, for example: 0000abc7654ff789c23d...;

[0105] Ultimately, when consumers purchase this skincare product, they can simply enter the traceability code on the packaging to access anti-counterfeiting and traceability data on the blockchain, including the production batch, source of raw materials, quality inspection information, and coordinates of the production plant.

[0106] S3. In the cross-border e-commerce commodity circulation process, the operation information of each logistics node is collected in real time, the block hash value is used as the data fingerprint, and anomalies are identified through an anomaly detection algorithm. The blockchain node encrypts and stores the data fingerprint after anomaly identification, and the producer uses the node's private key to generate a digital signature.

[0107] Preferably, in the cross-border e-commerce commodity circulation process, operational information of each logistics node is collected in real time, the block hash value is used as the data fingerprint, and anomalies are identified through an anomaly detection algorithm. The blockchain node encrypts and stores the data fingerprint after anomaly identification, and the producer uses the node's private key to generate a digital signature, including the following steps:

[0108] S31. Collect and store operational information of each logistics node in the cross-border e-commerce commodity circulation process.

[0109] S32. Each operation message will be assigned a block hash value as a data fingerprint, where the data fingerprint is the unique identifier of the operation record.

[0110] S33. By extracting the feature vector of the operation information, the anomaly recognition model is trained, the weights of the feature vector are continuously updated, and the anomaly score is calculated by combining the generalization risk function.

[0111] It needs to be explained that during the production and logistics of cross-border e-commerce goods, a large amount of data is generated from operational information (such as the usage of production equipment, the production process of goods, the usage of raw materials, and the results of product inspection). In order to use this data for abnormal behavior detection, meaningful features must first be extracted from it. For example, the timestamp, operation type, equipment number, and place of origin coordinates of each operation may be extracted. All of this information will be transformed into a set of feature vectors, which can represent the core content of the operational information.

[0112] Preferably, the expression for the generalized risk function is:

[0113] ;

[0114] In the formula, This indicates the risk of the anomaly detection model generalizing the feature vectors of operational information across various logistics nodes. This represents the empirical risk of the anomaly detection model on the training data; n represents the number of operational information items collected. Indicates the complexity of the anomaly detection model; Represents any specified low probability value; Represents the natural constant.

[0115] Preferably, the expression for calculating the anomaly score is:

[0116] ;

[0117] In the formula, This indicates an abnormal metric value for operational information; This indicates the risk of the anomaly detection model generalizing the feature vectors of operational information across various logistics nodes. This represents the inverse function output of the i-th classifier on the feature vector; The confidence weight assigned to the feature vector by the m-th classifier is given; M represents the total number of weak classifiers; and m represents the m-th weak classifier.

[0118] It should be explained that after each operation information is calculated by the anomaly identification model, an anomaly score will be generated; the higher the score, the more the operation deviates from the normal range, which may indicate a potential anomaly.

[0119] S34. Based on the anomaly score, perform cluster analysis on the feature vector of the operation information, and combine it with the preset dynamic threshold to determine whether there is abnormal behavior.

[0120] S35. Based on the judgment result, encrypt and protect all operation information marked as normal or abnormal, and at the same time use the producer's private key to generate a digital signature for each operation information.

[0121] S36. The encrypted and signed operation information is submitted to the blockchain network. The blockchain nodes verify the validity of the digital signature through the producer's public key and confirm the legality of the data through the IBFT consensus mechanism.

[0122] It should be explained that the abnormality score of all operation information is calculated and operation information with similar abnormality scores is clustered. For example, if the abnormality scores of some production batches are all very high, they are classified into one category and these batches are considered to have potential abnormal behavior. The preset dynamic threshold is designed to cope with environmental changes such as different time periods and different production cycles. The dynamic threshold will be adjusted according to real-time data, historical data or external changes (such as seasonal changes, market demand fluctuations, etc.).

[0123] Whether it's normal or abnormal operation, all operation information is protected by encryption to ensure the privacy and security of the information; the encrypted data is unreadable, and even if a third party obtains it, they cannot directly access the sensitive information; this usually uses symmetric encryption algorithms (such as AES) to encrypt the data, so that the data can be encrypted before being sent and decrypted when being received, ensuring that the data is not stolen or tampered with throughout the process.

[0124] Digitally signing operational data is used to verify the data's origin and integrity. Digital signatures use the producer's private key to sign the encrypted data, generating a unique signature value. The signing process ensures the following:

[0125] (1) Data has not been tampered with: If the signature verification fails, it means that the data has been modified;

[0126] (2) The data source is trustworthy: Only the producer holds the private key, proving that the data does indeed come from the producer;

[0127] Digital signatures also provide non-repudiation, meaning that the producer cannot deny that they have generated and signed the operational information.

[0128] S4. Submit the encrypted and signed operation information to the blockchain network. The blockchain nodes verify the validity of the digital signature using the producer's public key and verify its legitimacy through the consensus mechanism. Once verified, the transaction is recorded in the blockchain nodes.

[0129] S5. By inputting a unique traceability code, the blockchain node verifies the authenticity of the product, traces back the transaction records of the logistics nodes in chronological order, aggregates the verification results using zero-knowledge proofs, and displays a visual interface showing the product traceability path.

[0130] Preferably, by inputting a unique traceability code, blockchain nodes verify the authenticity of goods, trace back transaction records of logistics nodes in chronological order, aggregate verification results using zero-knowledge proofs, and display a visual interface showing the product traceability path, including the following steps:

[0131] S51. When the verifier enters the unique traceability code of the cross-border e-commerce product, the blockchain node reads the corresponding data fingerprint.

[0132] S52. Verify the authenticity of cross-border e-commerce goods through numerical signatures and anti-counterfeiting hash values;

[0133] S53. Blockchain nodes record the transactions of each logistics node in chronological order, verify the authenticity and continuity of the cross-border e-commerce goods processing process one by one, and finally generate a zero-knowledge proof to efficiently and privately prove the validity of the entire chain.

[0134] S54. Build a visual display interface that dynamically shows the traceability path of cross-border e-commerce products.

[0135] Preferably, the blockchain nodes trace back the transaction records of each logistics node in chronological order, verifying the processing of cross-border e-commerce goods at each logistics node one by one, and aggregating the verification results through zero-knowledge proofs, including the following steps:

[0136] S531. Locate the initial data fingerprint of the product on the blockchain based on the traceability code;

[0137] S532. Starting from the production stage, extract the transaction records of logistics nodes in sequence, including transportation, customs clearance, warehousing and distribution.

[0138] S533. Extract the verification elements of all logistics transactions and construct a zero-knowledge proof circuit to verify the signature validity and hash chain continuity of each transaction.

[0139] S534. Map the verification elements to the input of the zero-knowledge proof circuit, perform aggregation encoding, and generate an aggregated zero-knowledge proof.

[0140] S535. Submit a zero-knowledge proof to a smart contract on the blockchain, which will then verify the proof and provide the result.

[0141] It should be explained that the initial data fingerprint is like a product's ID card, recording the product's production information, anti-counterfeiting hash value, and other core data. Once the product enters the logistics node, all subsequent operation data will be associated with this data fingerprint, ensuring that the operation at each stage can be traced back to the specific product.

[0142] From the moment of production, cross-border e-commerce goods go through multiple logistics stages. Each stage (such as transportation, customs clearance, warehousing, and delivery) generates transaction records; these records include processing information for each stage, such as:

[0143] (1) Transportation records: information such as transportation company, route, transportation time, and transportation method;

[0144] (2) Customs clearance records: information such as customs clearance time, customs clearance location, and customs clearance procedures;

[0145] (3) Warehousing records: time of goods entering the warehouse, storage conditions, outbound records, etc.;

[0146] (4) Delivery records: delivery company, delivery method, estimated delivery time, etc.

[0147] To verify the validity of a transaction while ensuring privacy, a zero-knowledge proof circuit needs to be constructed. The zero-knowledge proof circuit is used to verify whether transaction data meets specific conditions (such as signature validity, hash chain continuity, etc.) without directly exposing the transaction content. The zero-knowledge proof circuit does not reveal the specific details of the transaction during the verification process, but only confirms whether a certain condition is met.

[0148] Aggregate coding combines the verification results of multiple transactions into a unified proof; this means that instead of generating separate proofs for each logistics node, a single aggregated zero-knowledge proof is generated through aggregate coding to verify the legality of all stages.

[0149] The aggregated zero-knowledge proofs are submitted to a smart contract on the blockchain. As a type of automatically executed code, a smart contract can receive external data and process it according to preset rules. In this scenario, the task of the smart contract is to receive and verify the zero-knowledge proofs to ensure that the operation of each logistics node is legal and meets the predetermined conditions.

[0150] Specific examples are described below:

[0151] At a certain logistics node (e.g., the transportation process), a total of n=1000 operational information entries (e.g., transportation time, temperature, humidity, etc.) were collected; the complexity of the anomaly detection model is d=5, meaning the model has 5 parameters during data processing; the empirical risk of the standard model in the training data. =0.1; =0.05 indicates that the maximum probability of an accepted error is 5%;

[0152] Substituting the expression for the generalization risk function, we calculate the generalization risk of the anomaly detection model for the feature vectors of operational information at each logistics node. Assuming e = 2.718 is the natural constant, substitute other values ​​to calculate:

[0153] =0.1, n=1000, d=5 =0.05;

[0154] The final for: ≤0.1+0.2519+0.0774=0.4293;

[0155] Suppose we have 10 feature vectors (W=10) and 5 classifiers (M=5), with confidence weights for each classifier. They are respectively:

[0156] =0.2, =0.15, =0.25, =0.1, =0.3;

[0157] Substituting the values ​​into the expression for the abnormal score, we get F = 0.4293;

[0158] The dynamic threshold is 0.4 (adjusted based on recent transportation congestion).

[0159] All data were clustered using K-means based on outlier scores (clustered into 3 classes):

[0160] Category 1: Score < 0.3 → Normal operation;

[0161] Category 2: Scores between 0.3 and 0.5 → Boundary data (note this);

[0162] Category 3: Score > 0.5 → Highly abnormal;

[0163] Data with F=0.4293 falls into the second category; data in the third category is directly marked as anomaly; data in the second category is marked as "to be monitored" (if a dense distribution occurs, it will be included in the anomaly handling);

[0164] Each piece of data is encrypted using a symmetric encryption algorithm (such as AES) to prevent leakage.

[0165] Example: Encrypt a piece of raw data {time 10:00, device TX-22, temperature 8.5°C} into ciphertext 0x9a…e3;

[0166] The encrypted data is signed using the producer's private key to generate a digital signature value Sig(data); then the upload and verification processes begin.

[0167] 1. Upload process:

[0168] The packaged data is submitted to the blockchain node via a transaction;

[0169] The data includes: encrypted data (ciphertext), digital signature, and status label (normal / abnormal).

[0170] 2. Verification process:

[0171] Blockchain nodes use the producer's public key to verify signatures;

[0172] If the verification passes, it proves the data is valid.

[0173] If verification fails, the data will be rejected from being written to the chain.

[0174] All verified data is submitted to the IBFT consensus mechanism to reach a consensus, ensuring data consistency and reliability.

[0175] The second embodiment of this application also discloses a blockchain-based cross-border e-commerce product traceability system, which is implemented based on the aforementioned blockchain-based cross-border e-commerce product traceability method.

[0176] It should be noted that the calculation formulas and all parameters involved in the calculations in this application have been dimensionless beforehand. The process of dimensionless processing is well known in the industry and will not be described here.

[0177] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.

Claims

1. A blockchain-based cross-border e-commerce commodity traceability method, characterized in that, This cross-border e-commerce product traceability method includes the following steps: S1. In the production process of cross-border e-commerce goods, a unique traceability code is generated for each cross-border e-commerce product, the original information fields of the cross-border e-commerce product are extracted, and the anti-counterfeiting hash value is calculated using a cryptographic hash algorithm. S2. The original information fields and anti-counterfeiting hash values ​​are encapsulated in a structured manner according to a preset template. The producer's private key is used for digital signature. After verifying the signature, the blockchain node confirms the transaction through the consensus mechanism and writes it into the blockchain, generating a block hash value. S3. In the cross-border e-commerce commodity circulation process, the operation information of each logistics node is collected in real time, the block hash value is used as the data fingerprint, and anomalies are identified through an anomaly detection algorithm. The blockchain node encrypts and stores the data fingerprint after anomaly identification, and the producer uses the node's private key to generate a digital signature. S4. Submit the encrypted and signed operation information to the blockchain network. The blockchain nodes verify the validity of the digital signature using the producer's public key and verify its legality through the consensus mechanism. After verification, the transaction is recorded in the blockchain nodes. S5. By inputting a unique traceability code, the blockchain node verifies the authenticity of the product, traces back the transaction records of the logistics nodes in chronological order, aggregates the verification results using zero-knowledge proofs, and displays a visual interface showing the product traceability path.

2. The blockchain-based cross-border e-commerce product traceability method according to claim 1, characterized in that, In the production stage of cross-border e-commerce goods, generating a unique traceability code for each cross-border e-commerce product, extracting the original information fields of the cross-border e-commerce product, and calculating the anti-counterfeiting hash value using an encrypted hash algorithm includes the following steps: S11. Generate a unique traceability code for each product during the production stage, including the production batch number, raw material code, and quality inspection report number. S12. Extract the production date, origin coordinates, and equipment number as raw information; S13. Based on the unique traceability code, use the cryptographic hash algorithm to calculate the original information and generate a unique anti-counterfeiting hash value; S14. Store the original information and anti-counterfeiting hash value in the manufacturer's off-chain encrypted database, and mark the anti-counterfeiting hash value as to be uploaded to the chain and store it in the Redis cache queue. 3.The blockchain-based cross-border e-commerce commodity traceability method according to claim 1, characterized in that, The process of encapsulating the original information fields and anti-counterfeiting hash values ​​according to a preset template, performing digital signatures using the producer's private key, and having blockchain nodes confirm the transaction and write it to the blockchain through a consensus mechanism after verifying the signature, generating a block hash value, includes the following steps: S21. Using a preset standard structure template, the original information fields and anti-counterfeiting hash values ​​are structured and encapsulated to generate a standardized data packet; S22. Digitally sign the standardized data packet using the private key held by the producer; S23. Encapsulate structured data, digital signatures, and timestamps into complete transaction data and broadcast it to blockchain nodes for verification. The producer's public key can be obtained through public records on the blockchain. S24. After receiving the transaction data, the blockchain node uses the producer's public key to verify the digital signature, ensuring that the data has not been tampered with and was initiated by the producer. S25. After verification, the blockchain node verifies the transaction content through the IBFT consensus mechanism and packages the verified transaction content into a new block to generate a block hash value. 4.The blockchain-based cross-border e-commerce commodity traceability method according to claim 3, characterized in that, After receiving the transaction data, the blockchain node uses the producer's public key to verify the digital signature, ensuring that the data has not been tampered with and was initiated by the producer, including the following steps: S241. Blockchain nodes receive broadcast transaction data and extract the producer's public key from the transaction data. S242. Verify the digital signature using the producer's public key to obtain the hash value of the transaction data; S243. Blockchain nodes recalculate the hash value of transaction data to generate a new hash value; S244. Compare the verified hash value with the hash value calculated by the blockchain node; S245. When the comparison results match, it proves that the digital signature is valid, the transaction data has not been modified, and it was indeed initiated by the producer. After verification, the transaction is marked as valid. 5.The blockchain-based cross-border e-commerce commodity traceability method according to claim 1, characterized in that, In the cross-border e-commerce commodity circulation process, the operation information of each logistics node is collected in real time, the block hash value is used as the data fingerprint, and anomalies are identified through an anomaly detection algorithm. The blockchain node encrypts and stores the data fingerprint after anomaly identification, and the producer uses the node's private key to generate a digital signature, including the following steps: S31. Collect and store operational information of each logistics node in the cross-border e-commerce commodity circulation process; S32. Each operation message will be assigned a block hash value as a data fingerprint, whereby the data fingerprint is the unique identifier of the operation record; S33. By extracting the feature vector of the operation information, training the anomaly recognition model, continuously updating the weight of the feature vector, and combining it with the generalization risk function to calculate the anomaly score. S34. Based on the anomaly score, perform cluster analysis on the feature vector of the operation information, and combine it with the preset dynamic threshold to determine whether there is abnormal behavior. S35. Based on the judgment result, all operation information marked as normal or abnormal is encrypted and protected, and a digital signature is generated for each operation information using the producer's private key. S36. The encrypted and signed operation information is submitted to the blockchain network. The blockchain nodes verify the validity of the digital signature through the producer's public key and confirm the legality of the data through the IBFT consensus mechanism. 6.The blockchain-based cross-border e-commerce commodity traceability method according to claim 5, characterized in that, The expression for the generalized risk function is: ; In the formula, This indicates the risk of the anomaly detection model generalizing the feature vectors of operational information across various logistics nodes. This represents the empirical risk of the anomaly detection model on the training data; n represents the number of operational information items collected. Indicates the complexity of the anomaly detection model; Represents any specified low probability value; Represents the natural constant.

7. The blockchain-based cross-border e-commerce product traceability method according to claim 1, characterized in that, The process of verifying the authenticity of goods by inputting a unique traceability code, tracing back transaction records of logistics nodes in chronological order, aggregating verification results using zero-knowledge proofs, and displaying a visual interface showing the product traceability path includes the following steps: S51. When the verifier enters the unique traceability code of the cross-border e-commerce product, the blockchain node reads the corresponding data fingerprint. S52. Verify the authenticity of cross-border e-commerce goods through numerical signatures and anti-counterfeiting hash values; S53. Blockchain nodes record the transactions of each logistics node in chronological order, verify the authenticity and continuity of the cross-border e-commerce goods processing process one by one, and finally generate a zero-knowledge proof to efficiently and privately prove the validity of the entire chain. S54. Build a visual display interface that dynamically shows the traceability path of cross-border e-commerce products.

8. The blockchain-based cross-border e-commerce product traceability method according to claim 7, characterized in that, The blockchain nodes trace back the transaction records of each logistics node in chronological order, verifying the processing of cross-border e-commerce goods at each logistics node one by one, and aggregating the verification results through zero-knowledge proofs, including the following steps: S531. Locate the initial data fingerprint of the product on the blockchain based on the traceability code; S532. Starting from the production stage, extract the transaction records of logistics nodes in sequence, including transportation, customs clearance, warehousing and distribution. S533. Extract the verification elements of all logistics transactions and construct a zero-knowledge proof circuit to verify the signature validity and hash chain continuity of each transaction. S534. Map the verification elements to the input of the zero-knowledge proof circuit, perform aggregation encoding, and generate an aggregated zero-knowledge proof. S535. Submit a zero-knowledge proof to a smart contract on the blockchain, which will then verify the proof and provide the result. 9.A blockchain-based cross-border e-commerce commodity traceability system, characterized in that, The system is implemented based on the blockchain-based cross-border e-commerce product traceability method described in any one of claims 1-8.