Blockchain-based material traceability management method

By generating tamper-proof identity records and circulation chain status records for materials using blockchain technology, the problems of easily tampered data identification and difficulty in tracing the trajectory in material traceability management are solved, and reliable traceability and accountability in the material circulation process are achieved.

CN122264707APending Publication Date: 2026-06-23CHINA HUADIAN GROUP CO LTD SICHUAN BRANCH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610380335.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-26
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Traditional material traceability management methods lack a unique mechanism, which makes it easy for material entry data identifiers to be tampered with or duplicated, making it difficult to build a continuous trajectory, making it difficult to detect and accurately locate path anomalies, and increasing the difficulty of assigning responsibilities due to insufficient data consistency verification.

Method used

A blockchain-based material traceability management method is adopted. Irreversible digest hash values ​​are generated by the SHA-256 hash function, and standardized status codes are generated by combining GS1 event identification codes. The circulation records are encrypted using the Keccak hash function to construct a chain-like status record of material circulation. Trajectory anomalies are identified by geocoding and time intervals, and hash path consistency is compared by combining Merkle tree structure to generate a list of traceability anomaly label identities.

Benefits of technology

To achieve an immutable digital identity for materials entering the warehouse, ensure the integrity of the trajectory in processes such as allocation, identify jump points and loops in the trajectory, ensure the integrity and accuracy of node data, and enable materials to be traceable, located, and verified in abnormal states.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122264707A_ABST
    Figure CN122264707A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of traceability management, in particular to a material traceability management method based on block chain, comprising the following steps: obtaining material data, matching nodes, generating index string, generating chain identity by hashing, extracting log code state, encrypting records, comparing path sequences, marking abnormalities, checking main chain, generating copy abnormalities, reverse checking batch suppliers, and allocating warehouses to generate an abnormal label list. In the present application, the chain identity record is formed by the construction method based on the unique index string of the label combined with the hash encryption, which guarantees the integrity of the track of the material in the multi-node links such as allocation and warehouse-out. The abnormal situation of jump point and loop in the track can be effectively identified by the path sequence construction method of geographic coding and time interval. The key information of the abnormal label is summarized by reverse search to collect the abnormal label identity list, realizing the construction of the whole process data chain of the traceability, positioning and checkability of the material in the abnormal state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of traceability management technology, and in particular to a blockchain-based method for material traceability management. Background Technology

[0002] The field of traceability management technology primarily involves collecting, recording, storing, and querying information on the status, flow path, usage, and related events of products, materials, equipment, and components throughout their entire lifecycle. This aims to achieve a control system where the source is traceable, the destination is trackable, the process is controllable, and responsibility is accountable. This technology typically integrates information technology, IoT technology, data management technology, and traceability mechanisms, and is widely applied in supply chain management, quality control, logistics and warehousing, food safety, drug regulation, energy equipment, and manufacturing systems. Its core lies in building a highly reliable and consistent information chain, ensuring the authenticity, completeness, and verifiability of information at all key nodes, thereby improving management transparency and risk controllability. With the increasing integration of business across platforms, traceability management technology increasingly relies on a composite technology system including data interconnection and interoperability between multiple systems, identity authentication mechanisms, data standards and specifications, and traceability path optimization.

[0003] The materials traceability management method is a management approach used to collect, identify, record, and query the status information of materials throughout multiple business stages, including procurement, warehousing, storage, allocation, use, return, and disposal. By constructing a traceability data structure and management process, the method can clearly define the material flow trajectory at each stage, ensuring data integrity and consistency. Its purpose is to improve the precision and transparency of materials management, achieve full lifecycle traceability of materials and delineate responsibilities at each stage, and avoid problems such as loss, misallocation, and waste during the material flow process.

[0004] Traditional management methods lack a uniqueness mechanism in the generation of label identities, which leads to the risk of data identification being tampered with or duplicated after materials are put into storage. In actual warehousing and transfer operations, the reliance on methods for recording cannot build a continuous trajectory, and problems such as missing nodes and inconsistent records are prone to occur. It is difficult to detect and accurately locate path anomalies in a timely manner. In terms of data consistency verification, there is a lack of a node verification mechanism based on the blockchain structure, which makes it impossible to trace and compare abnormal node data. For example, when the status of materials is mismatched after cross-regional transfer, it is difficult to restore the true flow path of the materials, which increases the difficulty of subsequent responsibility division. Summary of the Invention

[0005] The purpose of this invention is to address the shortcomings of existing technologies by proposing a blockchain-based material traceability management method.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: a blockchain-based material traceability management method, comprising the following steps:

[0007] S1: Obtain data on newly received materials from the power plant, including three items: EPC tag number, material code, and storage area code. Use the SHA-256 hash function to generate an irreversible digest hash value and submit it to the current height block of the blockchain for writing, generating the initial on-chain identity record of the materials.

[0008] S2: Call the initial on-chain identity record of the material, combine the inventory change record, transfer work order and RFID scanning log corresponding to the material tag, generate a standardized status code according to the GS1 event identification code, encrypt it through the Keccak hash function and write it into the specified data segment on the chain to generate a material flow chain status record.

[0009] S3: Obtain the material flow chain status record associated with the material to be traced and detected, extract the event time and node code, arrange the node codes in time order to form a path sequence, calculate the geographic code spacing between consecutive events, determine whether there are jump points, loops or node loss, mark the label number of discontinuous trajectory features in the path chain, and generate an abnormal path chain label set.

[0010] S4: Call the tag number included in the abnormal path chain tag set, retrieve the replica hash record of the corresponding blockchain node, analyze whether there is a conflict in the path hash value, extract the hash inconsistency item and the chain branch node number, and generate a set of abnormal replica nodes on the chain.

[0011] S5: Based on the node number in the set of abnormal nodes in the chain replica, extract the EPC code record and path hash value of each tag in the node, and reverse query the three information items of the batch to which it belongs, supplier ID and last transfer warehouse code according to the unique index string corresponding to the abnormal tag. Organize the related fields and combine them into a tag chain summary structure to generate a traceability abnormal tag identity list.

[0012] As a further aspect of the present invention, the initial on-chain identity record of the materials includes a unique hash digest, a block height index, an on-chain commit timestamp, and a node code; the material flow chain status record includes a status identifier code, on-chain storage location, an event time index, and a tag index association; the abnormal path chain marker set includes a path jump tag number, a path continuity missing segment number, a path reverse flow number, and an abnormal time interval index; the on-chain replica abnormal node set includes a conflict hash value number, a branch chain node number, a hash inconsistency record index, and a branch chain path location; and the traceability abnormal tag identity list includes an abnormal tag unique index, a corresponding supplier identifier, a corresponding warehousing batch number, and an abnormal storage node code.

[0013] As a further aspect of the present invention, the steps for obtaining the identity record on the initial material chain are specifically as follows:

