A method for sharing Internet of Things data based on blockchain payment channel network

By using the payment channel network and homomorphic hashing mechanism to expand the blockchain in the IoT environment, combined with multi-point relay and multi-path routing algorithms, the security and efficiency issues of IoT data sharing are solved, achieving high efficiency and security data sharing and resource optimization.

CN115361395BInactive Publication Date: 2024-08-23BEIJING INST OF TECH +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202210828802.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-14
Publication Date
2024-08-23
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional data sharing solutions based on centralized infrastructure in the IoT environment face privacy and security challenges, and existing blockchain-based data sharing solutions are computationally expensive and inefficient, making it impossible for IoT devices with limited resources to complete Computationally intensive consensus.

Method used

The payment channel network (PCN) is used to extend the blockchain, achieve efficient data sharing through multi-signature wallets and homomorphic hashing mechanisms, and use multi-point relay mechanisms to optimize route maintenance, and use node-disjoint multi-path routing algorithms to improve transaction success. rate and network utilization.

Benefits of technology

It achieves efficient and secure data sharing between IoT devices, reduces computing costs, improves transaction success rate and network resource utilization, and provides traceable distributed ledger management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115361395B
    Figure CN115361395B
Patent Text Reader

Abstract

The present invention relates to an Internet of Things data sharing method based on a blockchain payment channel network, and belongs to the field of blockchain technology. It includes four stages: data collection and processing, transaction segmentation, transaction routing, and transaction data recording. As a participant node of the blockchain, the Internet of Things device initiates a transaction in the payment channel network when data sharing is required. The present invention designs a transaction segmentation method based on homomorphic hashing, which solves the problem of low transaction success rate due to mortgage asset restrictions in the payment channel network. The payment channel network adopts a table-driven routing method based on a multi-point relay mechanism, and designs a minimum relay node selection algorithm to reduce routing maintenance overhead. The payment channel network is abstracted as a directed graph, and multiple node-disjoint shortest paths are planned to perform transaction routing, thereby improving the transaction success rate. At the end of data sharing, the shared records are uploaded to the blockchain for secure storage. This method realizes safe and efficient data sharing between Internet of Things devices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method for sharing Internet of Things data by utilizing a blockchain extended by a payment channel network in an Internet of Things environment, and belongs to the technical field of blockchain application. Background Art

[0002] IoT devices are currently widely deployed in various fields such as smart transportation, smart grid, and healthcare. Data sharing between IoT devices is an inevitable trend to enhance data value and build a digital integrated smart city. Faced with the ever-increasing amount of data and increasingly complex network structure, ensuring efficient and secure data sharing in the IoT environment is facing major challenges.

[0003] Traditional IoT data sharing solutions based on centralized infrastructure face challenges in privacy and security. Blockchain is considered to be an effective solution for achieving secure and efficient data sharing in IoT environments due to its decentralization, tamper-proof and traceability. However, most existing blockchain-based data sharing solutions face the problems of high computational costs and low efficiency, and IoT devices with limited resources cannot complete computationally intensive consensus. Summary of the invention

[0004] The purpose of the present invention is to solve the technical problem of how to achieve efficient and secure data sharing in the Internet of Things environment. A method for sharing Internet of Things data based on a blockchain payment channel network is creatively proposed.

[0005] The present invention uses a payment channel network (PCN) to expand the blockchain and achieve efficient IoT data sharing. In PCN, data is attached to transactions. Participants create a multi-signature wallet and pre-deposit a sum of money into the wallet, which is called the channel balance. Participants conduct direct transactions with designated users within a limited time through the payment channel. Between participants who do not directly establish a payment channel, transactions are forwarded through intermediary users, and intermediary users charge forwarding fees. When transactions between participants are carried out instantly off-chain, the final results are cleared and recorded on the blockchain when the channel is closed.

[0006] When the transaction amount exceeds the channel balance, the transaction fails because it cannot be forwarded through the channel. In order to improve the success rate of large transactions, large payments are divided into multiple small payments. Usually, the multiple transactions obtained after segmentation have the same hash lock, and the intermediate forwarding node checks whether the transaction is segmented by checking the hash lock of the transaction. Since the success rate of unsegmented transactions is usually greater than that of segmented transactions, rational intermediate nodes tend to forward unsegmented transactions, which cannot guarantee fairness between transactions. To this end, the present invention proposes a transaction segmentation method based on homomorphic hashing, so that intermediate nodes cannot distinguish between overall payments and segmented payments. Homomorphic hashing refers to a hash function with homomorphic properties. The homomorphic property means that after decrypting the output obtained by homomorphically encrypted data processing, the result is the same as the output of the unencrypted original data processed in the same way. At the same time, homomorphic hashing still maintains the anti-collision property of the hash function, that is, it is difficult to find a pair of numbers in the domain of definition so that the values ​​of this pair of numbers after function mapping are the same.

