Cold-chain logistics management method based on block chain, electronic equipment and storage medium

By adopting blockchain technology and smart contracts in cold chain logistics, problems such as opacity and traceability in cold chain logistics are solved, data transparency and immutability are achieved, and the efficiency and security of the supply chain are improved.

CN119417326APending Publication Date: 2025-02-11INSPUR YUNZHOU (SHANDONG) IND INTERNET CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411361545.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

There are problems such as opaque information, inconsistent data, and difficult to guarantee the safety of goods in cold chain logistics, and compliance audits are difficult to achieve, human errors and communication delays are not guaranteed, the supply chain is inefficient and costly, and the logistics process traceability difficulty.

Method used

Using a blockchain-based cold chain logistics management method, the data is transmitted to the alliance blockchain network by reading the environmental data collected by various sensors during the cold chain logistics process, and all nodes receive and verify the data. , if the verification is passed, it will be written to the blockchain, and a smart contract is deployed on the blockchain to monitor rules and trigger alarms.

Benefits of technology

Ensures data transparency and immutability in all links in the supply chain, improves the visibility and traceability of the supply chain, reduces human errors and communication delays, improves supply chain efficiency, ensures compliance and quality control, and reduces Management and operational costs are strengthened and security is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119417326A_ABST
    Figure CN119417326A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a cold-chain logistics management method based on a block chain, electronic equipment and a storage medium, and belongs to the field of logistics management. The method comprises the following steps: reading environmental data collected by various sensors in a cold-chain logistics process, and preprocessing the environmental data to obtain target environmental data; establishing an alliance block chain node, and configuring and starting the alliance block chain node; and transmitting the target environment data to the alliance block chain network, enabling all nodes in the alliance block chain to receive the target environment data, starting verification, and if the verification is passed, indicating that the target environment data is written into the alliance block chain. The block chain technology is adopted to ensure data transparency and non-tampering of each link in the supply chain, and a user can check, verify and trace the transportation history of goods in real time, so that the visibility and traceability of the supply chain are improved, and the non-tampering and traceability of the block chain are beneficial to ensuring the compliance and quality control of the supply chain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of logistics management, and specifically to a cold chain logistics management method, electronic device and storage medium based on blockchain. Background Art

[0002] Cold Chain Logistics refers to a systematic project that keeps refrigerated and frozen foods in a prescribed low-temperature environment during production, storage, transportation, sales, and before consumption to ensure food quality and reduce food loss. At present, most cold chain logistics monitoring technologies are very mature, but the difficulty lies in data traceability in the supply chain. Because a product involves multiple companies (logistics companies, warehousing companies) in the logistics link, it is very troublesome to integrate and exchange data from each company in these chains. Without the integration of these data, traceability cannot be achieved. Blockchain has a very high credibility for traceability data records. Trustworthy data has become the key to improving the efficiency of the entire supply chain. The application of blockchain technology in cold chain logistics mainly solves the problem of data authenticity. In particular, temperature and humidity conditions affect product quality. As long as these data exist on the blockchain, they cannot be modified. With real data, the coordination cost between partners can be reduced.

[0003] In traditional cold chain logistics management systems, there are often a series of problems such as opaque information, inconsistent data, and difficulty in ensuring the safety of goods. On the other hand, compliance audits are difficult to achieve, and human errors and communication delays cannot be guaranteed. At the same time, the contract execution process is too cumbersome, the supply chain is inefficient and costly, and the logistics process is difficult to trace. Summary of the invention

[0004] The purpose of the embodiments of the present invention is to provide a cold chain logistics management method, electronic device and storage medium based on blockchain, which are used to fully or at least partially solve the technical problems existing in the above-mentioned prior art.

[0005] In order to achieve the above objectives, an embodiment of the present invention provides a cold chain logistics management method based on blockchain, comprising:

[0006] Read the environmental data collected by various sensors in the cold chain logistics process, and pre-process the environmental data to obtain target environmental data;

[0007] Establish a consortium blockchain node, and configure and start the consortium blockchain node;

[0008] The target environment data is transmitted to the alliance blockchain network, so that all nodes in the alliance blockchain receive the target environment data and start verification. If the verification passes, it means that the target environment data has been written into the alliance blockchain.

