WO2017000480A1 - 时间同步方法、服务器及系统、存储介质 - Google Patents

时间同步方法、服务器及系统、存储介质 Download PDF

Info

Publication number
WO2017000480A1
WO2017000480A1 PCT/CN2015/094887 CN2015094887W WO2017000480A1 WO 2017000480 A1 WO2017000480 A1 WO 2017000480A1 CN 2015094887 W CN2015094887 W CN 2015094887W WO 2017000480 A1 WO2017000480 A1 WO 2017000480A1
Authority
WO
WIPO (PCT)
Prior art keywords
external clock
clock source
noise ratio
satellites
ptp
Prior art date
Application number
PCT/CN2015/094887
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 中兴通讯股份有限公司
Publication of WO2017000480A1 publication Critical patent/WO2017000480A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L7/00Arrangements for synchronising receiver with transmitter

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a time synchronization method, a server, and a system and a computer storage medium.
  • IEEE1588 Precision Clock Synchronization Protocol Standard for Network Measurement and Control System
  • clocks synchronize the clock of the client in the network with the clock of the server through hardware and software, and provides an Ethernet timing synchronization method with a synchronization setup time of less than 10 ⁇ s.
  • the slave clock of the client is completely synchronized with the master clock of the server.
  • the master clock periodically issues PTP (Precision Time Synchronization Protocol) and time information.
  • PTP Precision Time Synchronization Protocol
  • the clock port receives the timestamp information sent by the master clock port, and the system calculates the time delay of the master-slave line and the master-slave time difference, and uses the time difference to adjust the local time, so that the time of the client and the time of the server are consistent. .
  • the server In order to provide high-quality clock output, the server usually needs to support an external high-precision clock source such as GPS (Global Positioning System), Beidou, and atomic clock to synchronize with the external high-precision clock by using the server's main clock. To achieve high quality clock output requirements.
  • an external high-precision clock source such as GPS (Global Positioning System), Beidou, and atomic clock to synchronize with the external high-precision clock by using the server's main clock.
  • GPS Global Positioning System
  • Beidou Beidou
  • atomic clock To achieve high quality clock output requirements.
  • the client cannot determine the state of the high-precision clock externally connected to the server, so that the slave clock cannot know the problem of the external clock, thereby causing the entire Synchronous network systems may be abnormal.
  • an embodiment of the present invention provides a time synchronization method, a server, and a system and a computer storage medium, which are designed to add an external clock source information connected to a server in a PTP message based on the IEEE 1588 protocol.
  • the client is provided with more detailed synchronization information, which avoids the adverse consequences caused by the failure of the external clock source, thereby improving the stability of the system.
  • the server synchronizes time with an external clock source, and obtains information about the external clock source;
  • the information of the external clock source includes the server satellite number field, a signal to noise ratio field, an antenna feed status, and a quality field.
  • the information of the external clock source is integrated into a PTP packet to form a PTP add message, including:
  • the satellite number, the signal-to-noise ratio, the antenna feed state, and the quality value of the external clock source are added to the PTP packet to form a PTP add message.
  • the number of satellites includes the number of satellites searched by the server and the number of locked satellites, and when the antenna feed state of the external clock source is normal, the number of satellites and the signal to noise ratio are calculated according to the satellite number and the signal to noise ratio.
  • the quality value of the external clock source includes:
  • the quality value of the external clock source is calculated as a first value
  • the quality value of the external clock source is calculated to be a fourth value.
  • the PTP add message includes a header, a body, and an extension field, and the extension field is a type/length/value TLV format.
  • An embodiment of the present invention further provides a server, where the server includes:
  • the information acquiring module is configured to perform time synchronization between the server and the external clock source, and obtain information about the external clock source;
  • a packet module configured to integrate the information of the external clock source into a PTP packet of a precise time synchronization protocol to form a PTP add message
  • the first sending module is configured to send the PTP add message to the client, so that the client performs time synchronization with the server, and demodulates information of the external clock source.
  • the information of the external clock source includes the server satellite number field, a signal to noise ratio field, an antenna feed status, and a quality field.
  • the packaging module includes:
  • a calculating unit configured to calculate a quality value of the external clock source according to the number of satellites and a signal to noise ratio when the antenna feed state of the external clock source is normal;
  • the packet unit is configured to add the satellite number, the signal-to-noise ratio, the antenna feed state, and the quality value of the external clock source to the PTP packet to form a PTP add message.
  • the number of satellites includes the number of satellites searched by the server and the locked guard
  • the number of stars the calculation unit includes:
  • Comparing the subunits configured to compare the number of locked satellites with a predetermined number of satellites and a magnitude relationship between a signal to noise ratio and a predetermined signal to noise ratio when the antenna feed state of the external clock source is normal;
  • a first subunit configured to calculate, when the number of locked satellites is greater than or equal to the predetermined number of satellites, and the signal to noise ratio is greater than the predetermined signal to noise ratio, to obtain a quality value of the external clock source. value;
  • a second subunit configured to calculate, when the number of locked satellites is greater than the predetermined number of satellites, and the signal to noise ratio is less than the predetermined signal to noise ratio, to obtain a quality value of the external clock source as a second value;
  • a third subunit configured to calculate, when the locked satellite number is less than the predetermined number of satellites, and the signal to noise ratio is greater than the predetermined signal to noise ratio, to obtain a third value of the quality value of the external clock source;
  • the fourth subunit is configured to calculate that the quality value of the external clock source is a fourth value when the number of locked satellites is less than the predetermined number of satellites and the signal to noise ratio is less than the predetermined signal to noise ratio.
  • the PTP add message includes a header, a body, and an extension field, and the extension field is a type/length/value TLV format.
  • an embodiment of the present invention further provides a system, where the system includes a client, a remote end, and a server as described above.
  • the client includes:
  • a first receiving module configured to receive a PTP add message sent by the server, and a PTP add message fetch command sent by the remote end;
  • the parsing module is configured to parse the PTP add message according to the PTP add message extraction command to obtain the information of the external clock source;
  • a second sending module configured to send the parsed information of the external clock source to the Said remote end.
  • the remote end includes:
  • a requesting module configured to send the PTP add message extraction command to the client
  • the second receiving module is configured to receive information about the external clock source sent by the client.
  • the embodiment of the invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the foregoing clock synchronization method.
  • the time synchronization method, the server, and the system and the computer storage medium provided by the embodiments of the present invention perform time synchronization with the external clock source through the server, acquire information of the external clock source, and integrate and integrate the information of the external clock source into the precise
  • the PTP packet is sent to the client, so that the client synchronizes with the server and demodulates the external clock source. information.
  • the client can provide more detailed synchronization information, so that when the external clock source fails, the client can flexibly convert the clock policy to avoid possible occurrence.
  • the adverse consequences which improve the stability of the system.
  • FIG. 1 is a schematic flow chart of an embodiment of a time synchronization method according to the present invention.
  • FIG. 2 is a schematic diagram of a refinement process of forming a PTP-added packet by integrating the information of the external clock source into a PTP packet of the precise time synchronization protocol;
  • FIG. 3 is a schematic diagram of a refinement process of calculating the quality value of the external clock source according to the number of satellites and the signal-to-noise ratio when the antenna feed state of the external clock source is normal in the step of FIG. 2;
  • FIG. 4 is a schematic diagram of functional modules of an embodiment of a server according to the present invention.
  • FIG. 5 is a schematic diagram of a refinement function module of the packaging module in FIG. 4;
  • FIG. 6 is a schematic diagram of a refinement function module of the computing unit in FIG. 5;
  • FIG. 7 is a schematic diagram of functional modules of an embodiment of the system of the present invention.
  • FIG. 8 is a schematic diagram of a refinement function module of the client in FIG. 7;
  • FIG. 9 is a schematic diagram of functional modules of the remote end of FIG. 7;
  • Figure 10 is a network diagram of single-stage server synchronous transmission
  • FIG. 11 is a network diagram of synchronous transmission of a multi-level server.
  • An embodiment of the present invention provides a time synchronization method.
  • the time synchronization method includes the following steps:
  • the external clock source includes a GPS, a Beidou, and an atomic clock.
  • the information of the external clock source includes the number of satellites searched by the server, the number of locked satellites, the signal to noise ratio, and the antenna feed status.
  • the satellite quality field and other information, taking the atomic clock as an example, the information of the external clock source includes information such as signal-to-noise ratio and antenna feed status.
  • Step S20 the information of the external clock source is integrated and packaged into a PTP packet of a precise time synchronization protocol to form a PTP add message.
  • the remote maintenance tool can be used to monitor the information status of the external clock source of the server, thereby improving the maintenance efficiency of the IEEE 1588 clock synchronization.
  • the satellite number field is used to indicate the number of satellites and locked satellites found by the 1588 server. number. Use hexadecimal notation, where the high byte indicates the number of locks and the low byte indicates the number of stars. For example: 0x0407 means that 7 satellites were found, and the locked satellites are 4.
  • the SNR field is used to indicate the satellite quality used by the 1588 server, and the 1588 server averages the SNR values of all locked satellites.
  • the antenna feed status of the clock source is divided into normal, open and short circuits, which are represented by numbers 0, 1, and 2.
  • Step S30 Send the PTP add message to the client, so that the client performs time synchronization with the server, and demodulates the information of the external clock source.
  • the client is preferably a base station. Of course, in other embodiments, the client may also be other network devices.
  • the client communicates with the 1588v2 server through PTP packets.
  • the PTP packet type is preferably an Announce message describing the time source capability. Of other embodiments, other types may be selected.
  • the PTP-added packet can be sent to the client through the multi-level server to send the PTP-added packet to the client, and the third-level server is taken as an example.
  • the specific process is as follows:
  • the first level server synchronizes time with an external clock source, and obtains information about the external clock source;
  • the first level server integrates the information of the external clock source into a precise time synchronization protocol (PTP) packet to form a first PTP add message.
  • PTP time synchronization protocol
  • the first level server sends the first PTP add message to the second level server
  • the second-level server adds the received first PTP-added packet to the PTP packet of the sending end to form a second PTP-added packet.
  • the second level server sends the second PTP add message to the third level server
  • the third-level server sends the third PTP add message to the client, so that the client performs time synchronization with the server, and demodulates the information of the external clock source.
  • the PTP-added packets are transparently transmitted in the network, and the external time sources can be synchronized without using external external time sources.
  • the step S20 includes:
  • Step S201 when the antenna feed state of the external clock source is normal, calculate the quality value of the external clock source according to the satellite number and the signal to noise ratio;
  • the quality value of the external clock source is obtained by the number of satellites that are actually locked and the signal-to-noise ratio. In other embodiments, the number of satellites to be searched, the number of satellites to be locked, and The quality value is calculated from one or more information such as the signal to noise ratio.
  • Step S202 Add the quality value of the external clock source to the PTP packet to form a PTP add packet.
  • the message format of the PTP added packet is constructed, as shown in Table 1:
  • Tlv Type is represented by the ORGANIZATION_EXTENSION value 0003 specified by the IEEE1588 protocol, which occupies 2 bytes;
  • Length Field indicates the length of the entire extended field
  • the Organization ID and Organization SubType are vendor IDs and subtypes, each occupying 3 bytes;
  • the Data part is the satellite number field, the signal to noise ratio field, the antenna feed status, and the quality field.
  • the specific division is shown in Table 2:
  • Origin Timestamp is defined as a timestamp when the value is 0 or the precision is ⁇ 1 ns;
  • Grandmaster Priority1/2 represents the user-defined Grandmaster priority 1/2
  • Grandmaster Clock Quality is defined as the time quality level of the Grandmaster
  • Grandmaster Identity is defined as the clock device ID of the Grandmaster
  • Steps Removed is defined as the number of clock path hops between the Grandmaster and the slave device
  • Time Source is defined as the time source type
  • Tlv is a new extension field that occupies 15 bytes.
  • the data set of the PTP added message is constructed. Since the value of the Time Source is from the value of the TimeSource element in the time characteristic data set (Time Properties DS), the satellite number field is also added in the time characteristic data set. , signal to noise ratio, antenna feed status, and quality fields.
  • the initial values of the Time Properties DS satellite number are selected as follows:
  • the initial value of the satellite number is the actual satellite value, including the number of satellites searched and the number of satellites locked, otherwise the initial value is null NULL.
  • the initial values of the Time Properties DS signal to noise ratio are selected as follows:
  • the initial value of the SNR is the actual value, otherwise the initial value is NULL.
  • the initial values of the Time Properties DS antenna feed state are selected as follows:
  • the initial value of the antenna feed state is the actual state value, otherwise the initial value is NULL.
  • the initial values of the Time Properties DS quality values are selected as follows:
  • the initial value of the quality of the time source is the actual value, otherwise the initial value is NULL.
  • the step S201 includes:
  • Step S2011 comparing the number of locked satellites with a predetermined number of satellites and a magnitude relationship between a signal to noise ratio and a predetermined signal to noise ratio when the antenna feed state of the external clock source is normal;
  • Step S2012 when the number of locked satellites is greater than or equal to the predetermined number of satellites and the signal to noise ratio is greater than the predetermined signal to noise ratio, the quality value of the external clock source is calculated as a first value;
  • the calculated quality value is 0x01, indicating the external clock.
  • the quality of the source is good;
  • Step S2013 when the number of locked satellites is greater than the predetermined number of satellites and the signal to noise ratio is less than the predetermined signal to noise ratio, calculating that the quality value of the external clock source is a second value;
  • the calculated quality value is 0x02, indicating that the quality is poor;
  • Step S2014 when the number of locked satellites is less than the predetermined number of satellites and the signal to noise ratio is greater than the predetermined signal to noise ratio, calculating that the quality value of the external clock source is a third value;
  • step S2015 when the number of locked satellites is less than the predetermined number of satellites and the signal to noise ratio is less than the predetermined signal to noise ratio, the quality value of the external clock source is calculated to be a fourth value.
  • the calculated quality value is 0x04, indicating that the quality is unavailable.
  • the number of satellites that are predetermined to be locked is four, three of which are used to determine the longitude, latitude, and altitude of the location, and the other is used to determine the time information, it being understood that in other embodiments, at the location If the longitude, latitude, and altitude have been determined, only one satellite can be locked according to actual needs.
  • the embodiment of the invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the foregoing clock synchronization method.
  • the present invention also provides a server 100.
  • the server 100 includes:
  • the information obtaining module 10 is configured to perform time synchronization between the server and the external clock source, and obtain information about the external clock source.
  • the external clock source includes a GPS, a Beidou, and an atomic clock.
  • the information of the external clock source includes the number of satellites searched by the server 100, the number of locked satellites, the signal to noise ratio, and the antenna feeding state.
  • the satellite quality field and other information taking the atomic clock as an example, the information of the external clock source includes information such as signal-to-noise ratio and antenna feed status.
  • the packetizing module 20 is configured to integrate the information of the external clock source into a PTP packet of a precise time synchronization protocol to form a PTP add message.
  • the IEEE 1588 this preferred implementation is the version IEEE 1588v2 protocol
  • TLV type-length-value
  • information about the external clock source is added for the PTP message in the 1588 protocol.
  • Fields such as satellite number field, signal to noise ratio, antenna feed status, and quality
  • the quantity field or the like indicates the satellite quality condition.
  • the satellite number field is used to indicate the number of satellites found by the 1588 server and the number of satellites locked. Use hexadecimal notation, where the high byte indicates the number of locks and the low byte indicates the number of stars. For example: 0x0407 means that 7 satellites were found, and the locked satellites are 4.
  • the SNR field is used to indicate the satellite quality used by the 1588 server, and the 1588 server averages the SNR values of all locked satellites.
  • the antenna feed status of the clock source is divided into three types: normal, open, and short, which are represented by 0, 1, and 2.
  • the Quality field is used to indicate the quality of the satellite used by the 1588 server, which is calculated from the number of locked satellites and the signal to noise ratio.
  • the first sending module 30 is configured to send the PTP add message to the client, so that the client synchronizes with the server 100 and demodulates the information of the external clock source.
  • the client is preferably a base station. Of course, in other embodiments, the client may also be other network devices.
  • the client communicates with the 1588v2 server through PTP packets.
  • the PTP packet type is preferably an Announce message describing the time source capability. Of other embodiments, other types may be selected.
  • the PTP-added packet can be sent to the client through the multi-level server to send the PTP-added packet to the client, and the third-level server is taken as an example.
  • the specific process is as follows:
  • the first level server synchronizes time with an external clock source, and obtains information about the external clock source;
  • the first level server integrates the information of the external clock source into a precise time synchronization protocol (PTP) packet to form a first PTP add message.
  • PTP time synchronization protocol
  • the first level server sends the first PTP add message to the second level server
  • the second-level server adds the received first PTP add message to itself to send A second PTP add message is formed in the PTP packet of the terminal.
  • the second level server sends the second PTP add message to the third level server
  • the third-level server adds the received second PTP add message to the PTP packet of the sending end to form a third PTP add message.
  • the third-level server sends the third PTP add message to the client, so that the client performs time synchronization with the server, and demodulates the information of the external clock source.
  • the PTP-added packets are transparently transmitted in the network, and the external time sources can be synchronized without using external external time sources.
  • the server 100 obtained by the embodiment of the present invention obtains the information of the external clock source by time synchronization with an external clock source, and integrates the information of the external clock source into a precise time synchronization protocol PTP packet to form a PTP addition.
  • the PTP add message is sent to the client, so that the client synchronizes with the server 100 and demodulates the information of the external clock source.
  • the client is provided with more detailed synchronization information, so that when the external clock source fails, the client can flexibly convert the clock policy to avoid the possibility.
  • the adverse consequences of the increase have increased the stability of the system.
  • the packaging module 20 includes:
  • the calculating unit 201 is configured to calculate, according to the locked satellite number and the signal to noise ratio, the quality value of the external clock source when the antenna feed state of the external clock source is normal;
  • the quality value of the external clock source is obtained by the number of satellites that are actually locked and the signal-to-noise ratio. In other embodiments, the number of satellites to be searched, the number of satellites to be locked, and The quality value is calculated from one or more information such as the signal to noise ratio.
  • the packetizing unit 202 is configured to add the quality value of the external clock source to the PTP packet to form a PTP add message.
  • the PTP add message includes a header, a body, and an extension field, and the extension field is a type/length/value TLV format.
  • the message format of the PTP added packet is constructed, as shown in Table 1:
  • Tlv Type is represented by the ORGANIZATION_EXTENSION value 0003 specified by the IEEE1588 protocol, which occupies 2 bytes;
  • Length Field indicates the length of the entire extended field
  • the Organization ID and Organization SubType are vendor IDs and subtypes, each occupying 3 bytes;
  • the Data part is the satellite number field, the signal to noise ratio field, the antenna feed status, and the quality field.
  • the specific division is shown in Table 2:
  • Origin Timestamp is defined as a timestamp when the value is 0 or the precision is ⁇ 1 ns;
  • Grandmaster Priority1/2 represents the user-defined Grandmaster priority 1/2
  • Grandmaster Clock Quality is defined as the time quality level of the Grandmaster
  • Grandmaster Identity is defined as the clock device ID of the Grandmaster
  • Steps Removed is defined as the number of clock path hops between the Grandmaster and the slave device
  • Time Source is defined as the time source type
  • Tlv is a new extension field that occupies 15 bytes.
  • the data set of the PTP added message is constructed. Since the value of the Time Source is from the value of the TimeSource element in the time characteristic data set (Time Properties DS), the satellite number field is also added in the time characteristic data set. , signal to noise ratio, antenna feed status, and quality fields.
  • the initial values of the Time Properties DS satellite number are selected as follows:
  • the initial value of the satellite number is the actual satellite value, including the number of satellites searched and the number of satellites locked, otherwise the initial value is NULL.
  • the initial values of the Time Properties DS signal to noise ratio are selected as follows:
  • the initial value of the SNR is the actual value, otherwise the initial value is NULL.
  • the initial values of the Time Properties DS antenna feed state are selected as follows:
  • the initial values of the Time Properties DS quality values are selected as follows:
  • the calculating unit 201 includes:
  • the comparison subunit 2011 is configured to compare the number of locked satellites with a predetermined number of satellites and a magnitude relationship between a signal to noise ratio and a predetermined signal to noise ratio when the antenna feed state of the external clock source is normal;
  • the first subunit 2012 is configured to calculate, when the number of locked satellites is greater than or equal to the predetermined number of satellites, and the signal to noise ratio is greater than the predetermined signal to noise ratio, calculate a quality value of the external clock source.
  • the calculated quality value is 0x01, indicating the external clock.
  • the quality of the source is good;
  • the second subunit 2013 is configured to calculate that the quality value of the external clock source is the second value when the number of locked satellites is greater than the predetermined number of satellites and the signal to noise ratio is less than the predetermined signal to noise ratio. ;
  • the third subunit 2014 is configured to calculate that the quality value of the external clock source is a third value when the number of locked satellites is less than the predetermined number of satellites and the signal to noise ratio is greater than the predetermined signal to noise ratio. ;
  • the calculated quality value is 0x03, indicating that the quality is poor;
  • the fourth subunit 2015 is configured to calculate that the quality value of the external clock source is the fourth value when the number of locked satellites is less than the predetermined number of satellites and the signal to noise ratio is less than the predetermined signal to noise ratio. .
  • the calculated quality value is 0x04, indicating that the quality is unavailable.
  • the number of satellites that are predetermined to be locked is four, three of which are used to determine the longitude, latitude, and altitude of the location, and the other is used to determine the time information, it being understood that in other embodiments, at the location If the longitude, latitude, and altitude have been determined, only one satellite can be locked according to actual needs.
  • the client 200 includes:
  • the client 200 is preferably a base station.
  • the client 200 can also be other network devices.
  • the PTP packet type is preferably an Announce message describing the time source capability. Of other embodiments, other types may be selected.
  • the parsing module 202 is configured to add the PTP according to the PTP add message extraction command Adding a message for parsing to obtain information of the external clock source;
  • the second sending module 203 is configured to send the parsed information of the external clock source to the remote end 300.
  • the second receiving module 302 is configured to receive information about the external clock source sent by the client 200.
  • the client 200 communicates with the multi-level 1588v2 server through the PTP message, and the first server generates the first PTP add message by using the information of the external clock source.
  • the second-level server adds the received first PTP-added packet to the PTP packet of the sending end of the device, and forms a second PTP-added packet, the second-level server.
  • sending the second PTP add message to the third level server where the third level server adds the received second PTP add message to the PTP message of the sending end to form a third PTP add report.
  • the third server sends the third PTP add message to the second switch, and the second switch exchanges the packet to the client 200, and the client 200 performs demodulation to obtain the After the external clock source information is externally, the external clock source information is transmitted to the remote end 300 via the switch.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Abstract

