Clock source selection method and device and communication system

By determining the clock source according to the clock level and identification relationship in the 1588 synchronization technology, the problem of low time synchronization accuracy in the prior art is solved, higher time synchronization accuracy and lower time deviation are achieved, and the normal operation of 5G services is supported.

CN119995762APending Publication Date: 2025-05-13HUAWEI TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202311517550.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-13
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

In the existing 1588 synchronization technology, determining the clock source based on the optimal master clock source selection algorithm can easily lead to low time synchronization accuracy.

Method used

By acquiring the first data set and the second data set, including the clock level and the identification, the clock source is determined according to the clock level threshold and the identification relationship, ensuring that the clock level is not better than the threshold when the clock level is selected. This clock level threshold is configurable and compatible with ITU-T G.8275.1 and G.8275.2 standards.

Benefits of technology

It improves the time synchronization accuracy, reduces the time deviation between different devices, ensures that the time deviation between base stations remains within 3us, and supports the normal operation of 5G services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119995762A_ABST
    Figure CN119995762A_ABST
Patent Text Reader

Abstract

The invention discloses a clock source selection method and device and a communication system, and belongs to the technical field of communication. The method comprises: a first device obtains a first data set and a second data set, the first data set comprising a first clock level and a first clock identifier, and the second data set comprising a second clock identifier; and under the condition that the first clock level is not superior to a clock level threshold, the first equipment determines a clock source according to the first clock identifier and the second clock identifier, wherein the clock level threshold is configurable. According to the invention, the time synchronization precision can be improved, and the flexibility of clock source selection can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a clock source selection method and device, and a communication system. Background Art

[0002] In order to ensure the transmission requirements of the service, different devices in the network need to be time synchronized so that the time deviation between different devices is small. For example, the time deviation between different base stations in the network is within 3us (microseconds). That is, the time deviation between the time of each base station and the absolute time reference is within + / -1.5us (that is, [-1.5us, +1.5us]). Among them, the absolute time reference can be the time of the satellite system, and the satellite system is, for example, the global positioning system (GPS) or the Beidou positioning system.

[0003] At present, 1588 synchronization technology can be used to achieve time synchronization between different devices. Specifically, two 1588 servers can be deployed in the network. The two 1588 servers receive satellite signals from the satellite system respectively and synchronize with the satellite system time according to the received satellite signals. The two 1588 servers send 1588 messages carrying grandmaster (GM) information based on the status of the received satellite signals. The devices in the network select one of the two 1588 servers as the clock source according to the best master clock (BMC) source selection algorithm based on the GM information carried in the received 1588 message, and synchronize with the time of the clock source. Among them, the full name of the grandmaster clock in English is grandmaster clock, and the corresponding English abbreviation is GMC. In the relevant standards, the full name of the grandmaster clock in English is abbreviated as grandmaster, and the corresponding English abbreviation is abbreviated as GM. The grandmaster clock is also called the root clock (grandmaster clock). According to different actual conditions, the clock source selected by any device in the network can be the root clock source or the master clock source. The master clock source is the previous hop device of the device (which may be a 1588 server or another network device) and is on the 1588 synchronization path. The root clock source is the source device tracked by the device (for example, a 1588 server).

[0004] However, determining the clock source based on the current BMC source selection algorithm can easily lead to low time synchronization accuracy. Summary of the invention

[0005] The present application provides a clock source selection method and device, and a communication system, which can improve the time synchronization accuracy. The technical solution of the present application is as follows.

[0006] In a first aspect, a clock source selection method is provided, the method comprising: a first device acquires a first data set and a second data set, the first data set comprising a first clock level and a first clock identifier, and the second data set comprising a second clock identifier; when the first clock level is not better than a clock level threshold, the first device determines a clock source according to the first clock identifier and the second clock identifier, wherein the clock level threshold is configurable. After the first device determines the clock source, the first device performs time synchronization based on a clock message (e.g., a 1588 message) received from the clock source.

[0007] Among them, depending on the relationship between the first clock identifier and the second clock identifier, the clock source determined by the first device based on the first clock identifier and the second clock identifier can be a root clock source or a master clock source. For example, when the first clock identifier and the second clock identifier are different, the clock source determined by the first device based on the first clock identifier and the second clock identifier is the root clock source. When the first clock identifier and the second clock identifier are the same, the clock source determined by the first device based on the first clock identifier and the second clock identifier is the master clock source. The root clock source is GM, the master clock source is the previous hop device of the first device and the master clock source is in the clock synchronization path (for example, the 1588 synchronization path).

[0008] The technical solution provided by the present application indicates that the clock performance corresponding to the first clock level is relatively poor (for example, the clock accuracy is relatively low) when the first clock level is not better than the clock level threshold, so the first device determines the clock source according to the first clock identifier and the second clock identifier, so that the clock sources determined by different devices when the first clock level is not better than the clock level threshold can be the same clock source, for example, when the first clock level is not better than the clock level threshold and the first clock identifier is different from the second clock identifier, the clock sources determined by different devices can be the same clock source, and different devices can track the same clock source, which can reduce the difference in time synchronization accuracy between different devices, improve time synchronization accuracy, and ensure that the time deviation between different devices (for example, base stations) is maintained within the required range (for example, 3us). In addition, since the clock level threshold is configurable, the first device has high flexibility in determining the clock source based on the first clock level and the flexibly configured clock level threshold, and can ensure that the clock level threshold is compatible with the current International Telecommunication Union-TelecommunicationStandardization Sector (ITU-T) G.8275.1 standard and ITU-T G.8275.2 standard. This application can ensure that the time deviation between different devices (such as base stations) is maintained within the required range (such as 3us), ensuring that the fifth-generation mobile communication technology (5th-Generation Mobile Communication Technology, 5G) services can work normally.

[0009] Optionally, the first data set includes a first hop number, and the second data set includes a second hop number, and the method further includes: when the first clock level is better than the clock level threshold, the first device determines the clock source according to the first hop number and the second hop number. For example, the first device determines the clock source according to the first hop number and the second hop number according to the shortest path principle. The clock source determined by the first device according to the first hop number and the second hop number includes a root clock source and / or a master clock source. For example, the first data set corresponds to a first clock message, the second data set corresponds to a second clock message, the first hop number is the number of hops passed by the first clock message, the second hop number is the number of hops passed by the second clock message, the first device determines the minimum hop number of the first hop number and the second hop number, and the first device determines the clock source according to the clock message corresponding to the minimum hop number. For example, the first device determines the transmission path of the clock message corresponding to the minimum hop number as a clock synchronization path (for example, a 1588 synchronization path), and the first device determines the previous hop device of the first device on the clock synchronization path as a clock source. In the case where the previous hop device is a clock server, the clock source is the master clock source, and the clock source is also the root clock source. In the case where the previous hop device is a device between the clock server and the first device, the clock source is the main clock source and the clock server is the root clock source. After the first device determines the clock source according to the clock message corresponding to the minimum hop number, the first device adjusts the time of the first device according to the time information carried in the clock message corresponding to the minimum hop number to synchronize with the clock source.

[0010] The technical solution provided by the present application, when the first clock level is better than the clock level threshold, indicates that the clock performance corresponding to the first clock level is relatively good (for example, the clock accuracy is relatively high), so the first device determines the clock source according to the first hop count and the second hop count, thereby making it possible for the clock message corresponding to the clock source determined by the first device (for example, the clock message received directly or indirectly from the clock source by the first device) to reach the first device through a smaller number of hops (for example, the minimum), which helps to improve the time synchronization accuracy of the first device (the clock accuracy error carried by the clock message will deteriorate each time the clock message passes through a device, and the clock message corresponding to the clock source determined by the first device passes through fewer devices when it reaches the first device, and the clock accuracy carried by the clock message is higher). In the present application, the clock message originates from a clock server, the clock message originating from any clock server originates from the clock server, the source end of the clock message originating from any clock server is the clock server, and the source address of the clock message originating from any clock server is the address of the clock server. The clock message originating from any clock server includes at least one of the following: a clock message generated by the clock server, a clock message generated based on the clock message generated by the clock server (for example, a new clock message obtained by modifying the clock message generated by the clock server, the modification including modifying, adding or deleting information in the clock message).

[0011] Optionally, the first clock level being not better than the clock level threshold includes the first clock level being greater than the clock level threshold. Correspondingly, the first clock level being better than the clock level threshold includes the first clock level being less than or equal to (i.e., not greater than) the clock level threshold. Optionally, the clock level threshold is a clock level used to characterize a state in which a clock device is normally tracking a time signal, for example, the clock level threshold is 6. The time signal may be a satellite signal. The clock device may be a clock server or other device having a clock function. For example, the clock device may be a clock server or a network device connected between the clock server and the first device.

[0012] The technical solution provided by the present application, when the clock level threshold is the clock level used to characterize the state of the clock device normally tracking the time signal and the first clock level is greater than the clock level threshold (that is, the first clock level is not better than the clock level threshold), it indicates that the clock performance of the clock device is relatively poor, for example, the clock device loses the time signal, specifically, the clock device loses the time signal and the clock device is in a state of keeping the time available (that is, the clock device loses the time signal and the clock performance of the clock device is available), or the clock device loses the time signal and the clock performance of the clock device is unavailable. In this case, the first device determines the clock source according to the first clock identifier and the second clock identifier, so that the clock sources determined by different devices can be the same clock source, different devices can track the same clock source, and the time synchronization accuracy can be improved to ensure that the time deviation between different devices (such as base stations) is maintained within the required range (for example, 3us). When the clock level threshold is a clock level used to characterize the state of the clock device tracking the time signal normally and the first clock level is less than or equal to the clock level threshold (that is, the first clock level is better than the clock level threshold), it means that the clock performance of the clock device is relatively good, for example, the clock device is in the state of tracking the time signal normally, and the clock device has not lost the time signal. In this case, the first device determines the clock source according to the first hop number and the second hop number, for example, the first device determines the clock source according to the shortest path principle according to the first hop number and the second hop number, so that the clock message corresponding to the clock source determined by the first device reaches the first device through a smaller number of hops (for example, the minimum), which helps to improve the accuracy of time synchronization and ensure that the time deviation between different devices (for example, base stations) is maintained within the required range (for example, 3us). The availability or unavailability of the clock performance of the clock device refers to the availability or unavailability of the performance of the time signal output by the clock device.

[0013] Optionally, the first clock level being not better than the clock level threshold includes the first clock level being greater than or equal to (i.e. not less than) the clock level threshold. Correspondingly, the first clock level being better than the clock level threshold includes the first clock level being less than the clock level threshold. Optionally, the clock level threshold is a clock level used to characterize a state in which a time signal of a clock device is lost and the clock device is in a state of maintaining time availability, for example, the clock level threshold is 7. The time signal may be a satellite signal. The clock device may be a clock server or other device having a clock function. For example, the clock device may be a clock server or a network device connected between the clock server and the first device.

[0014] The technical solution provided by the present application, when the clock level threshold is the clock level used to characterize that a clock device has lost its time signal and the clock device is in a state of maintaining available time, and the first clock level is greater than or equal to the clock level threshold (that is, the first clock level is not better than the clock level threshold), it indicates that the clock performance of the clock device is relatively poor, for example, the clock device has lost its time signal and the clock device is in a state of maintaining available time (that is, the clock device has lost its time signal and the clock performance of the clock device is available), or the clock device has lost its time signal and the clock performance of the clock device is unavailable. In this case, the first device determines the clock source according to the first clock identifier and the second clock identifier, so that the clock sources determined by different devices can be the same clock source, different devices can track the same clock source, and the time synchronization accuracy can be improved to ensure that the time deviation between different devices is within the required range (for example, 3us). When the clock level threshold is a clock level used to characterize that the clock device has lost the time signal and the clock device is in a state of maintaining time availability, and the first clock level is less than the clock level threshold (that is, the first clock level is better than the clock level threshold), it means that the clock performance of the clock device is relatively good, for example, the clock device is in a state of normal tracking of the time signal, and the clock device has not lost the time signal. In this case, the first device determines the clock source according to the first hop number and the second hop number, for example, the first device determines the clock source according to the shortest path principle according to the first hop number and the second hop number, so that the clock message corresponding to the clock source determined by the first device reaches the first device after a small number of hops (for example, the minimum), which helps to improve the accuracy of time synchronization and ensure that the time deviation between different devices (for example, base stations) is maintained within the required range (for example, 3us). The availability or unavailability of the clock performance of the clock device refers to the availability or unavailability of the performance of the time signal output by the clock device.

[0015] Optionally, the first clock level not being better than the clock level threshold includes that the first clock level is not in the clock level set, and the first clock level being better than the clock level threshold includes that the first clock level is in the clock level set, and the clock level set is configurable. Optionally, the clock level threshold is in the clock level set, and the clock levels in the clock level set include: a clock level used to characterize a state in which a clock device is tracking a time signal normally, and / or a clock level used to characterize a state in which a time signal is lost for a clock device and the clock device is available in keeping time, and / or a default clock level. For example, the clock level used to characterize a state in which a clock device is tracking a time signal normally is 6, the clock level used to characterize a state in which a time signal is lost for a clock device and the clock device is available in keeping time is 7, the default clock level is 127, and the clock level set can be any one of the following: {6}, {7}, {127}, {6,127}, {7,127}, {6,7}, {6,7,127}.

[0016] The technical solution provided by the present application is that the clock level threshold is within the clock level set and the clock level set is configurable, so the clock level threshold is configurable, which can ensure that the clock level threshold is compatible with the current ITU-T G.8275.1 standard and ITU-T G.8275.2 standard. The configuration of the clock level threshold can be achieved by configuring the clock level set. By configuring the clock level threshold, different devices can be flexibly controlled to track the same clock server, or to track multiple clock servers (for example, two clock servers) according to the shortest path principle.

[0017] Optionally, the attribute set (defaultDS) of the first device includes a clock class set (clockClassSet) field, and the clockClassSet field is used to record the clock class set (clockClassSet). The defaultDS of the first device is a default dataset (default dataset) of the first device, and the clockClassSet field included in the defaultDS can be expressed as a defaultDS.clockClassSet field.

[0018] Optionally, the attribute set (defaultDS) of the first device includes a clock class threshold (clockClassThreshold) field, and the clockClassThreshold field is used to record the clock class threshold (clockClassThreshold). The defaultDS of the first device is the default dataset (defaultdataset) of the first device, and the clockClassThreshold field included in the defaultDS can be expressed as the defaultDS.clockClassThreshold field. The clock class threshold is also called the clock class threshold.

[0019] Optionally, the first device determines the clock source according to the first clock identifier and the second clock identifier, including: when the first clock identifier is different from the second clock identifier, the first device determines the target clock identifier in the first clock identifier and the second clock identifier, and the first device determines the clock server identified by the target clock identifier as the clock source, and the clock source is the root clock source. For example, the first clock identifier and the second clock identifier are both expressed in numerical values ​​or characters, and the target clock identifier is the smallest clock identifier of the first clock identifier and the second clock identifier.

[0020] Optionally, the first device determines the clock source according to the first clock identifier and the second clock identifier, including: when the first clock identifier is the same as the second clock identifier, the first device determines the clock source according to the first hop number in the first data set and the second hop number in the second data set. The clock source determined by the first device according to the first hop number and the second hop number includes a root clock source and / or a master clock source. For example, the first data set corresponds to a first clock message, the second data set corresponds to a second clock message, the first hop number is the number of hops passed by the first clock message, the second hop number is the number of hops passed by the second clock message, the first device determines the minimum hop number between the first hop number and the second hop number, and the first device determines the clock source according to the clock message corresponding to the minimum hop number. For example, the first device determines the transmission path of the clock message corresponding to the minimum hop number as a clock synchronization path (for example, a 1588 synchronization path), and the first device determines the previous hop device located on the first device on the clock synchronization path as a clock source. In the case where the previous hop device is a clock server, the clock source is the master clock source, and the clock source is also the root clock source. In the case that the previous-hop device is a device between the clock server and the first device, the clock source is a master clock source, and the clock server is a root clock source.

