WO2012167625A1 - 分布式存储系统及其时间戳的实现方法 - Google Patents

分布式存储系统及其时间戳的实现方法 Download PDF

Info

Publication number
WO2012167625A1
WO2012167625A1 PCT/CN2012/070618 CN2012070618W WO2012167625A1 WO 2012167625 A1 WO2012167625 A1 WO 2012167625A1 CN 2012070618 W CN2012070618 W CN 2012070618W WO 2012167625 A1 WO2012167625 A1 WO 2012167625A1
Authority
WO
WIPO (PCT)
Prior art keywords
timestamp
local
server node
value
data packet
Prior art date
Application number
PCT/CN2012/070618
Other languages
English (en)
French (fr)
Inventor
胡欢欢
郭斌
陈典强
韩银俊
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Priority to EP12796542.4A priority Critical patent/EP2720501B1/en
Publication of WO2012167625A1 publication Critical patent/WO2012167625A1/zh

Links

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
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps
    • H04J3/067Details of the timestamp structure
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps
    • H04J3/0664Clock or time synchronisation among packet nodes using timestamps unidirectional timestamps
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • H04L43/106Active monitoring, e.g. heartbeat, ping or trace-route using time related information in packets, e.g. by adding timestamps

Definitions

  • the present invention relates to the field of cloud computing technologies, and in particular, to a distributed storage system and a method for implementing the time stamp. Background technique
  • Cloud Computing is Grid Computing, Distributed Computing, Parallel Computing, Utility Computing Network Storage Technologies, Virtualization. , load balancing (Load Balance) and other traditional computer technology and network technology development and fusion products. It aims to integrate multiple relatively low-cost computing entities into a system with powerful computing power through the network.
  • Distributed storage systems are a domain in the field of cloud computing. Their role is to provide distributed storage services for massive data and high-speed read and write access.
  • a distributed storage system is composed of a plurality of server nodes and clients interconnected; a server node is responsible for storing data, and the client can perform operations such as writing, reading, updating, and deleting data to the server.
  • each attribute is added with some attribute information when it is actually stored. For example, timestamp.
  • timestamp In this way, when the user obtains the data, the user can return a maximum timestamp data to the user according to the size of the timestamp.
  • the time stamp in a distributed storage system refers to a data maintained by each server node in the system that reflects the lifetime of the distributed storage system. At any one time, the time stamp of each server node in the system must be the same, and gradually increase as the actual time increases.
  • Method 1 Select a server node in the system as a time server, and the time server periodically broadcasts to other server nodes in the system.
  • the timestamp maintained by it, other server nodes update their local timestamp after receiving the packet carrying the timestamp.
  • This method is a centralized solution whose reliability depends on the reliability of the time server in the system. If the time server is down, it affects the time stamp of the entire system. Moreover, the updated time stamp in the normal server node. , there is no calculation of the time when the data packet is transmitted in the network, that is, there is a time difference between the time stamp of the ordinary server node and the time stamp of the time server. In addition, this method will not update the time stamp correctly if the time server sends a failure.
  • NTP Network Time Protocol
  • the object of the present invention is to provide a distributed storage system and a method for implementing the timestamp thereof, so as to solve the problem that the existing centralized implementation method is not reliable.
  • the present invention provides a method for implementing a timestamp of a distributed storage system, including the following steps: Each server node of the system maintains a local timestamp;
  • Each of the above server nodes periodically sends other server nodes other than itself to the system. Send a packet carrying the current timestamp maintained locally;
  • Each of the above server nodes updates the local timestamp based on the received data packet.
  • each server node of the system maintains a local timestamp: the initial value of the timestamp maintained locally by each server node is 0, and is incremented by 1 every second from the first operation of the above system. .
  • each of the foregoing server nodes updates the local timestamp according to the received data packet to: parse the received data packet, and obtain a timestamp and a check digit;
  • the difference is within the above-mentioned check threshold, it is determined whether the value of the timestamp is greater than the value of the local current timestamp. When it is greater than, the local timestamp is updated by using the timestamp; when not greater than, the local timestamp is not updated. Timestamp.
  • the method further comprises: the server node in the above system persisting the local timestamp to the locally stored file every one second.
  • each server node of the system maintains a local timestamp as follows: The local timestamp of each of the above server nodes continues from the timestamp of pre-termination Timing.
  • the server node saves only two timestamps at the same time, and when a new timestamp is saved, the first saved timestamp automatically overflows.
  • the check threshold is 1 to 1.5 times a period in which the server node sends the data packet carrying the time stamp.
  • the present invention further provides a distributed storage system, including a plurality of server nodes connected to each other, wherein the server node includes a timestamp maintenance module and a timestamp update module; wherein the timestamp maintenance module is configured to provide a local timestamp And periodically sending a data packet carrying the local current timestamp to other server nodes except the server node in the system;
  • the timestamp update module is configured to update the timestamp of the timestamp maintenance module according to the received data packet.
  • the timestamp maintenance module is further configured to provide an interface for setting a period of sending a data packet carrying a local current timestamp, and stepping the timestamp by 1 for each timestamp, and persisting the timestamp every 1 second. To the locally stored file; and resume normal operation after the system terminates abnormally, continue timing from the timestamp that was persisted before termination;
  • the timestamp update module is further configured to provide an interface for setting a check threshold, parse the received data packet, determine whether the parsed bit is parsed correctly, and save the parsed timestamp when the check bit is correct. And determining whether the difference between the value of the timestamp obtained by the parsing and the value of the last saved timestamp is within the above-mentioned check threshold range, and determining the timestamp when the difference is within the check threshold range Whether the value is greater than the value of the current timestamp of the timestamp maintenance module, and when the value of the timestamp is greater than the current timestamp of the timestamp maintenance module, the timestamp of the timestamp maintenance module is updated with the timestamp.
  • the server node further includes a timestamp storage module configured to store the timestamp and automatically overflow the previously saved timestamp when a new timestamp is stored.
  • a timestamp storage module configured to store the timestamp and automatically overflow the previously saved timestamp when a new timestamp is stored.
  • the present invention ensures that the timestamps on each server node in the system are the same at any time by maintaining a timestamp on each server node and periodically updating the local timestamp according to the timestamps of other nodes.
  • Inventing the time stamp of each server node has a very high reliability, and is a decentralized solution. It does not cause an all system timestamp exception due to an exception of a server node in the system.
  • FIG. 1 is a flow chart of a method for implementing a timestamp of a distributed storage system according to the present invention
  • FIG. 2 is a schematic block diagram of a distributed storage system of the present invention. detailed description
  • FIG. 1 it is a flowchart of a method for implementing a timestamp of a distributed storage system according to the present invention, which includes the following steps:
  • Step S001 Each server node of the distributed storage system maintains a local timestamp; each server node persists the local timestamp to a locally stored file every 1 second. The initial value of the timestamp maintained locally by each server node is 0. From the first run of the distributed storage system, the local timestamp of each server node is incremented by 1 per second;
  • the local timestamp of each server node continues to be timed from the timestamp that was persisted before its termination. For example, if the value of the persistent timestamp is 120 before termination, After the system is running normally, the timing is continued from 120.
  • Step S002 Each server node periodically sends a data packet carrying a current timestamp maintained locally to other server nodes in the system.
  • Each server node sends a packet carrying the current timestamp maintained locally to other server nodes through a long link established during system initialization.
  • each server node can be preset to send a packet carrying a local timestamp to other server nodes in the system every 60 seconds.
  • Step S003 each server node parses the received data packet to obtain a timestamp 7 and a check digit.
  • the timestamp 7 obtained by the parsing is discarded.
  • Step S005 saving the above time stamp ⁇ ⁇ ;
  • each server node saves only two timestamps at the same time.
  • the previously saved timestamp automatically overflows. For example, if the current period is the third period, and the first two periods of the insurance risk are correct, the timestamp saved is the third time before the timestamp 7 carried in the data packet received in the second period is saved. - 2 period time stamps ⁇ _ _ 2 and
  • the time stamp of N-1 cycles ⁇ when the timestamp ⁇ of the second cycle is saved, the timestamp ⁇ _ _ 2 of the ⁇ -2 cycle automatically overflows.
  • Step S006 determining whether the difference between the value of the timestamp 7 and the value of the last saved timestamp ⁇ is within a preset check threshold range, and if yes, executing step S007; otherwise, executing step S009;
  • the check threshold may be set to be 1 to 1.5 times of the period in which the server node sends the time-stamped data packet. For example, if the server node sends the time-stamped data packet with a period of 60 seconds, the checksum is performed. The threshold is 60 ⁇ 90. If 7 - ⁇ is not within the check threshold range, it indicates that the packet has an exception during transmission.
  • Step S007 determining whether the parsed time stamp ⁇ ⁇ value greater than the current value of the timestamp of the local maintenance, if yes, step S008 is executed; otherwise, executing step S009;
  • Steps S005, S006, and S007 effectively ensure the consistency of the timestamps on the server nodes, and suppress the abnormal timestamps of other server nodes caused by the abnormality in the transmission process of the data packets carrying the timestamps.
  • Step S008 The local timestamp is updated by using the above timestamp ,, and the execution of the week is ended.
  • Step S009 The local timestamp is not updated, and the execution of the week is ended.
  • FIG. 2 it is a schematic block diagram of the distributed storage system of the present invention. This embodiment assumes that the distributed storage system includes three server nodes, which are respectively 10, 20, and 30. Each server node includes a timestamp maintenance module. a timestamp update module 02 and a timestamp storage module 03; a timestamp maintenance module 01, configured to provide a timestamp for the local, step by 1 for the timestamp described above, and persist the timestamp to the first time every 1 second.
  • the locally stored file is also used to provide an interface for setting a period of sending a packet carrying a current timestamp maintained locally, and periodically sending a packet carrying a local current timestamp to other server nodes in the system, and When the system returns to normal operation after abnormal termination, the timestamp is continued from the timestamp of the pre-termination; the timestamp update module 02 provides an interface for setting the check threshold, parses the received data packet, and judges the parsed verification.
  • the check bit when the check bit is correct, save the parsed timestamp ⁇ to the timestamp storage module 03, and judge ⁇ ⁇ timestamp value and the last value of the difference between the stored timestamp ⁇ 7 is within the above range check threshold, and when said difference is within said range check threshold, it is determined whether the value of the stamp 7 the current value of the timestamp is greater than the current value of the timestamp is the timestamp of the maintenance module 01, and the value is greater than the above-described stamp ⁇ ⁇ stamp maintenance module 01, the above time stamp updating ⁇ ⁇ time stamp maintenance module 01 stamp.
  • the timestamp storage module 03 is configured to store the parsed timestamp ⁇ ⁇ and automatically overflow the first saved timestamp when a new timestamp is stored.