本发明公开了一种时间同步方法,包括:服务器与外接时钟源进行时间同步,并获取所述外接时钟源的信息;将所述外接时钟源的信息整合打包到精确时间同步协议PTP报文中,形成PTP添加报文;将所述PTP添加报文发送至客户端,以使所述客户端与所述服务器进行时间同步,并解调出所述外接时钟源的信息。本发明还公开了一种服务器、系统及计算机存储介质。

Description

时间同步方法、服务器及系统、存储介质 技术领域
本发明涉及通讯技术领域,尤其涉及一种时间同步方法、服务器以及系统和计算机存储介质。
背景技术
IEEE1588(网络测量和控制系统的精密时钟同步协议标准)时钟是通过软硬件结合将网络中的客户端的时钟与服务器的时钟实现同步,提供同步建立时间小于10μs的以太网定时同步方式。它作为一种主从同步系统,客户端的从时钟完全同步于服务器的主时钟,在系统的同步过程中,主时钟周期性发布PTP(Precision Time Synchronization Protocol,精确时间同步协议)及时间信息,从时钟端口接收主时钟端口发来的时间戳信息,系统据此计算出主从线路时间延迟及主从时间差,并利用该时间差调整本地时间,使客户端的时间与服务器的时间保持一致的频率与相位。
服务器为了能够提供高质量的时钟输出,通常需要外接高精度时钟源如GPS(Global Positioning System,全球定位系统)、北斗以及原子钟等予以支持,通过利用服务器的主时钟与外界高精度时钟进行同步,来达到高质量的时钟输出要求。但由于服务器发布的PTP报文中并没有主时钟同步的外接高精度时钟的具体信息,客户端无法确定服务器外接的高精度时钟的状态,使得从时钟无法知晓外接时钟出现的问题,从而导致整个同步网络系统可能出现异常。
上述内容仅用于辅助理解本发明的技术方案,并不代表承认上述内容是现有技术。
发明内容
为解决现有存在的技术问题,本发明实施例在于提供一种时间同步方法、服务器以及系统和计算机存储介质,旨在基于IEEE1588协议,在PTP报文中添加与服务器连接的外接时钟源信息,为客户端提供了更详细的同步信息,避免了外接时钟源故障导致的不良后果,从而提高了系统的稳定性。
本发明实施例提供的一种时间同步方法,所述方法包括:
服务器与外接时钟源进行时间同步,并获取所述外接时钟源的信息;
将所述外接时钟源的信息整合打包到精确时间同步协议PTP报文中,形成PTP添加报文;
将所述PTP添加报文发送至客户端,以使所述客户端与所述服务器进行时间同步,并解调出所述外接时钟源的信息。
上述方案中,所述外接时钟源的信息包括所述服务器卫星数字段、信噪比字段、天馈状态以及质量字段。
上述方案中,所述将所述外接时钟源的信息整合打包到PTP报文中,形成PTP添加报文,包括:
在所述外接时钟源的天馈状态正常时,根据所述卫星数以及信噪比,计算出所述外接时钟源的质量值;
将所述外接时钟源的卫星数、信噪比、天馈状态以及质量值打包添加到PTP报文中,形成PTP添加报文。
上述方案中,所述卫星数包括所述服务器搜索到的卫星数和锁定的卫星数,所述在所述外接时钟源的天馈状态正常时,根据所述卫星数以及信噪比,计算出所述外接时钟源的质量值,包括:
在所述外接时钟源的天馈状态正常时,比较所述锁定的卫星数与预定卫星数以及信噪比与预定信噪比的大小关系;
在所述锁定的卫星数大于或等于所述预定卫星数且所述信噪比大于所述预定信噪比时,计算得到所述外接时钟源的质量值为第一值;
在所述锁定的卫星数大于所述预定卫星数且所述信噪比小于所述预定信噪比时,计算得到所述外接时钟源的质量值为第二值;
在所述锁定的卫星数小于所述预定卫星数且所述信噪比大于所述预定信噪比时,计算得到所述外接时钟源的质量值为第三值;
在所述锁定的卫星数小于所述预定卫星数且所述信噪比小于所述预定信噪比时,计算得到所述外接时钟源的质量值为第四值。
上述方案中,所述PTP添加报文包括头部、主体以及扩展字段,所述扩展字段为类型/长度/值TLV格式。
本发明实施例还提出一种服务器,所述服务器包括:
信息获取模块,配置为服务器与外接时钟源进行时间同步,并获取所述外接时钟源的信息;
打包模块,配置为将所述外接时钟源的信息整合打包到精确时间同步协议PTP报文中,形成PTP添加报文;
第一发送模块,配置为将所述PTP添加报文发送至客户端,以使所述客户端与所述服务器进行时间同步,并解调出所述外接时钟源的信息。
上述方案中,所述外接时钟源的信息包括所述服务器卫星数字段、信噪比字段、天馈状态以及质量字段。
上述方案中,所述打包模块包括:
计算单元,配置为在所述外接时钟源的天馈状态正常时,根据所述卫星数以及信噪比,计算出所述外接时钟源的质量值;
打包单元,配置为将所述外接时钟源的卫星数、信噪比、天馈状态以及质量值打包添加到PTP报文中,形成PTP添加报文。
上述方案中,所述卫星数包括所述服务器搜索到的卫星数和锁定的卫 星数,所述计算单元包括:
比较子单元,配置为在所述外接时钟源的天馈状态正常时,比较所述锁定的卫星数与预定卫星数以及信噪比与预定信噪比的大小关系;
第一子单元,配置为在所述锁定的卫星数大于或等于所述预定卫星数且所述信噪比大于所述预定信噪比时,计算得到所述外接时钟源的质量值为第一值;
第二子单元,配置为在所述锁定的卫星数大于所述预定卫星数且所述信噪比小于所述预定信噪比时,计算得到所述外接时钟源的质量值为第二值;
第三子单元,配置为在所述锁定的卫星数小于所述预定卫星数且所述信噪比大于所述预定信噪比时,计算得到所述外接时钟源的质量值为第三值;
第四子单元,配置为在所述锁定的卫星数小于所述预定卫星数且所述信噪比小于所述预定信噪比时,计算得到所述外接时钟源的质量值为第四值。
上述方案中,所述PTP添加报文包括头部、主体以及扩展字段,所述扩展字段为类型/长度/值TLV格式。
此外,本发明实施例还提出一种系统,所述系统包括客户端、远程端以及如上所述的服务器,
所述客户端包括:
第一接收模块,配置为接收所述服务器发送的PTP添加报文以及所述远程端发送的PTP添加报文提取命令;
解析模块,配置为根据所述PTP添加报文提取命令,将所述PTP添加报文进行解析,以得到所述外接时钟源的信息;
第二发送模块,配置为将解析得到的所述外接时钟源的信息发送至所 述远程端。
所述远程端包括:
请求模块,配置为向所述客户端发送所述PTP添加报文提取命令;
第二接收模块,配置为接收所述客户端发送的所述外接时钟源的信息。
本发明实施例还提供了一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行前述的时钟同步方法。
本发明实施例提供的时间同步方法、服务器以及系统和计算机存储介质,通过服务器与外接时钟源进行时间同步,获取所述外接时钟源的信息,在将所述外接时钟源的信息整合打包到精确时间同步协议PTP报文中形成PTP添加报文后,将所述PTP添加报文发送至客户端,以使所述客户端与所述服务器进行时间同步,并解调出所述外接时钟源的信息。这样,通过在PTP报文中添加与服务器连接的外接时钟源信息,为客户端提供更详细的同步信息,使得外接时钟源在出现故障时,可以方便客户端灵活转换时钟策略,以避免可能出现的不良后果,从而提高了系统的稳定性。
附图说明
图1为本发明时间同步方法一实施例的流程示意图;
图2为图1中步骤将所述外接时钟源的信息整合打包到精确时间同步协议PTP报文中,形成PTP添加报文的细化流程示意图;
图3为图2中步骤在所述外接时钟源的天馈状态正常时,根据所述卫星数以及信噪比,计算出所述外接时钟源的质量值的细化流程示意图;
图4为本发明服务器一实施例的功能模块示意图;
图5为图4中打包模块的细化功能模块示意图;
图6为图5中计算单元的细化功能模块示意图;
图7为本发明系统一实施例的功能模块示意图;
图8为图7中客户端的细化功能模块示意图;
图9为图7中远程端的功能模块示意图;
图10为单级服务器同步传输组网图;
图11为多级服务器同步传输组网图。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
本发明实施例提供一种时间同步方法,参照图1,在一实施例中,所述时间同步方法包括以下步骤:
步骤S10,服务器与外接时钟源进行时间同步,并获取所述外接时钟源的信息;
本实施例中,外接时钟源包括GPS、北斗以及原子钟等,以GPS和北斗为例,外接时钟源的信息包括所述服务器搜索的卫星数、锁定的卫星数、信噪比、天馈状态以及卫星质量字段等信息,以原子钟为例,外接时钟源的信息包括信噪比以及天馈状态等信息。
步骤S20,将所述外接时钟源的信息整合打包到精确时间同步协议PTP报文中,形成PTP添加报文;
本实施例中,根据IEEE 1588(本优选实施为版本IEEE 1588v2)协议的描述,在遵循TLV(类型-长度-值)的情况下,通过为IEEE 1588协议中PTP报文添加有关外接时钟源的信息字段如卫星数字段、信噪比、天馈状态以及质量字段等来表示卫星质量状况,如此,可通过远程维护工具来监控服务器外接时钟源的信息状态,从而提高IEEE 1588时钟同步的维护效率。
具体地,卫星数字段用来表示1588服务器搜到的卫星数和锁定的卫星 数。使用十六进制表示,其中高位字节表示锁定数,低位字节表示搜星数。比如:0x0407表示搜到7颗卫星,锁定卫星是4颗。信噪比字段用来表示1588服务器所使用的卫星质量,1588服务器将所有锁定的卫星的SNR值求平均值。
时钟源的天馈状态分为正常、开路和短路三种,分别用数字0、1和2表示。
质量字段是用来表示1588服务器所使用的卫星质量,该值是通过锁定的卫星数和信噪比计算得出。
步骤S30,将所述PTP添加报文发送至客户端,以使所述客户端与所述服务器进行时间同步,并解调出所述外接时钟源的信息。
本实施例中,所述客户端优选为基站。当然,在其他实施例中,所述客户端也可以为其他网络设备。客户端与1588v2服务器是通过PTP报文进行通信的。本优选实施例中,所述PTP报文类型优选为描述时间源能力的Announce报文,当然在其他实施例中,也可以选择其他类型。
可以理解的是,在其他实施例中,也可以通过多级服务器对PTP添加报文的传递,来将所述PTP添加报文发送至客户端,以三级服务器为例,具体过程如下:
第一级服务器与外接时钟源进行时间同步,并获取所述外接时钟源的信息;
所述第一级服务器将所述外接时钟源的信息整合打包到精确时间同步协议PTP报文中,形成第一PTP添加报文;
所述第一级服务器将所述第一PTP添加报文发送至第二级服务器;
所述第二级服务器将接收到的所述第一PTP添加报文添加到自身发送端的PTP报文中,形成第二PTP添加报文;
所述第二级服务器将所述第二PTP添加报文发送至第三级服务器;
所述第三级服务器将接收到的所述第二PTP添加报文添加到自身发送端的PTP报文中,形成第三PTP添加报文;
所述第三级服务器将所述第三PTP添加报文发送至客户端,以使所述客户端与所述服务器进行时间同步,并解调出所述外接时钟源的信息。
这样,通过多级服务器的串联,使PTP添加报文在网络中进行透传,可以不用外接多个外接时间源,实现不同局域网之间时间的同步。
本发明实施例提供的时间同步方法,通过服务器与外接时钟源进行时间同步,获取所述外接时钟源的信息,在将所述外接时钟源的信息整合打包到精确时间同步协议PTP报文中形成PTP添加报文后,将所述PTP添加报文发送至客户端,以使所述客户端与所述服务器进行时间同步,并解调出所述外接时钟源的信息。这样,通过在PTP报文中添加与服务器连接的外接时钟源信息,为客户端提供更详细的同步信息,使得外接时钟源在出现故障时,可以方便客户端灵活转换时钟策略,以避免可能出现的不良后果,从而提高了系统的稳定性。
在一个优选的实施例中,如图2所示,在上述图1的实施例的基础上,本实施例中,所述步骤S20包括:
步骤S201,在所述外接时钟源的天馈状态正常时,根据所述卫星数以及信噪比,计算出所述外接时钟源的质量值;
本优选实施例中,所述外接时钟源的质量值即为质量字段通过实际锁定的卫星数以及信噪比得到,在其他实施例中,也可以具体根据搜索的卫星数、锁定的卫星数、信噪比等一个或多个信息计算得到质量值。
步骤S202,将所述外接时钟源的质量值打包添加到PTP报文中,形成PTP添加报文。
本实施例中,PTP添加报文包括头部、主体以及扩展字段,所述扩展字段为类型/长度/值TLV格式。
本实施例中,构造所述PTP添加报文的消息格式,见表一:
1、IEEE1588协议规定的供应商与标准组织的可扩展格式为:
Figure PCTCN2015094887-appb-000001
表一
其中:Tlv Type使用IEEE1588协议规定的ORGANIZATION_EXTENSION值0003来表示,占用2个字节;
Length Field表示整个扩展字段的长度;
Organization ID和Organization SubType为供应商ID和子类型,分别占用3个字节;
Data部分为卫星数字段、信噪比字段、天馈状态和质量字段。具体划分如表二:
Figure PCTCN2015094887-appb-000002
表二
2、增加扩展字段后的PTP添加报文格式,参见表三:
Figure PCTCN2015094887-appb-000003
Figure PCTCN2015094887-appb-000004
表三
其中,Origin Timestamp定义为数值为0或精度为±1ns时的时间戳;
Current UTC Offset定义为UTC与TAIl时间标尺间的闰秒时间差;
Grandmaster Priority1/2表示用户定义的Grandmaster优先级1/2;
Grandmaster Clock Quality定义为的Grandmaster的时间质量级别;
Grandmaster Identity定义为Grandmaster的时钟设备ID;
Steps Removed定义为Grandmaster与Slave设备间的时钟路径跳数;
Time Source定义为时间源类型;
Tlv为新增的扩展字段,占用15个字节。
本实施例中,构造所述PTP添加报文的数据集,由于Time Source的值来自时间特性数据集(Time Properties DS)中TimeSource元素的值,因此,在时间特性数据集中也增加如卫星数字段、信噪比、天馈状态以及质量字段等。
Time Properties DS卫星数的初始值选择如下:
如果外接时间源在初始化时是已知的,则卫星数的初始值就是实际的卫星数值,包括搜索到的卫星数以及锁定的卫星数,否则初始值为空NULL。
Time Properties DS信噪比的初始值选择如下:
如果外接时间源在初始化时是已知的,则信噪比的初始值就是实际的值,否则初始值为NULL。
Time Properties DS天馈状态的初始值的选择如下:
如果外接时间源在初始化时是已知的,则天馈状态的初始值就是实际的状态值,否则初始值为NULL。
Time Properties DS质量值的初始值选择如下:
如果外接时间源在初始化时是已知的,则时间源的质量初始值就是实际的值,否则初始值为NULL。
在一个优选的实施例中,如图3所示,在上述图2的实施例的基础上,本实施例中,所述步骤S201包括:
步骤S2011,在所述外接时钟源的天馈状态正常时,比较所述锁定的卫星数与预定卫星数以及信噪比与预定信噪比的大小关系;
步骤S2012,在所述锁定的卫星数大于或等于所述预定卫星数且所述信噪比大于所述预定信噪比时,计算得到所述外接时钟源的质量值为第一值;
本实施例中,当所述锁定的卫星数大于等于预定值如4且所述信噪比大于预定信噪比值如30dBm(分贝毫瓦),计算得到的质量值为0x01,表示该外接时钟源的质量为好;
步骤S2013,在所述锁定的卫星数大于所述预定卫星数且所述信噪比小于所述预定信噪比时,计算得到所述外接时钟源的质量值为第二值;
本实施例中,当所述锁定卫星数大于预定值如4且信噪比小于预定信噪比值如30dbm,计算得到的质量值为为0x02,表示质量为差;
步骤S2014,在所述锁定的卫星数小于所述预定卫星数且所述信噪比大于所述预定信噪比时,计算得到所述外接时钟源的质量值为第三值;
本实施例中,在所述锁定的卫星数小于预定值如4且信噪比大于预定信 噪比值如30dbm,计算得到的质量值为0x03,表示质量为差;
步骤S2015,在所述锁定的卫星数小于所述预定卫星数且所述信噪比小于所述预定信噪比时,计算得到所述外接时钟源的质量值为第四值。
本实施例中,在所述锁定的卫星数小于预定值如4且信噪比小于预定信噪比值如30dbm,计算得到的质量值为0x04,表示质量为不可用。
本优选实施例中,预定锁定的卫星数为4个,其中三个用于确定位置的经度、纬度、高度,另一个用于确定时间信息,可以理解的是,在其他实施例中,在位置的经度、纬度、高度已经确定的情况下,也可以根据实际需要只锁定一颗卫星。
本发明实施例还提供了一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行前述的时钟同步方法。
本发明还提供一种服务器100,参照图4,在一实施例中,所述服务器100包括:
信息获取模块10,配置为服务器与外接时钟源进行时间同步,并获取所述外接时钟源的信息;
本实施例中,外接时钟源包括GPS、北斗以及原子钟等,以GPS和北斗为例,外接时钟源的信息包括所述服务器100搜索的卫星数、锁定的卫星数、信噪比、天馈状态以及卫星质量字段等信息,以原子钟为例,外接时钟源的信息包括信噪比以及天馈状态等信息。
打包模块20,配置为将所述外接时钟源的信息整合打包到精确时间同步协议PTP报文中,形成PTP添加报文;
本实施例中,根据IEEE 1588(本优选实施为版本IEEE 1588v2)协议的描述,在遵循TLV(类型-长度-值)的情况下,通过为1588协议中PTP报文添加有关外接时钟源的信息字段如卫星数字段、信噪比、天馈状态以及质 量字段等来表示卫星质量状况,如此,可通过远程维护工具来监控服务器100外接时钟源的信息状态,从而提高IEEE 1588时钟同步的维护效率。
具体地,卫星数字段用来表示1588服务器搜到的卫星数和锁定的卫星数。使用十六进制表示,其中高位字节表示锁定数,低位字节表示搜星数。比如:0x0407表示搜到7颗卫星,锁定卫星是4颗。信噪比字段用来表示1588服务器所使用的卫星质量,1588服务器将所有锁定的卫星的SNR值求平均值。
时钟源的天馈状态分为正常、开路和短路三种,分别用0、1和2表示。
质量字段是用来表示1588服务器所使用的卫星质量,该值是通过锁定的卫星数和信噪比计算得出。
第一发送模块30,配置为将所述PTP添加报文发送至客户端,以使所述客户端与所述服务器100进行时间同步,并解调出所述外接时钟源的信息。
本实施例中,所述客户端优选为基站。当然,在其他实施例中,所述客户端也可以为其他网络设备。客户端与1588v2服务器是通过PTP报文进行通信的。本优选实施例中,所述PTP报文类型优选为描述时间源能力的Announce报文,当然在其他实施例中,也可以选择其他类型。
可以理解的是,在其他实施例中,也可以通过多级服务器对PTP添加报文的传递,来将所述PTP添加报文发送至客户端,以三级服务器为例,具体过程如下:
第一级服务器与外接时钟源进行时间同步,并获取所述外接时钟源的信息;
所述第一级服务器将所述外接时钟源的信息整合打包到精确时间同步协议PTP报文中,形成第一PTP添加报文;
所述第一级服务器将所述第一PTP添加报文发送至第二级服务器;
所述第二级服务器将接收到的所述第一PTP添加报文添加到自身发送 端的PTP报文中,形成第二PTP添加报文;
所述第二级服务器将所述第二PTP添加报文发送至第三级服务器;
所述第三级服务器将接收到的所述第二PTP添加报文添加到自身发送端的PTP报文中,形成第三PTP添加报文;
所述第三级服务器将所述第三PTP添加报文发送至客户端,以使所述客户端与所述服务器进行时间同步,并解调出所述外接时钟源的信息。
这样,通过多级服务器的串联,使PTP添加报文在网络中进行透传,可以不用外接多个外接时间源,实现不同局域网之间时间的同步。
本发明实施例提供的服务器100,通过与外接时钟源进行时间同步,获取所述外接时钟源的信息,在将所述外接时钟源的信息整合打包到精确时间同步协议PTP报文中形成PTP添加报文后,将所述PTP添加报文发送至客户端,以使所述客户端与所述服务器100进行时间同步,并解调出所述外接时钟源的信息。这样,通过在PTP报文中添加与服务器100连接的外接时钟源信息,为客户端提供更详细的同步信息,使得外接时钟源在出现故障时,可以方便客户端灵活转换时钟策略,以避免可能出现的不良后果,从而提高了系统的稳定性。
在一个优选的实施例中,如图5所示,在上述图4的实施例的基础上,本实施例中,所述打包模块20包括:
计算单元201,配置为在所述外接时钟源的天馈状态正常时,根据所述锁定的卫星数以及信噪比,计算出所述外接时钟源的质量值;
本优选实施例中,所述外接时钟源的质量值即为质量字段通过实际锁定的卫星数以及信噪比得到,在其他实施例中,也可以具体根据搜索的卫星数、锁定的卫星数、信噪比等一个或多个信息计算得到质量值。
打包单元202,配置为将所述外接时钟源的质量值打包添加到PTP报文中,形成PTP添加报文。
本实施例中,PTP添加报文包括头部、主体以及扩展字段,所述扩展字段为类型/长度/值TLV格式。
本实施例中,构造所述PTP添加报文的消息格式,见表一:
1、IEEE1588协议规定的供应商与标准组织的可扩展格式为:
Figure PCTCN2015094887-appb-000005
表一
其中:Tlv Type使用IEEE1588协议规定的ORGANIZATION_EXTENSION值0003来表示,占用2个字节;
Length Field表示整个扩展字段的长度;
Organization ID和Organization SubType为供应商ID和子类型,分别占用3个字节;
Data部分为卫星数字段、信噪比字段、天馈状态和质量字段。具体划分如表二:
Figure PCTCN2015094887-appb-000006
表二
2、增加扩展字段后的PTP添加报文格式,参见表三:
Figure PCTCN2015094887-appb-000007
表三
其中,Origin Timestamp定义为数值为0或精度为±1ns时的时间戳;
Current UTC Offset定义为UTC与TAIl时间标尺间的闰秒时间差;
Grandmaster Priority1/2表示用户定义的Grandmaster优先级1/2;
Grandmaster Clock Quality定义为的Grandmaster的时间质量级别;
Grandmaster Identity定义为Grandmaster的时钟设备ID;
Steps Removed定义为Grandmaster与Slave设备间的时钟路径跳数;
Time Source定义为时间源类型;
Tlv为新增的扩展字段,占用15个字节。
本实施例中,构造所述PTP添加报文的数据集,由于Time Source的值来自时间特性数据集(Time Properties DS)中TimeSource元素的值,因此,在时间特性数据集中也增加如卫星数字段、信噪比、天馈状态以及质量字段等。
Time Properties DS卫星数的初始值选择如下:
如果外接时间源在初始化时是已知的,则卫星数的初始值就是实际的卫星数值,包括搜索到的卫星数以及锁定的卫星数,否则初始值为NULL。
Time Properties DS信噪比的初始值选择如下:
如果外接时间源在初始化时是已知的,则信噪比的初始值就是实际的值,否则初始值为NULL。
Time Properties DS天馈状态的初始值的选择如下:
如果外接时间源在初始化时是已知的,则天馈状态的初始值就是实际的状态值,否则初始值为NULL。
Time Properties DS质量值的初始值选择如下:
如果外接时间源在初始化时是已知的,则时间源的质量初始值就是实际的值,否则初始值为NULL。
在一个优选的实施例中,如图6所示,在上述图5的实施例的基础上,所述计算单元201包括:
比较子单元2011,配置为在所述外接时钟源的天馈状态正常时,比较所述锁定的卫星数与预定卫星数以及信噪比与预定信噪比的大小关系;
第一子单元2012,配置为在所述锁定的卫星数大于或等于所述预定卫星数且所述信噪比大于所述预定信噪比时,计算得到所述外接时钟源的质量值为第一值;
本实施例中,当所述锁定的卫星数大于等于预定值如4且所述信噪比大于预定信噪比值如30dBm(分贝毫瓦),计算得到的质量值为0x01,表示该外接时钟源的质量为好;
第二子单元2013,配置为在所述锁定的卫星数大于所述预定卫星数且所述信噪比小于所述预定信噪比时,计算得到所述外接时钟源的质量值为第二值;
本实施例中,当所述锁定卫星数大于预定值如4且信噪比小于预定信噪 比值如30dbm,计算得到的质量值为为0x02,表示质量为差;
第三子单元2014,配置为在所述锁定的卫星数小于所述预定卫星数且所述信噪比大于所述预定信噪比时,计算得到所述外接时钟源的质量值为第三值;
本实施例中,在所述锁定的卫星数小于预定值如4且信噪比大于预定信噪比值如30dbm,计算得到的质量值为0x03,表示质量为差;
第四子单元2015,配置为在所述锁定的卫星数小于所述预定卫星数且所述信噪比小于所述预定信噪比时,计算得到所述外接时钟源的质量值为第四值。
本实施例中,在所述锁定的卫星数小于预定值如4且信噪比小于预定信噪比值如30dbm,计算得到的质量值为0x04,表示质量为不可用。
本优选实施例中,预定锁定的卫星数为4个,其中三个用于确定位置的经度、纬度、高度,另一个用于确定时间信息,可以理解的是,在其他实施例中,在位置的经度、纬度、高度已经确定的情况下,也可以根据实际需要只锁定一颗卫星。
本发明还提供一种系统10,参照图7,在一实施例中,所述系统10包括客户端200、远程端300以及上述的服务器100,
参照图8,所述客户端200包括:
第一接收模块201,配置为接收所述服务器100发送的PTP添加报文以及所述远程端300发送的PTP添加报文提取命令;
本实施例中,所述客户端200优选为基站。当然,在其他实施例中,所述客户端200也可以为其他网络设备。本优选实施例中,所述PTP报文类型优选为描述时间源能力的Announce报文,当然在其他实施例中,也可以选择其他类型。
解析模块202,配置为根据所述PTP添加报文提取命令,将所述PTP添 加报文进行解析,以得到所述外接时钟源的信息;
本实施例中,所述客户端200在接收到所述PTP添加报文提取命令时,即对接收的所述PTP添加报文进行解析,从而得到所述外接时钟源的信息,如搜索的卫星数、锁定的卫星数、信噪比、天馈状态以及质量值等。
第二发送模块203,配置为将解析得到的所述外接时钟源的信息发送至所述远程端300。
本实施例中,所述客户端200将解析得到的所述外接时钟源的信息发送至所述远程端300,使得所述远程端300可以及时了解外接时钟源的状态,从而可以在外接时钟源出现故障时,能够灵活转换时钟策略,从而提高系统10的稳定性和维护效率。
参照图9,所述远程端300包括:
请求模块301,配置为向所述客户端200发送所述PTP添加报文提取命令;
第二接收模块302,配置为接收所述客户端200发送的所述外接时钟源的信息。
本优选实施例中,远程维护人员通过所述远程端300调用接口向所述客户端200如基站发出报文提取命令,从而获取客户端200发送的经解调得到的所述外接时钟源的信息,以便可以随时监控外接时钟源的状态,从而可以提高系统10的维护效率。
参照图10,以单级服务器同步传输为例,客户端200与1588v2服务器是通过PTP报文进行通信的,所述服务器100将所述外接时钟源的信息生成PTP添加报文后,将所述PTP添加报文发送至第一交换机,经所述第一交换机交换后传递至所述客户端200,经所述客户端200进行解调得到所述外接时钟源信息后,将所述外接时钟源信息经由第二交换机传递至所述远程端300。
参照图11,以多级服务器同步传输为例,客户端200与多级1588v2服务器是通过PTP报文进行通信的,所述第一服务器将所述外接时钟源的信息生成第一PTP添加报文后,发送至第二服务器,所述第二级服务器将接收到的所述第一PTP添加报文添加到自身发送端的PTP报文中,形成第二PTP添加报文,所述第二级服务器将所述第二PTP添加报文发送至第三级服务器,所述第三级服务器将接收到的所述第二PTP添加报文添加到自身发送端的PTP报文中,形成第三PTP添加报文,所述第三服务器将所述第三PTP添加报文发送至第二交换机,经所述第二交换机交换后传递至所述客户端200,经所述客户端200进行解调得到所述外接时钟源信息后,将所述外接时钟源信息经由所述交换机传递至所述远程端300。
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现 在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。
工业实用性
本发明实施例提供的时间同步方法、服务器以及系统和计算机存储介质,通过服务器与外接时钟源进行时间同步,获取所述外接时钟源的信息,在将所述外接时钟源的信息整合打包到精确时间同步协议PTP报文中形成PTP添加报文后,将所述PTP添加报文发送至客户端,以使所述客户端与所述服务器进行时间同步,并解调出所述外接时钟源的信息。这样,通过在PTP报文中添加与服务器连接的外接时钟源信息,为客户端提供更详细的同步信息,使得外接时钟源在出现故障时,可以方便客户端灵活转换时钟策略,以避免可能出现的不良后果,从而提高了系统的稳定性。