[0021] Among them, the first clock identifier and the second clock identifier are used to identify the clock server respectively; when the first clock identifier is different from the second clock identifier, it means that the clock server identified by the first clock identifier is different from the clock server identified by the second clock identifier (that is, they are not the same clock server); when the first clock identifier is the same as the second clock identifier, it means that the clock server identified by the first clock identifier is the same as the clock server identified by the second clock identifier (that is, they are the same clock server). Optionally, the first clock identifier and the second clock identifier are both expressed in numerical values ​​or characters, and the first clock identifier being the same as the second clock identifier can also be described as the first clock identifier being equal to the second clock identifier, and the first clock identifier being different from the second clock identifier can also be described as the first clock identifier being unequal to the second clock identifier.

[0022] Optionally, the first device obtains the first data set and the second data set, including: the first device receives a first clock message and a second clock message, the first device generates the first data set according to the first clock message, and the first device generates the second data set according to the second clock message.

[0023] Optionally, the method further includes: when the first data set and the second data set meet a preset condition, the first device determines whether the first clock level is better than a clock level threshold.

[0024] Optionally, the first data set also includes at least one of the following: a first clock accuracy, a first clock offset scaled log variance, a first clock priority, and a first local priority; the second data set also includes at least one of the following: a second clock class, a second clock accuracy, a second clock offset scaled log variance, a second clock priority, and a second local priority; the first clock accuracy, the first clock offset scaled log variance, the first clock priority, the first local priority, the second clock class, the second clock accuracy, the second clock offset scaled log variance, the second clock priority, and the second local priority are all expressed in numerical values ​​or characters, and the preset conditions include at least one of the following: the first clock class is equal to the second clock class, the first clock accuracy is equal to the second clock accuracy, the first clock offset scaled log variance is equal to the second clock offset scaled log variance, the first clock priority is equal to the second clock priority, and the first local priority is equal to the second local priority.

[0025] Optionally, the first clock level, the first clock identifier, the first clock accuracy, the first clock offset ratio logarithmic variance and the first clock priority are all GM information carried by the first clock message, and the second clock level, the second clock identifier, the second clock accuracy, the second clock offset ratio logarithmic variance and the second clock priority are all GM information carried by the second clock message. The local priority is the priority of the port on which the device receives the clock message, for example, the first local priority is the priority of the port on which the first device receives the first clock message, and the second local priority is the priority of the port on which the first device receives the second clock message. For example, the first clock class is the GM clock class in the first data set, the first clock identification is the GM clock identity in the first data set, the first clock accuracy is the GM clock accuracy in the first data set, the first clock offset scaled log variance is the GM clock offset scaled log variance in the first data set, and the first clock priority is the GM clock priority2 in the first data set; the second clock class is the GMclock class in the second data set, the second clock identification is the GM clock identity in the second data set, the second clock accuracy is the GM clock accuracy in the second data set, the second clock offset scaled log variance is the GM clockoffset scaled log variance in the second data set, and the second clock priority is the GM clock priority2 in the second data set. GM clock class, GM clock identity, GM clock accuracy, GM clock offset scaled logvariance, and GM clock priority2 are described in ITU-T G.8275.1 and ITU-T G.8275.2 standards. In the Institute of Electrical and Electronics Engineers (IEEE) 1588 version 2 (v2) IEEE 1588v2 standard, GM clock class is abbreviated as GM class, GM clock identity is abbreviated as GM identity, GM clock priority2 is abbreviated as GM priority2, GM clock accuracy is abbreviated as GM accuracy, and GM clock offset scaled log variance is abbreviated as GMoffsetscaledlogvariance.

[0026] Optionally, the clock server is a 1588 server, and the clock message is a 1588 message. The full name of 1588 is IEEE 1588.

[0027] In a second aspect, a clock source selection device is provided, which is applied to a first device, and the clock source selection device includes modules for executing the clock source selection method provided in the first aspect or any optional manner of the first aspect. These modules can be implemented based on software, hardware, or a combination of software and hardware, and these modules can be arbitrarily combined or divided based on specific implementations.

[0028] In a third aspect, a clock source selection device is provided, which is applied to a first device and includes a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program stored in the memory so that the clock source selection device executes the clock source selection method provided in the first aspect or any optional method of the first aspect.

[0029] In a fourth aspect, a clock source selection device is provided, which is applied to a first device and includes a main control board and an interface board, wherein the main control board and the interface board are used to implement the clock source selection method provided in the first aspect or any optional method of the first aspect. The interface board is also called a circuit board.

[0030] In a fifth aspect, a communication system is provided, comprising a first device and at least two clock devices, wherein the first device comprises a clock source selection device as provided in the second to fourth aspects above, and the first device is used to determine a clock source in the at least two clock devices.

[0031] Optionally, the first device includes any one of the following: a network element (NE), a base station. The network element is also called a network device, and the network element and the base station are collectively referred to as communication devices. The network element includes a router, a switch, a packet transport network (PTN) device, an optical transmission network (OTN) device, etc.

[0032] In a sixth aspect, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed, the clock source selection method provided in the first aspect or any optional method of the first aspect is implemented.

[0033] In a seventh aspect, a computer program product is provided, which includes a program or code, and when the program or code is executed, it implements the clock source selection method provided in the first aspect or any optional method of the first aspect.

[0034] In an eighth aspect, a chip is provided, which includes a programmable logic circuit and / or program instructions, and when the chip is running, it is used to implement the clock source selection method provided by the first aspect or any optional method of the first aspect.

[0035] The technical effects of the second to eighth aspects can refer to the technical effects of the first aspect and the optional implementation method of the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 is a schematic diagram of a 1588 network provided in an embodiment of the present application;

[0037] Figure 2 is a schematic diagram of a 1588 network including a 1588 synchronization path provided in an embodiment of the present application;

[0038] Figure 3 is a schematic diagram of another 1588 network including a 1588 synchronization path provided in an embodiment of the present application;

[0039] Figure 4 is a flow chart of a clock source selection method provided in an embodiment of the present application;

[0040] Figure 5 is a flow chart of another clock source selection method provided in an embodiment of the present application;

[0041] Figure 6 is a flow chart of another clock source selection method provided in an embodiment of the present application;

[0042] Figure 7 is a flowchart of another clock source selection method provided in an embodiment of the present application;

[0043] Figure 8 is a flowchart of another clock source selection method provided in an embodiment of the present application;

[0044] Fig. 9 is a schematic diagram of a first device provided in an embodiment of the present application;

[0045] Fig.10 is a schematic diagram of a clock source selection device provided in an embodiment of the present application;

[0046] Fig.11 is a schematic diagram of another clock source selection device provided in an embodiment of the present application;

[0047] Fig.12 It is a schematic diagram of another clock source selection device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] The implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0049] In order to ensure the transmission requirements of the service, different devices in the network need to be time synchronized so that the time deviation between different devices is small. For example, the current fifth-generation mobile communication technology (5th-Generation Mobile Communication Technology, 5G) requires that the time deviation between base stations is within 3us, that is, the time deviation between the time of each base station and the absolute time reference is within + / -1.5us (that is, [-1.5us, +1.5us]), so time synchronization is needed to make the time deviation between base stations meet this requirement. Among them, the absolute time reference can be the time of the satellite system, and the satellite system is, for example, the global positioning system (GPS) or the Beidou positioning system.

[0050] Currently, there are two time synchronization technologies. One technology is to install a satellite signal receiver on the device that needs time synchronization (such as a base station), such as a GPS receiver or a Beidou receiver, and the device synchronizes the time with the satellite system based on the satellite signal received by the satellite signal receiver on the device. The time synchronization accuracy of this technology can reach about + / -0.1us (that is, [-0.1us, +0.1us]), and the time synchronization accuracy is relatively high. However, satellite signals are more susceptible to interference and are easily deceived and counterfeited, resulting in low security of this technology.

[0051] Another technology is the 1588 synchronization technology, which uses a 1588 server to achieve time synchronization of different devices. For example, the 1588 server synchronizes time with the satellite system based on the received satellite signal, and the 1588 server transmits a 1588 message carrying time information to the base station through the bearer network based on the received satellite signal, and the base station adjusts the time of the base station based on the time information carried in the received 1588 message to perform time synchronization. The time synchronization accuracy of the 1588 synchronization technology is around + / -1us (that is, [-1us, +1us]), which can meet the synchronization requirement of + / -1.5us, and the deployment location of the 1588 server is relatively safe, interference and security attacks are relatively difficult, and the time synchronization process is not easily interfered with and deceived, and has high security. In order to perform security protection for time synchronization, two 1588 servers are generally deployed in the network. The two 1588 servers receive satellite signals from the satellite system respectively and synchronize with the satellite system time according to the received satellite signals. In addition, the two 1588 servers send 1588 messages carrying time information based on the received satellite signals respectively. The devices in the network (including network devices, base stations, etc.) select clock sources (i.e., select clock sources) according to the received 1588 messages and synchronize with the selected clock sources. For example, the time of the device is adjusted according to the time information carried in the 1588 message received from the selected clock source to perform time synchronization. Among them, the time information carried in the 1588 message sent by each 1588 server is the time information of the 1588 server. The network device is also called a network element (NE), and the network element includes a router, a switch, a packet transport network (PTN) device, an optical transmission network (OTN) device, etc. The network element and the base station are collectively referred to as communication equipment. Depending on the actual situation, the clock source selected by any device in the network can be the root clock source or the master clock source. The master clock source is the previous hop device of the device (it may be a 1588 server or another network device) and the master clock source is on the 1588 synchronization path. The root clock source is the source device tracked by the device (for example, a 1588 server). During the transmission of 1588 messages in the network, the information carried by the 1588 messages may be modified by the devices in the network. The device can send the 1588 messages after modifying them.

[0052] For the convenience of description, a network that performs time synchronization based on the 1588 synchronization technology is called a 1588 synchronization network, or 1588 network for short. Figure 1 Schematic diagram of a 1588 network provided in an embodiment of the present application. Figure 1As shown, the 1588 network includes 1588 servers 1-2, NE1-10 (i.e., network elements 1-10, network devices 1-10) and base stations 1-5. The 1588 servers 1-2 are respectively connected to the satellite system for communication, and the 1588 servers 1-2 are respectively connected to the base stations 1-5 for communication through NE1-10. The 1588 servers 1-2 are respectively used to receive satellite signals from the satellite system, synchronize with the time of the satellite system according to the received satellite signals, and transmit 1588 messages carrying time information to the base stations 1-5 through NE1-10 according to the received satellite signals. Each of the base stations 1-5 is used to select a clock source (i.e., select a clock source) according to the received 1588 message and synchronize with the selected clock source, for example, adjust the time of the base station according to the time information carried in the 1588 message received from the selected clock source to synchronize with the clock source. In addition, each NE in NE1-10 also selects a clock source according to the received 1588 message and synchronizes with the selected clock source. That is, NE1-10 and base stations 1-5 are all devices that need to be time synchronized. Optionally, NE1-10 also generates and sends a new 1588 message based on the information carried by the received 1588 message, which is similar to modifying and sending part of the content of the received 1588 message, such as modifying the information carried by the 1588 message (such as clock accuracy), the number of hops, etc. In the embodiment of the present application, the 1588 message originates from the 1588 server, and the 1588 message originating from any 1588 server refers to the 1588 message originating from the 1588 server, and the source end of the 1588 message originating from any 1588 server is the 1588 server, and the source address is the address of the 1588 server. Optionally, the 1588 message originating from any 1588 server includes at least one of the following: a 1588 message generated by the 1588 server, a newly generated 1588 message based on the 1588 message generated by the 1588 server (for example, a new 1588 message obtained by modifying the 1588 message generated by the 1588 server, the modification including modifying, adding or deleting information in the 1588 message).

[0053] In an optional embodiment, the 1588 servers 1-2 respectively include satellite signal receivers to receive satellite signals transmitted by a satellite system, and the satellite system may include multiple satellites, all of which are used to transmit satellite signals. Optionally, the 1588 servers 1-2 are respectively connected to base stations 1-5 through a bearer network, and NE1-10 all belong to the bearer network. In one example, the bearer network includes an access layer network and a core layer network, NE1-4 belong to the core layer network, and NE5-10 belong to the access layer network.

[0054] Although the 1588 server also receives satellite signals from the satellite system, and the time synchronization process between devices in the 1588 network is also related to the satellite signals transmitted by the satellite system, the number of 1588 servers is small, and the deployment location is relatively safe, and interference and security attacks are relatively difficult. Therefore, the time synchronization process between devices in the 1588 network is not easily interfered with and deceived, and has high security. When the satellite signal is normal, the time synchronization accuracy of the two 1588 servers can reach about + / -0.1us, and both 1588 servers can be used as the root clock source. Among them, the normal satellite signal means that the satellite signal is not interfered with and deceived, or the interference of the satellite signal is very small and is not deceived. For the 1588 server, the normal satellite signal includes at least one of the following: the 1588 server can at least receive satellite signals transmitted by a preset number of satellites, and the strength of the satellite signal received by the 1588 server is greater than the preset strength. In the case of satellite signals, the 1588 server can track the satellite signal normally, and the 1588 server is in a state of normal tracking of the satellite signal.

[0055] At present, there are two clock source selection algorithms (or clock source selection schemes), namely, the best master clock (BMC) source selection algorithm defined by the Institute of Electrical and Electronics Engineers (IEEE) 1588 version 2 (version 2, v2) standard and the BMC source selection algorithm defined by the International Telecommunication Union-Telecommunication Standardization Sector (ITU-T) G.8275.1 standard. Both BMC source selection algorithms can be used for devices (including NE, base station, etc.) in a 1588 network to determine the clock source and the 1588 status of their own ports, so that the 1588 synchronization path in the 1588 network can be determined based on the 1588 status of the ports of each device determined by each device in the 1588 network. Among them, the BMC source selection algorithm defined by the IEEE 1588v2 standard is also called the default BMC source selection algorithm, referred to as the default BMC. The 1588 state of a port is also called the 1588 port state. The 1588 state of a port includes the master (master, M) state, the slave (slave, S) state or the passive (passive, P) state. A port in the M state is also called an M port, a port in the S state is also called an S port, and a port in the P state is also called a P port.

[0056] However, in the BMC source selection algorithm defined in the IEEE 1588v2 standard, all devices in the 1588 network will select the same 1588 server as the clock source (that is, the root clock source) for tracking. All devices can only track the same 1588 server, which results in some devices being unable to track the 1588 server that is closer to them (that is, the 1588 server with a shorter path to them), and can only track the 1588 server that is farther away from them (that is, the 1588 server with a longer path to them). For example, some devices cannot select the 1588 server closest to them (that is, the 1588 server with the shortest path to them) as the clock source (that is, the root clock source) for tracking according to the shortest path principle. Every time a 1588 message passes through a device, the clock accuracy it carries will deteriorate. Therefore, compared with selecting a clock server that is far away from itself as the clock source (that is, the root clock source) for tracking, selecting a clock server that is close to itself (for example, the nearest) as the clock source (that is, the root clock source) for tracking can improve the time synchronization accuracy. In other words, for any device, the closer the 1588 server to the device (that is, the 1588 server with the shorter path to the device) is selected as the clock source (that is, the root clock source) for tracking, the higher the time synchronization accuracy of the device is. The farther the 1588 server from the device (that is, the 1588 server with the longer path to the device) is selected as the clock source (that is, the root clock source) for tracking, the lower the time synchronization accuracy of the device is. Because some devices cannot track the 1588 server that is close to them in the BMC source selection algorithm defined in the IEEE 1588v2 standard, the time synchronization accuracy of these devices is low. In the BMC source selection algorithm defined in the ITU-T G.8275.1 standard, when the time signal (e.g., satellite signal) of multiple 1588 servers is lost and they are all in a state of keeping the time available (the state of keeping the time available can be called the time keeping state), for example, when the clock levels of the multiple 1588 servers are all 7, all devices in the 1588 network select the 1588 server closest to them as the clock source (i.e., the root clock source) for tracking according to the shortest path principle, so different devices may track different 1588 servers among the multiple 1588 servers. Since the multiple 1588 servers are all in the time keeping state, as time goes by, the time deviation between different 1588 servers among the multiple 1588 servers will become larger and larger, resulting in an increasing time deviation between the devices tracking these different 1588 servers, which in turn results in a low time synchronization accuracy of the devices tracking these different 1588 servers.The BMC source selection algorithm of the ITU-T G.8275.2 standard is the same as the BMC source selection algorithm defined in the ITU-T G.8275.1 standard. Therefore, the BMC source selection algorithm of the G.8275.2 standard has the same problem as the BMC source selection algorithm defined in the ITU-T G.8275.1 standard.

