The invention provides an intelligent routing processing method in block chain. Nodes include state recording module, state judgment module, data request module and data response module. State recording module updates and records the current node status of nodes in real time. Node status refers to whether new blocks are generated in a short time; Data request module refers to when new nodes access block chain, it will update and record the current node status of nodes in real time. To send requests to existing nodes in the network, requesting existing nodes to transmit data to them; state judgment module refers to existing nodes reading local database content and judging their current status; data response module refers to the result that existing nodes can not transmit data to them or feedback data according to the requirements of new nodes. If a block is generated in a short time, it will not transmit data to the new node. Otherwise, for the newly generated node, it will not undertake the task of synchronizing data with the new node. This will reduce the burden of the newly generated node and improve the network transmission efficiency.
【技術實現步驟摘要】
一種區塊鏈中的智能路由處理方法
本專利技術提出一種在區塊鏈節點通信時,智能選擇通信節點的方法,當新的節點接入區塊鏈P2P網絡時,會向網絡中已有的節點請求數據,已存在節點要判斷自己當前的狀態,如果是短時間內生成了區塊,則不向新的節點傳輸數據,否則傳輸數據。
技術介紹
區塊鏈是借由密碼學串接并保護內容的串連交易記錄(又稱區塊)。每一個區塊包含了前一個區塊的加密散列、相應時間戳記以及交易數據(通常用默克爾樹算法計算的散列值表示),這樣的設計使得區塊內容具有難以竄改的特性。用區塊鏈所串接的分布式賬本能讓兩方有效紀錄交易,且可永久查驗此交易。區塊鏈利用P2P網絡傳輸數據,當新的節點接入區塊鏈P2P網絡時,會向網絡中已存在的節點請求數據。選擇哪些節點給新的節點同步數據,會影響到現有節點的處理速度和傳輸效率。當新的節點接入區塊鏈P2P網絡時,會隨機向網絡中已有的節點請求數據,已有節點不判斷自己當前的狀態,直接向新的節點傳輸數據。已有節點不判斷自己當前的狀態,直接向新的節點傳輸數據,如果已有節點在很短時間內生成了區塊,需要把新區塊向P2P網絡中傳播,同時需要和新的節點同步數據,已有節點的處理負擔很重,通信效率很低。
技術實現思路
本專利技術的目的是為了減輕生成區塊節點的負擔,提高網絡傳輸效率。本專利技術所采用的技術手段如下所述。本專利技術提供一種區塊鏈中的智能路由處理方法,其改進在于:每個節點至少包含狀態記錄模塊,狀態判斷模塊,數據請求模塊和數據響應模塊;所述狀態記錄模塊實時更新和記錄節點當前的節點狀態,所述節點狀態是指在短時間內是否生成了新的區塊;所述數據請求模塊是指當新的 ...
【技術保護點】
1.一種區塊鏈中的智能路由處理方法,其特征在于:每個節點至少包含狀態記錄模塊,狀態判斷模塊,數據請求模塊和數據響應模塊;所述狀態記錄模塊實時更新和記錄節點當前的節點狀態,所述節點狀態是指在短時間內是否生成了新的區塊;所述數據請求模塊是指當新的節點接入區塊鏈時,會向網絡中已有節點發送請求,請求已有節點向其傳輸數據;所述狀態判斷模塊是指該已有節點讀取本地數據庫內容,判斷自己當前的狀態,包含短時間內生成區塊或短時間內未生產區塊兩種狀態;所述數據響應模塊是指已有節點根據新的節點的要求向其傳輸數據或反饋無法傳遞數據的結果;如果是短時間內生成了區塊,則不向新的節點傳輸數據,否則傳輸數據;如果新的節點沒有同步到數據,會向網絡中其它已有節點請求數據。
【技術特征摘要】
1.一種區塊鏈中的智能路由處理方法,其特征在于:每個節點至少包含狀態記錄模塊,狀態判斷模塊,數據請求模塊和數據響應模塊;所述狀態記錄模塊實時更新和記錄節點當前的節點狀態,所述節點狀態是指在短時間內是否生成了新的區塊;所述數據請求模塊是指當新的節點接入區塊鏈時,會向網絡中已有節點發送請求,請求已有節點向其傳輸數據;所述狀態判斷模塊是指該已有節點讀取本地數據庫內容,判斷自己當前的狀態,包...
【專利技術屬性】
技術研發人員:夏冰,霍曉棟,馬俊昌,王虹妍,孫玉俐,劉迎賓,
申請(專利權)人:貴州藍石科技有限公司,
類型:發明
國別省市:貴州,52
還沒有人留言評論。發表了對其他瀏覽者有用的留言會獲得科技券。