[0009] Optionally, reading environmental data collected by various sensors in the cold chain logistics process and preprocessing the environmental data to obtain target environmental data includes:

[0010] The environmental data collected by various sensors are filtered and statistical parameters are calculated to filter out abnormal values ​​and noise data and obtain the target environmental data.

[0011] Optionally, the process of starting the node includes:

[0012] The Gossip protocol is used between peer nodes in the alliance blockchain to complete block broadcasting and state synchronization. Each transmitted Gossip message has a corresponding signature to prevent the Gossip message from being distributed to other nodes that are not in the same channel.

[0013] Nodes affected by block loss due to delays or network partitions are synchronized by contacting nodes that already have the missing blocks;

[0014] For the propagation of new blocks, the upper peer node on the channel extracts data from the sorting node service and distributes blocks to randomly selected neighbor nodes through the Gossip protocol. Each node periodically compares the data with the randomly selected neighbor nodes to keep the block data status synchronized.

[0015] Optionally, the cold chain logistics management method further includes:

[0016] Deploy smart contracts on the consortium blockchain network and configure smart contract monitoring rules to determine smart contract events or conditions that trigger alarms, where smart contracts include but are not limited to cargo tracking smart contracts, transportation cost smart contracts, and audit contracts.

[0017] Optionally, the smart contract monitoring rules are formulated based on the contract's function, data status or transaction behavior.

[0018] Optionally, before transmitting the target environment data to the alliance blockchain network so that all nodes in the alliance blockchain receive the target environment data and start verification, if the verification indicates that the target environment data has been written into the alliance blockchain, the cold chain logistics management method further includes:

[0019] The target environment data is signed and encrypted, and the signed and encrypted target environment data is broadcast to the alliance chain network.

[0020] Optionally, the process of signing the target environment data includes:

[0021] Use the SM3 hash function to hash the target environment data M to be signed, and generate a hash value of a fixed length related to the target environment data M to be signed and the user information;

[0022] The hash value is concatenated with the target environment data M to be signed to obtain a preprocessed message M', and the preprocessed message M' is hashed using the SM3 hash function to obtain a hash value;

[0023] The signature pair is determined based on the hash value.

[0024] Optionally, the process of encrypting the target environment data includes:

[0025] Segmenting the target environment data to obtain multiple data groups of the same length;

[0026] Using round function iteration to perform nonlinear transformation and linear transformation processing on multiple data groups of the same length, respectively, to obtain the iterative results corresponding to each data group of the same length;

[0027] The corresponding iteration result of each data group of the same length is reversed to obtain the ciphertext data corresponding to the target environment data.

[0028] On the other hand, the present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned blockchain-based cold chain logistics management method when executing the program.

[0029] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-mentioned blockchain-based cold chain logistics management method.

[0030] Through the above technical solution, the use of blockchain technology ensures the transparency and immutability of data in each link of the supply chain. Users can view, verify and trace the transportation history of goods in real time, thereby improving the visibility and traceability of the supply chain. The immutability and traceability of blockchain help ensure the compliance and quality control of the supply chain, reduce manual intervention and optimize supply chain efficiency.

[0031] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:

[0033] Figure 1 It is an implementation flow chart of a cold chain logistics management method based on blockchain provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0034] The specific implementation of the embodiment of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present invention, and is not used to limit the embodiment of the present invention.

[0035] See also Figure 1 As shown, it is an implementation flow chart of a cold chain logistics management method based on blockchain provided by an embodiment of the present invention, including the following execution steps:

[0036] Step 100: Read the environmental data collected by various sensors during the cold chain logistics process, and pre-process the environmental data to obtain target environmental data.

[0037] Specifically, the environmental data collected by various sensors in the cold chain logistics process are read, and the environmental data are preprocessed to obtain target environmental data, including: filtering the environmental data collected by various sensors and calculating statistical parameters to filter out abnormal values ​​and noise data to obtain target environmental data.

[0038] In some embodiments, the steps of using sensors to collect data are as follows:

[0039] (1) Select the appropriate sensor: Select the appropriate sensor based on the environmental data to be monitored. For example, if you need to measure temperature, you can choose a temperature sensor; if you need to detect light intensity, you can choose a light sensor.