Claims (12)

  1. 一种时间同步方法,所述方法包括:
    服务器与外接时钟源进行时间同步,并获取所述外接时钟源的信息;
    将所述外接时钟源的信息整合打包到精确时间同步协议PTP报文中,形成PTP添加报文;
    将所述PTP添加报文发送至客户端,以使所述客户端与所述服务器进行时间同步,并解调出所述外接时钟源的信息。
  2. 根据权利要求1所述的时间同步方法,其中,所述外接时钟源的信息包括所述服务器卫星数字段、信噪比字段、天馈状态以及质量字段。
  3. 根据权利要求2所述的时间同步方法,其中,所述将所述外接时钟源的信息整合打包到PTP报文中,形成PTP添加报文,包括:
    在所述外接时钟源的天馈状态正常时,根据所述卫星数以及信噪比,计算出所述外接时钟源的质量值;
    将所述外接时钟源的卫星数、信噪比、天馈状态以及质量值打包添加到PTP报文中,形成PTP添加报文。
  4. 根据权利要求3所述的时间同步方法,其中,所述卫星数包括所述服务器搜索到的卫星数和锁定的卫星数,所述在所述外接时钟源的天馈状态正常时,根据所述卫星数以及信噪比,计算出所述外接时钟源的质量值,包括:
    在所述外接时钟源的天馈状态正常时,比较所述锁定的卫星数与预定卫星数以及信噪比与预定信噪比的大小关系;
    在所述锁定的卫星数大于或等于所述预定卫星数且所述信噪比大于所述预定信噪比时,计算得到所述外接时钟源的质量值为第一值;
    在所述锁定的卫星数大于所述预定卫星数且所述信噪比小于所述预定信噪比时,计算得到所述外接时钟源的质量值为第二值;
    在所述锁定的卫星数小于所述预定卫星数且所述信噪比大于所述预定信噪比时,计算得到所述外接时钟源的质量值为第三值;
    在所述锁定的卫星数小于所述预定卫星数且所述信噪比小于所述预定信噪比时,计算得到所述外接时钟源的质量值为第四值。
  5. 根据权利要求1所述的时间同步方法,其中,所述PTP添加报文包括头部、主体以及扩展字段,所述扩展字段为类型/长度/值TLV格式。
  6. 一种服务器,所述服务器包括:
    信息获取模块,配置为服务器与外接时钟源进行时间同步,并获取所述外接时钟源的信息;
    打包模块,配置为将所述外接时钟源的信息整合打包到精确时间同步协议PTP报文中,形成PTP添加报文;
    第一发送模块,配置为将所述PTP添加报文发送至客户端,以使所述客户端与所述服务器进行时间同步,并解调出所述外接时钟源的信息。
  7. 根据权利要求6所述的服务器,其中,所述外接时钟源的信息包括所述服务器卫星数字段、信噪比字段、天馈状态以及质量字段。
  8. 根据权利要求7所述的服务器,其中,所述打包模块包括:
    计算单元,配置为在所述外接时钟源的天馈状态正常时,根据所述卫星数以及信噪比,计算出所述外接时钟源的质量值;
    打包单元,配置为将所述外接时钟源的卫星数、信噪比、天馈状态以及质量值打包添加到PTP报文中,形成PTP添加报文。
  9. 根据权利要求8所述的服务器,其中,所述卫星数包括所述服务器搜索到的卫星数和锁定的卫星数,所述计算单元包括:
    比较子单元,配置为在所述外接时钟源的天馈状态正常时,比较所述锁定的卫星数与预定卫星数以及信噪比与预定信噪比的大小关系;
    第一子单元,配置为在所述锁定的卫星数大于或等于所述预定卫星数 且所述信噪比大于所述预定信噪比时,计算得到所述外接时钟源的质量值为第一值;
    第二子单元,配置为在所述锁定的卫星数大于所述预定卫星数且所述信噪比小于所述预定信噪比时,计算得到所述外接时钟源的质量值为第二值;
    第三子单元,配置为在所述锁定的卫星数小于所述预定卫星数且所述信噪比大于所述预定信噪比时,计算得到所述外接时钟源的质量值为第三值;
    第四子单元,配置为在所述锁定的卫星数小于所述预定卫星数且所述信噪比小于所述预定信噪比时,计算得到所述外接时钟源的质量值为第四值。
  10. 根据权利要求6所述的服务器,其中,所述PTP添加报文包括头部、主体以及扩展字段,所述扩展字段为类型/长度/值TLV格式。
  11. 一种系统,所述系统包括客户端、远程端以及如权利要求6至10中任一项所述的服务器,
    所述客户端包括:
    第一接收模块,配置为接收所述服务器发送的PTP添加报文以及所述远程端发送的PTP添加报文提取命令;
    解析模块,配置为根据所述PTP添加报文提取命令,将所述PTP添加报文进行解析,以得到所述外接时钟源的信息;
    第二发送模块,配置为将解析得到的所述外接时钟源的信息发送至所述远程端;
    所述远程端包括:
    请求模块,配置为向所述客户端发送所述PTP添加报文提取命令;
    第二接收模块,配置为接收所述客户端发送的所述外接时钟源的信息。
  12. 一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行权利要求1至5任一项所述的方法。
