A method for tracing cross-border trade transportation based on blockchain technology
By employing zero-copy compact binary memory representation layout, shared memory pool, and frequency domain filtering technology, the problem of memory copying and deserialization during high-concurrency access of multi-source heterogeneous data in cross-border trade transportation is solved, achieving low-latency processing of customs clearance compliance verification and improving the real-time performance and data processing efficiency of cross-border trade transportation.
Patent Information
- Application Number
- CN202611319135.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-28
- Publication Date
- 2026-11-17
AI Technical Summary
In cross-border trade and transportation, the multi-source heterogeneous data generates a large amount of redundant memory copying and deserialization overhead when accessed at high concurrency. This causes the end-to-end processing delay of customs clearance and compliance verification to increase quadratically with the sequence length, which seriously affects real-time performance.
It adopts a zero-copy compact binary memory representation layout and a shared memory pool, combined with shared key-value caching and frequency domain filtering technology to reduce memory fragmentation and redundant computation. Through orthogonal random feature kernel mapping and ant colony path optimization algorithm, it achieves fast compliance verification and evidence storage of data.
It effectively eliminates redundant memory allocation and deserialization overhead, reduces memory usage and computational complexity, and enables the computational load of the customs clearance compliance verification model to increase linearly with the sequence length when processing long sequences, thereby improving the real-time performance and data processing efficiency of cross-border trade transportation.
Smart Images