[0040] (2) Location selection and installation: Sensors should be installed at appropriate locations based on the characteristics of the monitored elements and monitoring requirements.

[0041] (3) Connect sensors and data acquisition equipment: Connect sensors and data acquisition equipment to realize data transmission.

[0042] (4) Data acquisition: Use data acquisition equipment (such as a single-chip microcomputer or microcontroller) to read the sensor, obtain the environmental data sensed by the sensor, and convert it into a digital signal.

[0043] (5) Data preprocessing: Process and correct the collected raw data, including filtering, calculating statistical parameters, etc., to filter out outliers and noise to ensure the reliability of the data.

[0044] (6) Data transmission and storage: Select appropriate data transmission methods to transmit processed data to the data center or monitoring center. At the same time, select appropriate data storage media and methods to ensure data security and integrity.

[0045] (7) Data display and analysis: Data is displayed to users through web interfaces or mobile applications. Users can use these interfaces to view real-time data, generate reports, and perform data analysis.

[0046] Step 101: Establish a consortium blockchain node, and configure and start the consortium blockchain node.

[0047] In some embodiments, the steps to establish a consortium chain are as follows: Select a blockchain platform: First, you need to select a blockchain platform that is suitable for the consortium chain requirements, such as Hyperledger Fabric. Prepare the required software: Install the required software according to the selected blockchain platform. For example, if you choose the Hyperledger Fabric platform, you need to install Docker and Node.js. Create a node: Follow the guide of the selected blockchain platform to create a new node. This usually involves configuring some basic information for the node, such as IP address, port number, and authentication credentials.

[0048] In some implementations, the specific process steps for creating a new node are as follows:

[0049] Copy the raft files on the peer server to the specified location of the sorting node orderer server, such as / usr / local / etc / ; copy the docker-compose-org1-peer0.yaml in the / raft / compose-config directory on the peer server to the raft root directory; the sorting node orderer server copies the corresponding docker-compose-ordererX.XXX.yaml in / raft / compose-config to the raft root directory. (XXX is the subscript of the corresponding sorting node); modify the IP addresses of the last few lines of files such as docker-compose-org1-peer0.yaml and docker-compose-ordererX.XXX.yaml respectively: extra_hosts: ordererXXX.example.com under the node: the real IP address of the corresponding server; modify the IP addresses of the last few lines of docker-compose-cli.yaml in the fart directory on the peer server; extra_hosts: ordererXXX.example.com under the node: the real IP address of the corresponding server; peer0.org1.example.com: the real IP address of the peer server; find the last line in the / etc / hosts file and add:

[0050] 192.168.3.200orderer0.example.com; 192.168.3.201orderer1.example.com;

[0051] 192.168.3.202orderer2.example.com; 192.168.3.203peer0.org1.example.com The above IPs are the real IP addresses of the corresponding servers.

[0052] Specifically, the starting of the alliance blockchain node in step 101 may specifically include the following steps:

[0053] S1010: The Gossip protocol is used between peer nodes in the alliance blockchain to complete block broadcasting and status synchronization. Each transmitted Gossip message has a corresponding signature to prevent the Gossip message from being distributed to other nodes that are not in the same channel.

[0054] S1011: For nodes affected by block loss due to delays or network partitions, synchronize them by contacting the nodes that already have the missing blocks.

[0055] S1012: For the propagation of new blocks, the upper peer node on the channel extracts data from the sorting node service and distributes blocks to randomly selected neighbor nodes through the Gossip protocol. Each node periodically compares the data with the randomly selected neighbor nodes to keep the block data status synchronized.

[0056] In some implementations, enter the raft directory on the orderer server and execute the following commands respectively: execute chmod+x docker-compose-ordererX.XXX.yaml to grant executable permissions before executing the command docker-compose-f docker-compose-ordererX.XXX.yaml up-d; enter the raft directory on the peer server and execute: execute chmod+x to grant executable permissions before executing the command docker-compose-f docker-compose-org1-peer0.yamlup-d; docker-compose-f docker-compose-cli.yaml up-d.

[0057] In some implementations, the node synchronization process is as follows:

[0058] 1. Each peer node uses the Gossip protocol to complete the process of block broadcasting and state synchronization. Gossip messages are continuous, and each peer node on the channel continuously receives consistent block data from multiple nodes;

[0059] 2. Each transmitted Gossip message has a corresponding signature, which can easily identify and prevent forged messages sent by Byzantine participants, and prevent messages from being distributed to other nodes that are not in the same channel;

[0060] 3. Nodes affected by delays, network partitions, or other reasons for missing blocks will eventually synchronize with the current ledger state by contacting nodes that already have these missing blocks;

[0061] 4. For the propagation of new blocks, the Leader Peer node on the channel extracts data from the Ordering service and distributes blocks to randomly selected neighbor nodes through the Gossip protocol;

[0062] 5. Each node periodically compares the data with that of other random N nodes in the background to keep the block data status synchronized.

[0063] In some embodiments, the relationship between node synchronization and the size of the network and the speed of the network connection is as follows:

[0064] A. Impact of network size: Number of nodes: As the network scale expands, the number of nodes increases, and the amount of data that needs to be processed during synchronization will also increase accordingly; Number of channels: The channels in the Fabric network are used to isolate different data sets, and each channel has its own independent ledger. The increase in the number of channels means that more data sets need to be synchronized, which increases the complexity of synchronization.

[0065] B. Impact of network connection speed: Synchronization efficiency: Network connection speed directly affects the efficiency of data transmission between nodes. In a high-speed network environment, nodes can receive and synchronize data faster, thereby shortening the synchronization time. On the contrary, in a low-speed network environment, the synchronization process may become slow and time-consuming; Delay and packet loss: Delay and packet loss problems in network connections may also affect the stability of the synchronization process. Delay may cause data to arrive longer, while packet loss may cause data to be incomplete or require retransmission.

[0066] In some embodiments, the cold chain logistics management method further includes: deploying smart contracts on the consortium blockchain network, and configuring smart contract monitoring rules to determine smart contract events or conditions that trigger alarms, wherein the smart contracts include but are not limited to cargo tracking smart contracts, transportation cost smart contracts, and audit contracts.

[0067] For example, the cold chain monitoring smart contract: used to record the temperature, humidity and other information of the goods recorded by the sensor in real time and upload them to the chain in time. The cargo tracking smart contract: used to record the itinerary of the goods in real time. The transportation cost smart contract: used to record the costs incurred by the goods during the operation and maintenance process, and upload them to the chain in real time to avoid disputes. The audit contract: used to analyze a series of data in the transportation process and upload them to the chain to find and solve problems in a timely manner.

[0068] It should be understood that the smart contract monitoring rules are formulated based on the function, data status or transaction behavior of the contract.

[0069] In some embodiments, to achieve real-time monitoring and alerting based on smart contracts, the steps are as follows: Deploy the monitoring and alerting system: Deploy the smart contract monitoring and alerting system on the target blockchain network. Configure monitoring rules: Configure monitoring rules to define which smart contract events or conditions should trigger alerts. These rules can be formulated based on the functions of the contract, data status, or transaction behavior. Start real-time monitoring: Once the monitoring and alerting system is configured, it will start monitoring the target smart contract in real time. This includes capturing events in the contract, parsing transaction data, and analyzing the contract status. Event analysis and processing: The system will analyze the captured events to determine whether there are potential problems or risks. This can be achieved based on preset rules or machine learning algorithms. If the system detects any anomalies or potential risks, it will trigger an alert. This can be achieved in a variety of ways, such as sending emails, Slack notifications, or real-time messages. Alerts usually contain detailed information about the abnormal event so that developers or administrators can respond quickly. Respond and process: After receiving the alert, the developer or administrator needs to respond quickly and deal with the potential problem. This may include investigating the cause of the abnormal event, fixing vulnerabilities in the contract, or taking other necessary measures. Through the above operations, each link of the cold chain logistics process will be monitored in real time and traceable at any time.