PCT/CN2015/094887 2015-07-01 2015-11-18 时间同步方法、服务器及系统、存储介质 WO2017000480A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510376774.9 2015-07-01
CN201510376774.9A CN106330420A (zh) 2015-07-01 2015-07-01 时间同步方法、服务器以及系统

Publications (1)

Publication Number Publication Date
WO2017000480A1 true WO2017000480A1 (zh) 2017-01-05

Family

ID=57607615

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/094887 WO2017000480A1 (zh) 2015-07-01 2015-11-18 时间同步方法、服务器及系统、存储介质

Country Status (2)

Country Link
CN (1) CN106330420A (zh)
WO (1) WO2017000480A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110445632A (zh) * 2018-05-04 2019-11-12 北京京东尚科信息技术有限公司 一种预防客户端崩溃的方法和装置
EP3904970A4 (en) * 2018-12-25 2022-08-17 Vivo Mobile Communication Co., Ltd. METHODS FOR ACQUIRING AND SENDING TIME INFORMATION, TERMINAL AND NETWORK DEVICE

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114866626B (zh) * 2022-04-28 2023-09-29 国电南瑞科技股份有限公司 一种智能变电站以太网报文处理系统
CN115396058B (zh) * 2022-08-15 2024-04-12 中国联合网络通信集团有限公司 一种信号传输方法、装置及存储介质

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202818369U (zh) * 2012-08-30 2013-03-20 上海远景数字信息技术有限公司 一种支持iec61850时钟信息发布的时钟服务器
CN104320238A (zh) * 2014-10-21 2015-01-28 浙江大学 一种海底观测网大流量背景下的时间同步方法

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202818369U (zh) * 2012-08-30 2013-03-20 上海远景数字信息技术有限公司 一种支持iec61850时钟信息发布的时钟服务器
CN104320238A (zh) * 2014-10-21 2015-01-28 浙江大学 一种海底观测网大流量背景下的时间同步方法

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110445632A (zh) * 2018-05-04 2019-11-12 北京京东尚科信息技术有限公司 一种预防客户端崩溃的方法和装置
CN110445632B (zh) * 2018-05-04 2023-09-01 北京京东尚科信息技术有限公司 一种预防客户端崩溃的方法和装置
EP3904970A4 (en) * 2018-12-25 2022-08-17 Vivo Mobile Communication Co., Ltd. METHODS FOR ACQUIRING AND SENDING TIME INFORMATION, TERMINAL AND NETWORK DEVICE

