A cross-border logistics management method and system based on blockchain
By storing data on the chain in real time at each logistics node in cross-border logistics, and using the consensus algorithm of the blockchain, the problem of logistics data tampering is solved, a credible evidence chain is provided, and the reliability and transparency of dispute handling are improved.
Patent Information
- Application Number
- CN202311466911.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-07
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2043-11-07
AI Technical Summary
In cross-border logistics, existing technology cannot effectively prevent logistics nodes from tampering with data, resulting in a lack of credible evidence when handling disputes.
Adopting a cross-border logistics management method based on blockchain, by collecting and storing logistics data in real time at each logistics node, reducing the possibility of data tampering, and ensuring the integrity and non-tamperability of data through the consensus algorithm of the blockchain sex.
Real-time on-chain storage of data at each logistics node in cross-border logistics is realized, which significantly reduces the possibility of data tampering, provides a credible evidence chain, and improves the reliability and transparency of dispute handling.
Smart Images

Figure CN117522248B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cross-border logistics management, and in particular to a cross-border logistics management method and system based on blockchain. Background Art
[0002] As the scale of the logistics industry grows rapidly, disputes caused by logistics (such as package loss, package damage, etc.) are also increasing. In order to deal with disputes, it is necessary to produce evidence that is credible to all parties involved in the dispute. Such evidence is generally information on key logistics nodes in the entire life cycle of logistics (key logistics nodes are key events in a series of logistics processes, such as the node where package sorting is completed and the node where package transfer is completed). According to the regions involved in the logistics process, logistics can be divided into domestic logistics and cross-border logistics. The entire domestic logistics process can be completed by one logistics company. For example, logistics companies such as China Post and SF Express can complete the entire life cycle of domestic logistics alone. However, due to the constraints of business qualifications of various countries and cross-continental transportation capabilities, cross-border logistics generally requires multiple companies in multiple countries to cooperate to complete the transportation process of a package. At the same time, due to the extremely high cost of cross-border logistics, for multiple packages with the same starting point and end point on a certain route, first use the method of combining packages, and then sort and continue transportation after reaching the end point. This is also a common method in cross-border logistics. For example, a package costs $5, and 5 packages cost a total of $25. However, after the 5 packages are combined, if they do not reach the limited weight, they only cost $5, which can save $20. However, whether it is domestic logistics or cross-border logistics, it is necessary to provide a logistics management system that records the information of the logistics process and can provide credible evidence to the parties in the event of subsequent disputes.
[0003] After searching, the Chinese patent (patent name, a logistics tracking method based on blockchain; publication number, CN106022681A) proposed a logistics tracking method based on blockchain, which is applied to a logistics information network system with a master node and several slave nodes for maintaining blockchain, and the slave nodes include user sending nodes, logistics nodes and user receiving nodes; the logistics tracking method is as follows: the user sending node uploads the package information to the master node; the master node generates a digital fingerprint for the package information uploaded by the user sending node, writes it into the blockchain together with the corresponding timestamp, and broadcasts the blockchain in all slave nodes; each logistics node generates the package status information according to the digital fingerprint and the node information of itself and the corresponding next logistics node in accordance with the logistics space transmission path of the package, and the master node writes it into the blockchain; the corresponding user receiving node signs for the package and forms the package receipt information and uploads it to the master node to write it into the blockchain. It can be seen that the solution provided in the above patent uses blockchain to store the information of key logistics nodes in the whole life cycle of logistics. Based on the characteristics of blockchain that are difficult to tamper with, it can provide credible evidence to all parties in the event of subsequent disputes.
[0004] In the above scheme, each slave node corresponding to the key logistics node does not need to upload the package information to the blockchain immediately after obtaining the package information. Instead, it needs to sign each package information and upload it to the master node first. The master node then verifies the signatures of each slave node to confirm that the corresponding package information is sent by the corresponding slave node, and finally performs the operation of storing the package information on the chain. It can be seen that the master node can only verify whether the package information comes from the slave node. There is a possibility that the slave node tampers with the package information before sending it to the master node. Time is one of the most concerned indicators in logistics. Taking time as an example, if the event corresponding to the slave node is sorting completion, the slave node may modify the time of sorting completion and then send the package information to the master node. Summary of the invention
[0005] The present invention provides a cross-border logistics management method and system based on blockchain, which can directly store the collected logistics data on the chain in real time at each logistics node, thereby reducing the possibility of each logistics node tampering with the logistics data.
[0006] In order to achieve the above object, the present invention provides the following scheme:
[0007] A cross-border logistics management method based on blockchain is applied in a blockchain network composed of logistics terminals and storage servers deployed at multiple logistics nodes, each logistics terminal constitutes a terminal node of the blockchain network, and the storage server constitutes a server node of the blockchain network;
[0008] The method comprises:
[0009] The logistics terminal generates package information in response to the barcode scanned on the package; the package information includes the package identification number corresponding to the barcode, the logistics node event corresponding to the logistics terminal, and the time corresponding to the scanning of the barcode;
[0010] When the logistics terminal detects the generation of package information, it uploads the package information to the storage server in real time and stores the digital fingerprint of the package information in the blockchain;
[0011] The storage server associates the received package information with the corresponding package identification number so as to query the package information corresponding to the corresponding package at each logistics node based on the package identification number.
[0012] As a further improvement, when the logistics terminal detects the generation of package information, the digital fingerprint of the package information is stored in the blockchain through the following steps:
[0013] The logistics terminal encapsulates the digital fingerprint into logistics data and broadcasts the logistics data to the blockchain network, so that other nodes in the blockchain add the logistics data to the memory pool;
[0014] The node that generates a new block in the blockchain network selects the corresponding logistics data from the memory pool according to the set strategy, encapsulates it into a candidate block of the current block height, and broadcasts the candidate block to the blockchain network, so that other nodes in the blockchain can verify the candidate block;
[0015] After each node in the blockchain verifies the candidate block, the candidate block is added to the blockchain to store the digital fingerprint of the package information in the blockchain.
[0016] As a further improvement, the memory pool includes a non-compressed memory pool and a compressed memory pool;
[0017] Other nodes in the blockchain add logistics data to the memory pool, including:
[0018] When each node in the blockchain receives the logistics data, it determines whether the logistics data belongs to a compressed package in the first compression format. If not, the logistics data is added to the non-compressed memory pool. If so, a new compressed memory pool is created for the current compressed package, the current compressed package is decompressed, and the multiple pieces of data obtained by decompression are added to the compressed memory pool.
[0019] The node generating the new block selects the corresponding logistics data from the memory pool according to the set strategy and encapsulates it to form a candidate block of the current block height, which specifically includes:
[0020] When a node generating a new block detects that there is data in the compression memory pool, it will first select all the data from the compression memory pool as the data required to encapsulate and form a candidate block of the current block height;
[0021] When it is detected that the amount of all data selected from the compression class memory pool is not greater than the maximum amount of data allowed for a single block, the data required to form a candidate block of the current block height based on the obtained encapsulation is encapsulated to form a candidate block of the current block height.
[0022] As a further improvement, the memory pool includes a non-compressed memory pool and a compressed memory pool;
[0023] Other nodes in the blockchain add logistics data to the memory pool, including:
[0024] When each node in the blockchain receives the logistics data, it determines whether the logistics data belongs to a compressed package in the first compression format. If not, the logistics data is added to the non-compressed memory pool. If so, a new compressed memory pool is created for the current compressed package, the current compressed package is decompressed, and the multiple pieces of data obtained by decompression are added to the compressed memory pool.
[0025] The node generating the new block selects the corresponding logistics data from the memory pool according to the set strategy and encapsulates it to form a candidate block of the current block height, which specifically includes:
[0026] When a node generating a new block detects that there is data in the compression memory pool, it will first select all the data from the compression memory pool as the data required to encapsulate and form a candidate block of the current block height;
[0027] When it is detected that the amount of all data selected from the compression memory pool is greater than the maximum amount of data allowed for a single block, all data selected from the compression memory pool is divided into an available part and a remaining part; the amount of data in the available part is not greater than the maximum amount of data allowed for a single block;
[0028] The available part is used as the data required for encapsulating and forming the candidate block of the current block height, and the data required for encapsulating and forming the candidate block of the current block height is encapsulated based on the obtained encapsulation to form the candidate block of the current block height; at the same time, the remaining part is deleted from the compression class memory pool and the remaining part is packaged into a compressed package in a second compression format and the compressed package in the second compression format is broadcasted to the blockchain network as logistics data, so that other nodes in the blockchain add the compressed package in the second compression format to the memory pool.
[0029] As a further improvement, the memory pool also includes a priority class memory pool;
[0030] Other nodes in the blockchain add the compressed package in the second compression format to the memory pool, specifically including:
[0031] When each node in the blockchain receives the logistics data, it determines whether the logistics data belongs to a compressed package in the second compression format. If so, it decompresses the compressed package in the second compression format and adds the decompressed multiple data to the priority class memory pool, so that the data exists in the priority class memory pool;
[0032] The method further comprises:
[0033] When there is data in the priority memory pool, the node generating the new block selects the corresponding logistics data from the memory pool according to the set strategy and encapsulates it to form a candidate block of the current block height, which specifically includes:
[0034] When a node generating a new block detects that there is data in the priority memory pool, it will first select all the data from the priority memory pool as the data required to encapsulate and form a candidate block of the current block height;
[0035] When it is detected that the amount of all the data selected from the priority memory pool is not greater than the maximum amount of data allowed for a single block, the data required to form a candidate block of the current block height based on the obtained encapsulation is encapsulated to form a candidate block of the current block height;
[0036] When it is detected that the amount of all data selected from the priority memory pool is greater than the maximum amount of data allowed for a single block, all data selected from the priority memory pool is divided into an available part and a remaining part; the amount of data in the available part is not greater than the maximum amount of data allowed for a single block;
[0037] The available part is used as the data required for encapsulating and forming the candidate block of the current block height, and the data required for encapsulating and forming the candidate block of the current block height is encapsulated based on the obtained encapsulation to form the candidate block of the current block height; at the same time, the remaining part is deleted from the priority class memory pool and the remaining part is packaged into a compressed package in the second compression format and the compressed package in the second compression format is broadcasted to the blockchain network as logistics data, so that other nodes in the blockchain add the compressed package in the second compression format to the memory pool.
[0038] As a further improvement, the method further includes the following package anomaly detection step:
[0039] The logistics terminal at the package assembly site obtains a first photo of all large packages when they are packed by taking photos, and the first photo shows the first relative position information between the barcodes of multiple small packages packed into a large package at the package assembly site;
[0040] The logistics terminal at the unpacking site obtains a second photo of the target large package when it is unpacked by taking photos, and the second photo shows second relative position information between the barcodes of multiple small packages packed into a large package at the unpacking site; the target large package is a large package that does not need to be unpacked for verification at the clearing point;
[0041] Comparing the first relative position information with the second relative position information to obtain a comparison result;
[0042] Determine whether the target large package is abnormal based on the comparison result.
[0043] As a further improvement, the logistics terminal generates package information in response to the barcode scanned on the package, specifically including:
[0044] When the barcode scanned by the logistics terminal is the package identification number corresponding to the small package, the generated package information includes the package identification number of the small package corresponding to the barcode, the logistics node event corresponding to the logistics terminal, and the time corresponding to the scanning of the barcode;
[0045] When the barcode scanned by the logistics terminal is the package identification number corresponding to the large package, the package information corresponding to the multiple small packages assembled to obtain the large package is generated respectively, and the generated package information corresponding to each small package includes the package identification number of the small package corresponding to the barcode, the logistics node event corresponding to the logistics terminal, and the time corresponding to the scanning of the barcode;
[0046] The large package is assembled from a plurality of small packages, and a package identification number of the large package is associated with the package identification numbers of the plurality of small packages assembled to form the large package.
[0047] As a further improvement, the package information also includes package assembly data, the package assembly data includes a package assembly mark for indicating whether the current package is a package assembly package at each logistics node and a package identification number of a small package assembled together with the current package to form a large package, and the method also includes the step of obtaining logistics data corresponding to each logistics node for the target package from the blockchain network:
[0048] The storage server obtains the time corresponding to the scanned barcode of the target package at each logistics node from the database;
[0049] For each logistics node of the target package, the storage server uses the time corresponding to the scanned barcode corresponding to each logistics node as the target time point, and starts from the block in the blockchain whose timestamp corresponds to a time later than the target time point and closest to the target time point, and traverses each logistics data in the block until it matches the logistics data with the same digital fingerprint as the package information corresponding to each logistics node;
[0050] When the storage server detects that the target package is a packaged package at the corresponding logistics node, the method further includes the step of obtaining logistics data of other small packages that belong to the same large package as the target package at the corresponding logistics node:
[0051] When the storage server matches the logistics data corresponding to the target package in the corresponding logistics node, the block where the logistics data corresponding to each logistics node is matched is taken as the target block. All logistics data of the target block are matched first. When the target block matches the logistics data of all small packages belonging to the same large package as the target package, the matching is completed; otherwise, the previous block and the next block of the target block are continued to be matched until the logistics data of all small packages belonging to the same large package as the target package are matched.
[0052] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the steps of the above method when executing the computer program.
[0053] A computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the above method when executed by a processor.
[0054] Compared with the prior art in which logistics data is sent to the same master node for chain-up, resulting in the possibility of data tampering by the devices at each logistics node before sending the data to the master node, this embodiment provides a cross-border logistics management method and system based on blockchain. This solution generates package information at each logistics node once the logistics terminal scans the barcode of the package, and sends the package information to the storage server in real time, and directly stores the collected logistics data on the chain in real time at each logistics node, thereby reducing the possibility of each logistics node tampering with the package information and logistics data. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 A schematic diagram of the working principle of a cross-border logistics management method based on blockchain provided by the present invention;
[0056] Figure 2 A flowchart of a cross-border logistics management method based on blockchain provided by the present invention;
[0057] Figure 3 A flowchart of a cross-border logistics management method based on blockchain provided by the present invention;
[0058] Figure 4 A flowchart of a cross-border logistics management method based on blockchain provided by the present invention;
[0059] Figure 5A flowchart of a cross-border logistics management method based on blockchain provided by the present invention;
[0060] Figure 6 A schematic diagram of a process flow of a cross-border logistics management method based on blockchain provided by the present invention. DETAILED DESCRIPTION
[0061] like Figure 1 The figure is a schematic diagram of the working principle of a cross-border logistics management method based on blockchain provided in an embodiment of the present invention. As shown in the figure, the method is applied in a blockchain network composed of logistics terminals and storage servers deployed at multiple logistics nodes, each logistics terminal constitutes a terminal node of the blockchain network, and the storage server constitutes a server node of the blockchain network. Specifically, Figure 1 Four logistics terminals are shown, including logistics terminal 1, logistics terminal 2, logistics terminal 3, logistics terminal 4 and a storage server. These five devices constitute nodes of the blockchain network respectively. These nodes have the following functions: packaging data into logistics data and then broadcasting it to the blockchain network, competing through consensus algorithms to become nodes that generate new blocks, and after becoming nodes that generate new blocks, encapsulating the received logistics data to generate new blocks and then putting them on the chain and broadcasting the blocks to other nodes of the blockchain network. After receiving the new blocks, other nodes also put the blocks on the chain. In a specific business scenario, logistics terminal 1 and logistics terminal 2 can be computer devices with the function of scanning one-dimensional barcodes and two-dimensional barcodes in logistics sites deployed by overseas logistics partners, and logistics terminal 3, logistics terminal 4 and storage servers are computer devices with the function of scanning one-dimensional barcodes and two-dimensional barcodes deployed in China.
[0062] In cross-border logistics, the cooperation of multiple logistics companies is required. For example, user A places an order for a product on the US e-commerce platform B. In order to save freight, the US company C is entrusted to transport the product in a package-by-package manner. The origin of the package is O and the destination is F, that is, the products in the large package have the same route from O to F. Company C is only responsible for transportation in the United States and customs clearance for export in the United States. After customs clearance in the United States, Company D transports the product to the Chinese port in the international transportation stage and completes import customs clearance. After customs clearance, it is handed over to domestic company E for transportation. After Company E transports the large package to F (such as the North China sorting center), it splits the small packages in the large package and then arranges transportation from the corresponding logistics route to the final destination of each package according to the destination of each small package.
[0063] Among them, logistics terminal 1 is a device deployed by Company C at the package assembly site. Once the assembly of multiple packages is completed, the QR code on the large package can be scanned by logistics terminal 1 to generate the package information corresponding to the multiple small packages associated with the large package. For example, the package identification number of the large package is A, and the package identification numbers of the four small packages assembled to form the large package are a1, a2, a3, and a4. Once the logistics terminal 1 scans the QR code of the large package, the package information corresponding to the four small packages a1, a2, a3, and a4 will be generated and uploaded to the storage server for storage. When generating the package information, the software on the logistics terminal 1 determines that the logistics node event corresponding to the logistics terminal of the terminal is package assembly according to the preset rules. Other possible logistics node events also include sorting, customs clearance, etc. The barcode scanning time is 18:35:24 on October 1, 2023. According to this information, it can be determined that the large package A has completed the assembly at 18:35:24 on October 1, 2023. According to the site address information bound to the logistics terminal 1, for example, an address in Los Angeles, USA (i.e., location O), the user can query the package information of his package a1 from the storage server through the mobile phone. It can be understood that since the goods in the large package have the same route between O and F, if the package is not unpacked between O and F, the four small packages a1, a2, a3, and a4 that are assembled to form the large package have the same logistics node information in the assembled state.
[0064] Logistics terminal 2 is a device deployed by company D at the corresponding logistics site where the goods are waiting for import customs clearance. Large package A is transported to this location, indicating that large package A is at a node waiting for import customs clearance. At this time, the QR code on large package A is scanned using logistics terminal 2. The time of scanning the barcode is 12:30:20 on October 5, 2023. According to this information, it can be determined that large package A arrived at the location waiting for import customs clearance at 12:30:20 on October 5, 2023. Correspondingly, a special logistics terminal 5 can also be set up and equipped to be held by the staff at this location, so that when the customs personnel open the package for inspection, the staff can scan the QR code of the package that was opened for inspection during the customs clearance process through the logistics terminal 5, and generate the corresponding package information based on the logistics node event of being opened for inspection and upload it to the storage server.
[0065] After completing import customs clearance, domestic company E will continue to transport large package A to location F. Logistics terminal 3 is deployed at location F. The logistics node event corresponding to logistics terminal 3 is pre-set to "the package has arrived at the sorting center at location F and is being sorted". That is, when logistics terminal 3 scans the QR code of large package A, it will generate package information corresponding to 4 small packages a1, a2, a3, and a4, which is used to record the logistics nodes where the current 4 small packages a1, a2, a3, and a4 are located, that is, "the package has arrived at the sorting center at location F and is being sorted".
[0066] At location F, four small packages a1, a2, a3, and a4 will be transported to four corresponding final destinations respectively, and logistics terminal 4 is located at the delivery station corresponding to the final destination of a1. The logistics node event corresponding to logistics terminal 4 is pre-set to "The package has arrived at the delivery center in location G. Your package is being delivered. Please keep your phone open." Therefore, when logistics terminal 4 scans the QR code of small package a1, it will generate the package information corresponding to a1, which is used to record the current logistics node where a1 is located, that is, "The package has arrived at the delivery center in location G. Your package is being delivered. Please keep your phone open."
[0067] Combining the above content Figure 1 The application scenario of a cross-border logistics management method based on blockchain provided by the present invention is described below. Figures 2 to 6 Embodiments of the present invention are described in detail.
[0068] Reference Figure 1 In one embodiment, a cross-border logistics management method based on blockchain is provided, the method comprising:
[0069] Step S101, the logistics terminal generates package information in response to the barcode scanned on the package; the package information includes the package identification number corresponding to the barcode, the logistics node event corresponding to the logistics terminal, and the time corresponding to the scanning of the barcode.
[0070] For example, the parcel identification number is a1, and the logistics node event corresponding to the logistics terminal 4 is pre-set to "the parcel has arrived at the delivery center in location G, your parcel is being delivered, please keep your phone available for normal answering", and the time corresponding to the barcode scanning is 19:10:05 on October 15, 2023. Once the logistics terminal 4 scans the barcode on the parcel, it will integrate the above information into the parcel information. Furthermore, the site address information bound to the logistics terminal 4 can also be integrated into the parcel information, and based on step S101, a piece of parcel information of parcel a1 at a certain logistics node can be obtained.
[0071] Step S102, when the logistics terminal detects the generation of package information, it uploads the package information to the storage server in real time and stores the digital fingerprint of the package information in the blockchain.
[0072] In this step, after the logistics terminal 4 detects the generation of the package information, it immediately uploads the package information to the storage server for storage. While generating the package information, it also calculates the hash summary of the package information as a digital fingerprint through the hash algorithm and stores the digital fingerprint in the blockchain through the logistics terminal 4.
[0073] Step S103, the storage server associates the received package information with the corresponding package identification number, so as to query the package information corresponding to the corresponding package at each logistics node based on the package identification number.
[0074] Specifically, the database in the storage server establishes a logistics node table for each package. Whenever each package generates new package information, the corresponding package information is added to the logistics node table of the corresponding package. For example, the package information generated by the logistics terminal 4 is added to the logistics node table of the package identification number a1. Subsequent users can send a query request to the storage server through a mobile terminal. The storage server finds the corresponding logistics node table in response to the package identification number a1 carried in the query request, and returns the logistics node table data corresponding to the package a1 to the mobile terminal to display the package information corresponding to the clamp a1 at each logistics node.
[0075] Compared with the prior art in which logistics data is sent to the same master node for chain-up, resulting in the possibility of data tampering by the devices at each logistics node before sending the data to the master node, this embodiment provides a cross-border logistics management method and system based on blockchain. This solution generates package information at each logistics node once the logistics terminal scans the barcode of the package, and sends the package information to the storage server in real time, and directly stores the collected logistics data on the chain in real time at each logistics node, thereby reducing the possibility of each logistics node tampering with the package information and logistics data.
[0076] Reference Figure 3 In one embodiment, when the logistics terminal detects the generation of package information, the digital fingerprint of the package information is stored in the blockchain through the following steps:
[0077] Step S201, the logistics terminal encapsulates the digital fingerprint into logistics data and broadcasts the logistics data to the blockchain network, so that other nodes in the blockchain add the logistics data to the memory pool.
[0078] In the blockchain network, the logistics terminal 4 will broadcast the digital fingerprint to other nodes in the blockchain network, such as logistics terminals 1 to 3 and server nodes. According to the set rules, before the logistics terminal 4 broadcasts the digital fingerprint, it needs to encapsulate the logistics data according to the set data structure. The logistics data should include the blockchain node address, digital fingerprint, and the time when the logistics data is generated. The verification of transaction data mainly verifies whether the data structure is correct and whether the corresponding data is missing to ensure the integrity of the transaction data. After receiving the logistics data, each node in the blockchain will verify the logistics data, such as verifying whether the data structure is correct. After the verification is passed, each node will add the logistics data to the local memory pool for temporary storage, that is, the data in the memory pool is the logistics data that has not been added to the block. Then each node will select the corresponding logistics data from the memory pool according to the set strategy to encapsulate and form a candidate block of the current block height.
[0079] In step S202, the node generating a new block in the blockchain network selects the corresponding logistics data from the memory pool according to the set strategy to encapsulate the candidate block of the current block height and broadcasts the candidate block to the blockchain network, so that other nodes in the blockchain can verify the candidate block.
[0080] It is understandable that the nodes that generate new blocks are selected through a consensus algorithm. The specific consensus algorithm belongs to the existing technology and will not be described here.
[0081] Step S203, after each node in the blockchain verifies the candidate block, the candidate block is added to the blockchain to store the digital fingerprint of the package information in the blockchain.
[0082] Through steps S201 to S203, the digital fingerprint corresponding to the package information at each logistics node can be saved in the blockchain. When a dispute occurs later, the digital fingerprint of the package information stored on the storage server is calculated and compared with the digital fingerprint stored on the blockchain to determine whether the package information has been modified.
[0083] Furthermore, for the package assembly scenario, that is, in the scenario of the large package A formed by the four small packages a1, a2, a3, and a4, since the four small packages a1, a2, a3, and a4 have the same route from O to F, the corresponding package information is the same except for the package identification number. Therefore, when a dispute occurs in the subsequent a1 package, the parties may need to rely on the package data of the co-assembled packages a2, a3, etc. to prove or verify certain data to strengthen the persuasiveness of the chain of evidence. For example, if a package is lost or misdelivered after arriving at the destination, the user may ask the express company to provide A's transportation data to verify whether the package has arrived at the destination. The transportation data of other small packages a2 and a3 can also be used as reference evidence. If these small packages have been successfully delivered, it means that the large package A has arrived at the destination, further proving that the loss or misdelivery of the a1 package may exist. Package damage event: If package a1 is damaged during or after transportation, users may need A's transportation process data to prove that there was a problem during transportation, rather than damage when receiving the goods. Similarly, the data of a2 and a3 can also be used as a reference. If they are also damaged, it proves that there may be a problem in the transportation process. Package not scanned for storage event: After package A is split, if package a1 is not scanned for storage, you can check the records of a2 and a3 to see if there is an error in the unpacking of large package A.
[0084] In summary, when a dispute occurs in a package, there is a need to jointly verify the package data of other packages that are jointly packaged. Since the nodes that generate new blocks in the blockchain are selected through a consensus algorithm, it means that the nodes that generate new blocks corresponding to each block may be different. For example, a block with a block height of 4832 may be generated by logistics terminal 1, and a block with a block height of 4833 may be generated by logistics terminal 4. In addition, each blockchain node selects logistics data from the data in its own memory pool to generate a candidate block of the current block height. Since the time point when the same logistics data is transmitted to each node is different, it means that even if logistics terminal 1 broadcasts a piece of logistics data to the blockchain network, it cannot accurately know in which block the logistics data is specifically stored. When a dispute occurs and verification is required, the data that needs to be verified needs to be used. For example, the logistics node table of a1 includes 6 pieces of package information. It is necessary to first calculate the digital fingerprints of the 6 pieces of package information, and then traverse and compare them with the data in each block in the blockchain. Although the Merkle tree structure provided in the blockchain can improve the efficiency of matching a specific logistics data in a block, since it is impossible to accurately determine which block the logistics data is stored in, it is necessary to repeat the operation of traversing many blocks for each piece of logistics data. More specifically, when a dispute occurs in a certain package of a package, there is a need to jointly verify the package data of other packages that need to be packaged together. Compared with the number of other packages in the package, if each package also has 6 pieces of package information, it means that the logistics data corresponding to 6+18=24 pieces of package information needs to be found. In other words, it is necessary to repeat the operation of traversing many blocks for each piece of logistics data 24 times, which will require a large amount of computer resource overhead. The reason is that the distance between the blocks where the 24 pieces of package information are stored cannot be determined. If the distance is very far, it means that the resource overhead required for traversal is very large.
[0085] The solution of reducing the resources required for traversal according to the present invention will be described below through specific embodiments.
[0086] Reference Figure 4 ,In the first embodiment, the memory pool includes a non-compressed memory pool and a compressed memory pool;
[0087] Other nodes in the blockchain add logistics data to the memory pool, including:
[0088] Step S301: When each node in the blockchain receives logistics data, it jumps to step S302.
[0089] Step S302, determine whether the logistics data belongs to a compressed package in the first compression format, if not, jump to step S304; if so, jump to step S303.
[0090] Step S303: If yes, create a new compression class memory pool for the current compressed package, decompress the current compressed package, and add the multiple data obtained by decompression to the compression class memory pool.
[0091] Step S304, determine whether the logistics data belongs to a compressed package in the second compression format, if not, jump to step S306; if so, jump to step S305.
[0092] In one example, the first compression format may be a .zip format, and the second compression format may be a .rar format. Specifically, the method further includes:
[0093] When the barcode scanned by the logistics terminal is the package identification number corresponding to a large package, package information corresponding to multiple small packages that are assembled to obtain the large package is generated respectively, and the package information corresponding to each small package generated includes the package identification number of the small package corresponding to the barcode, the logistics node event corresponding to the logistics terminal, and the time corresponding to the scanning of the barcode; wherein, the large package is assembled from multiple small packages, and the package identification number of a large package is associated with the package identification numbers of the multiple small packages that are assembled to constitute the large package.
[0094] The logistics terminal packages the package information corresponding to the multiple small packages generated by assembling the large package into a compressed package in a first compression format and encapsulates the compressed package in the first compression format as logistics data and broadcasts it to the blockchain network.
[0095] Step S305, decompressing the compressed package in the second compression format and adding the multiple pieces of data obtained by decompression to the priority class memory pool, so that the priority class memory pool contains data.
[0096] Step S306, adding the logistics data to the non-compressed memory pool.
[0097] In this embodiment, the memory pool is divided into three categories, namely, a non-compressed memory pool, a compressed memory pool, and a priority memory pool, wherein the logistics data in the priority memory pool has the highest priority when generating a block, and the setting policy stipulates that as long as there is data in the priority memory pool, the logistics data in the priority memory pool is preferentially encapsulated into a candidate block corresponding to the current block height. The logistics data in the compressed memory pool has the second priority when generating a block, and the setting policy stipulates that if there is no priority memory pool, as long as there is data in the compressed memory pool, the logistics data in the compressed memory pool is preferentially encapsulated into a candidate block corresponding to the current block height. The non-compressed memory pool has the lowest priority, and only when the priority memory pool and the compressed memory pool do not store data, the logistics data in the non-compressed memory pool is encapsulated into a candidate block corresponding to the current block height. In addition, there is only one non-compressed memory pool and one priority memory pool respectively, while there are multiple compressed memory pools. Once the node detects that the received logistics data is a compressed package in the first compression format, it will create a corresponding compressed memory pool and add the multiple data obtained by decompressing the received logistics data to the compressed memory pool. Considering that if the amount of multiple data (for example, 100) in a compressed memory pool is greater than the maximum amount of data allowed in a single block, 70 data are available as the available part, and the amount of these 70 data is not greater than the maximum amount of data allowed in a single block, they can be encapsulated in the block of the current block height (such as 5874), and the remaining 30 data as the remaining part cannot be encapsulated in the block of the current block height (such as 5874). Obviously, in order to allow the remaining 30 pieces of data to be encapsulated in a block with a block height of 5875, the node that generates a new block with a block height of 5875 needs to give priority to encapsulating the remaining 30 pieces of data into a block with a block height of 5875. Therefore, when it is detected that multiple pieces of data in the compression class memory pool cannot be encapsulated into one block at one time, it is necessary to add these remaining parts to the priority class memory pool, and delete the remaining parts from the compression class memory pool, and set a policy to stipulate that as long as there is data in the priority class memory pool, the logistics data in the priority class memory pool will be encapsulated into a candidate block corresponding to the current block height. So that when it is necessary to traverse the data of other packages of the same package as the a1 package from the blockchain in the future, the resource overhead of traversal can be reduced. Specific embodiments include the following embodiments 1 to 4:
[0098] Example 1
[0099] In this embodiment 1, the case where there is no data in the priority memory pool and the amount of all data in the compression memory pool is not greater than the maximum amount of data allowed by a single block, at this time, the node generating a new block selects the corresponding logistics data from the memory pool according to the set strategy to encapsulate and form a candidate block of the current block height, specifically including:
[0100] When a node generating a new block detects that there is data in the compression class memory pool, it will preferentially select all the data from the compression class memory pool as the data required to encapsulate and form a candidate block of the current block height.
[0101] When it is detected that the amount of all data selected from the compression class memory pool is not greater than the maximum amount of data allowed for a single block, the data required to form a candidate block of the current block height based on the obtained encapsulation is encapsulated to form a candidate block of the current block height.
[0102] Example 2
[0103] In this embodiment 2, the case where there is no data in the priority memory pool and the amount of all data in the compression memory pool is greater than the maximum amount of data allowed by a single block, at this time, the node generating a new block selects the corresponding logistics data from the memory pool according to the set strategy to encapsulate and form a candidate block of the current block height, specifically including:
[0104] When a node generating a new block detects that there is data in the compression memory pool, it will first select all the data from the compression memory pool as the data required to encapsulate and form a candidate block of the current block height;
[0105] When it is detected that the amount of all data selected from the compression memory pool is greater than the maximum amount of data allowed for a single block, all data selected from the compression memory pool is divided into an available part and a remaining part; the amount of data in the available part is not greater than the maximum amount of data allowed for a single block;
[0106] The available part is used as the data required for encapsulating and forming the candidate block of the current block height, and the data required for encapsulating and forming the candidate block of the current block height is encapsulated based on the obtained encapsulation to form the candidate block of the current block height; at the same time, the remaining part is deleted from the compression class memory pool and the remaining part is packaged into a compressed package in a second compression format and the compressed package in the second compression format is broadcasted to the blockchain network as logistics data, so that other nodes in the blockchain add the compressed package in the second compression format to the memory pool.
[0107] Example 3
[0108] Assuming that a block with a block height of 5874 is generated in Example 2, the remaining part in Example 3 needs to be encapsulated in a block with a block height of 5875, so the remaining part in Example 2 needs to be added to the priority class memory pool.
[0109] In Example 3, it is aimed at the situation that there is data in the priority memory pool and the amount of all data in the priority memory pool is not greater than the maximum amount of data allowed by a single block:
[0110] When there is data in the priority memory pool, the node generating the new block selects the corresponding logistics data from the memory pool according to the set strategy and encapsulates it to form a candidate block of the current block height, which specifically includes:
[0111] When a node generating a new block detects that there is data in the priority memory pool, it will first select all the data from the priority memory pool as the data required to encapsulate and form a candidate block of the current block height;
[0112] When it is detected that the amount of all the data selected from the priority memory pool is not greater than the maximum amount of data allowed for a single block, the data required to form a candidate block of the current block height is encapsulated based on the obtained encapsulation to form a candidate block of the current block height.
[0113] Example 4
[0114] Assuming that a block with a block height of 5874 is generated in Example 2, the remaining part in Example 4 needs to be encapsulated in a block with a block height of 5875, so the remaining part in Example 2 needs to be added to the priority class memory pool.
[0115] In Example 4, it is aimed at the situation that there is data in the priority memory pool and the amount of all data in the priority memory pool is greater than the maximum amount of data allowed by a single block:
[0116] When there is data in the priority memory pool, the node generating the new block selects the corresponding logistics data from the memory pool according to the set strategy and encapsulates it to form a candidate block of the current block height, which specifically includes:
[0117] When a node generating a new block detects that there is data in the priority memory pool, it will first select all the data from the priority memory pool as the data required to encapsulate and form a candidate block of the current block height;
[0118] When it is detected that the amount of all data selected from the priority memory pool is greater than the maximum amount of data allowed for a single block, all data selected from the priority memory pool is divided into an available part and a remaining part; the amount of data in the available part is not greater than the maximum amount of data allowed for a single block;
[0119] The available part is used as the data required for encapsulating and forming the candidate block of the current block height, and the data required for encapsulating and forming the candidate block of the current block height is encapsulated based on the obtained encapsulation to form the candidate block of the current block height; at the same time, the remaining part is deleted from the priority class memory pool and the remaining part is packaged into a compressed package in the second compression format and the compressed package in the second compression format is broadcasted to the blockchain network as logistics data, so that other nodes in the blockchain add the compressed package in the second compression format to the memory pool.
[0120] In summary, through the above-mentioned embodiments 1 to 4, the package information corresponding to the multiple small packages that are assembled to obtain the large package can be packaged into a compressed package in a first compression format, and the corresponding logistics data can be saved in the same block or an adjacent block. When a dispute occurs later and it is necessary to traverse the data of other packages corresponding to the assembled package from the block, the resource overhead of the traversal can be reduced.
[0121] Specifically, after the logistics data is stored in the blockchain based on the solutions provided in the above-mentioned embodiments 1 to 4, when the data needs to be retrieved from the blockchain for verification later, the following solution can be adopted:
[0122] The package information also includes package assembly data, which includes a package assembly mark for indicating whether the current package is a package assembly package at each logistics node and a package identification number of a small package assembled together with the current package to form a large package, such as Figure 6 As shown, the method also includes the step of obtaining logistics data corresponding to each logistics node for the target package from the blockchain network:
[0123] Step S501, the storage server obtains from the database the time corresponding to the scanning barcode of the target package at each logistics node.
[0124] Step S502: For each logistics node of the target package, the storage server uses the time corresponding to the scanned barcode corresponding to each logistics node as the target time point, and starts from the block in the blockchain whose timestamp corresponds to a time later than the target time point and closest to the target time point, and traverses each logistics data in the block until the logistics data with the same digital fingerprint as the package information corresponding to each logistics node is matched.
[0125] When the storage server detects that the target package is a packaged package at the corresponding logistics node, the method further includes the step of obtaining logistics data of other small packages that belong to the same large package as the target package at the corresponding logistics node:
[0126] When the storage server matches the logistics data corresponding to the target package in the corresponding logistics node, the block where the logistics data corresponding to each logistics node is matched is taken as the target block. All logistics data of the target block are matched first. When the target block matches the logistics data of all small packages belonging to the same large package as the target package, the matching is completed; otherwise, the previous block and the next block of the target block are continued to be matched until the logistics data of all small packages belonging to the same large package as the target package are matched.
[0127] For example, if the six pieces of package information of package a1 are located at block heights 4578, 5435, 6045, 7756, 7857, and 8001 in order, then the first piece of logistics data starts from the block with a block height of 4571 and needs to traverse 8 blocks; the second piece of logistics data starts from the block with a block height of 5430 and needs to traverse 6 blocks; the third piece of logistics data starts from the block with a block height of 6002 and needs to traverse 6 blocks. The first logistics data starts from the block with a height of 7705, and needs to traverse 44 blocks; the fourth logistics data starts from the block with a height of 7705, and needs to traverse 52 blocks; the fifth logistics data starts from the block with a height of 7830, and needs to traverse 28 blocks; the sixth logistics data starts from the block with a height of 7990, and needs to traverse 12 blocks; a total of 8+6+44+52+28+12=150 blocks need to be traversed. If the solution provided in this embodiment is not adopted, for packages a2, a3, and a4, each package information is taken out from the logistics node table corresponding to a2, a3, and a4 and traversed and matched in the blockchain. Assuming that a2, a3, a4 and a1 have the same route throughout the whole process, we believe that the number of traversed blocks corresponding to a2, a3, and a4 is approximately 150 blocks. In the prior art, in order to obtain the corresponding logistics data of the four packages a1, a2, a3, and a4 stored in the blockchain, the total number of blockchains that need to be traversed is approximately 150*4=600 blocks. With the solution provided by this implementation, since the logistics data of other small packages a2, a3, and a4 that belong to the same large package as a1 at the same logistics node are all stored in one block or several adjacent blocks, it is equivalent to traversing the data of a1 in the block, and then obtaining the corresponding data of a2, a3, and a4 in the same block. That is, in this embodiment, in order to obtain the corresponding logistics data of the four packages a1, a2, a3, and a4 stored in the blockchain, the total number of blockchains that need to be traversed is approximately 150 blocks, which reduces the resources required for traversal.
[0128] like Figure 5 As shown, in one embodiment, the method further includes the following package anomaly detection step:
[0129] Step S401, the logistics terminal at the package assembly site obtains a first photo of all large packages when they are packaged by taking photos, and the first photo shows the first relative position information between the barcodes of multiple small packages packed into a large package at the package assembly site.
[0130] It can be understood that in this embodiment, corresponding barcodes are affixed to multiple small packages that are packed into a large package. When the multiple small packages are packed into a large package and their relative positions are fixed, the barcodes of the small packages are located directly above the small packages, making it convenient to capture the relative positions of the barcodes on all the small packages in one photo.
[0131] Step S402, the logistics terminal at the unpacking site obtains a second photo of the target large package when it is unpacked by taking photos, and the second photo shows second relative position information between the barcodes of multiple small packages packed into a large package at the unpacking site; the target large package is a large package that is in a state of not requiring unpacking for verification at the clearing point.
[0132] It is understandable that when a large package is opened at the unpacking station, the relative positions of the small packages will change slightly due to the shaking during transportation, but the relative positions of the barcodes of the small packages will generally not change if they have not been unpacked and moved. During customs clearance, if it is necessary to open the package for verification, since the customs inspection personnel will take out the small packages and may open them for inspection, it is difficult for the logistics staff or customs personnel accompanying the inspection to ensure that the small packages are put back to their original positions. Therefore, it is difficult to determine whether the large package that is opened for verification during customs clearance has been opened abnormally before or after customs clearance based on the relative positions of the barcodes.
[0133] Step S403: compare the first relative position information and the second relative position information to obtain a comparison result.
[0134] Step S404, determining whether there is any abnormality in the target large package according to the comparison result.
[0135] Comparing the relative positions of the barcodes of each small package in the first photo and the second photo can help the staff to quickly and preliminarily determine whether the large package has been opened abnormally. It is understandable that if the posture of each small package in the large package is only photographed to identify whether the package has been opened abnormally, the shaking during the transportation process will cause the posture of each small package to change slightly, which may easily lead to many false positive abnormal opening warnings and user disputes. The present invention can not only help the staff to quickly and preliminarily determine whether the package has been opened abnormally by identifying the relative positions of the barcodes with the help of image recognition, but also further avoid excessive false positives.
[0136] An embodiment of the present invention provides a computer device, the terminal includes a processor and a memory, the memory stores at least one instruction, at least one program, a code set or an instruction set, the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the cross-border logistics management method based on blockchain as provided in the above method embodiment. The memory can be used to store software programs and modules, and the processor executes various functional applications and blockchain-based data storage by running the software programs and modules stored in the memory. The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, application programs required for functions, etc.; the data storage area may store data created according to the use of the device, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory may also include a memory controller to provide the processor with access to the memory.
[0137] The embodiment of the present invention also provides a computer-readable storage medium, which can be set in a terminal or a server to store at least one instruction, at least one program, code set or instruction set related to a cross-border logistics management method based on blockchain, and the at least one instruction, the at least one program, the code set or instruction set is loaded and executed by the processor to implement the cross-border logistics management method based on blockchain provided by the above method embodiment. Optionally, in this embodiment, the above storage medium may include but is not limited to: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program code.
[0138] The specific implementation methods described above provide a detailed description of the technical solutions and beneficial effects of the present invention. It should be understood that the above is only the most preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, supplements and equivalent substitutions made within the scope of the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A cross-border logistics management method based on blockchain, characterized in that: Applied in a blockchain network composed of logistics terminals and storage servers deployed at multiple logistics nodes, each logistics terminal constitutes a terminal node of the blockchain network, and the storage server constitutes a server node of the blockchain network; The method comprises: The logistics terminal generates package information in response to the barcode scanned on the package; the package information includes the package identification number corresponding to the barcode, the logistics node event corresponding to the logistics terminal, and the time corresponding to the scanning of the barcode; When the logistics terminal detects the generation of package information, it uploads the package information to the storage server in real time and stores the digital fingerprint of the package information in the blockchain; The storage server associates the received package information with the corresponding package identification number, so as to query the package information corresponding to the corresponding package at each logistics node based on the package identification number; When the logistics terminal detects the generation of package information, the digital fingerprint of the package information is stored in the blockchain through the following steps: The logistics terminal encapsulates the digital fingerprint into logistics data and broadcasts the logistics data to the blockchain network, so that other nodes in the blockchain add the logistics data to the memory pool; The node that generates a new block in the blockchain network selects the corresponding logistics data from the memory pool according to the set strategy, encapsulates it into a candidate block of the current block height, and broadcasts the candidate block to the blockchain network, so that other nodes in the blockchain can verify the candidate block; After each node in the blockchain verifies the candidate block, the candidate block is added to the blockchain to store the digital fingerprint of the package information in the blockchain; The memory pool includes non-compressed memory pool and compressed memory pool; Other nodes in the blockchain add logistics data to the memory pool, including: When each node in the blockchain receives the logistics data, it determines whether the logistics data belongs to a compressed package in the first compression format. If not, the logistics data is added to the non-compressed memory pool. If so, a new compressed memory pool is created for the current compressed package, the current compressed package is decompressed, and the multiple pieces of data obtained by decompression are added to the compressed memory pool. The node generating the new block selects the corresponding logistics data from the memory pool according to the set strategy and encapsulates it to form a candidate block of the current block height, which specifically includes: When a node generating a new block detects that there is data in the compression memory pool, it will first select all the data from the compression memory pool as the data required to encapsulate and form a candidate block of the current block height; When it is detected that the amount of all the data selected from the compression class memory pool is not greater than the maximum amount of data allowed for a single block, the data required to form a candidate block of the current block height based on the obtained encapsulation is encapsulated to form a candidate block of the current block height; The package information also includes package assembly data, which includes a package assembly mark for indicating whether the current package is a package assembly package at each logistics node and a package identification number of a small package assembled together with the current package to form a large package. The method also includes the step of obtaining logistics data corresponding to each logistics node for the target package from the blockchain network: The storage server obtains the time corresponding to the scanned barcode of the target package at each logistics node from the database; For each logistics node of the target package, the storage server uses the time corresponding to the scanned barcode corresponding to each logistics node as the target time point, and starts from the block in the blockchain whose timestamp corresponds to a time later than the target time point and closest to the target time point, and traverses each logistics data in the block until it matches the logistics data with the same digital fingerprint as the package information corresponding to each logistics node; When the storage server detects that the target package is a packaged package at the corresponding logistics node, the method further includes the step of obtaining logistics data of other small packages that belong to the same large package as the target package at the corresponding logistics node: When the storage server matches the logistics data corresponding to the target package in the corresponding logistics node, the block where the logistics data corresponding to each logistics node is matched is taken as the target block. All logistics data of the target block are matched first. When the target block matches the logistics data of all small packages belonging to the same large package as the target package, the matching is completed; otherwise, the previous block and the next block of the target block are continued to be matched until the logistics data of all small packages belonging to the same large package as the target package are matched.
2. According to the cross-border logistics management method based on blockchain in claim 1, it is characterized in that: The memory pool includes non-compressed memory pool and compressed memory pool; Other nodes in the blockchain add logistics data to the memory pool, including: When each node in the blockchain receives the logistics data, it determines whether the logistics data belongs to a compressed package in the first compression format. If not, the logistics data is added to the non-compressed memory pool. If so, a new compressed memory pool is created for the current compressed package, the current compressed package is decompressed, and the multiple pieces of data obtained by decompression are added to the compressed memory pool. The node generating the new block selects the corresponding logistics data from the memory pool according to the set strategy and encapsulates it to form a candidate block of the current block height, which specifically includes: When a node generating a new block detects that there is data in the compression memory pool, it will first select all the data from the compression memory pool as the data required to encapsulate and form a candidate block of the current block height; When it is detected that the amount of all data selected from the compression memory pool is greater than the maximum amount of data allowed for a single block, all data selected from the compression memory pool is divided into an available part and a remaining part; the amount of data in the available part is not greater than the maximum amount of data allowed for a single block; The available part is used as the data required for encapsulating and forming the candidate block of the current block height, and the data required for encapsulating and forming the candidate block of the current block height is encapsulated based on the obtained encapsulation to form the candidate block of the current block height; at the same time, the remaining part is deleted from the compression class memory pool and the remaining part is packaged into a compressed package in a second compression format and the compressed package in the second compression format is broadcasted to the blockchain network as logistics data, so that other nodes in the blockchain add the compressed package in the second compression format to the memory pool.
3. According to the cross-border logistics management method based on blockchain in claim 2, it is characterized in that: The memory pool also includes a priority class memory pool; Other nodes in the blockchain add the compressed package in the second compression format to the memory pool, specifically including: When each node in the blockchain receives the logistics data, it determines whether the logistics data belongs to a compressed package in the second compression format. If so, it decompresses the compressed package in the second compression format and adds the decompressed multiple data to the priority class memory pool, so that the data exists in the priority class memory pool; The method further comprises: When there is data in the priority memory pool, the node generating the new block selects the corresponding logistics data from the memory pool according to the set strategy and encapsulates it to form a candidate block of the current block height, which specifically includes: When a node generating a new block detects that there is data in the priority memory pool, it will first select all the data from the priority memory pool as the data required to encapsulate and form a candidate block of the current block height; When it is detected that the amount of all the data selected from the priority memory pool is not greater than the maximum amount of data allowed for a single block, the data required to form a candidate block of the current block height based on the obtained encapsulation is encapsulated to form a candidate block of the current block height; When it is detected that the amount of all data selected from the priority memory pool is greater than the maximum amount of data allowed for a single block, all data selected from the priority memory pool is divided into an available part and a remaining part; the amount of data in the available part is not greater than the maximum amount of data allowed for a single block; The available part is used as the data required for encapsulating and forming the candidate block of the current block height, and the data required for encapsulating and forming the candidate block of the current block height is encapsulated based on the obtained encapsulation to form the candidate block of the current block height; at the same time, the remaining part is deleted from the priority class memory pool and the remaining part is packaged into a compressed package in the second compression format and the compressed package in the second compression format is broadcasted to the blockchain network as logistics data, so that other nodes in the blockchain add the compressed package in the second compression format to the memory pool.
4. According to a blockchain-based cross-border logistics management method according to claim 1, it is characterized in that: The method further comprises the following step of detecting anomalies in packaging: The logistics terminal at the package assembly site obtains a first photo of all large packages when they are packed by taking photos, and the first photo shows the first relative position information between the barcodes of multiple small packages packed into a large package at the package assembly site; The logistics terminal at the unpacking site obtains a second photo of the target large package when it is unpacked by taking photos, and the second photo shows second relative position information between the barcodes of multiple small packages packed into a large package at the unpacking site; the target large package is a large package that does not need to be unpacked for verification at the clearing point; Comparing the first relative position information with the second relative position information to obtain a comparison result; Determine whether the target large package is abnormal based on the comparison result.
5. According to a blockchain-based cross-border logistics management method according to claim 1, it is characterized in that: The logistics terminal generates package information in response to the barcode scanned on the package, including: When the barcode scanned by the logistics terminal is the package identification number corresponding to the small package, the generated package information includes the package identification number of the small package corresponding to the barcode, the logistics node event corresponding to the logistics terminal, and the time corresponding to the scanning of the barcode; When the barcode scanned by the logistics terminal is the package identification number corresponding to the large package, the package information corresponding to the multiple small packages assembled to obtain the large package is generated respectively, and the generated package information corresponding to each small package includes the package identification number of the small package corresponding to the barcode, the logistics node event corresponding to the logistics terminal, and the time corresponding to the scanning of the barcode; The large package is assembled from a plurality of small packages, and a package identification number of the large package is associated with the package identification numbers of the plurality of small packages assembled to form the large package.
6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