[0070] In some embodiments, based on a preset machine learning algorithm, linear regression is used to predict continuous meteorological variables, such as temperature and humidity. A target value (such as temperature or humidity) is predicted by establishing a linear equation that describes the relationship between input features (such as time, other relevant meteorological variables, etc.) and the target value. Formula: y = β0 + β1x1 + β2x2 + ... + β n x n +∈, where y is the predicted value, β0 is the intercept, β1,β2,...,β n are coefficients, x1,x2,...,x n is the input feature and ∈ is the error term.

[0071] The construction process usually includes: Data collection: First, a large amount of data needs to be collected from sensors. This data may include temperature, pressure, speed, images and other types of information. Data preprocessing: The collected data often needs to be preprocessed, including cleaning (removing noise, outliers, etc.), transformation (such as normalization, standardization) and feature extraction steps, so that the subsequent algorithm can better process and analyze. Model selection: Regression model, use the preprocessed data to train the selected model. During the training process, the algorithm will continuously adjust the model parameters to minimize the prediction error or maximize the classification accuracy and other indicators. Model evaluation and tuning: After the training is completed, the model needs to be evaluated to check its performance on unknown data. If the performance is not good, it needs to be tuned, including adjusting the model parameters, changing the model type or improving the data preprocessing steps. The implementation process of the algorithm usually involves programming and the use of computing resources. Here are some key steps: Programming environment preparation: Choose a suitable programming language and development environment. Python is one of the commonly used programming languages ​​in the field of machine learning because it has rich library and framework support (such as TensorFlow, PyTorch, scikit-learn, etc.). Algorithm implementation: Write the corresponding code implementation according to the selected model and algorithm principles. This includes data loading, preprocessing, model definition, training loop, evaluation indicator calculation and other parts. Computing resource allocation: Rationally allocate computing resources according to the needs of the algorithm and available resources. For large-scale data sets or complex models, it may be necessary to use high-performance computing clusters or cloud computing services to accelerate the training process. Model deployment: Deploy the trained model to actual application scenarios. This usually involves integrating the model into a larger system and ensuring that it can process sensor data in real time and produce useful outputs.

[0072] For example, the monitoring rules for cold chain items in the logistics process are mainly oriented towards temperature, as follows: Real-time recording: During transportation, the temperature recording device should record temperature data in real time and automatically record it once every certain period of time (such as 10 minutes). At key time points such as loading, unloading, opening and closing doors, the temperature data should be recorded manually or automatically. Data format: The recorded data should include information such as date, time, temperature value, etc., and should be stored in a standard data format. At the same time, paper backups can be provided on demand in case of emergency. Data preservation: Temperature records should be kept for at least a certain period of time (such as 3 months) after the delivery of the goods, and the data should be backed up regularly to prevent loss or damage.

[0073] Step 102: The target environment data is transmitted to the alliance blockchain network, so that all nodes in the alliance blockchain receive the target environment data and start verification. If the verification passes, it means that the target environment data has been written into the alliance blockchain.

[0074] In some embodiments, constructing a block header: The block header contains multiple key fields, which are essential for calculating the hash value. In Fabric, the block header usually contains the block number (number), the previous block hash (previous_hash), the data hash of the current block (data_hash, i.e., the Merkle root Merkle Root, which indicates that the hash values ​​of all transactions in the current block are calculated by the Merkle tree algorithm to obtain a hash value), etc. These fields are first arranged in a specific order and format and prepared for serialization. Serializing block header information: Convert each field in the block header into a byte string (Byte String), and this process usually follows the DER (Distinguished Encoding Rules) encoding rules in ASN.1 (Abstract Syntax Notation One). The DER encoding rules define how to convert data structures into byte sequences for transmission and storage. In Fabric, the fields of the block header (such as the block number, the previous block hash, and the data hash) are encoded as byte strings and spliced ​​together in a certain order to form a complete byte sequence. Apply hash function: Use the SHA-256 hash function to hash the serialized block header byte sequence. SHA-256 is a widely used secure hash algorithm that can convert an input of any length into an output of a fixed length (256 bits). In Fabric, the hash value obtained after the SHA-256 hash operation is the hash value of the current block (also the hash value of the block header), because it represents the unique identifier of the entire block header. Storage and verification: The calculated block hash value is stored in the block header and used as the value of the "previous block hash" field of the next block in the blockchain. In this way, each block is connected to the previous block through the hash value, forming an immutable blockchain. When a new block is added to the blockchain, the nodes in the network verify whether the hash value of the new block meets the requirements and whether the new block correctly references the hash value of the previous block. Among them, the formula involved in calculating the block hash is as follows: [\text{block hash}=\text{SHA-256}(\text{serialized block header byte sequence})]; where SHA-256 represents a hash function, the serialized block header byte sequence is the input of the hash function, and the block hash is the output of the hash function.