[0057] In the BMC source selection algorithm defined in the IEEE 1588v2 standard and the BMC source selection algorithm defined in the ITU-T G.8275.1 standard, a device in a 1588 network generates a data set including clock source selection information according to a 1588 message received by the device, performs clock source selection according to the clock source selection information in the data set, and each device determines the 1588 state of the port of the device according to the 1588 message received by the device and the clock source selected by the device. The clock source selection information includes at least one of time information and hop count (steps removed), the time information may be the time information of the 1588 server corresponding to the 1588 message, the time information may be the grandmaster (GM) information carried by the 1588 message, and the hop count may be the hop count of the 1588 message. For example, in the IEEE 1588v2 standard, the GM information includes GM clock identity, GM clock priority 1, GM clock class, GM clock accuracy, GM clock offset scaled log variance, and GM clock priority 2. In the ITU-T G.8275.1 standard, the GM information includes GM clock identity, GM clock class, GM clock accuracy, GM clock offset scaled log variance, and GM clock priority 2. In the ITU-T G.8275.1 standard, the clock source selection information also includes local priority, which is the priority of the port in the device for receiving 1588 messages.It should be noted that, for the sake of uniform description, the embodiments of the present application describe the GM information in the IEEE 1588v2 standard as GM clock identity, GM clock priority1, GM clock class, GM clock accuracy, GM clock offset scaled log variance and GM clockpriority2. In the actual IEEE 1588v2 standard, GM clock class is abbreviated as GM class, GM clock identity is abbreviated as GM identity, GM clock priority2 is abbreviated as GM priority2, GM clock accuracy is abbreviated as GM accuracy, and GM clock offset scaled log variance is abbreviated as GMoffsetscaledlogvariance.

[0058] The following briefly introduces the BMC source selection algorithm defined in the IEEE 1588v2 standard and the BMC source selection algorithm defined in the G.8275.1 standard with reference to the accompanying drawings.

[0059] Please refer to Figure 2 , which shows a schematic diagram of a 1588 network including a 1588 synchronization path provided by an embodiment of the present application. The 1588 synchronization path in the 1588 network is a 1588 synchronization path determined by the BMC source selection algorithm defined in the IEEE 1588v2 standard, Figure 2 This section describes the BMC source selection algorithm defined in the IEEE 1588v2 standard. Figure 2 In the figure, the small boxes in each device of NE1-10 and base stations 1-5 represent the ports of the devices, and the letters "M", "S", and "P" in the small boxes represent the 1588 status of the ports represented by the small boxes ("M" represents the M status, "S" represents the S status, and "P" represents the P status). The meanings of the small boxes and the letters in the small boxes in 1588 servers 1-2 are similar. Figure 2As shown, 1588 servers 1-2 receive satellite signals from the satellite system respectively, synchronize with the time of the satellite system according to the received satellite signals, and transmit 1588 messages to base stations 1-5 through NE1-10 according to the received satellite signals. Each device in NE1-10 and base stations 1-5 generates a data set including clock source selection information according to the received 1588 message, performs clock source selection according to the BMC source selection algorithm defined in the IEEE 1588v2 standard according to the clock source selection information in the data set, and determines the 1588 state of the port of the device according to the 1588 message received by the device and the clock source selected by the device (or sets the 1588 state of the port of the device), and 1588 servers 1-2 also set the 1588 state of their respective ports. For example, each of the 1588 servers 1 to 2 sets the 1588 state of the port in the 1588 server used for sending 1588 messages to the M state; each of the NEs 1 to 10 sets the 1588 state of the port in the NE used for receiving 1588 messages from the clock source selected by the NE to the S state, and sets the 1588 state of the port in the NE used for sending 1588 messages from the clock source selected by the NE to the M state; each of the base stations 1 to 5 sets the 1588 state of the port in the base station used for receiving 1588 messages from the clock source selected by the base station to the S state. Finally, the 1588 states of the respective ports set by the 1588 servers 1 to 2, NEs 1 to 10, and base stations 1 to 5 are as follows: Figure 2 As shown, based on the 1588 status of the ports of 1588 servers 1-2, NE1-10 and base stations 1-5, the 1588 synchronization paths corresponding to base stations 1-5 can be determined. The 1588 synchronization path corresponding to each base station in base stations 1-5 is the transmission path of the 1588 message of the clock source selected by the base station from the clock source to the base station. For example, base station 1 corresponds to 1588 synchronization path 1, which is the transmission path of 1588 messages of the clock source (1588 server 1) selected by base station 1 from 1588 server 1 to base station 1; base station 2 corresponds to 1588 synchronization path 2, which is the transmission path of 1588 messages of the clock source (1588 server 1) selected by base station 2 from 1588 server 1 to base station 2; base station 3 corresponds to 1588 synchronization path 3, which is the transmission path of 1588 messages of the clock source (1588 server 1) selected by base station 3 from 1588 server 1 to base station 3, and so on. Figure 2It can be seen that the clock sources selected by NE1~10 and base stations 1~5 are all 1588 server 1, and the clock sources of NE1~10 and base stations 1~5 are all 1588 server 1. NE1~10 and base stations 1~5 all track 1588 server 1 to synchronize time with 1588 server 1. 1588 server 2 is used as a backup. After 1588 server 1 fails or is unavailable, NE1~10 and base stations 1~5 switch to 1588 server 2 when selecting the clock source to track 1588 server 2.

[0060] refer to Figure 2, for example, the 1588 messages sent by 1588 servers 1 to 2 all carry GM information and hop counts, the hop counts carried by the 1588 messages increase hop by hop, and all or part of the GM information carried by the 1588 messages is updated hop by hop. For example, for any device among NE1 to 10 and base stations 1 to 5, the device receives 1588 messages A and 1588 messages B, the device generates data set A according to 1588 message A, the device generates data set B according to 1588 message B, data set A and data set B respectively include clock source selection information, the device selects the clock source according to the BMC source selection algorithm defined in the IEEE1588v2 standard according to the clock source selection information in data set A and the clock source selection information in data set B, and the device sets the 1588 state of the port of the device according to the selected clock source. Take NE1 as an example, and take 1588 message A originates from 1588 server 1, 1588 message B originates from 1588 server 2, and data set A and data set B respectively include GM clock identifier, GM clock priority 1, GM clock level, GM clock accuracy, GM clock offset ratio logarithmic variance, GM clock priority 2 and hop count. The hop count in data set A is the hop count when 1588 message A reaches NE1, and the hop count in data set B is the hop count when 1588 message B reaches NE1. NE1 selects the clock source by comparing data set A and data set B according to the BMC source selection algorithm defined in the IEEE 1588v2 standard. Specifically, NE1 determines whether the GM clock identifier in data set A is the same as the GM clock identifier in data set B. If the GM clock identifier in data set A is the same as the GM clock identifier in data set B, it means that 1588 message A and 1588 message B originate from the same 1588 server, and NE1 selects the clock source according to the shortest path principle based on the hop count in data set A and the hop count in data set B. If the GM clock identifier in data set A is different from the GM clock identifier in data set B, it means that 1588 message A and 1588 message B originate from different 1588 servers, and NE1 compares the GM clock priority 1 in data set A with the GM clock priority 1 in data set B, the GM clock level in data set A with the GM clock level in data set B, the GM clock accuracy in data set A with the GM clock accuracy in data set B, the logarithmic variance of the GM clock offset ratio in data set A with the logarithmic variance of the GM clock offset ratio in data set B, the GM clock priority 2 in data set A with the GM clock priority 2 in data set B, and the GM clock identifier in data set A with the clock identifier in data set B.When NE1 determines through comparison that the GM clock priority 1 in data set A is the same as the GM clock priority 1 in data set B, the GM clock level in data set A is the same as the GM clock level in data set B, the GM clock accuracy in data set A is the same as the GM clock accuracy in data set B, the GM clock offset ratio logarithmic variance in data set A is the same as the GM clock offset ratio logarithmic variance in data set B, and the GM clock priority 2 in data set A is the same as the GM clock priority 2 in data set B, NE1 determines the 1588 server identified by the smallest clock identifier between the GM clock identifier in data set A and the clock identifier in data set B as the clock source. When NE1 determines through comparison that any GM information of GM clock priority 1, GM clock level, GM clock accuracy, GM clock offset ratio logarithmic variance, and GM clock priority 2 in data set A is different from the corresponding GM information in data set B, NE1 selects a clock source from 1588 server 1 and 1588 server 2 according to the any GM information in data set A and the corresponding GM information in data set B. For example, the GM clock identifier, GM clock priority 1, GM clock level, GM clock accuracy, GM clock offset ratio logarithmic variance, GM clock priority 2 and hop count are all expressed in numerical values ​​or characters. Two identical GM clock identifiers can also be described as the two GM clock identifiers being equal, two different GM clock identifiers can also be described as the two GM clock identifiers being unequal, two identical GM clock priorities can also be described as the two GM clock priorities being equal, two different GM clock priorities can also be described as the two GM clock priorities being unequal, and so on. When NE1 determines through comparison that the GM clock priority 1 in data set A is different from the GM clock priority 1 in data set B, NE1 determines the 1588 server corresponding to the smaller GM clock priority 1 between the GM clock priority 1 in data set A and the GM clock priority 1 in data set B as the clock source, and the 1588 server corresponding to the smaller GM clock priority 1 is the source end of the 1588 message including the smaller GM clock priority 1; when NE1 determines through comparison that the GM clock priority 1 in data set A is the same as the GM clock priority 1 in data set B, NE1 compares the GM clock level in data set A with the GM clock level in data set B.When NE1 determines through comparison that the GM clock level in data set A is different from the GM clock level in data set B, NE1 determines the 1588 server corresponding to the smaller GM clock level between the GM clock level in data set A and the GM clock level in data set B as the clock source, and the 1588 server corresponding to the smaller GM clock level is the source end of the 1588 message including the smaller GM clock level; when NE1 determines through comparison that the GM clock level in data set A is the same as the GM clock level in data set B, NE1 compares the GM clock accuracy in data set A with the GM clock accuracy in data set B. When NE1 determines through comparison that the GM clock accuracy in data set A is different from the GM clock accuracy in data set B, NE1 determines the 1588 server corresponding to the smaller GM clock accuracy between the GM clock accuracy in data set A and the GM clock accuracy in data set B as the clock source, and the 1588 server corresponding to the smaller GM clock accuracy is the source end of the 1588 message including the smaller GM clock accuracy; when NE1 determines through comparison that the GM clock accuracy in data set A is the same as the GM clock accuracy in data set B, NE1 compares the logarithmic variance of the GM clock offset ratio in data set A with the logarithmic variance of the GM clock offset ratio in data set B. When NE1 determines through comparison that the GM clock offset ratio logarithmic variance in data set A is different from the GM clock offset ratio logarithmic variance in data set B, NE1 determines the 1588 server corresponding to the smaller GM clock offset ratio logarithmic variance between the GM clock offset ratio logarithmic variance in data set A and the GM clock offset ratio logarithmic variance in data set B as the clock source, and the 1588 server corresponding to the smaller GM clock offset ratio logarithmic variance is the source end of the 1588 message including the smaller GM clock offset ratio logarithmic variance; when NE1 determines through comparison that the GM clock offset ratio logarithmic variance in data set A is the same as the GM clock offset ratio logarithmic variance in data set B, NE1 compares the GM clock priority 2 in data set A with the GM clock priority 2 in data set B. When NE1 determines through comparison that the GM clock priority 2 in data set A is different from the GM clock priority 2 in data set B, NE1 determines the 1588 server corresponding to the smaller GM clock priority 2 between the GM clock priority 2 in data set A and the GM clock priority 2 in data set B as the clock source, and the 1588 server corresponding to the smaller GM clock priority 2 is the source end of the 1588 message including the smaller GM clock priority 2; when NE1 determines through comparison that the GM clock priority 2 in data set A is the same as the GM clock priority 2 in data set B, NE1 compares the GM clock identifier in data set A with the clock identifier in data set B.It should be noted that this is only a brief introduction to the BMC source selection algorithm defined in the IEEE 1588v2 standard. For details of the BMC source selection algorithm defined in the IEEE 1588v2 standard, please refer to the IEEE 1588v2 standard. For details, please refer to Data Set Comparison Algorithm Part 1 and Data Set Comparison Algorithm Part 2 defined in the IEEE 1588v2 standard (Part 2 mainly introduces the selection of clock sources based on the shortest path principle). The address of the IEEE 1588v2 standard is https: / / ieeexplore.ieee.org / document / 7949184.

[0061] Please refer to Figure 3 , which shows a schematic diagram of another 1588 network including a 1588 synchronization path provided by an embodiment of the present application. The 1588 synchronization path in the 1588 network is a 1588 synchronization path determined by the BMC source selection algorithm defined in the ITU-T G.8275.1 standard, Figure 3 This section introduces the BMC source selection algorithm defined in the ITU-TG.8275.1 standard. Figure 3 In the figure, the small boxes in each device of NE1-10 and base stations 1-5 represent the ports of the devices, and the letters "M", "S", and "P" in the small boxes represent the 1588 status of the ports represented by the small boxes ("M" represents the M status, "S" represents the S status, and "P" represents the P status). The meanings of the small boxes and the letters in the small boxes in 1588 servers 1-2 are similar. Figure 3As shown, 1588 servers 1-2 receive satellite signals from the satellite system respectively, synchronize with the time of the satellite system according to the received satellite signals, and transmit 1588 messages to base stations 1-5 through NE1-10 according to the received satellite signals. Each device in NE1-10 and base stations 1-5 generates a data set including clock source selection information according to the received 1588 message, performs clock source selection according to the BMC source selection algorithm defined in the ITU-T G.8275.1 standard according to the clock source selection information in the data set, and sets the 1588 state of the port of the device according to the 1588 message received by the device and the clock source selected by the device, and 1588 servers 1-2 also set the 1588 state of their respective ports. For example, each of the 1588 servers 1 to 2 sets the 1588 state of the port in the 1588 server used for sending 1588 messages to the M state; each of the NEs 1 to 10 sets the 1588 state of the port in the NE used for receiving 1588 messages from the clock source selected by the NE to the S state, and sets the 1588 state of the port in the NE used for sending 1588 messages from the clock source selected by the NE to the M state; each of the base stations 1 to 5 sets the 1588 state of the port in the base station used for receiving 1588 messages from the clock source selected by the base station to the S state. Finally, the 1588 states of the respective ports set by the 1588 servers 1 to 2, NEs 1 to 10, and base stations 1 to 5 are as follows: Figure 3 As shown, based on the 1588 status of the ports of 1588 servers 1-2, NE1-10 and base stations 1-5, the 1588 synchronization path corresponding to each of base stations 1-5 can be determined. The 1588 synchronization path corresponding to each base station in base stations 1-5 is the transmission path of the 1588 message of the clock source selected by the base station from the clock source to the base station. For example, base station 1 corresponds to 1588 synchronization path 1, and 1588 synchronization path 1 is the transmission path of the 1588 message of the clock source (1588 server 1) selected by base station 1 from 1588 server 1 to base station 1; base station 2 corresponds to 1588 synchronization path 2, and 1588 synchronization path 2 is the transmission path of the 1588 message of the clock source (1588 server 1) selected by base station 2 from 1588 server 1 to base station 2; base station 3 corresponds to 1588 synchronization path 3, and 1588 synchronization path 3 is the transmission path of the 1588 message of the clock source (1588 server 1) selected by base station 2 from 1588 server 1 to base station 2. The transmission path of the 1588 message of the clock source (1588 server 1) from 1588 server 1 to base station 3; base station 4 corresponds to 1588 synchronization path 4, 1588 synchronization path 4 is the transmission path of the 1588 message of the clock source (1588 server 2) selected by base station 4 from 1588 server 2 to base station 4; base station 5 corresponds to 1588 synchronization path 5, 1588 synchronization path 5 is the transmission path of the 1588 message of the clock source (1588 server 2) selected by base station 5 from 1588 server 2 to base station 5. According to Figure 3It can be seen that the clock sources selected by NE1, NE3, NE5, NE7, NE9 and base stations 1 to 3 are all 1588 server 1, and NE1, NE3, NE5, NE7, NE9 and base stations 1 to 3 all track 1588 server 1 to synchronize with 1588 server 1; the clock sources selected by NE2, NE4, NE6, NE8, NE10 and base stations 4 to 5 are all 1588 server 2, and NE2, NE4, NE6, NE8, NE10 and base stations 4 to 5 all track 1588 server 2 to synchronize with 1588 server 2. That is, NE1 to 10 and base stations 1 to 5 all select the 1588 server closest to them as the clock source for time synchronization.