Abstract

本发明涉及一种分布式存储系统及其时间戳的实现方法,上述方法包括:上述系统的每个服务器节点均维护一个本地时间戳,上述每个服务器节点周期性向系统中的其他服务器节点发送携带有本地维护的当前时间戳的数据包,上述每个服务器节点根据收到的数据包,更新本地时间戳;上述系统包括若干个服务器节点,上述服务器节点包括时间戳维护模块、时间戳更新模块以及时间戳存储模块。本发明具有非常高的可靠性。

Description

分布式存储系统及其时间戳的实现方法 技术领域
本发明涉及云计算技术领域, 尤其涉及一种分布式存储系统及其时间 戳的实现方法。 背景技术
云计算( Cloud Computing )是网格计算( Grid Computing )、 分布式计 算( Distributed Computing )、并行计算( Parallel Computing )、效用计算( Utility Computing ) 网络存 者 ( Network Storage Technologies )、 虚拟化 ( Virtualization ), 负载均衡( Load Balance )等传统计算机技术和网络技术 发展融合的产物。 它旨在通过网络把多个成本相对较低的计算实体整合成 一个具有强大计算能力的系统。 分布式存储系统是云计算范畴中的一个领 域, 其作用是提供海量数据的分布式存储服务以及高速读写访问的能力。
在分布式存储系统中, 时间戳的实现是比较难以解决的关键问题。 分 布式存储系统是由若干服务器节点和客户端互相连接构成的; 服务器节点 负责数据的存储, 客户端可以对服务器做数据的写入、 读取、 更新、 删除 等操作。
一般来说写入的数据不可能只保存在单个服务器节点上, 而是在多台 服务器节点上保存同一个数据的副本, 互为备份。 当网络偶然瞬间故障或 者硬件、 软件故障, 或者用户对同一个数据频繁、 交叉地进行不同的操作, 例如, 更新、 删除等, 则系统内不同服务器节点上的数据副本会有不同的 值。 当用户再次获取该数据时, 会发生取得的数据不是其最后更新后的值, 背离了用户的需求。
为了保障在分布式存储系统中, 用户取得的数据是其最后更新的数据, 即保障分布式存储系统中数据的一致性, 每个数据在实际存储时, 还要加 上一些属性信息。 例如, 时间戳。 这样用户在获取数据的时候, 可以根据 时间戳的大小, 返回一个最大时间戳的数据给用户。 所谓分布式存储系统 中的时间戳是指系统中每个服务器节点都维持的一个反应该分布式存储系 统存活时间的数据。 在任一时刻, 系统中每个服务器节点的时间戳必须相 同, 而且随着实际时间的增加, 逐步递增。
在现有的分布式存储系统中, 时间戳的实现有以下几种方法: 方法一: 在系统中选定一个服务器节点作为时间服务器, 由该时间服 务器周期性地向系统中的其它服务器节点广播其维护的时间戳, 其它服务 器节点收到携带有时间戳的数据包后, 更新其本地时间戳。 这种方法是一 个中心化的解决方法, 其可靠性依赖于系统中的时间服务器的可靠性, 如 果时间服务器宕机, 则影响到整个系统的时间戳; 而且, 普通服务器节点 中更新的时间戳, 是没有计算数据包在网络中传输的时间的, 也就是说, 普通服务器节点的时间戳与时间服务器的时间戳之间存在微'』、的时差。 另 外, 这种方法一旦时间服务器发送故障, 则整个系统将无法正确更新时间 戳。
方法二: 由系统中的每个服务器节点从 Internet 中的网络时间协议 ( Network Time Protocol, NTP ) 时间服务器获取权威的时间作为本节点的 本地时间戳。 这种方法依赖于外界的服务, 一般很少采用。 发明内容
本发明的目的是, 提供一种分布式存储系统及其时间戳的实现方法, 以解决现有基于中心化的实现方法可靠性不高的问题。
本发明提供了一种分布式存储系统时间戳的实现方法, 包括以下步驟: 所述系统的每个服务器节点均维护一个本地时间戳;
上述每个服务器节点周期性向所述系统中除自身外的其他服务器节点 发送携带有本地维护的当前时间戳的数据包;
上述每个服务器节点根据收到的数据包, 更新本地时间戳。
优选地, 所述系统的每个服务器节点均维护一个本地时间戳为: 所述每个服务器节点本地维护的时间戳的初始值为 0,从上述系统第一 次运行起, 每秒自增 1。
优选地, 上述每个服务器节点根据收到的数据包, 更新本地时间戳为: 解析收到的数据包, 得到时间戳和校验位;
判断上述校险位是否正确, 当所述校险位不正确时, 不更新本地时间 戳, 并丟弃上述时间戳;
当所述校验位正确时, 保存上述时间戳;
判断上述时间戳的值与上一次保存的时间戳的值之差是否在预设的校 验阈值范围内, 当上述差值不在上述校验阈值范围内时, 不更新本地时间 戳;
当上述差值在上述校验阈值范围内时, 判断上述时间戳的值是否大于 本地当前时间戳的值, 当大于时, 则用上述时间戳更新本地时间戳; 当不 大于时, 不更新本地时间戳。
优选地, 所述方法还包括: 上述系统中的服务器节点每隔 1 秒, 将本 地时间戳持久化到本地存储的文件中。
优选地, 当上述系统异常终止后又恢复正常运行, 所述系统的每个服 务器节点均维护一个本地时间戳为: 上述每个服务器节点的本地时间戳从 其终止前持久化的时间戳处继续计时。
优选地, 上述方法中, 上述服务器节点同一时间仅保存两个时间戳, 当有新的时间戳保存进来时, 先保存的时间戳自动溢出。
优选地, 上述校验阈值为上述服务器节点发送携带有时间戳的数据包 的周期的 1倍到 1.5倍。 本发明进一步提供了一种分布式存储系统, 包括相互连接的多个服务 器节点, 上述服务器节点包括时间戳维护模块、 时间戳更新模块; 其中, 上述时间戳维护模块, 设置为为本地提供时间戳, 并周期性向所述系 统中除自身所述服务器节点外的其他服务器节点发送携带本地当前时间戳 的数据包;
上述时间戳更新模块, 设置为根据收到的数据包, 更新上述时间戳维 护模块的时间戳。
优选地, 上述时间戳维护模块, 还设置为提供设置发送携带有本地当 前时间戳的数据包周期的接口, 为上述时间戳每秒步进 1 , 且每隔 1秒, 将 上述时间戳持久化到本地存储的文件中; 并在所述系统异常终止后又恢复 正常运行时, 从终止前持久化的时间戳处继续计时;
上述时间戳更新模块, 还设置为提供设置校验阈值的接口, 解析收到 的数据包, 并判断解析得到的校验位是否正确, 以及在上述校验位正确时, 保存解析得到的时间戳, 并判断上述解析得到的时间戳的值与上一次保存 的时间戳的值之差是否在上述校验阈值范围内, 并在上述差值在上述校验 阈值范围内时, 判断上述时间戳的值是否大于上述时间戳维护模块的当前 时间戳的值, 以及在上述时间戳的值大于上述时间戳维护模块的当前时间 戳的值时, 用上述时间戳更新上述时间戳维护模块的时间戳。
优选地, 上述服务器节点还包括时间戳存储模块, 设置为存储时间戳, 并在有新的时间戳存入时, 自动溢出先保存的时间戳。
本发明通过在每个服务器节点上均维护一个时间戳, 且周期性根据其 他节点的时间戳更新本地时间戳的方法, 保障了系统中每个服务器节点上 的时间戳在任一时刻都相同, 本发明各服务器节点的时间戳具有非常高的 可靠性, 是一个非中心化的解决方法, 不会因为系统中某个服务器节点的 异常导致全系统时间戳的异常。 附图说明
图 1是本发明分布式存储系统时间戳的实现方法流程图;
图 2是本发明分布式存储系统的原理框图。 具体实施方式
为了使本发明所要解决的技术问题、 技术方案及有益效果更加清楚、 明白, 以下结合附图和实施例, 对本发明进行进一步详细说明。 应当理解, 此处所描述的具体实施例仅用以解释本发明, 并不用于限定本发明。
如图 1 所示, 是本发明分布式存储系统时间戳的实现方法流程图, 包 括以下步驟:
步驟 S001 :分布式存储系统的每个服务器节点均维护一个本地时间戳; 各服务器节点每隔 1秒将本地时间戳持久化到本地存储的文件中。 各服务器节点本地维护的时间戳的初始值均为 0,从分布式存储系统第 一次运行起, 各服务器节点的本地时间戳每秒自增 1 ;
当分布式存储系统异常终止后又恢复正常运行, 则各服务器节点的本 地时间戳从其终止前持久化的时间戳处继续计时, 比如, 若终止前, 持久 化的时间戳的值为 120, 则系统正常运行后, 即从 120开始继续计时。
步驟 S002: 各服务器节点周期性向系统中的其他服务器节点发送携带 有本地维护的当前时间戳的数据包;
各服务器节点通过系统初始化时建立的长链接向其他服务器节点发送 携带有本地维护的当前时间戳的数据包。
例如, 可以预设各服务器节点每隔 60秒发送一次携带有本地时间戳的 数据包给系统中的其他服务器节点。
步驟 S003:各服务器节点解析收到的数据包,得到时间戳 7 和校验位; 步驟 S004: 判断上述解析得到的校验位是否正确, 若是, 则执行步驟 S005; 否则, 执行步驟 S009;
本发明中,当判断出解析得到的校验位错误时,则解析得到的时间戳 7 被丟弃。
步驟 S005: 保存上述时间戳 ΓΝ ;
本发明中, 各服务器节点同一时间仅保存两个时间戳, 当有新的时间 戳保存进来时, 先保存的时间戳自动溢出。 比如, 假设当前周期为第 Ν个 周期, 且其前两个周期的校险位都正确, 则在保存第 Ν个周期收到的数据 包携带的时间戳 7 之前, 保存的时间戳为第 Ν-2个周期的时间戳 ΓΝ_2和第
N-1个周期的时间戳 ^ , 当保存第 Ν个周期的时间戳^时, 则第 Ν-2个 周期的时间戳 ΓΝ_2自动溢出。
步驟 S006: 判断上述时间戳 7 的值与上一次保存的时间戳 ^的值之 差是否在预设的校验阈值范围内, 若是, 则执行步驟 S007; 否则, 执行步 驟 S009;
上述校验阈值可设置为本服务器节点发送携带有时间戳的数据包的周 期的 1倍到 1.5倍, 比如, 若本服务器节点发送携带有时间戳的数据包的周 期为 60秒, 则校验阈值为 60~90。 若 7 - ^不在校验阈值范围内, 则表示 该数据包在传输过程中发生异常。
步驟 S007: 判断上述解析得到的时间戳 ΓΝ的值是否大于本地维护的当 前时间戳的值, 若是, 则执行步驟 S008; 否则, 执行步驟 S009;
步驟 S005、 S006以及 S007有效地保障了各服务器节点上时间戳的一 致, 抑制了由于携带时间戳的数据包在传输过程中的异常而导致的其他服 务器节点的时间戳异常的情况。
步驟 S008: 用上述时间戳 ΓΝ更新本地时间戳, 本周期执行结束; 步驟 S009: 不更新本地时间戳, 本周期执行结束。 如图 2所示, 是本发明分布式存储系统的原理框图, 本实施例假设分 布式存储系统包括 3个服务器节点, 分别为 10、 20、 30, 每个服务器节点 均包括时间戳维护模块 01、 时间戳更新模块 02以及时间戳存储模块 03; 时间戳维护模块 01 , 用于为本地提供时间戳, 为上述时间戳每秒步进 1 , 且每隔 1秒, 将上述时间戳持久化到本地存储的文件中; 还用于提供设 置发送携带有本地维护的当前时间戳的数据包的周期的接口, 并周期性向 系统中的其他服务器节点发送携带有本地当前时间戳的数据包, 并在系统 异常终止后又恢复正常运行时, 从终止前持久化的时间戳处继续计时; 时间戳更新模块 02, 提供设置校验阈值的接口, 解析收到的数据包, 并判断解析得到的校验位是否正确, 在上述校验位正确时, 将解析得到的 时间戳 ^保存到时间戳存储模块 03 中, 并判断上述时间戳 ΓΝ的值与上一 次保存的时间戳 7^的值之差是否在上述校验阈值范围内,并在上述差值在 上述校验阈值范围内时, 判断上述时间戳 7 的值是否大于时间戳维护模块 01 的当前时间戳的值, 以及在上述时间戳 ΓΝ的值大于时间戳维护模块 01 的当前时间戳的值时, 用上述时间戳 ΓΝ更新时间戳维护模块 01的时间戳。
时间戳存储模块 03, 用于存储解析得到的时间戳 ΓΝ , 并在有新的时间 戳存入时, 自动溢出先保存的时间戳。
上述说明示出并描述了本发明的优选实施例, 但如前所述, 应当理解 本发明并非局限于本文所披露的形式, 不应看作是对其他实施例的排除, 而可用于各种其他组合、 修改和环境, 并能够在本文所述发明构想范围内, 通过上述教导或相关领域的技术或知识进行改动。 而本领域人员所进行的 改动和变化不脱离本发明的精神和范围, 则都应在本发明所附权利要求的 保护范围内。