[0007] In order to solve the problem of unstable wireless IoT infrastructure, PCN-based IoT data sharing adopts self-organizing network. In traditional link state routing algorithms, flooding is usually used to maintain the routing table, that is, each node broadcasts its own link state data packet to all other nodes. However, in the case of large-scale and high-density IoT devices, maintaining the network topology through flooding will cause huge overhead. The Optimized Link State Routing (OLSR) protocol reduces communication overhead through the multi-point relay (MPR) mechanism. The MPR mechanism only selects some nodes to forward link state information, and these selected nodes are called relay nodes.

[0008] Compared with single-path routing, multi-path routing has greater advantages in fault tolerance, reliability, and service quality. The node-disjoint multi-path routing mechanism can balance the network load while improving the transaction success rate. Generally, the stronger the independence of the paths in multi-path routing, the more network resources can be fully utilized. Nodes have the right to independently choose paths, so the use of paths can be adjusted according to the degree of network congestion, thereby improving network utilization.

[0009] First, the relevant concepts and contents involved in the present invention are explained.

[0010] Blockchain: It is an open distributed ledger running on a peer-to-peer network that can establish trust between multiple independent individuals or systems without the need for a middleman. The data in the blockchain is sequentially connected into a chain structure in the form of blocks, and the security, verifiability and immutability of the data are maintained through cryptography.

[0011] Consensus mechanism: It is a protocol or algorithm used to maintain data consistency in the blockchain system. It is also the key to establish trust in the blockchain system without a centralized organization. Transactions are voted on through specific blockchain nodes to complete the verification and confirmation of transactions within a certain period of time. If the nodes of all parties with unrelated interests reach a consensus on the transaction, the transaction is added to the entire blockchain ledger to ensure the consistency of the ledger data.

[0012] Payment channel: A method of cryptocurrency trading. Participants create a multi-signature wallet and pre-deposit a sum of money into the wallet, which is called the channel balance. Participants can conduct direct transactions with designated users through the payment channel for a limited time. Unidirectional payment channels only allow funds to flow in one direction, while bidirectional payment channels allow bidirectional transactions.

[0013] Payment Channel Network (PCN): is an off-chain cryptocurrency transaction solution designed to improve the scalability of blockchain. The essence of the payment channel network is a collection of two-way payment channels. Participants who do not directly establish payment channels can forward transactions through intermediary users. Transactions between participants are carried out instantly off-chain, and the final results are cleared and recorded on the blockchain when the channel is closed.

[0014] Homomorphic hashing: refers to a hash function with homomorphic properties. Homomorphic properties mean that after decrypting the output of homomorphically encrypted data, the result is the same as the output of the unencrypted original data processed in the same way. At the same time, homomorphic hashing still maintains the anti-collision property of the hash function, that is, it is difficult to find a pair of numbers in the domain of definition that have the same value after being mapped by the function.

[0015] Table-driven routing protocol: A table-based routing protocol. In this protocol, each node maintains one or more tables of routing information to all other nodes in the network. When a change in the network topology is detected, the node sends routing update information in the network. When the update information is received, the node updates its own table to make its routing information consistent, timely, and accurate.

[0016] Multi-point Relay (MPR) mechanism: It refers to the process of selecting some nodes to forward broadcasts in order to reduce flooding overhead during the routing table maintenance process. These selected nodes are called relay nodes, and link state information is only generated by relay nodes, thereby reducing control information flooding in the network.

[0017] The present invention is implemented by adopting the following technical solutions.

[0018] A method for sharing Internet of Things data based on a blockchain payment channel network, comprising the following steps:

[0019] Step 1: Collect data.

[0020] The object perception of IoT devices relies on connected sensors or other technical devices. The main function of these devices is to identify and locate objects, as well as to accurately collect object data when needed.

[0021] Preferably, since a large number of IoT devices will generate massive amounts of heterogeneous data, data processing can be performed before storage.

[0022] Step 1.1: Standardize or convert the data into a uniform format to make it compatible with the corresponding application.

[0023] Step 1.2: Store or create a backup of the newly converted format data.

[0024] Step 1.3: Filter duplicate, outdated, and invalid data to reduce data redundancy and improve accuracy.

[0025] Step 1.4: Integrate structured or unstructured data from other sources to enrich the current dataset.

[0026] Step 2: Generate a transaction.

[0027] The participants in the transaction include data requesters and data providers, where data requesters are IoT devices with corresponding data needs and data providers are IoT devices with shared data resources.

[0028] When there is a need for data sharing, the data requester initiates a transaction with the data provider by executing a smart contract in the blockchain.

[0029] Step 3: Split the transaction.

[0030] IoT devices also act as participating nodes in the payment channel network in the blockchain to forward transactions.

[0031] Among them, participants in the payment channel network must pledge an asset in the channel in advance. When the transaction amount exceeds the pledged assets in the current channel, the transaction fails.

[0032] In order to improve the success rate of large transactions in the payment channel network, a large transaction can be split into multiple small transactions based on the homomorphic hashing mechanism.

[0033] Step 4: Route maintenance.

[0034] The blockchain-based IoT data sharing model uses a self-organizing network, where each payment channel network node acts as both a terminal and a router, capable of searching and maintaining a route to another node in the network. When a node needs to communicate with a node outside its coverage, multi-hop forwarding by an intermediate node is required.

[0035] The blockchain-based IoT data sharing model adopts table-driven routing, broadcasting HELLO messages within a one-hop neighbor node to monitor the status of the neighbor node and build the node's neighbor table, where the HELLO message includes the address of the neighbor node, the cost to reach the neighbor node, and the remaining funds in the channel between the neighbor node.

[0036] Furthermore, the present invention proposes a multi-point relay selection algorithm to help each node select several nodes from its one-hop neighbor nodes as multi-point relay (MPR) nodes. Only multi-point relay nodes participate in forwarding topology control (TC) messages and participating in routing, thereby greatly reducing the communication overhead caused by link state update messages. The multi-point relay nodes regularly update the latest topology status of the payment channel network based on the received topology control messages.

[0037] Step 5: Transaction forwarding.

[0038] The payment channel network is abstracted as a directed graph G = (V, E), where V is the set of participating nodes and E is the set of all channels.

[0039] In the payment channel network, when two nodes conduct a transaction, a routing path consisting of multiple payment channels needs to be planned. Furthermore, since different paths require different forwarding fees and delay costs, the path selection scheme directly affects the system transaction performance. The present invention proposes a node-disjoint multi-path routing algorithm, which minimizes the routing cost while improving the reliability of the routing.

[0040] First, the MPR mechanism is used to obtain the current routing topology and fund view of the entire PCN. In order to reduce network communication overhead, an algorithm to solve the minimum MPR set selection problem is used. In addition, the payment channel network is abstracted as a directed graph, and multiple node-disjoint shortest paths are planned for transaction routing, which improves the transaction success rate and avoids path congestion.

[0041] Step 6: Store transaction records.

[0042] In a blockchain based on a payment channel network, a large number of transactions are carried out in real time outside the blockchain, and off-chain transactions do not have to wait for the on-chain consensus process, thereby improving the scalability of the blockchain system.

[0043] When the two parties want to terminate the transaction, the final settlement and merger are carried out based on the data sharing transaction records, and then submitted to the blockchain. The merged data sharing transactions are stored in the blockchain ledger after negotiation and verification.

[0044] Beneficial Effects

[0045] Compared with the prior art, the method of the present invention has the following advantages:

[0046] 1. This method uses a payment channel network to extend the blockchain to achieve efficient data sharing between IoT terminal devices. The payment channel network establishes a data transmission channel to support high-frequency data exchange. The data exchange transaction is executed outside the blockchain, and the exchange record is only uploaded to the blockchain for consensus and storage during the final settlement. In addition, the blockchain provides a traceable distributed ledger for IoT secure data sharing management.

[0047] 2. In order to improve the success rate of large transactions, the present invention introduces a homomorphic hash-driven transaction segmentation scheme into the proposed PCN-based data sharing scheme to ensure fairness by cutting off the association between the segmented transactions.

[0048] 3. The present invention proposes an intelligent multi-path routing solution, which improves the success rate of IoT data sharing while ensuring high-frequency transactions of IoT data sharing in PCN. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 It is a top-level architecture diagram of the method of the present invention.

[0050] Figure 2 The data sharing workflow diagram of the method of the present invention is shown in FIG.

[0051] Figure 3 It is a comparison diagram of the MPR mechanism and the flooding mechanism in the method of the present invention. DETAILED DESCRIPTION

[0052] The specific implementation process of the method of the present invention is further described in detail below in conjunction with the drawings and embodiments.

[0053] Example

[0054] Figure 1 The top-level architecture of the method of the present invention is shown.

[0055] A method for sharing IoT data based on blockchain payment channel network, such as Figure 2 As shown, the following steps are included.

[0056] Step 1: IoT devices collect data.

[0057] Object perception of IoT devices relies on connected sensors, radio frequency identification, image recognition and other technical equipment to identify and locate targets, as well as to accurately collect target data when needed.

[0058] Since a large number of IoT devices will generate massive amounts of heterogeneous data, data processing can be performed first, including:

[0059] Standardize or convert data into a unified format to make it compatible with the corresponding applications; store or create backups of newly converted formatted data; filter duplicate, obsolete, and invalid data to reduce data redundancy and improve accuracy; integrate structured or unstructured data from other sources to enrich current data sets.

[0060] The collected data can be stored in local or cloud databases. Standardized data can be shared and traded among participants in the IoT environment.

[0061] Step 2: Generate a transaction.

[0062] The participants in the transaction include data requesters and data providers, where data requesters are IoT devices with corresponding data needs and data providers are IoT devices with shared data resources.

[0063] When there is a need for data sharing, the data requester initiates a transaction with the data provider by executing a smart contract in the blockchain. Therefore, the data requester is the transaction initiator.