[0062] refer to Figure 3, for example, the 1588 messages sent by 1588 servers 1 to 2 all carry GM information and hop counts, the hop counts carried by the 1588 messages increase hop by hop, and all or part of the GM information carried by the 1588 messages is updated hop by hop. For example, for any device among NE1 to 10 and base stations 1 to 5, the device receives 1588 messages A and 1588 messages B, the device generates data set A according to 1588 message A, the device generates data set B according to 1588 message B, data set A and data set B respectively include clock source selection information, the device selects the clock source according to the BMC source selection algorithm defined in the ITU-TG.8275.1 standard according to the clock source selection information in data set A and the clock source selection information in data set B, and the device sets the 1588 state of the port of the device according to the selected clock source. For example, the device is NE1, and 1588 message A originates from 1588 server 1, 1588 message B originates from 1588 server 2, and data set A and data set B respectively include GM clock identifier, local priority, GM clock level, GM clock accuracy, GM clock offset ratio logarithmic variance, GM clock priority 2 and hop count. The hop count in data set A is the number of hops that 1588 message A passes when reaching NE1, the hop count in data set B is the number of hops that 1588 message B passes when reaching NE1, the local priority in data set A is the priority of the port in NE1 for receiving 1588 message A, and the local priority in data set B is the priority of the port in NE1 for receiving 1588 message B. NE1 selects the clock source by comparing data set A and data set B according to the BMC source selection algorithm defined in the ITU-T G.8275.1 standard. Specifically, NE1 compares the GM clock level in data set A with the GM clock level in data set B, the GM clock accuracy in data set A with the GM clock accuracy in data set B, the logarithmic variance of the GM clock offset ratio in data set A with the logarithmic variance of the GM clock offset ratio in data set B, the GM clock priority 2 in data set A with the GM clock priority 2 in data set B, and the local priority in data set A with the local priority in data set B.When NE1 determines through comparison that the GM clock level in data set A is the same as the GM clock level in data set B, the GM clock accuracy in data set A is the same as the GM clock accuracy in data set B, the logarithmic variance of the GM clock offset ratio in data set A is the same as the logarithmic variance of the GM clock offset ratio in data set B, the GM clock priority 2 in data set A is the same as the GM clock priority 2 in data set B, and the local priority in data set A is the same as the local priority in data set B, NE1 determines whether the GM clock level in data set A is less than or equal to (that is, ≤) 127; when the GM clock level in data set A is less than or equal to (that is, ≤) 127, NE1 determines according to the number of hops in data set A and the number of hops in data set B according to the number of hops in data set A and the number of hops in data set B. The clock source is selected according to the principle of the shortest path; when the GM clock level in data set A is greater than (i.e., >) 127, NE1 compares the GM clock identifier in data set A with the GM clock identifier in data set B; when the GM clock identifier in data set A is the same as the GM clock identifier in data set B, it means that 1588 message A and 1588 message B originate from the same 1588 server, and NE1 selects the clock source according to the principle of the shortest path based on the hop count in data set A and the hop count in data set B; when the GM clock identifier in data set A is different from the GM clock identifier in data set B, NE1 determines the 1588 server identified by the smallest clock identifier between the GM clock identifier in data set A and the clock identifier in data set B as the clock source. When NE1 determines through comparison that any GM information in data set A, GM clock accuracy, GM clock offset ratio logarithmic variance, GM clock priority 2, and local priority is different from the corresponding GM information in data set B, NE1 selects the clock source from 1588 server 1 and 1588 server 2 based on the any GM information in data set A and the corresponding GM information in data set B. For example, when NE1 determines through comparison that the GM clock level in data set A is different from the GM clock level in data set B, NE1 determines the 1588 server corresponding to the smaller GM clock level between the GM clock level in data set A and the GM clock level in data set B as the clock source, and the 1588 server corresponding to the smaller GM clock level is the source end of the 1588 message including the smaller GM clock level; when NE1 determines through comparison that the GM clock level in data set A is the same as the GM clock level in data set B, NE1 compares the GM clock accuracy in data set A with the GM clock accuracy in data set B.When NE1 determines through comparison that the GM clock accuracy in data set A is different from the GM clock accuracy in data set B, NE1 determines the 1588 server corresponding to the smaller GM clock accuracy between the GM clock accuracy in data set A and the GM clock accuracy in data set B as the clock source, and the 1588 server corresponding to the smaller GM clock accuracy is the source end of the 1588 message including the smaller GM clock accuracy; when NE1 determines through comparison that the GM clock accuracy in data set A is the same as the GM clock accuracy in data set B, NE1 compares the logarithmic variance of the GM clock offset ratio in data set A with the logarithmic variance of the GM clock offset ratio in data set B. When NE1 determines through comparison that the GM clock offset ratio logarithmic variance in data set A is different from the GM clock offset ratio logarithmic variance in data set B, NE1 determines the 1588 server corresponding to the smaller GM clock offset ratio logarithmic variance between the GM clock offset ratio logarithmic variance in data set A and the GM clock offset ratio logarithmic variance in data set B as the clock source, and the 1588 server corresponding to the smaller GM clock offset ratio logarithmic variance is the source end of the 1588 message including the smaller GM clock offset ratio logarithmic variance; when NE1 determines through comparison that the GM clock offset ratio logarithmic variance in data set A is the same as the GM clock offset ratio logarithmic variance in data set B, NE1 compares the GM clock priority 2 in data set A with the GM clock priority 2 in data set B. When NE1 determines through comparison that the GM clock priority 2 in data set A is different from the GM clock priority 2 in data set B, NE1 determines the 1588 server corresponding to the smaller GM clock priority 2 between the GM clock priority 2 in data set A and the GM clock priority 2 in data set B as the clock source, and the 1588 server corresponding to the smaller GM clock priority 2 is the source end of the 1588 message including the smaller GM clock priority 2; when NE1 determines through comparison that the GM clock priority 2 in data set A is the same as the GM clock priority 2 in data set B, NE1 compares the local priority in data set A with the local priority in data set B. When NE1 determines through comparison that the local priority in data set A is different from the local priority in data set B, NE1 determines the 1588 server corresponding to the smaller local priority between the local priority in data set A and the local priority in data set B as the clock source, and the 1588 server corresponding to the smaller local priority is the source end of the target 1588 message in 1588 message A and 1588 message B, and the target 1588 message is received by NE1 through the port of the smaller local priority; when NE1 determines through comparison that the local priority in data set A is the same as the local priority in data set B, NE1 determines whether the GM clock level in data set A is less than or equal to (that is, ≤) 127.It should be noted that only a brief introduction is given here to the BMC source selection algorithm defined in the ITU-T G.8275.1 standard. For details of the BMC source selection algorithm defined in the ITU-T G.8275.1 standard, please refer to the ITU-TG.8275.1 standard. For details, please refer to the data set comparison algorithm Part 1 and data set comparison algorithm Part 2 defined in the ITU-T G.8275.1 standard (Part 2 mainly introduces the process of selecting a clock source according to the shortest path principle. The data set comparison algorithm Part 2 in the ITU-T G.8275.1 standard is the same as the data set comparison algorithm Part 2 in the IEEE 1588v2 standard). The address of the ITU-TG.8275.1 standard is https: / / www.itu.int / ITU-T / recommendations / rec.aspx? rec=15131. It should be noted that, when the satellite signal is normal, the GM clock level of 1588 server 1 is the same as the GM clock level of 1588 server 2, the GM clock accuracy of 1588 server 1 is the same as the GM clock accuracy of 1588 server 2, the logarithmic variance of the GM clock offset ratio of 1588 server 1 is the same as the logarithmic variance of the GM clock offset ratio of 1588 server 2, the GM clock priority 2 of 1588 server 1 and the GM clock priority 2 of 1588 server 2 can be configured to be the same, and the GM clock level of 1588 server 1 and the GM clock level of 1588 server 2 are both 6, and the priority of the port for receiving 1588 message A in NE1 can be configured to be the same as the priority of the port for receiving 1588 message B in NE1. For example, the priority of the port for receiving 1588 message A in NE1 and the priority of the port for receiving 1588 message B in NE1 can be configured to be the same. The priority of the ports of dataset B is 128. Therefore, the GM clock level in dataset A is the same as the GM clock level in dataset B, the GM clock accuracy in dataset A is the same as the GM clock accuracy in dataset B, the logarithmic variance of the GM clock offset ratio in dataset A is the same as that of dataset B, the GM clock priority 2 in dataset A is the same as that in dataset B, the local priority in dataset A is the same as that in dataset B, and the GM clock level in dataset A is 6. 1588 message A originates from 1588 server 1, and dataset A corresponds to 1588 server 1. 1588 message B originates from 1588 server 2, and dataset B corresponds to 1588 server 2. NE1 selects the clock source for tracking according to the shortest path principle based on the number of hops in dataset A and the number of hops in dataset B, thereby improving the time synchronization accuracy. Figure 3The 1588 synchronization paths shown are 1588 synchronization paths determined according to the 1588 states of the respective ports provided in the 1588 servers 1 to 2, NEs 1 to 10, and base stations 1 to 5 when the satellite signals are normal.

[0063] The GM clock level is the clock level of the 1588 server. The GM clock level is also called the telecom grandmaster (T-GM) clock level. The ITU-T G.8275.1 standard defines the GM clock levels in various scenarios. The GM clock levels defined in the ITU-T G.8275.1 standard include 6, 7, 140, 150, and 160. The meanings of these clock levels are shown in Table 1 below.

[0064] Table 1

[0065] GM Clock Level meaning 6 GM normally tracks time signals (such as satellite signals) 7 GM is on hold and performance is available 140 GM is in holdover and performance is unavailable, but relies on level 1 frequency to provide time hold 150 GM is in holdover and performance is unavailable, but relies on Level 2 frequency to provide time hold 160 GM is in hold and performance is unavailable, but relies on Level 3 frequency to provide time hold

[0066] Table 1 only lists several GM clock levels and their meanings by way of example. For a detailed description of the GM clock levels and their meanings, please refer to the ITU-TG.8275.1 standard, which will not be described in detail in the embodiments of the present application.

[0067] According to the description of the BMC source selection algorithm defined in the ITU-T G.8275.1 standard, when the GM clock level of 1588 server 1 is the same as that of 1588 server 2, the GM clock accuracy of 1588 server 1 is the same as that of 1588 server 2, the logarithmic variance of the GM clock offset ratio of 1588 server 1 is the same as that of 1588 server 2, the GM clock priority 2 of 1588 server 1 is the same as that of 1588 server 2, and the priority of the port for receiving 1588 message A in the device is the same as the priority of the port for receiving 1588 message B in NE1, if the GM clock level of 1588 server 1 and the GM clock level of 1588 server 2 are both 7 (the GM clock level is less than 127), according to ITU-T According to the BMC source selection algorithm defined in the G.8275.1 standard, all devices will select the 1588 server closest to them as the clock source for tracking according to the shortest path principle. In this way, some devices select 1588 server 1 as the clock source for tracking, and other devices select 1588 server 2 as the clock source for tracking. However, when the GM clock level of 1588 server 1 and the GM clock level of 1588 server 2 are both 7, 1588 server 1 and 1588 server 2 are both in the time keeping state. As time goes by, the time deviation between 1588 server 1 and 1588 server 2 will become larger and larger, resulting in a larger and larger time deviation between the device tracking 1588 server 1 and the device tracking 1588 server 2. Although the time synchronization accuracy of devices tracking different 1588 servers can meet the requirement of 3us, the time synchronization accuracy is not optimal. In addition, the clock level threshold (ie, 127) in the BMC source selection algorithm defined in the ITU-TG.8275.1 standard is fixed and cannot be configured, resulting in low flexibility in the BMC source selection algorithm defined in the G.8275.1 standard, which in turn makes it impossible for the device to flexibly select the clock source.

[0068] The embodiment of the present application provides a clock source selection method and device, and a communication system. In the clock source selection method, the clock level threshold is configurable. When the clock level in the data set is not better than the clock level threshold, the device determines the clock source according to the clock identifier, so that when the clock level is not better than the clock level threshold (for example, the clock level is greater than 6), the clock source determined by different devices can be the same clock source, and different devices can track the same clock source, reducing the difference in time synchronization accuracy between different devices and improving time synchronization accuracy. In addition, since the clock level threshold is configurable, the device has high flexibility in determining the clock source based on the flexibly configured clock level threshold, and can ensure that the clock level threshold is compatible with the current G.8275.1 standard and ITU-T G.8275.2 standard. The embodiment of the present application can ensure that the time deviation between different devices (such as base stations) is maintained within the required range (for example, + / -1.5us), ensuring that 5G services can work normally.

[0069] The following introduces the technical solution provided by the embodiments of the present application, and first introduces the application scenario of the embodiments of the present application.

[0070] The application scenario of the embodiment of the present application provides a communication network, which includes at least one device and at least two clock servers. The at least two clock servers are respectively used to receive satellite signals from a satellite system, perform time synchronization with the satellite system according to the received satellite signals, and send clock messages carrying time information according to the received satellite signals. Each device in the at least one device is used to select a clock source according to the received clock message (that is, determine the clock source in the at least two clock servers) and synchronize time with the clock source, for example, adjust the time of the device according to the time information carried by the clock message from the clock source to synchronize time with the clock source. Optionally, each device in the at least one device generates a data set including clock source selection information according to the received clock message, and performs clock source selection according to the clock source selection information in the data set. In one embodiment, the at least one device is a plurality of devices, the plurality of devices include at least one network device and at least one base station, the at least two clock servers are respectively connected to the at least one base station through the at least one network device, and the time information carried in the clock message sent by each of the at least two clock servers is the time information of the clock server. For example, the at least two clock servers are both 1588 servers, the clock messages sent by the at least two clock servers are both 1588 messages, and the time information carried by the clock messages is GM information.