Claims

权利要求书
1、 一种分布式存储系统时间戳的实现方法, 其中, 所述方法包括: 所述系统的每个服务器节点均维护一个本地时间戳;
所述每个服务器节点周期性向所述系统中除自身外的其他服务器节点 发送携带有本地维护的当前时间戳的数据包;
所述每个服务器节点根据收到的数据包, 更新本地时间戳。
2、 根据权利要求 1所述的方法, 其中, 所述系统的每个服务器节点均 维护一个本地时间戳为: 所述每个服务器节点本地维护的时间戳的初始值为 0,从所述系统第一 次运行起, 每秒自增 1。
3、 根据权利要求 1或 2所述的方法, 其中, 所述每个服务器节点根据 收到的数据包, 更新本地时间戳为:
解析收到的数据包, 得到时间戳和校验位;
判断所述校验位是否正确, 当所述校验位不正确时, 不更新本地时间 戳, 并丟弃所述时间戳;
当所述校验位正确时, 保存所述时间戳;
判断所述时间戳的值与上一次保存的时间戳的值之差是否在预设的校 验阈值范围内, 当所述差值不在所述校验阈值范围内时, 不更新本地时间 戳;
当所述差值在所述校验阈值范围内时, 判断所述时间戳的值是否大于 本地当前时间戳的值, 当大于时, 则用所述时间戳更新本地时间戳; 当不 大于时, 不更新本地时间戳。
4、 根据权利要求 1所述的方法, 其中, 所述方法还包括:
所述系统中的服务器节点每隔 1 秒, 将本地时间戳持久化到本地存储 的文件中。
5、 根据权利要求 1或 4所述的方法, 其中, 当所述系统异常终止后又 恢复正常运行, 所述系统的每个服务器节点均维护一个本地时间戳为: 所述每个服务器节点的本地时间戳从其终止前持久化的时间戳处继续 计时。
6、 根据权利要求 3所述的方法, 其中, 所述保存所述时间戳为: 所述服务器节点同一时间仅保存两个时间戳, 当有新的时间戳保存进 来时, 先保存的时间戳自动溢出。
7、 根据权利要求 3所述的方法, 其中, 所述校验阈值为所述服务器节 点发送携带有时间戳的数据包的周期的 1倍到 1.5倍。
8、 一种分布式存储系统, 包括相互连接的多个服务器节点, 其中, 所 述服务器节点包括时间戳维护模块、 时间戳更新模块; 其中,
所述时间戳维护模块, 设置为为本地提供时间戳, 并周期性向所述系 统中除自身所属服务器节点外的其他服务器节点发送携带本地当前时间戳 的数据包;
所述时间戳更新模块, 设置为根据收到的数据包, 更新所述时间戳维 护模块的时间戳。
9、 根据权利要求 8所述的系统, 其中,
所述时间戳维护模块, 还设置为提供设置发送携带有本地当前时间戳 的数据包的周期的接口, 为所述时间戳每秒步进 1 , 且每隔 1秒, 将所述时 间戳持久化到本地存储的文件中; 并在所述系统异常终止后又恢复正常运 行时, 从终止前持久化的时间戳处继续计时;
所述时间戳更新模块, 还设置为提供设置校验阈值的接口, 解析收到 的数据包, 并判断解析得到的校验位是否正确, 以及在所述校验位正确时, 保存解析得到的时间戳, 并判断所述解析得到的时间戳的值与上一次保存 的时间戳的值之差是否在所述校验阈值范围内, 并在所述差值在所述校验 阈值范围内时, 判断所述时间戳的值是否大于所述时间戳维护模块的当前 时间戳的值, 以及在所述时间戳的值大于所述时间戳维护模块的当前时间 戳的值时 , 用所述时间戳更新所述时间戳维护模块的时间戳。
10、 根据权利要求 8或 9所述的系统, 其中, 所述服务器节点还包括 时间戳存储模块, 设置为存储时间戳, 并在有新的时间戳存入时, 自动溢 出先保存的时间戳。
PCT/CN2012/070618 2011-06-07 2012-01-19 分布式存储系统及其时间戳的实现方法 WO2012167625A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
EP12796542.4A EP2720501B1 (en) 2011-06-07 2012-01-19 Distributed storage system and method of time stamp control therefore.

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110151514.3A CN102821114B (zh) 2011-06-07 2011-06-07 分布式存储系统及其时间戳的实现方法
CN201110151514.3 2011-06-07