Figure CN123117965A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of blockchain technology, and more specifically, relates to a method for tracing cross-border trade transportation based on blockchain technology. Background Technology
[0002] In the field of cross-border trade and transportation traceability, existing technologies typically employ a method of independently parsing sea, land, and air waybills, customs declaration data, and cold chain sensor data before aggregating and processing them. Each data source must independently allocate memory space and perform a complete deserialization operation upon access, generating its own intermediate data structure before being sent to the compliance verification model. Under high-concurrency, multi-source data access conditions, due to significant differences in field formats, encoding standards, and sampling frequencies among the data sources, existing systems must perform format conversion and memory copying with each data frame arrival, leading to severe memory fragmentation and frequent garbage collection triggers, further exacerbating end-to-end processing latency. Especially when the customs clearance compliance verification model needs to perform dual-stream attention calculations on long sequences of documents, the computational complexity of the traditional fully connected attention mechanism increases quadratically with the sequence length. This results in a simultaneous surge in memory consumption and computing power consumption under conditions of concurrent verification of large batches of documents, preventing verification nodes from completing compliance determinations within the effective time window and severely restricting the real-time performance of end-to-end traceability. In other words, existing technologies suffer from the technical problem that when cross-border trade and transportation data from multiple sources are accessed at high concurrency, a large amount of redundant memory copying and deserialization overhead is generated, resulting in the end-to-end processing delay of customs clearance and compliance verification increasing quadratically with the sequence length. Summary of the Invention
[0003] In view of this, the present invention provides a method for tracing cross-border trade transportation based on blockchain technology, which can solve the technical problem in the prior art where a large amount of redundant memory copying and deserialization overhead is generated when multi-source heterogeneous data in cross-border trade transportation is accessed at high concurrency, resulting in the end-to-end processing delay of customs clearance compliance verification increasing quadratically with the sequence length.
[0004] This invention is implemented as follows: This invention provides a method for tracing cross-border trade transportation based on blockchain technology, comprising the following steps:
[0005] Collect sea, land, and air waybills, customs declarations, and cold chain sensor data; construct a zero-copy compact binary memory representation layout; perform high-speed alignment of multi-source structured and unstructured fields based on a shared memory pool; and generate a unified format of raw data frame sequences.
[0006] The original data frame sequence is input into the customs clearance compliance verification model, compliance verification is performed, the customs clearance compliance confidence vector and semantic conflict marker are output, and the verification result is written into the blockchain consensus queue.
[0007] The cold chain sensor data is subjected to orthogonal Fourier basis projection. Based on the energy spectral density distribution, periodic high-frequency noise is filtered out by a learnable bandpass frequency domain filter. The core low-frequency energy coefficients are then input into the frequency domain feature attention layer. After inverse transformation and restoration, a summary of cargo structural damage features is generated and written to the blockchain node.
[0008] A recursive cumulative state proof and local rolling window verification mechanism is adopted for the full historical state of cross-border transportation nodes. Based on the state transition invariant, the historical redundant verification path is pruned to reduce the computation time of verification nodes.
[0009] When port congestion or geopolitical dynamics lead to route changes, a dynamic subgraph local rewriting algorithm is adopted to reconstruct the reachability matrix only within the local star topology affected by the disturbed port, and synchronize the updated results to the blockchain topology state for evidence storage.
[0010] Before data enters the consensus queue, it passes through a micro-behavioral filtering layer to filter out dynamically abnormal data based on the laws of physical motion conservation and the entropy increase rule of state transition. On-chain consensus and final notarization are then performed on the filtered data to complete the full-chain traceability record.
[0011] Specifically, the zero-copy compact binary memory representation layout refers to the practice of not performing additional data copying operations on multi-source data in memory, but directly locating and aligning the offsets of each field in the shared memory pool in a compact binary format, thereby eliminating redundant memory allocation during deserialization and reducing the frequency of garbage collection.
[0012] The shared memory pool specifically refers to a pre-allocated fixed-capacity memory area. Multiple data source read and write operations share the same memory pool address space. The location mapping between structured fields and unstructured fields is completed through a field offset index table, avoiding the fragmentation overhead caused by each data source independently requesting memory.
[0013] The customs clearance compliance verification model is a deep learning-based linear kernelized dual-stream interaction and shared key-value cache fusion frequency domain filtering model. The input end is set with a dual-stream orthogonal decoupled projection layer. The first stream receives structured document data and the second stream receives unstructured inspection image and text data. The core layer uses orthogonal random feature kernel mapping to linearly approximate the traditional bidirectional attention mechanism, reducing the computational complexity of attention from quadratic to linear.
[0014] Among them, a shared key-value pair cache compression module is set between adjacent transformer layers, adjacent operation layers directly reuse the key-value representations already calculated at the bottom layer, the activation transfer weights between neurons are bound between shallow transformers and deep transformers with a shared parameter matrix, the feature transfer between layers is directly connected through cross-layer residual bypass, and the iteration step size of the data loop is dynamically adjusted according to the variance of the customs clearance compliance confidence vector.
[0015] Among them, video memory allocation is dynamically calculated by the video memory allocation adjustment function based on the length of the current batch of data frames; memory allocation is dynamically scaled within the range of the lower and upper limits of memory based on the shared key-value pair cache hit rate; and hierarchical allocation is based on the ratio of the activation entropy values of the shallow and deep transformers to allocate computing resources.
[0016] Specifically, the memory allocation adjustment function refers to: assuming the average length of the current batch of data frame sequences is... The current level activation entropy ratio is Video memory allocation coefficient in accordance with Segmentation threshold , , Segmentation determination, The value is used as a scaling factor multiplied by the baseline value of the single-layer memory limit to dynamically allocate the memory capacity required for the current batch; when When the entropy value is below the baseline threshold, the hierarchical allocation strategy tilts towards shallow transformers, compressing deep computing resources.
[0017] The network incorporates a multi-level self-looping feedback mechanism, encoding customs rule base constraints and import / export tariff conservation laws as adaptive penalty terms, which are directly embedded as scaling factors into the bias term of the attention kernel matrix. The information flow control layer employs a gating unit that directly outputs compliance assertions when the maximum component of the clearance compliance confidence vector exceeds the confidence threshold, through a cross-sequence hint prefix cache reuse mechanism. When semantic conflict markers appear between the declared product category and the freight trajectory, the gating unit activates a long-span residual bypass adaptive scaling fusion channel, executing multiple rounds of nonlinear dynamic iterative inference.
[0018] The customs clearance compliance verification model also integrates an ant colony path optimization algorithm, which is used to perform pheromone-guided heuristic search on the reachability matrix reconstruction path within the local star topology during the dynamic subgraph local rewriting process, thereby accelerating the convergence of the optimal path. The ant colony path optimization algorithm uses each reachable path within the local star topology as the ant search space, and the reciprocal of the product of path length and time delay as the heuristic factor. The pheromone is updated by positive feedback evaporation based on the optimal path in each round of search results.
[0019] Specifically, the recursive cumulative state proof refers to the gradual accumulation of all historical node states into a concise state summary in a recursive manner. Each time a new node state is added, only the incremental operation needs to be performed based on the previous state summary, without recalculating the entire history, thereby reducing the verification computation complexity from superlinear to near-linear.
[0020] Specifically, the local rolling window verification mechanism refers to performing a complete verification only on the node state within the most recent time range. Historical states outside the window are replaced by recursive cumulative state proofs. The window length is determined by measuring the verification time under different historical chain lengths and analyzing the inflection point.
[0021] Specifically, the dynamic subgraph local rewriting algorithm refers to identifying only the local star-shaped subgraphs directly associated with the disturbed ports in the global transportation topology graph, reconstructing the reachability matrix within the subgraphs, updating the reachability relationships between local nodes, avoiding the overall recalculation of the global topology, and making the path recalculation cost positively correlated with the number of disturbed nodes.
[0022] Specifically, the local star topology refers to a one-hop neighborhood subgraph structure with the disturbed port node as the central node and the port nodes directly adjacent to the central node as leaf nodes.
[0023] Specifically, the micro-behavior filtering layer refers to a pre-filtering module set up before data enters the blockchain consensus queue. It verifies the conservation relationship between acceleration, displacement and strain of sensor data based on the law of conservation of physical motion, and calculates the entropy increment during the state transition process. Data frames with abnormal entropy increments or violations of physical conservation relationships are marked as dynamic abnormal data and discarded.
[0024] The confidence threshold is determined by performing a grid search experiment on different candidate threshold values on the validation set, with the objective of maximizing the harmonic mean of recall and precision. The search range is 0.70–0.95. The suggested range for the window length is 32–128 nodes. The lower limit for memory is 16. The maximum memory limit is 512. The pheromone evaporation coefficient of the ant colony path optimization algorithm ranges from 0.05 to 0.30; segmentation threshold. The initial range is 128 to 256. The initial range is 256 to 512. The initial range is 512 to 1024.
[0025] This invention eliminates redundant memory allocation and deserialization overhead during multi-source data access by constructing a zero-copy compact binary memory representation layout and a shared memory pool. This allows fields from various data sources to be aligned directly within a unified memory address space, significantly reducing the frequency of garbage collection. Furthermore, this invention employs orthogonal random feature kernel mapping to linearly approximate the two-stream attention mechanism, reducing the computational complexity of attention from quadratic to linear. This enables the computational load of the customs clearance compliance verification model to increase linearly with the sequence length when processing long-sequence documents, fundamentally alleviating the memory bottleneck. Shared key-value pair caching compression technology further eliminates the need for adjacent transformer layers to repeatedly perform linear projection, reducing the computational overhead of redundant forward propagation. The frequency domain filtering submodule filters out high-frequency noise before sensor data enters the attention calculation, improving the signal-to-noise ratio of cargo damage features and ensuring the data quality of on-chain evidence storage. In summary, this invention solves the technical problem mentioned in the background art: the generation of a large amount of redundant memory copying and deserialization overhead during high-concurrency access of multi-source heterogeneous data in cross-border trade transportation leads to a quadratic increase in end-to-end processing latency for customs clearance compliance verification with the sequence length. Attached Figure Description
[0026] Figure 1 This is a flowchart of the method of the present invention.
[0027] Figure 2 A schematic diagram of the customs clearance compliance verification model structure.
[0028] Figure 3 A comparison of the energy spectral density distribution of cold chain sensors at each transportation node before and after frequency domain filtering.
[0029] Figure 4 This is a graph showing the trend of node single-verification time changing with the increase of historical chain length.
[0030] Figure 5 This is a schematic diagram of local star-shaped topology reconstruction using the dynamic subgraph local rewriting algorithm.
[0031] Figure 6 This is a schematic diagram of the abnormal data detection process for the micro-behavioral filtering layer.
[0032] Figure 7 A schematic diagram illustrating the blockchain evidence storage timeline for end-to-end traceability.
[0033] Figure 8 This is a graph showing the convergence curve of the optimal path cost in each iteration of the ant colony path optimization algorithm. Detailed Implementation
[0034] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below.
[0035] like Figure 1 The diagram shown is a flowchart of a cross-border trade transportation traceability method based on blockchain technology provided by the present invention. This method includes the following steps:
[0036] S01. Collect sea, land and air waybills, customs declarations and cold chain sensor data, construct a zero-copy compact binary memory representation layout, perform high-speed alignment of multi-source structured fields and unstructured fields based on a shared memory pool, and generate a unified format of raw data frame sequence.
[0037] S02. Input the original data frame sequence into the customs clearance compliance verification model, perform compliance verification, output the customs clearance compliance confidence vector and semantic conflict marker, and write the verification result into the blockchain consensus queue.
[0038] S03. Perform orthogonal Fourier basis projection on the cold chain sensor data. Based on the energy spectral density distribution, filter out periodic high-frequency noise through a learnable bandpass frequency domain filter. Input the retained core low-frequency energy coefficients into the frequency domain feature attention layer. Perform inverse transformation to restore and generate a summary of cargo structural damage features, and write it into the blockchain node.
[0039] S04. A recursive cumulative state proof and local rolling window verification mechanism is adopted for the full historical state of cross-border transportation nodes. Based on the state transition invariant, the historical redundant verification path is pruned to reduce the computation time of verification nodes.
[0040] S05. When port congestion or geopolitical dynamics cause route changes, a dynamic subgraph local rewrite algorithm is adopted to reconstruct the reachability matrix only within the local star topology affected by the disturbed port, and the update results are synchronized to the blockchain topology state for evidence storage.
[0041] S06. Before the data enters the consensus queue, the micro-behavior filtering layer filters out dynamic abnormal data according to the law of conservation of physical motion and the entropy increase rule of state transition. On-chain consensus and final notarization are performed on the filtered data to complete the full-link traceability record.
[0042] The zero-copy compact binary memory representation layout refers to the direct location and alignment of field offsets in the shared memory pool in a compact binary format without performing additional data copying operations on multi-source data in memory. This eliminates redundant memory allocation during deserialization and significantly reduces the frequency of garbage collection.
[0043] The shared memory pool refers to a pre-allocated fixed-capacity memory area. Multiple data source read and write operations share the same memory pool address space. The location mapping between structured fields and unstructured fields is completed through a field offset index table, avoiding the fragmentation overhead caused by each data source independently requesting memory.
[0044] The customs clearance compliance verification model is a deep learning-based model that fuses linear kernelized two-stream interaction and shared key-value caching with frequency domain filtering for customs clearance compliance verification. Figure 2 As shown, the specific structure of the model is as follows: A dual-stream orthogonal decoupled projection layer is set at the input end. The first stream receives structured document data, and the second stream receives unstructured inspection image and text data. Both streams are mapped to the same-dimensional feature space via linear projection matrices, performing spatial orthogonal decoupling to generate dual-path multidimensional feature streams. The core layer uses orthogonal random feature kernel mapping to linearly approximate the traditional bidirectional attention mechanism, reducing the computational complexity of attention from quadratic to linear, avoiding the generation of a fully connected correlation matrix. A shared key-value pair cache compression module is set between adjacent transformer layers. Adjacent computation layers directly reuse the key-value representations already calculated at the bottom layer, skipping redundant linear projections. The activation transfer weights between neurons are bound between shallow and deep transformers using a shared parameter matrix. Feature transfer between layers is directly connected through cross-layer residual bypasses. The iteration step size of the data loop is dynamically adjusted based on the variance of the customs clearance compliance confidence vector. Memory allocation is dynamically calculated by a memory allocation adjustment function based on the current batch data frame length. Memory allocation is based on a shared key-value pair cache hit rate of 16... Up to 512 The system dynamically scales within its range, allocating computational resources based on the ratio of activation entropy values between shallow and deep transformers. A multi-level self-looping feedback mechanism is implemented within the network, encoding customs rule base constraints and import / export tariff conservation laws as adaptive penalty terms, which are directly embedded as bias terms in the attention kernel matrix as scaling factors. The information flow control layer includes a gating unit; when the maximum component of the compliance confidence vector for the preceding document comparison exceeds the confidence threshold, a compliance assertion is directly output through a cross-sequence hint prefix cache reuse mechanism. When semantic conflicts occur between the declared product category and the freight trajectory, the gating unit activates a long-span residual bypass adaptive scaling fusion channel, executing multiple rounds of nonlinear dynamic iterative inference. The frequency domain processing submodule incorporates the pre-projection stage of the attention mechanism, performing orthogonal Fourier basis projection on high-frequency data from cold chain sensors within a time window. Based on the energy spectral density distribution, periodic high-frequency noise is filtered out by a learnable bandpass frequency domain filter. The core low-frequency energy coefficients undergo lightweight complex dot product operations in the frequency domain feature attention layer, replacing the time-domain fully connected computation. After inverse transformation to restore to the time domain, the error gradient... The predictive operator compensates for spectral truncation loss and generates an immutable on-chain micro-state summary of cargo structural damage characteristics. The customs clearance compliance verification model also integrates an ant colony path optimization algorithm, which is used to perform pheromone-guided heuristic search for the path reconstruction of the reachability matrix within the local star topology during the local rewriting process of dynamic subgraphs, accelerating the convergence of the optimal path. The steps for establishing the training dataset of the customs clearance compliance verification model specifically include: collecting historical cross-border trade contract texts, tax number records, customs declaration documents, cold chain sensor time series data, and port congestion event logs; preprocessing structured documents and unstructured graphics and text in a dual-stream format; labeling compliance assertion tags and semantic conflict markers; constructing multimodal heterogeneous training sample pairs; and dividing the training set, validation set, and test set in an 8:1:1 ratio. The steps for training the customs clearance compliance verification model specifically include: using the weighted sum of cross-entropy loss and adaptive penalty term as the total loss function; using an adaptive moment estimation optimizer to iteratively update all parameters; and executing an early stopping strategy on the validation set based on the convergence state of the mean of the customs clearance compliance confidence vector to complete model convergence.
[0045] The technical effects of the customs clearance compliance verification model are as follows: the linear kernelized attention mechanism replaces the calculation of the fully connected association matrix with the kernel mapping inner product, so that the computational amount of the attention layer when processing long sequence documents increases linearly with the sequence length rather than quadratically, fundamentally alleviating the memory and computing power bottleneck; the shared key-value pair caching compression technology eliminates the need for adjacent layers to repeatedly perform linear projection, reducing redundant forward propagation; the frequency domain filtering submodule filters out sensor noise before it enters the attention calculation, improving the signal-to-noise ratio of cargo structural damage features; the ant colony path optimization algorithm guides the path reconstruction of the reachable matrix to converge quickly to the local optimum through the pheromone positive feedback mechanism, avoiding the combinatorial explosion of enumerating global paths, and keeping the path search cost of dynamic subgraph rewriting nearly linear with the number of disturbed nodes.
[0046] The memory allocation adjustment function is defined as follows: Let the average length of the current batch of data frame sequences be... The current level activation entropy ratio is Then the memory allocation coefficient The segmentation is determined by the following segmentation rules: when hour, ;when hour, ;when hour, ;when hour, ;in , , Three segmented thresholds are proposed, with initial ranges of 128–256, 256–512, and 512–1024 respectively. Specific values are determined through multiple experiments on peak memory usage and inference latency at different batch lengths, followed by piecewise regression analysis of the experimental data. The value is used as a scaling factor multiplied by the baseline value of the single-layer video memory limit to dynamically allocate the video memory capacity required for the current batch, so that the video memory utilization rate is adaptively matched with the data scale; when When the entropy value is below the baseline threshold, the hierarchical allocation strategy is tilted towards shallow transformers, compressing deep computational resources. It is recommended that the baseline threshold be determined by taking the sum of the mean and standard deviation of the activation entropy distribution of each layer on the training set.
[0047] The recursive cumulative state proof refers to the gradual accumulation of all historical node states into a concise state summary in a recursive manner. Each time a new node state is added, only the incremental operation needs to be performed based on the previous state summary, without recalculating the entire history, thereby reducing the verification computation complexity from superlinear to near-linear.
[0048] The local rolling window verification mechanism refers to performing a complete verification only on the node state within the most recent time range. Historical states outside the window are replaced by recursive cumulative state proofs. The window length is recommended to be determined by measuring the verification time under different historical chain lengths and analyzing the inflection point. The recommended range is 32 to 128 nodes.
[0049] The state transition invariant refers to the conservation constraint that must be satisfied for a node state to legally transition in the entire cross-border transportation chain. Any historical state path that does not satisfy the invariant is pruned and does not need to be included in subsequent verification calculations.
[0050] The dynamic subgraph local rewriting algorithm refers to identifying only the local star-shaped subgraphs directly associated with the disturbed ports in the global transportation topology graph, reconstructing the reachability matrix within the subgraphs, updating the reachability relationships between local nodes, avoiding the overall recalculation of the global topology, and making the path recalculation cost positively correlated with the number of disturbed nodes rather than with the total number of global nodes.
[0051] The local star topology refers to a one-hop neighborhood subgraph structure with the disturbed port node as the central node and the port nodes directly adjacent to the central node as leaf nodes.
[0052] The micro-behavior filtering layer refers to a pre-filtering module set up before data enters the blockchain consensus queue. The module verifies the conservation relationship between physical quantities such as acceleration, displacement and strain in sensor data based on the law of conservation of physical motion. At the same time, it calculates the entropy increment during the state transition process and marks data frames with abnormal entropy increments or violations of physical conservation relationships as dynamic abnormal data and discards them, thereby quickly filtering out physical layer forgery and malicious replay data before on-chain logic execution.
[0053] The state transition entropy increase refers to the change in state distribution measured by information entropy between two adjacent time steps of the sensor state. The entropy increase in a normal physical motion process should be within a reasonable range. It is recommended that the reasonable range be determined by collecting normal freight sensor data, statistically analyzing the entropy increase distribution, and taking the 95th percentile interval.
[0054] The confidence threshold is recommended to be determined by performing grid search experiments on different candidate threshold values on the validation set with the goal of maximizing the harmonic mean of recall and precision. The recommended search range is 0.70 to 0.95.
[0055] The ant colony path optimization algorithm in this scheme is specifically implemented as follows: Each reachable path within the local star topology is used as the ant search space; the reciprocal of the product of path length and latency is used as the heuristic factor; pheromones are updated through positive feedback evaporation based on the optimal path in each round of search results; the pheromone evaporation coefficient is suggested to be determined by measuring the convergence rounds under different port disturbance scales and taking the coefficient value corresponding to the minimum convergence time, with a suggested range of 0.05 to 0.30; the algorithm enables the reachability matrix reconstruction to converge to a high-quality local optimum path within a finite number of iterations, avoiding exhaustive combination search of all paths, and fundamentally alleviating the problems of memory explosion and latency spikes.
[0056] The technical effects of the ant colony path optimization algorithm are as follows: through the pheromone positive feedback mechanism, the algorithm continuously strengthens the selection probability of historical high-quality paths in each iteration, so that the search process quickly concentrates on low-latency and low-congestion reachable paths. At the same time, the pheromone evaporation mechanism inhibits premature convergence to local extrema, ensuring that robust alternative paths can still be explored in the dynamic disturbance scenario of the port, so that the overall path reconstruction cost and the scale of disturbed nodes maintain a near-linear relationship, fundamentally solving the memory explosion problem during global topology recalculation.
[0057] Furthermore, this invention also provides a computer-based implementation method to form a cross-border trade transportation traceability system based on blockchain technology. The computer is equipped with a readable storage medium, which stores program instructions. When the program instructions are run on the computer, they execute all the above-mentioned method steps. The computer is communicatively connected to a cold chain sensor acquisition device, a blockchain consensus node, and a dynamic subgraph local rewriting algorithm execution unit to collaboratively complete the entire process of traceability, including multi-source data acquisition, compliance verification, path reconstruction, and on-chain evidence storage.
[0058] The specific implementation of step S01 is as follows: The purpose of this step is to integrate heterogeneous data from multiple sources, such as sea, land, and air waybills, customs declarations, and cold chain sensors, into a memory-aligned sequence of raw data frames, eliminating redundant memory operations during high-concurrency access. Specifically, the system pre-allocates a shared memory pool of fixed capacity at startup, providing a unified memory address space for all data sources and avoiding fragmentation caused by each data source independently requesting memory during runtime. When various waybills, declarations, and sensor data arrive, the system, based on a pre-established field offset index table, directly writes the memory offsets of structured fields (such as category codes, weight, and shipping location) and unstructured fields (such as inspection images and text descriptions) into the corresponding positions in the shared pool, without performing any format conversion or data copying operations, thereby achieving a zero-copy, compact binary memory representation layout. After field alignment is completed, the system generates raw data frames of a unified format frame by frame based on the field offset index table, providing low-latency input for subsequent customs clearance compliance verification. The frequency of garbage collection is significantly reduced at this stage due to the elimination of redundant memory allocation.
[0059] The specific implementation of step S02 is as follows: The purpose of this step is to perform compliance verification on the original data frame, output a quantifiable customs clearance compliance confidence vector and semantic conflict marker, and write the result into the blockchain consensus queue. The customs clearance compliance verification model uses a two-stream orthogonal decoupled projection layer as the input. The first stream processes structured document data (such as HS code, declared product category, and tariff category), and the second stream processes unstructured inspection image and text data (such as cargo image and inspection report text). Both streams are mapped to the same-dimensional feature space by a linear projection matrix and then spatial orthogonal decoupling is performed. The core attention layer uses orthogonal random feature kernel mapping, replacing the fully connected correlation matrix calculation of traditional bidirectional attention with the cumulative form of kernel mapping vector inner product, so that the computational load increases linearly with the sequence length. The shared key-value pair caching compression module between adjacent transformer layers allows adjacent layers to directly reuse the key-value representations already calculated at the bottom layer, skipping redundant linear projection. The network encodes the customs rule base constraints and the import and export tariff conservation law into adaptive penalty terms, embedding them into the attention kernel matrix bias term to ensure that compliance judgments are consistent with business rules. The gating unit determines whether to directly output a compliance assertion or activate a long-span residual bypass to perform multiple rounds of iterative inference based on the comparison between the maximum component of the customs clearance compliance confidence vector and the confidence threshold. Finally, the customs clearance compliance confidence vector and semantic conflict markers are written into the blockchain's consensus queue, awaiting subsequent consensus processing.
[0060] The specific implementation of step S03 is as follows: The purpose of this step is to perform frequency domain noise reduction processing on the time-series data of cold chain sensors, extract cargo structural damage features, and write them into the blockchain node. Cold chain sensor data typically contains multi-dimensional time-series signals such as temperature, vibration, and humidity, and periodic high-frequency noise is inevitably mixed in during the acquisition process. This step first performs orthogonal Fourier basis projection on the sensor data within the time window, transforming the time-domain signal to the frequency domain to obtain a complete energy spectral density distribution. A learnable bandpass frequency domain filter adaptively determines the passband range based on the energy spectral density distribution, filters out the frequency components corresponding to periodic high-frequency noise, and retains the core low-frequency energy coefficients carrying cargo structural damage information. The retained low-frequency coefficients are sent to the frequency domain feature attention layer, where lightweight dot product operations are performed in the complex space, replacing the time-domain fully connected computation and reducing the computational load. After being restored to the time domain by inverse Fourier transform, the error gradient prediction operator compensates for the loss introduced by spectral truncation, ensuring the integrity of the restored signal. Ultimately, the structural damage characteristics of the cargo are written into the blockchain node in the form of an immutable micro-state summary, serving as on-chain evidence of the cargo's state.
[0061] The specific implementation of step S04 is as follows: The purpose of this step is to significantly reduce the computational overhead of verifying the full historical state of cross-border transportation nodes while ensuring verification reliability. This step adopts a recursive cumulative state proof mechanism, which gradually accumulates the full historical node states into a concise state summary in a recursive manner. Each time a new node state is added, only incremental calculations are performed on the previous state summary, without recalculating the entire history. The verification complexity is reduced from superlinear to near-linear. The local rolling window verification mechanism only performs full verification on the node states within the nearest window length (suggested range 32-128 nodes). Historical states outside the window are replaced by recursive cumulative state proofs, further compressing the computational load of the current verification. The state transition invariant is used as a pruning rule, directly discarding historical state paths that do not meet the conservation constraints, without needing to enter subsequent verification calculations, thereby reducing the processing load of redundant paths. The synergistic effect of these three mechanisms enables the verification node to maintain a low computational consumption even with a large historical chain length.
[0062] The specific implementation of step S05 is as follows: The purpose of this step is to complete the path reconstruction of the transportation topology and synchronize it to the blockchain at the lowest cost when route changes are caused by port congestion or geopolitical dynamics. The dynamic subgraph local rewriting algorithm first identifies the local star-shaped subgraphs directly associated with the disturbed port in the global transportation topology graph. That is, the subgraph structure with the disturbed port as the central node and its one-hop neighboring ports as leaf nodes. Only the reachability matrix within this subgraph is reconstructed, updating the reachability relationships between local nodes, avoiding the overall recalculation of the global topology. The ant colony path optimization algorithm uses each reachable path as the ant search space within the local star-shaped topology, and uses the reciprocal of the product of path length and time delay as the heuristic factor. The pheromone is updated by positive feedback evaporation based on the optimal path in each round of search. The suggested range for the pheromone evaporation coefficient is 0.05 to 0.30. The positive feedback mechanism continuously strengthens the selection probability of historically high-quality paths in the search process, and the pheromone evaporation mechanism inhibits premature convergence, ensuring that robust alternative paths can still be explored under dynamic disturbance scenarios. After the algorithm converges within a finite number of iterations, it synchronizes the updated reachability matrix to the blockchain topology state storage, completing the on-chain record of path reconstruction.
[0063] The specific implementation of step S06 is as follows: The purpose of this step is to quickly eliminate forged and malicious replay data through a physical layer filtering mechanism before the data enters the blockchain consensus queue, ensuring the physical authenticity of the on-chain evidence data. The micro-behavior filtering layer, as a pre-filtering module, verifies the conservation relationship between physical quantities such as acceleration, displacement, and strain in sensor data based on the law of conservation of physical motion. Data frames that violate conservation constraints are marked as dynamically abnormal data. Simultaneously, the filtering layer calculates the state transition entropy increment between two adjacent time steps, using information entropy to measure the change in state distribution. The entropy increment of normal freight sensor data should fall within a reasonable range (it is recommended to determine this by statistically analyzing the entropy increment distribution after collecting normal freight sensor data and taking the 95th percentile interval). Data frames exceeding this range are also discarded. The filtered data enters the blockchain consensus queue, and after executing the on-chain consensus protocol, final evidence storage is completed, thus generating a complete end-to-end traceability record.
[0064] It should be noted that the key technologies of this invention include: the zero-copy shared memory pool mechanism pre-allocates a unified address space and relies on a field offset index table to complete field positioning, so that multi-source data does not need to undergo format conversion or memory copying during the access stage, eliminating redundant memory allocation from the data input source and providing a low-latency data foundation for subsequent calculations; the orthogonal random feature kernel mapping linearized attention mechanism transforms the calculation of the traditional quadratic fully connected correlation matrix into the linear accumulation of the inner product of the kernel mapping vector, so that the memory usage and computing power consumption of the customs clearance compliance verification model when processing long-sequence documents both increase linearly with the sequence length, eliminating the quadratic calculation bottleneck from the mechanism design level; the shared key-value pair cache and frequency domain filtering submodule further compress the computational amount of forward propagation and sensor feature extraction by skipping redundant linear projection and performing lightweight dot product operations in the frequency domain, respectively. The three technologies work together: the shared memory pool ensures low-latency access to large-scale concurrent data, linearized attention ensures the computational feasibility of long-sequence compliance verification, and key-value caching and frequency domain filtering continuously compress redundant overhead in the intermediate computing layer, enabling the entire system to maintain end-to-end low-latency processing capabilities in high-concurrency, long-sequence, and multimodal cross-border trade scenarios.
[0065] It's important to note that in scenarios involving a large number of cross-border transportation nodes and a long historical chain accumulation period, whenever a new node state needs to be written to the blockchain, the system must perform integrity verification on the entire historical state path to ensure the immutability of the on-chain evidence. As the historical chain length increases, the computational load of the traditional method of traversing and verifying each node increases superlinearly with the total number of historical nodes. Verification nodes cannot complete the verification within a limited time window, leading to a backlog of new state writes and consequently a surge in on-chain latency. The reason for this technical problem is that the traditional verification method must traverse from the beginning to the end of the chain to verify the legality of the state transition of each historical node each time a new node state is added. The computational load is directly proportional to the length of the historical chain, and intermediate results from previous verifications cannot be reused incrementally, resulting in a full recalculation for each write. A common solution to this problem is to shard the historical chain, dividing the full historical verification into multiple independent verifications, which are then processed in parallel by multiple verification nodes. However, sharding methods require additional cross-shard consensus protocols in scenarios involving cross-shard state dependencies, introducing new communication overhead and consensus complexity. Especially when node state transitions involve cross-shard associations, the coordination cost of cross-shard verification may outweigh the speedup benefits of sharding. Furthermore, the state digests at shard boundaries require additional maintenance, increasing the complexity of the system implementation. This invention effectively solves this technical problem: the recursive cumulative state proof mechanism progressively accumulates all historical node states into concise state digests in a recursive manner. Each time a new node state is added, incremental calculations are performed only based on the previous digest, eliminating the need to recalculate the entire history, reducing verification complexity to near-linear order. The local rolling window verification mechanism further restricts the complete verification range to a window of the most recent 32–128 nodes, replacing the history outside the window with a recursive digest, decoupling the actual computational cost of each write trigger from the length of the historical chain. The state transition invariant pruning mechanism discards paths that do not satisfy conservation constraints before entering verification computation, reducing the computational resource consumption of invalid verifications. The collaboration of these three elements enables verification nodes to maintain near-linear stable computational overhead in scenarios where the historical chain continues to grow, solving the write backlog problem caused by the superlinear growth of chain length in traditional step-by-step verification.
[0066] Specifically, the principle of this invention is:
[0067] The fundamental reason why this invention can solve the above-mentioned technical problems is that it eliminates redundant memory operations from the data access stage and replaces quadratic complexity with linear complexity in the model calculation stage, so that the two form a synergistic energy saving effect at the system level.
[0068] During the data access phase, this invention pre-allocates a shared memory pool of fixed capacity. All data source read and write operations share the same memory address space, and the location mapping between structured and unstructured fields is completed through a field offset index table. Since each data source does not need to independently allocate memory, the memory fragmentation problem is eliminated at its root. The zero-copy compact binary memory representation layout further ensures that fields are directly located in memory in a compact manner, eliminating the need for format conversion during deserialization. This reduces the frequency of garbage collection, providing a low-latency data input foundation for subsequent processing.
[0069] During the compliance verification phase, this invention employs orthogonal random feature kernel mapping to linearly approximate the traditional bidirectional attention mechanism. Traditional attention mechanisms require constructing a fully connected correlation matrix of size squared over the sequence length, while the kernel mapping method transforms attention computation into the inner accumulation of two linear projection vectors, making the computational cost linearly increase with the sequence length. Mathematically, this transformation is a Monte Carlo approximation of the kernel function, preserving the attention mechanism's ability to capture long-range dependencies while compressing memory usage from quadratic to linear, enabling large-scale concurrent verification.
[0070] The shared key-value pair caching compression mechanism reuses computed key-value representations between adjacent transformer layers, skipping redundant linear projection steps and reducing repetitive computations in forward propagation. Cross-layer residual bypass direct connections ensure gradient stability during feature propagation, enabling deep transformers to fully utilize semantic features extracted from shallow layers and avoiding gradient vanishing due to increased layer count.
[0071] The frequency domain filtering submodule transforms the time-series data from the cold chain sensors to the frequency domain using orthogonal Fourier basis projection. Based on the energy spectral density distribution, a learnable bandpass filter removes periodic high-frequency noise, retaining the core low-frequency energy coefficients. Lightweight complex dot product operations are then performed in the frequency domain, replacing the fully connected time-domain computation. After the inverse transformation, the spectral truncation loss is compensated by the error gradient prediction operator. This mechanism improves the signal-to-noise ratio of cargo structural damage characteristics, ensuring the reliability of the on-chain microstate summary.
[0072] At the path management level, the recursive cumulative state proof and local rolling window verification mechanism reduce the complexity of full-history verification from superlinear to near-linear. The dynamic subgraph local rewriting algorithm limits the path reconstruction cost to the local neighborhood of the disturbed node. The ant colony path optimization algorithm accelerates the convergence of the optimal path through the pheromone positive feedback mechanism. Together, they ensure the real-time response capability of full-link tracing under dynamic network disturbances.
[0073] The following provides a specific embodiment 1 of the present invention, and the specific implementation of each step in this embodiment 1 is described in detail below.
[0074] The specific implementation method of step S01 is as follows.
[0075] The system collects sea, land, and air waybills, customs declaration documents, and cold chain sensor data to construct a zero-copy, compact binary memory representation layout. A fixed-capacity memory region is pre-allocated in a shared memory pool, and a field offset index table is used to map the positions of structured and unstructured fields, avoiding fragmentation overhead caused by independent memory allocation from each data source. Let the... The first data source The starting offset of each field in the shared memory pool is The field length in bytes is The memory location formula for this field is expressed as follows:
[0076] ;
[0077] In the formula, For the first The first data source The starting offset of each field, in bytes. For the first The first data source The length of each field in bytes. For the first The base address offset of each data source in the shared memory pool, in bytes, is determined by a pre-allocation strategy. Multi-source structured and unstructured fields are directly aligned using these offsets, eliminating the need for additional data copying and generating a unified format of raw data frame sequences.
[0078] The specific implementation method of step S02 is as follows.
[0079] The raw data frame sequence is input into the customs clearance compliance verification model. A dual-stream orthogonal decoupled projection layer is set at the model input end. The first stream receives structured document data, and the second stream receives unstructured inspection image and text data. Both streams are mapped to the same-dimensional feature space through linear projection matrices, performing spatial orthogonal decoupling. Let the first stream input feature vector be... The second-stream input feature vector is The corresponding linear projection matrices are respectively and The projected feature vectors are respectively and The orthogonal decoupling constraint formula is expressed as follows:
[0080] ;
[0081] In the formula, These are the structured flow projection feature vectors. These are the projected feature vectors of the unstructured flow. For the same-dimensional feature space, the empirical value is 512. for The transpose of the vector. This constraint ensures that the features of the two streams are orthogonal in the projection space, eliminating redundant coupling between the two streams. The core layer uses orthogonal random feature kernel mapping to linearly approximate the traditional bidirectional attention mechanism, reducing the computational complexity of attention from... Down to ,in The sequence length is specified. A shared key-value pair cache compression module is set between adjacent transformer layers. Adjacent computation layers directly reuse the key-value representations already computed at the lower layer, skipping redundant linear projections. Feature transfer between layers is directly connected via cross-layer residual bypasses. The gating unit is based on the maximum component of the customs clearance compliance confidence vector. With confidence threshold The comparison result controls the information flow: when When compliance assertions are directly output through the cross-sequence hint prefix cache reuse mechanism, when semantic conflict markers appear between the declared product category and the freight trajectory, the long-span residual bypass is activated to execute multiple rounds of nonlinear dynamic iterative reasoning. The search range was determined by performing grid search experiments on different threshold candidate values, with the objective of maximizing the harmonic mean of recall and precision on the validation set. The search range was 0.70–0.95. The total loss function is expressed as follows:
[0082] ;
[0083] In the formula, For the total loss, For cross-entropy loss, This is an adaptive penalty term coded based on customs rule base constraints and the law of conservation of import and export tariffs. These are the weighting coefficients for the penalty term, with empirical values ranging from 0.1 to 0.5. All three are dimensionless loss values. Adaptive penalty term. The degree of violation of the conservation law is used as input, and is directly embedded as a bias term in the attention kernel matrix as a scaling factor. The iteration step size of the data loop is dynamically adjusted based on the variance of the customs clearance compliance confidence vector; the larger the variance, the smaller the iteration step size to enhance fine-grained inference. (Memory allocation coefficient) Determined by the segmentation rules, the formula is expressed as follows:
[0084] ;
[0085] In the formula, The average length of the current batch of data frame sequences, in units of lexical units. , , Three segmented thresholds are recommended, with initial ranges of 128–256, 256–512, and 512–1024 respectively. These thresholds were determined through multiple experiments on peak memory usage and inference latency at different batch lengths, followed by piecewise regression analysis of the experimental data. The dimensionless memory allocation coefficient is used as a scaling factor multiplied by the baseline value of the single-layer memory limit. (Unit is) Dynamically allocate the video memory capacity required for the current batch. The calculation relationship is as follows Memory allocation is based on shared key-value pairs, with a cache hit rate of 16%. Up to 512 Dynamic scaling within the range. When the activation entropy value is higher than... Below the entropy baseline threshold At this time, the hierarchical allocation strategy favors shallow transformers and compresses deep computing resources. The ratio of the activation entropy value of the shallow converter to the activation entropy value of the deep converter in the current batch is a dimensionless quantity. The standard deviation is determined by summing the mean and standard deviation of the activation entropy distribution of each layer on the training set. The verification result is written to the blockchain's consensus queue.
[0086] The specific implementation method of step S03 is as follows.
[0087] Perform orthogonal Fourier basis projection on the time-series data of the cold chain sensors, and let the time-domain signal be... Its orthogonal Fourier basis projection coefficients Obtained through Discrete Fourier Transform For the complex domain spectral coefficients. The filter mask for a learnable bandpass frequency domain filter is: Based on adaptive learning of the energy spectral density distribution, the formula for the core low-frequency energy coefficients retained after filtering is as follows:
[0088] ;
[0089] In the formula, The core low-frequency energy coefficient retained after filtering is a complex number. For a learnable bandpass filter mask, where are real-valued dimensionless weights. For discrete frequency variables, the unit is . For the sensor's time-domain signal, For time variables, the unit is . The input frequency domain feature attention layer performs lightweight complex dot product operations to replace the time domain fully connected computation. After inverse transformation to restore it to the time domain, the error gradient prediction operator compensates for the spectral truncation loss, generates a cargo structural damage feature summary, and writes it to the blockchain node.
[0090] The specific implementation method of step S04 is as follows.
[0091] The recursive cumulative state proof is used to prove the full historical state of cross-border transportation nodes. Let the nth state be... The node state summary of the step is The recursive update formula is expressed as follows:
[0092] ;
[0093] In the formula, For the first Step-by-step cumulative state summary, which is a fixed-length byte string. For the previous step, accumulate state summary Status data for newly added nodes This is an incremental hash accumulation function that accepts two byte strings as input and outputs a fixed-length digest, with the unit being the length of the byte string. The recommended range for the local scrolling window length is 32–128 nodes. Historical states outside the window are... In this alternative approach, any historical paths that do not satisfy the state transition invariant are pruned to reduce the computation time of the verification nodes.
[0094] The specific implementation method of step S05 is as follows.
[0095] When port congestion or geopolitical dynamics lead to route changes, only the local star-shaped subgraph directly associated with the disturbed port is identified. The disturbed port is designated as the central node. Its one-hop neighborhood node set is The locally reachable matrix is ,in The number of one-hop neighbor nodes, only for Reconstruction is performed, avoiding a complete recalculation of the global topology. The ant colony path optimization algorithm uses each reachable path as the ant search space within the local star topology, and employs a pheromone-guided heuristic search using the reciprocal of the product of path length and time delay as a heuristic factor. The pheromone update formula is expressed as follows:
[0096] ;
[0097] In the formula, For the first Path in round iteration The pheromone concentration on the surface is a dimensionless positive real number. The pheromone evaporation coefficient is a dimensionless quantity, with a suggested range of 0.05–0.30. It is determined by measuring the convergence cycles under different port disturbance scales and taking the coefficient value corresponding to the minimum convergence time. The optimal path pair for this round The pheromone increment is a dimensionless positive real number, which only occurs if the path... A positive value is assigned if the path belongs to the optimal path in this round, otherwise a value of 0 is assigned; heuristic factor The definition is as follows:
[0098] ;
[0099] In the formula, For path heuristic factor, For path Path length, in units of For path The transportation delay, in units of Units are The pheromone weighting is performed using dimensionless normalization. The algorithm converges within a finite number of iterations, and the updated results are synchronized to the blockchain topology state for verification.
[0100] The specific implementation method of step S06 is as follows.
[0101] Before data enters the consensus queue, it passes through a micro-behavioral filtering layer to verify the conservation relationships of physical quantities such as acceleration, displacement, and strain in the sensor data based on the law of conservation of physical motion. At the same time, it calculates the information entropy increment between the sensor states of two adjacent time steps. The formula is expressed as follows:
[0102] ;
[0103] In the formula, The state transition entropy increment between adjacent time steps, in units of For the first Information entropy of the state distribution of time-step sensors, in units of For the first The state probability distribution vector at each time step is obtained by normalizing the sensor sampled data and is a dimensionless quantity. For the first Information entropy of the state distribution of time-step sensors, in units of Normal physical motion process The reasonable range was determined by statistically analyzing the entropy increment distribution after collecting normal freight sensor data and taking the 95th percentile interval. Data frames that exceed reasonable limits or violate physical conservation relationships are marked as dynamic anomalies and discarded. On-chain consensus and final notarization are performed on filtered data to complete full-chain traceability and recording.
[0104] To better understand and implement this invention, the following is a specific application scenario of this invention, Example 2:
[0105] This embodiment uses the cross-border transportation traceability of a batch of cold chain fresh goods as an example. The goods are transported from the exporting country to the importing country via multiple transit ports, involving both sea and air transport, and passing through a total of 7 transport nodes, generating two types of inputs: structured document data and cold chain sensor time-series data. During implementation, technicians follow the method steps of this invention to collect, verify, extract features, verify history, reconstruct paths, and store evidence on the entire chain of data.
[0106] During the data acquisition phase, technicians integrated time-series data on temperature, vibration, and humidity collected from ocean bills of lading, air waybills, customs declarations, and cold chain sensors into a shared memory pool. The shared memory pool was pre-allocated to a capacity of 4... The fixed memory area has a pre-defined field offset index table that sets memory offsets for 28 types of fields, including structured fields (category code, weight, and shipping node number) and unstructured fields (goods image and inspection text). The collected multi-source data is directly written to the corresponding offset positions using a zero-copy compact binary memory representation layout, without deserialization or format conversion. The garbage collection trigger interval is significantly extended compared to traditional independent memory allocation methods. The original data frame sequence is output in batches, and the average frame length of each batch is shown in Table 1.
[0107] Table 1. Statistical table of average length of raw data frames in each batch
[0108]
[0109] During the compliance verification phase, the original data frame sequence is input into the customs clearance compliance verification model. The specific structure of the customs clearance compliance verification model is as follows: A dual-stream orthogonal decoupled projection layer is set at the input end. The first stream processes structured document data, and the second stream processes unstructured inspection image and text data. Both streams are mapped to a 512-dimensional feature space via linear projection matrices and then spatial orthogonal decoupling is performed to generate dual-path 512-dimensional feature streams. The core attention layer uses orthogonal random feature kernel mapping, with the random feature dimension set to 256. The calculation of the fully connected correlation matrix in traditional bidirectional attention is replaced by intra-vector accumulation within the kernel mapping, and the attention computation increases linearly with the frame length. The model has a total of 6 transformer layers. The shared key-value pair caching compression module between adjacent layers allows each layer to directly reuse the calculated key-value representations of the underlying layer, skipping redundant linear projections. Activation transfer weights are bound through a shared parameter matrix between shallow and deep transformers, and feature transfer is directly connected via cross-layer residual bypasses. Memory allocation coefficients... Based on the batch of 4 frames, the length exceeds 1124. Threshold (in this embodiment) The determination of 512) is taken. Dynamic memory allocation is performed. The output results of the customs clearance compliance confidence vector are shown in Table 2. Based on the comparison between the maximum component of the confidence vector and the confidence threshold of 0.85, the gating unit directly outputs compliance assertions for batches 1 and 2. For batch 3, after detecting semantic conflict markers, it activates the long-span residual bypass to perform multi-round iterative inference.
[0110] Table 2. Statistical Table of Maximum Components of Customs Clearance Compliance Confidence Vector for Each Batch
[0111]
[0112] Regarding alternative AI network structures, if the linear kernelized attention mechanism is difficult to deploy directly in the implementation environment, the following two equivalent replacement structures can be adopted: The first replacement is a two-stream transformer based on sparse attention. Its input end is also equipped with a two-stream orthogonal decoupled projection layer. The core layer adopts local sliding window sparse attention. Each query vector only calculates the attention weight with the key-value vector within a fixed window, avoiding the generation of a fully connected correlation matrix. The computational cost increases linearly with the sequence length. The output features of sparse attention are connected through cross-layer residual bypass. The data flow is consistent with the main scheme. The structured and unstructured two-stream features are fused at the top layer and then output as a customs clearance compliance confidence vector through a gating unit. The second replacement is a sequence modeling structure based on a state-space model. The input end is equipped with an equivalent dual-stream orthogonal decoupled projection layer, which feeds the two feature streams into the recursive state update module of the state-space model. This module gradually accumulates the sequence context information through linear recursive equations. The computational cost increases linearly with the sequence length. The state output is linearly projected and then output as a clearance compliance confidence vector through a gating unit. The feature extraction dimension of both replacement structures is 512-dimensional, and the loss function is a weighted sum of cross-entropy loss and adaptive penalty term, which is highly consistent with the main scheme.
[0113] During the cold chain sensor feature extraction stage, technicians performed orthogonal Fourier basis projection on the temperature and vibration time-series data of seven transportation nodes, setting the time window length to 128 sampling points. The energy spectral density distribution of each node was processed by a learnable bandpass frequency domain filter, filtering out 40% of the data. The above periodic high-frequency noise components, retaining 0-40 The core low-frequency energy coefficients are preserved. After performing a lightweight complex dot product operation on the frequency domain feature attention layer, the coefficients are restored to the time domain via inverse Fourier transform. The error gradient prediction operator compensates for the spectral truncation loss. For example... Figure 3 As shown, the comparison of the energy spectral density distribution of each node's cold chain sensor before and after frequency domain filtering indicates that 40 The high-frequency noise components mentioned above are effectively suppressed, and the energy retention rate of the core low-frequency components tends to stabilize as the learnable parameters of the filter converge. The summary of cargo structural damage features is written into the blockchain node in the form of a micro-state summary. The changes in signal-to-noise ratio before and after filtering at each node are shown in Table 3.
[0114] Table 3. Statistical table of signal-to-noise ratio of cold chain sensors before and after frequency domain filtering at each transportation node.
[0115]
[0116] As the passband parameters of the learnable bandpass frequency domain filter gradually converge, high-frequency noise components are continuously suppressed, and the improvement in the signal-to-noise ratio of each node tends to stabilize. This trend indicates that after targeted filtering of periodic noise in the frequency domain, the effective components of cargo structural damage information are reduced during time-domain reconstruction, ensuring the integrity of the physical information carried by the on-chain micro-state summary. This solves the technical defect in the prior art where sensor noise interference leads to distortion in cargo state feature extraction.
[0117] During the historical state verification phase, technicians employed a recursive cumulative state proof mechanism for the complete history of the seven transportation nodes. Each time a new node state was added, incremental calculations were performed only on the previous state summary. A local rolling window verification mechanism was used, setting the window length to 64 nodes and performing a complete verification on the most recent 64 node states. History outside the window was replaced with a recursive summary. State transition invariant pruning discarded paths that did not meet conservation constraints before verification. For example... Figure 4 As shown, the trend of the single verification time of the verification node with the increase of the historical chain length indicates that after adopting the recursive cumulative state proof, the verification time curve tends to flatten with the increase of the historical chain length, which is in contrast to the superlinear growth curve of the traditional step-by-step verification method, thus verifying the computational efficiency advantage of the recursive mechanism in the scenario of long historical chains.
[0118] During the route reconfiguration phase, a congestion event occurred at node 3 (the transit port), triggering a route change. For example... Figure 5 As shown, the dynamic subgraph local rewriting algorithm identifies a local star-shaped subgraph centered on node 3 (containing three leaf nodes: nodes 2, 4, and 5). It only reconstructs the reachability matrix within this local subgraph, leaving the reachability relationships of other nodes in the global topology unaffected. The ant colony path optimization algorithm performs a pheromone-guided search within the local star-shaped topology, using a pheromone evaporation coefficient of 0.15 and the reciprocal of the product of path length and time delay as a heuristic factor. After 20 iterations, it converges to the optimal candidate path. After path reconstruction, the updated reachability matrix is synchronized to the blockchain topology state record. The convergence of the optimal path cost in each iteration is shown in Table 4.
[0119] Table 4. Statistical table of iterative convergence process of ant colony path optimization algorithm
[0120]
[0121] like Figure 8 As shown, with the increase of iteration rounds, the cost of the optimal path continues to decrease and tends to stabilize. The pheromone positive feedback mechanism continuously strengthens the high-quality path after each iteration. The search process quickly concentrates on low-latency paths without having to perform exhaustive enumeration on all paths. Therefore, the path reconstruction cost maintains a near-linear relationship with the number of disturbed nodes.
[0122] In the micro-behavior filtering stage, the filtering layer performs physical motion conservation law verification and state transition entropy increment calculation on the sensor data of all 7 nodes. The reasonable range of entropy increment is determined by statistically analyzing the entropy increment distribution after collecting historical normal freight sensor data and taking the 95th percentile interval. For example Figure 6 As shown, in this embodiment, three frames of dynamic anomaly data were detected (two frames violated the acceleration conservation relationship, and one frame exceeded the 95th percentile upper limit of entropy increment). These three frames were discarded, and the remaining data entered the blockchain consensus queue after filtering. After executing the on-chain consensus protocol, the final notarization was completed, and the complete traceability record was generated. The filtering results are shown in Table 5.
[0123] Table 5. Statistical Table of Abnormal Data Detection in Microscopic Behavior Filtering Layer
[0124]
[0125] like Figure 7 As shown, the blockchain evidence storage timeline diagram of the full-link traceability record illustrates the time node distribution of each stage from the input of the original data frame sequence to the final completion of on-chain evidence storage. The trend of the processing time of each stage with the batch frame length is consistent with the theoretical expectation of the linearized attention mechanism of the customs clearance compliance verification model. That is, the end-to-end processing time increment of longer batches is significantly less than the expected increment of the traditional quadratic attention mechanism, which verifies the latency control capability of the present invention in high-concurrency long sequence scenarios.
[0126] The transport documents and sensor data involved in this application embodiment were all collected with the legal authorization of the relevant parties, and the data acquisition, processing and transmission process complies with applicable data compliance requirements.
[0127] It should be noted that the variables involved in this invention are explained in detail in Table 6.
[0128] Table 6. Variable Explanation Table
[0129]
[0130] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for tracing cross-border trade transportation based on blockchain technology, characterized in that, Includes the following steps: Collect sea, land, and air waybills, customs declarations, and cold chain sensor data; construct a zero-copy compact binary memory representation layout; perform high-speed alignment of multi-source structured and unstructured fields based on a shared memory pool; and generate a unified format of raw data frame sequences. The original data frame sequence is input into the customs clearance compliance verification model, compliance verification is performed, the customs clearance compliance confidence vector and semantic conflict marker are output, and the verification result is written into the blockchain consensus queue. The cold chain sensor data is subjected to orthogonal Fourier basis projection. Based on the energy spectral density distribution, periodic high-frequency noise is filtered out by a learnable bandpass frequency domain filter. The core low-frequency energy coefficients are then input into the frequency domain feature attention layer. After inverse transformation and restoration, a summary of cargo structural damage features is generated and written to the blockchain node. A recursive cumulative state proof and local rolling window verification mechanism is adopted for the full historical state of cross-border transportation nodes. Based on the state transition invariant, the historical redundant verification path is pruned to reduce the computation time of verification nodes. When port congestion or geopolitical dynamics lead to route changes, a dynamic subgraph local rewriting algorithm is adopted to reconstruct the reachability matrix only within the local star topology affected by the disturbed port, and synchronize the updated results to the blockchain topology state for evidence storage. Before data enters the consensus queue, it passes through a micro-behavioral filtering layer to filter out dynamically abnormal data based on the laws of physical motion conservation and the entropy increase rule of state transition. On-chain consensus and final notarization are then performed on the filtered data to complete the full-chain traceability record.
2. The cross-border trade transportation traceability method based on blockchain technology according to claim 1, characterized in that, The zero-copy compact binary memory representation layout specifically refers to the fact that no additional data copying operation is performed on multi-source data in memory. Instead, the offsets of each field are located and aligned directly in the shared memory pool in a compact binary format, eliminating redundant memory allocation during deserialization and reducing the frequency of garbage collection.
3. The cross-border trade transportation traceability method based on blockchain technology according to claim 2, characterized in that, The shared memory pool specifically refers to a pre-allocated fixed-capacity memory area. Multiple data source read and write operations share the same memory pool address space. The location mapping between structured fields and unstructured fields is completed through a field offset index table, avoiding the fragmentation overhead caused by each data source independently requesting memory.
4. The cross-border trade transportation traceability method based on blockchain technology according to claim 3, characterized in that, The customs clearance compliance verification model is a customs clearance compliance verification model based on deep learning, which integrates linear kernelized dual-stream interaction and shared key-value caching with frequency domain filtering. The input end is set with a dual-stream orthogonal decoupled projection layer. The first stream receives structured document data, and the second stream receives unstructured inspection image and text data. The core layer uses orthogonal random feature kernel mapping to linearly approximate the traditional bidirectional attention mechanism, reducing the computational complexity of attention from quadratic to linear.
5. The cross-border trade transportation traceability method based on blockchain technology according to claim 4, characterized in that, A shared key-value pair cache compression module is set between adjacent transformer layers. Adjacent computation layers directly reuse the key-value representations already calculated at the lower layer. The activation transfer weights between neurons are bound between shallow and deep transformers with a shared parameter matrix. The feature transfer between layers is directly connected through cross-layer residual bypass. The iteration step size of the data loop is dynamically adjusted according to the variance of the clearance compliance confidence vector.
6. The cross-border trade transportation traceability method based on blockchain technology according to claim 5, characterized in that, Video memory allocation is dynamically calculated by the video memory allocation adjustment function based on the length of the current batch of data frames. Memory allocation is dynamically scaled within the range of the lower and upper limits of memory based on the shared key-value pair cache hit rate. Hierarchical allocation allocates computing resources based on the ratio of the activation entropy values of the shallow and deep transformers.
7. The cross-border trade transportation traceability method based on blockchain technology according to claim 6, characterized in that, The aforementioned local rolling window verification mechanism specifically refers to performing a complete verification only on the node state within the most recent time range. Historical states outside the window are replaced by recursive cumulative state proofs. The window length is determined by measuring the verification time under different historical chain lengths and analyzing the inflection point.
8. The cross-border trade transportation traceability method based on blockchain technology according to claim 7, characterized in that, The network internally employs a multi-level self-looping feedback mechanism, encoding customs rule base constraints and import / export tariff conservation laws as adaptive penalty terms, which are directly embedded as scaling factors into the bias term of the attention kernel matrix. The information flow control layer sets up a gating unit, which directly outputs a compliance assertion through a cross-sequence hint prefix cache reuse mechanism when the maximum component of the customs clearance compliance confidence vector exceeds the confidence threshold. When semantic conflict markers appear between the declared product category and the freight trajectory, the gating unit activates a long-span residual bypass adaptive scaling fusion channel to execute multiple rounds of nonlinear dynamic iterative inference.
9. The cross-border trade transportation traceability method based on blockchain technology according to claim 8, characterized in that, The customs clearance compliance verification model also integrates an ant colony path optimization algorithm, which is used to perform pheromone-guided heuristic search on the reconstructed paths of the reachable matrix within the local star topology during the local rewriting process of the dynamic subgraph, thereby accelerating the convergence of the optimal path. The ant colony path optimization algorithm uses each reachable path within the local star topology as the ant search space, and the reciprocal of the product of path length and time delay as the heuristic factor. The pheromone is updated by positive feedback evaporation based on the optimal path in each round of search results.
10. The cross-border trade transportation traceability method based on blockchain technology according to claim 9, characterized in that, The recursive cumulative state proof specifically refers to the gradual accumulation of all historical node states into a concise state summary in a recursive manner. Each time a new node state is added, only the incremental operation needs to be performed based on the previous state summary, without recalculating the entire history, thereby reducing the verification computation complexity from superlinear to near-linear.