[0071] Optionally, each device in the at least one device also sets the 1588 state of the port of the device according to the clock message (e.g., 1588 message) received by the device and the clock source selected by the device, and the at least two clock servers also set the 1588 state of their respective ports, so that the 1588 synchronization path in the communication network can be determined based on the 1588 state of the port set by the at least two clock servers and the 1588 state of the port set by the at least one device. As an example, the communication network provided by the application scenario of the embodiment of the present application is as follows Figure 1 The 1588 network shown in FIG. 1588, the embodiment of the present application can be applied to Figure 1 The 1588 network shown, in this case, Figure 1 The 1588 network shown is only used to illustrate the application scenarios of the embodiments of the present application, and is not used to limit the technical solutions of the embodiments of the present application. During the implementation process, the number of NEs, the number of base stations, and the relationship between NEs, base stations and other devices in the 1588 network can be configured as needed; in addition, the 1588 network may also include other devices, such as control devices for network control. Among them, the control device integrates functions such as network management, business control and network analysis. The control device can be a server, or a server cluster composed of several servers, or a cloud computing service center. In some embodiments, the control device is also called a management device, a network management device, a controller, etc., which is not limited by the embodiments of the present application.

[0072] It should be noted that in the description of this application, the clock server closer to a certain device refers to the clock server with a shorter path to the certain device among at least two clock servers, and does not refer to the clock server with a physical location closer to the certain device. For example, clock server 1 and clock server 2 both send clock messages to the communication network, and the clock server closer to device A in the communication network refers to the clock server with a shorter path to device A among clock server 1 and clock server 2, and does not refer to the clock server with a physical location closer to device A. For example, the physical location of device A is closer to the physical location of clock server 1, and the physical location of device A is farther from the physical location of clock server 2, but there are more devices connected between device A and clock server 1, and fewer devices connected between device A and clock server 2, then clock server 2 is the clock server closer to device A described in the embodiment of this application, and clock server 1 is not the clock server closer to device A described in the embodiment of this application. Similarly, the clock server closest to a certain device refers to the clock server with the shortest path to the certain device among at least two clock servers, and does not refer to the clock server with a physical location closest to the certain device. For example, clock server 1 and clock server 2 both send clock messages to the communication network. The clock server closest to device A in the communication network refers to the clock server with the shortest path to device A among clock server 1 and clock server 2, and does not refer to the clock server that is physically closest to device A. For example, the physical location of device A is closest to the physical location of clock server 1, and the physical location of device A is farther from clock server 2, but there are more devices connected between device A and clock server 1, and fewer devices connected between device A and clock server 2. In this case, clock server 2 is the clock server closest to device A as described in the embodiment of the present application, and clock server 1 is not the clock server closest to device A as described in the embodiment of the present application. As an example, the communication network is as follows: Figure 1 In the 1588 network shown, clock server 1 is 1588 server 1, clock server 2 is 1588 server 2, device A is any device among NE1-10 and base stations 1-5, the clock message is a 1588 message, the 1588 server closer to device A refers to the clock server with a shorter path to device A between 1588 server 1 and 1588 server 2, and the 1588 server closest to device A refers to the clock server with a shorter path to device A between 1588 server 1 and 1588 server 2.

[0073] The above is an introduction to the application scenarios of the embodiments of the present application. The following introduces an embodiment of the clock source selection method of the present application.

[0074] Please refer to Figure 4, which shows a flow chart of a clock source selection method provided by an embodiment of the present application. This embodiment takes the clock source selection method applied to a first device as an example, and the clock source selection method is executed by the first device. The first device is any network device or base station in a communication network, and the clock server involved in the following description is deployed in the communication network. For example, the communication network is as follows Figure 1 In the 1588 network shown, the first device is any NE among NE1-10 or any base station among base stations 1-5, and the clock server involved in the following description includes at least one of 1588 server 1 and 1588 server 2. Figure 4 As shown, the clock source selection method includes the following steps S401 to S402.

[0075] S401. A first device obtains a first data set and a second data set, where the first data set includes a first clock level and a first clock identifier, and the second data set includes a second clock identifier.

[0076] Among them, the first clock identifier and the second clock identifier are used to identify the clock server respectively, and the first clock identifier and the second clock identifier can be the same or different, so that the clock server identified by the first clock identifier and the clock server identified by the second clock identifier are the same clock server or different clock servers. Specifically, when the first clock identifier and the second clock identifier are the same, the clock server identified by the first clock identifier and the clock server identified by the second clock identifier are the same clock server; when the first clock identifier and the second clock identifier are different, the clock server identified by the first clock identifier and the clock server identified by the second clock identifier are not the same clock server. For the convenience of description, the clock server identified by the first clock identifier is referred to as the first clock server, and the clock server identified by the second clock identifier is referred to as the second clock server, so the first clock server and the second clock server are the same clock server or different clock servers.

[0077] Among them, the first clock level is the clock level of the clock server identified by the first clock identifier (that is, the first clock server), that is, the clock level of the first clock server. Optionally, the second data set also includes a second clock level, and the second clock level is the clock level of the clock server identified by the second clock identifier (that is, the second clock server). The first clock level and the second clock level may be the same or different. In one example, the clock server identified by the first clock identifier and the clock server identified by the second clock identifier are the same clock server, and the first clock level is the same as the second clock level. In another example, the clock server identified by the first clock identifier and the clock server identified by the second clock identifier are not the same clock server, and the first clock level is the same as the second clock level.

[0078] In an optional embodiment, the first device receives a first clock message and a second clock message, the first device generates a first data set according to the first clock message, and the first device generates a second data set according to the second clock message. In one embodiment, the first clock message originates from a first clock server, the second clock message originates from a second clock server, the first clock message carries a first clock level and a first clock identifier, and the second clock message carries a second clock level and a second clock identifier; the first device extracts the first clock level and the first clock identifier from the first clock message, and the first device generates a first data set according to the first clock level and the first clock identifier; the first device extracts the second clock level and the second clock identifier from the second clock message, and the first device generates a second data set according to the second clock level and the second clock identifier. In one embodiment, the first clock message and the second clock message respectively carry GM information, the GM information carried by the first clock message is the GM information of the first clock server, the GM information carried by the first clock message includes a first clock level and a first clock identifier, the GM information carried by the second clock message is the GM information of the second clock server, and the GM information carried by the second clock message includes a second clock level and a second clock identifier; the first device extracts the GM information from the first clock message, and the first device generates a first data set based on the GM information extracted from the first clock message; and, the first device extracts the GM information from the second clock message, and the first device generates a second data set based on the GM information extracted from the second clock message.

[0079] In an optional embodiment, the first data set also includes at least one of the following: a first clock accuracy, a first clock offset ratio logarithmic variance, a first clock priority, a first local priority, and a first hop count. The first clock accuracy is the clock accuracy of the first clock server, the first clock offset ratio logarithmic variance is the clock offset ratio logarithmic variance of the first clock server, the first clock priority is the clock priority of the first clock server, the first local priority is the priority of a port (e.g., a first port) in the first device for receiving a first clock message, the first device receives the first clock message through the first port, and the first hop count is the number of hops that the first clock message goes through from the first clock server to the first device. In an example, the GM information carried by the first clock message includes a first clock level, a first clock identifier, a first clock accuracy, a first clock offset ratio logarithmic variance, and a first clock priority, and the first clock message also carries a first hop count. The first device determines the priority of the first port in the first device (that is, the first local priority), the first device extracts the GM information and the first hop count from the first clock message, and the first device generates a first data set based on the first local priority, the GM information extracted from the first clock message, and the first hop count extracted from the first clock message.

[0080] In an optional embodiment, the second data set also includes at least one of the following: a second clock accuracy, a second clock offset ratio logarithmic variance, a second clock priority, a second local priority, and a second hop count. The second clock accuracy is the clock accuracy of the second clock server, the second clock offset ratio logarithmic variance is the clock offset ratio logarithmic variance of the second clock server, the second clock priority is the clock priority of the second clock server, the second local priority is the priority of the port (e.g., the second port) used to receive the second clock message in the first device, the first device receives the second clock message through the second port, and the second hop count is the number of hops that the second clock message passes from the second clock server to the first device. For example, the GM information carried by the second clock message includes the second clock level, the second clock identifier, the second clock accuracy, the second clock offset ratio logarithmic variance, and the second clock priority, and the second clock message also carries the second hop count, the first device determines the priority of the second port in the first device (i.e., the second local priority), the first device extracts the GM information and the second hop count from the second clock message, and the first device generates the second data set according to the second local priority, the GM information extracted from the second clock message, and the second hop count extracted from the second clock message.

[0081] In an optional embodiment, the first clock server and the second clock server are both 1588 servers, and the first clock message and the second clock message are both 1588 messages. The first clock class is the GM clock class of the first clock server, the first clock identity is the GM clock identity of the first clock server, the first clock accuracy is the GM clock accuracy of the first clock server, the first clock offset scaled log variance is the GM clock offset scaled log variance of the first clock server, and the first clock priority is the GM clock priority 2 of the first clock server. The second clock class is the GM clock class of the second clock server, the second clock identity is the GMclock identity of the second clock server, the second clock accuracy is the GM clock accuracy of the second clock server, the second clock offset scaled log variance is the GM clock offset scaled log variance of the second clock server, and the second clock priority is the GM clock priority 2 of the second clock server. GM clock class, GM clock identity, GM clock accuracy, GM clock offset scaled log variance, and GM clock priority2 are described in ITU-T G.8275.1 and ITU-T G.8275.2 standards. In the IEEE 1588v2 standard, GM clock class is referred to as GM class, GM clock identity is referred to as GM identity, GM clock priority2 is referred to as GMpriority2, GM clock accuracy is referred to as GM accuracy, and GM clock offset scaled logvariance is referred to as GM offsetscaledlogvariance. This application does not limit this.

[0082] After the first device acquires the first data set and the second data set, the first device performs clock source selection according to the first data set and the second data set, that is, determines (or selects) the clock source. In a specific embodiment, the first device performs clock source selection according to the clock source selection information in the first data set and the clock source selection information in the second data set. Among them, the GM information and the first local priority in the first data set are both the clock source selection information in the first data set, and the GM information and the second local priority in the second data set are both the clock source selection information in the second data set. Please refer to the relevant description below for the implementation process of the first device performing clock source selection according to the first data set and the second data set.

[0083] S402. When the first clock level is not better than the clock level threshold, the first device determines a clock source according to the first clock identifier and the second clock identifier, and the clock level threshold is configurable.

[0084] The first device determines whether the first clock level in the first data set is better than the clock level threshold. When it is determined that the first clock level is not better than the clock level threshold, the first device determines the clock source according to the first clock identifier in the first data set and the second clock identifier in the second data set. In an embodiment of the present application, the first clock level is not better than the clock level threshold includes any one of the following three situations.

[0085] The first case: the first clock level is not better than the clock level threshold includes that the first clock level is greater than the clock level threshold.

[0086] The clock level threshold is a clock level used to characterize the state of the clock device tracking the time signal normally. For example, the clock level threshold is 6, and the first clock level is not better than the clock level threshold when the first clock level is greater than the clock level threshold. In a specific embodiment, the first device determines whether the first clock level is greater than the clock level threshold (for example, 6). When determining that the first clock level is greater than the clock level threshold, the first device determines that the first clock level is not better than the clock level threshold.

[0087] The second situation: the first clock level is not better than the clock level threshold includes that the first clock level is greater than or equal to the clock level threshold.

[0088] The clock level threshold is a clock level used to characterize the state in which the clock device loses the time signal and the clock device is available while maintaining time. For example, the clock level threshold is 7, and the first clock level is not better than the clock level threshold when the first clock level is greater than or equal to (that is, ≥) the clock level threshold, that is, the first clock level is not less than the clock level threshold. In a specific embodiment, the first device determines whether the first clock level is less than the clock level threshold (for example, 7). When it is determined that the first clock level is not less than (that is, greater than or equal to) the clock level threshold (for example, 7), the first device determines that the first clock level is not better than the clock level threshold (for example, 7).

[0089] The third situation: the first clock level is not better than the clock level threshold includes that the first clock level is not in the clock level set.

[0090] The clock level threshold is within the clock level set. The clock levels within the clock level set include: a clock level (e.g., 6) for characterizing a state in which a clock device normally tracks a time signal, and / or a clock level (e.g., 7) for characterizing a state in which a clock device loses a time signal and the clock device is available while maintaining time, and / or a default clock level (e.g., 127). For example, the clock level set is any one of the following: {6}, {7}, {127}, {6,127}, {7,127}, {6,7}, {6,7,127}.

[0091] In a specific embodiment, the first device determines whether the first clock level is in the clock level set. If it is determined that the first clock level is not in the clock level set, the first device determines that the first clock level is not better than the clock level threshold.

[0092] In the above three cases, the time signal may be a satellite signal, the clock device is a clock server or a device with a clock function connected between the first device and the clock server, and the clock device is on a clock synchronization path (e.g., a 1588 synchronization path). For example, the clock device is the previous hop device of the first device and the clock device is on a clock synchronization path (e.g., a 1588 synchronization path).

[0093] In an optional embodiment, the attribute set defaultDS of the first device includes at least one of a defaultDS.clockClassSet field and a defaultDS.clockClassThreshold field, the defaultDS.clockClassSet field is used to record the clock class set, and the defaultDS.clockClassThreshold field is used to record the clock class threshold.

[0094] In an embodiment of the present application, the clock source determined by the first device according to the first clock identifier and the second clock identifier can be a root clock source or a master clock source. The root clock source is a clock server. The master clock source is located between the clock server and the first device and is on a clock synchronization path (e.g., a 1588 synchronization path). For example, the master clock source is the previous hop device of the first device and the master clock source is on a clock synchronization path (e.g., a 1588 synchronization path). The master clock source is the previous hop tracking source device of the first device. In an optional embodiment, when the first device determines that the first clock level is not better than the clock level threshold, the first device determines whether the first clock identifier is the same as the second clock identifier. When the first device determines that the first clock identifier is the same as the second clock identifier, the first device determines that the clock server identified by the first clock identifier (i.e., the first clock server) and the clock server identified by the second clock identifier (i.e., the second clock server) are the same clock server, and then the first device determines that the first clock message and the second clock message originate from the same clock server. The first device determines the clock source according to the shortest path principle. In this case, the clock source determined by the first device can be the master clock source. For example, the first device determines the clock synchronization path from the first device to the clock server according to the shortest path principle. For example, the first device determines the clock synchronization path from the first device to the clock server according to the shortest path principle based on the first hop number in the first data set and the second hop number in the second data set. The first device determines the clock source (i.e., the master clock source) according to the clock synchronization path. In one example, the first hop number is the number of hops that the first clock message passes from the first clock server to the first device, and the second hop number is the number of hops that the second clock message passes from the second clock server to the first device. The first device determines the minimum hop number of the first hop number and the second hop number. The first device determines the transmission path of the clock message corresponding to the minimum hop number as the clock synchronization path, and the first device determines the previous hop device of the first device on the clock synchronization path as the clock source. In the case where the previous hop device is a clock server, the clock source is the master clock source, and the clock source is also the root clock source. Further, the first device adjusts the time of the first device according to the time information carried by the clock message corresponding to the minimum hop number to synchronize with the clock source. When the first device determines that the first clock identifier is different from the second clock identifier, the first device determines that the clock server identified by the first clock identifier and the clock server identified by the second clock identifier are not the same clock server, and further determines that the first clock message and the second clock message originate from different clock servers. The first device determines the target clock identifier in the first clock identifier and the second clock identifier, and the first device determines the clock server identified by the target clock identifier as the clock source. In this case, the clock source determined by the first device is the root clock source.For example, the first clock identifier and the second clock identifier are both expressed in numerical values ​​or characters, the target clock identifier is the smallest clock identifier between the first clock identifier and the second clock identifier, the first clock identifier and the second clock identifier being the same can also be described as the first clock identifier and the second clock identifier being equal, and the first clock identifier and the second clock identifier being different can also be described as the first clock identifier and the second clock identifier being unequal, and the embodiments of the present application do not limit this.