[0064] Step 3: Transaction splitting.

[0065] IoT devices also act as participating nodes in the payment channel network in the blockchain to forward transactions.

[0066] The payment channel network requires all participants joining the network to pledge an asset in the channel in advance. When the transaction amount exceeds the pledged assets in the current channel, the transaction fails.

[0067] In order to improve the success rate of large transactions in the payment channel network, the present invention proposes a method based on homomorphic hashing mechanism to split a large transaction into multiple small transactions. The details are as follows:

[0068] Assume that the data requester, that is, the transaction initiator, splits a transaction Tx with an amount of a into n small transactions (Tx1, Tx2, ..., Tx n ), the corresponding amount is (a1, a2, ..., a n ), where Tx n Indicates the nth transaction, a=a1+a2+...+a n .

[0069] For transaction Tx, select a random number x R , the hash value h is obtained by the homomorphic hash function H R .

[0070] For transactions (Tx1, Tx2, ..., Tx n ), select n random numbers (x1, x2, ..., x n ) is passed through the homomorphic hash function H to obtain the hash value (h1,h2,...,h n ), h n Represents a random number x n The corresponding hash value. n express.

[0071] Assume that the node receives a transaction with a hash value h and a ciphertext c. h and c are calculated by equation 1 and equation 2 respectively:

[0072] h=H(x R + x) = h R +H(x) (1)

[0073] c=ε pk (x R +x) (2)

[0074] Where h is the hash function H used to perform the hashing of x R and x, and c is the hash value obtained by mapping x using the recipient's public key R The ciphertext is obtained by encrypting the sum of ε and x. pk Represents a public key encryption function.

[0075] For each split transaction Tx i , with a random number x i To construct h i , as shown in formula 3; encrypt the random number with the receiver's public key to obtain the ciphertext c i , as shown in Formula 4:

[0076] h i =h+H(x i )=h R +H(x)+H(x i ) (3)

[0077] c i =c+ε pk (x i )=ε pk (x R +x)+ε pk (x i )=ε pk (x R +x+x i) (4)

[0078] The receiver decrypts c with his own private key sk i Get x i , then calculate H(x i ).

[0079] According to Formula 3, the receiver knows h i and H(x i ) can be calculated. Similarly, after using the private key to decrypt c to obtain x, h can be obtained according to formula 1 R .

[0080] In addition, the recipient provides a receipt proof for all received split transactions to ensure the security and correctness of the transaction splitting scheme.

[0081] Step 4: Route maintenance.

[0082] In the present invention, the blockchain-based IoT data sharing model adopts a self-organizing network, and each payment channel network node is both a terminal and a router, which can search and maintain the route to another node in the network. When a node wants to communicate with a node outside its coverage, multi-hop forwarding by an intermediate node is required.

[0083] The blockchain-based IoT data sharing model adopts table-driven routing, broadcasting HELLO messages within a one-hop neighbor node to monitor the status of the neighbor node and build the node's neighbor table. The HELLO message includes the address of the neighbor node, the cost of reaching the neighbor node, and the remaining funds in the channel between the neighbor node.

[0084] In addition, the present invention adopts a multi-point relay mechanism, that is, each node selects several nodes from its one-hop neighbor nodes as multi-point relay (MPR) nodes. Only multi-point relay nodes participate in forwarding topology control (TC) messages and participate in routing. The node regularly updates the latest topology status of the payment channel network based on the received topology control messages.

[0085] Figure 3 The link states within three hops when using the flooding mechanism and the MPR selection mechanism to broadcast messages are compared. The number of retransmission nodes required to broadcast messages in the flooding mode is 40, while the number of retransmission nodes required in the MPR mode is only 11. This means that the use of multi-relay forwarding mode to maintain the routing table can greatly reduce the communication overhead caused by link state update messages.

[0086] By reducing the number of MPR nodes in the network, the communication overhead of topology maintenance can be reduced. Furthermore, the present invention proposes a minimum MPR set selection method, which is as follows:

[0087] Firstly, the MPR node set selection problem is formally defined.

[0088] Define a node S as the starting node, S∈V, V is the set of participating nodes. 1 (S), N 2 (S) are the sets of one-hop and two-hop neighbor nodes of node S respectively. Define MPR(S) as the set of MPR nodes selected by node S. Then the optimal MPR set selection problem is expressed as the minimum set |MPR(S)| under the condition of satisfying equation 5-9:

[0089]

[0090]

[0091] N 1 (MPR(S)) = N 1 (M1)∪...∪N 1 (M k )-{S}-N 1 (S) (7)

[0092]

[0093]

[0094] Among them, M k represents the kth MPR node, k is the total number of MPR nodes of node S; M i represents the i-th MPR node; N 1 (MPR(S)) represents the one-hop neighbor set of the MPR node set of node S, N 1 (M1) represents the one-hop neighbor set of the first MPR node of node S, N 1 (M k ) represents the one-hop neighbor set of the kth MPR node of node S; U represents a node in the node set V, N 1 (U) represents the one-hop neighbor set of node U; is any symbol, For the existence symbol.

