An iot data transaction method based on a paid channel network
By employing a pay-channel network approach in IoT data transactions, calculating the funding ratio of gateway nodes to select suitable nodes, and designing a multi-route balancing protocol and hash time-locked contracts, the throughput and scalability issues of blockchain are resolved, enabling efficient and secure IoT data transactions.
Patent Information
- Application Number
- CN202111631557.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-29
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2041-12-29
AI Technical Summary
Blockchain technology has poor throughput and scalability in IoT data transactions, making it difficult to meet the real-time requirements of transactions. Existing research lacks adaptation solutions for Pay Channel Networks (PCNs) and IoT data transactions.
An IoT data transaction method based on a pay channel network is adopted. By calculating the expenditure-to-revenue ratio of gateway nodes, a suitable gateway node is selected for transaction. A multi-route balancing protocol and hash time-locked contract are designed to divide large transactions into multiple transaction units and optimize transaction routing by utilizing off-chain payment channels.
It improves the efficiency and network balance of IoT data transactions, reduces transaction capacity requirements, meets the needs of large-scale and rapid transactions, and ensures transaction security and real-time performance.
Smart Images

Figure CN115587812B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to an Internet of Things data transaction method based on a paid channel network and belongs to the technical field of blockchain Internet of Things transaction. BACKGROUND
[0002] At present, the application and research of blockchain technology are very active. The blockchain has the characteristics of decentralization, programmability and security against tampering, which provides a good opportunity for building a secure and reliable distributed transaction environment. With the popularity of Internet of Things devices, how to safely trade and use the data generated by Internet of Things devices has become an important research direction. In this paper, the blockchain technology is applied to the Internet of Things data transaction. However, due to the constraints of consensus mechanism and smart contract, the throughput and scalability of blockchain transaction are poor. In the Internet of Things data transaction, the real-time requirement of transaction is high, and the problem of poor scalability and low throughput of blockchain technology is further magnified.
[0003] In the field of Internet of Things data transaction, some researchers also use off-chain technology for research and design. Cao et al. published "Data trading with multiple owners, collectors, and users: An iterative auction mechanism" in IEEE Transactions on Signal and Information Processing over Networks in 2017, which proposes an iterative data transaction mode to coordinate transactions in a socially optimal way without accessing personal information, protecting the privacy of nodes. Hannon et al. published "Bitcoin payment-channels for resource limited IoT devices" in Proceedings of the International Conference on Omni-Layer Intelligent Systems in 2019, which also proposes to use payment channels for communication between Internet of Things devices. Its transaction process is carried out through the blockchain and introduces a third party outside the transaction to supervise, fully utilizes the characteristics of off-chain transactions of PCN, and at the same time guarantees the security of the transaction. However, there is a lack of more research on how the PCN network itself can better adapt to the Internet of Things data transaction process. SUMMARY
[0004] The application provides an Internet of Things data transaction method based on a paid channel network, namely an efficient transaction strategy for Internet of Things data transaction.
[0005] The technical scheme adopted by the application is as follows: an Internet of Things data transaction method based on a paid channel network, comprising the following steps:
[0006] Step 1: establish an Internet of Things data system model based on PCN: first, assume that the nodes in the network are connected through an off-chain payment channel, and the off-chain channel capacity of two nodes is the currency amount stored in the multi-signature address by the two nodes. The nodes in the network are divided into terminal user nodes, gateway nodes and routing nodes. The terminal user node, also known as the purchase node, is usually a node that pays for data. The terminal user is connected to the gateway node to access the rest of the network, and it must maintain a minimum amount of funds in its channel with the gateway to continue the transaction. The gateway node, also known as the data store node, is an Internet of Things node that usually wants to receive payment but rarely sends payment, that is, the provider of Internet of Things data. These nodes also help terminal users to trade with other nodes in the network. The routing node is responsible for connecting different gateways in the network. Each routing node tries to have a large number of connections, mainly by charging a transfer fee for transactions, and they are also responsible for maintaining the balance of channels in the entire network. This makes them the center of the payment network.
[0007] Step 2: after the model in Step 1 is established, calculate the transaction balance of each gateway node before each transaction is initiated, and calculate the ratio of the payment amount and the income amount of the gateway node within a period of time, determine the current use of the two-way channel of the gateway node, and calculate the current maximum transaction amount of the gateway node. Select the gateway node that meets the transaction demand and has the smallest ratio to perform the transaction, to ensure the balance of the network.
[0008] Step3: For the single transaction amount exceeding the maximum transaction amount specified in Step2, a multi-route balancing protocol is designed, the process is: first, the transaction initiator node determines the transaction amount, if the amount exceeds the maximum single transaction amount set by the network, the transaction is divided, and the transaction is divided into multiple transactions and signed; Then each transaction searches for different transaction routes, and initiates multiple transactions after determining the route; When the transaction reaches the gateway node, the transaction amount of the gateway node is calculated, if the flow is insufficient, the transaction gateway is searched again until the suitable transaction gateway route is found.
[0009] Step4: For transactions that have determined the route, off-chain transactions are conducted through Hash Time Locked Contract (HTLC).
[0010] Specifically, in Step2, the specific steps for calculating the current maximum transaction amount of the gateway are:
[0011] The transaction initiator node determines the transaction amount, determines the current transaction amount of the gateway node connected to the initiator node according to the routing table, and removes the gateway nodes with insufficient transaction amount; The payment and income amount ratio of the gateway node meeting the requirements in a period of time is calculated, and the specific calculation method is Ra=out_account / in_account, wherein: Ra is the payment and income ratio, out_account is the amount expected to be spent and locked in a period of time, and in_account is the amount expected to be received and unfrozen in a period of time, wherein In the formula: in_total is the transaction receiving payment, out_total is the transaction paying payment, capacity(v, u) is the channel balance that can be used for spending, and capacity(v, u) is the channel balance that can be used for receiving amount. It can be seen that the smaller Ra is, the more funds the gateway node is expected to pay, and the gateway node with the smallest Rao is selected for transaction, and the maximum transaction amount MTA(max transaction amount) used for maximum spending transaction of the gateway is 0.8*(capacity(v, u)+capacity(u, v)), MTA is the maximum amount that can be used for single spending transaction of the gateway, and is used for the maximum single transaction division problem in Step3.
[0012] Specifically, the large amount single transaction in Step3 refers to exceeding the defined maximum single transaction amount MTA, and MTA is defined according to the payment channel payment capacity in the transaction channel and the maximum amount of the gateway calculated in Step2.
[0013] Specifically, in Step 3, the working process of the multi-route load balancing protocol is as follows:
[0014] The routing load balancing algorithm splits a transaction into a series of independently routed transaction units at the time of initiation, defining a transaction unit as the largest transaction amount (MTA). Each transaction unit is created using a separate key during the transaction process, and splitting the transaction does not affect its security. When the transaction recipient receives and confirms a transaction unit, the sender can selectively display only the key for the confirmed transaction units. The transaction sender will receive notifications during the transaction process informing them of how many transaction units have been completed; the sender can choose to cancel incomplete transaction units or retry on the blockchain.
[0015] During the routing process for each transaction, a gateway selection protocol is used to calculate the ratio of expenditure to receipt of funds for each connected gateway node. Then, the gateway with the smallest Ra is selected. If a gateway node has the smallest ratio, it means that the funds it receives are much greater than the funds it pays. In this case, it can take on more of the work of gateway nodes used for payments. When using this method, gateway nodes with insufficient transmission capacity are not considered.
[0016] Specifically, the steps of Step 3 are as follows:
[0017] Step 3.1: Define the maximum transaction amount (MTA) as a transaction unit. When the amount of a single transaction exceeds the MTA, the transaction is divided.
[0018] Step 3.2: According to the formula Calculate the number of transaction units, where num Tun The number of transactions after partitioning is Round∪, which is rounded up, and m is the total transaction amount. The partitioned transaction units are signed. When the transaction recipient receives and confirms the transaction unit, the sender can selectively display only the key of the confirmed transaction unit.
[0019] Step 3.3: Calculate the forwarding paths of the transaction using the K-path algorithm. The number of forwarding paths is shown in the formula NUM. Path (trans t (v i ,v j ,m))=min(num Tun ,NUM pat (v i ,v j In the formula, NUM Path Forwarding path count, trans t (v i ,v j (m) represents the basic transaction information for a single transaction, v i For the node issuing the transaction, vj NUM is the transaction destination node pat (v i ,v j ) is the number of scientific transaction routes found by the routing algorithm. The first path Path1(v i ,v j ) is calculated using the basic routing algorithm, and then the other K-1 paths are calculated based on this. When calculating Path k+1 (v i ,v j ) 1<k<K, all nodes on Path1(v i ,v j ) except the destination node are regarded as deviating nodes, and the path from each deviating node to the destination node is calculated according to the basic routing algorithm, and then connected with the path from the source node to the deviating node on Path1(v i ,v j ) to form a candidate path.
[0020] Step 3.4: When calculating each transaction route, use the gateway selection protocol to separately calculate the transaction traffic, and select the most efficient gateway node that meets the requirements to route the transaction.
[0021] Specifically, in Step 4, the blockchain-based Internet of Things data transaction off-chain transaction contract is characterized by using a hash time lock contract, and the steps are as follows:
[0022] Step 4.1: The gateway node receiving the funds generates a random number R, encrypts R to obtain H, H = hash(R), and encrypts H using the public key of the user node to obtain Sig pk <h>and sends it to the user node.
[0023] Step 4.2: The user node uses its own private key to sign Sig pk <h>Decryption is performed, and a data packet HTCL(H, η, γ, data) is generated after decryption, wherein η is the number of hops of the route, γ is the transaction limited time, and data is other transaction data. Whenever the data packet passes through a node, η = η-1, and γ = γ- γ / η.
[0024] Step 4.3: After the gateway node receives the data packet, the correctness of H is verified, and then the random number R generated in Step 4.1 is returned along the original route, and each routing node verifies whether R is received within the transaction limited time γ and the correctness of R.
[0025] Step 4.4: After the user node receives R and verifies the correctness of R within the transaction limited time γ, the node account amount in the route is updated, and the updated node account amount is uploaded to the public blockchain for storage. BRIEF DESCRIPTION OF DRAWINGS
[0026] Figure 1 : overall structure of the patent
[0027] Figure 2 : PCN-based Internet of Things data transaction model diagram
[0028] Figure 3 : transaction channel blocking model diagram
[0029] Figure 4 : routing balancing algorithm schematic diagram
[0030] Figure 5 : Hash time lock contract schematic diagram DETAILED DESCRIPTION
[0031] In order to describe the present application in more detail and facilitate the understanding of those skilled in the art, the present application will be further described below in conjunction with the drawings and examples. The examples in this part are used to explain and illustrate the present application, and are for the purpose of understanding, and do not limit the present application.
[0032] The payment channel technology can solve the problems of poor scalability and low throughput of the blockchain, which is an off-chain payment technology. The method is to establish a payment channel between two users, and host a certain amount of funds in the channel, and transfer the transaction from the chain to the chain, avoiding the time delay of on-chain consensus and confirmation. The payment channels of different users are connected to form a payment channel network (PCN, payment channel network). In order to solve the problems of long-term running stability of the network and long transaction time when the single transaction amount is too large, the present application improves the PCN technology suitable for the Internet of Things data transaction process.
[0033] Example 1: as Figures 1-5 As shown, an IoT data transaction method based on a paychannel network includes the following steps:
[0034] Step 1: As Figure 2 As shown, a network is established with gateway nodes and routing nodes as the main network connections. All nodes in the network are connected through off-chain payment channels. The off-chain channel fund capacity of two nodes is the amount of currency deposited by these two nodes in their multi-signature addresses. The system model uses end-user nodes as consumers: including end-users, gateway nodes, and routing nodes. End-users, also known as purchasing nodes, typically pay for data. End-users connect to gateway nodes to access the rest of the network and must maintain a minimum amount of funds in their channel with the gateway to continue transactions. Gateway nodes, also called data store nodes, are IoT nodes that typically expect to receive payments but rarely send them—essentially providers of IoT data. These nodes also help end-users transact with other nodes in the network. Routing nodes are responsible for connecting different gateways in the network. Each routing node attempts to have a large number of connections, primarily profiting by collecting transaction fees, and they are also responsible for maintaining the balance of channels throughout the network. This makes them the central point of the payment network.
[0035] Step 2: After establishing the model in Step 1, before each transaction is initiated, calculate the transaction balance of each gateway node. Compile statistics on the bidirectional transaction amounts of each gateway node over a period of time and calculate the ratio of its payment amount to its revenue amount to determine its current bidirectional channel usage. Simultaneously, calculate the gateway's current maximum transaction amount. Select the gateway node that meets the transaction requirements and has the smallest ratio to proceed with the transaction.
[0036] Step 3: For single transactions where the transaction amount exceeds the maximum transaction amount specified in Step 2, a multi-route load balancing protocol is designed. The process is as follows: First, the transaction initiating node determines the transaction amount. If the amount exceeds the maximum single transaction amount set by the network, the transaction is divided into multiple transactions and signed. Then, each transaction searches for different transaction routes, and after determining the route, multiple transactions are initiated simultaneously. When the transaction arrives at the gateway node, the transaction amount traffic of the gateway node is calculated. If the traffic is insufficient, a new gateway is searched until a suitable gateway route for the transaction is found.
[0037] Step 4: For transactions with a predetermined route, conduct off-chain transactions through a Hash Time Locked Contract (HTLC).
[0038] Furthermore, in Step 2, the specific steps for calculating the current maximum transaction amount of the gateway are as follows:
[0039] The transaction initiating node determines the transaction amount and, based on the routing table, determines the current transaction amount of the gateway nodes connected to it, removing gateway nodes with insufficient transaction amounts. It then calculates the payment-to-revenue ratio of the gateway nodes that meet the requirements over a previous period, specifically calculated as Ra = out_account / in_account, where Ra is the payment-to-revenue ratio, out_account is the amount expected to be locked for expenditures over a period, and in_account is the amount expected to be unfrozen for revenue over a period. In the formula: in_total represents the transaction receiving payment, out_total represents the transaction paying payment, capacity(v,u) is the channel balance that can be used for payment, and capacity(v,u) is the channel balance that can be used to receive payment. It can be seen that the smaller Ra is, the more funds the gateway node is expected to use for payment. The gateway node with the smallest Rao is selected for the transaction, and the maximum transaction amount MTA (max transaction amount) for the gateway to use for the maximum payment transaction is set to 0.8*(capacity(v,u)+capacity(u,v)). MTA is the maximum amount that the gateway can use for a single payment transaction, and it is used for the maximum single transaction allocation problem in Step 3 to maintain the balance of the network.
[0040] like Figure 3 The diagram illustrates the shortest path for terminal nodes in region A to purchase data from gateway node D. Assuming that terminal nodes in region A purchase a large amount of data from node D within a short period, exhausting the channel's capacity, funds in the transaction channel will be frozen to ensure transaction security until these transactions are fully completed. While channel funds are frozen, if a node in region B wants to purchase data from gateway S, which also represents the shortest path, the channel's capacity has already been exhausted by one-way transactions. Therefore, the node in region B can only wait for the channel to release sufficient transaction funds or choose a different transaction channel. To solve this problem, the gateway initiating the transaction can be changed. If a gateway node has already conducted a large number of one-way transactions, it should be bypassed, and other gateways should be used for transactions. This ensures that the channel is not completely blocked, guaranteeing the availability of bidirectional transactions along the shortest path, thus better maintaining network balance and transaction efficiency within the PCN.
[0041] Furthermore, in Step 3, the specific working process of the multi-route load balancing protocol is as follows:
[0042] The routing load balancing algorithm splits a transaction into a series of independently routed transaction units at the time of initiation, defining a transaction unit as the largest transaction amount (MTA). Each transaction unit is created using a separate key during the transaction process, and splitting the transaction does not affect its security. When the transaction recipient receives and confirms a transaction unit, the sender can selectively display only the key for the confirmed transaction units. The transaction sender will receive notifications during the transaction process informing them of how many transaction units have been completed; the sender can choose to cancel incomplete transaction units or retry on the blockchain.
[0043] During the routing process for each transaction, a gateway selection protocol is used to calculate the ratio of expenditure to receipt of funds for each connected gateway node. Then, the gateway with the smallest Ra is selected. If a gateway node has the smallest ratio, it means that the funds it receives are much greater than the funds it pays. In this case, it can take on more of the work of gateway nodes used for payments. When using this method, gateway nodes with insufficient transmission capacity are not considered.
[0044] Furthermore, the specific steps of Step 3 are as follows:
[0045] Step 3.1: Define the maximum transaction amount (MTA) as a transaction unit. When the amount of a single transaction exceeds the MTA, the transaction is divided.
[0046] Step 3.2: According to the formula Calculate the number of transaction units, where num Tum The number of transactions after partitioning is Round∪, which is rounded up, and m is the total transaction amount. The partitioned transaction units are signed. When the transaction recipient receives and confirms the transaction unit, the sender can selectively display only the key of the confirmed transaction unit.
[0047] Step 3.3: Calculate the forwarding paths of the transaction using the K-path algorithm. The number of forwarding paths is shown in the formula NUM. Path (trans t (v i ,v j ,m))=min(num Tun ,NUM path (v i ,v j In the formula, NUM Path Forwarding path count, trans t (v i ,v j (m) represents the basic transaction information for a single transaction, v i For the node issuing the transaction, v j NUM is the node for the transaction destination. pa (v i ,v j ) is the number of scientific transaction routing found by the routing algorithm. The first path Path1(v i ,v j ) is calculated by using the basic routing algorithm, and then the other K-1 paths are calculated on this basis. When Path k+1 (v i ,v j ) is calculated, 1 < k < K, all nodes on Path1(v i ,v j ) except the destination node are regarded as deviating nodes, and the path from each deviating node to the destination node is calculated according to the basic routing algorithm, and then connected with the path from the source node to the deviating node on Path1(v i ,v j ) to form a candidate path.
[0048] For convenience of description, it is assumed that K = 3, and there are 3 units of transfer request between nodes A and E, and the K-path routing result of nodes A and E is shown in Fig. Figure 4 (a). The deviating node between Path1(A, E) and Path2(A, E) is A, and the deviating node between Path2(A, E) and Path3(A, E) is B. As can be seen from Fig. Figure 4 (a), the maximum circulatable funds of the three paths cannot meet the demand, and the transfer request is evenly distributed to the three candidate paths, and the transfer can be successful, as shown in Fig. Figure 4 (b).
[0049] Step 3.4: When calculating each transaction route, use the gateway selection protocol to separately calculate the transaction flow, and select the most efficient gateway node that meets the requirements to route the transaction.
[0050] Further, in Step 4, the working process of the hash time-locked contract is as follows:
[0051] As shown in Fig. Figure 5 , for request A→E, the receiver E generates a key R and its hash H, and sends H to A. A encodes H and a time limit T1 into the contract with B, so that B cannot spend the locked funds within the time limit T1 without returning the key R to A. Then each node similarly forwards the payment and adopts a decreasing deadline, i.e., T1 > T2 > T3 > T4. After receiving the payment, E will provide R to D to confirm the receipt of the payment, and D will perform the same operation on the previous node until A receives R.
[0052] Further, in Step 4, the specific steps of the hash time-locked contract are as follows:
[0053] Step 4.1: The destination gateway node receiving the funds generates a random number R, hashes R to obtain H, H = hash(R), and encrypts H using the public key of the user node to obtain Sig pk <h>and sends it to the user node.
[0054] Step 4.2: The user node uses its own private key to sign Sig pk <h>The decryption is performed, and a data packet HTCL(H, η, γ, data) is generated after decryption, wherein η is the number of hops of the route, γ is the transaction limited time, and data is other transaction data. Whenever the data packet passes through a node, η = η-1, and γ = γ-γ / η.
[0055] Step 4.3: After the gateway node receives the data packet, the correctness of H is verified, and then the random number R generated in Step 4.1 is returned along the original route. Each routing node verifies whether R is received within the transaction limited time and the correctness of R.
[0056] Step 4.4: After the user node receives R and verifies the correctness of R within the transaction limited time γ, the node account amount in the route is updated, and the updated node account amount is uploaded to the public blockchain for storage.
[0057] The specific embodiments of the application are described in detail above in combination with the drawings, but the application is not limited to the above embodiments. Within the knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the application.< / h> < / h> < / h> < / h>
Claims
1. An Internet of Things data transaction method based on a paid channel network, characterized in that: The transaction process using the improved payment channel network PCN has the following steps: Step1: Establish a PCN-based Internet of Things data system model: first, assume that the nodes in the network are connected through off-chain payment channels, the off-chain channel capacity of two nodes is the amount of currency stored in the multi-signature address by the two nodes, divide the nodes in the network into terminal user nodes, gateway nodes and routing nodes, terminal user nodes, also known as purchase nodes, are often paid for purchasing data, terminal users connect to gateway nodes to access the rest of the network, and they must maintain a minimum amount of funds in their channel with the gateway to continue the transaction; gateway nodes, also known as data store nodes, are Internet of Things nodes that want to receive payments but rarely send payments, i.e. Internet of Things data providers, these nodes also help terminal users to transact with other nodes in the network; routing nodes, routing nodes are responsible for connecting different gateways in the network, each routing node tries to have a large number of connections, benefits by collecting transaction transfer fees, and they are also responsible for maintaining the balance of channels in the entire network; Step2: After establishing the model in Step1, calculate the transaction balance of each gateway node before each transaction is initiated, count the bidirectional transaction amount of the gateway node within a period of time and calculate the ratio of its payment amount to its income amount to determine its current usage of the bidirectional channel, and calculate the current maximum transaction amount of the gateway, select the gateway node that meets the transaction demand and has the smallest ratio to perform the transaction; Step3: For single transaction amount exceeding the maximum transaction amount specified in Step2, a multi-routing balancing protocol is designed, which has the following process: first, the transaction initiator determines the transaction amount, if the amount exceeds the maximum single transaction amount set by the network, the transaction is divided and signed; then each transaction searches for different transaction routes, and determines the route and initiates multiple transactions at the same time; when the transaction reaches the gateway node, calculate the transaction amount of the gateway node, if the flow is insufficient, find a new transaction gateway, until the suitable gateway route is found; Step4: For transactions that have determined the route, perform off-chain transactions through the hash time lock contract HTLC. 2.The Internet of Things data transaction method based on a paid channel network according to claim 1, characterized in that, The specific steps for calculating the current maximum transaction amount of the gateway in Step2 are as follows: The transaction initiating node determines the transaction amount, determines the current transaction amount of the gateway node connected to the initiating node according to the routing table, and removes the gateway node with insufficient transaction amount; the ratio of the payment and income amount of the gateway node meeting the requirements in a period of time is calculated, and the specific calculation method is Ra=out_account / in_account, wherein Ra is the payment and income ratio, out_account is the amount locked for expected expenditure in a period of time, and in_account is the amount unfrozen for expected income in a period of time, wherein in_total is the transaction of receiving payment, out_total is the transaction of paying out payment, capacity(v,u) is the channel balance for paying out, and capacity(u,v) is the channel balance that can be used to receive amount. It can be known that the smaller Ra is, the more funds the gateway node is expected to pay, the gateway node with the smallest Ra is selected for transaction, and the maximum transaction amount MTA of the gateway node used for maximum expenditure transaction is MTA=0.8*(capacity(v,u)+capacity(u,v)), and MTA is the maximum amount that can be used for expenditure transaction of the gateway node at a time. 3.The IoT data transaction method based on the paid channel network of claim 2, wherein, The specific steps of Step3 are as follows: Step3.1: Define the maximum transaction amount MTA as a transaction unit, when the single transaction amount exceeds MTA, divide the transaction; Step3.2: According to the formula The number of transaction units is calculated, wherein num Tun is the number of divided transactions, Round is the rounding up, m is the total transaction amount, and the divided transaction units are signed, and when the transaction receiver receives and confirms the transaction unit, the sender can selectively display the key of the confirmed transaction unit; Step 3.3: Calculate the forwarding paths of the transaction using the K-path algorithm. The number of forwarding paths is shown in the formula NUM. Path (trans t (v i v j ,m))=min(num Tun NUM path (v i v j In the formula, NUM Path Forwarding path count, trans t (v i v j m) represents the basic transaction information for a single transaction, v i For the node issuing the transaction, v j For the destination node of the transaction, NUM path (v i v j ) represents the number of transactable routes found by the routing algorithm. The first path Path1(v) is calculated using the basic routing algorithm. i v j Then, based on this, find the other K-1 paths, and then calculate the Path. k+1 (v i v j When 1 < k < K, Path1(v) i v j All nodes on the path except the destination node are considered as stray nodes. The path from each stray node to the destination node is calculated using the basic routing algorithm and then compared with the previous Path1(v). i v j The path connections from the source node to the diverging node constitute candidate paths; Step3.4: When calculating each transaction route, use the gateway selection protocol to calculate the transaction flow separately, and select the most efficient gateway node that meets the requirements for routing transactions.
4. The method of claim 1, wherein the method is based on a pay channel network. The specific steps of Step4 are as follows: Step 4.1: The destination gateway node receiving the funds generates a random number R, hashes R to obtain H, H = hash(R), and encrypts H using the public key of the user node to obtain Sig pk <h> ,< / h> In the formula, and send it to the user node; Step 4.2: The user node uses its own private key to sign Sig pk <h>Decryption is performed, and after decryption, a data packet HTCL(H, η, γ, data) is generated, where η is the number of hops of the route, γ is the transaction limited time, and data is other transaction data. Whenever the data packet passes through a node, η = η - 1, and γ = γ - γ / η;< / h> Step 4.3: After the gateway node receives the data packet, the correctness of H is verified, and then the random number R generated in Step 4.1 is returned along the original route. Each routing node verifies whether R is received within the transaction limited time γ and the correctness of R; Step 4.4: After the user node receives R and verifies the correctness of R within the transaction limited time γ, the node account amount in the route is updated, and the updated node account amount is uploaded to the public block chain for storage.