[0014] S101: Obtain data on newly received materials in the power plant, including three items: EPC tag number, material code, and storage area code. Call the storage area code and equipment node asset code lookup table for matching and comparison. Based on the matching and comparison relationship, extract the equipment node number corresponding to the storage area code. Then, concatenate the equipment node number with the EPC tag number to construct a joint index string with material location attributes, and obtain the equipment tag joint index information.

[0015] S102: Based on the device tag composite index information, call the current Unix timestamp data corresponding to the material code, concatenate the device tag composite index value and the Unix timestamp according to the character sequence, and use the concatenation structure as input data. Use the SHA-256 hash function to perform encrypted digest, construct irreversible hash code data, and generate material chain encryption identifier string.

[0016] S103: Based on the encrypted identifier string for material entry into the blockchain, extract the chain height number of the current block and use it as a hash writing positioning parameter. Write the encrypted identifier string for material entry into the blockchain into the data record field corresponding to the block number, and simultaneously generate a set of index relationships between the record timestamp, tag number and chain height to establish the initial on-chain identity record of the material.

[0017] As a further aspect of the present invention, the steps for obtaining the material flow chain status record are specifically as follows:

[0018] S201: Call the unique index string and node code generated in the initial chain identity record of the material, collect the inventory change record, transfer operation order and RFID scanning log associated with the tag number, aggregate the tag status field recorded in the log, and perform field comparison on the aggregation result based on the node code, filter the data fragments that match the status field with the current node code, and establish a tag node status mapping set.

[0019] S202: Extract the status attribute field of each record based on the tag node status mapping set, call the GS1 event identification code field rules, compare the event type with the status attribute, assign a standardized status code to each status data according to the matching relationship, integrate the standardized status code and the unique index string into a single data structure according to the field concatenation order, and generate the tag standard status structure.

[0020] S203: Based on the standard status structure of the tag, call the Keccak hash function for encryption processing, obtain the encrypted digest corresponding to the structure, write the digest into the data segment corresponding to the current block number in the blockchain, and simultaneously establish an on-chain bidirectional index structure of the status code index field and the tag number field to generate a chain-like status record of material flow.

[0021] As a further aspect of the present invention, the aggregation process of the tag status field is specifically as follows: sorting the tag status field according to the time order in which the same tag number appears in multiple business records, filtering out consecutive records with a time interval lower than a set time threshold, wherein the time threshold is the median of the time interval values ​​of the tag status field, and retaining the consecutive status sequence within the maximum time span based on the sorting result, wherein the maximum time span is the mean of the time difference between valid records plus twice the standard deviation;

[0022] The process of performing field comparison on the aggregation result based on node code is as follows: the device node code field included in the retained continuous state sequence is mapped and verified one-to-one with the node code, state records with inconsistent node code fields and node codes are filtered out, and only state records with consistent node code fields are retained.

[0023] As a further aspect of the present invention, the step of obtaining the abnormal path chain marker set specifically includes:

[0024] S301: Obtain the material flow chain status record associated with the material to be traced and detected, extract the event time field and the corresponding node code field recorded in the chain structure, call the geocode configuration table corresponding to the node code field, retrieve the geocode value corresponding to each node, and rearrange the order based on the event time field, arrange the geocode and node code in time order to form a path structure, and generate a node time path sequence structure.

[0025] S302: Based on the node time path sequence structure, calculate the geographic distance according to the geocoding field between adjacent nodes in the path sequence, identify node pairs whose geographic distance value is greater than the maximum distance threshold, count the number of jump points, loops and missing segments, and calculate the path discrete anomaly intensity value.

[0026] S303: Based on the path discrete anomaly intensity value, filter the label numbers of the path discrete anomaly intensity value that are greater than the abnormal discrete threshold, mark them as data records with path trajectory discontinuity characteristics, and concatenate the path jump label number with the geographical location missing segment number to obtain the abnormal path chain label set.

[0027] As a further aspect of the present invention, the formula for calculating the path discrete anomaly intensity value is specifically as follows:

[0028] ;

[0029] in, This represents the path discrete anomaly intensity value. To represent the number of consecutive event pairs in a path, For the first The node geocoding normalized value of each event. For the first The normalized timestamp value of an event For the first Normalized value of geographic jump distance of segment path, For the path set Normalized value of reference length for segment path. For the first Normalized value of the number of times label recognition failed on the segment path.

[0030] As a further aspect of the present invention, the step of obtaining the set of abnormal on-chain replica nodes specifically includes:

[0031] S401: Call the tag number included in the abnormal path chain tag set, retrieve the replica hash record at the current block height in the blockchain node corresponding to the tag number, locate the Merkle tree substructure including the tag number, extract the event hash path and branch node number associated with the tag number in the structure, and establish the tag event hash path structure.

[0032] S402: Based on the tag event hash path structure, extract the event hash value sequence and the node code, call the corresponding event hash path structure at the same height of the main chain for matching, compare whether each pair of event hash values ​​is consistent according to the node code order, filter the tag number and node code position where hash collision occurs, and generate tag hash collision comparison information.

[0033] S403: Based on the conflicting tag number and node code recorded in the tag hash conflict comparison information, aggregate the node information with inconsistent hash values, remove duplicates, construct a node number set, and establish a mapping structure between the set and the original tag number to generate an on-chain replica abnormal node set.

[0034] As a further aspect of the present invention, during the construction of the tag hash conflict comparison information, when performing a consistency comparison of the hash values ​​of each pair of main chain records and replica records in the event hash value sequence, the conflict determination threshold is set to the median deviation of the frequency of occurrence of hash values ​​in all path positions in the event hash path exceeding one standard deviation.

[0035] In the process of filtering tag numbers that have hash collisions, only event hash value pairs that are inconsistent in two or more consecutive path locations are retained;

[0036] During the generation of the set of abnormal nodes in the on-chain replica, aggregation is performed based on the tag number and corresponding node code that meet the conflict determination conditions in the tag hash conflict comparison information, and node records with the same path position and completely identical hash value are removed during the aggregation process.

[0037] As a further aspect of the present invention, the steps for obtaining the source tracing anomaly tag identity list are specifically as follows:

[0038] S501: Based on the node number in the set of abnormal nodes of the on-chain replica, retrieve the tag data frame recorded inside the node, extract the EPC code and path hash value in each record, compare the path hash value of each tag with the corresponding record at the same block height of the main chain at the field level, filter the tag codes with inconsistent fields in the path hash value, and generate an abnormal tag path filter set.

[0039] S502: Based on the tag codes in the abnormal tag path filtering set, call the unique index string corresponding to each tag, use the index to reverse match the asset registration record and warehouse transfer log, and sequentially obtain the inbound batch number, supplier identification code and last transfer warehouse node code corresponding to the tag, and establish a tag attribute field set.