[0095] To solve the above problem, the present invention adopts a multi-point relay selection algorithm to reduce the number of MPR nodes as much as possible, thereby reducing the number and forwarding time of TC messages in the network.

[0096] The input of the multi-point relay selection algorithm includes the topology of the payment channel network G = (V, E) and the starting node S. The output of the algorithm includes the MPR node set MPR (S) of the starting node S, the one-hop neighbor set N 1(S), two-hop neighbor set N 2 (S). The details are as follows:

[0097] Step 4.1: Initialization.

[0098] First, initialize MPR(S) to the set of one-hop neighbor nodes N 1 (S). Then, the status of all nodes in MPR (S) is marked as unselected.

[0099] For each node V in MPR(S) i , calculate its two-hop neighbor node set N 2 The number of nodes that can be covered in (S) is denoted as deg[V i ].

[0100] Step 4.2: Node selection for the MPR(S) set.

[0101] Check each node in the current MPR(S) set. For the current node V i If it has been selected into the MPR set by other nodes and the forwarding willingness is not 0, V i Add S to the MPR set and add V i The status of is changed to selected by S.

[0102] Step 4.3: Add necessary nodes and delete redundant nodes in the MPR(S) set.

[0103] By traversing the nodes in the MPR(S) set that are in the selected state, redundancy is eliminated and the communication overhead of maintaining the routing table is reduced.

[0104] If there are nodes in the MPR(S) set that are not selected, then traverse these nodes. Find the node V with the smallest degree one by one. i , detect when removing V i Can the remaining nodes in the MPR(S) set cover N 2 (S). If yes, delete node V i , otherwise the node V i The status of is marked as selected.

[0105] The execution process of the above multi-point relay selection algorithm is as follows in pseudo code:

[0106]

[0107] Step 5: Transaction forwarding.

[0108] The payment channel network is abstracted as a directed graph G = (V, E), where V is the set of participating nodes and E is the set of all channels.

[0109] In the payment channel network, when two nodes conduct a transaction, a routing path consisting of multiple payment channels must be planned. Since different paths require different forwarding fees and delay costs, the path selection scheme directly affects the system transaction performance. This paper proposes a node-disjoint multi-path routing algorithm, which minimizes the routing cost while improving the reliability of the routing.

[0110] The input of the algorithm includes the topology of the payment channel network G = (V, E), the edge weight set w, the channel balance set Deposit, the starting node S, the target node T, the transaction amount Tx.a, and the preset number of paths k. The output of the algorithm is a set P of k node-disjoint shortest paths between S and T. Lines (1) to (22) of the pseudocode define a function Route that finds the shortest path between S and T under the constraint of the channel balance. The main function of lines (23) to (29) is to establish k node-disjoint shortest paths.

[0111] The specific process of the entire algorithm includes the following steps:

[0112] Step 5.1: Lines (2) to (5) correspond to the initialization process of variables. Based on the routing table maintained by the multi-relay forwarding algorithm, an adjacency list (head and e) is established to store the PCN topology. Among them, head is the first address of the linked list composed of the corresponding edges of a node. The array e is used to store the nodes pointed to by an edge. Define the array visit to store the visit status of the nodes in the graph G, and initialize visit with 0 (unvisited state). Define the array dist as the path length from the starting node S to each vertex in V, and initialize dist to ∞ (indicating that the path is unreachable). Since the distance from S to itself is 0, initialize dist[S.pos] to 0, where pos is the position index of node S. Define a priority queue Q, whose first element is the length of the shortest path from S to the current node, and the second element is the index of the current node. The starting node S is added to Q for initialization.

[0113] Step 5.2: Lines (6) to (21) correspond to the process of finding the shortest path from S to each node. A priority queue Q is used to store vertices and distances that can be used to update the shortest path. When Q is not empty, the element with the shortest path length (denoted as V) is popped out each time. If V has been processed, skip it directly; otherwise, mark V as processed and process the vertices adjacent to it. If V's neighbor U can provide a shorter path length, update dist[] and add the relevant information of U to the queue Q. Repeat the above process until all nodes have been processed. The shortest path Path from S to T can be constructed based on the values ​​in dist[] that are not equal to ∞, and the length of Path is stored in dist[T.pos].

[0114] Step 5.3: First add the current Path to P, then copy a PCN topology and delete all nodes in the current path Path. Call the Route function to find another shortest path to join P. Exit this algorithm until the preset number of paths k is reached or the condition is not met.

[0115] Step 6: Store transaction records.

[0116] In a blockchain based on a payment channel network, a large number of transactions are carried out in real time outside the blockchain, and off-chain transactions do not have to wait for the on-chain consensus process, thereby improving the scalability of the blockchain system.

[0117] When the two parties want to terminate the transaction, the final settlement and merger are carried out based on the data sharing transaction records, and then submitted to the blockchain. The merged data sharing transactions are stored in the blockchain ledger after negotiation and verification.

