Blockchain-based container internal cargo positioning and identification method
Patent Information
- Application Number
- CN202610925466.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-25
- Publication Date
- 2026-10-23
AI Technical Summary
[0003]传统的拼箱点上报货物信息及装箱位置通常存储于中心化数据库中,数据极易被非法篡改或伪造;在海关开箱查验环节,查验人员仅能通过扫描货物表面的条码获取平台上报的静态信息,无法对数据的源头合法性及完整性进行密码学意义上的验签核验,由于缺乏基于区块链等分布式账本的初始定位区块对货物数字凭证进行深度把控,一旦中心化数据被恶意修改,影响了实际占位坐标的精准性,导致了集装箱内部货物的定位识别的精准性较低
(1)采集集装箱的尺寸,并结合集装箱的内部空间确定对应的多维位置矩阵,获取货物在多维位置矩阵中的理论占位坐标,并结合货物属性特征数据生成位置信息,进而形成货物初始定位区块;当接收到集装箱内部货物的定位识别请求时,采集待识别货物表面的图形码,提取对应的货物数字凭证,区块链网络的智能合约对货物数字凭证进行验签与解密,从货物初始定位区块中提取与货物数字凭证对应的实际占位坐标,引入了货物初始定位区块,对货物数字凭证进一步把控,提高了实际占位坐标的精准性。
Smart Images

Figure CN122964304A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of blockchain technology, and more particularly to a blockchain-based method for locating and identifying cargo inside a container. Background Technology
[0002] With the booming global trade and rapid development of the logistics industry, containers, as the core carrier for cross-border transportation of bulk goods, directly affect customs clearance speed and trade security through the efficiency of cargo supervision and inspection. In current container logistics supervision and customs inspection scenarios, verification of cargo information within containers typically relies on paper documents such as packing lists and customs declarations, or electronic data recorded by centralized system platforms.
[0003] Traditionally, cargo information and loading locations reported by consolidation points are stored in centralized databases, making the data highly susceptible to illegal tampering or forgery. During customs inspection, inspectors can only obtain static information reported on the platform by scanning barcodes on the cargo surface. They cannot perform cryptographic verification of the data's source legitimacy and integrity. Due to the lack of in-depth control over the digital credentials of the cargo based on initial positioning blocks of distributed ledgers such as blockchain, once the centralized data is maliciously modified, the accuracy of the actual occupancy coordinates is affected, resulting in low accuracy in locating and identifying cargo inside the container. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings of the prior art. This invention provides a method for locating and identifying cargo inside a container based on blockchain.
[0005] This invention provides a blockchain-based method for locating and identifying cargo inside a container, comprising: The dimensions of the container are collected, and the corresponding multi-dimensional position matrix is determined by combining the internal space of the container. The theoretical occupancy coordinates of the cargo in the multi-dimensional position matrix are obtained, and the position information is generated by combining the cargo attribute feature data, thereby forming the initial positioning block of the cargo. When a request to locate and identify cargo inside a container is received, the graphic code on the surface of the cargo to be identified is collected, the corresponding digital certificate of the cargo is extracted, the smart contract of the blockchain network verifies and decrypts the digital certificate of the cargo, and extracts the actual occupancy coordinates corresponding to the digital certificate of the cargo from the initial positioning block of the cargo. The actual occupancy coordinates are mapped to the corresponding grid of the multi-dimensional position matrix, and the spatial position is highlighted to output a virtual highlighted grid. The corresponding spatial mapping content is further determined by combining the internal space of the container. Based on the recognition of the spatial mapping content, the real-time physical coordinates of the goods to be identified relative to the container are determined. The smart contract of the blockchain network compares the real-time physical coordinates with the actual occupancy coordinates by offset. If the offset is less than the preset offset threshold, the positioning recognition is deemed successful, and a confirmation block is generated and uploaded to the chain.
[0006] This invention provides a blockchain-based container interior cargo location and identification system, which is applied to the aforementioned blockchain-based container interior cargo location and identification method. The blockchain-based container interior cargo location and identification system includes: The positioning block module is used to collect the dimensions of the container and determine the corresponding multi-dimensional position matrix based on the internal space of the container. It obtains the theoretical occupancy coordinates of the cargo in the multi-dimensional position matrix and generates position information by combining the cargo attribute feature data, thereby forming the initial positioning block of the cargo. The coordinate module is used to collect the graphic code on the surface of the cargo to be identified when a location identification request for cargo inside the container is received, extract the corresponding digital certificate of the cargo, and the smart contract of the blockchain network verifies and decrypts the digital certificate of the cargo, extracting the actual occupancy coordinates corresponding to the digital certificate of the cargo from the initial location block of the cargo. The spatial mapping module is used to map the actual occupancy coordinates to the corresponding grid of the multi-dimensional position matrix and perform highlight rendering of the spatial position to output a virtual highlight grid. The corresponding spatial mapping content is further determined by combining the internal space of the container. The blockchain module is used to determine the real-time physical coordinates of the goods to be identified relative to the container based on the recognition of the spatial mapping content. The smart contract of the blockchain network compares the real-time physical coordinates with the actual occupancy coordinates by offset. If the offset is less than the preset offset threshold, the positioning recognition is deemed successful, and a confirmation block is generated and uploaded to the chain.
[0007] Compared with the prior art, the beneficial effects of the present invention are: (1) Collect the dimensions of the container and determine the corresponding multi-dimensional position matrix in combination with the internal space of the container. Obtain the theoretical occupancy coordinates of the goods in the multi-dimensional position matrix and generate position information in combination with the attribute feature data of the goods, thereby forming the initial positioning block of the goods. When a positioning and identification request for the goods inside the container is received, collect the graphic code on the surface of the goods to be identified, extract the corresponding digital certificate of the goods, and the smart contract of the blockchain network verifies and decrypts the digital certificate of the goods. Extract the actual occupancy coordinates corresponding to the digital certificate of the goods from the initial positioning block of the goods. The initial positioning block of the goods is introduced to further control the digital certificate of the goods and improve the accuracy of the actual occupancy coordinates.
[0008] (2) The actual occupant coordinates are mapped to the corresponding grid of the multi-dimensional position matrix and the spatial position is highlighted to output a virtual highlighted grid. The corresponding spatial mapping content is further determined by combining the internal space of the container. Based on the recognition of the spatial mapping content, the real-time physical coordinates of the cargo to be identified relative to the container are determined. The smart contract of the blockchain network compares the real-time physical coordinates with the actual occupant coordinates by offset. If the offset is less than the preset offset threshold, the positioning recognition is determined to be successful, and a confirmation and evidence block is generated and uploaded to the chain. The spatial mapping content is further controlled, and the smart contract of the blockchain network and the offset are fully considered, which improves the accuracy of the positioning recognition of cargo inside the container. Attached Figure Description
[0009] Figure 1 This is a flowchart illustrating the blockchain-based method for locating and identifying cargo inside a container, as described in this embodiment of the invention. Figure 2 This is a flowchart illustrating step S11 of the blockchain-based container cargo location and identification method in this embodiment of the invention. Figure 3 This is a flowchart illustrating step S12 of the blockchain-based container internal cargo location and identification method in this embodiment of the invention. Figure 4 This is a flowchart illustrating step S13 in the blockchain-based container cargo location and identification method in this embodiment of the invention. Figure 5 This is a flowchart illustrating step S14 of the blockchain-based container cargo location and identification method in this embodiment of the invention. Detailed Implementation
[0010] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
[0011] Please see Figures 1 to 5 A blockchain-based method for locating and identifying cargo inside a container, applied to a blockchain scenario; the blockchain-based method for locating and identifying cargo inside a container includes: Step S11: Collect the dimensions of the container and determine the corresponding multi-dimensional position matrix in combination with the internal space of the container. Obtain the theoretical occupancy coordinates of the cargo in the multi-dimensional position matrix and generate position information in combination with cargo attribute feature data, thereby forming the initial positioning block of the cargo. Step S12: When a request for location identification of goods inside the container is received, the graphic code on the surface of the goods to be identified is collected, the corresponding digital certificate of the goods is extracted, the smart contract of the blockchain network verifies and decrypts the digital certificate of the goods, and extracts the actual occupancy coordinates corresponding to the digital certificate of the goods from the initial location block of the goods. Step S13: Map the actual occupancy coordinates to the corresponding grid of the multi-dimensional position matrix, and perform spatial position highlight rendering to output a virtual highlight grid. Further combine the internal space of the container to determine the corresponding spatial mapping content. Step S14: Based on the recognition of the spatial mapping content, determine the real-time physical coordinates of the goods to be identified relative to the container. The smart contract of the blockchain network compares the real-time physical coordinates with the actual occupancy coordinates by offset. If the offset is less than the preset offset threshold, the positioning recognition is deemed successful, and a confirmation block is generated and uploaded to the chain.
[0012] refer to Figure 2 In step S11, the specific steps are as follows: S111: The three-dimensional dimension data of the container is acquired by three-dimensional laser scanning, and a corresponding multi-dimensional position matrix is constructed based on the structural characteristics of the container's internal space. The multi-dimensional position matrix divides the container's internal space into multiple three-dimensional grid units according to the XYZ axes. S112: Mark each cargo reported by the consolidation point and obtain the theoretical occupancy coordinates of the cargo in the multi-dimensional location matrix. At the same time, collect the attribute feature data of the cargo, including the physical size, weight, dangerous goods class and stacking orientation of the cargo. Combine the theoretical occupancy coordinates to generate location information containing spatial topology and attribute hash value. Then, use an asymmetric encryption mechanism to digitally sign the location information to form the corresponding cargo initial location block. Broadcast the cargo initial location block to the blockchain network for consensus storage.
[0013] In the embodiments of this application, three-dimensional dimension data of the container is acquired by three-dimensional laser scanning, and a corresponding multi-dimensional position matrix is constructed based on the structural features of the container's internal space. The multi-dimensional position matrix divides the container's internal space into multiple three-dimensional grid units according to the XYZ axes, thus introducing the multi-dimensional position matrix.
[0014] At this point, a high-precision 3D laser scanner is used to perform a panoramic scan of the exterior and interior of the target container. By emitting laser pulses and receiving reflected signals, the time of flight of light is calculated to obtain massive discrete point cloud data of the container surface. The initial point cloud data is then denoised, filtered, and registered and stitched to reconstruct a 3D point cloud model of the container. Based on this point cloud model, the absolute 3D dimensions of the container, namely length L, width W, and height H, are extracted, and the structural features inside the container, such as the unevenness of the side wall corrugations, the protruding dimensions of corner fittings, and the intrusion of door end seals into the space, are identified. Thus, the boundary parameters of the net space inside the container are calculated, providing an accurate physical spatial reference for subsequent matrix construction.
[0015] Using the bottom corner of the container door as the origin of the spatial coordinate system (X=0, Y=0, Z=0), the X-axis is set along the length of the container, the Y-axis along the width, and the Z-axis along the height. A three-dimensional rectangular coordinate system that strictly maps to the physical space of the container is established. Based on the boundary parameters of the internal net space, the maximum extension range of this coordinate system is set as the boundary extreme value of the matrix, thereby constructing a multi-dimensional position matrix framework that logically encompasses the entire internal net space of the container.
[0016] Optionally, the construction of the multidimensional position matrix is not based on a fixed step size division, but is generated according to the net space dimensions inside the container, the typical physical dimensions of the cargo to be loaded, and the preset inspection accuracy level, combined with a dynamic granularity division mechanism. Specifically, the length, width, and height net space values inside the container are obtained by using three-dimensional laser scanning, and structural features that affect loading are identified, such as the inward bulging of side wall corrugations or the intrusion area of door end seals.
[0017] Based on this, the system determines the baseline partitioning step size for the X, Y, and Z axes according to the maximum length, maximum width, and maximum height of all goods in the LCL plan, ensuring that each 3D grid cell can accommodate the main volume of at least one piece of goods. For cases where goods cross multiple grid boundaries, the system employs a multi-grid overlay marking method, using the entire set of continuous grids occupied by the goods as its theoretical occupancy coordinates, rather than forcing a one-to-one correspondence between goods and individual grids.
[0018] When goods of various sizes are mixed, the system prioritizes the least common multiple or hierarchical cascading partitioning method. The internal space of the container is first divided into large-size grids to accommodate large goods, and then further subdivided into smaller grids to accommodate smaller goods. This achieves multi-scale compatibility without rebuilding the entire matrix. All partitioning parameters, step size criteria, and grid indexing rules are included as part of the location information and stored on the blockchain along with the initial cargo location block, ensuring that the matrix construction logic can be traced back and reproduced during each inspection.
[0019] Based on the accuracy requirements of actual inspection and consolidation operations, the granularity division step size of the X, Y, and Z axes is set. For example, the X-axis is divided into equal parts by a step size Δx, the Y-axis into equal parts by a step size Δy, and the Z-axis into equal parts by a step size Δz. Through an orthogonal cutting algorithm, the multidimensional position matrix is sliced and meshed level by level along the XYZ axes, so that the continuous internal space of the container is discretized into several three-dimensional mesh units with consistent volume or adaptively adjusted according to features. Each three-dimensional mesh unit is assigned a unique spatial index code, such as a combination of level-column-row coordinates, thereby completing the full mapping from the physical container space to the logical three-dimensional mesh unit.
[0020] Specifically, taking the scenario of loading "Type B cargo, such as electronic equipment cartons with dimensions of 1.2m × 1.0m × 1.0m" into a standard "Type A container: external standard dimensions of 12.192m in length, 2.438m in width, and 2.591m in height", a 3D laser scanner scans the interior of the Type A container to obtain its internal net space dimensions of 12.000m in length, 2.352m in width, and 2.393m in height. At the same time, it identifies the structural feature of the side wall corrugations intruding inward by 0.05m, thus limiting the effective loading boundary to the above net space parameters.
[0021] A spatial rectangular coordinate system is established with the lower right corner of the door of the Type A container as the origin (0,0,0). The X-axis extends along the length of 12.000m, the Y-axis extends along the width of 2.352m, and the Z-axis extends along the height of 2.393m, thus constructing a multi-dimensional position matrix representing the net internal space of the Type A container.
[0022] To accommodate the "24-grid area division" commonly used in customs inspections and the physical dimensions of Type B cargo, the X-axis division step size is set to 2.000m, divided into 6 parts; the Y-axis division step size is set to 1.176m, divided into 2 parts; and the Z-axis division step size is set to 0.797m, divided into 2 parts, approximating a layer height of 2.393m / 3. Through granular division along the XYZ axes, the internal space of the Type A container is discretized into 6×2×2=24 three-dimensional grid units. Each three-dimensional grid unit represents a logical space block with a length of 2m × width of 1.176m × height of 0.797m, and is assigned an index code according to the coordinate system, such as X1Y1Z1 representing the frontmost bottom grid unit. When Type B cargo is loaded into a Type A container, its space can be precisely mapped to one or more combinations of these 24 three-dimensional grid units.
[0023] Furthermore, each cargo reported by the consolidation point is marked, and its theoretical occupancy coordinates in a multi-dimensional location matrix are obtained. Simultaneously, the attribute feature data of the cargo is collected, including its physical dimensions, weight, hazard class, and stacking orientation. Combined with the theoretical occupancy coordinates, location information containing spatial topological relationships and attribute hash values is generated. Then, an asymmetric encryption mechanism is used to digitally sign the location information, thereby forming the corresponding initial location block of the cargo. This initial location block of the cargo is broadcast to the blockchain network for consensus storage, fully taking location information into account.
[0024] At this point, the LCL (Less than Container Load) operation system assigns a unique identifier to each cargo to be loaded according to the packing plan, and allocates a preset loading area to the marked cargo based on a multi-dimensional position matrix, thereby obtaining the set of three-dimensional grid cell indexes corresponding to the cargo in the multi-dimensional position matrix, i.e., the theoretical occupancy coordinates; at the same time, through IoT weighing equipment, barcode scanning equipment and manual data entry terminals, the system synchronously collects the attribute feature data of the cargo. The attribute feature data includes at least the cargo's "physical dimensions: length, width and height parameters", "weight: gross weight / net weight", "hazard class: such as the International Maritime Dangerous Goods Code", and "stacking orientation: such as the vector direction of the upward arrow of the identifier", thereby realizing a multi-dimensional deep binding between the cargo's spatial occupancy logic and physical entity.
[0025] Based on the acquired theoretical occupancy coordinates, the adjacency and hierarchical relationships between the three-dimensional grid cells corresponding to the cargo and the three-dimensional grid cells of adjacent loaded cargo are calculated, thereby generating a spatial topology relationship representing the relative position of the cargo in the overall loading space of the container. At the same time, a cryptographic hash algorithm, such as the SHA-256 algorithm, is introduced to perform a one-way hash operation on the aforementioned collected attribute feature data of the cargo, such as physical dimensions, weight, hazard class, and stacking orientation, to extract fixed-length attribute hash values. The theoretical occupancy coordinates, spatial topology relationships, and attribute hash values are then structurally fused and serialized to generate a location information data packet with tamper-proof characteristics.
[0026] The consolidation point node calls the blockchain client and uses an asymmetric encryption mechanism, such as the ECC elliptic curve cryptography algorithm, to digitally sign the generated location information data packet using the consolidation point node's private key to confirm the authenticity of the data source and the integrity of the data. The data body containing the signed location information data packet, timestamp, and consolidation point digital certificate is encapsulated into a block body, and the hash value of the block body is calculated as the block header, thereby formally constructing the initial location block of the goods corresponding to the goods.
[0027] The consolidation point node broadcasts the completed initial cargo location block to all verification nodes in the blockchain network via a P2P network protocol. After receiving the block, the verification nodes verify the validity of the digital signature using the consolidation point's public key and execute a consensus algorithm, such as PBFT (Practical Byzantine Fault Tolerance). Once a majority of nodes in the network reach a consensus, the initial cargo location block is appended to the end of the blockchain distributed ledger, thereby achieving immutable and permanent traceability storage of the initial cargo location data.
[0028] Specifically, the consolidation point system assigns the cargo identification code "B-Elec-001" to the "Type B cargo: electronic equipment cartons". According to the packing plan, it is pre-allocated to the bottom area at the front of the container, and its theoretical occupancy coordinates in the 24-grid multidimensional position matrix are obtained as "X1Y1Z1", which is the three-dimensional grid cell along the first segment of the X-axis, the first column of the Y-axis, and the first layer of the Z-axis. At the same time, the terminal collects the attribute characteristic data of the Type B cargo: the physical dimensions are recorded as 1.2m×1.0m×1.0m, the weight is recorded as 50kg, the hazard class is recorded as "non-hazardous goods: general cargo", and the stacking orientation is recorded as "+Z axis upward".
[0029] The system determines whether adjacent grids of coordinate "X1Y1Z1" already have occupancy data based on the coordinates, and generates spatial topology relationships. For example, it marks that the adjacent grid "X2Y1Z1" is empty, and "X1Y2Z1" has been assigned to another cargo. The system uses the SHA-256 algorithm to perform a hash operation on the attribute feature data string "1.2m×1.0m×1.0m+50kg+non-hazardous goods++Z axis upward" to generate the attribute hash value "0x3A9F…B2C1". The theoretical occupancy coordinates, spatial topology relationships and attribute hash values are serialized in JSON format and packaged into a location information data packet.
[0030] The consolidation point node invokes the ECC algorithm to digitally sign the location information data packet using its private key, generating a signature value "Sig-001". The content containing the location information data packet, signature value, current timestamp, and consolidation point public key certificate is assembled into a block body, its Merkle root is calculated, and a block header is generated, thus completing the construction of the initial location block for type B cargo "B-Elec-001".
[0031] The consolidation point broadcasts the initial location block to the blockchain network. After receiving the broadcast, customs nodes and other supply chain nodes use the consolidation point's public key to verify the signature's legitimacy. Once they confirm that the type B cargo does indeed occupy the "X1Y1Z1" grid and that the attribute hash value is correct, they write the block into the blockchain ledger through the PBFT consensus mechanism. This ensures the absolute credibility and traceability of the location and attribute characteristics data of type B cargo in type A containers at the source of packing.
[0032] refer to Figure 3 In step S12, the specific steps are as follows: S121: The terminal device scans the graphic code on the surface of the goods to be identified and triggers a location identification request for the goods inside the container. At this time, the graphic code on the surface of the goods to be identified is collected, the graphic code is dynamically identified, and the corresponding digital certificate of the goods is extracted during the identification process. The digital certificate of the goods contains ciphertext generated based on the identity of the goods and a hash pointer of the initial location block. S122: Mark the blockchain network and call the smart contract of the blockchain network to automatically trigger the verification logic, thereby using the public key stored in the distributed ledger to verify and decrypt the digital certificate of goods, and then verify the legality of the goods' identity and the integrity of the data. After the verification is passed, the smart contract extracts the actual placeholder coordinates that uniquely correspond to the digital certificate of goods from the initial positioning block of the goods on the chain according to the hash pointer.
[0033] In the embodiments of this application, the terminal device scans the graphic code on the surface of the goods to be identified and triggers a location identification request for the goods inside the container. At this time, the graphic code on the surface of the goods to be identified is collected, the graphic code is dynamically identified, and the corresponding digital certificate of the goods is extracted during the identification process. The digital certificate of the goods contains ciphertext generated based on the identity of the goods and a hash pointer of the initial location block, and a hash pointer is introduced.
[0034] At this point, customs inspectors, equipped with terminal devices such as mobile smart terminals that integrate cameras and customized inspection apps, aim the camera at the graphic code affixed to the surface of the goods to be identified to capture images. The terminal device acquires video frames or image streams containing the graphic code through image sensors, and then generates a location identification request containing device identification code, timestamp, and request type locally. This request is then sent to the access gateway of the blockchain network via a wireless communication network, thereby formally triggering the location identification process for specific goods inside the container.
[0035] The terminal device performs a dynamic recognition process on the acquired graphic code image; it performs preprocessing operations such as grayscale conversion, filtering and noise reduction, and contrast enhancement on the image; it uses an adaptive threshold segmentation algorithm to extract the positioning pattern and timing pattern of the graphic code, and performs perspective transformation and affine correction based on the degree of geometric distortion of the pattern to overcome image distortion caused by tilted shooting angle or curvature of the cargo surface; according to the established graphic code encoding and decoding specifications, such as the matrix decoding rules of QR code or Data Matrix, it performs grid sampling and binarization reading on the corrected image area to complete the dynamic decoding process from visual image to machine-readable code stream.
[0036] The terminal device extracts the corresponding digital certificate of goods from the decoded code stream. This digital certificate of goods is encapsulated using a specific data structure and contains at least two core fields: the first is ciphertext generated based on the identity of the goods. This ciphertext is generated during the consolidation stage using symmetric or asymmetric encryption algorithms based on the attribute feature data of the goods and random factors, and is used to uniquely and securely identify the identity of the goods entity; the second is a hash pointer of the initial location block. This pointer points to the hash value of the block header and the corresponding transaction index of the blockchain distributed ledger that stores the initial location information of the goods. The terminal device deserializes and parses the extracted digital certificate, separating the ciphertext from the hash pointer, so that it can be submitted to the blockchain network for verification and addressing later.
[0037] Specifically, a customs inspection officer opens the inspection APP, and uses the camera of the mobile terminal to scan the QR code affixed to the surface of a type-B cargo carton inside the type-A container; after the terminal camera captures the QR code image, the APP immediately generates a positioning identification request that includes the current inspection officer ID, the current UTC timestamp and the operation type of "positioning inspection", and sends the request to the customs blockchain node gateway via a 5G network, to officially start the positioning and identification process for the type-B cargo.
[0038] Since the inspection officer holds the handheld terminal for scanning in the narrow space inside the container, the shooting angle may be tilted, and the terminal APP activates a dynamic identification mechanism; the captured QR code image is subjected to grayscale processing and Gaussian filtering denoising, three "hui"-shaped positioning patterns at the top left, top right and bottom left of the QR code are extracted, and the included angle of the connecting lines of their center points is calculated; after it is found that the included angle is not a right angle, the system uses a perspective transformation matrix to perform geometric distortion correction on the image to restore it to a standard rectangle; grid sampling and Reed-Solomon error correction decoding are performed on the corrected QR code matrix, and the visual QR code is successfully converted into a binary data stream.
[0039] The terminal APP extracts the digital cargo credential from the binary data stream according to the preset "TLV: Type-Length-Value" protocol format; parsing finds that the digital credential includes two parts: the first part is a ciphertext generated based on the identity of the type-B cargo, for example, a ciphertext string "0xA7B3...F9E2" generated by encrypting "Type-B cargo number Elec-001 + consolidated shipment random number" using the SM2 algorithm, which is used to verify the real identity of the cargo on the chain; the second part is the hash pointer of the initial positioning block, for example, including the block height #12345, the block header hash value "0x000...ABC" and the transaction Merkle path index, the pointer accurately points to the initial positioning data of the type-B cargo recorded in the blockchain ledger, that is, the position information occupying the X1Y1Z1 grid; the terminal device separates and encapsulates the ciphertext and the hash pointer, and prepares to call the smart contract for the next signature verification and data extraction operation.
[0040] Further, the blockchain network is marked, and the smart contract of the blockchain network is invoked to automatically trigger the verification logic, so that the public key stored in the distributed ledger is used to perform signature verification and decryption on the digital cargo credential, and further the identity legitimacy and data integrity of the cargo are verified. After the signature verification is passed, the smart contract extracts the actual occupancy coordinates uniquely corresponding to the digital cargo credential from the initial cargo positioning block on the chain. The introduction of the initial cargo positioning block further controls the digital cargo credential, and improves the accuracy of the actual occupancy coordinates.
[0041] At this point, the terminal device uniquely marks the target blockchain network according to the network routing configuration of the location identification request to ensure that the inspection request is accurately routed to the specific consortium blockchain network that maintains the container logistics data; the terminal device calls the cargo location verification smart contract deployed on the blockchain network and passes the cargo digital certificate extracted in the previous steps as input parameters to the contract interface; after the smart contract listens to the transaction event called from the outside, it automatically activates its internal preset verification logic state machine, so that the process enters the identity and integrity verification stage.
[0042] The smart contract retrieves the public key corresponding to the "container node: the initial on-chain party" from the identity certificate storage block of the blockchain distributed ledger. Using this public key, it performs an asymmetric encryption algorithm to verify the signature of the encrypted text in the goods' digital certificate. By comparing the signature digest with the recalculated data hash value, it verifies whether the data has been tampered with during transmission and storage, thus confirming data integrity. Next, it uses the public key to decrypt the encrypted portion, restoring the plaintext identifier and attribute feature digest of the goods. The decrypted digest is then cross-compared with the attribute hash value initially stored on the chain to verify the legitimacy of the goods' identity and prevent unauthorized access by forged graphic codes.
[0043] Only after the signature verification is successful and the identity is confirmed, the smart contract parses the hash pointer of the initial location block carried in the digital certificate of goods. This hash pointer contains the block header hash value of the target block and the Merkel path index of the transaction data. Based on this pointer, the smart contract performs directional addressing in the blockchain structure of the distributed ledger to quickly locate the specific block storing the initial location information of the goods. It accurately extracts the actual placeholder coordinates uniquely mapped to the digital certificate of goods from the transaction payload of the block. These coordinates are the theoretical placeholder coordinates that have been consensus-stored during the binning stage. The smart contract returns this coordinate data to the terminal device for subsequent spatial rendering.
[0044] Specifically, the customs inspection APP will route the location identification request generated by scanning the B-type cargo carton to the blockchain network marked "Customs Cross-border Logistics Alliance Chain" and call the location verification smart contract with the address "0xVerify…AbC1" on the chain; the APP will pass in the extracted "cargo digital certificate: containing ciphertext and hash pointer" as a parameter, and the smart contract will automatically capture the call event, trigger the internal verification logic state machine, and prepare to execute the verification.
[0045] The smart contract retrieves the public key corresponding to the consortium blockchain's distributed ledger that initially performed the on-chain operation for the Type B goods. Using this public key, the smart contract executes the ECDSA signature verification algorithm on the ciphertext in the digital certificate, confirming a signature digest match. This indicates that the certificate data for the Type B goods has not been tampered with, and the data integrity verification is successful. The smart contract then uses the public key to decrypt the ciphertext, restoring the plaintext identity of the Type B goods, "B-Elec-001," and its attribute digest. This digest matches the attribute hash value, confirming that the electronic device carton is indeed a legitimately reported Type B goods, thus verifying its legitimacy and ruling out the possibility of using a fake QR code to deceive the system.
[0046] After the signature is verified, the smart contract parses the initial positioning block hash pointer contained in the digital certificate, such as pointing to block height #12345 and transaction index Tx[2]. The contract quickly locks block #12345 in the blockchain ledger based on the pointer, and accurately extracts the actual occupant coordinates that uniquely correspond to "B-Elec-001" from the transaction load of Tx[2] - that is, the three-dimensional grid cell index "X1Y1Z1", which represents the position of the A-type container along the first segment of the X-axis, the first column of the Y-axis, and the first layer of the Z-axis. The smart contract packages the "X1Y1Z1" coordinate data into a transaction receipt event and returns it to the verification APP, providing an accurate on-chain coordinate reference for the subsequent red highlight rendering in the simulated container space by the APP.
[0047] refer to Figure 4 In step S13, the specific steps are as follows: S131: Mark the actual occupancy coordinates and map them to the corresponding grid of the multi-dimensional position matrix using a spatial affine transformation mechanism. This simulates the three-dimensional space of the container in the visualization interface of the terminal device. Highlight the spatial position of the grid set containing the actual occupancy coordinates and output a virtual highlight grid. The virtual highlight grid uses a preset warning color rendering strategy to distinguish the goods to be inspected from other goods. S132: Obtain the environmental parameters of the container's internal space, including light intensity, field of view, and occlusion relationship. Combine these parameters with the virtual highlight mesh to determine the corresponding spatial mapping content. At this point, establish a virtual-real fusion mapping content containing depth information and edge features between the virtual highlight mesh and the container's internal space. This allows the highlighted virtual mesh to adaptively fit the real stacking outline in the three-dimensional simulation space according to the switching of the viewing angle.
[0048] In the embodiments of this application, the actual occupant coordinates are marked and mapped to the corresponding grid of the multidimensional position matrix using a spatial affine transformation mechanism, thereby simulating the three-dimensional space of the container in the visualization interface of the terminal device. The set of grids containing the actual occupant coordinates is highlighted in spatial position, and then a virtual highlighted grid is output. The virtual highlighted grid adopts a preset warning color rendering strategy to distinguish the goods to be inspected from other goods, thus introducing highlight rendering.
[0049] At this point, after receiving the actual placeholder coordinates returned by the smart contract, the terminal device marks and parses the coordinate data structure, extracting the grid index logic along the XYZ axes. Since there are differences in spatial dimensions and origin position between the logical coordinate system of the multi-dimensional position matrix and the screen coordinate system of the terminal device's visualization interface, the system introduces a spatial affine transformation mechanism to construct an affine transformation matrix containing translation, rotation, and scaling parameters. By applying this affine transformation matrix to the actual placeholder coordinates at the logical level, the system calculates their absolute spatial position in the world coordinate system of the 3D rendering engine, thereby achieving a precise mapping of the logical coordinates to the corresponding grid in the visualization rendering space, ensuring that the grid position in the virtual space is strictly aligned with the physical space layout of the container.
[0050] Optionally, in the affine transformation stage, the system first uses the inner intersection point of the bottom corners of the container door as the origin of the three-dimensional spatial coordinate system. The physical position of this origin can be reproduced and located using the fixed structural features of the container during each inspection. Based on the internal clearance length, width, and height of the container obtained by three-dimensional laser scanning, the system determines the maximum boundary values of the X-axis, Y-axis, and Z-axis, respectively.
[0051] Based on this, the system establishes an affine transformation matrix from logical coordinates to rendering engine world coordinates. The translation component of this matrix is used to move the origin of the logical coordinate system to the predefined origin position of the container model in the rendering engine world coordinate system. The origin of the container model is preset to the center of the bottom surface of the model's bounding box or the center of the bottom of the door. The scaling component is calculated based on the ratio between the maximum boundary value of the logical coordinates and the corresponding boundary value of the container 3D model in the rendering engine, so that the length unit of each grid cell in the logical space and the virtual length unit in the rendering space form a fixed linear correspondence. The rotation transformation maintains the identity matrix or performs a preset fixed rotation based on the initial orientation of the viewing angle, without introducing random or dynamic rotation parameters.
[0052] The terminal device's graphics rendering engine calls the 3D modeling interface to construct a proportional 3D simulation space of the container in the visualization interface based on the actual physical size and internal structural features of the container. This 3D simulation space supports dual-mode switching between perspective projection and orthographic projection, and is configured with ambient lighting and shadow generation algorithms to enhance the depth and realism of the 3D space. At the same time, based on the granularity division rules of the multi-dimensional position matrix constructed in the previous steps, the corresponding 3D mesh unit boundary wireframes are drawn inside this 3D simulation space to form a visualized spatial reference skeleton, providing a spatial support base for subsequent highlight rendering.
[0053] The rendering engine traverses the mapped mesh set, extracts the hexahedral topological faces and vertex data that make up the mesh set, and modifies the material properties of the corresponding faces of the mesh set to switch the rendering mode from the default base material to a self-illuminating material, and assigns high transparency and high brightness lighting parameters. The rendering pipeline performs rasterization and fragment shading on the above faces, thereby outputting a virtual bright mesh representing the location of the cargo to be identified in the three-dimensional simulation space of the visualization interface, so that it can overcome the limitations of dim lighting and occlusion inside the container at the visual level and present a clearly visible three-dimensional outline.
[0054] Optionally, the system does not directly overlay colors onto the original rendered image. Instead, it first calculates the minimum and maximum corner coordinates of the grid in the logical coordinate system based on the grid index corresponding to the actual placeholder coordinates. Then, it applies the above affine transformation matrix to these eight corner coordinates in sequence to obtain the eight corresponding vertex coordinates in the rendering engine's world coordinate system.
[0055] The system uses these eight vertices to construct a hexahedral mesh model and assigns an independent material instance to it. Regarding material property settings, the system forces the mesh model to have the highest rendering priority, ensuring it is always rendered in front of other regular cargo mesh models. Simultaneously, the material's self-illumination intensity is set to a dynamic coefficient inversely proportional to the ambient light intensity. This coefficient is obtained by real-time acquisition of the container's internal lighting values via the terminal device's light sensor, ensuring that the bright mesh remains clearly visible in dim environments and avoids overexposure that causes glare in bright environments.
[0056] To enable inspectors to instantly identify the target to be inspected, the system applies a preset warning color rendering strategy to the output virtual highlight grid. This strategy maps the fragment colors of the virtual highlight grid to a high-saturation warning color, such as red, at the shader level, and overlays dynamic edge streaming or breathing flashing effects to further enhance visual warning. At the same time, the grid set of other non-inspected goods inside the container is rendered as a low-saturation, low-brightness semi-transparent base color, such as gray-blue or wireframe mode. By utilizing the strong color contrast and visual hierarchy difference, the system clearly distinguishes the goods to be inspected from other goods in the visualization interface, guiding inspectors to directly target the target.
[0057] Specifically, the inspection APP receives the actual location coordinates "X1Y1Z1" of the type B cargo returned by the smart contract, which is the 3D mesh index of the first segment of the X-axis, the first column of the Y-axis, and the first layer of the Z-axis. The APP marks this logical coordinate as the target rendering object. Since the origin of the world coordinate system of the 3D rendering engine is usually located at the center of the screen or the center of the model, while the origin of the logical coordinate is located at the bottom corner of the container door, the system constructs an affine transformation matrix composed of a translation matrix and a scaling matrix to accurately map the logical index "X1Y1Z1" to the corresponding cuboid space region coordinates in the 3D engine.
[0058] Based on the external dimensions and internal clearance dimensions of a Type A container (12.192m × 2.438m × 2.591m), the app renders a scaled 3D container model on a mobile phone screen and draws a light gray wireframe of 24 3D grid cells inside the model, forming a 3D spatial simulation view of the interior of the Type A container.
[0059] The rendering engine locks the mesh area corresponding to "X1Y1Z1", extracts the 8 vertices and 6 faces of the cuboid mesh, forcibly modifies its material properties to a glowing material, and performs rasterization rendering. In the 3D simulation space of the type A container, it outputs a virtual highlight mesh that matches the volume of the type B cargo, making it stand out in the dim virtual container.
[0060] The system invokes the warning color rendering strategy, setting the RGB value of the "X1Y1Z1" virtual highlight grid to pure red (255, 0, 0) in the fragment shader, and adding an edge highlight overflow effect; while the remaining 23 grids inside the container that may contain other goods are rendered as semi-transparent dark gray wireframes; through the APP screen, the inspectors can intuitively see a conspicuous red highlight 3D grid in the bottom area on the left front in the simulated space of the type A container, thereby immediately identifying the exact location of the type B goods to be inspected in the physical container, achieving rapid positioning and verification.
[0061] Furthermore, the environmental parameters of the container's internal space are obtained, including light intensity, field of view, and occlusion relationship. These parameters are then combined with a virtual highlight mesh to determine the corresponding spatial mapping content. At this point, a virtual-real fusion mapping content containing depth information and edge features is established between the virtual highlight mesh and the container's internal space. This allows the highlighted virtual mesh to adaptively fit the real stacking contour in the three-dimensional simulation space according to the switching of the viewing angle, fully considering the real stacking contour.
[0062] At this time, the terminal device acquires environmental parameters of the container's interior space in real time through integrated external sensors and internal attitude calculation modules. Specifically, it uses light sensors to collect the light intensity inside the container to dynamically adjust the self-emission intensity and ambient light occlusion coefficient of the virtual highlight grid in the visualization interface, avoiding overexposure or loss of details in dark areas. The terminal device's gyroscope and accelerometer calculate the spatial attitude of the camera, thereby deducing the current field of view (FOV) and the direction of the observation ray. Simultaneously, based on the multi-dimensional position matrix inside the container and the occupancy coordinates of the loaded goods, a spatial axial bounding box (AABB) tree is constructed. The ray casting algorithm calculates the intersection of the observation ray with each goods bounding box, thereby resolving the occlusion relationship between the goods to be identified and the surrounding goods from the current perspective.
[0063] The system parametrically correlates the previously acquired illumination intensity, field of view, and occlusion relationships with the virtual highlight mesh to determine the corresponding spatial mapping content. Based on the field of view and occlusion relationships, the system calculates the projection envelope region of the virtual highlight mesh on the current two-dimensional view plane and sorts and removes mesh faces completely occluded by surrounding goods according to the projection depth. At the same time, based on the illumination intensity parameters, the system inputs dynamic illumination uniformity variables into the fragment shader of the virtual highlight mesh, so that the spatial mapping content not only corresponds to the multi-dimensional position matrix in geometric position, but also adapts to the real physical environment inside the container in optical performance, providing a visual benchmark for subsequent virtual-real fusion.
[0064] By enabling the depth buffer mechanism of the terminal device rendering engine, the depth map of the container's internal space environment is compared with the depth value of the virtual highlighted mesh on a pixel-by-pixel basis to construct a virtual-real fusion mapping containing accurate depth information. On this basis, the edge pixels where the virtual highlighted mesh intersects with the outline of the real cargo stack are extracted, and an edge detection operator such as the Sobel operator is introduced to extract edge features. Semi-transparent outline strokes and normal perturbation effects are generated at the edge features. By writing the depth occlusion information into the template buffer, the visual representation of the virtual highlighted mesh being partially occluded by real physical occluders is achieved. At the same time, the edge features are enhanced in the unoccluded areas, thereby establishing a visually logically rigorous virtual-real fusion mapping between the virtual highlighted mesh and the container's internal space.
[0065] The main rendering loop of the terminal device monitors the change of observation perspective in real time. When the inspection personnel move the terminal device, causing a change in the field of view or spatial posture, the system re-executes the calculation and rendering logic of steps one to three according to the updated view matrix and projection matrix. The virtual highlight mesh in the virtual-real fusion mapping content dynamically updates its occlusion culling facets and edge feature stroke positions according to the view switching, realizing adaptive adjustment of the rendering state. This ensures that the highlighted virtual mesh always visually fits accurately and closely onto the real stacking outline of the goods in the three-dimensional simulation space, ensuring that the inspection personnel can obtain consistent virtual-real spatial positioning visual guidance with accurate outlines from any observation angle.
[0066] Specifically, customs inspectors used handheld terminal equipment to enter the interior of a Type A container. The terminal's light sensor detected that the light intensity inside the container was only 50 lux. At the same time, the attitude sensor calculated that the current camera's field of view was 60 degrees and the line of sight was angled at 45 degrees towards the bottom left front side of the container. Based on the multi-dimensional position matrix, the system calculated that, under the current line of sight, 30% of the volume of "Type B cargo: electronic equipment carton" located in the "X1Y1Z1" grid was obscured by another cargo in the adjacent grid "X2Y1Z1" on the right, forming a partial obscuration relationship.
[0067] The system inputs a low-light parameter of 50 lux, a field of view of 60 degrees, and a partial occlusion relationship of 30% into the rendering pipeline. Based on the field of view and the occlusion relationship, it determines the effective visible projection area of the virtual highlight mesh on the screen and removes the back and bottom mesh fragments that are completely occluded by the cargo on the right. At the same time, based on the low-light characteristics, it dynamically increases the self-illumination intensity of the red virtual highlight mesh by 1.5 times to ensure sufficient visual alertness in dim environments, thereby determining the spatial mapping content specific to this type B cargo.
[0068] The rendering engine calls the depth buffer to fuse and compare the depth of the 3D model of other goods in the Type A container with the depth of the "X1Y1Z1" red virtual highlight grid. At the boundary where the goods on the right occlude the Type B goods, edge feature pixels are extracted and a bright yellow outline with a width of 2 pixels is generated to mark the outline of the virtual-real boundary. Through template buffer control, the physical goods on the right can naturally occlude the red virtual highlight grid behind them, thereby establishing a virtual-real fusion mapping content that includes depth occlusion information and yellow edge features.
[0069] When the inspector walks around the goods on the right and switches their field of view to face the front of the Type B goods, the system captures the change in perspective in real time. The adaptive rendering logic is updated immediately: the 30% of the previously obscured red virtual highlight grid area is re-rendered and displayed, and the yellow edge outline on the right moves to the left edge of the Type B goods as the perspective changes. Moreover, the adaptive fitting algorithm of the virtual grid ensures that the red highlight area completely and only covers the three-dimensional simulated outline of the 1.2m×1.0m×1.0m electronic device carton. In this way, no matter which angle the inspector observes from, the red highlight virtual grid on the terminal interface is closely fitted to the visible outline of the real goods like a "texture", achieving accurate virtual-real fusion positioning guidance.
[0070] refer to Figure 5 In step S14, the specific steps are as follows: S141: Dynamically identify the spatial mapping content and match spatial anchor points, and combine the spatial ranging mechanism to determine the real-time physical coordinates of the cargo to be identified relative to the container. At the same time, the smart contract of the blockchain network calls the on-chain comparison logic to compare the real-time physical coordinates with the actual occupancy coordinates extracted from the initial positioning block to obtain the corresponding offset vector. S142: If the offset vector is less than the preset offset threshold, it is determined that the physical stacking state of the goods has not been abnormally overturned or misaligned, and the positioning and identification are passed. The smart contract further generates a confirmation and evidence block containing the inspection timestamp, coordinate offset and inspection node signature and puts it on the chain, thereby using the immutable characteristics of the blockchain to form a closed-loop evidence chain of compliant loading of goods. S143: If the offset is greater than or equal to the preset offset threshold, the smart contract's abnormal warning mechanism will be triggered, freezing the flow status of the goods and recording the abnormal offset on the blockchain.
[0071] In the embodiments of this application, the spatial mapping content is dynamically identified and spatial anchor points are matched. The real-time physical coordinates of the cargo to be identified relative to the container are determined by combining the spatial ranging mechanism. At the same time, the smart contract of the blockchain network calls the on-chain comparison logic to compare the real-time physical coordinates with the actual occupant coordinates extracted from the initial positioning block by offset, so as to obtain the corresponding offset vector. The offset vector is introduced.
[0072] At this point, the terminal device's visual processing engine dynamically recognizes the virtual-real fusion mapping content generated in the previous steps. By extracting the feature point set and contour edges of the virtual highlight mesh in the real video stream, it continuously tracks the image performance of the goods to be identified in the physical world. The system introduces a spatial anchor point matching mechanism, using the pre-calibrated "fixed structural features inside the container, such as the corner of the lock hole at the container door and the center of the bottom corner fitting" as the reference spatial anchor point. By calculating the relative perspective transformation relationship between the feature points of the virtual highlight mesh and the above-mentioned reference anchor point, the virtual rendering coordinate system is rigidly aligned with the physical coordinate system of the container, thereby establishing a stable mapping reference from the visual rendering space to the real container space and eliminating coordinate drift caused by device movement or shaking.
[0073] The terminal device, combined with its built-in spatial ranging mechanism, such as a time-of-flight laser ranging sensor or a binocular vision depth sensing module, emits a detection signal to the physical surface of the cargo to be identified and receives the reflected signal, calculating the absolute distance data between the device and the cargo. At the same time, combined with the attitude angle data provided by the terminal inertial measurement unit (IMU), it calculates the three-dimensional spatial position vector of the center point of the cargo to be identified in the container's physical coordinate system with the reference spatial anchor point as the origin. This three-dimensional spatial position vector is the real-time physical coordinate of the cargo to be identified relative to the container, representing the cargo's current physical occupancy within the container.
[0074] The terminal device encapsulates the determined real-time physical coordinate data into a blockchain transaction request and sends it to the blockchain network. After the smart contract deployed on the blockchain network listens to the transaction event, it automatically calls the internally preset on-chain comparison logic. The smart contract obtains the actual occupant coordinates stored in the initial positioning block of the goods from the decryption of the previous steps, which are the theoretical reference coordinates on the chain during the packing stage. Using the actual occupant coordinates as a reference point, it calculates the difference between the real-time physical coordinates and the reference point in each coordinate axis direction. By subtracting the corresponding components of the two coordinate vectors, it obtains an offset vector containing the offset distance and offset direction. This offset vector is output as a quantitative indicator to measure whether the goods have been abnormally displaced, and is used by the subsequent anti-tampering judgment logic.
[0075] Specifically, customs officers hold a terminal device and point it at the red-highlighted B-type cargo inside the container. The terminal's visual engine dynamically identifies the outline of the red-highlighted grid and the actual electronic device carton. The system uses the geometric center of the lower left corner fitting of the A-type container door as the reference spatial anchor point, i.e., the physical coordinate origin O(0,0,0). By matching the perspective relationship between the virtual highlighted grid feature points and this anchor point, the system rigidly aligns the XYZ axes of the terminal rendering space with the length, width, and height axes of the A-type container's physical space, ensuring that the virtual coordinate system completely coincides with the container's real physical coordinate system.
[0076] The terminal device activates the laser rangefinder sensor, emitting a laser pulse towards the center of the front of the Type B cargo carton, and measures the absolute distance between the device and the carton as 1.5 meters. Simultaneously, combined with IMU attitude data, the physical spatial position vector of the carton center relative to the anchor point O is calculated as (1.0m, 0.5m, 0.5m). This vector (1.0, 0.5, 0.5) is the real-time physical coordinate of the Type B cargo within the Type A container, meaning that the carton center is actually located 1.0 meter from the door end, 0.5 meters from the right side wall, and 0.5 meters from the bottom plate.
[0077] The terminal submits the real-time physical coordinates (1.0, 0.5, 0.5) to the blockchain. The smart contract calls the comparison logic to extract the actual placement coordinates from the initial positioning block of the type B goods, i.e., the theoretical reference coordinates uploaded to the blockchain during consolidation, assuming these coordinates are (1.0, 0.5, 0.5). The smart contract performs a vector difference operation between the real-time physical coordinates and the actual placement coordinates: subtracting the actual placement coordinates (1.0, 0.5, 0.5) from the real-time physical coordinates (1.0, 0.5, 0.5) yields an offset vector of (0.0, 0.0, 0.0), indicating that the goods have not shifted in any direction. If, due to transportation bumps, the type B goods slide deeper into the container and to the right, and the real-time physical coordinates become (1.2, 0.7, 0.5), then the smart contract calculates an offset vector of (0.2, 0.2, ...). The value of 0.0 accurately quantifies the displacement of the type B cargo by 0.2 meters along the length direction and 0.2 meters along the width direction, providing a solid on-chain calculation basis for subsequent determination of whether it exceeds the offset threshold.
[0078] Furthermore, if the offset vector is less than the preset offset threshold, it is determined that the physical stacking state of the goods has not been abnormally overturned or misaligned, and the positioning and identification are thus successful. The smart contract further generates a confirmation and evidence block containing the inspection timestamp, coordinate offset, and inspection node signature and uploads it to the chain. This utilizes the immutability of the blockchain to form a closed-loop evidence chain for the compliant loading of goods. At the same time, the spatial mapping content is further controlled, and the smart contracts and offsets of the blockchain network are fully considered, improving the accuracy of positioning and identification of goods inside the container.
[0079] At this point, the smart contract of the blockchain network compares the magnitude of the offset vector or the absolute value of each axial component calculated in the previous steps with the offset threshold preset by the system. This offset threshold is a safety boundary parameter pre-calibrated based on the container transportation vibration tolerance, cargo physical dimensions, and stacking stability model. If the magnitude of the offset vector is strictly less than the offset threshold, it indicates that the cargo to be identified has not undergone translation or rotation beyond the allowable range during transportation or storage, its physical stacking state is stable, and there is no abnormal overturning or misalignment. The state machine of the smart contract then transitions and makes a decision to pass the positioning and identification. Conversely, if the offset is greater than or equal to the threshold, an abnormal alarm logic is triggered.
[0080] In response to the decision that the location identification has passed, the smart contract automatically triggers the data encapsulation logic of the confirmation and evidence storage block; the contract calls the trusted timestamp service in the execution environment to obtain the absolute UTC time of the current block packaging as the verification timestamp; at the same time, the "coordinate offset: containing the data of each component of the offset vector" generated by the previous comparison is written into the block body as the core data of the state change; the private key registered in the blockchain identity authentication system by the "verification node: i.e. the customs terminal node that initiated this verification request" is called, and an asymmetric encryption algorithm is used to digitally sign the above-mentioned verification timestamp, coordinate offset, and hash digest of the digital certificate of goods, generating a verification node signature, thereby ensuring the ownership and non-repudiation of the evidence data.
[0081] The smart contract constructs the block body of the confirmed evidence block from the encapsulated data body containing the verification timestamp, coordinate offset, and verification node signature. It calculates the Merkle root and fills the block header, then broadcasts the confirmed evidence block to all verification nodes in the blockchain network. Each verification node verifies the legality of the block data, the validity of the signature, and the correctness of the state transition according to a consensus protocol such as PBFT or PoA. After reaching a majority consensus, the confirmed evidence block is appended to the end of the blockchain distributed ledger. Thus, from the "initial positioning block: proving the ought position" in the binning stage to the confirmed "evidence block: confirming the actual position" in the verification stage, a complete closed-loop evidence chain of compliant cargo loading confirmed by multi-party consensus is constructed based on the immutable characteristics of the blockchain's chain hash pointer.
[0082] Specifically, the smart contract calculates the real-time physical coordinates of the "Type B Goods; Electronic Device Carton" as (1.02m, 0.51m, 0.49m), while its actual occupancy coordinates extracted from the initial positioning block are (1.0m, 0.5m, 0.5m). Therefore, the offset vector is (0.02, 0.01, ...). -0.01); The system's preset offset threshold is 0.1 meters, which allows for a 10-centimeter transport vibration offset; The smart contract calculates the magnitude of the offset vector. The specific process is as follows: the squares of the X-axis offset of 0.02, the squares of the Y-axis offset of 0.01, and the squares of the Z-axis offset of 0.01 are summed to obtain a total of 0.0006. Then, the square root of this total is taken, and the magnitude of the offset vector is calculated to be approximately 0.024 meters. Since 0.024m is much smaller than the threshold of 0.1m, the contract determines that the electronic device carton has only experienced minor vibration and slippage in the Type A container, and the physical stacking state has not experienced any abnormal overturning or misalignment. The state machine transitions to "Positioning recognition passed".
[0083] The smart contract automatically encapsulates the data, connects to the consortium blockchain's timestamp server, and obtains the current verification time as "2023-10-27T14:30:00Z" as the verification timestamp. It writes the offset data "ΔX=0.02m, ΔY=0.01m, ΔZ=-0.01m" into the block data body. It calls the private key of the customs inspection terminal node (Node-Custom-A) representing this operation to perform ECDSA signing on the timestamp, offset, and B-type cargo document hash, generating the signature value "Sig-Custom-A-0x8F…3D", ensuring that the inspection result is confirmed by specific customs personnel and equipment and is non-repudiable.
[0084] The smart contract packages “2023-10-27T14:30:00Z”, “Δ(0.02,0.01,-0.01)”, and “Sig-Custom-A-0x8F…3D” into a confirmation and evidence block, and broadcasts it to the entire network. After other customs nodes and logistics nodes verify the validity of the signature and the legality of the state machine logic, they write the block into the ledger through PBFT consensus. At this point, for this type B cargo, there is both an initial positioning block that records that it should be loaded into the “X1Y1Z1” grid and a confirmation and evidence block that proves that its actual position is only 0.024m off from the intended position. The two blocks are tightly linked by hash pointers, and by utilizing the immutability of the blockchain, a closed-loop evidence chain is formed to prove that the type B cargo was legally loaded in the type A container and was not illegally switched or seriously displaced.
[0085] Therefore, if the offset is greater than or equal to the preset offset threshold, the smart contract's abnormal warning mechanism is triggered, freezing the circulation status of the goods and recording the abnormal offset on the blockchain, thus introducing the circulation status.
[0086] At this point, the smart contract of the blockchain network compares the magnitude of the offset vector or the maximum absolute value of each axial component calculated in the previous steps with the preset offset threshold. When the magnitude of the offset vector is greater than or equal to the preset offset threshold, it indicates that the cargo to be identified has undergone significant displacement or tilting beyond the physical tolerance range inside the container, which means there is a high suspicion of abnormal overturning, misalignment, or illegal substitution. Based on this, the state machine of the smart contract terminates the normal identification and marks the current state of the cargo as "abnormal" through a branch, thereby completing the state transition from normal comparison to abnormal intervention at the logical level.
[0087] In response to the confirmation of the abnormal state, the smart contract automatically triggers the abnormal warning mechanism. The contract broadcasts a structured warning event message to the entire network by calling the blockchain's distributed event push interface. The recipients of this message include the customs supervision system backend, the LCL point operation and maintenance terminal, and the communication nodes bound to the cargo owner. The warning event message encapsulates the cargo's digital certificate, current offset vector data, and trigger timestamp, driving each associated terminal to pop up a forced-top alarm pop-up window at the user interface layer, triggering audible and visual alarm signals, and simultaneously switching the highlighted rendering grid corresponding to the cargo in the 3D visualization interface from the regular "warning color: such as red" to a high-frequency flashing "emergency alarm color: such as yellow and black stripes" to guide inspection personnel to immediately pay attention and implement on-site intervention.
[0088] To prevent goods with physical anomalies or safety hazards from escaping supervision, the smart contract locks the state machine of the goods in the blockchain ledger. The contract forcibly changes the circulation status of the goods to "frozen" and writes this status field into the corresponding storage slot in the global state tree. In this state, any on-chain transaction request that attempts to change the ownership of the goods, clear customs, or transfer logistics will be identified as an illegal state and rejected during the smart contract's pre-verification. This completely cuts off the possibility of abnormal goods continuing to circulate at the underlying logic of the blockchain until inspectors complete a thorough offline investigation and submit an anomaly removal instruction on the chain.
[0089] The smart contract encapsulates all traceability data from this anomaly determination into an anomaly offset record. This record includes at least: the digital certificate of the goods, the real-time physical coordinates at the time of the anomaly trigger, the initial actual occupancy coordinates, the offset vector value, the over-limit threshold parameter, the verification timestamp, and the warning event hash. After the contract structures and serializes the above data, it uses the verification node's private key to perform digital signature, generating a non-repudiable anomaly offset record block. After the block is verified by the blockchain network consensus algorithm, it is appended to the end of the distributed ledger, forming a closed-loop evidence chain with the previous initial positioning block, ensuring that the anomaly is permanently fixed for subsequent accountability and judicial evidence collection.
[0090] Specifically, the smart contract calculates the real-time physical coordinates of the "Type B cargo: electronic device carton" as (3.5m, 1.8m, 0.2m), while the actual occupancy coordinates extracted from the initial positioning block are (1.0m, 0.5m, 0.5m), thus yielding an offset vector of (2.5, 1.3, -0.3). The system's preset offset threshold is 0.5 meters. The smart contract calculates the offset vector magnitude as follows: it sums the squares of the X-axis offset of 2.5, the Y-axis offset of 1.3, and the Z-axis offset of 0.3, obtaining a total of 8.03. Taking the square root of this sum, the calculated offset vector magnitude is approximately 2.82 meters. This magnitude of 2.82 meters represents the total absolute linear displacement of the center point of the actual physical location of the cargo in the container's three-dimensional space relative to the theoretical reference center point recorded in the initial positioning block of the blockchain. This value intuitively reflects the overall magnitude of the cargo's deviation from its original position. Since 2.82m is much greater than the threshold of 0.5m, the contract determines that the type B cargo has been seriously misplaced in the type A container, which is very likely due to loading collapse or misloading. The state machine immediately transitions to the "abnormal" state.
[0091] The smart contract triggers an anomaly warning mechanism, sending a warning event containing "Type B cargo number Elec-001 deviates beyond limit" to the customs inspection APP and the back-end control center through the blockchain event subscription push service. After receiving the event, the inspection APP emits a high-frequency alarm sound on the terminal interface and instantly switches the originally bright red virtual grid in the three-dimensional simulation space of the Type A container to high-frequency flashing yellow and black stripes, indicating to the inspection personnel that the Type B cargo has seriously deviated from its original position.
[0092] The smart contract forcibly overwrites the circulation status field of type B goods "Elec-001" from "under inspection" to "frozen" in the ledger status database. At this time, if the cargo owner or logistics provider attempts to initiate a "clearance" smart contract call for the batch of electronic devices on the consortium blockchain, the contract will directly throw a status exception interruption after verifying that the circulation status is "frozen", refusing to release the transaction package and ensuring that the misplaced goods are strictly detained in the regulatory area.
[0093] The smart contract packages the anomaly details, generating an anomaly offset record containing real-time physical coordinates (3.5, 1.8, 0.2), offset vector (2.5, 1.3, -0.3), threshold 0.5, and trigger timestamp. After being signed by the customs node's private key, this anomaly offset record block is broadcast and written into the blockchain ledger via PBFT consensus. This block is closely linked to the initial positioning block that previously recorded the location of the Type B goods in the X1Y1Z1 grid through hash pointers, forming an irrefutable closed loop of evidence proving that the electronic device carton was severely displaced during transportation and has been intercepted by customs. Any unilateral tampering is impossible.
[0094] It should be noted that although multiple modules are mentioned in the detailed description above, this division is not mandatory; in fact, according to the embodiments of this disclosure, the features and functions of two or more modules or described above can be embodied in one module; conversely, the features and functions of one module described above can be further divided into multiple modules to be embodied.
[0095] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the disclosure herein; this application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein; the specification and embodiments are to be considered exemplary only.
[0096] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A blockchain-based method for locating and identifying cargo inside a container, characterized in that, include: The dimensions of the container are collected, and the corresponding multi-dimensional position matrix is determined by combining the internal space of the container. The theoretical occupancy coordinates of the cargo in the multi-dimensional position matrix are obtained, and the position information is generated by combining the cargo attribute feature data, thereby forming the initial positioning block of the cargo. When a request to locate and identify cargo inside a container is received, the graphic code on the surface of the cargo to be identified is collected, the corresponding digital certificate of the cargo is extracted, the smart contract of the blockchain network verifies and decrypts the digital certificate of the cargo, and extracts the actual occupancy coordinates corresponding to the digital certificate of the cargo from the initial positioning block of the cargo. The actual occupancy coordinates are mapped to the corresponding grid of the multi-dimensional position matrix, and the spatial position is highlighted to output a virtual highlighted grid. The corresponding spatial mapping content is further determined by combining the internal space of the container. Based on the recognition of the spatial mapping content, the real-time physical coordinates of the goods to be identified relative to the container are determined. The smart contract of the blockchain network compares the real-time physical coordinates with the actual occupancy coordinates by offset. If the offset is less than the preset offset threshold, the positioning recognition is deemed successful, and a confirmation block is generated and uploaded to the chain.
2. The method for locating and identifying cargo inside a container based on blockchain according to claim 1, characterized in that, The dimensions of the container are collected, and a corresponding multi-dimensional position matrix is determined based on the container's internal space. The theoretical occupancy coordinates of the cargo in the multi-dimensional position matrix are obtained, and position information is generated by combining cargo attribute feature data, thereby forming an initial cargo positioning block, including: The three-dimensional dimensions of the container are acquired by three-dimensional laser scanning, and a corresponding multi-dimensional position matrix is constructed based on the structural characteristics of the container's internal space. The multi-dimensional position matrix divides the container's internal space into multiple three-dimensional grid units according to the XYZ axes.
3. The method for locating and identifying cargo inside a container based on blockchain according to claim 2, characterized in that, The process of collecting the dimensions of the container, determining the corresponding multi-dimensional position matrix based on the container's internal space, obtaining the theoretical occupancy coordinates of the cargo in the multi-dimensional position matrix, and generating position information by combining cargo attribute feature data, thereby forming an initial cargo positioning block, also includes: Each shipment reported by the consolidation point is marked, and its theoretical location coordinates in a multi-dimensional location matrix are obtained. At the same time, the attribute feature data of the shipment is collected, including its physical dimensions, weight, hazard class, and stacking orientation. Combined with the theoretical location coordinates, location information containing spatial topology and attribute hash values is generated. Then, an asymmetric encryption mechanism is used to digitally sign the location information, thereby forming the corresponding initial location block of the shipment. The initial location block of the shipment is then broadcast to the blockchain network for consensus storage.
4. The method for locating and identifying cargo inside a container based on blockchain according to claim 1, characterized in that, When a location identification request for goods inside a container is received, the graphic code on the surface of the goods to be identified is collected, the corresponding digital certificate of the goods is extracted, and the smart contract of the blockchain network verifies and decrypts the digital certificate of the goods. The actual occupant coordinates corresponding to the digital certificate of the goods are extracted from the initial location block of the goods, including: The terminal device scans the graphic code on the surface of the cargo to be identified and triggers a location identification request for the cargo inside the container. At this time, the graphic code on the surface of the cargo to be identified is collected, the graphic code is dynamically identified, and the corresponding cargo digital certificate is extracted during the identification process. The cargo digital certificate contains ciphertext generated based on the cargo identity and a hash pointer of the initial location block.
5. The method for locating and identifying cargo inside a container based on blockchain according to claim 4, characterized in that, When a location identification request for goods inside a container is received, the process includes collecting the graphic code on the surface of the goods to be identified, extracting the corresponding digital certificate, verifying and decrypting the digital certificate using a smart contract on the blockchain network, and extracting the actual occupant coordinates corresponding to the digital certificate from the initial location block of the goods. The process also includes: The blockchain network is marked, and its smart contract is invoked to automatically trigger the verification logic. The public key stored in the distributed ledger is used to verify and decrypt the digital certificate of goods, thereby verifying the legality of the goods' identity and the integrity of the data. After the verification is successful, the smart contract extracts the actual placeholder coordinates that uniquely correspond to the digital certificate of goods from the initial positioning block of the goods on the chain according to the hash pointer.
6. The method for locating and identifying cargo inside a container based on blockchain according to claim 1, characterized in that, The process of mapping the actual occupant coordinates to the corresponding grid of the multi-dimensional position matrix and performing spatial highlight rendering to output a virtual highlight grid, further combining the internal space of the container to determine the corresponding spatial mapping content, includes: The actual occupant coordinates are marked and mapped to the corresponding grid of the multi-dimensional position matrix using a spatial affine transformation mechanism. This simulates the three-dimensional space of the container in the visualization interface of the terminal device. The set of grids containing the actual occupant coordinates is highlighted in spatial position, and then a virtual highlighted grid is output. The virtual highlighted grid uses a preset warning color rendering strategy to distinguish the goods to be inspected from other goods.
7. The method for locating and identifying cargo inside a container based on blockchain according to claim 6, characterized in that, The process of mapping the actual occupant coordinates to the corresponding grid of the multi-dimensional position matrix and performing spatial highlight rendering to output a virtual highlight grid, further combining the internal space of the container to determine the corresponding spatial mapping content, also includes: The environmental parameters of the container's internal space are obtained, including light intensity, field of view, and occlusion relationship. These parameters are then combined with a virtual highlight mesh to determine the corresponding spatial mapping content. At this point, a virtual-real fusion mapping content containing depth information and edge features is established between the virtual highlight mesh and the container's internal space, enabling the highlighted virtual mesh to adaptively fit the real stacking outline in the three-dimensional simulation space according to the switching of the viewing angle.
8. The method for locating and identifying cargo inside a container based on blockchain according to claim 1, characterized in that, The real-time physical coordinates of the cargo to be identified relative to the container are determined based on the recognition of the spatial mapping content, and the smart contract of the blockchain network compares the real-time physical coordinates with the actual occupancy coordinates by offset. If the offset is less than the preset offset threshold, the location identification is deemed successful, and a confirmation block is generated and uploaded to the blockchain, including: The spatial mapping content is dynamically identified and spatial anchor points are matched. Combined with a spatial ranging mechanism, the real-time physical coordinates of the cargo to be identified relative to the container are determined. At the same time, the smart contract of the blockchain network calls the on-chain comparison logic to compare the real-time physical coordinates with the actual occupant coordinates extracted from the initial positioning block to obtain the corresponding offset vector.
9. The method for locating and identifying cargo inside a container based on blockchain according to claim 8, characterized in that, The real-time physical coordinates of the cargo to be identified relative to the container are determined based on the recognition of the spatial mapping content, and the smart contract of the blockchain network compares the real-time physical coordinates with the actual occupancy coordinates by offset. If the offset is less than the preset offset threshold, the location identification is deemed successful, and a confirmation block is generated and uploaded to the blockchain. This also includes: If the offset vector is less than the preset offset threshold, it is determined that the physical stacking state of the goods has not been abnormally overturned or misaligned, and the positioning and identification are passed. The smart contract further generates a confirmation and evidence block containing the inspection timestamp, coordinate offset and inspection node signature and puts it on the chain, thereby using the immutable characteristics of the blockchain to form a closed-loop evidence chain of compliant loading of goods. If the offset is greater than or equal to the preset offset threshold, the smart contract's abnormal warning mechanism will be triggered, freezing the flow status of the goods and recording the abnormal offset on the blockchain.
10. A blockchain-based container internal cargo location and identification system, characterized in that, The blockchain-based container interior cargo location and identification system is applied to the blockchain-based container interior cargo location and identification method as described in any one of claims 1-9; the blockchain-based container interior cargo location and identification system includes: The positioning block module is used to collect the dimensions of the container and determine the corresponding multi-dimensional position matrix based on the internal space of the container. It obtains the theoretical occupancy coordinates of the cargo in the multi-dimensional position matrix and generates position information by combining the cargo attribute feature data, thereby forming the initial positioning block of the cargo. The coordinate module is used to collect the graphic code on the surface of the cargo to be identified when a location identification request for cargo inside the container is received, extract the corresponding digital certificate of the cargo, and the smart contract of the blockchain network verifies and decrypts the digital certificate of the cargo, extracting the actual occupancy coordinates corresponding to the digital certificate of the cargo from the initial location block of the cargo. The spatial mapping module is used to map the actual occupancy coordinates to the corresponding grid of the multi-dimensional position matrix and perform highlight rendering of the spatial position to output a virtual highlight grid. The corresponding spatial mapping content is further determined by combining the internal space of the container. The blockchain module is used to determine the real-time physical coordinates of the goods to be identified relative to the container based on the recognition of the spatial mapping content. The smart contract of the blockchain network compares the real-time physical coordinates with the actual occupancy coordinates by offset. If the offset is less than the preset offset threshold, the positioning recognition is deemed successful, and a confirmation block is generated and uploaded to the chain.