[0040] S503: Based on the tag codes in the abnormal tag path filtering set and the attribute information in the tag attribute field set, construct the correspondence between the unique index string of the tag and the three attribute fields of the batch number of the warehouse entry, the supplier identification code and the last transfer storage node code, unify the data structure of the mapping results, encapsulate them into structured tag chain information, and generate a traceability abnormal tag identity list.

[0041] Compared with the prior art, the advantages and positive effects of the present invention are as follows:

[0042] In this invention, an on-chain identity record is formed by constructing a unique index string based on tags and combining it with hash encryption. This ensures that materials have an immutable digital identity as soon as they enter the warehouse. Standardized status codes are used in conjunction with tag status change events to generate a flow chain record, ensuring the integrity of the material's trajectory in multiple stages such as allocation and outbound. By constructing a path sequence using geocoding and time intervals, abnormal situations with jumps and loops in the trajectory can be effectively identified. Event hash path consistency comparison is performed using the blockchain Merkle tree structure to ensure the integrity and accuracy of node data replication. By reversing the search and summarizing the key information of abnormal tags, an abnormal tag identity list is compiled, realizing the construction of a traceable, locatable, and verifiable data chain for materials in abnormal states. Attached Figure Description

[0043] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0044] Figure 1 This is a schematic diagram of the main steps of the present invention;

[0045] Figure 2 This is a detailed schematic diagram of S1 of the present invention;

[0046] Figure 3 This is a detailed schematic diagram of S2 of the present invention;

[0047] Figure 4 This is a detailed schematic diagram of S3 of the present invention;

[0048] Figure 5 This is a detailed schematic diagram of S4 of the present invention;

[0049] Figure 6 This is a detailed schematic diagram of S5 of the present invention. Detailed Implementation

[0050] The technical solution of the present invention will now be described with reference to the accompanying drawings.

[0051] In embodiments of the present invention, words such as "exemplarily," "for example," etc., are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" in the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the word "exemplary" is intended to present the concept in a concrete manner. Furthermore, in embodiments of the present invention, the meaning expressed by "and / or" can be both, or either one.

[0052] In the embodiments of this invention, the terms "image" and "picture" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning. Similarly, the terms "of," "corresponding (relevant)," and "corresponding" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning.

[0053] In this embodiment of the invention, sometimes a subscript such as W1 may be written in a non-subscript form such as W1. When the difference is not emphasized, the meaning they express is the same.

[0054] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.

[0055] Please see Figure 1 This invention provides a technical solution: a blockchain-based method for material traceability management, comprising the following steps:

[0056] S1: Obtain data on newly received materials from the power plant, including three items: EPC tag number, material code, and storage area code. Call the storage area code and equipment node asset code lookup table to match the location nodes. Concatenate the node code generated after matching with the EPC tag number to form a unique index string. Based on the material code, call the Unix timestamp and the unique index string to combine them, use the SHA-256 hash function to generate an irreversible digest hash value, and submit it to the current height block of the blockchain for writing, generating the initial on-chain identity record of the material.

[0057] The EPC label number is an internationally standardized material identification code used to uniquely identify logistics labels; the SHA-256 hash function is a NIST standard hash algorithm, widely used in blockchain for data encryption and immutability verification; the Unix timestamp is a standard second-level time stamp that can uniquely correspond to the data submission time.

[0058] S2: Call the unique index string and node code generated in the initial chain identity record of the material, combine the inventory change record, transfer work order and RFID scanning log corresponding to the material tag, extract the tag status change event and compare it with the equipment node code, generate a standardized status code according to the GS1 event identification code, concatenate the status code with the unique index string, encrypt it with the Keccak hash function and write it into the specified data segment on the chain to generate a chain status record of material flow.

[0059] GS1 event identifiers are used to describe the status of items, such as ObjectEvent and AggregationEvent, based on the EPCIS standard; the Keccak hash function is the standard encryption function used by mainstream smart contract blockchain underlying platforms; WMS logs and transfer work orders are the standard business data formats of warehouse management systems and enterprise resource planning systems.

[0060] S3: Obtain the material flow chain status record associated with the material to be traced and inspected, extract the event time and node code, extract the geographic code of each node and the time interval between events, call the path structure diagram corresponding to the unique index string, arrange the node codes in chronological order to form a path sequence, calculate the geographic code spacing between consecutive events, and compare it with the set predefined minimum flow path set to determine whether there are jump points, loops or node loss, accumulate the number of missing segments and jump intervals in the path diagram, mark the label number of the path chain with discontinuous trajectory characteristics, and generate an abnormal path chain label set;

[0061] Geocoding is the standard used for exchanging vehicle and equipment location data; the predefined minimum circulation path set comes from the standard warehouse transfer path map configured in the system, and the shortest circulation chain is calculated based on the location codes between nodes;

[0062] S4: Call the tag number included in the abnormal path chain tag set, retrieve the replica hash record of the corresponding blockchain node, extract the event hash path of the tag under the current block height from the Merkle tree structure, compare it with the record of the same height in the main chain, analyze whether there is a conflict in the path hash value, extract the hash inconsistency item and the chain branch node number, and generate the set of abnormal replica nodes on the chain.

[0063] The Merkle tree structure is a standard data digest tree in blockchain, used to verify on-chain data integrity and branch consistency; consistency is determined based on whether path hash value collisions exist between the main chain and the secondary chain with the same tag number.

[0064] S5: Based on the node number in the set of abnormal nodes in the on-chain replica, extract the EPC code record and path hash value of each tag in the node, filter the tag items whose path hash value is inconsistent with the main chain record, and reverse query the three items of information, namely the batch of goods entering the warehouse, supplier ID and last transfer warehouse code, according to the unique index string corresponding to the abnormal tag. Organize the related fields and combine them into a tag chain summary structure to generate a list of traceable abnormal tag identities.

[0065] The supplier ID and the batch number are both standard business fields in the ERP system; the EPC code record is the original unique identifier written on the chain and is bound to the main chain path hash to form a verifiable index.

[0066] The initial on-chain identity record for materials includes a unique hash digest, block height index, on-chain commit timestamp, and node code. The chain-like status record for material flow includes a status identifier code, on-chain storage location, event time index, and tag index association. The abnormal path chain marker set includes path jump tag number, path continuity missing segment number, path reverse flow number, and abnormal time interval index. The on-chain replica abnormal node set includes conflict hash value number, branch chain node number, hash inconsistency record index, and branch chain path location. The traceability abnormal tag identity list includes a unique index of abnormal tag, corresponding supplier identifier, corresponding warehousing batch number, and abnormal storage node code.

[0067] Please see Figure 2 The specific steps for obtaining the identity record on the initial supply chain are as follows:

[0068] S101: Obtain data on newly received materials in the power plant, including three items: EPC tag number, material code, and storage area code. Call the storage area code and equipment node asset code lookup table for matching and comparison. Based on the matching and comparison relationship, extract the equipment node number corresponding to the storage area code. Then, concatenate the equipment node number with the EPC tag number to construct a joint index string with material location attributes, and obtain the equipment tag joint index information.

[0069] The newly received material data, specifically a batch of high-pressure valves, was retrieved from the power plant's material management system. This record contains an EPC tag number of "EPC20250930001", a material code of "MV-HPT-075A", and a storage area code of "KW-A03-H05-L02". Subsequently, the internally stored "Storage Area Code and Equipment Node Asset Code Comparison Table" was accessed. The table structure is shown in Table 1. An entry matching the storage area code "KW-A03-H05-L02" was searched in this table. The search operation performed a string exact match on the "Storage Area Code" field of the comparison table, finding a matching equipment node asset code of "1B-SG-PREHEATER-IN". Next, the obtained device node number "1B-SG-PREHEATER-INLET-V01" is concatenated with the aforementioned EPC tag number "EPC20250930001". The concatenation rule is to use the device node number as a prefix, the EPC tag number as a suffix, and use a colon ":" as a separator. Specifically, the string "1B-SG-PREHEATER-INLET-V01" and the string "EPC20250930001" are concatenated to construct a composite index string "1B-SG-PREHEATER-INLET-V01:EPC20250930001", thus obtaining the device tag composite index information.

[0070] Table 1 Comparison of Warehouse Areas and Equipment Nodes

[0071] ;

[0072] As shown in Table 1, this lookup table establishes a logical mapping relationship between the physical location of the warehouse and the power plant equipment assets. The warehouse area code "KW-A03-H05-L02" represents the second storage location on the left side of the fifth layer of shelf 03 in warehouse area A.

[0073] S102: Based on the device tag composite index information, call the current Unix timestamp data corresponding to the material code, concatenate the device tag composite index value and the Unix timestamp according to the character sequence, and use the concatenation structure as input data. Use the SHA-256 hash function to perform encrypted digest, construct irreversible hash code data, and generate the material entry encrypted identifier string.

[0074] Based on the device tag composite index information "1B-SG-PREHEATER-INLET-V01: EPC20250930001", the material information database is then accessed. The database is searched for the current system timestamp associated with the material code "MV-HPT-075A". The obtained Unix timestamp data is "1759240800", which represents the number of seconds elapsed from 00:00 on January 1, 1970, until the material receiving operation occurred. Subsequently, the device tag composite index value "1B-SG-PREHEATER-INLET-V01: EPC20250930001" is compared with the obtained Unix timestamp "1759240800". "The characters are concatenated in sequence without any delimiters, forming a long string "1B-SG-PREHEATER-INLET-V01:EPC202509300011759240800". This concatenated structure is used as input data, and the built-in SHA-256 hash function is called to perform a cryptographic digest operation on this input data. The SHA-256 function converts input data of arbitrary length into a fixed-length 256-bit (32-byte) hash value. This operation is irreversible, and the result is a hexadecimal string, such as "a3f1…7e9b", thus constructing irreversible hash code data and generating a material entry encryption identifier string."

[0075] S103: Based on the encrypted identifier string of the materials entering the chain, extract the chain height number of the current block of the blockchain and use it as a hash to write the positioning parameter. Write the encrypted identifier string of the materials entering the chain into the data record field corresponding to the block number, and simultaneously generate a set of index relationships between the record timestamp, tag number and chain height to establish the initial on-chain identity record of the materials.

[0076] Based on the hash value of the encrypted identifier string "a3f1…7e9b" for materials entering the blockchain, the chain height number of the latest block is extracted from the connected blockchain network node. This number is "952701". This chain height number "952701" is used as the positioning parameter for the hash write operation. Subsequently, the encrypted identifier string "a3f1…7e9b" for materials entering the blockchain is written as a data entry into the data record field of the block with the number "952701" in the blockchain network. Simultaneously with the write operation, an index relationship record is generated in the local index database. The record contains three fields: record timestamp, tag number, and chain height. Specifically, the record timestamp is "1759240800", the tag number is "EPC20250930001", and the chain height is "952701". These three pieces of data are integrated into an index relationship set, which has the form {"timestamp": "1759240800", "epcId": "EPC20250930001", "blockHeight": "952701"}, thus completing the establishment of the initial chain identity record for the material.

[0077] Please see Figure 3 The specific steps for obtaining the status record of the material flow chain are as follows:

[0078] S201: Call the unique index string and node code generated in the initial chain identity record of materials, collect the inventory change records, transfer work orders and RFID scanning logs associated with the tag number, aggregate the tag status fields recorded in the logs, and perform field comparison on the aggregation results based on the node code, filter the data fragments that match the status field with the current node code, and establish a tag node status mapping set.

[0079] The aggregation process of the tag status field is as follows: sort the tag status field according to the time order in which the same tag number appears in multiple business records, filter out consecutive records with a time interval lower than a set time threshold, the time threshold being the median of the time interval values ​​of the tag status field, and retain the consecutive status sequence within the maximum time span based on the sorting results, the maximum time span being the mean of the time difference between valid records plus twice the standard deviation.

[0080] The process of performing field comparison on the aggregation result based on node code is as follows: the device node code field included in the retained continuous state sequence is mapped and verified one-to-one with the node code, and state records with inconsistent node code fields and node codes are filtered out, and only state records with consistent node code fields are retained.

[0081] The system retrieves the unique index string "1B-SG-PREHEATER-INLET-V01: EPC20250930001" and node code "1B-SG-PREHEATER-INLET-V01" generated based on the initial chain identity record of the materials. It then collects all inventory change records, transfer orders, and RFID scanning logs associated with the tag number "EPC20250930001" from the database of the materials management system. The system performs aggregation processing on the tag status fields recorded in these log files. This aggregation process first considers the time when the same tag number "EPC20250930001" appears in multiple business records. The process involves sorting all relevant label status fields, such as "Inbound," "Shelf," "Relocation," "Outbound," and "Installation," in ascending order. This sorting yields a time-series status record. Next, the time intervals between adjacent records in this sequence are calculated, resulting in a set of time interval values, such as {10, 15, 16, 25, 60} minutes. The median of this set of values, 16 minutes, is then calculated and set as the time threshold. Consecutive records with time intervals less than 16 minutes are filtered out. The remaining records are then used to calculate the mean of the time differences between these valid records, set to 28 minutes, and the standard deviation, set to 15 minutes. The maximum time span is calculated by adding twice the standard deviation to the mean. The system calculates the time in minutes and retains a continuous state sequence within 58 minutes based on this result. Then, it performs a field comparison on this aggregation result based on the node code "1B-SG-PREHEATER-INLET-V01". Specifically, it performs a one-to-one string matching verification between the device node code field contained in each record in the retained continuous state sequence and the input node code "1B-SG-PREHEATER-INLET-V01". It filters out state records in which the node code field is inconsistent with "1B-SG-PREHEATER-INLET-V01" and retains only state records in which the node code field is completely consistent, thus establishing a tag node state mapping set.