[0118] Considering the storage limitations of IoT devices, ordinary IoT nodes only store block headers, while consensus service nodes store the complete blockchain ledger. The consensus process includes the following steps.

[0119] Step 6.1: Endorsement phase.

[0120] The transaction initiator first sends the transaction proposal to the endorsing node, which verifies the legitimacy of the transaction, including transaction format, duplicate records, digital signatures, etc.

[0121] The endorsing node then signs the execution result and returns it to the transaction initiator.

[0122] Assume that there are n faulty nodes. When the transaction initiator receives n+1 identical endorsement results, it is considered that a consensus has been reached on the simulation execution results.

[0123] After the transaction initiator verifies the endorsement result, he combines the transaction proposal, endorsement result and his own signature into a transaction and sends the transaction to the sorting node.

[0124] Step 6.2: Sorting phase.

[0125] When any two devices in an IoT system exchange data, they need to process transactions submitted by different participants.

[0126] The sorting node receives all transactions in the network without checking the transaction content, and sorts them according to the specified logic. The purpose of sorting transaction data is to ensure the consistency of the transaction sequence in the blockchain. When the generation strategy set by the block is met (for example, the cached transactions reach the maximum number of transactions in the block, or the block generation time is reached, etc.), the transactions are packaged into a new block. After the new block is signed, it will be broadcast to the verification nodes.

[0127] Step 6.3: Verification phase.

[0128] After receiving the broadcasted block, the submitting node performs a final check and saves it.

[0129] The node verifies the validity of transaction data (such as transaction format, signature, etc.), the legitimacy of the information, and the validity of the specified endorsement policy. On each peer node, each transaction verifies the consistency of its endorsement before being submitted to the ledger.

[0130] Finally, valid transactions are eventually recorded in the blockchain file system, and failed transactions are left for audit.

[0131] Below, the pseudo code and explanation of the multi-path routing algorithm execution process are given.

[0132]

[0133]

[0134] The meanings of the relevant symbols involved in the present invention are as follows:

[0135] symbol meaning <![CDATA[Tx i ]]> Transaction with sequence number i <![CDATA[a i ]]> <![CDATA[Transaction Tx i has an amount of a]]> <![CDATA[Pr(Tx i )]]> <![CDATA[Transaction Tx i Probability of successful completion]]> <![CDATA[h i ]]> <![CDATA[Natural number x i The corresponding hash value]]> H Homomorphic hash functions <![CDATA[ε pk ]]> Public key encryption function G=(V,E) Payment channel network topology <![CDATA[V i (In i ∈V)]]> The vertex with index i in the topology <![CDATA[E j (AND j ∈E)]]> The edge with sequence number j in the topology <![CDATA[deg[V i ]]]> <![CDATA[Degree of vertex V i > <![CDATA[P i,j ]]> <![CDATA[The set of paths from vertex V i to vertex V j > <![CDATA[(pk i ,sk i )]]> <![CDATA[Public and private key pair of vertex V i > <![CDATA[N 1 (S)]]> The set of 1-hop neighbor nodes of vertex S <![CDATA[N 2 (S)]]> The set of 2-hop neighbor nodes of vertex S MPR(S) The multi-point relay set of vertex S

[0136] The method achieves safe and efficient sharing of IoT data through blockchain technology based on a payment channel network, maximizes the value of IoT data, and is conducive to promoting the virtuous cycle and intelligent development of the entire IoT ecosystem.

[0137] The above is only a preferred embodiment of the present invention, and the present invention should not be limited to the contents disclosed in the embodiment and the drawings. Any equivalent or modification completed without departing from the spirit disclosed in the present invention shall fall within the protection scope of the present invention.

Claims

1. A method for sharing Internet of Things data based on a blockchain payment channel network, characterized in that: The following steps are involved: Step 1: IoT devices collect data; Step 2: Generate transaction; The parties involved in the transaction include data requesters and data providers, where data requesters are IoT devices with corresponding data needs, and data providers are IoT devices with shared data resources; When there is a need for data sharing, the data requester initiates a transaction with the data provider by executing a smart contract in the blockchain. The data requester is the transaction initiator. Step 3: Split the transaction; IoT devices also act as participating nodes in the payment channel network in the blockchain to forward transactions; Participants in the payment channel network must pledge an asset in the channel in advance. When the transaction amount exceeds the pledged assets in the current channel, the transaction fails. A large transaction is split into multiple small transactions based on a homomorphic hashing mechanism. The method is as follows: Assume that the data requester, that is, the transaction initiator, splits a transaction Tx with an amount of a into n small transactions (Tx1, Tx2, ..., Tx n ), the corresponding amount is (a 1, a 2, ... , a n ), where Tx n Indicates the nth transaction, a=a1+a2+...+a n ; For transaction Tx, select a random number x R , the hash value h is obtained by the homomorphic hash function H R ; For transactions (Tx1, Tx2, ..., Tx n ), select n random numbers (x1, x2, ..., x n ) is passed through the homomorphic hash function H to obtain the hash value (h1,h2,...,h n ), h n Represents a random number x n The corresponding hash value; Assume that the node receives a transaction with a hash value h and a ciphertext c. h and c are calculated by equation 1 and equation 2 respectively: h = H(x R + x) = h R + H(x) (1) c = ε pk (x R + x) (2) Where h is the hash function H used to perform the hashing of x. R and x, and c is the hash value obtained by mapping x using the recipient's public key R The ciphertext obtained by encrypting the sum of ε and x; pk Represents a public key encryption function; For each split transaction Tx i , with a random number x i To construct h i , as shown in formula 3; encrypt the random number with the receiver's public key to obtain the ciphertext c i, As shown in formula 4: h i = h + H(x i ) = h R + H(x) + H(x i ) (3) c i = c + e pk (x i ) = e pk (x R + x) + e pk (x i ) = e pk (x R + x + x i ) (4) The receiver decrypts c with his private key sk i Get x i , then calculate H(x i ); According to Formula 3, the receiver knows h i and H(x i ) can be used to calculate h; similarly, after using the private key to decrypt c to obtain x, h can be obtained according to formula 1 R ; At the same time, the receiver provides a receipt proof for all received split transactions to ensure the security and correctness of the transaction splitting scheme; Step 4: Route maintenance; The blockchain-based IoT data sharing model uses a self-organizing network. Each payment channel network node acts as both a terminal and a router, capable of searching and maintaining a route to another node in the network. When a node needs to communicate with a node outside its coverage, multi-hop forwarding by an intermediate node is required. The IoT data sharing model based on blockchain adopts table-driven routing, broadcasting HELLO messages in one-hop neighbor nodes to monitor the status of neighbor nodes and build the node's neighbor table. The HELLO message includes the address of the neighbor node, the cost of reaching the neighbor node, and the remaining funds in the channel between the neighbor node and the neighbor node. Using a multi-point relay mechanism, each node selects several nodes from its one-hop neighbor nodes as multi-point relay nodes, that is, MPR nodes; only multi-point relay nodes participate in forwarding topology control messages, that is, TC messages, and participate in routing; nodes regularly update the latest topology status of the payment channel network based on the received topology control messages; Step 5: Transaction forwarding; The payment channel network is abstracted into a directed graph G = (V, E), where V is the set of participating nodes and E is the set of all channels; In the payment channel network, when two nodes conduct a transaction, a routing path consisting of multiple payment channels must be planned, using a node-disjoint multi-path routing algorithm. The input of the algorithm includes the topology of the payment channel network G = (V, E), the edge weight set w, the channel balance set Deposit, the starting node S, the target node T, the transaction amount Tx.a, and the preset number of paths k; the output of the algorithm is the set P of k node-disjoint shortest paths between S and T; Step 6: Store transaction records; In a blockchain based on a payment channel network, a large number of transactions are carried out in real time outside the blockchain, and off-chain transactions do not have to wait for the on-chain consensus process; When the two parties want to terminate the transaction, they will conduct final settlement and merger based on the transaction records of data sharing, and then submit them to the blockchain. The merged data sharing transaction will be stored in the blockchain account book after negotiation and verification; Ordinary IoT nodes only store block headers, while consensus service nodes store the complete blockchain ledger.

2. The method for sharing Internet of Things data based on a blockchain payment channel network as claimed in claim 1, characterized in that: When collecting data in step 1, the collected data is processed, including: Standardize or convert data into a uniform format to make it compatible with the appropriate applications; Store or create a backup of the data in a new converted format; Filter duplicate, outdated and invalid data; Integrate structured or unstructured data from other sources to enrich current data sets; Standardized data can be shared and traded between participants in an IoT environment.

3. The method for sharing Internet of Things data based on a blockchain payment channel network as claimed in claim 1, characterized in that: When performing route maintenance in step 4, the minimum MPR set selection method is adopted, as follows: First, the MPR node set selection problem is formally defined; Define a node S as the starting node, S∈V, V is the set of participating nodes; N 1 (S), N 2 (S) are the sets of one-hop and two-hop neighbor nodes of node S respectively; MPR(S) is defined as the set of MPR nodes selected by node S, then the optimal MPR set selection problem is expressed as the minimum set |MPR(S)| under the condition of satisfying equation 5-9: N 1 (MPR(S) ) = N 1 (M1) ∪ ... ∪ N 1 (M k ) - {S} - N 1 (S) (7) Among them, M k represents the kth MPR node, k is the total number of MPR nodes of node S; M i represents the i-th MPR node; N 1 (MPR(S)) represents the one-hop neighbor set of the MPR node set of node S, N 1 (M1) represents the one-hop neighbor set of the first MPR node of node S, N 1 (M k ) represents the one-hop neighbor set of the kth MPR node of node S; U represents a node in the node set V, N 1 (U) represents the one-hop neighbor set of node U; is any symbol, For the symbol of existence; The input of the multi-point relay selection algorithm includes the topology of the payment channel network G = (V, E) and the starting node S; the output of the algorithm includes the MPR node set MPR (S) of the starting node S, the one-hop neighbor set N 1 (S), two-hop neighbor set N 2 (S), as follows: Step 4.1: Initialization; First, initialize MPR(S) to the set of one-hop neighbor nodes N 1 (S); then, mark the status of all nodes in MPR (S) as unselected; For each node V in MPR(S) i , calculate its two-hop neighbor node set N 2 The number of nodes that can be covered in (S) is denoted as deg[V i ]; Step 4.2: Node selection of MPR(S) set; Check each node in the current MPR(S) set. For the current node V i If it has been selected into the MPR set by other nodes and the forwarding willingness is not 0, V i Add S to the MPR set and add V i The status of is changed to being selected by S; Step 4.3: Add necessary nodes and delete redundant nodes in the MPR(S) set; By traversing the nodes in the MPR(S) set that are in the selected state, redundancy is eliminated and the communication overhead of maintaining the routing table is reduced; If there are nodes in the MPR(S) set that are not selected, then traverse these nodes and find the node V with the smallest degree in turn. i , detect the removal of V i Can the remaining nodes in the MPR(S) set cover N 2 (S); If possible, delete node V i , otherwise the node V i The status of is marked as selected.

4. The method for sharing Internet of Things data based on a blockchain payment channel network as claimed in claim 1, characterized in that: When forwarding transactions in step 5, a node-disjoint multi-path routing algorithm is used, which includes the following steps: Step 5.1: Variable initialization; Based on the routing table maintained by the multi-relay forwarding algorithm, an adjacency list head and an array e are established to store the PCN topology; head is the first address of the linked list composed of the corresponding edges of a node; array e is used to store the nodes pointed to by an edge; the array visit is defined to store the visit status of the nodes in the graph G, and visit is initialized with 0, that is, the unvisited state; the array dist is defined as the path length from the starting node S to each vertex in V, and the array dist is initialized to ∞, indicating that the path is unreachable; since the distance from S to itself is 0, dist[S.pos] is initialized to 0, where pos is the position index of the node S; a priority queue Q is defined, whose first element is the length of the shortest path from S to the current node, and the second element is the index of the current node; the starting node S is added to Q for initialization; Step 5.2: The process of finding the shortest path from S to each node; A priority queue Q is used to store vertices and distances used to update the shortest path. When Q is not empty, the element with the shortest path length is popped out each time, recorded as V. If V has been processed, it is skipped directly. Otherwise, V is marked as processed and its adjacent vertices are processed. If V's neighbor U can provide a shorter path length, dist[] is updated and the relevant information of U is added to the queue Q. The above process is repeated until all nodes have been processed. The shortest path Path from S to T can be constructed based on the value in dist[] that is not equal to ∞, and the length of Path is stored in dist[T.pos]. Step 5.3: First add the current Path to P, then copy a PCN topology and delete all nodes in the current path Path; call the Route function to find another shortest path to join P; exit until the preset number of paths k is reached or the condition is not met.

5. The method for sharing Internet of Things data based on a blockchain payment channel network as claimed in claim 1, characterized in that: In step 6, the consensus process includes the following steps: Step 6.1: Endorsement phase; The transaction initiator first sends the transaction proposal to the endorsing node, which verifies the legitimacy of the transaction, including transaction format, duplicate records, and digital signatures. Then, the endorsing node signs the execution result and returns it to the transaction initiator; Assuming there are n faulty nodes, when the transaction initiator receives n+1 identical endorsement results, it is considered that a consensus has been reached on the simulation execution result; After the transaction initiator verifies the endorsement result, it combines the transaction proposal, endorsement result and its own signature into a transaction and sends the transaction to the sorting node; Step 6.2: Sorting phase; When any two devices in an IoT system exchange data, they need to process transactions submitted by different participants; The sorting node receives all transactions in the network without checking the transaction content, and sorts them according to the specified logic; when the generation strategy set by the block is met, the transaction is packaged into a new block; after the new block is signed, it will be broadcast to the verification node; Step 6.3: Verification phase; After receiving the broadcasted block, the submitting node performs a final check and saves it; Nodes verify the validity of transaction data, the legitimacy of information, and the validity of the specified endorsement policy; On each peer node, each transaction is verified for consistency of endorsements before being committed to the ledger; Finally, valid transactions are eventually recorded in the blockchain file system, and failed transactions are left for auditing.

Citation Information

Patent Citations

  • Blockchain anonymous transaction method based on cross-node multi-hop payment

    CN112150144A

  • Blockchain efficient management architecture based on cross-chain technology and working method thereof

    CN112418860A

  • Block chain transaction privacy protection method based on homomorphic encryption in Internet of Things

    CN114547695A

  • Blockchain-based three-party account transfer method and apparatus

    WO2022121624A1

  • KR20200084162A