Also Published As

Publication number Publication date
CN106330420A (zh) 2017-01-11

Similar Documents

Publication Publication Date Title
US11057136B1 (en) Time correction using extension fields
US9548831B2 (en) Synchronizing system, synchronizing method, first synchronizing device, second synchronizing device, and computer program
US8107502B2 (en) Method and apparatus for monitoring packet networks
US10404552B2 (en) Time-stamping data packets in a network tap element
JP5811794B2 (ja) 通信装置
CN103563287B (zh) 同步设备和同步方法
US20180097610A1 (en) Synchronization apparatus, synchronization system, radio communication apparatus and synchronization method
WO2017000480A1 (zh) 时间同步方法、服务器及系统、存储介质
WO2018006686A1 (zh) 一种通信网络设备间时间同步的优化方法、装置及设备
CN102710410B (zh) 一种ntp网络和ptp网络之间时钟同步的方法
WO2016112666A1 (zh) Otn网络中实现时间同步的方法、设备、系统及存储介质
US9860003B2 (en) Method for providing time holdover in packet-based timing deployments
TWI766248B (zh) 用於在電腦網路中經加密流量的時間同步
US9042411B1 (en) System and method for accurate time sampling in presence of output delay
US9130661B2 (en) Method and master clock for generating fail-silent synchronization messages
WO2009043299A1 (en) A determining method and device for the synchronization port of a transparent clock equipment
TW201530155A (zh) 用於分散式電力系統測量之通訊系統與方法
CN107809295B (zh) 一种跨平台时间同步装置及方法
CN104054298A (zh) 基于包的时序测量
WO2021077289A1 (zh) 一种同步方法及设备
WO2017177751A1 (zh) 时间同步方法和装置
JP5426695B2 (ja) 少なくとも1つのタイミング配信プロトコルにより第1のデータおよび第2のデータを別々に伝送することによってクロックを同期するための方法、ならびに関連するシステムおよびモジュール
WO2015087024A1 (en) Method and devices for synchronization using linear programming
WO2022089177A1 (zh) 时间同步方法及装置
CN102983959B (zh) 在多个mac中实现ptp一步模式和两步模式的方法及装置

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: 15897007

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15897007

Country of ref document: EP

Kind code of ref document: A1