[0075] In some embodiments, the specific steps of linking the hash of the previous block are as follows: Calculate the hash-related fields of the current block: First, calculate the data hash (Merkle Root) of the current block, which usually involves processing all transactions in the block through the Merkle tree algorithm to obtain a hash value of a fixed length. At the same time, prepare the values ​​of other block header fields, such as block number and timestamp. Get the hash value of the previous block: Retrieve the hash value of the previous block from the blockchain. In Fabric, this usually means reading the value of the PreviousHash field of the previous block from the storage system of the blockchain. Include the hash value of the previous block in the current block header: When constructing the current block header, include the obtained hash value of the previous block as the value of the Previous Hash field. In this way, the current block is linked to the previous block through the Previous Hash field. Calculate the hash value of the current block header: Use a hash function (such as SHA-256) to perform a hash operation on the serialized block header (including the Previous Hash field) to obtain the hash value of the current block. This hash value not only represents the unique identifier of the current block header, but also indirectly establishes a connection with the hash value of the previous block through the Previous Hash field. Store the current block: Store the calculated current block (including the block header and block body) in the storage system of the blockchain. In this way, the current block becomes part of the blockchain and is closely connected to the previous block through the Previous Hash field.

[0076] In some implementations, after being written into the block, the data will be verified and confirmed again to ensure its correctness and validity on the chain. At the same time, the alliance chain will generate corresponding transaction records or event notifications for the participants to query and use. Through the above, the key data in the cold chain logistics process is uploaded to the blockchain, and the relevant nodes can obtain the data in the transportation process in real time.

[0077] In some embodiments, before executing step 102, the cold chain logistics management method further executes: signing and encrypting the target environment data, and broadcasting the signed and encrypted target environment data to the alliance chain network.

[0078] Specifically, the process of signing the target environment data includes the following execution steps:

[0079] S1: Use the SM3 hash function to hash the target environment data M to be signed, and generate a hash value of a fixed length related to the target environment data M to be signed and the user information.

[0080] In some embodiments, the target environment data M to be signed is set: the original data to be signed. User A's public key P_A (x_A, y_A): a point of user A on the elliptic curve, where (x_A, y_A) is the coordinate of the public key. User A's private key d_A: an integer used to generate the public key P_A and used in the signing process. User identification ID_A: unique information used to identify user A. The SM3 hash function is used to hash a series of parameters, including the length ENTL_A of the user identification ID_A (occupying two bytes), ID_A itself, the parameters a and b of the elliptic curve, the coordinates of the base point G (x_G, y_G), and the coordinates of the public key P_A (x_A, y_A). The specific formula is: Z_A = SM3 (ENTL_A||ID_A||a||b||x_G||y_G||x_A||y_A). In the formula, the || symbol is used to represent the string concatenation operation, and Z_A represents the hash value, which generates a hash value of a fixed length related to the message to be signed and the user information.

[0081] S2: concatenate the hash value with the target environment data M to be signed to obtain a preprocessed message M', and perform hash calculation on the preprocessed message M' using the SM3 hash function to obtain a hash value.

[0082] S3: Determine the signature pair based on the hash value.

