Non-ferrous metal storage traceability method based on block chain and Internet of Things
By leveraging blockchain and IoT technologies, access control authorization records and status evidence indexes are generated, resolving issues of data credibility and interoperability, enabling reliable traceability of non-ferrous metal warehousing, and enhancing the security and transparency of data management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN GREEN MASON TECHNOLOGY CO LTD
- Filing Date
- 2026-01-14
- Publication Date
- 2026-04-24
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing technologies in industrial data management suffer from insufficient data credibility and low interoperability. In particular, centralized storage architectures are susceptible to tampering risks, and the heterogeneity of multi-source IoT data makes integration difficult, which affects the reliability and scalability of warehouse traceability systems.
By using blockchain and IoT-based methods, access control authorization records are generated, multi-source IoT data is collected and verified, warehouse sensing sequences are generated, change relationships are analyzed and status evidence packages are generated, and the blockchain-anchored index records are stored immutably to achieve on-chain confirmation receipts and traceability analysis, thereby generating a non-ferrous metal warehouse traceability report.
It improves the authenticity and integrity of multi-source IoT data, enhances the security and transparency of the traceability system, realizes reliable traceability of the entire non-ferrous metal warehousing chain, and improves the efficiency and accuracy of industrial data management and traceability.
Smart Images

Figure CN121920931A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial data management technology, and in particular to a non-ferrous metal warehousing traceability method based on blockchain and the Internet of Things. Background Technology
[0002] In the field of industrial data management, warehouse traceability management is a crucial component of supply chain digitalization. Conventional methods typically rely on centralized database systems for inventory recording and operational tracking, combined with IoT technology to achieve real-time collection of end-user data, such as monitoring the temperature, humidity, and location of metal batches via sensors. Industrial data management technologies build upon this foundation, employing standardized data processing workflows, including data registration, verification, and access control, to support batch identification binding and multi-source data integration. These methods aim to improve the transparency and efficiency of warehouse management, meeting the industry's fundamental requirements for data consistency and traceability, and driving the widespread application of IoT and information technology in industrial scenarios.
[0003] However, conventional methods have certain limitations in terms of data credibility and interoperability. On the one hand, centralized storage architectures may lead to data integrity relying on a single authority, making them vulnerable to internal or external tampering and affecting the reliability of the traceability chain. On the other hand, the heterogeneity of multi-source IoT data makes the integration process lack unified standards, making it difficult to achieve efficient state transition verification and real-time consensus, thus restricting the scalability and automation level of warehouse traceability systems. These shortcomings are particularly prominent in adjudication scenarios that require a highly reliable environment, limiting the accuracy of data-driven decision-making. Summary of the Invention
[0004] In view of the aforementioned existing problems, the present invention is proposed.
[0005] Therefore, this invention provides a non-ferrous metal warehousing traceability method based on blockchain and the Internet of Things to solve the problems of insufficient data credibility and low interoperability.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: This invention provides a non-ferrous metal warehousing traceability method based on blockchain and the Internet of Things, comprising: Assign identity identifiers to IoT terminals and register and verify them, establish a binding relationship between non-ferrous metal batch identifiers and identity identifiers, and generate access control authorization records; Based on access control authorization records, collect multi-source IoT data, perform verification and preprocessing, and generate warehouse sensing sequences; Analyze the changing relationships of the warehouse perception sequence and identify events that meet the conditions for establishing the basis for adjudication, generate a set of warehouse status events, and generate a set of signature status evidence packages and evidence consistency verification records through minimum evidence extraction and terminal signature processing; Based on the evidence consistency verification record, the consistency verification of the signature status evidence package set and the historical inventory status table is performed and a status evidence index is constructed. The status evidence index is written into the blockchain and highly anchored to generate an on-chain anchored index record. Based on the on-chain anchored index records, the conditions for the establishment of warehouse receipt status changes are verified, an on-chain confirmation receipt is generated, the historical inventory status table is updated according to the on-chain confirmation receipt and traceability analysis is performed to generate a non-ferrous metal warehousing traceability report.
[0007] As a preferred embodiment of the non-ferrous metal warehousing traceability method based on blockchain and the Internet of Things (IoT) described in this invention, the steps of assigning identity identifiers to IoT terminals and registering and verifying them are as follows: Assign an identity to the IoT terminal and register it to generate an IoT terminal identity registration form; Configure digital certificates for IoT terminals in the IoT terminal identity registration table and perform legality verification to generate IoT terminal verification records.
[0008] As a preferred embodiment of the non-ferrous metal warehousing traceability method based on blockchain and the Internet of Things described in this invention, the steps for establishing the binding relationship between non-ferrous metal batch identifiers and identity identifiers, and generating access control authorization records, are as follows: By using batch binding rules, a binding relationship is established between non-ferrous metal batch identifiers and corresponding identity identifiers, generating a batch identifier binding table; Based on the IoT terminal verification records, the access permission scope for the adjudication data is configured for the corresponding identity identifier in the batch identifier binding table, and an access control authorization record is generated.
[0009] As a preferred embodiment of the non-ferrous metal warehousing traceability method based on blockchain and the Internet of Things described in this invention, the steps of collecting multi-source IoT data according to access control authorization records, performing verification and preprocessing, and generating a warehousing sensing sequence are as follows. Data acquisition tasks are generated based on the batch identifier binding table and access control authorization records, and multi-source IoT data is collected. Verify the identity of multi-source IoT data to generate authentic multi-source IoT data; By using time alignment and spatial mapping methods, real multi-source IoT data is processed to achieve time unification and warehouse location mapping, generating a warehouse sensing sequence. A summary of the warehouse perception sequence is generated by applying a fixed window and written into the summary storage, thus generating a warehouse fact summary sequence.
[0010] As a preferred embodiment of the non-ferrous metal warehousing traceability method based on blockchain and the Internet of Things described in this invention, the steps of analyzing the changing relationships of the warehousing sensing sequence and identifying events that meet the conditions for establishing the adjudication basis, and generating a set of warehousing status events, are as follows: Analyze the changing relationships of the warehouse sensing sequence and, in conjunction with the warehouse status determination rules, generate a set of candidate events for warehouse status. Identify candidate events in the warehouse status candidate event set that meet the minimum conditions for adjudication and integrate them into a warehouse status event set.
[0011] As a preferred embodiment of the non-ferrous metal warehousing traceability method based on blockchain and IoT described in this invention, the steps for generating a signature status evidence package set and evidence consistency verification record through minimum evidence extraction and terminal signature processing are as follows: By using the minimum evidence extraction method, data fragments that can support the establishment of warehouse status events are extracted from the warehouse perception sequence, and a set of status evidence packages is generated. Digital signature processing is performed on the set of state evidence packets to generate a signed set of state evidence packets; Verify the consistency between the signature status evidence package set and the warehouse fact summary sequence, and output the evidence consistency verification record.
[0012] As a preferred embodiment of the non-ferrous metal warehousing traceability method based on blockchain and IoT described in this invention, the steps of performing consistency verification on the signature status evidence package set and the historical inventory status table based on evidence consistency verification records, and constructing a status evidence index, are as follows: The verification task is generated based on the evidence consistency verification record as the signature status evidence package set. The consistency verification is used to verify the quantity conservation relationship and status transition relationship between the signature status evidence package set and the historical inventory status table, and a consistency verification conclusion set is generated. Based on the signature status evidence package set and the consistency verification conclusion set, evidence hash and conclusion hash are generated, and the status evidence index set is obtained through index construction processing.
[0013] As a preferred embodiment of the non-ferrous metal warehousing traceability method based on blockchain and IoT described in this invention, the steps of writing the state evidence index into the blockchain and highly anchoring it to generate an on-chain anchored index record are as follows: Submit on-chain write operations to each item in the state evidence index set and confirm consensus to generate on-chain state index records; By anchoring the on-chain height, the on-chain state index record is written to the block height and operation hash in the blockchain, and the index storage is backfilled. This anchoring backfilling process generates an on-chain anchored index record.
[0014] As a preferred embodiment of the non-ferrous metal warehousing traceability method based on blockchain and IoT described in this invention, the steps for verifying the conditions for warehouse receipt status changes based on on-chain anchored index records and generating on-chain confirmation receipts are as follows. Collect the adjudication request form, extract the non-ferrous metal batch identifier and warehouse receipt number from the adjudication request form, retrieve the anchor index record on the chain, and generate the adjudication retrieval table; Perform state transition permission verification and index integrity verification on the adjudication retrieval table and the electronic warehouse receipt state machine rule table to obtain adjudication condition verification records; Based on the adjudication condition verification record, an adjudication certificate is generated and submitted for consensus confirmation. The adjudication certificate is then written to generate an on-chain adjudication record. Generate a status confirmation record based on the on-chain ruling record, and confirm the status record consensus to generate an on-chain confirmation receipt.
[0015] As a preferred embodiment of the non-ferrous metal warehousing traceability method based on blockchain and IoT described in this invention, the steps of updating the historical inventory status table based on on-chain confirmation receipts and performing traceability analysis to generate a non-ferrous metal warehousing traceability report are as follows: Based on the on-chain confirmation receipt, update the confirmation status and solidify the timestamp to generate an inventory status table; By aggregating the inventory status table, on-chain anchored index records, and consistency verification conclusions through traceability analysis, a traceability report for non-ferrous metal warehousing is generated.
[0016] The beneficial effects of this invention are as follows: by generating a set of signature status evidence packages and evidence consistency verification records, the authenticity and integrity of multi-source IoT data are ensured, and the anti-interference ability and credibility of traceability data are improved; by generating on-chain anchored index records, the immutable storage and decentralized trust of status evidence index are realized, enhancing the security and transparency of the traceability system, realizing reliable traceability of the entire non-ferrous metal warehousing chain, and improving the efficiency of industrial data management and the accuracy of traceability. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the 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.
[0018] Figure 1 This is a flowchart of a non-ferrous metal warehousing traceability method based on blockchain and the Internet of Things.
[0019] Figure 2 A flowchart for IoT terminal identity management and data collection.
[0020] Figure 3 A flowchart for warehouse status event identification and evidence generation.
[0021] Figure 4 A flowchart for blockchain anchoring and status confirmation. Detailed Implementation
[0022] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0023] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0024] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0025] Reference Figures 1-4 This is one embodiment of the present invention, which provides a non-ferrous metal warehousing traceability method based on blockchain and the Internet of Things, including the following steps: S1. Assign identity identifiers to IoT terminals and register and verify them, establish a binding relationship between non-ferrous metal batch identifiers and identity identifiers, and generate access control authorization records.
[0026] Assign an identity to the IoT terminal and register it to generate an IoT terminal identity registration form.
[0027] Furthermore, from the hardware characteristics of the IoT terminal at the factory, the radio frequency code value, communication chip serial number, and public key digest of the encrypted storage area are read, concatenated in a fixed order, and generated through a one-way hash function to generate an identity identifier; using the identity identifier as an index, it is associated with the IoT terminal type field, deployment location field, and first activation timestamp field (e.g., timestamp accurate to the second) to form a registration record; the registration record is appended and stored in chronological order to generate an IoT terminal identity registration table.
[0028] It should be noted that the hardware characteristics of an IoT terminal refer to the physical or electrical identification information that is solidified inside the IoT terminal during the manufacturing stage and remains unchanged throughout its entire life cycle; the one-way hash function is a mathematical calculation function that takes a byte sequence formed by concatenating according to a fixed field order and a fixed encoding method as input, and generates a hash value of fixed length that uniquely corresponds to the input content through an irreversible hash calculation process, which is used to characterize the integrity and consistency of the input data.
[0029] Configure digital certificates for IoT terminals in the IoT terminal identity registration table and perform legality verification to generate IoT terminal verification records.
[0030] Furthermore, the system reads the identity identifier and corresponding IoT terminal from the IoT terminal identity registration table, generates a unique asymmetric key pair and public key in the secure storage area through the IoT terminal, performs a fixed-order concatenation of the public key and identity identifier, and obtains a digital certificate through a one-way hash function, drives the IoT terminal to perform signature calculation and return the signature value through the digital certificate, and judges the consistency between the digital certificate and the verification message (a challenge data string randomly generated by the verifier) through the public key verification operation. When the consistency is determined multiple times (e.g., 3 times in a row), the legality verification is passed, and the identity identifier, digital certificate and verification timestamp are summarized to generate an IoT terminal verification record.
[0031] By using batch binding rules, a binding relationship is established between non-ferrous metal batch identifiers and corresponding identity identifiers, generating a batch identifier binding table.
[0032] Furthermore, non-ferrous metal batch identifiers are read from historical warehousing business records, and uniqueness checks are performed using the identity identifier and non-ferrous metal batch identifier as binding elements to confirm that the same non-ferrous metal batch identifier corresponds to only one identity identifier within the current time window (e.g., a time window of 24 hours), thus forming a binding relationship. The effective timestamp and binding sequence number of the non-ferrous metal batch identifier, identity identifier, binding elements are sequentially concatenated and written to generate a batch identifier binding table.
[0033] It should be noted that historical warehousing business records refer to structured record data formed and solidified by the warehousing operation process when non-ferrous metal warehousing operations occur, including non-ferrous metal batch identifier, warehousing timestamp, and storage location number fields.
[0034] Based on the IoT terminal verification records, the access permission scope for the adjudication data is configured for the corresponding identity identifier in the batch identifier binding table, and an access control authorization record is generated.
[0035] Furthermore, based on the IoT terminal verification record and batch identifier binding table, using the identity identifier and non-ferrous metal batch identifier as the authorization objects, an adjudication data access permission scope (referring to the structured data set used to determine whether the storage status is valid in the subsequent adjudication process, including the storage perception sequence, signature status evidence package set, and evidence consistency verification record) is generated according to the binding relationship. The identity identifier, non-ferrous metal batch identifier, adjudication data access permission scope, and timestamp are written sequentially to form an authorization record. This record is continuously appended and stored and sorted by identity identifier to generate an access control authorization record.
[0036] S2. Based on the access control authorization records, collect multi-source IoT data, perform verification and preprocessing, and generate warehouse sensing sequences.
[0037] Data acquisition tasks are generated based on the batch identifier binding table and access control authorization records, and multi-source IoT data are collected.
[0038] Furthermore, based on the batch identifier binding table and access control authorization records, a data acquisition task is generated that includes an identity identifier, a non-ferrous metal batch identifier, a collection time window, and a collection frequency (e.g., once every 60 seconds). According to the data acquisition task, the IoT terminal corresponding to the identity identifier is triggered to collect weight sensor data, temperature and humidity sensor data, displacement sensor data, and storage location status data. The data is then concatenated with the collection timestamp and the terminal private key in a fixed order to obtain a message authentication code, forming multi-source IoT data.
[0039] Verify the identity of multi-source IoT data to generate authentic multi-source IoT data.
[0040] Furthermore, the identity identifiers in the multi-source IoT data are extracted, and the corresponding authorized entries in the access control authorization records are identified using the identity identifiers as search keys; the consistency between the non-ferrous metal batch identifiers in the multi-source IoT data and the non-ferrous metal batch identifiers specified in the authorized entries is identified, and the validity of the identity identifier source is confirmed by combining the corresponding identity identifiers in the IoT terminal verification records; the message authentication codes in the multi-source IoT data are verified using public keys, and the verified multi-source IoT data are aggregated and solidified in the order of collection timestamps to form real multi-source IoT data.
[0041] By using time alignment and spatial mapping methods, real multi-source IoT data is processed for time unification and warehouse location mapping to generate warehouse sensing sequences.
[0042] Furthermore, the minimum collection interval of real multi-source IoT data is selected as a unified time benchmark (e.g., set to 60 seconds). Data collected earlier than the benchmark time is processed by holding the data (the value corresponding to the most recent collection time is directly selected and copied to the current time benchmark). Data collected later than the benchmark time is processed by truncation (the most recent data with a timestamp no later than the current time benchmark is retained to participate in the time unification calculation), thus completing the time unification. Based on the storage location number field in the historical warehousing business records, each piece of time-unified multi-source IoT data is mapped to the corresponding storage location number and combined in chronological order to form a warehousing sensing sequence.
[0043] A summary of the warehouse perception sequence is generated by applying a fixed window and written into the summary storage, thus generating a warehouse fact summary sequence.
[0044] Furthermore, a fixed window length is selected and the storage sensing sequence is sliced using the window start timestamp (e.g., a fixed window length of 300 seconds). Within each fixed window, weight sensing data, temperature and humidity sensing data, displacement sensing data, and storage location status data are aggregated in the order of collection timestamps. The minimum, maximum, and last values (the values corresponding to the last storage sensing sequence) within the window are calculated and combined into a window feature vector. The window feature vector is input into a one-way hash function to generate a fixed-length hash value as a storage fact summary. The storage fact summary, along with the non-ferrous metal batch identifier, storage location number, window start timestamp, and window end timestamp, is sequentially written into the storage area to form a storage fact summary sequence.
[0045] S3. Analyze the changing relationships of the warehouse perception sequence and identify events that meet the conditions for establishing the basis for adjudication, generate a set of warehouse status events, and generate a set of signature status evidence packages and evidence consistency verification records through minimum evidence extraction and terminal signature processing.
[0046] Analyze the changing relationships of the warehouse sensing sequence and combine them with the warehouse status determination rules to generate a set of candidate events for warehouse status.
[0047] Furthermore, the weight sensor data difference value, displacement sensor data difference value, and storage location status data change flag (a binary flag generated after consistency comparison of storage location status data, marked as 1 when the status changes and marked as 0 when no change occurs) are calculated in the order of the collected timestamps for the storage sensing sequence, and combined with the temperature and humidity sensor data change rate to form a change vector; the storage status judgment rules are executed, marking the time period when the weight sensor data difference value exceeds the difference threshold as a weight anomaly candidate event, the time point when the storage location status data change flag changes from 0 to 1 as a storage location change candidate event, and the segment where the displacement sensor data difference value is less than the convergence threshold in a continuous time period as a displacement stability candidate event, for example, a weight sensor data difference value greater than 5 kg for 300 seconds; the event type identifier, non-ferrous metal batch identifier, storage location number, event start timestamp, and event end timestamp of the candidate events are sequentially aggregated to generate a storage status candidate event set.
[0048] It should be noted that the rate of change of temperature and humidity sensing data refers to the rate of change obtained by differentiating temperature and humidity data within a fixed time interval and normalizing the scale in combination with the corresponding time interval (for example, when the data acquisition time base is 60 seconds, the rate of change of temperature and humidity is obtained by converting the difference values of adjacent sampling points into hourly changes according to the time scale, specifically by multiplying the 60-second difference value by 60, and the rate of change of humidity is similarly calculated); the storage status judgment rule is based on the historical storage sensing sequence, and determines the judgment boundary that can distinguish between operational behavior and noise disturbance by statistically analyzing the change amplitude of weight sensing data, temperature and humidity sensing data, displacement sensing data and storage location status data during historical normal operations; the difference threshold is determined by the minimum effective amplitude of weight change in historical storage operations, and the typical value range is 3 kg to 10 kg; the convergence threshold is set based on the resolution of the displacement sensor and the jitter amplitude under structural stability, and is determined by statistically analyzing the distribution of the difference values of displacement sensing data under static conditions, and the typical value range is 0.1 mm to 0.5 mm.
[0049] Identify candidate events in the warehouse status candidate event set that meet the minimum conditions for adjudication and integrate them into a warehouse status event set.
[0050] Furthermore, candidate events that meet the minimum conditions for adjudication in the candidate event set of storage status are identified. Specifically, the rate of change of temperature and humidity sensor data is used as the status confirmation constraint. The environmental stability of the candidate events in the storage status candidate event set within the corresponding time period is checked once. When the rate of change of temperature and humidity sensor data is in a stable range, the candidate event is not affected by environmental disturbances, for example, the rate of temperature change is less than 0.5℃ / hour. The candidate events that are not affected by environmental disturbances are aggregated to form the storage status event set.
[0051] It should be noted that the stable range is set based on the statistical distribution of the change rate of historical normal temperature and humidity sensor data. The fixed range is obtained by extracting a sample set of change rate under long-term no-operation conditions and using it as the judgment boundary. For example, the temperature change rate range is 0.3℃ / hour to 0.8℃ / hour, and the humidity change rate range is 1% / hour to 3% / hour.
[0052] By using the minimum evidence extraction method, data fragments that can support the establishment of warehouse status events are extracted from the warehouse perception sequence, and a set of status evidence packages is generated.
[0053] Furthermore, based on the event start timestamp in the warehouse status event, the event time period is obtained by reversely locating the continuous time period that meets the corresponding judgment conditions in the warehouse sensing sequence. An evidence time window is formed by extending a fixed time buffer forward and backward (e.g., extending by 120 seconds) with the event time period as the center. Multi-source IoT data corresponding to the event type is extracted within the evidence time window, and deduplication and continuity compression are performed. According to the conditions for the establishment of the warehouse status event, key fragments (such as the stable state before the event is triggered, the event process, and the stable state after the event) are retained. The key fragments are combined with the event type identifier, non-ferrous metal batch identifier, warehouse location number, and evidence time window identifier to generate a status evidence package set.
[0054] The set of state evidence packets is digitally signed to generate a set of signed state evidence packets.
[0055] Furthermore, the status evidence package set undergoes digital signature processing. Specifically, the event type identifier, non-ferrous metal batch identifier, storage location number, evidence time window identifier, and key data fragments within the status evidence package set are concatenated in a fixed order to form an evidence content sequence. Deterministic byte encoding is performed on the evidence content sequence, converting it into a byte stream, which is then input into a one-way hash function to obtain the evidence window digest value. Using the private key associated with the corresponding identity identifier in the IoT terminal verification record as a signature factor, a signature operation is performed on the evidence window digest value to generate a signature value. The signature value is bound to the evidence content sequence and written to form a signed status evidence package set. When the evidence time window contains data from multiple IoT terminals, the signed status evidence package set contains a signature list corresponding to the terminal identifier and the signature value. Each terminal only generates a signature value for the data fragments it collects.
[0056] Verify the consistency between the signature status evidence package set and the warehouse fact summary sequence, and output the evidence consistency verification record.
[0057] Furthermore, based on the evidence time window identifier in the signature status evidence package set, the warehouse fact summary corresponding to the same non-ferrous metal batch identifier and warehouse location number is retrieved in the warehouse fact summary sequence; the signature verification operation is performed using the public key associated with the identity identifier in the IoT terminal verification record to obtain the signature verification status identifier (e.g., 1 for successful signature verification and 0 for unsuccessful signature verification); when the signature verification status identifier is successful, the summary value is compared with the warehouse fact summary of the corresponding time window to output the evidence consistency verification record.
[0058] It should be noted that the digest values in the signature status evidence package set and the digest values in the warehouse fact digest sequence are both generated using the same fixed window length, the same set of data fields, the same field concatenation order, and the same one-way hash operation function.
[0059] S4. Based on the evidence consistency verification record, perform consistency verification on the signature status evidence package set and the historical inventory status table, construct a status evidence index, write the status evidence index into the blockchain and highly anchor it, and generate an on-chain anchored index record.
[0060] The verification task is generated for the signature status evidence package set based on the evidence consistency verification record. The quantity conservation relationship and status transition relationship between the signature status evidence package set and the historical inventory status table are verified through consistency verification, and a consistency verification conclusion set is generated.
[0061] Furthermore, a verification task is generated for the signature status evidence package set based on the evidence consistency verification record. According to the verification task, the consistency of inventory quantity and weight changes before and after the event is verified in conjunction with the quantity conservation relationship. Under the premise that the quantity conservation relationship is established, the event type identifier in the signature status evidence package set is compared with the status change type in the historical inventory status table to verify whether the status migration conforms to the predetermined migration path (e.g., from in-stock status to out-of-stock status). The quantity conservation verification identifier and the status migration verification identifier are sequentially combined and written to generate a consistency verification conclusion set.
[0062] It should be noted that the historical inventory status table is a structured ledger of non-ferrous metal batches recorded at different points in time, showing the inventory quantity and warehouse receipt status. Quantity conservation verification uses the inventory quantity field in the historical inventory status table as the unified measurement standard. Weight sensor data is converted to inventory quantity measurement units before verification, and an allowable error band determined by both sensor error and packaging error is introduced during verification.
[0063] Based on the signature status evidence package set and the consistency verification conclusion set, evidence hash and conclusion hash are generated, and the status evidence index set is obtained through index construction processing.
[0064] Furthermore, a summary value representing the storage status evidence content is extracted from the signature status evidence package and generated as an evidence hash using sequential concatenation and one-way hashing functions. Using the evidence time window identifier as the association key, the corresponding quantity conservation verification identifier and state transition verification identifier in the consistency verification conclusion set are obtained and generated as a conclusion hash to identify the verification conclusion of the evidence time window using sequential concatenation and one-way hashing functions. The evidence hash and conclusion hash are combined with sequential concatenation and one-way hashing functions to form the final index hash value. The final index hash value is bound and written with the non-ferrous metal batch identifier, storage location number, and evidence time window identifier to generate a status evidence index set.
[0065] The concatenation expression for the evidence hash and the conclusion hash is: ; in, For the first The final index hash value of each state evidence index; The sequence number of the status evidence index corresponds one-to-one with the evidence time window identifier; This is a one-way hash function used to map concatenated data into a fixed-length hash value; For the first Evidence hashes corresponding to each evidence time window; Used to identify data sources related to evidence of warehouse status; For the first The conclusion hash corresponding to each evidence time window; Used to identify the data sources associated with the consistency verification conclusions.
[0066] Submit each state evidence index set to an on-chain write operation and perform consensus confirmation to generate an on-chain state index record.
[0067] Furthermore, the state evidence index set is assembled in a fixed order (e.g., "final index hash value → non-ferrous metal batch identifier → storage location number → evidence time window identifier") to form a state payload. The state payload is submitted as an on-chain write operation when the consensus confirmation of the previous state evidence index write operation is completed (meaning that multiple nodes have confirmed the consistency of the operation content and written it to the block). The on-chain write operation is then confirmed by multiple nodes. After writing the block, the block height and operation hash are returned, and an on-chain state index record is generated.
[0068] It should be noted that the block height represents the sequence number of the block on the chain where the operation is located, and the operation hash represents the unique identifier of the corresponding written content.
[0069] By anchoring the on-chain height, the on-chain state index record is written to the block height and operation hash in the blockchain, and the index storage is backfilled. This anchoring backfilling process generates an on-chain anchored index record.
[0070] Furthermore, the block height and operation hash are appended as anchoring fields to the entries in the state evidence index set to form anchoring backfill entries. The "final index hash value, block height, and operation hash" in the anchoring backfill entries are concatenated in a fixed order and a one-way hash operation function is used to generate an anchoring digest, which is then written into the anchoring backfill entries (e.g., the anchoring digest length is 256 bits). The anchoring backfill entries containing the final index hash value, block height, operation hash, and anchoring digest are aggregated into on-chain anchoring index records.
[0071] S5. Based on the on-chain anchored index record, verify the conditions for the establishment of warehouse receipt status change, generate on-chain confirmation receipt, update the historical inventory status table according to the on-chain confirmation receipt and perform traceability analysis to generate non-ferrous metal warehousing traceability report.
[0072] Collect the adjudication request form, extract the non-ferrous metal batch identifier and warehouse receipt number from the adjudication request form, retrieve the anchor index record on the chain, and generate the adjudication retrieval table.
[0073] Furthermore, the content of the adjudication request form, including the status change type, request initiation time, warehouse receipt number, and non-ferrous metal batch identifier, is collected, and the integrity of the adjudication request form is verified. Using the non-ferrous metal batch identifier and warehouse receipt number in the adjudication request form as the retrieval key, the corresponding final index hash value, block height, and operation hash are sequentially matched in the on-chain anchor index record, and then bound and aggregated with the adjudication request form to generate an adjudication retrieval table (for example, each row of the adjudication retrieval table corresponds to a warehouse receipt number and its unique on-chain anchor position).
[0074] Perform state transition permission verification and index integrity verification on the adjudication retrieval table and the electronic warehouse receipt state machine rule table to obtain adjudication condition verification records.
[0075] Furthermore, based on the warehouse receipt number in the adjudication request, the current electronic warehouse receipt status is located in the electronic warehouse receipt state machine rule table. Based on the status change type in the adjudication request, the current electronic warehouse receipt status is mapped to the target status in the electronic warehouse receipt state machine rule table. A state migration permission verification is performed on the target status to check if there is a migration relationship between the current electronic warehouse receipt status and the target status (e.g., from "already in storage" to "in storage," or from "in storage" to "pledged"). If such a relationship exists, permission is granted; otherwise, permission is denied. Using the on-chain anchoring information associated with the adjudication retrieval table, an index integrity verification is performed on the on-chain anchoring index record to confirm that the final index hash value has a unique and continuous on-chain positioning relationship under the corresponding block height and operation hash. The state migration permission verification identifier and the index integrity verification identifier are sequentially aggregated to form an adjudication condition verification record.
[0076] It should be noted that the electronic warehouse receipt state machine rule table is set based on the objective processing of warehouse receipts in actual warehousing operations (such as warehousing, in-warehouse, out-of-warehouse, pledge, and release). By limiting the warehouse receipt status to change only between predetermined steps according to the order of processing, it clarifies the unique allowed state change relationship corresponding to each processing behavior. The content includes the initial state definition, allowed state set, state transition triggering conditions, prohibited transition constraints, and termination state conditions.
[0077] Based on the adjudication condition verification record, an adjudication certificate is generated and submitted for consensus confirmation. The adjudication certificate is then written to generate an on-chain adjudication record.
[0078] Furthermore, based on the adjudication condition verification record, the warehouse receipt number, non-ferrous metal batch identifier, target status, and corresponding final index hash value are combined to form the adjudication certificate payload, and the adjudication certificate payload is written into the block after consistency confirmation; the corresponding adjudication block height and adjudication certificate hash are obtained and associated with the order of warehouse receipt number and target status to generate on-chain adjudication record.
[0079] Generate a status confirmation record based on the on-chain ruling record, and confirm the status record consensus to generate an on-chain confirmation receipt.
[0080] Furthermore, based on the adjudication record, the initiating warehouse receipt entity identifier, receiving warehouse receipt entity identifier, confirmed quantity, and associated adjudication certificate hash (e.g., confirmed quantity in tons) are confirmed, and a status confirmation record payload is generated. The status confirmation record payload is then confirmed by multiple nodes and written into a block to obtain the corresponding confirmation block height and status confirmation record hash. Finally, the warehouse receipt number, confirmation block height, and status confirmation record hash are written sequentially to generate an on-chain confirmation receipt.
[0081] Based on the on-chain confirmation receipt, update the confirmation status and solidify the timestamp to generate an inventory status table.
[0082] Furthermore, based on the on-chain confirmation receipt, the corresponding target status is located. Using the block confirmation time corresponding to the confirmed block height as the sole time reference, the corresponding target status is updated to the confirmation completion status and the timestamp is synchronously fixed (e.g., the timestamp is accurate to the second). The latest target status and corresponding inventory quantity fields of all warehouse receipts are aggregated in order of warehouse receipt number to form an inventory status table that can reflect the current inventory scale and confirmation completion status. The inventory status table is the latest snapshot of the historical inventory status table at the current time point.
[0083] By aggregating the inventory status table, on-chain anchored index records, and consistency verification conclusions through traceability analysis, a traceability report for non-ferrous metal warehousing is generated.
[0084] Furthermore, based on the inventory status table, the changes in warehouse receipt status over time are traced sequentially according to the non-ferrous metal batch identifier corresponding to the warehouse receipt number, with the non-ferrous metal batch identifier as the main thread. Based on the changes in warehouse receipt status, the final index hash value, block height, and operation hash in the on-chain anchor index record are associated to establish a one-to-one correspondence between warehouse receipt status and on-chain position. Using the final index hash value as the index key, the corresponding quantity conservation verification identifier and state transition verification identifier in the consistency verification conclusion set are aggregated, and summarized in chronological order to form a non-ferrous metal warehousing traceability report containing the warehouse receipt status evolution path, inventory quantity change trajectory, on-chain anchor position, and verification conclusion basis.
[0085] In summary, this invention ensures the authenticity and integrity of multi-source IoT data and enhances the anti-interference capability and credibility of traceability data by generating a set of signature status evidence packages and evidence consistency verification records. By generating on-chain anchored index records, it achieves immutable storage and decentralized trust of status evidence indexes, enhances the security and transparency of the traceability system, realizes reliable traceability of the entire non-ferrous metal warehousing chain, and improves the efficiency of industrial data management and the accuracy of traceability.
[0086] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for tracing the origin of non-ferrous metals in warehousing based on blockchain and the Internet of Things, characterized in that: include, Assign identity identifiers to IoT terminals and register and verify them, establish a binding relationship between non-ferrous metal batch identifiers and identity identifiers, and generate access control authorization records; Based on access control authorization records, collect multi-source IoT data, perform verification and preprocessing, and generate warehouse sensing sequences; Analyze the changing relationships of the warehouse perception sequence and identify events that meet the conditions for establishing the basis for adjudication, generate a set of warehouse status events, and generate a set of signature status evidence packages and evidence consistency verification records through minimum evidence extraction and terminal signature processing; Based on the evidence consistency verification record, the consistency verification of the signature status evidence package set and the historical inventory status table is performed and a status evidence index is constructed. The status evidence index is written into the blockchain and highly anchored to generate an on-chain anchored index record. Based on the on-chain anchored index records, the conditions for the establishment of warehouse receipt status changes are verified, an on-chain confirmation receipt is generated, the historical inventory status table is updated according to the on-chain confirmation receipt and traceability analysis is performed to generate a non-ferrous metal warehousing traceability report.
2. The non-ferrous metal warehousing traceability method based on blockchain and the Internet of Things as described in claim 1, characterized in that: The steps for assigning identity identifiers to IoT terminals and registering and verifying them are as follows: Assign an identity to the IoT terminal and register it to generate an IoT terminal identity registration form; Configure digital certificates for IoT terminals in the IoT terminal identity registration table and perform legality verification to generate IoT terminal verification records.
3. The non-ferrous metal warehousing traceability method based on blockchain and the Internet of Things as described in claim 2, characterized in that: The steps for establishing the binding relationship between non-ferrous metal batch identifiers and identity identifiers, and generating access control authorization records, are as follows: By using batch binding rules, a binding relationship is established between non-ferrous metal batch identifiers and corresponding identity identifiers, generating a batch identifier binding table; Based on the IoT terminal verification records, the access permission scope for the adjudication data is configured for the corresponding identity identifier in the batch identifier binding table, and an access control authorization record is generated.
4. The non-ferrous metal warehousing traceability method based on blockchain and the Internet of Things as described in claim 3, characterized in that: The steps for collecting multi-source IoT data based on access control authorization records, performing verification and preprocessing, and generating a warehouse sensing sequence are as follows. Data acquisition tasks are generated based on the batch identifier binding table and access control authorization records, and multi-source IoT data is collected. Verify the identity of multi-source IoT data to generate authentic multi-source IoT data; By using time alignment and spatial mapping methods, real multi-source IoT data is processed to achieve time unification and warehouse location mapping, generating a warehouse sensing sequence. A summary of the warehouse perception sequence is generated by applying a fixed window and written into the summary storage, thus generating a warehouse fact summary sequence.
5. The non-ferrous metal warehousing traceability method based on blockchain and the Internet of Things as described in claim 4, characterized in that: The steps for analyzing the changing relationships of the warehouse sensing sequence and identifying events that meet the conditions for establishing the adjudication criteria, and generating a set of warehouse status events, are as follows: Analyze the changing relationships of the warehouse sensing sequence and, in conjunction with the warehouse status determination rules, generate a set of candidate events for warehouse status. Identify candidate events in the warehouse status candidate event set that meet the minimum conditions for adjudication and integrate them into a warehouse status event set.
6. The non-ferrous metal warehousing traceability method based on blockchain and the Internet of Things as described in claim 5, characterized in that: The process of generating a signature status evidence package set and an evidence consistency verification record through minimum evidence extraction and terminal signature processing is as follows: By using the minimum evidence extraction method, data fragments that can support the establishment of warehouse status events are extracted from the warehouse perception sequence, and a set of status evidence packages is generated. Digital signature processing is performed on the set of state evidence packets to generate a signed set of state evidence packets; Verify the consistency between the signature status evidence package set and the warehouse fact summary sequence, and output the evidence consistency verification record.
7. The non-ferrous metal warehousing traceability method based on blockchain and the Internet of Things as described in claim 6, characterized in that: The steps for performing consistency verification on the signature status evidence package set and the historical inventory status table based on the evidence consistency verification record, and constructing a status evidence index, are as follows: The verification task is generated based on the evidence consistency verification record as the signature status evidence package set. The consistency verification is used to verify the quantity conservation relationship and status transition relationship between the signature status evidence package set and the historical inventory status table, and a consistency verification conclusion set is generated. Based on the signature status evidence package set and the consistency verification conclusion set, evidence hash and conclusion hash are generated, and the status evidence index set is obtained through index construction processing.
8. The non-ferrous metal warehousing traceability method based on blockchain and the Internet of Things as described in claim 7, characterized in that: The steps for writing the state evidence index into the blockchain and highly anchoring it to generate an on-chain anchored index record are as follows. Submit on-chain write operations to each item in the state evidence index set and confirm consensus to generate on-chain state index records; By anchoring the on-chain height, the on-chain state index record is written to the block height and operation hash in the blockchain, and the index storage is backfilled. This anchoring backfilling process generates an on-chain anchored index record.
9. The non-ferrous metal warehousing traceability method based on blockchain and the Internet of Things as described in claim 8, characterized in that: The process of verifying the conditions for a warehouse receipt status change based on on-chain anchored index records and generating an on-chain confirmation receipt involves the following steps. Collect the adjudication request form, extract the non-ferrous metal batch identifier and warehouse receipt number from the adjudication request form, retrieve the anchor index record on the chain, and generate the adjudication retrieval table; Perform state transition permission verification and index integrity verification on the adjudication retrieval table and the electronic warehouse receipt state machine rule table to obtain adjudication condition verification records; Based on the adjudication condition verification record, an adjudication certificate is generated and submitted for consensus confirmation. The adjudication certificate is then written to generate an on-chain adjudication record. Generate a status confirmation record based on the on-chain ruling record, and confirm the status record consensus to generate an on-chain confirmation receipt.
10. The non-ferrous metal warehousing traceability method based on blockchain and the Internet of Things as described in claim 9, characterized in that: The steps for updating the historical inventory status table based on the on-chain confirmation receipt and performing traceability analysis to generate a non-ferrous metal warehousing traceability report are as follows: Based on the on-chain confirmation receipt, update the confirmation status and solidify the timestamp to generate an inventory status table; By aggregating the inventory status table, on-chain anchored index records, and consistency verification conclusions through traceability analysis, a traceability report for non-ferrous metal warehousing is generated.