[0082] S202: Extract the status attribute field of each record based on the tag node status mapping set, call the GS1 event identification code field rules, compare the event type with the status attribute, assign a standardized status code to each status data according to the matching relationship, integrate the standardized status code and the unique index string into a single data structure according to the field concatenation order, and generate the tag standard status structure.

[0083] Extract the status attribute field of each valid record. For example, if the status attribute of a record is "Outbound Completed", then call the preset GS1 event identification code field rule base. This rule base defines the mapping relationship between business status and standard event codes. Compare the extracted status attribute "Outbound Completed" with the event type field in the rule base, and find the corresponding standardized status code based on the matching relationship. For example, if the rule base defines "Outbound Completed" as matching "urn:epc:evt:ObjectEvent:removing", then assign this standardized status code to this status data. Then, apply this standardized status code "urn:epc:evt:ObjectEvent:removing" to the record. c:evt:ObjectEvent:removing” and the unique index string of the material “1B-SG-PREHEATER-INLET-V01:EPC20250930001” are combined according to the preset field concatenation order, with the unique index string first and the standardized status code second, separated by a semicolon “;”, to form a single data structure “1B-SG-PREHEATER-INLET-V01:EPC20250930001;urn:epc:evt:ObjectEvent:removing”, generating a standard status structure for the tag.

[0084] S203: Based on the standard status structure of the tag, call the Keccak hash function to perform encryption processing, obtain the encrypted digest corresponding to the structure, write the digest into the data segment corresponding to the current block number in the blockchain, and simultaneously establish an on-chain bidirectional index structure of the status code index field and the tag number field to generate a chain-like status record of material flow.