[0095] In a specific embodiment, when the first device determines that the first clock level is not better than the clock level threshold, the first device compares the first clock identifier with the second clock identifier. By comparing, the first device can determine the size relationship between the first clock identifier and the second clock identifier, and the size relationship between the first clock identifier and the second clock identifier includes that the first clock identifier is equal to (that is, the same as) the second clock identifier, the first clock identifier is greater than the second clock identifier, or the first clock identifier is less than the second clock identifier. When the first device determines that the first clock identifier is equal to (that is, the same as) the second clock identifier, the first device determines the clock source according to the shortest path principle, and the clock source determined by the first device may be the master clock source. When the first device determines that the first clock identifier is greater than the second clock identifier, the first device determines that the second clock identifier is the smallest clock identifier between the first clock identifier and the second clock identifier, so the first device determines that the second clock identifier is the target clock identifier, and the first device determines the clock server identified by the second clock identifier (that is, the second clock server) as the clock source, and the clock source determined by the first device may be the root clock source. When the first device determines that the first clock identifier is smaller than the second clock identifier, the first device determines that the first clock identifier is the smallest clock identifier between the first clock identifier and the second clock identifier. Therefore, the first device determines that the first clock identifier is the target clock identifier. The first device determines the clock server identified by the first clock identifier (that is, the first clock server) as the clock source. The clock source determined by the first device may be a root clock source.

[0096] In an optional embodiment, after the first device obtains the first data set and the second data set, the first device determines whether the first data set and the second data set meet a preset condition. In the case of determining that the first data set and the second data set meet the preset condition, the first device determines whether the first clock level in the first data set is better than the clock level threshold. In one embodiment, the first data set includes a first clock level and a first clock identifier, and also includes at least one of a first clock accuracy, a first clock offset ratio logarithmic variance, a first clock priority, a first local priority, and a first hop count. The second data set includes a second clock level and a second clock identifier, and also includes at least one of a second clock accuracy, a second clock offset ratio logarithmic variance, a second clock priority, a second local priority, and a second hop count. The first clock level, the first clock identifier, the first clock accuracy, the first clock offset ratio logarithmic variance, the first clock priority, the first local priority, the first number of hops, the second clock level, the second clock identifier, the second clock accuracy, the second clock offset ratio logarithmic variance, the second clock priority, the second local priority and the second number of hops are all expressed numerically, and the preset condition includes at least one of the following: the first clock level is equal to the second clock level, the first clock accuracy is equal to the second clock accuracy, the first clock offset ratio logarithmic variance is equal to the second clock offset ratio logarithmic variance, the first clock priority is equal to the second clock priority, and the first local priority is equal to the second local priority. Specifically, the first data set includes a first clock level, a first clock identifier, a first clock accuracy, a first clock offset ratio logarithmic variance, a first clock priority, and a first local priority; the second data set includes a second clock level, a second clock identifier, a second clock accuracy, a second clock offset ratio logarithmic variance, a second clock priority, and a second local priority; the preset condition includes: the first clock level is equal to the second clock level, the first clock accuracy is equal to the second clock accuracy, the first clock offset ratio logarithmic variance is equal to the second clock offset ratio logarithmic variance, the first clock priority is equal to the second clock priority, and the first local priority is equal to the second local priority. That is, when the first clock level is equal to the second clock level, the first clock accuracy is equal to the second clock accuracy, the first clock offset ratio logarithmic variance is equal to the second clock offset ratio logarithmic variance, the first clock priority is equal to the second clock priority, and the first local priority is equal to the second local priority, the first device determines whether the first clock level in the first data set is better than the clock level threshold.

[0097] Optionally, the first data set includes a first hop count, the second data set includes a second hop count, and the clock source selection method further includes the following step S403.

[0098] S403. When the first clock level is better than the clock level threshold, the first device determines a clock source according to a first hop count in the first data set and a second hop count in the second data set.

[0099] The first device determines whether the first clock level in the first data set is better than the clock level threshold. When it is determined that the first clock level is better than the clock level threshold, the first device determines the clock source according to the first hop count in the first data set and the second hop count in the second data set. In an embodiment of the present application, the first clock level is better than the clock level threshold including any one of the following three situations.

[0100] The first case (corresponding to the first case in S402 where the first clock level is not better than the clock level threshold): the first clock level being better than the clock level threshold includes the first clock level being less than or equal to (ie, ≤) the clock level threshold.

[0101] The clock level threshold is a clock level used to characterize the state of the clock device tracking the time signal normally. For example, the clock level threshold is 6. The first clock level is better than the clock level threshold (for example, 6) when the first clock level is less than or equal to (that is, ≤) the clock level threshold (for example, 6). In a specific embodiment, the first device determines whether the first clock level is greater than the clock level threshold (for example, 6). When it is determined that the first clock level is not greater than the clock level threshold (for example, 6), the first device determines that the first clock level is better than the clock level threshold (for example, 6).

[0102] The second case (corresponding to the second case in S402 where the first clock level is not better than the clock level threshold): the first clock level is better than the clock level threshold includes the first clock level being less than the clock level threshold.

[0103] The clock level threshold is a clock level used to characterize that a time signal of a clock device is lost and the clock device is in a state of maintaining time availability. For example, the clock level threshold is 7, and the first clock level is better than the clock level threshold when the first clock level is less than the clock level threshold. In a specific embodiment, the first device determines whether the first clock level is less than the clock level threshold (for example, 7). If it is determined that the first clock level is less than the clock level threshold, the first device determines that the first clock level is better than the clock level threshold.

[0104] The third case (corresponding to the third case in S402 where the first clock level is not better than the clock level threshold): the first clock level is better than the clock level threshold including that the first clock level is in the clock level set.

[0105] The clock level threshold is within the clock level set. The clock levels within the clock level set include: a clock level (e.g., 6) for characterizing a state in which a clock device is tracking a time signal normally; and / or a clock level (e.g., 7) for characterizing a state in which a clock device loses a time signal and the clock device is maintaining time availability; and / or a default clock level (e.g., 127). For example, the clock level set is any one of the following: {6}, {7}, {127}, {6,127}, {7,127}, {6,7}, {6,7,127}.

[0106] In a specific embodiment, the first device determines whether the first clock level is within the clock level set. If it is determined that the first clock level is within the clock level set, the first device determines that the first clock level is better than the clock level threshold.

[0107] In an embodiment of the present application, the clock source determined by the first device according to the first hop count in the first data set and the second hop count in the second data set can be a root clock source or a master clock source. The root clock source is a clock server. The master clock source is located between the clock server and the first device and the master clock source is on a clock synchronization path (e.g., a 1588 synchronization path). For example, the master clock source is the previous hop device of the first device and the master clock source is on a clock synchronization path (e.g., a 1588 synchronization path). The master clock source is the previous hop tracking source device of the first device. In an optional embodiment, when the first device determines that the first clock level is better than the clock level threshold, the first device determines the clock source according to the first hop count in the first data set and the second hop count in the second data set according to the shortest path principle. For example, the first hop count is the number of hops that the first clock message passes from the first clock server to the first device, and the second hop count is the number of hops that the second clock message passes from the second clock server to the first device. In one embodiment, the first data set also includes a first clock identifier, the second data set also includes a second clock identifier, the first device determines the first clock server according to the first clock identifier, the first device determines the second clock server according to the second clock identifier, the first clock server and the second clock server are not the same clock server, the first device determines the clock server closer to the first device (e.g., the closest) among the first clock server and the second clock server according to the shortest path principle based on the first hop number in the first data set and the second hop number in the second data set as the clock source, in this case, the clock source determined by the first device is the root clock source. In another embodiment, the first data set also includes the first clock identifier, the second data set also includes the second clock identifier, the first device determines the first clock server according to the first clock identifier, the first device determines the second clock server according to the second clock identifier, the first clock server and the second clock server are the same clock server, the first device determines the minimum hop number of the first hop number and the second hop number, the first device determines the transmission path of the clock message corresponding to the minimum hop number as the clock synchronization path, the first device determines the previous hop device of the first device on the clock synchronization path as the clock source, in this case, the clock source determined by the first device is the main clock source. Further, the first device adjusts the time of the first device according to the time information (e.g., GM information) carried by the clock message corresponding to the minimum number of hops to synchronize with the clock source. The implementation process of the first device determining the clock source according to the shortest path principle can refer to the data set comparison algorithm Part 2 defined in the IEEE 1588v2 standard, and the embodiments of the present application will not be repeated here.

[0108] In an optional embodiment, the preset condition in S402 includes that the first clock level is equal to the second clock level. That is, when the first clock level is equal to the second clock level, the first device determines whether the first clock level in the first data set is better than the clock level threshold. It can be understood that, when the first clock level is equal to the second clock level, "the first device determines whether the first clock level in the first data set is better than the clock level threshold" can be replaced by "the first device determines whether the second clock level in the second data set is better than the clock level threshold", S402 can be replaced by "when the second clock level is not better than the clock level threshold, the first device determines the clock source according to the first clock identifier and the second clock identifier", and S403 can be replaced by "when the second clock level is better than the clock level threshold, the first device determines the clock source according to the first hop count in the first data set and the second hop count in the second data set". That is, when the first clock level is equal to the second clock level, the first device can compare any clock level of the first clock level and the second clock level with the clock level threshold to determine whether to determine the clock source according to the clock identifier or to determine the clock source according to the shortest path principle, and the embodiment of the present application does not limit this.

[0109] In an embodiment of the present application, after the first device determines the clock source, the first device adjusts the time of the first device according to the time information (e.g., GM information) carried in the clock message received from the clock source to synchronize with the clock source. In one embodiment, when the first clock level is not better than the clock level threshold and the first clock identifier is the same as the second clock identifier, the first device adjusts the time of the first device according to the time information carried in the clock message with the smallest number of hops in the received first clock message and the second clock message to synchronize with the clock source.

[0110] In an optional embodiment, after the first device determines the clock source, the 1588 state of the port of the first device is determined according to the clock message received by the first device and the clock source determined by the first device, so that the 1588 synchronization path in the communication network can be determined based on the 1588 state of the port of each device determined by each device in the communication network where the first device is located. For example, the communication network where the first device is located is as follows Figure 1 In the case where the first data set and the second data set meet the preset conditions and the first clock level is better than the clock level threshold, each device in the 1588 network determines the clock source according to the shortest path principle, and each device in the 1588 network determines the 1588 status of the port according to the received clock message and the determined clock source as shown in FIG. Figure 3 As shown, the 1588 synchronization paths corresponding to base stations 1 to 5 are determined based on the 1588 states of the ports of each device in the 1588 network. Figure 3When the first data set and the second data set meet the preset conditions and the first clock level is not better than the clock level threshold and the first clock identifier is different from the second clock identifier, each device in the 1588 network determines the clock source according to the smallest clock identifier of the first clock identifier and the second clock identifier. The 1588 state of the port determined by each device in the 1588 network according to the received clock message and the determined clock source is as shown in Figure 2 As shown, the 1588 synchronization paths corresponding to base stations 1 to 5 are determined based on the 1588 states of the ports of each device in the 1588 network. Figure 2 shown.

[0111] In summary, the technical solution provided by the embodiment of the present application, when the first clock level is not better than the clock level threshold, indicates that the clock performance corresponding to the first clock level is relatively poor, so the first device determines the clock source according to the first clock identifier and the second clock identifier, thereby making it possible for the clock sources determined by different devices to be the same clock source (e.g., the root clock source) when the first clock level is not better than the clock level threshold. For example, when the first clock level is not better than the clock level threshold and the first clock identifier is different from the second clock identifier, the clock sources determined by different devices can be the same root clock source, and different devices can track the same root clock source, which can reduce the difference in time synchronization accuracy between different devices and improve time synchronization accuracy. When the first clock level is better than the clock level threshold, it indicates that the clock performance corresponding to the first clock level is relatively good, so the first device determines the clock source according to the first hop count and the second hop count, thereby making it possible for the clock message corresponding to the clock source determined by the first device (e.g., the clock message received by the first device from the clock source) to reach the first device. The number of hops is small (e.g., minimum), which helps to improve the time synchronization accuracy of the first device. In addition, in the technical solution provided in the embodiment of the present application, the clock level threshold is configurable, so the device has high flexibility in determining the clock source based on the clock level and the flexibly configured clock level threshold, and can ensure that the clock level threshold is compatible with the current ITU-T G.8275.1 standard and ITU-T G.8275.2 standard. The technical solution provided in the embodiment of the present application can ensure that the time deviation between different devices (such as base stations) is maintained within the required range (such as 3us), ensuring that 5G services can operate normally.

[0112] It should be noted that the above "S401", "S402", and "S403" are only used as the numbers of the steps in the embodiment of the present application, and are not used to limit the execution order of the steps in the embodiment of the present application. The order of the steps in the embodiment of the present application can be adjusted, and the steps can also be appropriately increased or decreased. For example, according to the relationship between the first clock level and the clock level threshold, only one of S402 and S403 can be actually executed.

[0113] As described above, the first device determines whether the first clock level in the first data set is better than the clock level threshold when it determines that the first data set and the second data set meet the preset condition, and then determines to execute S402 or S403 according to the judgment result. In an optional embodiment, when the first device determines that the first data set and the second data set do not meet the preset condition, the first device determines that the clock server identified by the first clock identifier or the clock server identified by the second clock identifier is the clock source according to the condition that the first data set and the second data set do not meet.

[0114] Take the example that the first data set includes the first clock level, the first clock identifier, the first clock accuracy, the first clock offset ratio logarithmic variance, the first clock priority, the first local priority and the first hop count, and the second data set includes the second clock level, the second clock identifier, the second clock accuracy, the second clock offset ratio logarithmic variance, the second clock priority, the second local priority and the second hop count. For example, the first clock level and the second clock level are both GM clock levels, the first clock identifier and the second clock identifier are both GM clock identifiers, the first clock accuracy and the second clock accuracy are both GM clock accuracy, the first clock offset ratio logarithmic variance and the second clock offset ratio logarithmic variance are both GM clock offset ratio logarithmic variance, the first clock priority and the second clock priority are both GM clock priorities (for example, GM clock priority 2), the first clock level, the first clock identifier, the first clock accuracy, the first clock offset ratio logarithmic variance, the first clock priority, the first local priority, the first hop count, the second clock level, the second clock identifier, the second clock accuracy, the second clock offset ratio logarithmic variance, the second clock priority, the second local priority and the second hop count are all expressed in numerical values, and the preset conditions include that the first clock level is equal to the second clock level, the first clock accuracy is equal to the second clock accuracy, the first clock offset ratio logarithmic variance is equal to the second clock offset ratio logarithmic variance, the first clock priority is equal to the second clock priority and the first local priority is equal to the second local priority. As an example, please refer to Figure 5 , which shows a flow chart of another clock source selection method provided by an embodiment of the present application. Figure 5 The clock source selection method shown is illustrated by taking the first device as an example.

