CN117273713A - Low transaction fee priority cross-multi-person channel payment path selection method - Google Patents
Low transaction fee priority cross-multi-person channel payment path selection method Download PDFInfo
- Publication number
- CN117273713A CN117273713A CN202311029122.9A CN202311029122A CN117273713A CN 117273713 A CN117273713 A CN 117273713A CN 202311029122 A CN202311029122 A CN 202311029122A CN 117273713 A CN117273713 A CN 117273713A
- Authority
- CN
- China
- Prior art keywords
- node
- routing table
- channel
- transaction fee
- path
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000010187 selection method Methods 0.000 title claims abstract description 9
- 238000000034 method Methods 0.000 claims description 26
- 238000010276 construction Methods 0.000 claims description 13
- 238000012544 monitoring process Methods 0.000 claims 10
- RWSOTUBLDIXVET-UHFFFAOYSA-N Dihydrogen sulfide Chemical compound S RWSOTUBLDIXVET-UHFFFAOYSA-N 0.000 claims 1
- 230000009191 jumping Effects 0.000 claims 1
- 108091006146 Channels Proteins 0.000 description 96
- 238000010586 diagram Methods 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 5
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 230000001934 delay Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/08—Payment architectures
- G06Q20/10—Payment architectures specially adapted for electronic funds transfer [EFT] systems; specially adapted for home banking systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/04—Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
- G06Q10/047—Optimisation of routes or paths, e.g. travelling salesman problem
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
Landscapes
- Business, Economics & Management (AREA)
- Engineering & Computer Science (AREA)
- Accounting & Taxation (AREA)
- Economics (AREA)
- Finance (AREA)
- Strategic Management (AREA)
- Theoretical Computer Science (AREA)
- Human Resources & Organizations (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Development Economics (AREA)
- General Business, Economics & Management (AREA)
- Marketing (AREA)
- Technology Law (AREA)
- Game Theory and Decision Science (AREA)
- Entrepreneurship & Innovation (AREA)
- Operations Research (AREA)
- Quality & Reliability (AREA)
- Tourism & Hospitality (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明公开了一种低交易费优先的跨多人通道支付路径选择方法,包括以下步骤:构建一级路由表和二级路由表,一级路由表记载各个多人通道之间的路由,二级路由表记载每个通道内部的普通节点之间的路由;查找最低交易费的跨多人通道支付路径,当两个节点需要交易时,通过一级路由表查找出最低交易费通道路径;根据最低交易费通道路径和一级路由表信息,向对应的监督节点请求查询二级路由表,根据二级路由表选择最低交易费的节点,最终得到最低交易费的跨多人通道支付路径。本发明引入两级路由,使用监督节点来降低维护整个网络路由信息的成本,并且本发明在路由信息中增加了通道余额、交易费等信息,从而帮助支付节点快速选择合适的支付路由。
The invention discloses a cross-multi-person channel payment path selection method with low transaction fee priority, which includes the following steps: constructing a first-level routing table and a second-level routing table. The first-level routing table records the routes between each multi-person channel; The first-level routing table records the routes between ordinary nodes within each channel; finds the payment path with the lowest transaction fee across multi-person channels. When two nodes need to trade, find the lowest transaction fee channel path through the first-level routing table; according to For the lowest transaction fee channel path and first-level routing table information, request the corresponding supervisory node to query the second-level routing table, select the node with the lowest transaction fee based on the second-level routing table, and finally obtain the cross-multiple channel payment path with the lowest transaction fee. The invention introduces two-level routing and uses supervisory nodes to reduce the cost of maintaining routing information of the entire network. The invention also adds channel balance, transaction fee and other information to the routing information, thereby helping payment nodes quickly select appropriate payment routes.
Description
技术领域Technical field
本发明属于区块链技术领域,具体涉及一种低交易费优先的跨多人通道支付路径选择方法。The invention belongs to the field of blockchain technology, and specifically relates to a payment path selection method across multi-person channels with low transaction fee priority.
背景技术Background technique
双人通道或双向支付通道是区块链技术中的一种机制,主要用于创建链下的微支付网络,实现数字资产在用户之间的转移。基于智能合约的双人通道技术,学者们又提出了多人通道方案。在多人通道内,通道内的节点间可以互相交易,而当处于不同通道内的节点进行交易时,称为跨通道支付。将同时位于多个通道中的节点作为支付中转节点进行交易,大大扩大了支付范围。此外,中间节点可能处于不同的区块链,因此,跨通道支付也可以实现跨链支付。Two-person channel or two-way payment channel is a mechanism in blockchain technology that is mainly used to create an off-chain micropayment network to realize the transfer of digital assets between users. Based on the two-person channel technology of smart contracts, scholars have proposed a multi-person channel solution. In a multi-person channel, nodes in the channel can trade with each other, and when nodes in different channels conduct transactions, it is called cross-channel payment. Using nodes located in multiple channels at the same time as payment transfer nodes for transactions greatly expands the scope of payment. In addition, the intermediate nodes may be in different blockchains, so cross-channel payments can also achieve cross-chain payments.
目前,跨通道支付主要面临两个问题:1)网络中需要有足够的余额,以支持每个阶段的交易支付;2)选择合适的支付路径,需要考虑通道的流动性、交易费用和网络延迟等因素。其中,支付路径的选择极大的影响网络支付效率以及节点的开销,因此,支付路径选择问题得到了广泛关注。Currently, cross-channel payment mainly faces two problems: 1) There needs to be sufficient balance in the network to support transaction payments at each stage; 2) Choosing an appropriate payment path requires considering the liquidity of the channel, transaction fees and network delays. And other factors. Among them, the choice of payment path greatly affects the network payment efficiency and node overhead. Therefore, the payment path selection issue has received widespread attention.
现有的多人通道网络路由算法忽视了中间节点收取手续费的问题,只考虑资金充足的可达路径;然而,不同的路径手续费差别巨大,用户对于交易手续费敏感并倾向于选择交易成本更低的跨通道支付路径。The existing multi-channel network routing algorithm ignores the problem of intermediate nodes charging fees and only considers reachable paths with sufficient funds; however, the fees for different paths vary greatly, and users are sensitive to transaction fees and tend to choose transaction costs. Lower cross-channel payment paths.
发明内容Contents of the invention
本发明的主要目的在于克服现有技术的缺点与不足,提出一种低交易费优先的跨多人通道支付路径选择方法。The main purpose of the present invention is to overcome the shortcomings and deficiencies of the existing technology and propose a cross-multiple channel payment path selection method with low transaction fee priority.
为了达到上述目的,本发明采用以下技术方案:In order to achieve the above objects, the present invention adopts the following technical solutions:
一种低交易费优先的跨多人通道支付路径选择方法,设有由多个多人通道组成的全局多人通道网络,多人通道内包括普通节点和监督节点,方法包括以下步骤:A cross-multi-person channel payment path selection method with low transaction fee priority, which has a global multi-person channel network composed of multiple multi-person channels. The multi-person channel includes ordinary nodes and supervisory nodes. The method includes the following steps:
构建两级路由表,包括一级路由表和二级路由表的构建,一级路由表记载各个多人通道之间的路由,二级路由表记载每个通道内部的普通节点之间的路由;Construct a two-level routing table, including the construction of a first-level routing table and a second-level routing table. The first-level routing table records the routes between each multi-person channel, and the second-level routing table records the routes between ordinary nodes within each channel;
查找最低交易费的跨多人通道支付路径,当两个节点需要交易时,通过一级路由表查找出最低交易费通道路径;根据最低交易费通道路径和一级路由表信息,向对应的监督节点请求查询二级路由表,根据二级路由表选择最低交易费的节点,最终得到最低交易费的跨多人通道支付路径。Find the cross-multi-person channel payment path with the lowest transaction fee. When two nodes need to trade, find the lowest transaction fee channel path through the first-level routing table; based on the lowest transaction fee channel path and the first-level routing table information, report to the corresponding supervisor The node requests to query the secondary routing table, selects the node with the lowest transaction fee based on the secondary routing table, and finally obtains the payment path across multi-person channels with the lowest transaction fee.
本发明与现有技术相比,具有如下优点和有益效果:Compared with the existing technology, the present invention has the following advantages and beneficial effects:
1、本发明创新性的引入两级路由,使用监督节点来降低维护整个网络路由信息的成本;并且,在路由信息中增加了通道余额、交易费等信息,从而帮助支付节点快速选择合适的低手续费的支付路径。1. The present invention innovatively introduces two-level routing and uses supervisory nodes to reduce the cost of maintaining routing information of the entire network; and adds channel balance, transaction fee and other information to the routing information, thereby helping payment nodes quickly select appropriate low-cost routing information. Payment method for handling fees.
2、本发明的两级路由显著降低了通信,存储和计算消耗;监督节点只需要维护和存储各个通道间(监督节点间)和本通道的路由信息,而不需要维护和存储所有普通节点的路由信息,而普通节点在交易前只需要根据一级路由表计算通道间的路由信息,而不需要计算整个网络中所有节点的路由信息,因而降低了计算消耗。2. The two-level routing of the present invention significantly reduces communication, storage and computing consumption; the supervision node only needs to maintain and store the routing information between each channel (between supervision nodes) and this channel, and does not need to maintain and store the routing information of all ordinary nodes. Routing information, while ordinary nodes only need to calculate the routing information between channels based on the first-level routing table before transactions, instead of calculating the routing information of all nodes in the entire network, thus reducing computing consumption.
3、本发明解决了多通道间的不同通道手续费低价策略不同的问题,不要求网络中的所有通道手续费类型一致,更具实用性。3. The present invention solves the problem of different low-price handling fee strategies for different channels among multiple channels. It does not require the handling fee types of all channels in the network to be consistent, and is more practical.
附图说明Description of the drawings
图1是本发明方法的流程图;Figure 1 is a flow chart of the method of the present invention;
图2是多人通道网络示意图;Figure 2 is a schematic diagram of the multi-person channel network;
图3是实施例中节点B转账给节点G的通道路径图;Figure 3 is a channel path diagram for node B to transfer money to node G in the embodiment;
图4是实施例中节点B转账给节点G的节点支付路径图。Figure 4 is a node payment path diagram for node B to transfer money to node G in the embodiment.
具体实施方式Detailed ways
下面结合实施例及附图对本发明作进一步详细的描述,但本发明的实施方式不限于此。The present invention will be described in further detail below with reference to the examples and drawings, but the implementation of the present invention is not limited thereto.
实施例Example
假设有由多个多人通道组成的多人通道网络T={t1,t2,…},多人通道内包括普通节点和监督节点;多人通道表示为ti=Ci∪{si},其中,Ci={n1,n2,…}表示通道i对应的普通节点集合,si表示通道i对应的监督节点;监督节点或普通节点分别具有监督节点ID和普通节点ID,每个节点ID在网络中是唯一的。Suppose there is a multi-person channel network T = {t 1 , t 2 ,...} composed of multiple multi-person channels. The multi-person channel includes ordinary nodes and supervisory nodes; the multi-person channel is expressed as t i =C i ∪{s i }, where C i ={n 1 , n 2 ,...} represents the set of ordinary nodes corresponding to channel i, and s i represents the supervisory node corresponding to channel i; supervisory nodes or ordinary nodes have supervisory node IDs and ordinary node IDs respectively. , each node ID is unique in the network.
另外,本发明规定同一个通道的普通节点只能选择同一个类型的手续费,例如,所有节点要么按次收费,要么按交易金额百分比收费,并且节点的交易费可以完全不同;而监督节点的手续费类型、手续费大小可以和普通节点的不同。In addition, the present invention stipulates that ordinary nodes in the same channel can only choose the same type of handling fee. For example, all nodes either charge per-time or as a percentage of the transaction amount, and the transaction fees of the nodes can be completely different; while the supervision nodes' The fee type and fee size can be different from those of ordinary nodes.
如图1所示,一种低交易费优先的跨多人通道支付路径选择方法,包括以下步骤:As shown in Figure 1, a low transaction fee priority payment path selection method across multi-person channels includes the following steps:
S1、构建两级路由表,包括一级路由表和二级路由表的构建,一级路由表记载各个多人通道之间的路由,二级路由表记载每个通道内部的普通节点之间的路由。S1. Construct a two-level routing table, including the construction of a first-level routing table and a second-level routing table. The first-level routing table records the routes between each multi-person channel, and the second-level routing table records the routes between ordinary nodes within each channel. routing.
在通道ti中,每个普通节点nj都维护一个本地路由表LR(j),LR(j)中的每一个条目由六个元素组成,即LRI=<tid,sid,nid,bal,nfee,sfee>,其中tid表示通道ID,sid表示监督节点ID,nid表示节点自身ID,bal为节点在该通道的余额,nTee表示使用该节点进行跨通道支付需要付出的手续费。sfee表示该通道监督节点的手续费。同一个节点在不同的通道中余额bal、交易费nfee可能都不同;In channel ti , each ordinary node n j maintains a local routing table LR(j). Each entry in LR(j) consists of six elements, that is, LRI=<tid, sid, nid, bal, nfee, sfee>, where tid represents the channel ID, sid represents the supervision node ID, nid represents the node's own ID, bal is the node's balance in the channel, and nTee represents the handling fee required to use the node for cross-channel payment. sfee represents the handling fee of the channel supervision node. The balance bal and transaction fee nfee of the same node in different channels may be different;
普通节点nj会定期向自己的所有监督节点si发送自己的本地路由表;监督节点根据自己通道中普通节点发送的本地路由表LR(j),构建出二级路由表SR(i);二级路由表的每一个条目SRI由以下元素构成:SRI=<tid,sid,NF>;Ordinary node n j will regularly send its own local routing table to all its supervisory nodes s i ; the supervisory node constructs a secondary routing table SR(i) based on the local routing table LR(j) sent by the ordinary nodes in its own channel; Each entry SRI in the secondary routing table consists of the following elements: SRI=<tid, sid, NF>;
其中,tid表示通道ID,sid表示监督节点ID,NF表示本通道中连接到通道tid的节点集合,NF是一个三元组集合,其中每个元素由<nid,bal,nfee>,即节点ID、节点余额及节点交易费组成。Among them, tid represents the channel ID, sid represents the supervision node ID, NF represents the set of nodes connected to the channel tid in this channel, NF is a triplet set, in which each element consists of <nid, bal, nfee>, which is the node ID , node balance and node transaction fees.
二级路由表的构建,基于普通节点的本地路由表,具体为:The construction of the secondary routing table is based on the local routing table of ordinary nodes, specifically:
假定普通节点每m秒向监督节点发送一次本地路由表,并且设定2m为超时,在时刻ts时监督节点收到某个普通节点nj的本地路由表LR(j),监督节点执行以下构建操作:Assume that the ordinary node sends the local routing table to the supervisory node every m seconds, and sets 2m as the timeout. At time ts, the supervisory node receives the local routing table LR(j) of an ordinary node n j , and the supervisory node performs the following construction operate:
步骤1、判断LR(j)是否为空:Step 1. Determine whether LR(j) is empty:
如果为空,结束二级路由表构建,并返回SR(i);如果不为空,取出一个条目LRI=<tid,sid,nid,bal,nfee,sfee>;If it is empty, end the construction of the secondary routing table and return SR(i); if it is not empty, take out an entry LRI=<tid, sid, nid, bal, nfee, sfee>;
步骤2、查找SR(i)中是否存在tid的相关条目:Step 2. Find whether there are related entries of tid in SR(i):
若不存在,插入二级路由条目如果存在,执行步骤3;If it does not exist, insert the secondary routing entry If it exists, go to step 3;
步骤3、计算过期时间nexp←ts+2m;Step 3. Calculate the expiration time nexp←ts+2m;
步骤4、更新二级路由条目NF←NF∪{<nid,bal,nfee,nexp>},然后跳转到步骤1。Step 4. Update the secondary routing entry NF←NF∪{<nid, bal, nfee, nexp>}, and then jump to step 1.
在二级路由表构建完成后,监督节点si根据二级路由表SR构建本通道ti的一级路由表FR(i);After the construction of the secondary routing table is completed, the supervisory node s i constructs the primary routing table FR(i) of this channel t i based on the secondary routing table SR;
监督节点依次从二级路由表中取出每个条目,并构建一级路由条目FRI=<from_tid,to_tid,from_sid,to_sid,mbal,sfee,mfee,exp>;The supervisory node takes out each entry from the secondary routing table in turn and constructs the primary routing entry FRI=<from_tid, to_tid, from_sid, to_sid, mbal, sfee, mfee, exp>;
其中,from_tid是交易发出通道ID,to_tid是交易到达通道ID,from_sid是交易发出通道对应的监督节点ID,to_sid交易到达通道对应的监督节点ID,mbal表示到达通道路径中普通节点的最大余额;Among them, from_tid is the ID of the transaction sending channel, to_tid is the ID of the transaction arrival channel, from_sid is the supervision node ID corresponding to the transaction sending channel, to_sid is the supervision node ID corresponding to the transaction arrival channel, and mbal represents the maximum balance of the ordinary node in the arrival channel path;
mbal可从二级路由表中得出,具体为:mbal can be derived from the secondary routing table, specifically:
首先监督节点根据tid从二级路由表中找到对应条目,然后得到节点集合NF,并得到普通节点的最大余额,即mbal=min{nf[bal]|nf∈NF)};First, the supervisory node finds the corresponding entry from the secondary routing table according to tid, and then obtains the node set NF, and obtains the maximum balance of ordinary nodes, that is, mbal=min{nf[bal]|nf∈NF)};
其中,sfee表示出发通道的监督节点的交易手续费,mfee表示此路径普通节点的最低交易手续费,mfee由二级路由表得出,具体为:Among them, sfee represents the transaction fee of the supervision node of the departure channel, mfee represents the minimum transaction fee of the ordinary node on this path, and mfee is derived from the secondary routing table, specifically:
首先监督节点从二级路由表中找到对应条目,得到节点集合NF,然后从NF找出普通节点的最小交易费,即mfee=min{nf[nfee]|nf∈NF)};First, the supervisory node finds the corresponding entry from the secondary routing table to obtain the node set NF, and then finds the minimum transaction fee of the ordinary node from NF, that is, mfee=min{nf[nfee]|nf∈NF)};
其中,exp为改路由条目过期时间,它由改路径中最早过期的二级路由条目决定。Among them, exp is the expiration time of the modified routing entry, which is determined by the earliest expired secondary routing entry in the modified path.
一级路由表的构建具体为:The construction of the first-level routing table is specifically:
假设通道ti的监督节点si已有二级路由表SR(i),一级路由表的具体构建由两个部分组成:构建从本通道出发的一级路由表条目和构建到达本通道的一级路由表条目;具体过程如下:Assume that the supervisory node s i of channel t i already has a secondary routing table SR(i). The specific construction of the primary routing table consists of two parts: constructing the primary routing table entry starting from this channel and constructing the entry arriving at this channel. First-level routing table entry; the specific process is as follows:
步骤1、从二级路由表SR(i)中找到tid和本通道ID相等条目SRIi=<ti,si,,sfeei,NFi>;Step 1. Find the entry SRI i = <t i , si , sfee i , NF i > whose tid is equal to the channel ID from the secondary routing table SR(i);
步骤2、根据当前时间ts,去除NFi中过期数据,即NFi←{nf|nf[nexp]<ts,nf∈NFi};Step 2. According to the current time ts, remove expired data in NF i , that is, NF i ←{nf|nf[nexp]<ts, nf∈NF i };
步骤3、计算过期时间exp1←min{nf[nexp]|nf∈NFi};Step 3. Calculate the expiration time exp 1 ←min{nf[nexp]|nf∈NF i };
步骤4、遍历SR(i)中的每个条目SRIj=<tj,sj,sfeej,NFj>,进行如下步骤:Step 4. Traverse each entry SRI j =<t j , s j , sfee j , NF j > in SR(i) and perform the following steps:
步骤41、如果SRIj==SRIi则跳过;如果SRIj≠SRIi,从SRIj取出NFj;Step 41. If SRI j == SRI i , skip; if SRI j ≠ SRI i , take out NF j from SRI j ;
步骤42、根据当前时间ts,去除NFj中过期数据,即NFj←{nf|nf[nexp]<ts,nf∈NFj};Step 42. According to the current time ts, remove expired data in NF j , that is, NF j ←{nf|nf[nexp]<ts, nf∈NF j };
步骤43、从NFj得到节点ID集合ns←{nf[nid]|nf∈NFj)};Step 43. Obtain the node ID set ns←{nf[nid]|nf∈NF j )} from NF j ;
步骤44、从SRIi取出NFi,遍历节点ID集合ns得到NFi中所有相关的节点信息NF′i,即NF′i←{nf|nf[nid]∈ns};Step 44: Take out NF i from SRI i , traverse the node ID set ns to obtain all relevant node information NF′ i in NF i , that is, NF′ i ←{nf|nf[nid]∈ns};
步骤45、构建从本通道出发的一级路由表条目;Step 45: Construct a first-level routing table entry starting from this channel;
步骤46、构建到达本通道的一级路由表条目;Step 46: Construct a first-level routing table entry to reach this channel;
其中,步骤45中,构建从本通道出发的一级路由表条目,包括:Among them, in step 45, a first-level routing table entry starting from this channel is constructed, including:
计算到达通道最大余额mbal←min{nf[bal]|nf∈NFj)};Calculate the maximum balance of the arrival channel mbal←min{nf[bal]|nf∈NFj)};
计算本路径最小交易费mfee←min{nf[nfee]|nf∈NF′i)};Calculate the minimum transaction fee mfee←min{nf[nfee]|nf∈NF′ i )} for this path;
FR(i)←FR(i)∪{<ti,si,tj,sj,mbal,sfeej,mfee,exp1>};FR(i)←FR(i)∪{<t i , s i , t j , s j , mbal, sfee j , mfee, exp 1 >};
步骤46中,构建到达本通道的一级路由表条目,包括:In step 46, a first-level routing table entry to this channel is constructed, including:
计算过期时间exp2←min{nf[nexp]|nf∈NFj};Calculate the expiration time exp 2 ←min{nf[nexp]|nf∈NF j };
计算到达通道最大余额mbal←min{nf[bal]|nf∈NF′i)};Calculate the maximum balance of the arrival channel mbal←min{nf[bal]|nf∈NF′ i )};
计算本路径最小交易费mfee←min{nf[nfee]|nf∈NFj)};Calculate the minimum transaction fee mfee←min{nf[nfee]|nf∈NF j )} for this path;
FR(i)←FR(i)∪{<tj,sj,ti,si,mbal,sfeei,mfee,exp2>}。FR(i)←FR(i)∪{<t j , s j , t i , s i , mbal, sfee i , mfee, exp 2 >}.
在构建二级路由表时,通过普通节点的定时广播自己的本地路由,监督节点不断更新此二级路由表;When constructing the secondary routing table, regular nodes broadcast their own local routes regularly, and the supervisory nodes continuously update the secondary routing table;
在每次更新二级路由表后,监督节点会更新自己的一级路由表条目信息;同时,所有的监督节点会和邻居通道中的其他监督节点交换自己本地的一级路由表,使最终网络中的每个监督节点都有一个全局的一级路由表。After each update of the secondary routing table, the supervisory node will update its own first-level routing table entry information; at the same time, all supervisory nodes will exchange their local first-level routing tables with other supervisory nodes in the neighbor channel, so that the final network Each supervisory node in the network has a global first-level routing table.
在一级路由表和二级路由表中,每个路由条目包括一个过期时间;In the first-level routing table and the second-level routing table, each routing entry includes an expiration time;
普通节点向监督节点发送本地路由表时,监督节点获悉普通节点仍然存活,因此更新二级路由表中节点对应条目的过期时间;When the ordinary node sends the local routing table to the supervisory node, the supervisory node learns that the ordinary node is still alive, so it updates the expiration time of the corresponding entry of the node in the secondary routing table;
监督节点在生成一级路由表时,会检查二级路由表中的条目是否过期,并删除过期条目;When the supervisory node generates the first-level routing table, it will check whether the entries in the second-level routing table have expired and delete the expired entries;
监督节点间在交换一级路由表前会删除过期的一级路由表中的条目。Expired entries in the first-level routing table will be deleted before exchanging the first-level routing tables between supervisory nodes.
S2、查找最低交易费的跨多人通道支付路径,当两个节点需要交易时,通过一级路由表查找出最低交易费通道路径;根据最低交易费通道路径和一级路由表信息,向对应的监督节点请求查询二级路由表,根据二级路由表选择最低交易费的节点,最终得到最低交易费的跨多人通道支付路径。S2. Find the cross-multi-person channel payment path with the lowest transaction fee. When two nodes need to trade, the lowest transaction fee channel path is found through the first-level routing table; based on the lowest transaction fee channel path and the first-level routing table information, the corresponding The supervision node requests to query the secondary routing table, selects the node with the lowest transaction fee based on the secondary routing table, and finally obtains the cross-multiple channel payment path with the lowest transaction fee.
查找最低交易费通道路径的方法具体为:The specific method to find the lowest transaction fee channel path is:
步骤1、发送节点向监督节点请求一级路由表FR;Step 1. The sending node requests the first-level routing table FR from the supervisory node;
步骤2、发送节点将所有一级路由表条目中通道最大余额小于发送金额m的条目删除,得到一个新的一级路由表FR′={FRI|FRI[mbal]<a,FRI∈FR};Step 2. The sending node deletes the entries in all first-level routing table entries whose channel maximum balance is less than the sending amount m, and obtains a new first-level routing table FR′={FRI|FRI[mbal]<a, FRI∈FR};
步骤3、发送节点更新路由表FR′中的普通节点手续费sfee和监督节点手续费mfee;对FR′中的每一个路由条目,如果sfee或mfee是百分比类型,则将其与金额m相乘得到具体的手续费,最后将总手续费fee=sfee+mfee更新到该路由条目中;Step 3. The sending node updates the ordinary node handling fee sfee and the supervision node handling fee mfee in the routing table FR′; for each routing entry in FR′, if sfee or mfee is a percentage type, multiply it by the amount m Obtain the specific handling fee, and finally update the total handling fee fee=sfee+mfee to the routing entry;
步骤4、发送节点根据筛选的一级路由表FR′,构建出一个有向带权图G,其中每个图顶点为一个由通道ID和监督节点ID组成的元组,图中每条边的权值为两个通道间的最低手续费fee;Step 4. The sending node constructs a directed weighted graph G based on the filtered first-level routing table FR′, in which each graph vertex is a tuple consisting of a channel ID and a supervisory node ID. Each edge in the graph The weight is the lowest handling fee between the two channels;
步骤5、发送节点使用单源最短路径算法,例如Dijkstra算法,查找到达接收节点的最低交易费通道路径RT,如果没有找到则说明两个节点间不存在连通的路径;Step 5. The sending node uses a single-source shortest path algorithm, such as the Dijkstra algorithm, to find the lowest transaction fee channel path RT to the receiving node. If it is not found, it means that there is no connected path between the two nodes;
步骤6、根据最低交易费通道路径RT,发送节点计算出交易费f。Step 6. Based on the lowest transaction fee channel path RT, the sending node calculates the transaction fee f.
得到最低交易费的跨多人通道支付路径的方法具体为:The specific method to obtain the payment path across multi-person channels with the lowest transaction fee is:
步骤1、发送节点根据得到最低交易费通道路径RT,依次向该路径中的每一个监督节点查询其所在通道所对应的二级路由表;Step 1. Based on the lowest transaction fee channel path RT, the sending node sequentially queries each supervision node in the path for the secondary routing table corresponding to its channel;
步骤2、根据二级路由表,发送节点利用通道ID查询得到二级路由表中的节点信息集合NF,查找提供最低手续费的普通节点,如果存在多个满足条件的节点,则选择余额最大的那个节点;Step 2. According to the secondary routing table, the sending node uses the channel ID to query to obtain the node information set NF in the secondary routing table, and finds the ordinary node that provides the lowest handling fee. If there are multiple nodes that meet the conditions, select the one with the largest balance. that node;
步骤3、发送节点检查提供最低手续费的普通节点余额是否大于m+f;Step 3. The sending node checks whether the balance of the ordinary node that provides the lowest handling fee is greater than m+f;
如果节点的余额小于m+f,发送节点删除FR′中的对应通道路由条目,并跳转到查找最低交易费通道路径的步骤4;如果节点的余额大于m+f,则继续执行以下步骤;If the node's balance is less than m+f, the sending node deletes the corresponding channel routing entry in FR' and jumps to step 4 of finding the lowest transaction fee channel path; if the node's balance is greater than m+f, continue to perform the following steps;
步骤4、发送节点将提供最低手续费的普通节点ID添加到跨多人通道支付路径RN;Step 4. The sending node adds the common node ID that provides the lowest handling fee to the cross-multiplayer channel payment path RN;
步骤5、当最低交易费通道路径RT中所有的通道处理完毕后,即得到最低交易费的跨多人通道支付路径RN。Step 5: When all channels in the lowest transaction fee channel path RT are processed, the cross-multiple channel payment path RN with the lowest transaction fee is obtained.
在本实施例中,假设有如图2所示的多人通道支付网络图,图中每个顶点为一个多人通道,顶点中的每个节点旁标注的是该节点的余额和手续费费,每个顶点下面的三元组表示的是通道ID,监督节点ID和监督节点手续费。假定节点B要给G转账15。那么B首先向自己的监督节点询问一级路由表,然后它构造出一个有向带权图,如图3所示,其中每个顶点为通道ID和监督节点ID,边为所需要的最低手续费,例如,从通道11到通道12的手续费计算如下,查询一级路由表,可以得到路由条目<11,12,21,22,50,1%,0.1,exp>,因此总手续费为15*0.1+0.1=0.25。同样的可以计算出其他路径的手续费并最终选择一条手续费最低的通道路径;图3中,实线表示节点B最终选择的通道路径。最后根据通道路径最终选择出一个交易费最低的支付路径,如图4所示,图中实线表示节点B最终选择的支付路径。In this embodiment, assume that there is a multi-person channel payment network diagram as shown in Figure 2. Each vertex in the diagram is a multi-person channel. Next to each node in the vertex is the balance and handling fee of the node. The triplet under each vertex represents the channel ID, supervision node ID and supervision node handling fee. Assume that node B wants to transfer 15 to G. Then B first asks its own supervision node for the first-level routing table, and then it constructs a directed weighted graph, as shown in Figure 3, in which each vertex is the channel ID and supervision node ID, and the edge is the minimum required procedure. For example, the handling fee from channel 11 to channel 12 is calculated as follows. Querying the first-level routing table, you can get the routing entry <11,12,21,22,50,1%,0.1,exp>, so the total handling fee is 15*0.1+0.1=0.25. Similarly, the handling fees of other paths can be calculated and a channel path with the lowest handling fee can be finally selected; in Figure 3, the solid line represents the channel path finally selected by node B. Finally, a payment path with the lowest transaction fee is finally selected based on the channel path, as shown in Figure 4. The solid line in the figure represents the payment path finally selected by node B.
还需要说明的是,在本说明书中,诸如术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should also be noted that in this specification, terms such as "comprising", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article or device that includes a series of elements not only includes Those elements, but also other elements not expressly listed or inherent in such process, method, article or equipment. Without further limitation, an element defined by the statement "comprises a..." does not exclude the presence of additional identical elements in a process, method, article, or apparatus that includes the stated element.
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本发明。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下,在其他实施例中实现。因此,本发明将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。The above description of the disclosed embodiments enables those skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be practiced in other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311029122.9A CN117273713A (en) | 2023-08-16 | 2023-08-16 | Low transaction fee priority cross-multi-person channel payment path selection method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311029122.9A CN117273713A (en) | 2023-08-16 | 2023-08-16 | Low transaction fee priority cross-multi-person channel payment path selection method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117273713A true CN117273713A (en) | 2023-12-22 |
Family
ID=89216751
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311029122.9A Pending CN117273713A (en) | 2023-08-16 | 2023-08-16 | Low transaction fee priority cross-multi-person channel payment path selection method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117273713A (en) |
-
2023
- 2023-08-16 CN CN202311029122.9A patent/CN117273713A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7760718B2 (en) | Taxonomy based multiple ant colony optimization approach for routing in mobile ad hoc networks | |
Huang et al. | An effective service-oriented networking management architecture for 5G-enabled internet of things | |
KR101605175B1 (en) | Name-based neighbor discovery and multi-hop service discovery in information-centric networks | |
CN110995590B (en) | Efficient routing method under distributed domain network | |
CN104992044B (en) | Optimal more meeting point method for searching path and device applied to real-time rideshare | |
CN103210617A (en) | Reduction of message and computational overhead in networks | |
CN103929782B (en) | A kind of resources balance multi-path route method suitable for industrial wireless sensor network | |
CN104661275B (en) | Data transmission method in a kind of opportunistic network | |
JP2012217164A5 (en) | ||
CN101414964A (en) | Method for reducing redundant message of delay-tolerant network and intermittently-connected network | |
CN108900599B (en) | Software-defined content-centric network device and cluster cache decision method thereof | |
CN101902795B (en) | Wireless sensor network diffusion routing algorithm based on connection | |
CN103824127B (en) | Service self-adaptive combinatorial optimization method under cloud computing environment | |
CN103888517A (en) | Caching method for publishing and subscription system to achieve historical event subscription | |
CN117273713A (en) | Low transaction fee priority cross-multi-person channel payment path selection method | |
CN103200641B (en) | Many radio frequencies multi-Channel Wireless Mesh Network route selection method | |
CN115473854A (en) | A flow intelligent control method for multi-modal network | |
CN114189887A (en) | A Method for Optimizing Network Routing in Mobile Ad Hoc Network Based on Improved Sparrow Search Algorithm | |
CN106792971A (en) | Network node system of selection based on ant group algorithm | |
CN116032827A (en) | A PCN Optimal Path Routing Method Based on AODV | |
CN108600981A (en) | A kind of radio sensor network data collection method based on tree | |
CN107124750A (en) | The routing conversion and system of meet prediction and the perceived distance of a kind of opportunistic network | |
CN110121199B (en) | Opportunistic network data forwarding method based on node role association degree | |
CN103346965A (en) | Light multicast route method based on coding subgraph optimized coding cost | |
US9621401B1 (en) | Performing dynamic data analysis within a dynamic network |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |