A blockchain-based grain storage and transportation maintenance data traceability method
Patent Information
- Application Number
- CN202611062840.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-17
- Publication Date
- 2026-10-13
AI Technical Summary
[0005]本发明的目的在于为了解决现有粮储运维数据管理中存在的数据易篡改、溯源困难、多源异构数据融合不足、设备身份管理混乱及运维决策可信性低的问题,而提出一种基于区块链的粮储运维数据溯源方法
[0029]1、本发明通过部署多层级感知网络,对原始数据进行时间戳标记、设备与空间位置身份绑定及异常剔除,生成具备时空标签特征的结构化运维数据单元;设置相位展开时间窗口将数据映射至相位空间进行拓扑重排,扰动耦合编码生成链式依赖的数字指纹,并将数字指纹与去中心化身份标识上链存证,实现数证分离。解决了多源异构数据的时钟漂移与格式差异问题,使数据具备防篡改、可追溯特性,克服传统中心化存储中数据易伪造、跨主体共享不可信的缺陷。
Smart Images

Figure CN122905690A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of grain storage and operation management technology, specifically a blockchain-based method for tracing grain storage and operation data. Background Technology
[0002] Grain depot operation and maintenance data involves multiple dimensions, including equipment operating status, grain and environmental information, personnel behavior, and energy performance.
[0003] Traditional grain storage operation and maintenance data management often relies on centralized databases or local records, which presents the following prominent problems: data is easily tampered with or forged during collection, transmission, and storage; traceability efficiency is low; and it is difficult to quickly locate the responsible party and establish a complete chain of evidence when abnormal events occur. Grain storage operation and maintenance data has complex characteristics such as multi-source heterogeneity, continuous time sequence, and sampling clock drift, making it difficult to conduct effective deep coupling analysis and fusion utilization of equipment status, grain condition changes, personnel behavior, and energy consumption data. Equipment identity management lacks a unified decentralized mechanism, and the full life cycle archives of equipment, including factory release, operation and maintenance, and scrapping, are incomplete, making it difficult to guarantee credibility when sharing data across entities. Existing operation and maintenance decisions rely heavily on manual experience and simple rules, lacking simulation and multi-objective optimization capabilities based on digital twins, resulting in untimely risk warnings and difficulty in predicting the effectiveness of control strategies.
[0004] Therefore, there is an urgent need for a new method that can ensure the reliability, traceability, and intelligent analysis of grain storage and operation data. Summary of the Invention
[0005] The purpose of this invention is to address the problems in existing grain storage operation and maintenance data management, such as easy data tampering, difficulty in traceability, insufficient integration of multi-source heterogeneous data, chaotic equipment identity management, and low credibility of operation and maintenance decisions, by proposing a blockchain-based grain storage operation and maintenance data traceability method.
[0006] The objective of this invention can be achieved through the following technical solution: a blockchain-based method for tracing grain storage and operation data, comprising:
[0007] S1: Timestamp, bind, and remove anomalies from the raw data to generate structured operation and maintenance data units with spatiotemporal labeling characteristics;
[0008] S2: Based on structured operation and maintenance data units, a time window is set for aggregation processing, which is then merged into standardized data blocks, and a digital fingerprint is generated through a hash function;
[0009] S3: Decentralized identity registration is completed during the device manufacturing stage. A digital certificate separation process is adopted, the original data is encrypted and stored in a distributed storage system, and the digital fingerprint, device identity identifier, timestamp and data tag are written into the consortium blockchain for evidence storage.
[0010] S4: Perform unified feature encoding on the time-aligned data, and use long short-term memory networks and Transformer structures to conduct deep coupling analysis on equipment status, grain condition changes, personnel behavior and energy consumption data, and output multi-dimensional risk analysis results.
[0011] S5: Based on the results of multi-dimensional risk analysis, generate executable control strategies through rules and multi-objective optimization models;
[0012] S6: Map the results of multi-dimensional risk analysis to the executable control strategy on the digital twin platform, analyze the effect of the control strategy through simulation and perform secondary optimization to obtain the modified control parameter set;
[0013] S7: Trigger the execution action based on the modified control parameter set; collect feedback data during execution, record maintenance information, and when an anomaly occurs, call the on-chain fingerprint and off-chain data through the traceability interface to complete the hash comparison and evidence chain reconstruction, generate a visual traceability report, and put the execution result back on the chain for evidence storage, update the equipment's full life cycle file, and form a closed-loop operation and maintenance file.
[0014] As a preferred embodiment of the present invention, the specific process for generating structured operation and maintenance data units with spatiotemporal labeling features is as follows:
[0015] For sampling clock drift of different sensor nodes, a reference time function and a time offset function are set to map the original data to a unified time axis to obtain a time-aligned data sequence. Device identity information and spatial location information are coupled and encoded to establish a joint identity vector, which includes the device's unique identifier, three-dimensional spatial coordinates, and functional area encoding. The time-aligned data and the joint identity vector are fused through a feature splicing operator. A statistical discrimination process based on a sliding window is set up to calculate the local mean and local standard deviation of the data within the window, and an anomaly discrimination function is established. When the function value is greater than the anomaly judgment threshold, it is judged as an anomaly and replaced with the local mean. The dimensional unification and numerical normalization are performed through a standardized mapping function, and the time information, spatial identity information, and data quality indicators are structurally encapsulated to form the final structured operation and maintenance data unit. The data quality indicator is defined as the calculated result of the ratio of the number of abnormal data points to the total number of data points.
[0016] As a preferred embodiment of the present invention, the specific process of setting a time window for aggregation processing and generating a digital fingerprint is as follows:
[0017] A phase unfolding time window is set up, and the data within the window is mapped to the phase space and topologically rearranged to establish a complex domain fusion matrix. The fusion result is modally decoupled to establish a standardized data block containing the complex vector magnitude, phase angle, and semantic topological encoding vector. A perturbation coupling encoding process is set up, and a perturbation function based on the data block norm is established to perturb the data block and perform perturbation embedding and sequence encoding. A digital fingerprint generation function is defined to perform one-way hash calculation on the sequence encoding result, structural compression features, and the fingerprint of the previous window to realize chain-dependent digital fingerprint generation. The semantic topological encoding is obtained by summing normalized weights and an identity mapping function, which encodes the device identity and spatial location into a fixed-length numerical vector.
[0018] As a preferred embodiment of the present invention, the specific process of the digital certificate separation process is as follows:
[0019] During the device manufacturing stage, a decentralized identity identifier based on hash operations is generated for each device. The identity identifier is obtained by hashing the device's public key, device manufacturing metadata, and random salt value. The original data block is symmetrically encrypted into ciphertext, and the session key is generated by hashing the device's private key, timestamp, and digital fingerprint. The ciphertext is uploaded to a distributed storage system to obtain a storage address. The digital fingerprint, device decentralized identity identifier, timestamp, data type label, and storage address are used to construct an on-chain evidence storage structure, and digital signature is performed using the device's private key. In the consortium blockchain network, weighted consensus verification is performed. Each node verifies hash consistency and signature authenticity. The sum of the trust weights of each node is one. After the weighted sum reaches a preset consensus threshold, it is written into the blockchain to form an on-chain evidence storage dataset. Access control functions based on user roles, data access scope labels, and permission policy vectors are set, and dynamic policy updates are supported.
[0020] As a preferred embodiment of the present invention, the specific process of performing deep coupling analysis on equipment status, grain condition changes, personnel behavior, and energy consumption data is as follows:
[0021] Multi-source operation and maintenance data is mapped into a set of multivariate time functions, including equipment state vectors, grain condition and environment vectors, personnel behavior vectors, and energy consumption vectors. Each variable is mapped to a unified feature space using a feature embedding function, which includes mapping parameters and a nonlinear function. The embedding results are then concatenated and fused. A dynamic coupling matrix is established, and the cosine similarity between variables is calculated to reweight the fused features. The reweighted time series is then sequentially input into a Long Short-Term Memory (LSTM) network and a Transformer structure. The LSM network outputs a hidden state sequence, and the Transformer structure captures global dependencies through a self-attention mechanism. After layer normalization, a unified high-dimensional coupling feature is obtained. The unified feature is mapped to subspaces for mold risk, equipment failure, energy efficiency, and behavioral risk using a task projection function. Mold risk probability indicators, equipment anomaly indicators, energy efficiency indicators, and behavioral risk indicators are established. The equipment anomaly indicator is obtained by calculating the distance to the normal state reference vector, and the energy efficiency indicator is obtained by the ratio of output energy to input energy, forming a multi-dimensional risk analysis result set.
[0022] As a preferred embodiment of the present invention, the specific process of generating an executable control strategy through rules and a multi-objective optimization model is as follows:
[0023] The output indicators from the analysis phase are represented as continuous state vectors. A system reference state is established through expected operation mapping. The information inconsistency vector between the current state and the reference state is calculated. The information inconsistency vector is accumulated by memory residuals, and a memory decay coefficient is set to obtain the accumulated residual vector. The accumulated residual vector is decomposed into independent control components through a decoupling matrix. Based on a preset basic control mode library, each basic control mode represents a standardized vector expression of a basic operation. Control vectors are generated by weighted combination, and the weights are calculated based on the independent control components using a normalized exponential function. After amplitude constraint and trajectory consistency correction, the continuous control vector is transformed into an executable control strategy by executing a mapping function, including corresponding the numerical range to the wind turbine frequency level, triggering a maintenance work order when a certain dimension exceeds a threshold, and triggering a safety alarm by combining multiple dimensions.
[0024] As a preferred embodiment of the present invention, the specific process of performing effect analysis and secondary optimization of the control strategy through simulation is as follows:
[0025] The physical state is represented in the digital twin space through a mapping function. Spatially extended sampling point data generates continuous grain temperature and gas concentration field functions, which are generated in real-time using radial basis function interpolation data from temperature, humidity, and gas sensors deployed within the grain silo. The control strategy to be executed is input into the virtual space, and the state evolution of the twin is driven by a virtual evolution operator. Simulation indicators are extracted, including risk level, equipment load changes, and energy efficiency trends. Verification is passed when the simulation indicators meet preset safety and performance constraints; otherwise, the control strategy is adjusted based on the state deviation before and after the simulation. A phased deviation-driven correction function is used to correct the strategy, and the simulation is repeated until the constraints are met, resulting in a corrected control parameter set. After execution, feedback maps the actual state changes back to the virtual space, maintaining the consistency of the digital twin model.
[0026] As a preferred embodiment of the present invention, the specific process of collecting feedback data, recording maintenance information, and tracing the source during execution is as follows:
[0027] Real-time acquisition of execution feedback vectors; structured representation of maintenance process information as a set of maintenance records; when the anomaly detection function detects an anomaly, it calls on-chain evidence information to retrieve the original data from distributed storage, recalculates the digital fingerprint and compares it with the on-chain fingerprint for consistency, establishes an evidence chain structure containing on-chain information, off-chain data and comparison results, and generates a visual traceability report through visual mapping; after execution, the execution results are organized into on-chain data units, including the final control vector, execution feedback vector and set of maintenance records, generate a new digital fingerprint and write it to the blockchain, update the equipment file to the union of historical files and the current on-chain record, forming full lifecycle management.
[0028] Compared with the prior art, the beneficial effects of the present invention are:
[0029] 1. This invention deploys a multi-level sensing network to timestamp raw data, bind device and spatial location identities, and remove anomalies, generating structured operation and maintenance data units with spatiotemporal labeling characteristics. A phase unfolding time window is set to map the data to the phase space for topological rearrangement. Perturbation coupling encoding generates chain-dependent digital fingerprints, which are then stored on the blockchain along with decentralized identity identifiers, achieving separation of digital evidence and physical evidence. This solves the problems of clock drift and format differences in multi-source heterogeneous data, giving the data tamper-proof and traceable characteristics, overcoming the shortcomings of traditional centralized storage, such as easy data forgery and untrustworthy cross-entity sharing.
[0030] 2. This invention maps equipment status, grain condition changes, personnel behavior, and energy consumption data into a set of multivariate time functions. Through feature embedding and dynamic coupling matrices, it reconstructs a multi-source fusion feature space, sequentially inputting it into a Long Short-Term Memory (LSTM) network and a Transformer structure to capture temporal evolution patterns and global dependencies, outputting mold risk probability, equipment anomaly indicators, energy efficiency indicators, and behavioral risk indicators. This deep coupling analysis method overcomes the limitations of existing technologies that only analyze single types of data independently, revealing the comprehensive impact of multi-factor interactions on safety in grain storage systems.
[0031] 3. This invention establishes multi-dimensional risk indicators as continuous state vectors, establishes system reference states through expected operation mapping, decomposes them into independent control components through memory residual accumulation and decoupling transformation, and generates executable control strategies by combining with a basic control mode library. Decisions are mapped to a digital twin platform, and effect analysis and deviation-driven correction are performed through simulation of continuous grain temperature and gas concentration fields, forming a closed-loop iterative optimization. During execution, feedback data is collected in real time and maintenance information is recorded in a structured manner. In case of anomalies, a visual traceability report is generated through on-chain fingerprint comparison and evidence chain reconstruction. The execution results are then uploaded to the blockchain again to update the equipment's full lifecycle archive. This invention solves the problems of existing operation and maintenance relying on manual experience, the inability to pre-simulate and verify control strategies, and broken evidence chains, achieving reliable full lifecycle management of grain storage operation and maintenance from data collection, intelligent decision-making, simulation optimization to anomaly traceability. Attached Figure Description
[0032] To facilitate understanding by those skilled in the art, the present invention will be further described below with reference to the accompanying drawings.
[0033] Figure 1 This is a flowchart of the method steps of the present invention. Detailed Implementation
[0034] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0035] It should be understood that the terms “comprising” and “including” used in this disclosure and claims indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0036] It should also be understood that the terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to limit the disclosure. As used in this disclosure and claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this disclosure and claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes such combinations.
[0037] Please see Figure 1 As shown, a blockchain-based method for tracing grain storage and operation data includes:
[0038] S1: A multi-level sensing network is installed throughout the entire grain depot area to continuously collect and cover raw data throughout the entire operation and maintenance process. This raw data is then timestamped and linked to equipment and spatial location identities via sensor nodes or edge gateways. Outliers are removed, and the data is formatted to obtain structured operation and maintenance data units with spatiotemporal labeling characteristics. The operation and maintenance data includes multi-dimensional content such as equipment operating status, grain condition and environmental information, personnel behavior, and energy performance. It also includes vibration parameters of conveying equipment, drying temperature curves, temperature and humidity field distribution of grain piles, acoustic signals of pests, gas concentration changes, and personnel location trajectories and safety behavior identification results.
[0039] S2: Based on structured operation and maintenance data units, and combined with the multi-source heterogeneity and time-series continuity of grain storage operation and maintenance data, a time window is set to aggregate the data, merge multi-dimensional data within the same time interval into standardized data blocks, and generate digital fingerprints by mapping and calculating the data blocks through a hash function.
[0040] S3: During the device manufacturing stage, decentralized identity registration is completed, and one item, one code management is implemented. During the data on-chain process, the original data is encrypted and stored in a distributed storage system through the digital certificate separation process. The digital fingerprint, device DID, timestamp, and data tag are written into the consortium chain to complete the evidence storage. Through the consensus machine and permission control process, the data under the participating entities has consistency and credibility, forming an on-chain evidence storage dataset.
[0041] S4: Perform unified feature encoding on the time-aligned data, establish a multi-source fusion feature space, use long short-term memory networks to capture the evolution patterns of time series, and combine the Transformer structure to establish a cross-variable global dependency model. Perform deep coupling analysis on the data of equipment status, grain condition changes, personnel behavior and energy consumption, and output the probability of mold risk, equipment anomaly indicators, energy efficiency indicators and behavioral risk indicators to obtain a multi-dimensional risk analysis result set.
[0042] S5: Based on the multi-dimensional risk analysis result set, establish a decision fusion process, and use rules and multi-objective optimization models to uniformly process the results of fault prediction, safety risk and energy efficiency analysis to generate executable control strategies.
[0043] S6: The analysis results and optimization decisions are mapped to the digital twin platform in real time. A three-dimensional operation model synchronized with the actual grain depot is built in the virtual space. The model is displayed through visualization of equipment health status, dynamic rendering of grain temperature and gas concentration fields, and heat map of personnel trajectories. Before execution, the effect of the executable control strategy is analyzed through simulation and the control parameters are optimized a second time based on the simulation feedback to obtain a set of corrected control parameters.
[0044] S7: Automatically triggers actions based on the modified control parameter set, including generating maintenance work orders, linking ventilation and air conditioning equipment, and triggering safety alarms; during execution, it collects execution feedback data in real time and records the maintenance process, spare parts replacement information, and manual confirmation marks; when an abnormal event occurs, it calls the on-chain fingerprint and off-chain original data through the traceability interface to complete hash comparison and evidence chain reconstruction, and generates a visual traceability report; the execution results are uploaded to the chain again for evidence storage, the equipment's full life cycle file is updated, and a closed-loop operation and maintenance file is formed.
[0045] The generation of structured operation and maintenance data units with spatiotemporal labeling features specifically includes:
[0046] At each sensing node i, the collected multi-source physical quantities are uniformly represented as a multidimensional continuous-time function: X i (t)={x i1 (t), x i2 (t), ..., x im (t)} where i represents the i-th sensing node; t is a continuous time variable; m represents the number of data dimensions collected by this node; x ij (t) represents the original measurement value of the j-th physical quantity at time t. The physical quantity includes temperature, humidity, vibration, or gas concentration, etc. j∈1,2,...,m.
[0047] Because different sensing nodes experience sampling clock drift, a unified time base is established by setting a reference time function T. ref (t), and establish the time offset function Δ i (t), where Δ i (t) represents the offset of node i relative to the reference clock. Based on this, the time mapping relationship is: τ i (t)=t+Δ i (t), where τ i (t) represents the corrected unified time variable. Mapping the original data to a unified time axis yields a time-aligned data sequence: ,in, This represents the reconstructed data value at a uniform time scale.
[0048] After time alignment is completed, device identity information and spatial location information are coupled and encoded to establish a joint identity vector: S i =(ID i L i Ω i Among them, ID i Indicates the unique identifier of the device; L i =(x i y i , z i ) represents the coordinate position of the device in three-dimensional space; Ω i This indicates the functional area code to which the device belongs. This is achieved by defining a feature concatenation operator. This involves integrating data with identity information. , where Φ i (·) represents the spatial identity mapping function.
[0049] Based on the above process, a statistical discrimination process based on a sliding window is set up. For data of any dimension, the window length is set to W, and its local statistical features are represented as follows: , , where μ ij (τ) is the local mean, σ ij (τ) represents the local standard deviation. Further, an anomaly detection function is established: ,in, To prevent extremely small positive numbers with a denominator of zero. When D ij If (τ) > λ, then the data is considered an outlier and is replaced by the local mean. =μ ij (τ), where λ is the anomaly detection threshold.
[0050] After handling outliers, the data is formatted and standardized. By establishing a standardized mapping function F(·), the dimensions are unified and the values are normalized to obtain z. ij (τ), z ij (τ) represents the normalized standard data. Further, a unified data representation format will be established: .
[0051] Based on the above processing, time information, spatial identity information, and data quality information are structured and encapsulated to form the final data unit: P i (τ)={Z i (τ), τ, S i Ψ i}, where P i (τ) represents a structured operation and maintenance data unit; Ψi This refers to data quality metrics, which are defined as follows: , where N abn N represents the number of outlier data points. total This indicates the total number of data points.
[0052] The process of setting a time window to aggregate data is as follows:
[0053] After completing the basic data normalization, the data units from different nodes are represented as sets: P i (τ)={Z i (τ), τ, S i Ψ i}
[0054] To avoid information redundancy caused by directly splicing traditional time windows, a phase-expanded time window is set up, and a window function is defined: , θ=ω τ +ϕ i}, where k represents the k-th window; θ is the window length; θ is the time phase variable; ω is the uniform angular frequency parameter, reflecting the sampling rhythm; ϕ i The initial phase offset for node i is derived from the mapping encoding of the device ID.
[0055] Based on this, the data within the window is mapped to the phase space and topologically rearranged to establish a fusion matrix: , where: M k ∈C m Let be a complex field fusion vector; j is the imaginary unit, and satisfies j 2 =−1; θ is the Euler phase factor used to encode the temporal sequence structure. i (τ)=ω τ +ϕ i It should be noted that the above process creates a rotational superposition structure of data from different time points in the complex plane, preserving the time sequence and node differences.
[0056] Subsequently, modal decoupling was performed on the fusion results to establish standardized data blocks: , where: |M k | represents the magnitude of the complex vector; arg(M) k ) represents the phase angle (reflecting the time structure); O k This is a semantic topological encoding vector. The semantic topological encoding is defined as follows: , where: γ i For normalized weights; f(S) i) is the identity mapping function, which encodes the device ID and spatial location into a fixed-length numerical vector, for example, through hash embedding or encoding table mapping. Thus, B is obtained. k It consists of a data block with a ternary structure of amplitude, phase, and semantics, which is different from the traditional single numerical fusion form.
[0057] When generating a digital fingerprint, a perturbation coupling coding process is set up, and a perturbation function is established: , where: ∥B k ∥1 represents the L1 norm of the data block, the sum of the absolute values of all elements; η is the scaling factor; ρ k The window disturbance seed originates from the fingerprint of the previous window.
[0058] Subsequently, the data block is perturbed and embedded: , where ⊕ indicates splicing, that is, embedding the perturbation value into the data structure.
[0059] Sequence encoding is performed on the perturbed data: , where Encode(·) represents a deterministic encoding function, such as fixed-length byte mapping.
[0060] Finally, the digital fingerprint generation function is defined as follows: Where: H(·) is a one-way hash function; ∥ represents sequence concatenation; σ k =cos( ), which is a structural compression feature ( (L2 norm) Use the fingerprint of the previous window to achieve chained dependencies.
[0061] The process of separating digital certificates is as follows:
[0062] During the device manufacturing phase, a decentralized identity identifier (DID) is generated for each device i. i Its definition is: DID i =H(PK i ∥M i ∥ζ i ), where PK i For device public key; M i This contains device manufacturing metadata, such as model number and batch number encoding vectors; ζ i This represents a random salt value for the device; ∥ indicates sequence concatenation. This achieves a unique identity binding for each item with a unique code.
[0063] During the data uploading process, the original data block is represented as: D k ={B k , t k DID i Λ k}, where B kFor standardized data blocks; t k For timestamps; Λ k This is a data type label, such as equipment status, grain condition, or energy consumption category encoding.
[0064] To achieve digital-to-document separation, the original data block is encrypted using the symmetric encryption function E(·). , where C k For encrypted data; K k This is the session key for this data block. The session key is generated as follows: K k =H(SK i ∥t k ∥F k ), of which SK i For device private key; F k This is the digital fingerprint of the corresponding data block.
[0065] Subsequently, the encrypted data C k Upload to a distributed storage system, such as IPFS, and obtain the storage address: Addr k =H(C k ), where Addr k This serves as an addressing identifier for the data content. Meanwhile, only the data digest information is constructed into an on-chain evidence storage structure: R k ={F k DID i , t k Λ k Addr k To prevent the digest information from being forged, a signature function is set up: ,in, This indicates that the device's private key is used for digital signature calculation; This is the signature result.
[0066] This ultimately forms the on-chain data unit: In a consortium blockchain network, a multi-node consensus verification process is established for this data unit. Let the set of nodes participating in the consensus be N = {n1, n2, ..., n}. q1}, where q1 is the number of nodes. Each node executes the verification function: ,in: This represents a public-key-based signature verification function; b k Encoded sequence for data blocks; V j1 Represents node n j1 The verification results.
[0067] Next, set the weighted consensus decision function: , where ω j1 For node n j1 The trust weights, and satisfying ∑ωj1 =1.
[0068] When Γ k ≥θ c When the time is right, the data is deemed valid and written to the blockchain, forming an on-chain evidence dataset, where θ c This is the consensus threshold. Regarding access control, an access control function is set: A(u, R...). k )=f(Role u Scope k Π u ), where: u represents the access subject; Role u Indicates user roles, such as regulators, equipment manufacturers, etc.; Scope k Indicates the data access scope label; Π u This represents the permission policy vector; f(·) is the policy matching function used for blockchain access control, determining whether access to a certain stored evidence is allowed based on the user's role, data scope, and permission policy. Preferably, it is implemented as a role-based multi-level matching rule engine. When A(u, Rk) = 1, access to on-chain digest information and off-chain data index is allowed; otherwise, access is denied.
[0069] Furthermore, enhance the dynamism of permissions by setting a policy update function: Π u (t+1)=Π u (t)+Δ u (t), where Δ u (t) represents the permission correction amount generated based on policy adjustments.
[0070] The specific process of the deep coupling analysis between equipment status, grain condition changes, personnel behavior, and energy consumption data is as follows:
[0071] After time alignment is completed, multi-source operation and maintenance data are uniformly mapped to a set of multivariable time functions: X(τ1)={x d (τ1), x g (τ1), x p (τ1), x e (τ1)}, where: x d Represents the device state vector; x g Represents the grain situation environment vector; x p Represents a vector of human behavior; x e τ represents the energy consumption vector; τ1 is a uniform time variable.
[0072] To eliminate differences in scale among variables and establish a unified representation, a feature embedding function is set: Where: k1∈{d, g, p, e} represents the variable category; W k1 b k1σ is the mapping parameter; σ(·) is a nonlinear function.
[0073] By embedding and concatenating the variables, we obtain the fused input: h(τ1)=h d (τ1)⊕h g (τ1)⊕h p (τ1)⊕h e (τ1).
[0074] Based on this, a dynamic coupling matrix is established: , where ai2j2(τ1) represents the cosine similarity between variables i2 and j2; thus forming the coupling matrix A(τ).
[0075] Based on the coupling matrix relationship, the features are reweighted and fused: .
[0076] Subsequently, the time series { The input is a Long Short-Term Memory (LSTM) network used to model the temporal evolution process, and its output is: s t1 =LSTM( s t1−1 ), where: s t1 To further capture global dependencies across time and variables, time t1 is represented by the sequence {s}. t1 Input a Transformer structure to obtain the global representation: g t1 =Attention(s t1 , S, S), where: S = [s 11 , ..., s T1 Attention is a standard self-attention function used to capture long-range dependencies between grain condition variables. In the context of grain storage, a preferred approach is to apply multi-head self-attention to the hidden state sequence output by the LSTM, with each head focusing on a different coupling pattern. This results in a unified high-dimensional coupling feature: Z. t1 =LayerNorm(g t1 ).
[0077] Next, the task projection function maps the unified features to different business subspaces: z r =W r Z t1 , z f =W f Z t1 , z e =W e Z t1 , z p =W p Z t1 ; where: z r For the characteristics of the mold risk subspace, z fFor the equipment fault subspace features, z e For the energy efficiency subspace characteristics, z p W* represents the behavioral risk subspace features, and W* is the task projection matrix, which is obtained by training with historical labeled data.
[0078] Based on the above process, indicator functions are established, including: mold risk indicator: This indicates the probability of grain becoming moldy. Equipment malfunction indicators: ,in This is the reference vector for the normal state. Energy efficiency indicators: This represents the unit energy efficiency ratio. Behavioral risk indicators: , representing the probability of a violation. The results of a multi-dimensional risk analysis are then derived by organizing the indicator functions.
[0079] The process of uniformly processing the results of fault prediction, safety risk, and energy efficiency analysis through rule-based procedures and multi-objective optimization models is as follows:
[0080] After obtaining the metrics output from the analysis phase, the system state is represented as a continuous state vector: y t1 =[R t1 F t1 E t1 P t1 ].
[0081] Next, the system reference state is established through the expected runtime mapping: Where M(·) is the reference model function, obtained from historical stable operating conditions; based on the current time and historical operating condition embedding, the normal state range that the system should be in is output. Preferably, a prediction model based on a long short-term memory network is adopted, trained using stable operating data from the past three years of storage period. τ1 t1 h represents the current time. t1 It embeds historical state sequences to reflect periodicity and operating conditions.
[0082] Therefore, the information inconsistency vector is calculated: This vector characterizes the degree and direction of deviation from the normal operating state.
[0083] Next, to avoid misjudgment caused by fluctuations at a single moment, the information inconsistency vector is accumulated by memory residuals, defined as follows: , where: r t1 λ1∈(0,1) is the cumulative residual vector; λ1∈(0,1) is the memory decay coefficient.
[0084] After obtaining the residual expression, a directional decoupling transformation is set to decompose the mixed index into independent control components: q t1 =Tr t1 , where: T∈R m×4The decoupling matrix is preset from historical data; q t1 ∈R m This represents the driving quantity in the control primitive space.
[0085] Subsequently, by controlling the primitive base, a set of basic control patterns is defined: U0={u (12) u (22) ,…,u (m2)}, where each u (k2) This represents a standardized vector representation of a basic operation, including enhanced ventilation, cooling, and maintenance triggering.
[0086] Based on driving quantity q t1 Establish control combinations: The weights are defined as follows: .
[0087] Next, to ensure that the control action and state match, set the amplitude constraint function. , where: ∥r t1 ∥2 represents the residual strength; the tanh function is used to limit the output range.
[0088] Based on the above process, in order to avoid controlling oscillations, trajectory consistency correction is performed: ,in: This feature enables slow adjustments when the deviation is small and a rapid response when the deviation is large.
[0089] Finally, by executing the mapping function, the continuous control vector is transformed into an executable control policy: , where: Π(⋅) maps each dimension to a specific instruction, including the numerical range corresponding to the wind turbine frequency level, triggering a maintenance work order when a certain dimension exceeds the threshold, and triggering a safety alarm when multiple dimensions are combined.
[0090] The process of analyzing the effectiveness of the executable control strategy through simulation is as follows:
[0091] After obtaining the multidimensional analysis indices and continuous control vectors output from the previous stage, they are set up in a virtual space for consistent mapping; the physical state at the current moment is represented as: , of which S phy Represents the set of physical states, where n3 represents the number of real-world entities, including equipment, grain storage units, or personnel; s i3 (τ1) represents the state vector of the i3th object at time τ1; i3 represents the object index; the corresponding representation in the digital twin space is established through a mapping function: S vir (τ1)=T0(S phy (τ1)), where S virT0(·) represents the set of virtual system states; T0(·) converts information such as equipment status, grain distribution and personnel behavior into geometric attributes and rendering parameters in the three-dimensional model, so that the virtual model keeps synchronized with the actual grain depot in terms of spatial structure and operating status.
[0092] After completing the overall mapping, discretely acquired data can be continuously represented in virtual space, further establishing the grain temperature field and gas concentration field. Spatially expanding the sampling point data yields continuous field functions: T(r, τ1) and G(r, τ1), where T(r, τ1) represents the grain temperature field function and G(r, τ1) represents the gas concentration field function, used to construct the continuous physical field in the digital twin. Preferably, radial basis function interpolation is used, generated in real-time using data from 80 temperature and humidity sensors and 24 gas sensors deployed within the grain silo; r represents the spatial coordinates. The continuous field function drives the color distribution and transparency changes in the 3D model, creating a dynamic visualization effect across the entire silo. Equipment health and personnel trajectories are mapped to color gradients and thermal distributions, respectively, presenting the superposition of multidimensional information in a unified space.
[0093] After the virtual environment completes state establishment, set the control policy to be executed: u t1 =[u 11 u 21 ,…,u m1 ], where u t1 Let represent the control vector to be executed at time t1; the control policy to be executed is applied as input to the virtual twin, driving the twin to evolve its state. The virtual evolution operator is calculated as follows: ,in, Δτ1 represents the virtual state after the deduction, and Δτ1 is the deduction time step.
[0094] Following the simulated virtual state, further evaluation indicators are extracted, and simulation indicators are established: J sim =Φ( ), where J sim For simulation indicators, Φ(⋅) represents the mapping function that extracts risk level, equipment load change and energy efficiency trend from virtual state. Preferably, it is achieved through three-layer weighted calculation in the digital twin model of grain warehouse.
[0095] When the simulation metrics meet the preset safety and performance constraints, i.e.: J sim If the threshold is ≤Θ, where Θ is the comprehensive judgment threshold, then it is determined that the current control strategy can reduce the risk in the virtual environment and will not cause new anomalies. At this time, the execution preparation stage is entered.
[0096] If the above conditions are not met, the strategy correction process is triggered. By comparing the state differences before and after the simulation, the deviation Δs is established: Δs = - And adjust the control strategy based on the deviation: u t1 adj =ut+Γ0(Δs), where u t1 adj Let Γ0(·) represent the corrected control vector, and let Γ0(·) be the deviation-driven correction function, used to quantitatively correct the control strategy based on the state deviation generated by the digital twin virtual simulation. Preferably, in conjunction with the actual control scenario of the grain depot, the deviation-driven correction is implemented in a phased proportional-integral-derivative form. After the correction is completed, the strategy corresponding to the updated control vector is re-inputted into the virtual system for a second simulation until the constraints are met, forming a closed-loop iterative process.
[0097] After the control strategy passes virtual verification, it enters the actual execution phase. The continuous control vector is mapped to a modified control parameter set: A t1 =Π(u t1 final During execution, through a feedback process, the actual state changes after execution are collected again and mapped to the virtual space, updating it as follows: , where: τ1 + This indicates a new point in time after execution, ensuring that the digital twin model always maintains consistency with the real system.
[0098] The process of collecting execution feedback data in real time during execution, and recording the maintenance process, spare parts replacement information, and manual confirmation marks, specifically includes:
[0099] During execution, feedback data is collected in real time, and the execution status is represented as: f t1 =[f1(t1), f2(t1),…,fk3(t1)], where: f t1 This represents the execution feedback vector, where k3 represents the number of feedback dimensions, such as execution status, maintenance progress, sensor response, etc.; f (t1) represents the t1th Each feedback component =1, 2, ..., k3.
[0100] Furthermore, the maintenance process information is structured and represented as: M t1 ={p1 t1 r1 t1 h1 t1}, where: M t1 For the collection of maintenance records, p1 t1 For spare parts replacement information, such as model and quantity; r1 t1 The result of the repair process; h1 t1 For manual verification, such as a signature or confirmation mark.
[0101] When an abnormal event is detected during execution, such as f (t1) If the threshold is exceeded, the tracing process is triggered: Define the abnormal event identifier: ϵ t1 =I0(f t1 ), where: ϵ t1 Indicates an exception event flag; I0(·): exception determination function, outputs 0 or 1. When ϵ t1 When =1, trace the source by calling on-chain and off-chain data.
[0102] On-chain evidence storage information is represented as: R k ={F k DID i , t k Λ k Addr k}, retrieve the original data D from distributed storage k ; Recalculate the digital fingerprint using the retrieved data: F k =H(D) k ), where: F k ' is the recalculated digital fingerprint; perform a consistency comparison: , where: δ k Data consistency determination results.
[0103] Based on the above process, establish the chain of evidence structure: Z k ={R k D k δ k}, where: Z k It is a set of evidence chains, including on-chain information, off-chain data, and verification results.
[0104] Further, a source tracing report is generated using a visual mapping function: V k =Ω0(Z k ), where: V k Visualize the source tracing results; Ω0(·) visualizes the transformation function.
[0105] After execution, the results will be reorganized into on-chain data units D. t1 exec :D t1 exec ={u t1 final f t1 M t1}, generate a new fingerprint F on it. t1 exec :F t1 exec =H(D t1 exec ), and establish an on-chain record: R t1exec ={F t1 exec DID i ,t1,L t1 exec}, where: L t1 exec The data is labeled and ultimately written to the blockchain to complete the notarization.
[0106] Furthermore, in order to establish full lifecycle management, the equipment file will be updated to: L i =L i prev ∪R t1 exec , where: L i For the lifecycle profile of device i, L i prev For historical archives, ∪ is the set union operation.
[0107] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to any specific implementation. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.
Claims
1. A blockchain-based method for tracing grain storage and operation data, characterized in that, include: The raw data is timestamped, identified, and anomaly removed, and structured operation and maintenance data units with spatiotemporal label characteristics are generated. Based on structured operation and maintenance data units, time windows are set, aggregation processing is performed, and the data is merged into standardized data blocks. Digital fingerprints are generated through hash functions. Through the digital certificate separation process, the original data is encrypted and stored in a distributed storage system, and the digital fingerprint, device identity, timestamp and data tag are written into the consortium blockchain for evidence storage; The time-aligned data is uniformly feature-coded, and the data on equipment status, grain condition changes, personnel behavior and energy consumption are deeply coupled and analyzed to output multi-dimensional risk analysis results. Based on the results of multi-dimensional risk analysis, executable control strategies are generated through rules and multi-objective optimization models. The results of multi-dimensional risk analysis are mapped to the executable control strategy and then mapped to the digital twin platform. The effect of the control strategy is analyzed and optimized through simulation, resulting in a modified control parameter set. The execution action is triggered based on the modified control parameter set.
2. The method for tracing grain storage and operation data based on blockchain according to claim 1, characterized in that, The specific process for generating structured operation and maintenance data units with spatiotemporal labeling features is as follows: For the sampling clock drift of different sensing nodes, a reference time function is set and a time offset function is established to map the original data to a unified time axis to obtain a time-aligned data sequence; device identity information and spatial location information are coupled and encoded to establish a joint identity vector; The time-aligned data is fused with the joint identity vector using a feature concatenation operator; a sliding window-based statistical discrimination process is set up to calculate the local mean and local standard deviation of the data within the window, and an anomaly discrimination function is established. When the function value is greater than the anomaly judgment threshold, it is judged as an anomaly and replaced with the local mean; through a standardized mapping function, the units are unified and the values are normalized, and the time information, spatial identity information and data quality indicators are structurally encapsulated to obtain the final structured operation and maintenance data unit.
3. The method for tracing grain storage and operation data based on blockchain according to claim 1, characterized in that, The specific process of setting a time window for aggregation processing and generating digital fingerprints is as follows: Set a phase unfolding time window, map the data within the window to the phase space and perform topological rearrangement to establish a complex domain fusion matrix; perform modal decoupling on the fusion result to establish a standardized data block containing complex vector magnitude, phase angle and semantic topological encoding vector; The perturbation coupling coding process is set up, a perturbation function based on the data block norm is established, and perturbation embedding and sequence coding are performed on the data block; a digital fingerprint generation function is defined, and one-way hash calculation is performed on the sequence coding result, structural compression features and the fingerprint of the previous window to realize the generation of chain-dependent digital fingerprints; Semantic topological coding is obtained by summing normalized weights and an identity mapping function, which encodes device identity and spatial location into a fixed-length numerical vector.
4. The method for tracing grain storage and operation data based on blockchain according to claim 3, characterized in that, The specific process of separating digital certificates is as follows: During the device manufacturing process, a decentralized identity identifier based on hash calculation is generated for each device. The original data block is symmetrically encrypted into ciphertext; the ciphertext is uploaded to a distributed storage system to obtain a storage address; the digital fingerprint, the device's decentralized identity, the timestamp, the data type tag, and the storage address are used to construct an on-chain evidence storage structure, and the device's private key is used for digital signature; In the consortium blockchain network, weighted consensus verification is used to verify the consistency of hash and the authenticity of signature. The sum of the trust weights of each node is one. After the weighted sum reaches the preset consensus threshold, it is written into the blockchain to form an on-chain evidence dataset. Configure access control functions based on user roles, data access scope tags, and permission policy vectors.
5. A method for tracing grain storage and operation data based on blockchain according to claim 4, characterized in that, The specific process of conducting deep coupling analysis of equipment status, grain condition changes, personnel behavior, and energy consumption data is as follows: Multi-source operation and maintenance data is mapped into a set of multivariable time functions, including equipment status vectors, grain and environmental conditions vectors, personnel behavior vectors, and energy consumption vectors. The feature embedding function maps each variable to a unified feature space. The embedding function contains mapping parameters and nonlinear functions; it concatenates and merges the embedding results of various variables. A dynamic coupling matrix is established, the cosine similarity between variables is calculated, and the fused features are reweighted. The reweighted time series is then input into a long short-term memory network and a Transformer structure. The long short-term memory network outputs a hidden state sequence, and the Transformer structure captures global dependencies through a self-attention mechanism. After layer normalization, a unified high-dimensional coupling feature is obtained. By using a task projection function, unified features are mapped to subspaces of mold risk, equipment failure, energy efficiency, and behavioral risk. Mold risk probability indicators, equipment anomaly indicators, energy efficiency indicators, and behavioral risk indicators are established respectively, thereby obtaining a multi-dimensional risk analysis result set.
6. The method for tracing grain storage and operation data based on blockchain according to claim 1, characterized in that, The specific process of generating an executable control strategy through rules and multi-objective optimization models is as follows: The indicators output from the analysis phase are represented as continuous state vectors, and a system reference state is established through expected operation mapping; the information inconsistency vector between the current state and the reference state is calculated. The information inconsistency vector is accumulated by memory residuals, and a memory decay coefficient is set to obtain the accumulated residual vector; the accumulated residual vector is decomposed into independent control components by a decoupling matrix; Based on a pre-defined library of basic control modes, control vectors are generated by combining weights. After amplitude constraints and trajectory consistency corrections, continuous control vectors are transformed into executable control strategies by executing a mapping function.
7. A method for tracing grain storage and operation data based on blockchain according to claim 6, characterized in that, The specific process of analyzing the effectiveness of the control strategy and performing secondary optimization through simulation is as follows: The physical state is represented in the digital twin space by a mapping function; The sampling point data is spatially expanded to generate continuous grain temperature field and gas concentration field functions. The radial basis function interpolation method is used to generate these functions in real time using data from temperature and humidity sensors and gas sensors deployed in the grain warehouse. The control strategy to be executed is input into the virtual space, and the state evolution of the twin is driven by the virtual evolution operator to extract simulation indicators. Validation is passed when the simulation metrics meet the preset safety and performance constraints. Otherwise, the control strategy is adjusted based on the state deviation before and after the deduction. A phased deviation-driven correction function is used to correct the strategy, and the deduction is repeated until the constraints are met to obtain the corrected control parameter set. After execution, the actual state changes are remapped to the virtual space through feedback to maintain the consistency of the digital twin model.
8. A method for tracing grain storage and operation data based on blockchain according to claim 7, characterized in that, Also includes: During the execution process, feedback data is collected and maintenance information is recorded. When an anomaly occurs, the on-chain fingerprint and off-chain data are called through the traceability interface to complete hash comparison and evidence chain reconstruction, generate a visual traceability report, and put the execution result back on the chain for evidence storage, and update the equipment's full life cycle file. The specific process of collecting feedback data, recording maintenance information, and tracing the source during the execution is as follows: Real-time acquisition of execution feedback vectors; structured representation of maintenance process information as a set of maintenance records; when the anomaly detection function detects an anomaly, it calls on-chain evidence information to retrieve the original data from distributed storage, recalculates the digital fingerprint and compares it with the on-chain fingerprint for consistency, establishes an evidence chain structure containing on-chain information, off-chain data and comparison results, and generates a visual traceability report through visual mapping; after execution, the execution results are organized into on-chain data units, including the final control vector, execution feedback vector and set of maintenance records, generate a new digital fingerprint and write it to the blockchain, update the equipment file to the union of historical files and the current on-chain record, forming full lifecycle management.