CN110071775B - 一种面向去中心化p2p网络的可信时序偏序计算方法 - Google Patents

一种面向去中心化p2p网络的可信时序偏序计算方法 Download PDF

Info

Publication number
CN110071775B
CN110071775B CN201810661036.2A CN201810661036A CN110071775B CN 110071775 B CN110071775 B CN 110071775B CN 201810661036 A CN201810661036 A CN 201810661036A CN 110071775 B CN110071775 B CN 110071775B
Authority
CN
China
Prior art keywords
prefix
message
current
network
timestamp
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.)
Active
Application number
CN201810661036.2A
Other languages
English (en)
Other versions
CN110071775A (zh
Inventor
谢绍韫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai heiyun Technology Co.,Ltd.
Suzhou black cloud Intelligent Technology Co.,Ltd.
Original Assignee
Suzhou Heiyun Information Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Suzhou Heiyun Information Technology Co ltd filed Critical Suzhou Heiyun Information Technology Co ltd
Priority to CN201810661036.2A priority Critical patent/CN110071775B/zh
Publication of CN110071775A publication Critical patent/CN110071775A/zh
Application granted granted Critical
Publication of CN110071775B publication Critical patent/CN110071775B/zh
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Computer And Data Communications (AREA)

Abstract

本发明提供了一种去中心化网络环境下,在全局P2P节点之间,建立、验证、计算时序偏序的方法;在该方法中,所建立的时序偏序关系不可抵赖、防篡改;所述方法包括:S1,建立前缀源消息;S2,发送前缀消息源;S3,验证前缀消息源时间戳;S4,计算时序偏序关系。本发明为在去中心化P2P网络中进行可信时序的一阶谓词逻辑演算,提供了不可抵赖、防篡改的全局时序偏序语义,增加了P2P网络的智能特性和可信时序偏序特性。

Description

一种面向去中心化P2P网络的可信时序偏序计算方法
技术领域
本发明涉及去中心化P2P网络,尤其是涉及一种面向去中心化P2P网络的可信时序偏序计算方法。
背景技术
在目前的去中心化P2P网络中,考虑到网络的不可靠性,尚缺乏有效时序计算手段,能够确定地保证全网节点能够高效地对某一个时间节点或者时序关系做出共识,从而导致很多基于时序逻辑的算法和应用真正地部署在去中心化P2P网络中,也因此缺乏了基于时序的智能性。
发明内容
本发明的目的在于克服现有技术的缺陷,提供一种去中心化P2P网络节点能够快速达到全网时序共识的方法,基于该方法,去中心化P2P节点能够在毫秒级时延内,秒级误差内,共识当前全网网络时间的最近最大起点值。
为实现上述目的,本发明提出如下技术方案:一种面向去中心化P2P网络的可信时序偏序计算方法,包括:
S1,建立前缀源消息;
S2,发送前缀源消息;
S3,验证前缀源消息时间戳;
S4,计算时序偏序关系;
所述前缀源消息包括:一个四元组(prefix,current,pubkey,signature),其中:prefix和current具有相同的基本消息结构,并且均含有至少一个时间戳字段TimeStampField;pubkey为前缀源消息发送者的公钥,signature为前缀源消息发送者对prefix:current的数字签名值;
所述验证前缀源消息时间戳包括:
步骤S1001中,接收到消息(prefix,current,pubkey,signature)后,使用发送方的公钥pubkey对signature进行解密,判断解密后所得明文与prefix:current是否相等;如果相等,则继续下一步S1002,否则,出错,转异常处理;
步骤S1002中,如果prefix或者prefix的某种签名、加密或实际结构形式已经存在于接收方本地的库中,则继续下一步S1003,否则,出错,转异常处理;
步骤S1003中,从prefix和current中,提取出同一个时间戳字段实例,假设分别为prefix.TimeStampField和current.TimeStampField;基于pubkey,可识别出消息发送者,设为sender,并假设消息接收者收到的所有来自于sender的消息中,时间最近的、并且已经被全网节点接收或者共识了的基本消息结构的时间戳为latestMsg.TimeStampField,如果prefix.TimeStampField@timPOLS@latestMsg.TimeStampField或者latestMsg.TimeStampField@timPOLS@prefix.TimeStampField,则出错,转异常处理,否则,继续下一步S1004;
步骤S1004中,消息接收者更新本地网络时间后,收到消息时,本地时间为localTimeStamp,且有localTimeStamp@timPOLS@prefix.TimeStampFiel,则失败,转出错处理,否则,验证前缀源消息时间戳成功,当前全网共识的最近全局时间为prefix.TimeStampFiel,全网存储消息current;
所述计算时序偏序关系包括:
步骤S1005中,消息接收者更新本地网络时间localTimeStamp,并且收到新的消息rawMsg=prefix2:current2,则当前全网共识的最近全局时间为prefix2.TimeStampFiel,如果localTimeStamp与current.TimeStampFiel代表的时间差值<=2x秒,并且如果prefix2.TimeStampFiel与current.TimeStampFiel代表的时间差值满足消息发送者的需求,则执行该消息,否则,转出错处理;其中,x为一个可调时间跨度参数,代表网络最大经验时延。
优选地,所述prefix:current包括:prefix消息实例的所有值按字符串序列化的方法得到的字符串,连接上符号:后,再连接上current消息实例的所有值按某种字符串序列化的方法得到的字符串后,所得到的字符串。
优选地,所述prefix包括:已经被P2P网络中所有节点接收并接受的消息实例,或已经被所在P2P网络共识了的消息实例。
优选地,所述current包括:尚未被P2P网络中所有节点接收或尚未被P2P网络中所有节点接受的消息实例,或尚未被所在P2P网络共识了的消息实例。
优选地,所述prefix和current的时间戳字段包括:将preifx.TimeStampField和current.TimeStampField均转换为真实的时间之后,有:preifx.TimeStampField发生在current.TimeStampField之前。
优选地,所述preifx.TimeStampField和current.TimeStampField包括:建立时序偏序关系包括:preifx.TimeStampField@timPOLS@current.TimeStampField<=>preifx.TimeStampField对应的真实时间发生在current.TimeStampField对应的真实时间之前。
优选地,包括:所述符号<=>表示命题逻辑中的当且仅当。
优选地,所述发送前缀源消息包括:可通过各种计算机网络传输协议将前缀源消息发送至P2P网络中任一指定消息接受方,或者P2P网络中所有节点。
附图说明
图1是本发明可信时序偏序计算的流程示意图;
具体实施方式
下面将结合本发明的附图,对本发明实施例的技术方案进行清楚、完整的描述。
如图1所示,本发明实施例所揭示的一种面向去中心化P2P网络的可信时序偏序计算方法,主要是提供一种不可抵赖、防篡改的时序偏序计算语义和方法;该方法主要由前缀源消息结构、消息发送者节点、消息接收者节点、消息接收者节点消息链构成。
场景:
去中心化P2P网络中,所述前缀源消息包括一个四元组(prefix,current,pubkey,signature),有一个节点集Miners,其中每个节点存放当前网络上所有其他节点互发的消息;节点A不在Miners中;A最近发出并且被Miner共识的消息为prefixA,prefixA.TimeStampFiel=”15:00”;A想在16:00之后向B转账10元,于是发出一条消息,其原始的内容为:rawMsg=“prefixA:在”16:00”之后,从A转10元到B”,A发出rawMsg在所述四元组形成后,便断网了;下面,Miners要判断当前的时序语义,以决定当前是否要执行“从A转10元到B”这个操作。
Miners在判断当前是否要执行“在”16:00”之后,从A转10元到B”这个操作的过程,包括以下步骤:
步骤S1001中,验证收到的四元组消息是否完整及签名正确;
步骤S1002中,prefixA在本地消息链中是否存在;
步骤S1003中,从rawMsg中提取出prefixA.TimeStampField=”15:00”,current.TimeStampField=”16:00”,并且接收者发现prefixA.TimeStampField=latestMsg.TimeStampField;
步骤S1004中,更新本地网络时间后localTimeStamp=”15:55”,prefixA.TimeStampFiel@timPOLS@localTimeStamp;
步骤S1005中,|localTimeStamp-current.TimeStampFiel|>2x,不执行“从A转10元到B”这一操作,继续下一步S1006;
步骤S1006中,继续接收消息,并跳转回S1001;
由于Miners中的节点不断收到外部某个节点发来的消息,并从每个消息的prefix部分检出prefix.TimeStampFiel作为当前全局时间,并把它与”16:00”比较,在某一轮的新消息prefix部分,发现prefix.TimeStampFiel=”16:01”,由此判断“在”16:00”之后”这个条件成立,因此执行“从A转10元到B”这个操作。
本发明的技术内容及技术特征已揭示如上,然而熟悉本领域的技术人员仍可能基于本发明的教示及揭示而作种种不背离本发明精神的替换及修饰,因此,本发明保护范围应不限于实施例所揭示的内容,而应包括各种不背离本发明的替换及修饰,并为本专利申请权利要求所涵盖。

Claims (8)

1.一种面向去中心化P2P网络的可信时序偏序计算方法,其特征在于,包括:
S1,建立前缀源消息;
S2,发送前缀源消息;
S3,验证前缀源消息时间戳;
S4,计算时序偏序关系;
所述前缀源消息包括:一个四元组(prefix,current,pubkey,signature),其中:prefix和current具有相同的基本消息结构,并且均含有至少一个时间戳字段TimeStampField;pubkey为前缀源消息发送者的公钥,signature为前缀源消息发送者对prefix:current的数字签名值;
所述验证前缀源消息时间戳包括:
步骤S1001中,接收到消息(prefix,current,pubkey,signature)后,使用发送方的公钥pubkey对signature进行解密,判断解密后所得明文与prefix:current是否相等;如果相等,则继续下一步S1002,否则,出错,转异常处理;
步骤S1002中,如果prefix或者prefix的某种签名、加密或实际结构形式已经存在于接收方本地的库中,则继续下一步S1003,否则,出错,转异常处理;
步骤S1003中,从prefix和current中,提取出同一个时间戳字段实例,假设分别为prefix.TimeStampField和current.TimeStampField;基于pubkey,可识别出消息发送者,设为sender,并假设消息接收者收到的所有来自于s ender的消息中,时间最近的、并且已经被全网节点接收或者共识了的基本消息结构的时间戳为latestMsg.TimeStampField,如果prefix.TimeStampFiel d@timPOLS@latestMsg.TimeStampField或者latestMsg.TimeStampField@tim POLS@prefix.TimeStampField,则出错,转异常处理,否则,继续下一步S1004;
步骤S1004中,消息接收者更新本地网络时间后,收到消息时,本地时间为localTimeStamp,且有localTimeStamp@timPOLS@prefix.TimeStamp Fiel,则失败,转出错处理,否则,验证前缀源消息时间戳成功,当前全网共识的最近全局时间为prefix.TimeStampFiel,全网存储消息current;
所述计算时序偏序关系包括:
步骤S1005中,消息接收者更新本地网络时间localTimeStamp,并且收到新的消息rawMsg=prefix2:current2,则当前全网共识的最近全局时间为pref ix2.TimeStampFiel,如果localTimeStamp与current.TimeStampFiel代表的时间差值<=2x秒,并且如果prefix2.TimeStampFiel与current.TimeStampFiel代表的时间差值满足消息发送者的需求,则执行该消息,否则,转出错处理;其中,x为一个可调时间跨度参数,代表网络最大经验时延。
2.根据权利要求1所述的方法,其特征在于,所述prefix:current包括:prefix消息实例的所有值按字符串序列化的方法得到的字符串,连接上符号:后,再连接上current消息实例的所有值按某种字符串序列化的方法得到的字符串后,所得到的字符串。
3.根据权利要求1所述的方法,其特征在于,所述prefix包括:已经被P2P网络中所有节点接收并接受的消息实例,或已经被所在P2P网络共识了的消息实例。
4.根据权利要求1所述的方法,其特征在于,所述current包括:尚未被P2P网络中所有节点接收或尚未被P2P网络中所有节点接受的消息实例,或尚未被所在P2P网络共识了的消息实例。
5.根据权利要求1所述的方法,其特征在于,所述prefix和current的时间戳字段包括:将preifx.TimeStampField和current.TimeStampField均转换为真实的时间之后,有:preifx.TimeStampField发生在current. TimeStampField之前。
6.根据权利要求5所述的方法,其特征在于,所述preifx.TimeStampField和current.TimeStampField包括:建立时序偏序关系包括:preifx.TimeStampField@timPOLS@current.TimeStampField<=>preifx.TimeSta mpField对应的真实时间发生在current.TimeStampField对应的真实时间之前。
7.根据权利要求6所述的方法,其特征在于,包括:所述符号<=>表示命题逻辑中的“当且仅当”。
8.根据权利要求1所述的方法,其特征在于,所述发送前缀源消息包括:可通过各种计算机网络传输协议将前缀源消息发送至P2P网络中任一指定消息接收方,或者P2P网络中所有节点。
CN201810661036.2A 2018-06-25 2018-06-25 一种面向去中心化p2p网络的可信时序偏序计算方法 Active CN110071775B (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810661036.2A CN110071775B (zh) 2018-06-25 2018-06-25 一种面向去中心化p2p网络的可信时序偏序计算方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810661036.2A CN110071775B (zh) 2018-06-25 2018-06-25 一种面向去中心化p2p网络的可信时序偏序计算方法

Publications (2)

Publication Number Publication Date
CN110071775A CN110071775A (zh) 2019-07-30
CN110071775B true CN110071775B (zh) 2020-10-09

Family

ID=67365714

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810661036.2A Active CN110071775B (zh) 2018-06-25 2018-06-25 一种面向去中心化p2p网络的可信时序偏序计算方法

Country Status (1)

Country Link
CN (1) CN110071775B (zh)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107103473A (zh) * 2017-04-27 2017-08-29 电子科技大学 一种基于区块链的智能合约实现方法

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006148197A (ja) * 2004-11-16 2006-06-08 Nippon Telegr & Teleph Corp <Ntt> 利用者情報の分散管理装置、方法、およびプログラム
US20080120342A1 (en) * 2005-04-07 2008-05-22 Iofy Corporation System and Method for Providing Data to be Used in a Presentation on a Device
CN103297529B (zh) * 2013-06-06 2016-01-20 浙江大学 基于时间戳的树型结构数据同步方法
CN107181599B (zh) * 2017-07-18 2020-01-21 天津理工大学 基于区块链的路由位置数据保密存储及共享方法

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107103473A (zh) * 2017-04-27 2017-08-29 电子科技大学 一种基于区块链的智能合约实现方法

Also Published As

Publication number Publication date
CN110071775A (zh) 2019-07-30

Similar Documents

Publication Publication Date Title
Armenia et al. A flexible phasor data concentrator design leveraging existing software technologies
CN110971663A (zh) 一种面向数据交易的可信处理方法与系统
Hussain et al. Secure data provenance compression using arithmetic coding in wireless sensor networks
US20140317406A1 (en) Communication between network nodes that are not directly connected
Wang et al. Sensor network provenance compression using dynamic bayesian networks
WO2020208580A1 (en) Methods and devices for propagating blocks in a blockchain network
TW202044086A (zh) 檔案驗證方法、檔案驗證系統與檔案驗證伺服器
CN111555860B (zh) 一种区块链节点共识方法、装置、电子设备及存储介质
CN110956463B (zh) 基于可扩展分布式查询系统的可信存证方法与系统
Alzaid et al. A forward & backward secure key management in wireless sensor networks for PCS/SCADA
CN110071775B (zh) 一种面向去中心化p2p网络的可信时序偏序计算方法
Gao et al. Data authentication for wireless sensor networks with high detection efficiency based on reversible watermarking
US20100074254A1 (en) Communication system, transmitting apparatus, receiving apparatus, communication method, and record medium
Refaei et al. Data authentication for NDN using hash chains
CN113632435A (zh) 抵抗dos攻击的计算谜题
US20240106669A1 (en) Methods and systems for streaming block templates with cross-references
US20100268784A1 (en) Data synchronization system and method
CN111669320B (zh) 一种处理报文的方法及网络设备
Fraczek et al. Steg Blocks: Ensuring perfect undetectability of network steganography
Faraj et al. ZIRCON: Zero-watermarking-based approach for data integrity and secure provenance in IoT networks
Barenghi et al. A security audit of the OpenPGP format
Chang et al. MR-Chord: A scheme for enhancing Chord lookup accuracy and performance in mobile P2P network
Yang et al. A distributed secure monitoring system based on blockchain
US20240031128A1 (en) Methods and systems for synchronizing a streamed template to a solved block
JP7509797B2 (ja) ショートトランザクション識別子衝突検出及び調停

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
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20200929

Address after: No. 2458, Dongda Road, Datuan Town, Pudong New Area, Shanghai, 201312

Patentee after: Shanghai nattl technology partnership (limited partnership)

Address before: Room 16 & 17, 3 / F, building 21, Tengfei science and Technology Park, 388 Xinping street, Suzhou Industrial Park, Jiangsu Province, 215000

Patentee before: SUZHOU HEIYUN INFORMATION TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20201229

Address after: Room 228, building 2, No. 378, East Ring Road, Suzhou Industrial Park, Jiangsu Province

Patentee after: Suzhou black cloud Intelligent Technology Co.,Ltd.

Patentee after: Shanghai heiyun Technology Co.,Ltd.

Address before: No.2458, Dongda highway, Datun Town, Pudong New Area, Shanghai 201312

Patentee before: Shanghai nattl technology partnership (limited partnership)