[0115] like Figure 5As shown, after the first device acquires the first data set and the second data set, the first device sequentially compares the GM clock level in the first data set with the GM clock level in the second data set, the GM clock accuracy in the first data set with the GM clock accuracy in the second data set, the logarithmic variance of the GM clock offset ratio in the first data set with the logarithmic variance of the GM clock offset ratio in the second data set, the GM clock priority in the first data set with the GM clock priority in the second data set, and the local priority in the first data set (i.e., the first local priority) with the local priority in the second data set (i.e., the second local priority). When the first device determines through comparison that the GM clock level in the first data set is equal to the GM clock level in the second data set, the GM clock accuracy in the first data set is equal to the GM clock accuracy in the second data set, the logarithmic variance of the GM clock offset ratio in the first data set is equal to the logarithmic variance of the GM clock offset ratio in the second data set, the GM clock priority in the first data set is equal to the GM clock priority in the second data set, and the local priority in the first data set is equal to the local priority in the second data set, the first device determines that the first data set and the second data set meet the preset condition, and then the first device determines whether the GM clock level in the first data set is better than the clock equal threshold. In the case where it is determined that the GM clock level in the first data set is better than the clock equal threshold, the first device selects the clock source according to the shortest path principle based on the number of hops in the first data set and the number of hops in the second data set. In the case where the GM clock level in the first data set is not better than the clock equal threshold, the first device determines the clock source according to the GM clock identifier in the first data set and the GM clock identifier in the second data set. Specifically, the first device compares the GM clock identifier in the first data set with the GM clock identifier in the second data set; in the case where it is determined that the GM clock identifier in the first data set is equal to the GM clock identifier in the second data set, the first device selects the clock source and determines the clock synchronization path according to the shortest path principle based on the number of hops in the first data set and the number of hops in the second data set; in the case where it is determined that the GM clock identifier in the first data set is greater than the GM clock identifier in the second data set, the first device determines that the clock server corresponding to the second data set is the clock source, and the clock server corresponding to the second data set is also the source end of the second clock message; in the case where it is determined that the GM clock identifier in the first data set is less than the GM clock identifier in the second data set, the first device determines that the clock server corresponding to the first data set is the clock source, and the clock server corresponding to the first data set is also the source end of the first clock message. That is, when the first device determines that the GM clock identifier in the first data set is not equal to the GM clock identifier in the second data set, the first device determines the clock server identified by the smallest clock identifier between the GM clock identifier in the first data set and the clock identifier in the second data set as the clock source, which is the root clock source.

[0116] like Figure 5As shown, when the first device determines through comparison that any GM information in the GM clock level, GM clock accuracy, GM clock offset ratio logarithmic variance, GM clock priority, and local priority in the first data set is not equal to the corresponding GM information in the second data set, the first device selects a clock source according to the smaller GM information between the any GM information in the first data set and the GM information corresponding to the second data set. For example, when the first device determines through comparison that the GM clock level in the first data set is greater than the GM clock level in the second data set, the first device determines the clock server corresponding to the second data set as the clock source (that is, determines the clock server corresponding to the GM clock level in the second data set as the clock source). When the first device determines through comparison that the GM clock level in the first data set is less than the GM clock level in the second data set, the first device determines the clock server corresponding to the first data set as the clock source (that is, determines the clock server corresponding to the GM clock level in the first data set as the clock source). That is, when the first device determines through comparison that the GM clock level in the first data set is not equal to the GM clock level in the second data set, the first device determines the clock server corresponding to the smaller GM clock level of the GM clock level in the first data set and the GM clock level in the second data set as the clock source, and the clock server corresponding to the smaller GM clock level is the source end of the clock message including the smaller GM clock level. When the first device determines through comparison that the GM clock level in the first data set is equal to the GM clock level in the second data set, the first device compares the GM clock accuracy in the first data set with the GM clock accuracy in the second data set. When the first device determines through comparison that the GM clock accuracy in the first data set is greater than the GM clock accuracy in the second data set, the first device determines the clock server corresponding to the second data set as the clock source (that is, determines the clock server corresponding to the GM clock accuracy in the second data set as the clock source). When the first device determines through comparison that the GM clock accuracy in the first data set is less than the GM clock accuracy in the second data set, the first device determines the clock server corresponding to the first data set as the clock source (that is, determines the clock server corresponding to the GM clock accuracy in the first data set as the clock source). That is, when the first device determines through comparison that the GM clock accuracy in the first data set is not equal to the GM clock accuracy in the second data set, the first device determines the clock server corresponding to the smaller GM clock accuracy in the first data set and the GM clock accuracy in the second data set as the clock source, and the clock server corresponding to the smaller GM clock accuracy is the source end of the clock message including the smaller GM clock accuracy. When the first device determines through comparison that the GM clock accuracy in the first data set is equal to the GM clock accuracy in the second data set, the first device compares the logarithmic variance of the GM clock offset ratio in the first data set with the logarithmic variance of the GM clock offset ratio in the second data set.Similarly, when the first device determines through comparison that the GM clock offset ratio logarithmic variance in the first data set is not equal to the GM clock offset ratio logarithmic variance in the second data set, the first device determines the clock server corresponding to the smaller GM clock offset ratio logarithmic variance of the GM clock offset ratio logarithmic variance in the first data set and the GM clock offset ratio logarithmic variance in the second data set as the clock source, and the clock server corresponding to the smaller GM clock offset ratio logarithmic variance is the source end of the clock message including the smaller GM clock offset ratio logarithmic variance. When the first device determines through comparison that the GM clock offset ratio logarithmic variance in the first data set is equal to the GM clock offset ratio logarithmic variance in the second data set, the first device compares the GM clock priority in the first data set with the GM clock priority in the second data set. When the first device determines by comparison that the GM clock priority in the first data set is not equal to the GM clock priority in the second data set, the first device determines the clock server corresponding to the smaller GM clock priority of the GM clock priority in the first data set and the GM clock priority in the second data set as the clock source, and the clock server corresponding to the smaller GM clock priority is the source end of the clock message including the smaller GM clock priority; when the first device determines by comparison that the GM clock priority in the first data set is equal to the GM clock priority in the second data set, the first device compares the local priority in the first data set with the local priority in the second data set. When the first device determines by comparison that the local priority in the first data set is not equal to the local priority in the second data set, the first device determines the clock server corresponding to the smaller local priority of the local priority in the first data set and the local priority in the second data set as the clock source, and the clock server corresponding to the smaller local priority is the source end of the first clock message and the target clock message in the first clock message, and the target clock message is received by the first device through the port of the smaller local priority. When the first device determines by comparison that the local priority in the first data set is equal to the local priority in the second data set, the first device determines whether the GM clock level in the first data set is better than the clock level threshold.

[0117] As mentioned above, the clock level threshold is a clock level (e.g., 6) used to characterize the state of the clock device tracking the time signal normally, the first clock level is not better than the clock level threshold is the first clock level is greater than the clock level threshold, the first clock level is better than the clock level threshold is the first clock level is less than or equal to (that is, ≤) the clock level threshold. Alternatively, the clock level threshold is a clock level (e.g., 7) used to characterize the state in which the clock device loses the time signal and the clock device is available while maintaining time, the first clock level is not better than the clock level threshold is the first clock level is greater than or equal to (that is, ≥) the clock level threshold, the first clock level is better than the clock level threshold is the first clock level is less than the clock level threshold. Alternatively, the clock level threshold is within the clock level set, the first clock level is not better than the clock level threshold includes the first clock level not being within the clock level set, and the first clock level is better than the clock level threshold includes the first clock level being within the clock level set. Wherein, the clock device can be a clock server or a network device with a clock function.

[0118] In one embodiment, the clock level threshold is 6, the first clock level is not better than the clock level threshold is the first clock level is greater than 6, the first clock level is better than the clock level threshold is the first clock level is less than or equal to (ie ≤) 6. In this embodiment, the clock source selection method provided in the embodiment of the present application is as follows Figure 6 shown. Figure 6 and Figure 5 The difference is that Figure 5 In the above description, “determine whether the GM clock level in the first data set is better than the clock equal to threshold” is replaced with “determine whether the GM clock level in the first data set is less than or equal to 6”.

[0119] In another embodiment, the clock level threshold is 7, the first clock level is not better than the clock level threshold is that the first clock level is greater than or equal to (that is, ≥) 7, and the first clock level is better than the clock level threshold is that the first clock level is less than 7. In this embodiment, the clock source selection method provided in the embodiment of the present application is as follows Figure 7 shown. Figure 7 and Figure 5 The difference is that Figure 5 The step “determine whether the GM clock level in the first data set is better than the clock equal to threshold” is replaced with “determine whether the GM clock level in the first data set is less than 7”.

[0120] In another embodiment, the first clock level is not better than the clock level threshold includes that the first clock level is not in the clock level set, and the first clock level is better than the clock level threshold includes that the first clock level is in the clock level set. In this embodiment, the clock source selection method provided in the embodiment of the present application is as follows: Figure 8 shown. Figure 8 and Figure 5 The difference is that Figure 5 The phrase “determine whether the GM clock level in the first data set is better than the clock equal threshold” is replaced with “determine whether the GM clock level in the first data set is within the clock level set”.

[0121] Figures 6 to 8 The relevant description of the illustrated embodiment can be referred to Figure 5 The description of the illustrated embodiment will not be repeated here.

[0122] It should be noted that, when the GM clock level of a clock device (such as a clock server) is greater than 6, for example, when the GM clock level of a clock device (such as a clock server) is greater than or equal to 7, the clock device (such as a clock server) loses the time signal and is in a time holding state. Figure 6 and Figure 7 It can be seen from the illustrated embodiment that: when the GM clock level in the first data set is greater than 6 (for example, ≥7) and the GM clock identifier in the first data set is not equal to the GM clock identifier in the second data set, the first device determines the clock server identified by the smallest clock identifier of the GM clock identifier in the first data set and the GM clock identifier in the second data set as the clock source, and other devices in the communication network where the first device is located are also determined as clock sources accordingly. Therefore, the clock source determined by different devices in the communication network is the same clock server, and different devices in the communication network track the same clock server, which can ensure that the time deviation between different devices in the communication network (for example, base stations) is maintained within 3us; when the GM clock level in the first data set is less than 6, the first device is determined as the clock source according to the shortest path principle. Therefore, the clock sources determined by different devices in the communication network can be different, and different devices in the communication network can track different clock servers. Each device tracks the clock server with the shortest path to itself, which can ensure the accuracy of time synchronization and ensure that the time deviation between different devices in the communication network (for example, base stations) is maintained within 3us. That is, when the clock signal is relatively poor (for example, the GM clock level is greater than 6), the devices in the communication network track the same clock server; when the clock signal is good (for example, the GM clock level is less than or equal to 6), the devices in the communication network track the clock server with the shortest path to themselves, which helps to ensure the accuracy of time synchronization.

[0123] In an embodiment of the present application, the first device includes a main control board and at least one interface board. The main control board includes a clock source selection unit, the interface board includes a message transceiver unit and a network interface, the network interface is used to receive clock messages, the message transceiver unit is used to transmit clock messages between the network interface and the clock source selection unit, and the clock source selection unit is used to execute all or part of the steps of the clock source selection method provided in the embodiment of the present application to perform clock source selection, and determine the 1588 status of each network interface of the first device. For example, the clock source selection unit is used to generate a data set according to the clock message transmitted by the message transceiver unit, and then perform clock source selection based on the data set. For example, the clock source selection unit is a 1588 source selection unit, and the clock message is a 1588 message. As an example, the first device such as Fig. 9 shown.

[0124] The above is an introduction to the method embodiment of the present application. The following is an introduction to the device embodiment of the present application. The device of the present application can be used to execute the method of the present application. For details not disclosed in the device embodiment of the present application, please refer to the method embodiment.

[0125] Please refer to Fig.10 , which shows a schematic diagram of a clock source selection device 1000 provided in an embodiment of the present application. The clock source selection device 1000 is applied to a first device. For example, the clock source selection device 1000 is the first device or a functional component in the first device, for example, the clock source selection device 1000 is Fig. 9 The clock source selection unit in the first device shown. The clock source selection device 1000 is used to perform Figures 4 to 8 The clock source selection method provided by any embodiment. For example, the first device is as follows Figure 1 In the 1588 network shown in FIG. 1, any NE among NE1 to 10 or any base station among base stations 1 to 5, the clock server involved in the following description includes the following: Figure 1 At least one of the 1588 server 1 and the 1588 server 2 in the 1588 network shown. Fig.10 The clock source selection device 1000 includes an acquisition module 1010 and a source selection module 1020 .

[0126] The acquisition module 1010 is used to acquire a first data set and a second data set, wherein the first data set includes a first clock level and a first clock identifier, and the second data set includes a second clock identifier. The functional implementation of the acquisition module 1010 may refer to the relevant description in the above S401.

[0127] The source selection module 1020 is used to determine the clock source according to the first clock identifier and the second clock identifier when the first clock level is not better than the clock level threshold, and the clock level threshold is configurable. The function implementation of the source selection module 1020 can refer to the relevant description in the above S402.

[0128] Optionally, the first data set includes a first hop count, the second data set includes a second hop count, and the source selection module 1020 is further configured to determine the clock source according to the first hop count and the second hop count when the first clock level is better than the clock level threshold. The function implementation of the source selection module 1020 can also refer to the relevant description in the above S403.

[0129] In an optional embodiment, the first clock level is not better than the clock level threshold includes the first clock level being greater than the clock level threshold, and the first clock level is better than the clock level threshold includes the first clock level being less than or equal to (i.e., not greater than) the clock level threshold, and the clock level threshold is a clock level used to characterize the state of a clock device normally tracking a time signal.

[0130] In another optional embodiment, the first clock level is not better than the clock level threshold includes the first clock level being greater than or equal to (i.e., not less than) the clock level threshold, and the first clock level is better than the clock level threshold includes the first clock level being less than the clock level threshold, and the clock level threshold is a clock level used to characterize a state in which a clock device loses a time signal and the clock device is in a state of maintaining time availability.

[0131] In another optional embodiment, the first clock level is not better than the clock level threshold includes that the first clock level is not in the clock level set, the first clock level is better than the clock level threshold includes that the first clock level is in the clock level set, the clock level threshold is in the clock level set, the clock levels in the clock level set include: a clock level used to characterize a state in which a clock device is normally tracking a time signal, and / or a clock level used to characterize a state in which a clock device loses a time signal and the clock device is available while maintaining time, and / or a default clock level.

[0132] Optionally, the clock device is a clock server (such as a 1588 server) or a device with a clock function in a time synchronization network.

[0133] Optionally, the attribute set defaultDS of the first device includes a clock class set defaultDS.clockClassSet field, and the defaultDS.clockClassSet field is used to record the clock class set.

[0134] Optionally, the attribute set defaultDS of the first device includes a clock class threshold defaultDS.clockClassThreshold field, and the defaultDS.clockClassThreshold field is used to record the clock class threshold.

[0135] In summary, the technical solution provided by the embodiment of the present application, when the first clock level is not better than the clock level threshold, indicates that the clock performance corresponding to the first clock level is relatively poor, so the first device determines the clock source according to the first clock identifier and the second clock identifier, thereby making it possible for the clock sources determined by different devices to be the same clock source when the first clock level is not better than the clock level threshold, for example, when the first clock level is not better than the clock level threshold and the first clock identifier is different from the second clock identifier, the clock sources determined by different devices can be the same root clock source, and different devices can track the same root clock source, which can reduce the difference in time synchronization accuracy between different devices and improve time synchronization accuracy. When the first clock level is better than the clock level threshold, it indicates that the clock performance corresponding to the first clock level is relatively good, so the first device determines the clock source according to the first hop count and the second hop count, thereby making it possible for the clock message corresponding to the clock source determined by the first device (for example, the clock message received by the first device from the clock source) to reach the first device. The number of hops is small (for example, the minimum), which helps to improve the time synchronization accuracy of the first device. In addition, in the technical solution provided in the embodiment of the present application, the clock level threshold is configurable, so the device has high flexibility in determining the clock source based on the clock level and the flexibly configured clock level threshold, and can ensure that the clock level threshold is compatible with the current ITU-T G.8275.1 standard and ITU-T G.8275.2 standard. The technical solution provided in the embodiment of the present application can ensure that the time deviation between different devices (such as base stations) is maintained within the required range (such as 3us), ensuring that 5G services can operate normally.

[0136] The clock source selection device provided in the embodiment of the present application can also be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The above-mentioned PLD can be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. The clock source selection device provided in the above-mentioned method embodiment can also be implemented by software. When the clock source selection method provided in the above-mentioned method embodiment is implemented by software, each module in the above-mentioned clock source selection device can also be a software module, which is not limited in the embodiment of the present application.

