Grain batch fingerprint comparison method based on knowledge graph
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NANJING UNIV OF FINANCE & ECONOMICS
- Filing Date
- 2026-07-07
- Publication Date
- 2026-08-04
AI Technical Summary
[0004]针对现有技术的不足,本发明提供了一种基于知识图谱的粮食批次指纹比对方法,解决了现有技术通过静态比对会出现漏判而影响后续比对数据可靠性的问题
1、本发明在检索基准指纹向量进行多维空间相似度计算的同时,同步基于元路径语义验证包含当前批次指纹向量的图谱路径是否符合流转时序逻辑,解决了现有技术脱离真实业务背景而造成的漏判问题,避免了仅靠表层数值计算影响对深层逻辑异常的挖掘,降低了精心伪造行为的误识别率,提升对异常批次进行替换拦截与预警的敏锐度。
Smart Images

Figure CN122508293A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of grain batch comparison technology, and in particular to a grain batch fingerprint comparison method based on knowledge graph. Background Technology
[0002] To prevent substandard or stolen grain from entering, storing, transporting, and leaving the warehouse, strict consistency comparisons of grain batches are typically required at each stage of grain circulation. Current methods for grain batch comparison largely rely on simple electronic tags or manual sampling records. Some systems have begun to introduce physical feature comparison technologies based on spectral or image analysis to generate grain fingerprints. However, these methods are mostly limited to static numerical comparison mechanisms and fail to establish multi-dimensional contextual attributes and topological relationships between circulation nodes.
[0003] In complex real-world circulation scenarios, when another batch of grain with extremely similar physical characteristics is used to illegally replace it, static comparison alone often leads to serious omissions in the comparison system. At the same time, since most existing systems lack circulation knowledge graphs and are not configured with meta-path semantic verification methods for circulation time-series logic, the system is detached from the real business context, affecting the system's ability to identify circulation anomalies from deep business logic chains and reducing the sensitivity of intercepting and warning of abnormal batches. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention provides a knowledge graph-based method for comparing grain batch fingerprints, which solves the problem that existing technologies, through static comparison, may result in missed judgments, thus affecting the reliability of subsequent comparison data.
[0005] To address the aforementioned technical problems, this invention provides the following technical solution: a knowledge graph-based method for comparing grain batch fingerprints, the method comprising: S1. Collect multimodal detection data of the target batch of grain and preprocess it. Input the preprocessed multimodal detection data into the multimodal deep learning model for feature fusion, extract steady-state features and map them into the fingerprint vector of the current batch. S2. Obtain the multi-dimensional context attributes associated with the current flow node, convert them and the current batch fingerprint vector into target entities, and inject them into the preset flow knowledge graph through the entity alignment mechanism to build topological associations; S3. In response to the establishment of topological associations, the baseline equipment parameters and baseline environmental parameters of upstream nodes are traced in the knowledge graph of the flow, and the system deviation matrix is calculated by combining multi-dimensional context attributes. The matrix is then used to perform multi-dimensional vector compensation on the fingerprint vector of the current batch, and a calibrated fingerprint vector is generated. S4. Retrieve the corresponding baseline fingerprint vector in the knowledge graph of the flow, calculate the multidimensional spatial similarity between the calibrated fingerprint vector and the baseline fingerprint vector, and simultaneously verify whether the graph path containing the fingerprint vector of the current batch conforms to the flow sequence logic based on the meta-path semantics. S5. When the multidimensional spatial similarity is lower than the preset tolerance threshold, or the graph path is abnormal, a replacement interception warning is triggered. The replacement interception warning, the underlying raw data for generating the fingerprint vector of the current batch, the version identification code and the system deviation matrix are hashed to generate the evidence storage data structure.
[0006] Furthermore, the multimodal detection data includes near-infrared spectra characterizing internal properties, and images characterizing external morphology, particle texture, and impurity distribution.
[0007] Furthermore, the multidimensional context attributes include a service identifier and physical sensing data containing current device parameters and environmental parameters. Step S2 specifically includes the following steps: S21. Obtain the multi-dimensional context attributes associated with the current flow node, and encapsulate the multi-dimensional context attributes and the current batch fingerprint vector into a target entity; S22. Traverse the candidate entity set in the preset knowledge graph, extract the historical attribute set and historical fingerprint vector corresponding to each candidate entity, and calculate the joint alignment similarity between the current target entity and any candidate entity using a weighted distance model. The calculation formula is as follows:
[0008] In the above formula, This represents the joint alignment similarity between the current target entity and any candidate entity; Represents the fingerprint vector of the current batch; Represents the historical fingerprint vector of the candidate entity; A multidimensional set of context attributes representing the current target entity; Represents the set of historical attributes of candidate entities; This represents the preset vector similarity weights; This represents the preset attribute similarity weights, and satisfies... ; S23. Determine whether the joint alignment similarity is greater than the preset alignment judgment threshold; If so, the current target entity will be merged and updated with the corresponding highest similarity candidate entity; If not, the current target entity will be injected as an independent new node into the preset flow knowledge graph, and a topological association with the global flow link historical entity network will be established based on the business identifier.
[0009] Furthermore, step S3 specifically includes the following steps: S31. In response to the establishment of topological association, traverse upstream along the temporal flow edge in the flow knowledge graph, extract the baseline device parameters and baseline environmental parameters of the corresponding upstream node, and concatenate them to form a baseline perception vector. At the same time, concatenate the device parameters and environmental parameters of the current flow node to form the current perception vector. S32. Based on the current sensing vector and the reference sensing vector, calculate the state difference vector between the current sensing vector and the reference sensing vector. The calculation formula is as follows:
[0010] In the above formula, Represents the state difference vector; Represents the current perception vector; Represents the baseline sensing vector; S33. Using the preset nonlinear mapping function and state difference vector, calculate the system deviation matrix and bias compensation vector. The calculation formula is as follows:
[0011] In the above formula, Represents the system deviation matrix; Represents the bias compensation vector; This represents the preset deviation transfer weight matrix; This represents the preset bias transition weight matrix; Represents a nonlinear activation function; S34. Using the system bias matrix and bias compensation vector, perform a spatial affine transformation on the extracted fingerprint vectors of the current batch to calculate the calibrated fingerprint vectors after eliminating cross-domain heterogeneous interference. The calculation formula is as follows:
[0012] In the above formula, This represents the calibrated fingerprint vector; This represents the fingerprint vector of the current batch.
[0013] Furthermore, step S4 specifically includes the following steps: S41. Retrieve the knowledge graph of the flow, extract the baseline fingerprint vector associated with the target entity, and combine it with the pre-trained feature attention weight vector to calculate the multidimensional similarity between the calibrated fingerprint vector and the baseline fingerprint vector. The calculation formula is as follows:
[0014] In the above formula, This represents the multidimensional similarity between the calibrated fingerprint vector and the baseline fingerprint vector. Represents the baseline fingerprint vector; This represents the calibrated fingerprint vector; Represents the feature attention weight vector; S42. Based on the preset material flow metapath pattern, perform network walk in the flow knowledge graph, extract the association sequence between the upstream benchmark node and the current node, parse the spatiotemporal semantic tags of each flow node in the association sequence, and construct a set of spatiotemporal evolution trajectories containing discrete geographical locations and timestamps. S43. For each pair of adjacent transition nodes in the spatiotemporal evolution trajectory set, extract the physical spatial spherical distance and absolute time difference. Combined with the preset physical vehicle kinematic limit parameters, calculate the temporal logic rationality score of the map path. The calculation formula is as follows:
[0015] In the above formula, The temporal logical rationality score represents the path in the graph. Represents the physical distance between spheres; Indicates the absolute time difference; This represents the total number of transition node pairs in the association sequence; Indicates the first The maximum legal operating speed of the physical vehicle corresponding to each jump node; This represents the preset abnormal attenuation penalty coefficient; This represents the function that takes the maximum value. S44. Using temporal logic rationality scores, the abstract topological features based on meta-path semantic extraction are mapped to the objective physical kinematic domain. The vehicle speed limit is used as the quantitative constraint boundary of spatiotemporal displacement, and the graph relationship walk is transformed into a hard verification of the legality of the flow trajectory.
[0016] Furthermore, step S5 specifically includes the following steps: S51. Extract the absolute time span from the spatiotemporal evolution trajectory set, and calculate the adaptive tolerance threshold by combining it with the inherent physicochemical decay constant of the target material. The calculation formula is as follows:
[0017] In the above formula, This represents the adaptive tolerance threshold. This indicates the preset lower limit threshold for baseline similarity; Indicates the absolute time span; Represents the inherent physicochemical attenuation constant associated with the target material; This represents the residual compensation uncertainty corresponding to the system deviation matrix; in,
[0018] This represents the factory-standard hardware noise figure of the target entity. This represents the root mean square error of the estimate; Indicates the confidence weight of hardware degradation; Indicates the confidence weights for algorithm fitting; S52. Determine the relationship between the multidimensional spatial similarity and the adaptive tolerance threshold, and simultaneously determine the relationship between the temporal logic rationality score and the preset legal topology threshold. If the multidimensional spatial similarity is less than the adaptive tolerance threshold, or the temporal logic rationality score is less than the preset legal topology threshold, a replacement interception warning signal indicating an abnormal flow status is triggered, and the process proceeds to step S53. If the multidimensional spatial similarity is greater than or equal to the adaptive tolerance threshold, and the temporal logic rationality score is greater than or equal to the preset legal topology threshold, it is determined that the current physical state and spatiotemporal evolution trajectory of the target material have legal consistency, a delivery acceptance pass signal is generated, and the process proceeds to step S54. S53. In response to the generation of the replacement interception warning signal, extract the undenoised underlying multidimensional physical parameters of the current batch fingerprint vector, the model version identification code for current feature extraction, and the system bias matrix, and perform cryptographic-based cascade combination calculation of the tamper-proof evidence root hash. The calculation formula is as follows:
[0019] In the above formula, This represents the root hash of tamper-proof evidence; This represents the undenoised underlying multidimensional physical parameters of the current batch of fingerprint vectors; This indicates the model version identification code currently used for feature extraction; Represents the system deviation matrix; This indicates that the interception warning signal will be replaced; Represents an irreversible, collision-resistant hash mapping function; This represents a data feature concatenation operator; The tamper-proof evidence root hash is then chain-signed to generate a tamper-proof time-series associated evidence storage data structure with time-series dependency. S54. In response to the generation of the delivery and acceptance pass signal, the preset smart contract is invoked to register the change of ownership of the target material, and the current target entity, the current batch fingerprint vector and physical perception data are converted into standard time-series knowledge triples and appended to the flow knowledge graph to complete the adaptive topology update of the global flow link historical entity network.
[0020] A grain batch fingerprint comparison system includes a processor and a memory, wherein the memory is used to store a computer program, and the computer program is executed by the processor to implement a grain batch fingerprint comparison method.
[0021] By employing the above technical solution, the present invention provides a knowledge graph-based method for comparing grain batch fingerprints, which has at least the following beneficial effects: 1. While performing multi-dimensional spatial similarity calculation on the retrieved benchmark fingerprint vector, this invention simultaneously verifies whether the graph path containing the fingerprint vector of the current batch conforms to the flow sequence logic based on meta-path semantics. This solves the problem of missed judgment caused by the existing technology being divorced from the real business background, avoids the influence of relying solely on surface numerical calculations on the mining of deep logical anomalies, reduces the false recognition rate of carefully forged behavior, and improves the sensitivity of replacing, intercepting and warning of abnormal batches.
[0022] 2. This invention transforms the batch fingerprint vector extracted after multimodal preprocessing into a target entity along with the multidimensional context attributes of the current flow node, and injects it into a preset flow knowledge graph through an entity alignment mechanism. This avoids the feature bias caused by the existing single static comparison mechanism, prevents the technical defect that the homogeneous replacement recognition rate is directly affected by the similarity of local physical features, and transforms isolated feature data into networked features with topological associations, thereby reducing the data comparison blind spot in complex flow scenarios.
[0023] 3. In response to the establishment of topological association, this invention can accurately trace the reference equipment parameters and reference environmental parameters of upstream nodes, and calculate the system deviation matrix to perform multi-dimensional vector compensation for the fingerprint vectors of the current batch. This overcomes the data drift caused by the non-standardization of acquisition equipment and drastic environmental fluctuations between different nodes, avoids cross-node environmental background noise interference and affects the calculation accuracy of multi-dimensional spatial similarity, reduces the risk of comparison distortion caused by systematic hardware errors, and ensures the benchmark uniformity of the generated calibrated fingerprint vectors.
[0024] 4. When the replacement interception warning is triggered, the present invention not only outputs the warning signal, but also performs full hash encoding on the underlying original data of the interception warning, the generated fingerprint, the version identification code and the system deviation matrix to generate the evidence storage data structure. This avoids the responsibility tracing gap caused by the disappearance or malicious tampering of key original evidence after the abnormal warning occurs, ensures the audit compliance of the warning tracing, and reduces the trust risk of the anti-counterfeiting traceability system under the game of multiple interests. Attached Figure Description
[0025] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a flowchart of the fingerprint comparison method of the present invention. Detailed Implementation
[0026] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. This will allow for a full understanding of how the present application uses technical means to solve technical problems and achieve technical effects, and to facilitate its implementation.
[0027] This invention provides a knowledge graph-based method for comparing grain batch fingerprints, such as... Figure 1 As shown, the method includes: S1. The sensor arrays deployed at each physical node are triggered by the flow control center to synchronously collect multimodal detection data of the target batch of grain under a unified high-precision clock synchronization mechanism. The multimodal detection data includes near-infrared spectra characterizing internal properties (e.g., continuous spectral curves of characteristic absorption peaks of moisture, starch, and crude protein inside the material obtained by a near-infrared spectrometer covering the 900-1700nm band) and images characterizing external morphology, particle texture, and impurity distribution (e.g., high-definition visual images containing material lesions, breakage rate, mold outlines, and impurity mixing ratio captured by a 4K resolution global shutter industrial CCD camera).
[0028] Preprocessing operations, including data cleaning and outlier removal, are performed on the multimodal detection data. Near-infrared spectra are smoothed and abrupt band removal is applied. Specifically, the Savitzky-Golay polynomial smoothing algorithm is used to filter out high-frequency instrument dark current thermal noise, and the spectral derivative is dynamically evaluated to remove abrupt bands of physical signals caused by strong ambient light interference or suspended dust obstruction. Background cropping and spatial registration are performed on surface texture and impurity distribution images. Otsu adaptive thresholding and edge detection operators are used to accurately remove non-material elements such as conveyor belt background and lighting shadows. Affine transformation is used to unify images captured from different angles to a standard observation viewpoint, outputting a scale-aligned purity measurement with high spatial and scale consistency.
[0029] The preprocessed multimodal detection data is input into a multimodal deep learning model for feature fusion. Steady-state features representing the inherent physical properties of the target material are extracted in the shared manifold space. The fused high-dimensional tensor features are then dimensionality-reduced and mapped to the fingerprint vector of the current batch. This enables mutual verification between different physical modes and effectively extracts a set of high-dimensional features representing the inherent biochemical and physical properties of bulk materials.
[0030] S2. Simply extracting feature vectors and performing isolated vector distance calculations is highly susceptible to interference from local environmental fluctuations. By acquiring multi-dimensional contextual attributes associated with the current flow node, these attributes and the current batch fingerprint vector are transformed into target entities. Through an entity alignment mechanism, these entities are injected into a pre-defined flow knowledge graph to construct topological associations. This avoids the local similarity traps that isolated feature calculations can easily lead to in complex supply chains, and provides a structured verification topology to prevent physical substitution between flow nodes.
[0031] In this embodiment, as a preferred implementation method, the implementation steps are as follows: S21. Obtain the multi-dimensional context attributes associated with the current flow node. The multi-dimensional context attributes include business identifiers that represent business logic (such as smart contract waybill number, shipper ID, and carrier license plate number), as well as physical perception data containing current equipment parameters (such as spectrometer model, batch number, and cumulative power-on time of the light source) and environmental parameters (such as atmospheric temperature, absolute humidity, and illuminance at the work site). The multi-dimensional context attributes and the current batch fingerprint vector are encapsulated into a target entity, establishing a traceable context benchmark anchor point for subsequent accurate positioning of physical systemic drift.
[0032] S22. Traverse the candidate entity set in the preset knowledge graph, extract the historical attribute set and historical fingerprint vector corresponding to each candidate entity, and calculate the joint alignment similarity between the current target entity and any candidate entity using a weighted distance model. The calculation formula is as follows:
[0033] The above formula deeply integrates the similarity measure between the continuous physical domain and the discrete business domain, where, This represents the joint alignment similarity between the current target entity and any candidate entity; Represents the fingerprint vector of the current batch; Represents the historical fingerprint vector of the candidate entity; Let represent the L2 norms of the corresponding vectors; A multidimensional set of context attributes representing the current target entity; Represents the set of historical attributes of candidate entities; The potential representing the intersection of two attribute sets; The potential representing the union of two attribute sets; This represents the preset vector similarity weights; This represents the preset attribute similarity weights, and satisfies... This formula allows even two batches of seemingly similar materials to have their overall similarity significantly reduced if there is a logical break in their contextual attributes (such as the spatiotemporal coherence of flow nodes and the state of equipment perception), thus improving the accuracy of counterfeit detection and exposing the disguise.
[0034] S23. Determine whether the joint alignment similarity is greater than the preset alignment judgment threshold; If the joint alignment similarity is greater than the preset alignment judgment threshold, it indicates that the batch of materials has a clear previous flow status in the global map. Then, the current target entity and the corresponding highest similarity candidate entity will be merged and updated to complete the logistics trajectory. If the joint alignment similarity is less than the preset alignment threshold, the current target entity is injected as an independent new node into the preset flow knowledge graph, and a topological association with the global flow link historical entity network is established based on the business identifier. This realizes the dynamic weaving of flow trajectories in the wide area network, transforming disordered logistics data into spatiotemporal physical trajectories with a coherent topological structure.
[0035] S3. The physical systemic drift caused by heterogeneous sensor hardware, factory tolerances, and significant differences in ambient temperature and humidity is the fundamental defect that leads to false positives blocking normal delivery. This step responds to the establishment of topological associations by tracing the baseline device parameters and baseline environmental parameters of upstream nodes in the knowledge graph. Based on the baseline device parameters and baseline environmental parameters, as well as the difference between the device parameters and environmental parameters, a system deviation matrix is calculated. This system deviation matrix is then used to perform multi-dimensional vector compensation on the fingerprint vector of the current batch, generating a calibrated fingerprint vector. This reduces the heterogeneous degradation defects of the underlying sensor hardware in the distributed system.
[0036] In this embodiment, as a preferred implementation method, the implementation steps are as follows: S31. In response to the establishment of topological association, the system traverses upstream along the temporal flow edge in the knowledge graph to extract the reference equipment parameters and reference environmental parameters of the corresponding upstream node, and concatenates them to form a reference perception vector. At the same time, the system concatenates the equipment parameters and environmental parameters of the current flow node to form the current perception vector, thereby realizing the digital restoration of the measurement site environment of the last legal delivery.
[0037] S32. Based on the current sensing vector and the reference sensing vector, calculate the state difference vector between the current sensing vector and the reference sensing vector. Then, using a preset nonlinear mapping function and the state difference vector, calculate the system deviation matrix and the bias compensation vector. The calculation formula is as follows:
[0038] In the above formula, This represents the state difference vector, which accurately and objectively quantifies the differences in physical interferences such as the 20-degree Celsius temperature difference drift caused by inter-provincial transportation and the grating scattering tolerance of different batches of instruments. Represents the current perception vector; Represents the baseline sensing vector; Represents the system deviation matrix; Represents the bias compensation vector; This represents the preset deviation transfer weight matrix; This represents the preset bias transition weight matrix; Represents a nonlinear activation function; S33. After obtaining an accurate error model, the extracted fingerprint vectors of the current batch are subjected to a spatial affine transformation using the system bias matrix and bias compensation vector. The calibrated fingerprint vectors, which eliminate cross-domain heterogeneous interference, are then calculated using the following formula:
[0039] In the above formula, This represents the calibrated fingerprint vector; This represents the fingerprint vector of the current batch.
[0040] S4. In the knowledge graph of the flow, retrieve the benchmark fingerprint vector that uniquely corresponds to the target batch of grain. Using the vector distance metric algorithm, calculate the multidimensional spatial similarity between the calibrated fingerprint vector and the benchmark fingerprint vector. Simultaneously trigger the graph traversal algorithm. Based on the path tracking rules of the fusion meta-path semantics, verify whether the subgraph entity relationship path containing the fingerprint feature vector of the current batch conforms to the predefined physical spatiotemporal flow sequence logic.
[0041] In this embodiment, as a preferred implementation method, the implementation steps are as follows: S41. Retrieve the knowledge graph of the flow, extract the baseline fingerprint vector associated with the target entity, and combine it with the pre-trained feature attention weight vector to calculate the multidimensional similarity between the calibrated fingerprint vector and the baseline fingerprint vector. The calculation formula is as follows:
[0042] In the above formula, This represents the multidimensional similarity between the calibrated fingerprint vector and the baseline fingerprint vector. Represents the baseline fingerprint vector; This represents the calibrated fingerprint vector; This represents the feature attention weight vector used to enhance key physical representation dimensions. It can forcibly amplify those key representation dimensions that represent irreversible changes in the material itself and are extremely difficult to change through physical doping (such as the recombination absorption peaks of certain hidden proteins in the long-wave near-infrared), while moderately weakening dimensions that are easily affected by dust. This represents the Hadamard product operation; The L2 norm of a vector is used to represent the vector's L2 norm.
[0043] S42. Based on the preset material flow metapath pattern, perform network walk in the flow knowledge graph, extract the association sequence connecting the upstream benchmark node and the current node, parse the spatiotemporal semantic tags of each flow node in the association sequence, and construct a set of spatiotemporal evolution trajectories containing discrete geographical locations and timestamps.
[0044] S43. For each pair of adjacent transition nodes in the spatiotemporal evolution trajectory set, extract the physical spatial spherical distance and absolute time difference. Combined with the preset physical vehicle kinematic limit parameters, calculate the temporal logic rationality score of the map path. The calculation formula is as follows:
[0045] In the above formula, The temporal logical rationality score represents the path in the graph. Represents the physical distance between spheres; Indicates the absolute time difference; This represents the total number of transition node pairs in the association sequence; Indicates the first The maximum legal operating speed of the physical vehicle corresponding to each jump node; This represents the preset abnormal attenuation penalty coefficient; This represents the function that takes the maximum value. If the calculated segmented movement speed deviates from common sense (e.g., a heavy-duty truck reaching the cruising speed of an airplane at 800 km / h, which usually means that the logistics information has been tampered with online or that a fake trajectory has been fabricated), the difference exceeding the vehicle's maximum physical speed limit will be... It is activated in the function and subject to a preset abnormal decay penalty coefficient. The negative exponential domain amplifies the signal dramatically, causing the legitimacy score of that trajectory to plummet to near zero.
[0046] S44. By using temporal logic rationality scores, the abstract topological features based on meta-path semantic extraction are mapped to the objective physical kinematic domain. The vehicle speed limit is used as the quantitative constraint boundary of spatiotemporal displacement. The graph relationship walk is transformed into a flow trajectory legality hard verification subject to the real physical causal law, thereby preventing network hackers from attempting to forge false logistics trajectories by tampering with local area network timestamps.
[0047] S5. During the natural circulation of agricultural products (especially grains) over several months and across multiple climate zones, the natural evaporation of moisture and the oxidative degradation of crude protein within the material are unstoppable unidirectional processes. If a rigid, static high threshold is stubbornly adopted in the delivery judgment, a large amount of real material that has undergone a normal aging cycle will inevitably be misjudged and rejected by the system.
[0048] When it is determined that the multidimensional spatial similarity is lower than the adaptive tolerance threshold dynamically output by the preset delivery inspection rules, or when it is evaluated that the subgraph entity relationship path deviates from the physical spatiotemporal legal flow sequence logic and the graph association is abnormal, a batch replacement interception warning signal is triggered. The underlying raw data, version identification code, and system deviation matrix of the replacement interception warning and the generation of the current batch fingerprint vector are hash-encoded to generate the evidence storage data structure.
[0049] In this embodiment, as a preferred implementation method, the implementation steps are as follows: S51. Extract the absolute time span from the spatiotemporal evolution trajectory set, and calculate the adaptive tolerance threshold by combining it with the inherent physicochemical decay constant of the target material. The calculation formula is as follows:
[0050] In the above formula, This represents the adaptive tolerance threshold. This indicates the preset lower limit threshold for baseline similarity; Indicates the absolute time span; Represents the inherent physicochemical attenuation constant associated with the target material; This represents the residual compensation uncertainty corresponding to the system deviation matrix; in, , This represents the factory-standard hardware noise figure of the target entity. This represents the root mean square error of the estimate; Indicates the confidence weight of hardware degradation; This represents the confidence weights for algorithm fitting.
[0051] S52. Determine the relationship between the multidimensional spatial similarity and the adaptive tolerance threshold, and simultaneously determine the relationship between the temporal logic rationality score and the preset legal topology threshold. If the multidimensional spatial similarity is less than the adaptive tolerance threshold, or the temporal logic rationality score is less than the preset legal topology threshold (meeting either condition), a replacement interception warning signal indicating an abnormal flow status is triggered, and the process proceeds to step S53. If the multidimensional spatial similarity is greater than or equal to the adaptive tolerance threshold, and the temporal logic rationality score is greater than or equal to the preset legal topology threshold (both must be met simultaneously), it is determined that the current physical state and spatiotemporal evolution trajectory of the target material have legal consistency, a delivery acceptance pass signal is generated, and the process proceeds to step S54. S53. Traditional traceability systems often only generate one error log after an alarm, which is easily overwritten if attacked. In response to the generation of the replacement interception warning signal, the system extracts the undenoised underlying multidimensional physical parameters of the current batch fingerprint vector, the model version identification code for current feature extraction, and the system deviation matrix. It then performs a cryptographic-based cascaded combination calculation of the tamper-proof evidence root hash, using the following formula:
[0052] In the above formula, This represents the root hash of tamper-proof evidence; This represents the undenoised underlying multidimensional physical parameters of the current batch of fingerprint vectors; This indicates the model version identification code currently used for feature extraction; Represents the system deviation matrix; This indicates that the interception warning signal will be replaced; Represents an irreversible, collision-resistant hash mapping function; This represents a data feature concatenation operator; Subsequently, the tamper-proof evidence root hash is chain-signed to generate a tamper-proof time-series associated evidence data structure with time-series dependency, and persistently written into the node ledger of the distributed storage medium. S54. In response to the generation of the delivery and acceptance pass signal, the preset smart contract is invoked to register the change of ownership of the target material, and the current target entity, the current batch fingerprint vector and physical perception data are converted into standard time-series knowledge triples and appended to the flow knowledge graph to complete the adaptive topology update of the global flow link historical entity network.
[0053] The fingerprint comparison method is implemented as follows: First, multimodal detection data of the target material is synchronously collected and adaptively denoised. A high-fidelity current fingerprint vector is mapped through cross-modal feature fusion. Then, multidimensional contextual attributes containing physical sensing data are extracted and encapsulated in the target entity. This is then injected into the knowledge graph through a weighted attribute joint alignment mechanism to construct a topological association. Next, in response to the establishment of the topological association, the upstream benchmark sensing state is traced back and a system deviation operator is dynamically synthesized. This allows for a high-dimensional affine transformation of the current fingerprint to compensate for cross-node physical optoelectronic hardware tolerances. Furthermore, the weighted spatial similarity between the calibration fingerprint and the graph benchmark is calculated, and a temporal robustness check, constrained by objective physical causality, is performed on the graph metapath based on the vehicle's kinematic limits. Finally, the system introduces an adaptive tolerance based on the material's natural decay law to perform spatiotemporal dual-track anti-counterfeiting judgment. In abnormal states, the undenoised underlying data and deviation operators are instantaneously extracted for tamper-proof hash concatenation. In legitimate states, the smart contract is driven to automatically confirm ownership and trigger the adaptive evolution of the graph benchmark.
[0054] The present invention also provides a knowledge graph-based grain batch fingerprint comparison system, including a processor and a memory, wherein the memory is used to store a computer program, and the computer program, when executed by the processor, implements a knowledge graph-based grain batch fingerprint comparison method.
[0055] Those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0056] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. Since the above embodiments are substantially similar to the method embodiments, their descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0057] The above embodiments provide a detailed description of the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for comparing the fingerprints of grain batches based on knowledge graphs, characterized in that, The method includes the following steps: S1. Collect multimodal detection data of the target batch of grain and preprocess it. Input the preprocessed multimodal detection data into the multimodal deep learning model for feature fusion, extract steady-state features and map them into the fingerprint vector of the current batch. S2. Obtain the multi-dimensional context attributes associated with the current flow node, convert them and the current batch fingerprint vector into target entities, and inject them into the preset flow knowledge graph through the entity alignment mechanism to build topological associations; S3. In response to the establishment of topological associations, the baseline equipment parameters and baseline environmental parameters of upstream nodes are traced in the knowledge graph of the flow, and the system deviation matrix is calculated by combining multi-dimensional context attributes. The matrix is then used to perform multi-dimensional vector compensation on the fingerprint vector of the current batch, and a calibrated fingerprint vector is generated. S4. Retrieve the corresponding baseline fingerprint vector in the knowledge graph of the flow, calculate the multidimensional spatial similarity between the calibrated fingerprint vector and the baseline fingerprint vector, and simultaneously verify whether the graph path containing the fingerprint vector of the current batch conforms to the flow sequence logic based on the meta-path semantics. S5. When the multidimensional spatial similarity is lower than the preset tolerance threshold, or the graph path is abnormal, a replacement interception warning is triggered. The replacement interception warning, the underlying raw data for generating the fingerprint vector of the current batch, the version identification code and the system deviation matrix are hashed to generate the evidence storage data structure.
2. The fingerprint comparison method according to claim 1, characterized in that, The multimodal detection data includes near-infrared spectra characterizing internal properties, and images characterizing external morphology, particle texture, and impurity distribution.
3. The fingerprint comparison method according to claim 1, characterized in that, The multidimensional context attributes include a service identifier and physical sensing data containing current device parameters and environmental parameters. Step S2 specifically includes the following steps: S21. Obtain the multi-dimensional context attributes associated with the current flow node, and encapsulate the multi-dimensional context attributes and the current batch fingerprint vector into a target entity; S22. Traverse the candidate entity set in the preset knowledge graph, extract the historical attribute set and historical fingerprint vector corresponding to each candidate entity, and calculate the joint alignment similarity between the current target entity and any candidate entity using a weighted distance model. The calculation formula is as follows: ; In the above formula, This represents the joint alignment similarity between the current target entity and any candidate entity; Represents the fingerprint vector of the current batch; Represents the historical fingerprint vector of the candidate entity; A multidimensional set of context attributes representing the current target entity; Represents the set of historical attributes of candidate entities; This represents the preset vector similarity weights; This represents the preset attribute similarity weights, and satisfies... ; S23. Determine whether the joint alignment similarity is greater than the preset alignment judgment threshold; If so, the current target entity will be merged and updated with the corresponding highest similarity candidate entity; If not, the current target entity will be injected as an independent new node into the preset flow knowledge graph, and a topological association with the global flow link historical entity network will be established based on the business identifier.
4. The fingerprint comparison method according to claim 1, characterized in that, Step S3 specifically includes the following steps: S31. In response to the establishment of topological association, traverse upstream along the temporal flow edge in the flow knowledge graph, extract the baseline device parameters and baseline environmental parameters of the corresponding upstream node, and concatenate them to form a baseline perception vector. At the same time, concatenate the device parameters and environmental parameters of the current flow node to form the current perception vector. S32. Based on the current sensing vector and the reference sensing vector, calculate the state difference vector between the current sensing vector and the reference sensing vector. The calculation formula is as follows: ; In the above formula, Represents the state difference vector; Represents the current perception vector; Represents the baseline sensing vector; S33. Using the preset nonlinear mapping function and state difference vector, calculate the system deviation matrix and bias compensation vector. The calculation formula is as follows: ; ; In the above formula, Represents the system deviation matrix; Represents the bias compensation vector; This represents the preset deviation transfer weight matrix; This represents the preset bias transition weight matrix; Represents a nonlinear activation function; S34. Using the system bias matrix and bias compensation vector, perform a spatial affine transformation on the extracted fingerprint vectors of the current batch to calculate the calibrated fingerprint vectors after eliminating cross-domain heterogeneous interference. The calculation formula is as follows: ; In the above formula, This represents the calibrated fingerprint vector; This represents the fingerprint vector of the current batch.
5. The fingerprint comparison method according to claim 1, characterized in that, Step S4 specifically includes the following steps: S41. Retrieve the knowledge graph of the flow, extract the baseline fingerprint vector associated with the target entity, and combine it with the pre-trained feature attention weight vector to calculate the multidimensional similarity between the calibrated fingerprint vector and the baseline fingerprint vector. The calculation formula is as follows: ; In the above formula, This represents the multidimensional similarity between the calibrated fingerprint vector and the baseline fingerprint vector. Represents the baseline fingerprint vector; This represents the calibrated fingerprint vector; Represents the feature attention weight vector; S42. Based on the preset material flow metapath pattern, perform network walk in the flow knowledge graph, extract the association sequence between the upstream benchmark node and the current node, parse the spatiotemporal semantic tags of each flow node in the association sequence, and construct a set of spatiotemporal evolution trajectories containing discrete geographical locations and timestamps. S43. For each pair of adjacent transition nodes in the spatiotemporal evolution trajectory set, extract the physical space spherical distance and absolute time difference, and calculate the temporal logic rationality score of the map path by combining the preset physical vehicle kinematic limit parameters. S44. Using temporal logic rationality scores, the abstract topological features based on meta-path semantic extraction are mapped to the objective physical kinematic domain. The vehicle speed limit is used as the quantitative constraint boundary of spatiotemporal displacement, and the graph relationship walk is transformed into a hard verification of the legality of the flow trajectory.
6. The fingerprint comparison method according to claim 5, characterized in that, The formula for calculating the temporal logic rationality score of the graph path is as follows: ; In the above formula, The temporal logical rationality score represents the path in the graph. Represents the physical distance between spheres; Indicates the absolute time difference; This represents the total number of transition node pairs in the association sequence; Indicates the first The maximum legal operating speed of the physical vehicle corresponding to each jump node; This represents the preset abnormal attenuation penalty coefficient; This represents the function that takes the maximum value.
7. The fingerprint comparison method according to claim 1, characterized in that, Step S5 specifically includes the following steps: S51. Extract the absolute time span from the spatiotemporal evolution trajectory set, and calculate the adaptive tolerance threshold by combining it with the inherent physicochemical decay constant of the target material. The calculation formula is as follows: ; In the above formula, This represents the adaptive tolerance threshold. This indicates the preset lower limit threshold for baseline similarity; Indicates the absolute time span; Represents the inherent physicochemical attenuation constant associated with the target material; This represents the residual compensation uncertainty corresponding to the system deviation matrix; in, ; This represents the factory-standard hardware noise figure of the target entity. This represents the root mean square error of the estimate; Indicates the confidence weight of hardware degradation; Indicates the confidence weights for algorithm fitting; S52. Determine the relationship between the multidimensional spatial similarity and the adaptive tolerance threshold, and simultaneously determine the relationship between the temporal logic rationality score and the preset legal topology threshold. If the multidimensional spatial similarity is less than the adaptive tolerance threshold, or the temporal logic rationality score is less than the preset legal topology threshold, a replacement interception warning signal indicating an abnormal flow status is triggered, and the process proceeds to step S53. If the multidimensional spatial similarity is greater than or equal to the adaptive tolerance threshold, and the temporal logic rationality score is greater than or equal to the preset legal topology threshold, it is determined that the current physical state and spatiotemporal evolution trajectory of the target material have legal consistency, a delivery acceptance pass signal is generated, and the process proceeds to step S54. S53. In response to the generation of the replacement interception warning signal, extract the undenoised underlying multidimensional physical parameters of the current batch fingerprint vector, the model version identification code for current feature extraction, and the system bias matrix, and calculate the tamper-proof evidence root hash based on cryptographic cascade combination. The calculation formula is as follows: ; In the above formula, This represents the root hash of tamper-proof evidence; This represents the undenoised underlying multidimensional physical parameters of the current batch of fingerprint vectors; This indicates the model version identification code currently used for feature extraction; Represents the system deviation matrix; This indicates that the interception warning signal will be replaced; Represents an irreversible, collision-resistant hash mapping function; This represents a data feature concatenation operator; The tamper-proof evidence root hash is then chain-signed to generate a tamper-proof time-series associated evidence storage data structure with time-series dependency. S54. In response to the generation of the delivery and acceptance pass signal, the preset smart contract is invoked to register the change of ownership of the target material, and the current target entity, the current batch fingerprint vector and physical perception data are converted into standard time-series knowledge triples and appended to the flow knowledge graph to complete the adaptive topology update of the global flow link historical entity network.
8. A fingerprint comparison system for grain batches as described in any one of claims 1-7, characterized in that, It includes a processor and a memory, the memory being used to store a computer program, which, when executed by the processor, implements the grain batch fingerprint comparison method as described in any one of claims 1-7.