[0085] Based on the tag standard state structure "1B-SG-PREHEATER-INLET-V01:EPC20250930001;urn:epc:evt:ObjectEvent:removing", the Keccak hash function (specifically Keccak-256) is called to encrypt this structure. This function converts the input string into a 256-bit cryptographic digest, obtaining the cryptographic digest value corresponding to the structure, for example, "8c2d…5a0f". Then, this digest "8c2d…5a0f" is written to the data segment corresponding to the current block of the blockchain (let's say its number is "952788"). During the writing process, a bidirectional index structure with a status code index field and a tag number field is simultaneously established in the on-chain status database. Specifically, an index entry is created to map the status code "urn:epc:evt:ObjectEvent:removing" to the tag number "EPC20250930001", and another index entry is created to map the tag number "EPC20250930001" to the status code "urn:epc:evt:ObjectEvent:removing". This bidirectional index structure is used for subsequent data retrieval to complete the generation of the chain-like status record of material flow.

[0086] Please see Figure 4 The specific steps for obtaining the abnormal path chain marker set are as follows:

[0087] S301: Obtain the material flow chain status record associated with the material to be traced and tested, extract the event time field and the corresponding node code field recorded in the chain structure, call the geocode configuration table corresponding to the node code field, retrieve the geocode value corresponding to each node, and rearrange the order based on the event time field, arrange the geocode and node code in time order to form a path structure, and generate a node time path sequence structure.

[0088] Retrieve the chain-like status record of the material flow associated with the material to be inspected, “EPC20250930001”. Extract the event time field and the corresponding node code field of each record from the chain-like record to obtain a sequence, such as [{Event Time: “1759240800”, Node Code: “KW-A03-H05-L02”}, {Event Time: “1759327200”, Node Code: “TRANS-AREA-01”}, {Event Time: “1759413600”, Node Code: “1B-SG-PREHEATER-INLET-V01”}]. Then, call the internally stored “geographic code configuration table corresponding to the node code field” to retrieve the geographic code value corresponding to each node code in the table. For example, the geographic code corresponding to “KW-A03-H05-L02” is found to be “(116.39, 39.91)”, “TRANS-AREA- The geocode corresponding to "01" is "(116.42, 39.93)", and the geocode corresponding to "1B-SG-PREHEATER-INLET-V01" is "(116.45, 39.95)". Next, the geocode sequence is rearranged based on the event time field. Since the original sequence was already sorted by time, the order remains unchanged. Finally, the geocodes and node codes are arranged together according to time order to form a path structure and generate node times. The path sequence structure is in the form of [("1759240800", "KW-A03-H05-L02", (116.39, 39.91)), ("1759327200", "TRANS-AREA-01", (116.42, 39.93)), ("1759413600", "1B-SG-PREHEATER-INLET-V01", (116.45, 39.95))].

[0089] S302: Based on the node time path sequence structure, calculate the geographic distance according to the geocoding field between adjacent nodes in the path sequence, identify node pairs whose geographic distance value is greater than the maximum distance threshold, count the number of jump points, loops and missing segments, and calculate the path discrete anomaly intensity value.

[0090] The specific formula for calculating the discrete anomaly intensity value of the path is as follows:

[0091] ;

[0092] in, This represents the path discrete anomaly intensity value. To represent the number of consecutive event pairs in a path, For the first The normalized value of the node geocoding for each event is calculated based on the relative position of the actual geographic coordinates within the standard boundary. For the first The timestamp normalized value of each event is extracted from the event log time field. For the first The normalized value of the geographic jump distance of the segment path is calculated by dividing the difference in geocoding between adjacent nodes by the maximum coding interval. For the path set The normalized reference length value of the segment path is standardized according to a uniform ratio based on the standard path map. For the first The normalized value of the number of label recognition failures on the segment path is calculated as the ratio of the number of recognition failures to the expected total number of recognitions for that segment. The abnormal discrete threshold is set by extracting multiple consecutive flow record sequences from the flow path records, calculating the corresponding path discrete anomaly intensity value distribution range, and setting the upper limit of the 95% confidence interval as the anomaly judgment threshold to ensure that the judgment benchmark comes from quantifiable reference baseline data.

[0093] The geographic distance is calculated for the geocoding fields of adjacent nodes in the path sequence, and node pairs with geographic distance values ​​greater than the maximum distance threshold are identified. Then, the number of hops, loops, and missing segments in the path is counted using the following formula:

[0094] ;

[0095] The discrete anomaly intensity value of the path is obtained through calculation. The parameters and calculation logic in the formula are explained below. The final calculated path discrete anomaly intensity value integrates anomalies from multiple dimensions within the path. This represents the number of consecutive event pairs in the path. For a path containing 3 nodes, The value is 3, summation symbol This indicates the sequence of events from the first event pair to the second event pair in the path. The metrics of each event pair (i.e., the last event pair) are summed and then divided by . The first part of the formula is used to obtain the average value of outlier indicators. The rate of change of geographical location per unit time was calculated, reflecting the abnormal speed of material movement. (Part Two) The deviation between the actual travel distance and the reference distance was calculated, reflecting spatial trajectory anomalies of the path. (Part Three) This introduces RFID identification failures during the flow process, reflecting anomalies at the data acquisition level. The sum of these three factors forms a comprehensive anomaly score for a single path segment. The advantage of this formula lies in constructing a multi-dimensional path anomaly assessment model by combining quantitative indicators from three dimensions: speed, path, and data quality. Compared to single-dimensional judgments, this formula can more comprehensively and accurately identify complex flow anomalies, such as forged paths or data tampering. In a specific calculation, the path contains four nodes, therefore... The number of event pairs is 3, and the specific parameters are shown in Table 2.

[0096] Table 2 Parameters for Calculating Path Anomaly Intensity

[0097] ;

[0098] As shown in Table 2, the methods for obtaining each parameter are as follows. The actual geographic coordinates of the node, for example (116.39, 39.91), are linearly normalized to the interval [0, 1] within the geographical boundary of the factory area (e.g., a rectangular area of ​​10km x 10km). This is obtained by normalizing the Unix timestamps of events within a range of one day (86400 seconds), for example... for , , , , For the first The normalized value of the geographic jump distance of a segment path is calculated as the difference between the normalized geocodes of adjacent nodes, for example... , The length of the corresponding road segment is obtained by standardizing the proportions according to the pre-set standard route map of the project. The abnormal dispersion threshold is set as the ratio of the number of RFID identification failures to the expected total number of identifications (e.g., one identification every 10 meters) along this path. It is determined by extracting 1000 records of similar material flow paths from a historical database, calculating the path dispersion anomaly intensity value for each record, forming a distribution interval, and then applying this interval to the 1000 records. The values ​​are sorted, and the 950th value is taken as the upper limit of the 95% confidence interval and set as the anomaly detection threshold. The calculated threshold is 1.25. The data in Table 2 are substituted into the formula.

[0099] At that time, the item was ;

[0100] At that time, the item was ;

[0101] At that time, the item was ;

[0102]

[0103] The result of 9.071 is much greater than the anomaly detection threshold of 1.25, indicating that there is a significant discrete anomaly in the circulation path of the material.

[0104] S303: Based on the path discrete anomaly intensity value, filter the label numbers of the path discrete anomaly intensity value that are greater than the abnormal discrete threshold, mark them as data records with path trajectory discontinuity characteristics, and concatenate the path jump label number with the geographical location missing segment number to obtain the abnormal path chain label set.

[0105] Based on the path discrete anomaly intensity value of 9.071, this value is compared with the preset anomaly discrete threshold of 1.25. A judgment operation is performed, the judgment condition being whether the path discrete anomaly intensity value is greater than the anomaly discrete threshold. Since 9.071 > 1.25, this condition is met. Therefore, the tag number "EPC20250930001" associated with this path is marked as a data record with path trajectory discontinuity characteristics. Subsequently, the path segment that contributes the largest anomaly value is identified, i.e., in the calculation... The path segment (with an anomaly value of 13.63) corresponds to the missing geographic location segment number, which is set as "SEG-03". The path jump label number "EPC20250930001" is concatenated with this missing geographic location segment number "SEG-03" using a hyphen "-" as the concatenation format, resulting in the string "EPC20250930001-SEG-03", forming an abnormal path chain tag set.

[0106] Please see Figure 5 The specific steps for obtaining the set of abnormal on-chain replica nodes are as follows:

[0107] S401: Call the tag number included in the abnormal path chain tag set, retrieve the replica hash record at the current block height in the blockchain node corresponding to the tag number, locate the Merkle tree substructure including the tag number, extract the event hash path and branch node number associated with the tag number in the structure, and establish the tag event hash path structure.

[0108] The system calls the tag number "EPC20250930001" contained in the abnormal path chain tag set and uses this tag number to retrieve its replica hash record at the current block height (e.g., "952788") in the corresponding blockchain node. This record is used to locate the Merkle tree substructure containing the events related to this tag number. In this Merkle tree structure, starting from the leaf node (the event hash of the tag), the system traces upwards to the root node to extract the event hash path associated with the tag number "EPC20250930001". This path consists of a series of hash values ​​of sibling nodes used for verification, such as {"hash_level1_sibling", "hash_level2_sibling", ...}. At the same time, the branch node numbers traversed by this path are extracted, and a tag event hash path structure containing the event hash path and branch node numbers is established.

[0109] S402: Based on the tag event hash path structure, extract the event hash value sequence and the node code, call the corresponding event hash path structure at the same height of the main chain for matching, compare whether each pair of event hash values ​​is consistent according to the node code order, filter the tag number and node code position where hash collision occurs, and generate tag hash collision comparison information.

[0110] Extract the event hash value sequence and the node encoding sequence of the event. Simultaneously, call the event hash path structure corresponding to the same block height "952788" on the main chain for matching. This matching operation compares the hash values ​​of each pair of events on the replica chain and the main chain one by one according to the node encoding order. During the comparison process, a conflict determination threshold is set. This threshold is set by counting the frequency of all hash values ​​in the event hash path across all path positions, calculating the median of these frequencies (e.g., 5), and the standard deviation (e.g., 1.5). The threshold for a median deviation exceeding one standard deviation is... If a hash value appears more than 6.5 times, it is considered abnormal. In the process of filtering tag numbers that have hash collisions, only event hash value pairs that appear inconsistently in two or more consecutive path positions are retained. For example, if the hash values ​​of node A and node B are inconsistent, the tag number "EPC20250930001" and the inconsistent node code positions {A, B} are recorded to generate tag hash collision comparison information.

[0111] S403: Based on the conflicting tag number and node code recorded in the tag hash conflict comparison information, aggregate the node information with inconsistent hash values, remove duplicates, construct a set of node numbers, and establish a mapping structure between the set and the original tag number to generate a set of abnormal on-chain replica nodes.

[0112] During the construction of tag hash collision comparison information, when comparing the consistency of the hash values ​​of each pair of main chain records and replica records in the event hash value sequence, the collision judgment threshold is set as the deviation of the median frequency of the hash value in all path positions in the event hash path from one standard deviation.

[0113] During the process of filtering tag numbers that have hash collisions, only event hash value pairs that are inconsistent in two or more consecutive path locations are retained;

[0114] During the generation of the set of abnormal nodes in the on-chain replica, aggregation is performed based on the tag number and corresponding node code that meet the conflict judgment conditions in the tag hash conflict comparison information. During the aggregation process, node records with the same path position and completely identical hash values ​​are removed.

[0115] Based on the conflict tag number "EPC20250930001" and node codes {A, B} recorded in the tag hash conflict comparison information, the node information with inconsistent hash values ​​in all records is aggregated. During the aggregation process, all conflicting node codes are collected into a set and duplicates are removed. For example, if multiple tags conflict at node A, only one "A" is kept in the set, thus constructing a set of node numbers. Subsequently, a mapping structure between this set and the original tag numbers is established, mapping the tag "EPC20250930001" to the abnormal node set {A, B}. During the aggregation process, a filtering is performed, that is, node records with identical hash values ​​but the same path position are removed, finally generating an on-chain replica abnormal node set.

[0116] Please see Figure 6 The specific steps for obtaining the list of anomaly tag identities are as follows:

[0117] S501: Based on the node number in the set of abnormal nodes in the on-chain replica, retrieve the tag data frame recorded inside the node, extract the EPC code and path hash value in each record, compare the path hash value of each tag with the corresponding record at the same block height in the main chain, filter out tag codes with inconsistent fields in the path hash value, and generate an abnormal tag path filter set.

[0118] Based on the set of abnormal nodes in the on-chain replicas, extract the node number, for example, node "A", and retrieve all tag data frames recorded within that node. Extract the EPC code and the corresponding path hash value from each data frame record. For each tag's path hash value, perform a field-by-field comparison with the path hash value of the corresponding record at the same block height on the main chain. This comparison operation verifies that the two hash strings are completely matched, filtering out tag codes with one or more inconsistent characters in the path hash value. Gather all the filtered tag codes together to generate an abnormal tag path filter set.

[0119] S502: Based on the tag code in the abnormal tag path filtering set, call the unique index string corresponding to each tag, use the index to reverse match the asset registration record and warehouse transfer log, and sequentially obtain the inbound batch number, supplier identification code and last transfer warehouse node code corresponding to the tag, and establish a tag attribute field set.

[0120] Based on the tag codes in the abnormal tag path filtering set, such as "EPC20250930001", the unique index string corresponding to each tag is called, namely "1B-SG-PREHEATER-INLET-V01:EPC20250930001". This index is then used to reverse match the asset registration record database and the warehouse transfer log database. In the asset registration record, the inbound batch number corresponding to the tag is found through the unique index string, with the value "BATCH-20250930-01" and the supplier identification code, with the value "SUP-88765". In the warehouse transfer log, the last transfer warehouse node code of the tag before the anomaly occurred is found, with the value "KW-A03-H05-L02". These three pieces of data (inbound batch number, supplier identification code, and last transfer warehouse node code) are integrated together to establish a tag attribute field set.

[0121] S503: Based on the tag codes in the abnormal tag path filtering set and the attribute information in the tag attribute field set, construct the correspondence between the unique index string of the tag and the three attribute fields of the inbound batch number, the supplier identification code and the last transfer storage node code, unify the data structure of the mapping results, encapsulate them into structured tag chain information, and generate a traceability abnormal tag identity list.

[0122] Based on the tag code "EPC20250930001" in the abnormal tag path filtering set and the attribute information in the tag attribute field set established in the previous process, the correspondence between the unique index string of the tag and the three attribute fields of the inbound batch number, supplier identification code, and last transfer storage node code is constructed one by one. Specifically, a record is created, and the unique index string "1B-SG-PREHEATER-INLET-V01:EPC20250930001" is mapped to the inbound batch number "BATCH-20250930-01", the supplier identification code "SUP-88765", and the last transfer storage node code "KW-A03-H05-L02". After performing this mapping operation on all abnormal tags, the data structure of the result is unified and encapsulated into a JSON object array format to form a structured tag chain information, generating the final traceability abnormal tag identity list.

[0123] It should be understood that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. A and B can be singular or plural. Additionally, the character " / " in this article generally indicates an "or" relationship between the preceding and following related objects, but it can also represent an "and / or" relationship. Please refer to the context for a more accurate understanding.

[0124] In this invention, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of a single item or a plurality of items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be a single item or multiple items.

[0125] It should be understood that, in various embodiments of the present invention, the order of the above-mentioned process numbers does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0126] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0127] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices, apparatuses, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0128] In the several embodiments provided by this invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, 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 device, 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 between devices or units may be electrical, mechanical, or other forms.