[0083] In some embodiments, the hash value Z_A is concatenated with the message M to be signed to obtain the preprocessed message M'=Z_A||M. The preprocessed message M' is hashed using the SM3 hash function to obtain e=H(M'). Note that H() here represents the SM3 hash function, and the result is a hash value of a fixed length. Then, the hash value e is converted into a large integer for subsequent modular operations. Generate a random number k: Generate a random number k in the range of [1,n-1], where n is the order of the elliptic curve. The random number generator should use a random number generator approved by the State Cryptography Administration to ensure the security and unpredictability of the random number. Calculate the doubling point: Use the random number k to perform a scalar multiplication operation with the base point G of the elliptic curve to obtain the point (x_1,y_1)=kG. In elliptic curve cryptography, scalar multiplication is an important basic operation. Here we only care about the x-coordinate x_1 of the calculation result and convert it into a large integer. Calculate r value: Calculate r value according to the formula r = (e + x_1) mod n. Modular operation (mod n) is used here, where n is the order of the elliptic curve. If the calculated r value is 0 or satisfies the condition r + k = n, it is necessary to reselect the random number k and repeat the above steps (starting from generating the random number k) until a valid r value is obtained. Calculate s value: After obtaining a valid r value, calculate s value according to the formula s = ((1 + d_A) - 1 · (kr · d_A)) mod n. Modular operation (mod n) is also used here, and it should be noted that ((1 + d_A) - 1) is the multiplicative inverse element of (1 + d_A) under mod n. If the calculated s value is 0, it is necessary to reselect the random number k and repeat the above steps until a valid s value is obtained. Output signature: Combine the calculated r value and s value into a signature pair (r, s), and output the signature pair together with the original message M. The signature pair (r, s) is the digital signature of the signed message M, which proves that the message M is indeed issued by user A who owns the private key d_A.

[0084] Specifically, the process of encrypting the target environment data includes the following execution steps:

[0085] SA: Segmenting the target environment data to obtain multiple data groups of the same length;

[0086] SB: Use round function iteration to perform nonlinear transformation and linear transformation on multiple data groups of the same length, and obtain the iterative results corresponding to each data group of the same length.

[0087] SC: Perform a reverse transformation on the corresponding iteration result of each data group of the same length to obtain the ciphertext data corresponding to the target environment data.

[0088] In some embodiments, for plaintext encryption: the input plaintext data is 128 bits (i.e., 16 bytes), which is grouped in units of 32 bits (i.e., 4 bytes) to obtain 4 32-bit words, represented as (X0, X1, X2, X3). The SM4 encryption process adopts a 32-round nonlinear iteration mechanism. Each round of iteration requires a round key (rki), and a total of 32 round keys are required. The round function F receives 5 parameters: 4 32-bit plaintexts (or iterative intermediate values) (Xi, Xi+1, Xi+2, Xi+3) and a 32-bit round key rki, and outputs a 32-bit result. The calculation process of the round function includes nonlinear transformation (S box replacement) and linear transformation (L transformation). First, Xi+1, Xi+2, Xi+3 are XORed with the round key rki, and the result is used as the input of the nonlinear transformation. Then, the output of the nonlinear transformation is XORed with X0, and a linear transformation is performed to obtain the result Xi+4 of this round. After 32 rounds of iteration, 36 32-bit words (X0,...,X35) are obtained. Finally, these four words are reversed, that is, (Y0,Y1,Y2,Y3)=(X35,X34,X33,X32), and the final 128-bit ciphertext data is obtained.

[0089] In some embodiments, for key expansion: the input encryption key is 128 bits (i.e., 16 bytes), and is also grouped in units of 32 bits to obtain 4 32-bit words, represented as (MK0, MK1, MK2, MK3). The key expansion algorithm uses the system parameter FK (four constants) and the fixed parameter CKi (32 fixed parameters) to generate 32 round keys. First, the initial key MKi is XORed with the system parameter FKi to obtain the key Ki (i=0, 1, 2, 3) used for the cycle. Then, through round function iteration similar to the encryption process (but the linear transformation part is slightly different), 32 round keys rki (i=0, 1, ..., 31) are generated.

[0090] The solution proposed in this application has the following beneficial effects:

[0091] Improve transparency and traceability: Blockchain technology ensures data transparency and immutability in all links of the supply chain. Participants can view, verify and trace the transportation history of goods in real time, thereby improving the visibility and traceability of the supply chain. Improve supply chain efficiency: The automatic execution, real-time detection and data sharing of smart contracts reduce human errors and communication delays, and improve the efficiency of the entire supply chain. Automated contract execution and timely exception handling help reduce management costs. Ensure compliance and quality control: The immutability and traceability of blockchain help ensure the compliance and quality control of the supply chain, providing strong support for the legitimacy of the supply chain. Reduce management and operating costs: By automating processes, reducing manual intervention and optimizing supply chain efficiency, the system can reduce management and operating costs and help control overall costs. Strengthen security: The decentralized and encrypted characteristics of blockchain, as well as the secure execution of smart contracts, provide security for the entire cold chain logistics system, ensuring that only authorized participants can access and modify data, effectively preventing potential malicious attacks.

[0092] On the other hand, the present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the cold chain logistics management method based on blockchain as described in any one of the above embodiments are implemented.

[0093] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the blockchain-based cold chain logistics management method described in any of the above embodiments.

[0094] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0095] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0096] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0097] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0098] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0099] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0100] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0101] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0102] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A cold chain logistics management method based on blockchain, characterized in that: include: Read the environmental data collected by various sensors in the cold chain logistics process, and pre-process the environmental data to obtain target environmental data; Establish a consortium blockchain node, and configure and start the consortium blockchain node; The target environment data is transmitted to the alliance blockchain network, so that all nodes in the alliance blockchain receive the target environment data and start verification. If the verification passes, it means that the target environment data has been written into the alliance blockchain.