[0137] The embodiment of the present application provides a clock source selection device, including a memory and a processor. The memory is used to store a computer program. The processor is used to execute the computer program stored in the memory so that the clock source selection device performs the following steps: Figures 4 to 8 A clock source selection method provided by any embodiment.

[0138] As an example, see Fig.11 , which shows a schematic diagram of another clock source selection device 1100 provided in an embodiment of the present application. The clock source selection device 1100 is a first device or a functional component in the first device, and the first device may be a network device. The clock source selection device 1100 is used to perform Figures 4 to 8 The clock source selection method provided by any embodiment. For example, the first device is Figure 1 Any NE in the 1588 network shown in the figure. Fig.11 As shown, the clock source selection device 1100 includes a main control board 1110, an interface board 1130 and an interface board 1140. In the case of multiple interface boards, a switching network board ( Fig.11 The switch fabric board is used to complete the data exchange between the interface boards. The main control board is also called the main processing unit (MPU) or the route processing card (route processor card), and the interface board is also called the line processing unit (LPU), line card, service board or line board. The switch fabric board is also called the switch fabric unit (SFU).

[0139] The main control board 1110 is used to complete functions such as system management, equipment maintenance, and protocol processing. The interface board 1130 and the interface board 1140 are used to provide various service interfaces and realize message forwarding. These service interfaces include, for example, Packet Over SONET / SDH (POS) interface, Gigabit Ethernet (GE) interface, and asynchronous transfer mode (ATM) interface. There are mainly three types of functional units on the main control board 1110: system management control unit, system clock unit, and system maintenance unit. The main control board 1110, the interface board 1130, and the interface board 1140 are connected to the system backplane through the system bus to achieve intercommunication. The interface board 1130 includes one or more processors 1131. The processor 1131 is used to control and manage the interface board 1130 and communicate with the central processor 1112 on the main control board 1110. The memory 1132 on the interface board 1130 is used to store forwarding information such as forwarding tables. The interface board 1130 includes one or more network interfaces 1133 for receiving and sending messages, and the specific implementation is not described here. Fig.11 As shown, the main control board 1110 also includes a memory 1114, and the memory 1114 is used to store system management information, protocols, etc. In the present application, the main control board 1110 includes a clock source selection unit (eg, a 1588 source selection unit) to execute a clock source selection algorithm.

[0140] like Fig.11 As shown, the present embodiment includes multiple interface boards, and a distributed forwarding mechanism is adopted. Under this mechanism, the operation on the interface board 1140 is substantially similar to the operation on the interface board 1130. For example, the interface board 1140 includes one or more network interfaces 1143 for receiving and sending messages, a memory 1142 for storing a forwarding table, and a processor 1141 for controlling and managing the interface board 1140 and communicating with the central processor 1112 on the main control board 1110. For the sake of brevity, the interface board 1140 is not described in detail here.

[0141] Fig.11 The processor 1131 in the interface board 1130 and / or the processor 1141 in the interface board 1140 may be dedicated hardware or chips, such as a network processor (NP) or a dedicated integrated circuit to implement the above functions. This implementation is what is commonly referred to as a forwarding plane using dedicated hardware or chip processing. In another embodiment, the processor 1131 in the interface board 1130 and / or the processor 1141 in the interface board 1140 may be a general-purpose processor, such as a central processing unit (CPU).

[0142] In addition, it should be pointed out that there may be one or more main control boards, and when there are multiple boards, they may include a main main control board and a standby main control board. There may be one or more interface boards. The stronger the data processing capability of the network device, the more interface boards are provided. In the case of multiple interface boards, the multiple interface boards can communicate with each other through one or more switching network boards, and when there are multiple boards, they can jointly realize load sharing and redundant backup. In a centralized forwarding architecture, the network device may not need a switching network board, and the interface board is responsible for the processing function of the service data of the entire system. In a distributed forwarding architecture, the network device includes multiple interface boards, and data exchange between multiple interface boards can be realized through the switching network board, providing large-capacity data exchange and processing capabilities. Therefore, the data access and processing capabilities of the network device with a distributed architecture are greater than those of the network device with a centralized architecture. Which architecture to adopt depends on the networking deployment scenario and is not limited here.

[0143] In an optional implementation, the memory 1114 and / or the memory 1132 and / or the memory 1142 is a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, an optical disc storage (including a compressed optical disc, a laser disc, an optical disc, a digital versatile disc, a Blu-ray disc, etc.), a magnetic disk or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 1132 can exist independently and be connected to the processor 1131 through a communication bus, or it can be integrated with the processor 1131. The memory 1142 may exist independently and be connected to the processor 1141 via a communication bus, or may be integrated with the processor 1141. The memory 1114 may exist independently and be connected to the central processor 1112 via a communication bus, or may be integrated with the central processor 1112. This embodiment of the application does not limit this.

[0144] The memory 1114 is used to store program codes, and the central processor 1112 controls the execution to execute some or all steps of the method provided in the above embodiment. The central processor 1112 is used to execute the program codes stored in the memory 1114. The program codes may include one or more software modules. The one or more software modules may be the above Figure 7 Functional modules provided in the illustrated embodiment. Optionally, the memory 1132 may also be used to store program codes, and the processor 1131 controls execution to execute part or all of the steps of the method provided in the above embodiment. The memory 1142 may also be used to store program codes, and the processor 1141 controls execution to execute part or all of the steps of the method provided in the above embodiment. The embodiments of the present application are not limited to this.

[0145] In an optional implementation, the network interface 1133 and the network interface 1143 may be devices using any transceiver type for communicating with other devices or networks, such as Ethernet, radio access network (RAN), wireless local area networks (WLAN), etc. The communication bus may be divided into an address bus, a data bus, a control bus, etc.

[0146] As another example, see Fig.12 , which shows a schematic diagram of another clock source selection device 1200 provided in an embodiment of the present application. The clock source selection device 1200 is a first device or a functional component in the first device. The first device may be a network device or a base station. For example, the first device is Figure 1 Any NE or any base station in the 1588 network shown. The clock source selection device 1200 is used to perform Figures 4 to 8 The clock source selection method provided by any embodiment. Fig.12 As shown, the clock source selection device 1200 includes a processor 1202, a memory 1204, a communication interface 1206 and a bus 1208. The processor 1202, the memory 1204 and the communication interface 1206 are communicatively connected via the bus 1208. In other embodiments, the processor 1202, the memory 1204 and the communication interface 1206 may also be connected in other ways.

[0147] The memory 1204 is used to store a computer program 12042, which may include instructions and data. The memory 1204 may be various types of storage media, such as RAM, ROM, non-volatile RAM (NVRAM), programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), flash memory, optical storage, registers, etc.

[0148] Among them, the processor 1202 can be a general-purpose processor, which can be a processor that performs specific steps and / or operations by reading and executing a computer program (e.g., computer program 12042) stored in a memory (e.g., memory 1204), and the general-purpose processor may use data stored in the memory in the process of performing the above steps and / or operations. The stored computer program can be executed to implement the related functions of the aforementioned acquisition module 1010 and the source selection module 1020. The general-purpose processor can be a CPU. The processor 1202 can also be a dedicated processor, which is a processor specially designed to perform specific steps and / or operations. The dedicated processor can be a digital signal processor (DSP), ASIC or FPGA, etc. The processor 1202 can also be a multi-core processor. The processor 1202 includes at least one circuit to perform all or part of the steps of the above-mentioned embodiment method.

[0149] The communication interface 1206 may include an input / output (I / O) interface, a physical interface, and a logical interface, etc., which are used to interconnect the devices inside the clock source selection device 1200, and an interface used to interconnect the clock source selection device 1200 with other devices (such as network devices). The physical interface may be a gigabit Ethernet (GE) interface, which may be used to interconnect the clock source selection device 1200 with other devices, and the logical interface is an interface inside the clock source selection device 1200, which may be used to interconnect the devices inside the clock source selection device 1200. It is easy to understand that the communication interface 1206 may be used for the clock source selection device 1200 to communicate with other devices, for example, the communication interface 1206 is used to send and receive messages between the clock source selection device 1200 and other devices.

[0150] The bus 1208 may be any type of communication bus, such as a system bus, for interconnecting the processor 1202, the memory 1204, and the communication interface 1206. The bus 1208 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.12 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0151] The above devices may be arranged on independent chips, or at least partially or completely on the same chip. Whether to arrange each device independently on different chips or to integrate them on one or more chips often depends on the needs of product design. The embodiments of the present application do not limit the specific implementation form of the above devices.

[0152] Fig.12 The clock source selection device 1200 shown is only an example, and the clock source selection device 1200 may also include other components. The clock source selection device 1200 selects a clock source by executing all or part of the steps of the method provided in the above embodiment to synchronize time with the clock source.

[0153] It should be noted that the ports, interfaces, network interfaces, communication interfaces, etc. involved in the description of the above embodiments may have the same meaning.

[0154] Based on the same inventive concept, an embodiment of the present application provides a communication system, including a first device and at least two clock devices, wherein the first device includes Figures 10 to 12 In any of the clock source selection devices shown, the first device is used to determine a clock source among the at least two clock devices, wherein the at least two clock devices include at least one of a clock server or a network device with a clock function.

[0155] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed (for example, executed by a network device, a base station, one or more processors, etc.), it implements all or part of the steps of the clock source selection method provided in the above method embodiment.

[0156] Based on the same inventive concept, an embodiment of the present application provides a computer program product, which includes a program or code. When the program or code is executed (for example, executed by a network device, a base station, one or more processors, etc.), it implements all or part of the steps of the clock source selection method provided in the above method embodiment.

[0157] The embodiment of the present application provides a chip, which includes a programmable logic circuit and / or program instructions, and when the chip is running, is used to implement all or part of the steps of the clock source selection method provided in the above method embodiment. Optionally, the chip is a processing chip.

[0158] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product, and the computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that contains one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium, or a semiconductor medium (e.g., a solid-state hard disk), etc.

[0159] It should be understood that the term "at least one" in this application refers to one or more, and "plurality" refers to two or more. In this application, unless otherwise specified, the symbol " / " generally means or, for example, A / B can represent A or B. The term "and / or" in this application is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, for the convenience of clear description, this application uses words such as "first", "second", and "third" to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art can understand that words such as "first", "second", and "third" do not limit the quantity and execution order.

[0160] Different types of embodiments such as method embodiments and device embodiments provided in the embodiments of the present application can refer to each other, the order of operations of the method embodiments can be appropriately adjusted, and the operations can be increased or decreased in response to the circumstances. Any technician familiar with the technical field can easily think of changes within the technical scope disclosed in the present application, and all of them should be covered within the scope of protection of the present application, so they will not be repeated here.

[0161] In the corresponding embodiments provided in the present application, it should be understood that the disclosed devices and the like can be implemented by other configuration methods. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical or other forms. The modules described as separate components may or may not be physically separated, and the components described as modules may or may not be physical modules, which may be located in one place or distributed on multiple network nodes. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment.

[0162] The above is only an exemplary embodiment of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A clock source selection method, characterized in that: The method comprises: The first device acquires a first data set and a second data set, where the first data set includes a first clock level and a first clock identifier, and the second data set includes a second clock identifier; When the first clock level is not better than a clock level threshold, the first device determines a clock source according to the first clock identifier and the second clock identifier, and the clock level threshold is configurable.

2. The method according to claim 1, characterized in that: The first data set includes a first hop count, the second data set includes a second hop count, and the method further includes: when the first clock level is better than the clock level threshold, the first device determines a clock source according to the first hop count and the second hop count.

3. The method according to claim 1 or 2, characterized in that: The first clock level is not better than the clock level threshold includes that the first clock level is greater than the clock level threshold.

4. The method according to claim 3, characterized in that The clock level threshold is a clock level used to characterize a state in which a clock device normally tracks a time signal.

5. The method according to claim 1 or 2, characterized in that: The first clock level is not better than the clock level threshold includes that the first clock level is greater than or equal to the clock level threshold.

6. The method according to claim 5, characterized in that The clock level threshold is a clock level used to indicate that a time signal of a clock device is lost and the clock device is in a state of maintaining time availability.

7. The method according to claim 1 or 2, characterized in that: The first clock grade being not better than the clock grade threshold includes that the first clock grade is not in a clock grade set.

8. The method according to claim 7, characterized in that The clock level threshold is within the clock level set, and the clock levels within the clock level set include: a clock level used to characterize a state in which a clock device is normally tracking a time signal, and / or a clock level used to characterize a state in which a clock device has lost a time signal and the clock device is available while maintaining time, and / or a default clock level.

9. The method according to claim 8, characterized in that The attribute set defaultDS of the first device includes a clock class set defaultDS.clockClassSet field, and the defaultDS.clockClassSet field is used to record the clock class set.

10. The method according to any one of claims 1 to 9, characterized in that: The attribute set defaultDS of the first device includes a clock class threshold defaultDS.clockClassThreshold field, and the defaultDS.clockClassThreshold field is used to record the clock class threshold.

11. A clock source selection device, characterized in that: Applied to a first device, the apparatus comprises: An acquisition module, configured to acquire a first data set and a second data set, wherein the first data set includes a first clock level and a first clock identifier, and the second data set includes a second clock identifier; A source selection module is used to determine a clock source according to the first clock identifier and the second clock identifier when the first clock level is not better than a clock level threshold, and the clock level threshold is configurable.

12. The device according to claim 11, characterized in that The first data set includes a first hop count, the second data set includes a second hop count, and the source selection module is further used to determine a clock source according to the first hop count and the second hop count when the first clock level is better than the clock level threshold.

13. The device according to claim 11 or 12, characterized in that The first clock level is not better than the clock level threshold includes that the first clock level is greater than the clock level threshold.

14. The device according to claim 13, characterized in that The clock level threshold is a clock level used to characterize a state in which a clock device normally tracks a time signal.

15. The device according to claim 11 or 12, characterized in that The first clock level is not better than the clock level threshold includes that the first clock level is greater than or equal to the clock level threshold.

16. The device according to claim 15, characterized in that The clock level threshold is a clock level used to indicate that a time signal of a clock device is lost and the clock device is in a state of maintaining time availability.

17. The device according to claim 11 or 12, characterized in that The first clock grade being not better than the clock grade threshold includes that the first clock grade is not in a clock grade set.

18. The device according to claim 17, characterized in that The clock level threshold is within the clock level set, and the clock levels within the clock level set include: a clock level used to characterize a state in which a clock device is normally tracking a time signal, and / or a clock level used to characterize a state in which a clock device has lost a time signal and the clock device is available while maintaining time, and / or a default clock level.

19. The device according to claim 18, characterized in that The attribute set defaultDS of the first device includes a clock class set defaultDS.clockClassSet field, and the defaultDS.clockClassSet field is used to record the clock class set.

20. The device according to any one of claims 11 to 19, characterized in that The attribute set defaultDS of the first device includes a clock class threshold defaultDS.clockClassThreshold field, and the defaultDS.clockClassThreshold field is used to record the clock class threshold.

21. A clock source selection device, characterized in that: including memory and processor; The memory is used to store computer programs; The processor is configured to execute the computer program stored in the memory so that the clock source selection device executes the method according to any one of claims 1 to 10.

22. A communication system, characterized in that: It comprises a first device and at least two clock devices, wherein the first device comprises the clock source selection apparatus as described in any one of claims 11 to 20, and the first device is used to determine a clock source in the at least two clock devices.

23. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 10 is implemented.

24. A computer program product, characterized in that The computer program product comprises a program or a code, and when the program or the code is executed, the method according to any one of claims 1 to 10 is implemented.

25. A chip, characterized in that: The chip implements the method according to any one of claims 1 to 10 when running.

Citation Information

Cited By

  • Clock source selection method, apparatus and communication system

    EP4794410A1

  • Clock source selection method, apparatus and communication system

    WO2025103086A1