[0129] 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.

[0130] In addition, the functional units in the various embodiments of the present invention 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.

[0131] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a 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 a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0132] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A blockchain-based method for material traceability management, characterized in that, Includes the following steps: S1: Obtain data on newly received materials from the power plant, including three items: EPC tag number, material code, and storage area code. Use the SHA-256 hash function to generate an irreversible digest hash value and submit it to the current height block of the blockchain for writing, generating the initial on-chain identity record of the materials. S2: Call the initial on-chain identity record of the material, combine the inventory change record, transfer work order and RFID scanning log corresponding to the material tag, generate a standardized status code according to the GS1 event identification code, encrypt it through the Keccak hash function and write it into the specified data segment on the chain to generate a material flow chain status record. S3: Obtain the material flow chain status record associated with the material to be traced and detected, extract the event time and node code, arrange the node codes in time order to form a path sequence, calculate the geographic code spacing between consecutive events, determine whether there are jump points, loops or node loss, mark the label number of discontinuous trajectory features in the path chain, and generate an abnormal path chain label set. S4: Call the tag number included in the abnormal path chain tag set, retrieve the replica hash record of the corresponding blockchain node, analyze whether there is a conflict in the path hash value, extract the hash inconsistency item and the chain branch node number, and generate a set of abnormal replica nodes on the chain. S5: Based on the node number in the set of abnormal nodes in the chain replica, extract the EPC code record and path hash value of each tag in the node, and reverse query the three information items of the batch to which it belongs, supplier ID and last transfer warehouse code according to the unique index string corresponding to the abnormal tag. Organize the related fields and combine them into a tag chain summary structure to generate a traceability abnormal tag identity list.

2. The blockchain-based material traceability management method according to claim 1, characterized in that, The initial on-chain identity record of the materials includes a unique hash digest, block height index, on-chain commit timestamp, and node code. The chain-like status record of the material flow includes a status identifier code, on-chain storage location, event time index, and tag index association. The abnormal path chain marker set includes path jump tag number, path continuity missing segment number, path reverse flow number, and abnormal time interval index. The on-chain replica abnormal node set includes conflict hash value number, branch chain node number, hash inconsistency record index, and branch chain path location. The traceability abnormal tag identity list includes an abnormal tag unique index, corresponding supplier identifier, belonging to the warehousing batch number, and abnormal storage node code.