Publications (1)

Publication Number Publication Date
WO2012167625A1 true WO2012167625A1 (zh) 2012-12-13

Family

ID=47295437

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/070618 WO2012167625A1 (zh) 2011-06-07 2012-01-19 分布式存储系统及其时间戳的实现方法

Country Status (3)

Country Link
EP (1) EP2720501B1 (zh)
CN (2) CN102821114B (zh)
WO (1) WO2012167625A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109542338A (zh) * 2018-10-19 2019-03-29 郑州云海信息技术有限公司 一种实现分布式存储系统中节点信息一致性方法及装置
CN109873921A (zh) * 2019-02-14 2019-06-11 初速度(苏州)科技有限公司 一种图像时间戳的传输方法、解析方法和装置

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104507155B (zh) * 2014-12-17 2018-02-27 苏州寻息电子科技有限公司 一种有源节点的组网同步与管理方法
CN105812181B (zh) * 2016-03-10 2019-08-02 同济大学 一种面向高速磁浮交通仿真的分布式通信系统维护方法
CN106302700B (zh) * 2016-08-11 2019-09-24 浪潮(北京)电子信息产业有限公司 基于paxos算法的分布式系统一致性更新方法及系统
CN108594636A (zh) * 2018-04-28 2018-09-28 济南浪潮高新科技投资发展有限公司 一种自动驾驶车辆的冗余控制系统及方法
CN110032444B (zh) * 2019-02-25 2023-01-10 创新先进技术有限公司 一种分布式系统及分布式任务处理方法
CN111158999B (zh) * 2019-12-30 2023-05-26 杭州迪普科技股份有限公司 一种格式化时间的计算方法和装置
CN112269423B (zh) * 2020-12-21 2021-03-19 支付宝(杭州)信息技术有限公司 一种锁定区块链系统中全局时钟的方法及区块链系统
CN112968747B (zh) * 2021-03-04 2022-09-23 广州市百果园网络科技有限公司 一种时间校准方法、装置、计算机设备和存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060222016A1 (en) * 2005-03-29 2006-10-05 Lucent Technologies Inc. Synchronization of time stamps of peer devices in a communication node
CN1960242A (zh) * 2006-10-17 2007-05-09 中控科技集团有限公司 实现时钟同步的方法、装置、系统及分布式系统
US7487229B2 (en) * 2006-03-30 2009-02-03 Intel Corporation Methods and apparatus to synchronize local times at nodes in a computer network
US7561559B2 (en) * 2005-03-30 2009-07-14 Ixia Hardware time stamping and processor synchronization
CN101656977A (zh) * 2009-07-01 2010-02-24 南京邮电大学 一种基于时分复用访问协议的安全时间同步方法

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5428645A (en) * 1992-11-03 1995-06-27 International Business Machines Corporation Anonymous time synchronization method
US7120825B2 (en) * 2003-06-06 2006-10-10 Hewlett-Packard Development Company, L.P. Adaptive batch sizing for asynchronous data redundancy
KR100735230B1 (ko) * 2006-05-02 2007-07-03 삼성전자주식회사 분산 제어 시스템에서의 타임 동기화 방법
CN101132270B (zh) * 2007-08-02 2010-09-08 北京航空航天大学 多节点协调的时间一致性管理方法
CN101753609B (zh) * 2008-12-15 2012-09-19 中国移动通信集团公司 分布式系统版本控制方法、节点及系统
US8924513B2 (en) * 2009-07-08 2014-12-30 International Business Machines Corporation Storage system
CN101982959B (zh) * 2010-11-24 2013-02-13 电子科技大学 网络的按需时间同步方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060222016A1 (en) * 2005-03-29 2006-10-05 Lucent Technologies Inc. Synchronization of time stamps of peer devices in a communication node
US7561559B2 (en) * 2005-03-30 2009-07-14 Ixia Hardware time stamping and processor synchronization
US7487229B2 (en) * 2006-03-30 2009-02-03 Intel Corporation Methods and apparatus to synchronize local times at nodes in a computer network
CN1960242A (zh) * 2006-10-17 2007-05-09 中控科技集团有限公司 实现时钟同步的方法、装置、系统及分布式系统
CN101656977A (zh) * 2009-07-01 2010-02-24 南京邮电大学 一种基于时分复用访问协议的安全时间同步方法

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109542338A (zh) * 2018-10-19 2019-03-29 郑州云海信息技术有限公司 一种实现分布式存储系统中节点信息一致性方法及装置
CN109873921A (zh) * 2019-02-14 2019-06-11 初速度(苏州)科技有限公司 一种图像时间戳的传输方法、解析方法和装置
CN109873921B (zh) * 2019-02-14 2023-04-07 魔门塔(苏州)科技有限公司 一种图像时间戳的传输方法、解析方法和装置