2. The cold chain logistics management method according to claim 1, characterized in that: Read the environmental data collected by various sensors in the cold chain logistics process, and pre-process the environmental data to obtain the target environmental data, including: The environmental data collected by various sensors are filtered and statistical parameters are calculated to filter out abnormal values ​​and noise data and obtain the target environmental data.

3. The cold chain logistics management method according to claim 1, characterized in that: The process of starting the node includes: The Gossip protocol is used between peer nodes in the alliance blockchain to complete block broadcasting and state synchronization. Each transmitted Gossip message has a corresponding signature to prevent the Gossip message from being distributed to other nodes that are not in the same channel. Nodes affected by block loss due to delays or network partitions are synchronized by contacting nodes that already have the missing blocks; For the propagation of new blocks, the upper peer node on the channel extracts data from the sorting node service and distributes blocks to randomly selected neighbor nodes through the Gossip protocol. Each node periodically compares the data with the randomly selected neighbor nodes to keep the block data status synchronized.

4. The cold chain logistics management method according to claim 1, characterized in that: The cold chain logistics management method further includes: Deploy smart contracts on the consortium blockchain network and configure smart contract monitoring rules to determine smart contract events or conditions that trigger alarms, where smart contracts include but are not limited to cargo tracking smart contracts, transportation cost smart contracts, and audit contracts.

5. The cold chain logistics management method according to claim 4, characterized in that: The smart contract monitoring rules are formulated based on the function, data status or transaction behavior of the contract.

6. The cold chain logistics management method according to claim 1, characterized in that: Before transmitting the target environment data to the alliance blockchain network so that all nodes in the alliance blockchain receive the target environment data and start verification, if the verification indicates that the target environment data has been written into the alliance blockchain, the cold chain logistics management method further includes: The target environment data is signed and encrypted, and the signed and encrypted target environment data is broadcast to the alliance chain network.

7. The cold chain logistics management method according to claim 6, characterized in that: The process of signing the target environment data includes: Use the SM3 hash function to hash the target environment data M to be signed, and generate a hash value of a fixed length related to the target environment data M to be signed and the user information; The hash value is concatenated with the target environment data M to be signed to obtain a preprocessed message M', and the preprocessed message M' is hashed using the SM3 hash function to obtain a hash value; The signature pair is determined based on the hash value.

8. The cold chain logistics management method according to claim 6, characterized in that: The process of encrypting the target environment data includes: Segmenting the target environment data to obtain a plurality of data groups of the same length; Using round function iteration to perform nonlinear transformation and linear transformation processing on multiple data groups of the same length, respectively, to obtain the iterative results corresponding to each data group of the same length; The corresponding iteration result of each data group of the same length is reversed to obtain the ciphertext data corresponding to the target environment data.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the blockchain-based cold chain logistics management method are implemented as described in any one of claims 1 to 8.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, the steps of the blockchain-based cold chain logistics management method as described in any one of claims 1 to 8 are implemented.

Citation Information

Cited By

  • Expressway construction business data credibility supervision method and system based on block chain

    CN122048271A