A blockchain-based customer barcode traceability management method and system
By deeply integrating blockchain technology with barcode traceability, the problems of easy data tampering and incomplete links in traditional customer barcode traceability management have been solved, realizing secure, complete and efficient tracking of material flow status and optimization of customer management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 杭州友成科技有限公司
- Filing Date
- 2026-04-21
- Publication Date
- 2026-05-26
Smart Images

Figure CN122089346A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data management technology, specifically a blockchain-based customer barcode traceability management method and system. Background Technology
[0002] Traditional customer barcode traceability management relies on centralized databases for data storage, which suffers from issues such as data tampering and incomplete traceability links. Customer basic information and material flow data are scattered across various systems, with inconsistent formats and a lack of effective encryption and verification mechanisms, making it difficult to guarantee data integrity. Furthermore, asynchronous data collection at multiple nodes prevents the formation of a coherent, full-lifecycle traceability link, resulting in insufficient real-time tracking capabilities for material flow status. In addition, under a centralized management model, traceability access control is inflexible, data retrieval efficiency is low, and traceability results lack visualization, failing to meet customers' transparent needs for material traceability and hindering precise customer management for enterprises.
[0003] Therefore, a customer barcode traceability management method and system based on blockchain is provided. Summary of the Invention
[0004] To address the aforementioned technical problems, the present invention aims to provide a blockchain-based customer barcode traceability management method and system.
[0005] To achieve the above objectives, the present invention provides the following technical solution: a blockchain-based customer barcode traceability management method, the method comprising: The acquired basic customer information and barcode-related data are standardized in format, and the standardized data is encrypted and verified based on a blockchain hash algorithm to extract the core identification features of the barcode. Based on barcode scanning terminals and IoT devices, multi-node real-time collection of customer lifecycle behavior data and material flow data is performed. Combined with timestamps, a data chain is constructed to obtain the original traceability data, and barcode dynamic flow characteristics are extracted from the original traceability data. Based on the core identification features of the barcode, cross-traceability analysis is performed on the dynamic circulation features of the barcode to obtain complete traceability link data. Based on the complete traceability link data, the circulation status of customer-related materials is tracked in real time, and a traceability analysis report is generated. A customer barcode traceability alliance chain is built based on blockchain distributed ledger technology. The original traceability data and traceability analysis report are packaged into blocks and stored on the chain to form a traceability database. Based on the traceability database, the system quickly responds to customer barcode traceability requests, automatically executes traceability permission verification and data retrieval through smart contracts, generates visualized traceability results, and optimizes customer management based on these results.
[0006] Furthermore, the process of encrypting and verifying the standardized data based on the blockchain hash algorithm to extract the core identification features of the barcode includes: Obtain standardized customer basic information and barcode associated data; concatenate the standardized customer basic information and barcode associated data according to field order to form the original data string; The original data string is encrypted using the SHA-256 hash algorithm to generate a corresponding encrypted hash value, which serves as a data integrity verification identifier. Based on the barcode association data, a core feature field set is obtained; the core feature field set is vectorized to obtain an initial identification feature; the initial identification feature is bound and fused with the encrypted hash value to obtain the barcode core identification feature.
[0007] Furthermore, the process of collecting customer lifecycle behavior data and material flow data in real time across multiple nodes based on barcode scanning terminals and IoT devices, and combining this with timestamps to construct a data chain to obtain the original traceability data includes: Based on barcode scanning terminals and IoT devices, real-time collection of customer lifecycle behavior data and material flow data is performed across multiple nodes, including production nodes, warehousing nodes, logistics nodes and customer nodes, thereby obtaining corresponding production process data blocks, warehousing process data blocks, logistics process data blocks and customer process data blocks. The data blocks from the production process, warehousing process, logistics process, and customer process are used as the original data for traceability.
[0008] Furthermore, the process of extracting barcode dynamic circulation features from the original traceability data includes: The data blocks of each stage in the original traceability data are parsed to extract key fields, which are then used to form the original set of flow features; the original set of flow features is cleaned; and the cleaned original set of flow features is then feature-encoded. The encoded features are sorted according to time order to obtain a flow feature sequence; local feature extraction is performed on the flow feature sequence based on a convolutional neural network to obtain the corresponding barcode dynamic flow features.
[0009] Furthermore, the process of performing cross-tracing analysis on the barcode's dynamic circulation features based on the core identification features of the barcode to obtain complete traceability chain data includes: Using the single-item code from the core barcode identification features as a search keyword, the corresponding traceability raw data is matched in the blockchain distributed ledger. The integrity of the matched traceability raw data is verified based on the hash value of the core barcode identification features, and abnormal data with mismatched hash values is removed. The circulation feature sequence in the barcode dynamic circulation features is dimensionally aligned with the core barcode identification features. The dimensional alignment of the circulation feature sequence with the core barcode identification features is achieved through a fully connected layer, thereby obtaining the corresponding barcode core identification feature vector and barcode dynamic circulation feature vector. The feature similarity is calculated based on the cosine similarity algorithm. A preset feature similarity threshold is used to filter out the flow feature sequences with feature similarity greater than the threshold, and the corresponding link data blocks are spliced together in time stamp order to form a complete traceability link skeleton; The data blocks of each link in the traceability link skeleton are correlated and verified to obtain complete traceability link data.
[0010] Furthermore, the process of tracking the flow status of customer-related materials in real time based on the complete traceability chain data and generating a traceability analysis report includes: Extract timestamps from each stage of the complete traceability chain data, calculate the time consumed in each stage, and generate stage time statistics. The system collects key lifecycle indicators of customer-related materials in a distributed manner; it integrates complete traceability data, time consumption statistics for each step, and key lifecycle indicators to generate standardized traceability analysis reports.
[0011] Furthermore, the process of constructing a customer barcode traceability consortium blockchain based on blockchain distributed ledger technology, and storing the original traceability data and traceability analysis reports on the blockchain in block packaging to form an immutable traceability database includes: Set node permissions by pre-setting the operation permissions of each node through a smart contract, record them as node signature information, and write the node signature information to the end of the block; Based on the AES-256 encryption algorithm, the original traceability data and traceability analysis report are encrypted to obtain the hash value of the corresponding block, and can be decrypted by only authorized nodes through a preset smart contract; A preset packaging cycle is established. The encrypted traceability raw data and traceability analysis report are packaged according to the packaging cycle to generate blocks. The Merkle root of the corresponding block is calculated, and the hash value of the previous block, the hash value of the current block, the Merkle root, and the current timestamp are written into the block header. All on-chain traceability raw data and traceability analysis reports are integrated to form a traceability database.
[0012] Furthermore, the process of quickly responding to customer barcode traceability requests based on the traceability database, automatically executing traceability permission verification and data retrieval through smart contracts, and generating visualized traceability results includes: The traceability request is submitted to the smart contract of the customer barcode traceability consortium chain. According to the preset smart contract, the legality of the requester's identity and the scope of his / her authority are verified. If the permission verification fails, access is denied; if the permission verification passes, the smart contract generates a search instruction based on the traceability keywords, sends it to the traceability database, and quickly retrieves the corresponding block according to the search instruction. The smart contract decrypts the block and performs structured parsing on the data in the block to extract key information from each stage. Based on the results of the structured parsing, the corresponding visual traceability result is generated.
[0013] A second aspect of the present invention also provides a blockchain-based customer barcode traceability management system, comprising: a feature extraction module, a data acquisition module, a traceability analysis module, a consortium blockchain storage module, and a traceability service module; The feature extraction module is used to standardize the format of pre-generated customer basic information and barcode associated data, and to encrypt and verify the standardized basic data based on the blockchain hash algorithm to extract the core identification features of the barcode. The data acquisition module collects customer behavior data and material flow data in real time from multiple nodes based on barcode scanning terminals and IoT devices, combines timestamps to complete the data chain construction, obtains the original traceability data, and extracts the barcode dynamic flow characteristics from the original traceability data. The traceability analysis module performs cross-traceability analysis on the barcode's dynamic circulation features based on the core identification features of the barcode to obtain complete traceability link data, and tracks the circulation status of customer-related materials in real time based on the complete traceability link data to generate a traceability analysis report. The consortium blockchain storage module is built on the blockchain distributed ledger technology to construct a customer barcode traceability consortium blockchain. It packages the original traceability data and traceability analysis report into blocks and stores them on the blockchain to form an immutable traceability database. The traceability service module responds quickly to customer barcode traceability requests based on the traceability database, automatically performs traceability permission verification and data retrieval through smart contracts, generates visualized traceability results, and optimizes customer management based on the visualized traceability results.
[0014] Compared with existing technologies, the beneficial effects of this invention are as follows: Through the deep integration of blockchain technology and barcode traceability, it achieves secure, complete, and efficient customer barcode traceability. Blockchain hash encryption and distributed ledger technology ensure the immutability and integrity of traceability data, solving the problem of low data reliability in traditional traceability. Multi-node real-time collection and cross-traceability analysis construct a complete traceability link throughout the entire lifecycle, enabling accurate tracking of the status of material flow. Smart contracts and visual presentation improve traceability response speed and the flexibility of access control, allowing both customers and enterprises to easily access traceability information. The overall solution not only strengthens the security and reliability of traceability data but also optimizes the accuracy of customer management, helping enterprises improve service quality and customer trust. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0016] Figure 1 This is a schematic diagram illustrating the steps of a blockchain-based customer barcode traceability management method.
[0017] Figure 2 This is a schematic diagram of a module of a blockchain-based customer barcode traceability management system. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be described in detail below. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other implementation methods obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0019] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0020] Example 1: like Figure 1 As shown, a blockchain-based customer barcode traceability management method includes the following steps: Step S1: Standardize the format of the acquired customer basic information and barcode associated data, and encrypt and verify the standardized data based on the blockchain hash algorithm to extract the core identification features of the barcode; Step S2: Based on barcode scanning terminals and IoT devices, multi-node real-time collection of customer lifecycle behavior data and material flow data is performed. Combined with timestamps, a data chain is constructed to obtain the original traceability data, and the barcode dynamic flow characteristics are extracted from the original traceability data. Step S3: Based on the core identification features of the barcode, perform cross-traceability analysis on the dynamic circulation features of the barcode to obtain complete traceability link data, and based on the complete traceability link data, track the circulation status of customer-related materials in real time and generate a traceability analysis report; Step S4: Construct a customer barcode traceability consortium chain based on blockchain distributed ledger technology, and package the original traceability data and traceability analysis report into blocks for on-chain storage to form an immutable traceability database; Step S5: Based on the traceability database, quickly respond to the traceability request of the customer's barcode, automatically execute traceability permission verification and data retrieval through smart contract, generate visualized traceability results, and optimize customer management based on the visualized traceability results.
[0021] It should be further explained that, in the specific implementation process, the standardization of the acquired basic customer information and barcode-related data includes: It should be noted that the basic customer information includes, but is not limited to, customer product information (e.g., drawing number, item number, and product name), order information (e.g., batch number, batch description, and production time); the barcode associated data includes, but is not limited to, single item code, initial scan time, last box code, and barcode-bound material information (e.g., equipment, mold, employees, and manufacturing tasks).
[0022] Optionally, in this embodiment of the application, the character encoding, date format, and field length of the corresponding data fields in the customer basic information are unified (for example, the date format of the production time is unified as "YYYY-MM-DDHH:MM:SS"); the barcode associated data is standardized (for example, the data of the single item code uniformly includes a 10-digit unique identifier + an 8-digit batch code + an 8-digit check code). Perform field integrity checks on the standardized customer basic information and barcode-related data, and filter out data with missing corresponding data fields.
[0023] It should be further explained that, in the specific implementation process, the process of encrypting and verifying the standardized data based on the blockchain hash algorithm to extract the core identification features of the barcode includes: It should be noted that the blockchain hash algorithm uses the SHA-256 algorithm to ensure that the data cannot be tampered with after encryption.
[0024] Optionally, in this embodiment of the application, standardized customer basic information and barcode associated data are obtained; the standardized customer basic information and barcode associated data are concatenated in field order to form the original data string; The original data string is encrypted using the SHA-256 hash algorithm to generate a corresponding encrypted hash value, which serves as a data integrity verification identifier. Extract the item code, initial scan time, and last box code from the barcode association data to form a core feature field set; perform vectorization processing on the core feature field set, converting the item code into a binary vector, the initial scan time into a timestamp vector, and the last box code into a classification vector to obtain the initial identification features; The initial identification features are bound and fused with the encrypted hash value. The fused features are then mapped to a unified dimension through a linear transformation to obtain the core identification features of the barcode.
[0025] It should be noted that the encrypted hash value has a one-to-one correspondence with the original data string. If the original data is tampered with, the encrypted hash value will change significantly, and the data tampering behavior can be quickly identified through hash verification. The vectorization processing adopts a combination of One-Hot encoding and Word2Vec to ensure that different types of core feature fields can be fused and calculated. The core identification feature of the barcode will serve as the core index on the blockchain for rapid matching in subsequent traceability links.
[0026] It should be further explained that, in the specific implementation process, the process of collecting customer lifecycle behavior data and material flow data in real time at multiple nodes based on barcode scanning terminals and IoT devices, and combining this with timestamps to complete the data chain construction to obtain the original traceability data includes: It should be noted that the customer lifecycle behavior data includes, but is not limited to, customer order placement behavior, payment behavior, goods receipt confirmation behavior, and after-sales feedback behavior; the material flow data includes, but is not limited to, material production process data (e.g., production time, production line number, and quality inspection results), warehousing process data (e.g., warehousing time, storage location number, and inventory status), and logistics process data (e.g., carrier information, transportation route, transit nodes, and receipt time); the multiple nodes include production nodes, warehousing nodes, logistics nodes, and customer nodes; it should be noted that each node deploys a corresponding barcode scanning terminal, IoT sensing device, and data collection gateway.
[0027] Optionally, in this embodiment of the application, for production nodes, the unique customer barcode bound to the materials is scanned by a barcode scanning terminal, and then the corresponding production time, production line number, quality inspector ID and quality inspection result data are collected, and after being marked with a unified timestamp, a production process data block is generated. For the warehousing node, the barcode scanning terminal verifies the consistency between the material barcode and the warehouse entry order, and then collects the corresponding warehouse entry time, warehouse location number, and warehouse manager ID. The IoT device collects material storage status data (e.g., whether it has been opened or moved), and after marking it with a unified timestamp, a warehousing data block is generated. For logistics nodes, carrier ID, transport vehicle license plate and loading time data are collected through barcode scanning terminals, and transport route latitude and longitude and transfer node information are collected through IoT sensing devices. After being marked with a unified timestamp, logistics link data blocks are generated. For customer nodes, barcode scanning terminals are used to collect customer signature time, signature information and delivery address confirmation data. If there is after-sales feedback, the description of the after-sales problem and feedback time data are collected, and after being marked with a unified timestamp, a customer process data block is generated. The data blocks from the production stage, warehousing stage, logistics stage, and customer stage are used as the original traceability data. It should be noted that there is a time stamp order between the corresponding data blocks, and each data block contains the hash value of the previous data block.
[0028] It should be further explained that, in the specific implementation process, the process of extracting the dynamic circulation characteristics of the barcode from the original traceability data includes: Optionally, in this embodiment of the application, the data blocks of each link in the traceability original data are parsed to extract key fields, and then a flow feature original set is formed; the key fields include, but are not limited to, timestamp, node type, location information and status change; the node types include production nodes, warehousing nodes, logistics nodes and customer nodes.
[0029] The data cleaning process for the original set of flow characteristics includes removing data with abnormal timestamps and conflicting location information. The original set of flow features after cleaning is feature-encoded, the node type is converted into a classification code (e.g., production=01, warehousing=02, logistics=03, customer=04), the status change is converted into a status code (production completed=10, warehousing=11, in transit=12, signed for=13, after-sales=14), and the location information is converted into a spatial coordinate vector; The encoded features are sorted according to time order to obtain a flowing feature sequence; Local feature extraction of the flow feature sequence is performed based on convolutional neural network (CNN). The flow patterns at different time scales are captured through three convolutional layers with kernel sizes of 3, 5 and 7 respectively. The dynamic flow features of the barcode are obtained by dimensionality reduction through pooling layer.
[0030] It should be noted that each data block contains the hash value of the previous data block to ensure the integrity of the data chain. If the data in a certain link is tampered with, the hash values of all subsequent data blocks will become invalid, which can be quickly discovered through the blockchain node consensus mechanism. The activation function of the convolutional neural network (CNN) adopts the ReLU function to avoid the gradient vanishing problem, and the pooling layer adopts max pooling to retain key flow features.
[0031] It should be further explained that, in the specific implementation process, the process of performing cross-tracing analysis on the barcode's dynamic circulation features based on the core identification features of the barcode to obtain complete traceability link data includes: It should be noted that existing traceability analysis can only provide information queries for a single link, and cannot achieve cross-link correlation analysis and status tracking, and it is difficult to quickly locate the problematic link. This application constructs a complete traceability link by cross-matching the core identification features of the barcode and the dynamic circulation features of the barcode, thereby improving the efficiency and accuracy of traceability.
[0032] Optionally, in this embodiment of the application, the single item code in the core identification features of the barcode is used as a search keyword to match the corresponding traceability original data in the blockchain distributed ledger; The integrity of the matched original traceability data is verified by using the hash value of the core identification features of the barcode, and abnormal data with mismatched hash values are removed. The flow feature sequence in the barcode dynamic flow feature is dimensionally aligned with the barcode core identification feature. The flow feature sequence is dimensionally aligned with the barcode core identification feature through a fully connected layer, thereby obtaining the corresponding barcode core identification feature vector and barcode dynamic flow feature vector. The feature similarity is calculated based on the cosine similarity algorithm. A preset feature similarity threshold is used to filter out the flow feature sequences with feature similarity greater than the threshold, and the corresponding link data blocks are spliced together in time stamp order to form a complete traceability link skeleton; The data blocks of each link in the traceability link skeleton are correlated and verified to obtain complete traceability link data.
[0033] It should be noted that the correlation verification process includes verifying the consistency between the batch number of materials in the production stage and the batch number of materials entering the warehouse in the storage stage, the consistency between the carrier information in the logistics stage and the carrier signed for by the customer in the delivery stage, and supplementing the detailed data of the verified stages (such as quality inspection reports and GPS tracks).
[0034] To further explain, the calculation formula for the cosine similarity algorithm is as follows: Where A is the core identifier feature vector of the barcode, and B is the dynamic circulation feature vector of the barcode.
[0035] It should be further explained that, in the specific implementation process, the real-time tracking of the flow status of customer-related materials based on the complete traceability chain data, and the generation of a traceability analysis report, includes the following: Optionally, in this embodiment of the application, timestamps of each link are extracted from the complete traceability chain data, the time consumed in each link is calculated (e.g., the time consumed in the production link and the time consumed in the logistics link), and link time statistics are generated. The system collects key lifecycle metrics of customer-related materials in a distributed manner. These key lifecycle metrics include, but are not limited to, production cycle, warehousing cycle, transportation cycle, total circulation cycle, and anomaly rate. The complete traceability chain data, the time consumption statistics of each link, and the key indicators of the entire life cycle are statistically integrated to generate a standardized traceability analysis report. The traceability analysis report contains links to jumpable link data blocks for easy and quick viewing of the original data.
[0036] It should be further explained that, in the specific implementation process, the process of building a customer barcode traceability consortium chain based on blockchain distributed ledger technology, and storing the original traceability data and traceability analysis reports on the chain in block packaging to form an immutable traceability database includes: It should be noted that the customer barcode traceability consortium blockchain consists of nodes from manufacturing enterprises, warehousing enterprises, logistics enterprises, customers, and regulatory agencies. Each node adopts a Byzantine Fault Tolerance (PBFT) consensus mechanism to ensure the consistency and security of data after it is uploaded to the blockchain. The blockchain distributed ledger technology uses a chain-like storage structure, with each block consisting of a block header, block body, and block tail. The block header stores the hash value of the previous block, the hash value of the current block, the current timestamp, and the Merkle root. The block body stores the packaged original traceability data and traceability analysis report, and the block tail stores the node signature information.
[0037] Optionally, in this embodiment of the application, node permissions are set, and the operation permissions of each node are preset through a smart contract, recorded as node signature information, and the node signature information is written to the end of the block; Based on the AES-256 encryption algorithm, the original traceability data and traceability analysis report are encrypted to obtain the hash value of the corresponding block, and can be decrypted by only authorized nodes through a preset smart contract; A preset packaging cycle is established. The encrypted traceability raw data and traceability analysis report are packaged according to the packaging cycle to generate blocks. The Merkle root of the corresponding block is calculated, and the hash value of the previous block, the hash value of the current block, the Merkle root, and the current timestamp are written into the block header.
[0038] It should be noted that in the aforementioned customer barcode traceability consortium blockchain, each node verifies the newly added block through a Byzantine fault-tolerant consensus mechanism to confirm the legality of the data in the newly added block. If the data is legal, the addition of the block is successful; otherwise, the addition of the block fails. The successfully added block is added to the distributed ledger of the consortium blockchain, and each node updates its local ledger synchronously. All traceability raw data and traceability analysis reports uploaded to the blockchain are integrated to form an immutable traceability database that supports rapid retrieval.
[0039] To further explain, the Merkle root is calculated by merging the original traceability data and the hash value of the traceability analysis report in the block layer by layer according to a binary tree structure. It is the core identifier for verifying the integrity of data within the block. The specific calculation steps include: The initial block hash list obtained after processing the original traceability data and traceability analysis report in the block is used as the leaf node of the Merkle tree. For example, if the block contains 8 data blocks, the corresponding leaf node hash values are H1, H2, H3, H4, H5, H6, H7, and H8. The calculation is based on the layer-by-layer merging of the binary tree, specifically: First-level merging (leaf node → second-level node): The hash values of two adjacent leaf nodes are concatenated (for example, H1 and H2 are concatenated to H1+H2). The hash value of the concatenated string is calculated using the SHA-256 algorithm to obtain the hash value H12 of the second-level node; Similarly, the hash values H34, H56, and H78 of the second-level nodes are calculated, and there are a total of 4 nodes in the second level; Second-level merge (second-level node → third-level node): The hash values of the first and second nodes of the second-level node are concatenated and merged to obtain H1234; similarly, the hash values of the third and fourth nodes of the second-level node are concatenated and merged to obtain H5678. There are a total of 2 nodes in the third level. Third-level merge (third level → root node): concatenate the hash values of the nodes in the third-level nodes to obtain the Merkle root of the corresponding block; It should be noted that if the number of leaf nodes is odd (e.g., 7), the hash value of the last leaf node is concatenated repeatedly (e.g., H7 is concatenated to H7+H7, resulting in H77) to ensure that the number of nodes in each layer is even.
[0040] To further explain, if any data block in the block is tampered with (for example, H2 is modified to H2'), then H12 will become H12', which will cause the Merkle root of the corresponding block to change; the customer barcode traceability consortium chain can quickly determine whether the block body data is complete by comparing the locally calculated Merkle root with the Merkle root in the block header of the corresponding block.
[0041] It should be further explained that, in the specific implementation process, the process of quickly responding to customer barcode traceability requests based on the traceability database, automatically executing traceability permission verification and data retrieval through smart contracts, and generating visualized traceability results includes: Optionally, in this embodiment of the application, the traceability request is submitted to the smart contract of the customer barcode traceability consortium chain. According to the preset smart contract, the legality of the requester's identity and the scope of authority are verified (for example, the customer can only request traceability data of its own associated barcode); the traceability request includes the requester's identity and traceability keywords.
[0042] If the permission verification fails, access is denied; if the permission verification passes, the smart contract generates a search instruction based on the traceability keywords, sends it to the traceability database, and quickly retrieves the corresponding block according to the search instruction. The smart contract decrypts the block and performs structured parsing on the data in the block to extract key information from each stage. Based on the results of the structured parsing, the corresponding visual traceability result is generated.
[0043] It should be further explained that, in the specific implementation process, the process of optimizing customer management based on the aforementioned visualized traceability results includes: Optionally, in this embodiment of the application, an optimization plan is formulated based on the visualized traceability results (e.g., changing to a more efficient carrier, adjusting the location of transit nodes, etc.), the optimization plan is written into a smart contract, and synchronized to all relevant nodes through the customer barcode traceability alliance chain to execute the optimized flow process; personalized service recommendations are provided to customers based on the visualized traceability results to improve customer satisfaction.
[0044] It should be noted that the smart contract is deployed on the customer barcode traceability consortium blockchain, supporting flexible updates to permission rules and optimization schemes; through continuous data analysis and scheme iteration, it continuously improves the efficiency of material circulation and the quality of customer service.
[0045] Example 2: like Figure 2 As shown, a blockchain-based customer barcode traceability management system includes, but is not limited to, a feature extraction module, a data acquisition module, a traceability analysis module, a consortium blockchain storage module, and a traceability service module. The feature extraction module is used to standardize the format of pre-generated customer basic information and barcode associated data, and to encrypt and verify the standardized basic data based on the blockchain hash algorithm to extract the core identification features of the barcode. The data acquisition module collects customer behavior data and material flow data in real time from multiple nodes based on barcode scanning terminals and IoT devices, combines timestamps to complete the data chain construction, obtains the original traceability data, and extracts the barcode dynamic flow characteristics from the original traceability data. The traceability analysis module performs cross-traceability analysis on the barcode's dynamic circulation features based on the core identification features of the barcode to obtain complete traceability link data, and tracks the circulation status of customer-related materials in real time based on the complete traceability link data to generate a traceability analysis report. The consortium blockchain storage module is built on the blockchain distributed ledger technology to construct a customer barcode traceability consortium blockchain. It packages the original traceability data and traceability analysis report into blocks and stores them on the blockchain to form an immutable traceability database. The traceability service module responds quickly to customer barcode traceability requests based on the traceability database, automatically performs traceability permission verification and data retrieval through smart contracts, generates visualized traceability results, and optimizes customer management based on the visualized traceability results.
[0046] Optionally, in this embodiment, those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0047] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0048] If the integrated units in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in the aforementioned computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause one or more electronic devices to execute all or part of the steps of the methods described in the various embodiments of this application.
[0049] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0050] In the several embodiments provided in this application, it should be understood that the disclosed application can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of units or modules may be electrical or other forms.
[0051] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0052] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0053] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A blockchain-based customer barcode traceability management method, characterized in that, The method includes: The acquired basic customer information and barcode-related data are standardized in format, and the standardized data is encrypted and verified based on a blockchain hash algorithm to extract the core identification features of the barcode. Based on barcode scanning terminals and IoT devices, multi-node real-time collection of customer lifecycle behavior data and material flow data is performed. Combined with timestamps, a data chain is constructed to obtain the original traceability data, and barcode dynamic flow characteristics are extracted from the original traceability data. Based on the core identification features of the barcode, cross-traceability analysis is performed on the dynamic circulation features of the barcode to obtain complete traceability link data. Based on the complete traceability link data, the circulation status of customer-related materials is tracked in real time, and a traceability analysis report is generated. A customer barcode traceability alliance chain is built based on blockchain distributed ledger technology. The original traceability data and traceability analysis report are packaged into blocks and stored on the chain to form a traceability database. Based on the traceability database, the system quickly responds to customer barcode traceability requests, automatically executes traceability permission verification and data retrieval through smart contracts, generates visualized traceability results, and optimizes customer management based on these results.
2. The customer barcode traceability management method based on blockchain according to claim 1, characterized in that, The process of encrypting and verifying standardized data based on blockchain hash algorithms to extract core barcode identification features includes: Obtain standardized customer basic information and barcode associated data; concatenate the standardized customer basic information and barcode associated data according to field order to form the original data string; The original data string is encrypted using the SHA-256 hash algorithm to generate a corresponding encrypted hash value, which serves as a data integrity verification identifier. Based on the barcode association data, a core feature field set is obtained; the core feature field set is vectorized to obtain an initial identification feature; the initial identification feature is bound and fused with the encrypted hash value to obtain the barcode core identification feature.
3. The customer barcode traceability management method based on blockchain according to claim 2, characterized in that, The process of collecting customer lifecycle behavior data and material flow data in real time across multiple nodes based on barcode scanning terminals and IoT devices, and combining this with timestamps to construct a data chain to obtain the original traceability data includes: Based on barcode scanning terminals and IoT devices, real-time collection of customer lifecycle behavior data and material flow data is performed across multiple nodes, including production nodes, warehousing nodes, logistics nodes and customer nodes, thereby obtaining corresponding production process data blocks, warehousing process data blocks, logistics process data blocks and customer process data blocks. The data blocks from the production process, warehousing process, logistics process, and customer process are used as the original data for traceability.
4. The customer barcode traceability management method based on blockchain according to claim 3, characterized in that, The process of extracting barcode dynamic circulation features from the original traceability data includes: The data blocks of each stage in the original traceability data are parsed to extract key fields, which are then used to form the original set of flow features; the original set of flow features is cleaned; and the cleaned original set of flow features is then feature-encoded. The encoded features are sorted according to time order to obtain a flow feature sequence; local feature extraction is performed on the flow feature sequence based on a convolutional neural network to obtain the corresponding barcode dynamic flow features.
5. The customer barcode traceability management method based on blockchain according to claim 4, characterized in that, The process of performing cross-tracing analysis on the barcode's dynamic circulation features based on the core identification features of the barcode to obtain complete traceability chain data includes: Using the single-item code from the core barcode identification features as a search keyword, the corresponding traceability raw data is matched in the blockchain distributed ledger. The integrity of the matched traceability raw data is verified based on the hash value of the core barcode identification features, and abnormal data with mismatched hash values is removed. The circulation feature sequence in the barcode dynamic circulation features is dimensionally aligned with the core barcode identification features. The dimensional alignment of the circulation feature sequence with the core barcode identification features is achieved through a fully connected layer, thereby obtaining the corresponding barcode core identification feature vector and barcode dynamic circulation feature vector. The feature similarity is calculated based on the cosine similarity algorithm. A preset feature similarity threshold is used to filter out the flow feature sequences with feature similarity greater than the threshold, and the corresponding link data blocks are spliced together in time stamp order to form a complete traceability link skeleton; The data blocks of each link in the traceability link skeleton are correlated and verified to obtain complete traceability link data.
6. The customer barcode traceability management method based on blockchain according to claim 5, characterized in that, The process of tracking the flow status of customer-related materials in real time based on the complete traceability chain data and generating a traceability analysis report includes: Extract timestamps from each stage of the complete traceability chain data, calculate the time consumed in each stage, and generate stage time statistics. The system collects key lifecycle indicators of customer-related materials in a distributed manner; it integrates complete traceability data, time consumption statistics for each step, and key lifecycle indicators to generate standardized traceability analysis reports.
7. The customer barcode traceability management method based on blockchain according to claim 6, characterized in that, The process of building a customer barcode traceability consortium blockchain based on blockchain distributed ledger technology, and storing the original traceability data and traceability analysis reports on the blockchain in block packaging to form an immutable traceability database includes: Set node permissions by pre-setting the operation permissions of each node through a smart contract, record them as node signature information, and write the node signature information to the end of the block; Based on the AES-256 encryption algorithm, the original traceability data and traceability analysis report are encrypted to obtain the hash value of the corresponding block, and can be decrypted by only authorized nodes through a preset smart contract; A preset packaging cycle is established. The encrypted traceability raw data and traceability analysis report are packaged according to the packaging cycle to generate blocks. The Merkle root of the corresponding block is calculated, and the hash value of the previous block, the hash value of the current block, the Merkle root, and the current timestamp are written into the block header. All on-chain traceability raw data and traceability analysis reports are integrated to form a traceability database.
8. The customer barcode traceability management method based on blockchain according to claim 7, characterized in that, The process of quickly responding to customer barcode traceability requests based on the traceability database, automatically executing traceability permission verification and data retrieval through smart contracts, and generating visualized traceability results includes: The traceability request is submitted to the smart contract of the customer barcode traceability consortium chain. According to the preset smart contract, the legality of the requester's identity and the scope of his / her authority are verified. If the permission verification fails, access is denied; if the permission verification passes, the smart contract generates a search instruction based on the traceability keywords, sends it to the traceability database, and quickly retrieves the corresponding block according to the search instruction. The smart contract decrypts the block and performs structured parsing on the data in the block to extract key information from each stage. Based on the results of the structured parsing, the corresponding visual traceability result is generated.
9. A blockchain-based customer barcode traceability management system, implementing the blockchain-based customer barcode traceability management method according to any one of claims 1 to 8, characterized in that, include: The module includes a feature extraction module, a data acquisition module, a traceability analysis module, a consortium blockchain storage module, and a traceability service module. The feature extraction module is used to standardize the format of pre-generated customer basic information and barcode associated data, and to encrypt and verify the standardized basic data based on the blockchain hash algorithm to extract the core identification features of the barcode. The data acquisition module collects customer behavior data and material flow data in real time from multiple nodes based on barcode scanning terminals and IoT devices, combines timestamps to complete the data chain construction, obtains the original traceability data, and extracts the barcode dynamic flow characteristics from the original traceability data. The traceability analysis module performs cross-traceability analysis on the barcode's dynamic circulation features based on the core identification features of the barcode to obtain complete traceability link data, and tracks the circulation status of customer-related materials in real time based on the complete traceability link data to generate a traceability analysis report. The consortium blockchain storage module is built on the blockchain distributed ledger technology to construct a customer barcode traceability consortium blockchain. It packages the original traceability data and traceability analysis report into blocks and stores them on the blockchain to form an immutable traceability database. The traceability service module responds quickly to customer barcode traceability requests based on the traceability database, automatically performs traceability permission verification and data retrieval through smart contracts, generates visualized traceability results, and optimizes customer management based on the visualized traceability results.