Also Published As

Publication number Publication date
CN102821114B (zh) 2017-02-08
EP2720501B1 (en) 2017-08-16
CN102821114A (zh) 2012-12-12
EP2720501A4 (en) 2014-10-29
CN106470084A (zh) 2017-03-01
EP2720501A1 (en) 2014-04-16

Similar Documents

Publication Publication Date Title
WO2012167625A1 (zh) 分布式存储系统及其时间戳的实现方法
US10320635B2 (en) Methods and apparatus for providing adaptive private network centralized management system timestamp correlation processes
CA2767499C (en) A method of time synchronization of free running nodes in an avionics network
CN110297801B (zh) 基于容错fpga的事务系统的正好一次事务语义的系统和方法
WO2021121370A1 (zh) 用于消息队列的消息丢失检测方法和装置
TWI435202B (zh) 回應於主要時間伺服器的時間碼接收器之失效,將主要時間伺服器維持為目前的時間伺服器
US8606407B2 (en) Energy management application server and processes
US10929157B2 (en) Techniques for checkpointing/delivery between primary and secondary virtual machines
US8416811B2 (en) Coordinated timing network having servers of different capabilities
US9367261B2 (en) Computer system, data management method and data management program
WO2014101684A1 (zh) 数据同步方法、装置和系统
US9608753B2 (en) Time synchronization system, management node, and time synchronization method
US10326613B2 (en) Method and system for processing spanning tree protocol (STP) state in a multichassis link aggregation (MLAG) domain
US10439917B2 (en) Recovering a replica in an operator in a data streaming processing system
US10491329B1 (en) Transfer of data-redundancy encoded data via unreliable, connectionless protocol
US9438676B2 (en) Speculative data processing of streaming data
US20160092537A1 (en) Polling based synchronization in managed networks
US20160094657A1 (en) Event-driven synchronization in snmp managed networks
WO2014135011A1 (zh) 数据库系统以及数据同步方法
US20140351639A1 (en) Recovery of operational state values for complex event processing based on a time window defined by an event query
CA2757499A1 (en) Water-base acrylic premanufactured waterproofing material and process for obtaining the same
US10599672B2 (en) Cursor-based state-collapse scheme for shared databases
WO2014199568A1 (ja) 永続記憶装置へのデータ書込制御方法
WO2016183735A1 (zh) 一种同步虚拟网络功能vnf状态的方法、装置和设备
WO2017011981A1 (zh) 一种流表项的定时处理方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12796542

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

REEP Request for entry into the european phase

Ref document number: 2012796542

Country of ref document: EP