3. The blockchain-based material traceability management method according to claim 2, characterized in that, The specific steps for obtaining the initial chain identity record of the materials are as follows: S101: Obtain data on newly received materials in the power plant, including three items: EPC tag number, material code, and storage area code. Call the storage area code and equipment node asset code lookup table for matching and comparison. Based on the matching and comparison relationship, extract the equipment node number corresponding to the storage area code. Then, concatenate the equipment node number with the EPC tag number to construct a joint index string with material location attributes, and obtain the equipment tag joint index information. S102: Based on the device tag composite index information, call the current Unix timestamp data corresponding to the material code, concatenate the device tag composite index value and the Unix timestamp according to the character sequence, and use the concatenation structure as input data. Use the SHA-256 hash function to perform encrypted digest, construct irreversible hash code data, and generate material chain encryption identifier string. S103: Based on the encrypted identifier string for material entry into the blockchain, extract the chain height number of the current block and use it as a hash writing positioning parameter. Write the encrypted identifier string for material entry into the blockchain into the data record field corresponding to the block number, and simultaneously generate a set of index relationships between the record timestamp, tag number and chain height to establish the initial on-chain identity record of the material.

4. The blockchain-based material traceability management method according to claim 3, characterized in that, The specific steps for obtaining the material flow chain status record are as follows: S201: Call the unique index string and node code generated in the initial chain identity record of the material, collect the inventory change record, transfer operation order and RFID scanning log associated with the tag number, aggregate the tag status field recorded in the log, and perform field comparison on the aggregation result based on the node code, filter the data fragments that match the status field with the current node code, and establish a tag node status mapping set. S202: Extract the status attribute field of each record based on the tag node status mapping set, call the GS1 event identification code field rules, compare the event type with the status attribute, assign a standardized status code to each status data according to the matching relationship, integrate the standardized status code and the unique index string into a single data structure according to the field concatenation order, and generate the tag standard status structure. S203: Based on the standard status structure of the tag, call the Keccak hash function for encryption processing, obtain the encrypted digest corresponding to the structure, write the digest into the data segment corresponding to the current block number in the blockchain, and simultaneously establish an on-chain bidirectional index structure of the status code index field and the tag number field to generate a chain-like status record of material flow.

5. The blockchain-based material traceability management method according to claim 4, characterized in that, The aggregation process of the tag status field is as follows: sort the tag status field according to the time order in which the same tag number appears in multiple business records, filter out consecutive records with a time interval lower than a set time threshold, the time threshold being the median of the time interval values ​​of the tag status field, and retain the consecutive status sequence within the maximum time span based on the sorting result, the maximum time span being the mean of the time difference between valid records plus twice the standard deviation. The process of performing field comparison on the aggregation result based on node code is as follows: the device node code field included in the retained continuous state sequence is mapped and verified one-to-one with the node code, state records with inconsistent node code fields and node codes are filtered out, and only state records with consistent node code fields are retained.

6. The blockchain-based material traceability management method according to claim 5, characterized in that, The specific steps for obtaining the abnormal path chain marker set are as follows: S301: Obtain the material flow chain status record associated with the material to be traced and detected, extract the event time field and the corresponding node code field recorded in the chain structure, call the geocode configuration table corresponding to the node code field, retrieve the geocode value corresponding to each node, and rearrange the order based on the event time field, arrange the geocode and node code in time order to form a path structure, and generate a node time path sequence structure. S302: Based on the node time path sequence structure, calculate the geographic distance according to the geocoding field between adjacent nodes in the path sequence, identify node pairs whose geographic distance value is greater than the maximum distance threshold, count the number of jump points, loops and missing segments, and calculate the path discrete anomaly intensity value. S303: Based on the path discrete anomaly intensity value, filter the label numbers of the path discrete anomaly intensity value that are greater than the abnormal discrete threshold, mark them as data records with path trajectory discontinuity characteristics, and concatenate the path jump label number with the geographical location missing segment number to obtain the abnormal path chain label set.

7. The blockchain-based material traceability management method according to claim 6, characterized in that, The specific formula for obtaining the discrete anomaly intensity value of the path is as follows: ; in, This represents the path discrete anomaly intensity value. To represent the number of consecutive event pairs in a path, For the first The node geocoding normalized value of each event. For the first The normalized timestamp value of an event For the first Normalized value of geographic jump distance of segment path, For the path set Normalized value of reference length for segment path. For the first Normalized value of the number of times label recognition failed on the segment path.

8. The blockchain-based material traceability management method according to claim 7, characterized in that, The specific steps for obtaining the set of abnormal on-chain replica nodes are as follows: S401: Call the tag number included in the abnormal path chain tag set, retrieve the replica hash record at the current block height in the blockchain node corresponding to the tag number, locate the Merkle tree substructure including the tag number, extract the event hash path and branch node number associated with the tag number in the structure, and establish the tag event hash path structure. S402: Based on the tag event hash path structure, extract the event hash value sequence and the node code, call the corresponding event hash path structure at the same height of the main chain for matching, compare whether each pair of event hash values ​​is consistent according to the node code order, filter the tag number and node code position where hash collision occurs, and generate tag hash collision comparison information. S403: Based on the conflicting tag number and node code recorded in the tag hash conflict comparison information, aggregate the node information with inconsistent hash values, remove duplicates, construct a node number set, and establish a mapping structure between the set and the original tag number to generate an on-chain replica abnormal node set.

9. The blockchain-based material traceability management method according to claim 8, characterized in that, In the process of constructing the tag hash conflict comparison information, when comparing the consistency of the hash values ​​of each pair of main chain records and replica records in the event hash value sequence, the conflict judgment threshold is set as the median deviation of the frequency of the hash value in all path positions in the event hash path exceeds one standard deviation. In the process of filtering tag numbers that have hash collisions, only event hash value pairs that are inconsistent in two or more consecutive path locations are retained; During the generation of the set of abnormal nodes in the on-chain replica, aggregation is performed based on the tag number and corresponding node code that meet the conflict determination conditions in the tag hash conflict comparison information, and node records with the same path position and completely identical hash value are removed during the aggregation process.

10. The blockchain-based material traceability management method according to claim 9, characterized in that, The specific steps for obtaining the source tracing anomaly tag identity list are as follows: S501: Based on the node number in the set of abnormal nodes of the on-chain replica, retrieve the tag data frame recorded inside the node, extract the EPC code and path hash value in each record, compare the path hash value of each tag with the corresponding record at the same block height of the main chain at the field level, filter the tag codes with inconsistent fields in the path hash value, and generate an abnormal tag path filter set. S502: Based on the tag codes in the abnormal tag path filtering set, call the unique index string corresponding to each tag, use the index to reverse match the asset registration record and warehouse transfer log, and sequentially obtain the inbound batch number, supplier identification code and last transfer warehouse node code corresponding to the tag, and establish a tag attribute field set. S503: Based on the tag codes in the abnormal tag path filtering set and the attribute information in the tag attribute field set, construct the correspondence between the unique index string of the tag and the three attribute fields of the batch number of the warehouse entry, the supplier identification code and the last transfer storage node code, unify the data structure of the mapping results, encapsulate them into structured tag chain information, and generate a traceability abnormal tag identity list.

Citation Information

Patent Citations

  • Wireless communicating method and system, communicating station, and controlling station

    EP0952701A2

  • Apparatus and method for accessing the pericardial space

    EP0952788A1