Clock synchronization method and system, electronic equipment and storage medium
By analyzing and verifying clock synchronization information, determining the reference clock source and calculating the clock deviation value, the problem of clock inconsistency caused by different base station master clock sources is solved, and the time synchronization accuracy of the system is improved.
Patent Information
- Application Number
- CN202310856605.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-12
- Publication Date
- 2024-10-18
AI Technical Summary
In the 5G+ industrial Internet communication network architecture, the terminal side does not need to be changed. However, due to the different main clock sources of different base stations, the equipment in the complex system cannot be accurately synchronized, affecting the time accuracy.
By analyzing the received clock synchronization information, the reference clock source information is determined, and when inconsistencies are found, the clock deviation value is obtained according to different scenarios for clock verification to ensure the synchronization accuracy of the device clock information.
It improves the time synchronization accuracy of clock synchronization devices in the entire system and ensures the accuracy of clock data transmission between devices.
Smart Images

Figure CN118802045A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of clock synchronization, and in particular to a clock synchronization method, system, electronic device and storage medium. Background Art
[0002] In the 5G+Industrial Internet communication networking architecture, no changes are required on the terminal side, and the introduction of the 5G system in the end-to-end architecture can be imperceptible. When the 5G network CPE is synchronized with the base station clock, only time information is generally transmitted between the two devices. For example, the SIB9 broadcast message transmitted by the base station to the UE in the cellular network does not contain the current clock source information. Different master clock sources will cause different devices in a complex system to be unable to synchronize accurately because they refer to different master clocks. For example, some industrial gateways use the base station B code for synchronization when making a 5G connection. The master clocks referenced by different base stations may be different, resulting in the inability to guarantee the time accuracy of the entire system. Summary of the invention
[0003] The embodiments of the present application provide a clock synchronization method, system, electronic device and storage medium, aiming to improve the time synchronization accuracy of the clock synchronization device in the entire system.
[0004] In a first aspect, an embodiment of the present application provides a clock synchronization method, including:
[0005] Parse the received clock synchronization information to obtain the current clock source information;
[0006] Determine reference clock source information of a clock synchronization system, and compare the current clock source information with the reference clock source information to obtain an information comparison result;
[0007] If it is determined that the information comparison result is that the current clock source information is inconsistent with the reference clock source information, a reference clock source acquisition scenario of the reference clock source information is determined, and clock information of the device in the clock synchronization system is checked based on the reference clock source acquisition scenario.
[0008] In one embodiment, the clock verification of the clock information of the device in the clock synchronization system based on the reference clock source acquisition scenario includes:
[0009] If it is determined that the reference clock source acquisition scenario is the first acquisition scenario, then the first sending time of the network device sending the clock calibration request to the system control center is obtained, and the first receiving time of the system control center receiving the clock calibration request is obtained; the first acquisition scenario characterizes that the clock source information of the clock synchronization devices whose number proportion is greater than the preset proportion is determined as the reference clock source information;
[0010] Acquire a first initiation time when the system control center initiates a clock calibration reply to the network device, and acquire a first confirmation time when the network device initiates a clock reply confirmation to the system control center;
[0011] A first clock deviation value is calculated based on the first sending time, the first receiving time, the first initiation time, and the first confirmation time, and clock information of a device in the clock synchronization system is checked based on the first clock deviation value.
[0012] The performing clock verification on the clock information of the device in the clock synchronization system based on the reference clock source acquisition scenario includes:
[0013] If it is determined that the reference clock source acquisition scenario is the second acquisition scenario, a second sending time at which the network device sends a clock calibration request to the system control center is obtained, and a second receiving time at which the system control center receives the clock calibration request is obtained; the second acquisition scenario represents that the clock source information of the master clock synchronization device in the clock synchronization system is determined as the reference clock source information;
[0014] Acquire a second initiation time at which the system control center initiates a clock calibration reply to the network device, and acquire a second confirmation time at which the network device initiates a clock reply confirmation to the system control center;
[0015] A second clock deviation value is calculated based on the second sending time, the second receiving time, the second initiation time and the second confirmation time, and clock information of a device in the clock synchronization system is checked based on the second clock deviation value.
[0016] The performing clock verification on the clock information of the device in the clock synchronization system based on the reference clock source acquisition scenario includes:
[0017] If it is determined that the reference clock source acquisition scenario is the third acquisition scenario, a third sending time of the network device sending the clock calibration request to the system control center is obtained, and a third receiving time of the system control center receiving the clock calibration request is obtained; the third acquisition scenario represents that the clock source information inside the clock synchronization system is determined as the reference clock source information;
[0018] Acquire a third initiation time at which the system control center initiates a clock calibration reply to the network device, and acquire a third confirmation time at which the network device initiates a clock reply confirmation to the system control center;
[0019] A third clock deviation value is calculated based on the third sending time, the third receiving time, the third initiation time and the third confirmation time, and clock verification is performed on the clock information of the device in the clock synchronization system based on the third clock deviation value.
[0020] The performing clock verification on the clock information of the device in the clock synchronization system based on the reference clock source acquisition scenario includes:
[0021] If it is determined that the reference clock source acquisition scenario is the fourth acquisition scenario, clock information of the device in the clock synchronization system is clock-checked based on the first network device and the second network device at the opposite end thereof; the fourth acquisition scenario represents that clock calibration is performed between devices without determining the reference clock source information;
[0022] Accordingly, the specific steps of performing clock verification on the clock information of the device in the clock synchronization system based on the first network device and the second network device at the opposite end thereof include:
[0023] Acquire a fourth sending time at which the first network device sends a clock calibration request to the second network device, and acquire a fourth receiving time at which the second network device receives the clock calibration request;
[0024] Obtain a fourth initiation time at which the second network device initiates a clock calibration reply to the first network device, and obtain a fourth confirmation time at which the first network device initiates a clock reply confirmation to the second network device;
[0025] A fourth clock deviation value is calculated based on the fourth sending time, the fourth receiving time, the fourth initiation time and the fourth confirmation time, and clock verification is performed on the clock information of the device in the clock synchronization system based on the fourth clock deviation value.
[0026] The step of determining the reference clock source information of the clock synchronization system includes:
[0027] Acquire clock synchronization devices carrying the same target clock source information in the clock synchronization system, and determine whether the proportion of the number of the clock synchronization devices is greater than a preset proportion;
[0028] If it is determined that the quantity ratio is greater than the preset ratio, determining the target clock source information as the reference clock source information;
[0029] If it is determined that the quantity ratio is less than or equal to the preset ratio, a clock enable type is determined, and the reference clock source information is determined based on the clock enable type.
[0030] The determining the reference clock source information based on the clock enable type includes:
[0031] If it is determined that the clock enabling type is the first enabling type, the clock source information inside the clock synchronization system is determined as the reference clock source information; the first type represents the type of enabling the internal clock source information;
[0032] If it is determined that the clock enable type is the second enable type, the master clock synchronization device of the clock synchronization system is obtained, and the clock source information of the master clock synchronization device is determined as the reference clock source information; the second enable type represents the type of enabling external clock source information.
[0033] In a second aspect, an embodiment of the present application provides a clock synchronization system, including:
[0034] The parsing module is used to parse the received clock synchronization information to obtain the current clock source information;
[0035] A determination comparison module is used to determine the reference clock source information of the clock synchronization system, and compare the current clock source information with the reference clock source information to obtain an information comparison result;
[0036] The clock synchronization module is used to determine the reference clock source acquisition scenario of the reference clock source information if it is determined that the information comparison result is that the current clock source information is inconsistent with the reference clock source information, and perform clock verification on the clock information of the device in the clock synchronization system based on the reference clock source acquisition scenario.
[0037] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the clock synchronization method described in the first aspect when executing the computer program.
[0038] In a fourth aspect, an embodiment of the present application provides a non-transitory computer-readable storage medium, the non-transitory computer-readable storage medium comprising a computer program, and when the computer program is executed by a processor, the clock synchronization method described in the first aspect is implemented.
[0039] The clock synchronization method, system, electronic device and storage medium provided in the embodiments of the present application parse the received clock synchronization information to obtain the current clock source information; determine the reference clock source information of the clock synchronization system, compare the current clock source information with the reference clock source information, and obtain the information comparison result; if the information comparison result is that the current clock source information is inconsistent with the reference clock source information, then determine the reference clock source acquisition scenario of the reference clock source information, and perform clock calibration on the clock information of the device in the clock synchronization system based on the reference clock source acquisition scenario. In the process of clock synchronization, when it is determined that the current clock source information in the clock synchronization information is different from the current clock source information of the internal system, the clocks of the clock synchronization devices can be calibrated through the system control center, especially when the communication between the clock synchronization devices is not as convenient as the communication between the devices and the system control center, so that the synchronization accuracy of the time data transmission of the clock synchronization devices is more accurate, thereby improving the time synchronization accuracy of the clock synchronization devices in the entire system. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the present application or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0041] Figure 1 It is a flowchart of a clock synchronization method provided in an embodiment of the present application;
[0042] Figure 2 This is a schematic diagram of the B code expansion provided in an embodiment of the present application;
[0043] Figure 3 This is one of the clock information verification process diagrams provided in the embodiment of the present application;
[0044] Figure 4 This is the second schematic diagram of the clock information verification process provided in the embodiment of the present application;
[0045] Figure 5 This is the third schematic diagram of the clock information verification process provided in the embodiment of the present application;
[0046] Figure 6 is a schematic diagram of the structure of a clock synchronization system provided in an embodiment of the present application;
[0047] Figure 7 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0049] Figure 1 This is one of the flow charts of the clock synchronization method provided in the embodiment of the present application. Figure 1 , an embodiment of the present application provides a clock synchronization method, comprising:
[0050] Step 100, parsing the received clock synchronization information to obtain current clock source information;
[0051] Step 200, determining the reference clock source information of the clock synchronization system, and comparing the current clock source information with the reference clock source information to obtain an information comparison result;
[0052] Step 300: If it is determined that the information comparison result is that the current clock source information is inconsistent with the reference clock source information, a reference clock source acquisition scenario of the reference clock source information is determined, and clock information of the device in the clock synchronization system is checked based on the reference clock source acquisition scenario.
[0053] It should be noted that the embodiments of the present application are illustrated by a clock synchronization system. The clock synchronization system includes a system air center and multiple network devices, and the network device can be understood as a clock synchronization device. At the same time, when transmitting the synchronization clock information, the embodiments of the present application add the current clock source information, such as adding the current clock source information in the SIB 9 message, and according to the current clock source information carried by the SIB 9, carry the current clock source information in the B code information or in the non-B code information. When the clock sources of multiple devices in a complex system are inconsistent, the system needs to perform clock calibration to improve the clock synchronization information of the entire system, specifically:
[0054] Therefore, after receiving the clock synchronization information, the network device parses the clock synchronization information to obtain the current clock source information carried in the clock synchronization information.
[0055] It should be noted that the system's reference clock source information is maintained within the clock synchronization system. In a scenario where synchronous data exchange is required between devices in the clock synchronization system, when a device within the clock synchronization system receives clock synchronization information, if it is determined that the received clock synchronization information is not the reference clock source information of the current system, it is necessary to perform clock calibration within the system or use the system relative clock (local clock) to perform internal system time synchronization before synchronous data exchange can be performed between devices in the system to eliminate the synchronization time deviation caused by different clock sources and ensure synchronization accuracy.
[0056] Furthermore, the network device obtains the reference clock source information of the clock synchronization system, and compares the current clock source information with the reference clock source information to obtain an information comparison result, wherein the information comparison result may be that the current clock source information is consistent with the reference clock source information, and the information comparison result page may be that the current clock source information is inconsistent with the reference clock source information.
[0057] Furthermore, if it is determined that the information comparison result is that the current clock source information is consistent with the reference clock source information, the network device can directly interact with other network devices in the clock synchronization system for data that requires clock synchronization. Furthermore, if it is determined that the information comparison result is that the current clock source information is inconsistent with the reference clock source information, the network device determines the reference clock source acquisition scenario of the reference clock source information, obtains the clock deviation value based on the reference clock source acquisition scenario, performs clock verification on the clock information in the network device according to the clock deviation value, and then interacts with other network devices in the clock synchronization system for data that requires clock synchronization.
[0058] The clock synchronization method provided in the embodiment of the present application parses the received clock synchronization information to obtain the current clock source information; determines the reference clock source information of the clock synchronization system, compares the current clock source information with the reference clock source information, and obtains the information comparison result; if the information comparison result is that the current clock source information is inconsistent with the reference clock source information, then determines the reference clock source acquisition scenario of the reference clock source information, and performs clock calibration on the clock information of the device in the clock synchronization system based on the reference clock source acquisition scenario. In the process of clock synchronization, when it is determined that the current clock source information in the clock synchronization information is different from the current clock source information of the internal system, the clocks of the clock synchronization devices can be calibrated through the system control center, especially when the communication between the clock synchronization devices is not as convenient as the communication between the devices and the system control center, so that the synchronization accuracy of the time data transmission of the clock synchronization devices is more accurate, thereby improving the time synchronization accuracy of the clock synchronization devices in the entire system.
[0059] Based on the above embodiment, determining the reference clock source information of the clock synchronization system based on step 200 includes:
[0060] Acquire clock synchronization devices carrying the same target clock source information in the clock synchronization system, and determine whether the proportion of the number of the clock synchronization devices is greater than a preset proportion;
[0061] If it is determined that the quantity ratio is greater than the preset ratio, determining the target clock source information as the reference clock source information;
[0062] If it is determined that the quantity ratio is less than or equal to the preset ratio, a clock enable type is determined, and the reference clock source information is determined based on the clock enable type.
[0063] Specifically, the clock synchronization system obtains clock synchronization devices in the clock synchronization system that carry the same target clock source information, and determines whether the proportion of the number of clock synchronization devices is greater than a preset proportion, wherein the preset proportion is set according to actual conditions.
[0064] Further, if it is determined that the quantity ratio is greater than a preset ratio, the clock synchronization system determines the target clock source information as the reference clock source information of the clock synchronization system.
[0065] Further, if the determined quantity ratio is less than or equal to the preset ratio, the clock synchronization system determines the clock enable type and determines the reference clock source information based on the clock enable type, wherein the clock enable type is the type of whether to enable the external clock source information.
[0066] Based on the above embodiment, determining the reference clock source information based on the clock enable type includes:
[0067] If it is determined that the clock enable type is the first enable type, determining the clock source information inside the clock synchronization system as the reference clock source information;
[0068] If it is determined that the clock enable type is the second enable type, a master clock synchronization device of the clock synchronization system is acquired, and the clock source information of the master clock synchronization device is determined as the reference clock source information.
[0069] Specifically, if the clock enable type is determined to be the first enable type, the first type represents the type of enabling internal clock source information. Therefore, it can be understood that if the clock enable type is determined to be the type of enabling internal clock source information, the clock synchronization system will determine the clock source information inside the clock synchronization system as the reference clock source information of the clock synchronization system.
[0070] Further, if the clock enable type is determined to be the second enable type, the second enable type represents the type of enabling external clock source information. Therefore, it can be understood that if the clock enable type is determined to be the type of enabling external clock source information, the clock synchronization system obtains the master clock synchronization device in the clock synchronization system, and determines the clock source information of the master clock synchronization device as the reference clock source information of the clock synchronization system.
[0071] The embodiments of the present application determine the reference clock source information of the clock synchronization system in different ways, so that the reference clock source information has diversity.
[0072] Based on the above embodiment, clock verification is performed on the clock information of the device in the clock synchronization system based on the reference clock source acquisition scenario recorded in step 300, including:
[0073] If it is determined that the reference clock source acquisition scenario is the first acquisition scenario, obtaining a first sending time when the network device sends a clock calibration request to the system control center, and obtaining a first receiving time when the system control center receives the clock calibration request;
[0074] Acquire a first initiation time when the system control center initiates a clock calibration reply to the network device, and acquire a first confirmation time when the network device initiates a clock reply confirmation to the system control center;
[0075] A first clock deviation value is calculated based on the first sending time, the first receiving time, the first initiation time, and the first confirmation time, and clock information of a device in the clock synchronization system is checked based on the first clock deviation value.
[0076] Specifically, if the reference clock source acquisition scenario is determined to be the first acquisition scenario, the first acquisition scenario characterizes that the clock source information of clock synchronization devices whose number accounts for more than a preset proportion is determined as the reference clock source information. Therefore, it can be understood that the clock source information of most clock synchronization devices in the clock synchronization system is used as the reference clock source information of the clock synchronization system. For example, when the clock source information of more than 50% of the clock synchronization devices in the clock synchronization system comes from the same clock source, the clock synchronization system determines this clock source information as the reference clock source information.
[0077] A system control center is set up inside the clock synchronization system to perform clock calibration between the clock synchronization information from different clock source information between the internal devices of the system. The clock synchronization system pre-configures and maintains the system's reference clock source information, such as the Global Positioning System (GPS), Beidou Satellite Navigation System (COMPASS), GLONASS, Galileo Satellite Positioning System (Galileo) or local clock, etc. After the network device in the clock synchronization system receives the clock synchronization information containing the clock source information, it determines whether the current clock source information in the clock synchronization information is the reference clock source information of the system. If the current clock source information in the clock synchronization information is the reference clock source information of the system, it can directly interact with other network devices in the clock synchronization system that require clock synchronization; if the current clock source information in the clock synchronization information is not the reference clock source information of the system, it first performs clock calibration through the system control center, and then interacts with data that requires clock synchronization.
[0078] The specific implementation steps are as follows:
[0079] 1. The clock synchronization information between the base station and the CPE is broadcast by extending the SIB9 broadcast message of the base station, adding the current clock source information, that is, the information contained in SIB9 is as follows:
[0080] a.timeInfo
[0081] (1) timeInfoUTC: UTC time, unit: 10ms;
[0082] (2)dayLightSavingTime: daylight saving time;
[0083] (3)leapSeconds: leap seconds;
[0084] (4) localTimeOffset: time zone;
[0085] b.referenceTimeInfo
[0086] (extent)time Source (Clock Source): clock source information;
[0087] (1) time: GPS time, unit: 10ns;
[0088] (2) uncertainty: uncertainty of reference time information;
[0089] (3) timeInfoType: If not, it means that the previous time is the starting point of GPS time, that is, 00:00:00 Greenwich time on January 6, 1980. If it is localclock, it means that the starting point of time is customized;
[0090] (4) referenceSFN: required for unicast;
[0091] 2. A method for extending clock synchronization information between CPE and network devices of a clock synchronization system includes IRIG-B code and non-IRIG-B code clock source notification messages.
[0092] (1) B code information extension reference Figure 2 , Figure 2 This is a schematic diagram of the B code expansion provided in an embodiment of the present application;
[0093] (2) Non-IRIG-B code clock source notification messages are used to notify the current clock source information used by the current synchronization clock by adding information interaction messages between CPE and CPE and clock synchronization system devices. The application layer can use HTTP, MQTT, CoAP, AMQP, STOMP, etc., and the transport layer can use TCP and UDP protocols.
[0094] (3) Interaction between clock synchronization system equipment and control center.
[0095] A system control center is set up inside the clock synchronization system to perform clock verification on clock information from different clock sources between devices inside the system.
[0096] The clock synchronization system pre-configures and maintains the system's reference clock source information, such as the Global Positioning System (GPS), Beidou Satellite Navigation System (COMPASS), GLONASS, Galileo Satellite Positioning System (Galileo) or local clock, etc. The method for the clock synchronization system to maintain the system's reference clock source information can use the clock source of most of the clock synchronization devices in the system as the system's reference clock source information, such as when the clock information of more than 50% of the clock synchronization devices in the system comes from the GPR clock source, the system's reference clock source information is GPR.
[0097] After receiving the clock synchronization information containing the clock source in the clock synchronization system, the network device determines whether the current clock source information in the clock synchronization information is the reference clock source information of the system by comparing the received current clock source information with the reference clock source information of the system. If the current clock source information in the clock synchronization information is the reference clock source information of the system, data interaction requiring clock synchronization can be directly performed with other devices in the clock synchronization system; if the current clock source information in the clock synchronization information is not the reference clock source information of the system, clock verification is first performed through the system control center, and then data interaction requiring clock synchronization is performed. The method for the system control center to perform clock verification is: using the reference clock source information of the system as a reference, a time deviation value is sent to the device requesting clock verification in the system, and the device requesting clock verification performs clock calibration.
[0098] Further, the network device sends a clock calibration request to the system control center and determines a first sending time when sending. The system control center receives the clock calibration request and determines a first receiving time when receiving. Further, the system control center initiates a clock calibration reply to the network device and determines a first initiation time when initiating. The network device initiates a clock reply confirmation to the system control center and determines a first confirmation time when initiating.
[0099] Further, the system control center calculates a first clock deviation value according to the first sending time, the first receiving time, the first initiation time and the first confirmation time, and returns the first clock deviation value to the network device. Further, the network device performs clock verification on the clock information of the network device according to the first clock deviation value, referring to Figure 3 , Figure 3 This is one of the clock information verification process diagrams provided in the embodiment of the present application, and the specific analysis is as follows:
[0100] Step 1: The network device in the clock synchronization system determines that the clock source is a non-system reference clock source based on the received clock synchronization information.
[0101] Step 2: The network device sends a clock calibration request (carrying the network device ID, the received clock information, and the time T1 of sending step 2) to the system control center interactively.
[0102] Step 3: The system control center records the time T2 at which step 2 is received.
[0103] Step 4: The system control center initiates a clock calibration request response.
[0104] Step 5: The system control center records the time T3 of sending step 4.
[0105] Step 6: The network device initiates a clock reply confirmation to the system control center according to step 4 (carrying the network device ID and the time T4 of receiving step 4).
[0106] Step 7: The system control center determines the clock deviation t based on the information exchanged with the network device, including the time T1 in the clock calibration request information, the time T2 when step 2 is received, the time T3 when step 3 is sent, and the time T4 when the network device receives step 4. The time deviation between the network device clock and the system reference clock is t = 2 / T4 + T1 - (T3 + T2).
[0107] Step 8: The system control center sends clock calibration information to the network device that sent the clock calibration request, carrying the clock deviation t. The network device calibrates the clock information according to the clock deviation t.
[0108] In the embodiment of the present application, when it is determined that the current clock source information in the clock synchronization information is different from the current clock source information of the internal system, the clock synchronization devices can be calibrated through the system control center, especially when the communication between the clock synchronization devices is not as convenient as the communication between the devices and the system control center. This makes the synchronization accuracy of the time data transmission of the clock synchronization devices more accurate, thereby improving the time synchronization accuracy of the clock synchronization devices in the entire system.
[0109] Based on the above embodiment, clock verification is performed on the clock information of the device in the clock synchronization system based on the reference clock source acquisition scenario recorded in step 300, including:
[0110] If it is determined that the reference clock source acquisition scenario is the second acquisition scenario, obtaining a second sending time when the network device sends a clock calibration request to the system control center, and obtaining a second receiving time when the system control center receives the clock calibration request;
[0111] Acquire a second initiation time at which the system control center initiates a clock calibration reply to the network device, and acquire a second confirmation time at which the network device initiates a clock reply confirmation to the system control center;
[0112] A second clock deviation value is calculated based on the second sending time, the second receiving time, the second initiation time and the second confirmation time, and clock information of a device in the clock synchronization system is checked based on the second clock deviation value.
[0113] Specifically, if the reference clock source acquisition scenario is determined to be the second acquisition scenario, the second acquisition scenario represents that the clock source information of the master clock synchronization device in the clock synchronization system is determined as the reference clock source information. Therefore, it can be understood that the clock information sources of the clock synchronization devices in the clock synchronization system are relatively scattered, and the judgment condition that the clock information of the clock synchronization devices in the system that is greater than the preset proportion comes from the same clock source is not met. The system control center can use the clock source information of a master clock device in the clock synchronization system as the reference clock source information of the system, and notify the reference clock source information of the devices in the system. When the reference clock source information of the system changes, the system control center synchronizes it to each clock synchronization device in the system.
[0114] The specific analysis is as follows:
[0115] 1. The clock synchronization information between the base station and the CPE is broadcast by extending the SIB9 broadcast message of the base station, adding the current clock source information, that is, the information contained in SIB9 is as follows:
[0116] a.timeInfo
[0117] (1) timeInfoUTC: UTC time, unit: 10ms;
[0118] (2)dayLightSavingTime: daylight saving time;
[0119] (3)leapSeconds: leap seconds;
[0120] (4) localTimeOffset: time zone;
[0121] b.referenceTimeInfo
[0122] (extent)time Source (Clock Source): clock source information;
[0123] (1) time: GPS time, unit: 10ns;
[0124] (2) uncertainty: uncertainty of reference time information;
[0125] (3) timeInfoType: If not, it means that the previous time is the starting point of GPS time, that is, 00:00:00 Greenwich time on January 6, 1980. If it is localclock, it means that the starting point of time is customized;
[0126] (4) referenceSFN: required for unicast;
[0127] 2. A method for extending clock synchronization information between CPE and network devices of a clock synchronization system includes IRIG-B code and non-IRIG-B code clock source notification messages.
[0128] (1) B code information extension reference Figure 2 , Figure 2 This is a schematic diagram of the B code expansion provided in an embodiment of the present application;
[0129] (2) Non-IRIG-B code clock source notification messages are used to notify the current clock source information used by the current synchronization clock by adding information interaction messages between CPE and CPE and clock synchronization system devices. The application layer can use HTTP, MQTT, CoAP, AMQP, STOMP, etc., and the transport layer can use TCP and UDP protocols.
[0130] (3) Interaction between clock synchronization system equipment and control center.
[0131] A system control center is set up inside the clock synchronization system to perform clock verification on clock information from different clock sources between devices inside the system. In view of the fact that the clock information sources of the clock synchronization devices in the system are relatively scattered and the judgment condition that the clock information of more than 50% of the clock synchronization devices in the system comes from the same clock source is not met, the system control center can use the clock source information of the clock source of a master clock device in the system as the reference clock source information of the system. When the clock of the master device changes, it actively initiates clock information to notify the current clock source information, and performs clock synchronization with the system control center. The system control center notifies the reference clock source information of the devices in the system.
[0132] After receiving the clock synchronization information containing the clock source in the clock synchronization system, the network device determines whether the current clock source information in the clock synchronization information is the reference clock source information of the system by comparing the received current clock source information with the reference clock source information of the system. If the current clock source information in the clock synchronization information is the reference clock source information of the system, data interaction requiring clock synchronization can be directly performed with other devices in the clock synchronization system; if the current clock source information in the clock synchronization information is not the reference clock source information of the system, clock verification is first performed through the system control center, and then data interaction requiring clock synchronization is performed. The method for the system control center to perform clock verification is: using the reference clock source information of the system as a reference, sending a time deviation to the device requesting clock verification in the system, which is used for clock calibration of the device requesting clock verification.
[0133] Further, the network device sends a clock calibration request to the system control center and determines a second sending time when sending. The system control center receives the clock calibration request and determines the second receiving time when receiving. Further, the system control center initiates a clock calibration reply to the network device and determines a second initiation time when initiating. The network device initiates a clock reply confirmation to the system control center and determines a second confirmation time when initiating.
[0134] Further, the system control center calculates a second clock deviation value according to the second sending time, the second receiving time, the second initiation time and the second confirmation time, and returns the second clock deviation value to the network device. Further, the network device performs clock verification on the clock information of the network device according to the second clock deviation value, referring to Figure 3 , Figure 3 This is one of the clock information verification process diagrams provided in the embodiment of the present application, and the specific analysis is as follows:
[0135] Step 1: The network device in the clock synchronization system determines that the clock source is a non-system reference clock source based on the received clock synchronization information.
[0136] Step 2: The network device sends a clock calibration request (carrying the network device ID, the received clock information, and the time T1 of sending step 2) to the system control center interactively.
[0137] Step 3: The system control center records the time T2 at which step 2 is received.
[0138] Step 4: The system control center initiates a clock calibration request response.
[0139] Step 5: The system control center records the time T3 of sending step 4.
[0140] Step 6: The network device initiates a clock reply confirmation to the system control center according to step 4 (carrying the network device ID and the time T4 of receiving step 4).
[0141] Step 7: The system control center determines the clock deviation t based on the information exchanged with the network device, including the time T1 in the clock calibration request information, the time T2 when step 2 is received, the time T3 when step 3 is sent, and the time T4 when the network device receives step 4. The time deviation between the network device clock and the system reference clock is t = 2 / T4 + T1 - (T3 + T2).
[0142] Step 8: The system control center sends clock calibration information to the network device that sent the clock calibration request, carrying the clock deviation t. The network device calibrates the clock information according to the clock deviation t.
[0143] In the embodiment of the present application, when it is determined that the current clock source information in the clock synchronization information is different from the current clock source information of the internal system, the clock synchronization devices can be calibrated through the system control center, especially when the communication between the clock synchronization devices is not as convenient as the communication between the devices and the system control center. This makes the synchronization accuracy of the time data transmission of the clock synchronization devices more accurate, thereby improving the time synchronization accuracy of the clock synchronization devices in the entire system.
[0144] Based on the above embodiment, clock verification is performed on the clock information of the device in the clock synchronization system based on the reference clock source acquisition scenario recorded in step 300, including:
[0145] If it is determined that the reference clock source acquisition scenario is the third acquisition scenario, a third sending time of the network device sending the clock calibration request to the system control center is obtained, and a third receiving time of the system control center receiving the clock calibration request is obtained; the third acquisition scenario represents that the clock source information inside the clock synchronization system is determined as the reference clock source information;
[0146] Acquire a third initiation time at which the system control center initiates a clock calibration reply to the network device, and acquire a third confirmation time at which the network device initiates a clock reply confirmation to the system control center;
[0147] A third clock deviation value is calculated based on the third sending time, the third receiving time, the third initiation time and the third confirmation time, and clock verification is performed on the clock information of the device in the clock synchronization system based on the third clock deviation value.
[0148] Specifically, if the reference clock source acquisition scenario is determined to be the third acquisition scenario, the third acquisition scenario characterizes that the clock source information inside the clock synchronization system is determined as the reference clock source information. Therefore, it can be understood that the clock information source of the clock synchronization device is relatively scattered, and the judgment condition that the clock information of the clock synchronization devices in the system that is greater than the preset proportion comes from the same clock source is not met. The system control center determines not to use an external clock source, but chooses to use the internal relative time of the system as the reference clock source information of the system, and notifies the reference clock source information of the devices in the system. The specific analysis is as follows:
[0149] 1) The clock synchronization information between the base station and the CPE is broadcasted by extending the SIB9 broadcast message of the base station, adding the current clock source information, that is, the information contained in SIB9 is as follows:
[0150] a.timeInfo
[0151] (1) timeInfoUTC: UTC time, unit: 10ms;
[0152] (2)dayLightSavingTime: daylight saving time;
[0153] (3)leapSeconds: leap seconds;
[0154] (4) localTimeOffset: time zone;
[0155] b.referenceTimeInfo
[0156] (extent)time Source (Clock Source): clock source information;
[0157] (1) time: GPS time, unit: 10ns;
[0158] (2) uncertainty: uncertainty of reference time information;
[0159] (3) timeInfoType: If not, it means that the previous time is the starting point of GPS time, that is, 00:00:00 Greenwich time on January 6, 1980. If it is localclock, it means that the starting point of time is customized;
[0160] (4) referenceSFN: required for unicast;
[0161] 2. A method for extending clock synchronization information between CPE and network devices of a clock synchronization system includes IRIG-B code and non-IRIG-B code clock source notification messages.
[0162] (1) B code information extension reference Figure 2 , Figure 2 This is a schematic diagram of the B code expansion provided in an embodiment of the present application;
[0163] (2) Non-IRIG-B code clock source notification messages are used to notify the current clock source information used by the current synchronization clock by adding information interaction messages between CPE and CPE and clock synchronization system devices. The application layer can use HTTP, MQTT, CoAP, AMQP, STOMP, etc., and the transport layer can use TCP and UDP protocols.
[0164] 3) Interaction between clock synchronization system equipment and control center.
[0165] A system control center is set up inside the clock synchronization system to perform clock verification on clock information from different clock sources between devices inside the system. In view of the relatively scattered sources of clock information of the clock synchronization devices in the system, the system control center can use the relative time inside the clock synchronization system as the reference clock source information of the system, and notify the reference clock source information of the devices in the clock synchronization system. The relative time inside the clock synchronization system means that the clock source does not come from the public current clock source information such as the Global Positioning System (GPS), Beidou Satellite Navigation System (COMPASS), GLONASS, Galileo Satellite Positioning System (Galileo), etc., but comes from the internal clock of the system. Therefore, this embodiment is only applicable to clock synchronization between devices inside the clock synchronization system, and is not applicable to the synchronous interaction between devices inside the clock synchronization system and devices outside the clock synchronization system.
[0166] After receiving the clock synchronization information containing the clock source in the clock synchronization system, the network device determines whether the current clock source information in the clock synchronization information is the reference clock source information of the system by comparing the received current clock source information with the reference clock source information of the system. If the current clock source information in the clock synchronization information is the reference clock source information of the system, data interaction requiring clock synchronization can be directly performed with other devices in the clock synchronization system; if the current clock source information in the clock synchronization information is not the reference clock source information of the system, clock verification is first performed through the system control center, and then data interaction requiring clock synchronization is performed. The method for the system control center to perform clock verification is: using the reference clock source information of the system as a reference, sending a time deviation to the device requesting clock verification in the system, which is used for clock calibration of the device requesting clock verification.
[0167] Further, the network device sends a clock calibration request to the system control center and determines a third sending time when sending. The system control center receives the clock calibration request and determines the third receiving time when received. Further, the system control center initiates a clock calibration reply to the network device and determines a third initiation time when initiating. The network device initiates a clock reply confirmation to the system control center and determines a third confirmation time when initiating.
[0168] Further, the system control center calculates a third clock deviation value according to the third sending time, the third receiving time, the third initiation time and the third confirmation time, and returns the third clock deviation value to the network device. Further, the network device performs clock verification on the clock information of the network device according to the third clock deviation value. Figure 4 This is the second schematic diagram of the clock information verification process provided by the embodiment of the present application, and the specific analysis is as follows:
[0169] Step 1: The network device in the clock synchronization system determines that the clock source is a non-system reference clock source based on the received clock synchronization information.
[0170] Step 2: The network device sends a clock calibration request (carrying the network device ID, the received clock information, and the time T1 of sending step 2) to the system control center interactively.
[0171] Step 3: The system control center records the time T2 at which step 2 is received.
[0172] Step 4: The system control center initiates a clock calibration request response. In this step, the system control center notifies the network device to enable the local clock, that is, the relative clock inside the system.
[0173] Step 5: The system control center records the time T3 of sending step 4.
[0174] Step 6: The network device initiates a clock reply confirmation to the system control center according to step 4 (carrying the network device ID and the time T4 of receiving step 4).
[0175] Step 7: The system control center determines the clock deviation t based on the information exchanged with the network device, including the time T1 in the clock calibration request information, the time T2 when step 2 is received, the time T3 when step 3 is sent, and the time T4 when the network device receives step 4. The time deviation between the network device clock and the system reference clock is t = 2 / T4 + T1 - (T3 + T2).
[0176] Step 8: The system control center sends clock calibration information to the network device that sent the clock calibration request, carrying the clock deviation t. The network device calibrates the clock information according to the clock deviation t.
[0177] In the embodiment of the present application, when the clock information sources of the clock synchronization devices in the system are relatively scattered, the system control center may choose not to use an external clock source, but to use the system's internal relative time as the system's reference clock source information, and notify the reference clock source information of the devices in the system. The clock synchronization devices can be calibrated through the system control center, especially when the communication between the clock synchronization devices is not as convenient as the communication between the devices and the system control center. This makes the synchronization accuracy of the time data transmission of the clock synchronization devices more accurate, thereby improving the time synchronization accuracy of the clock synchronization devices in the entire system.
[0178] Based on the above embodiment, clock verification is performed on the clock information of the device in the clock synchronization system based on the reference clock source acquisition scenario recorded in step 300, including:
[0179] If it is determined that the reference clock source acquisition scenario is the fourth acquisition scenario, clock verification is performed on the clock information of the device in the clock synchronization system based on the first network device and the second network device at the opposite end thereof;
[0180] Accordingly, the specific steps of performing clock verification on the clock information of the device in the clock synchronization system based on the first network device and the second network device at the opposite end thereof include:
[0181] Acquire a fourth sending time at which the first network device sends a clock calibration request to the second network device, and acquire a fourth receiving time at which the second network device receives the clock calibration request;
[0182] Obtain a fourth initiation time at which the second network device initiates a clock calibration reply to the first network device, and obtain a fourth confirmation time at which the first network device initiates a clock reply confirmation to the second network device;
[0183] A fourth clock deviation value is calculated based on the fourth sending time, the fourth receiving time, the fourth initiation time and the fourth confirmation time, and clock verification is performed on the clock information of the device in the clock synchronization system based on the fourth clock deviation value.
[0184] Specifically, if the reference clock source acquisition scenario is determined to be the fourth acquisition scenario, the fourth acquisition scenario represents that clock calibration is performed between devices without determining the reference clock source information. Before the network devices of the clock synchronization system need to perform synchronous data exchange, the interaction channel (data channel or signaling channel) established between the network devices is used to confirm whether the clock source information between the network devices is consistent. If they are consistent, synchronous data exchange can be performed directly without the need to perform clock calibration within the system. If they are inconsistent, you can choose to perform clock calibration through the first acquisition scenario, the second acquisition scenario, or the third acquisition scenario, or perform clock calibration directly between the devices of the clock synchronization system without the participation of the system control center. The methods of the first acquisition scenario, the second acquisition scenario, or the third acquisition scenario are not described in detail. The analysis of direct clock calibration between the devices of the clock synchronization system is as follows:
[0185] The first network device sends a clock calibration request to the second network device and determines a fourth sending time when the request is initiated. The second network device receives the clock calibration request and determines a fourth receiving time when the request is received. Further, the second network device initiates a clock calibration reply to the first network device and determines a fourth initiation time when the request is initiated. The first network device initiates a clock reply confirmation to the second network device and determines a fourth confirmation time when the request is initiated.
[0186] Further, the first network device calculates a fourth clock deviation value according to the fourth sending time, the fourth receiving time, the fourth initiation time and the fourth confirmation time, and returns the fourth clock deviation value to the second network device. Further, the second network device performs clock verification on the clock information of the second network device according to the fourth clock deviation value, referring to Figure 5 , Figure 5 This is the third schematic diagram of the clock information verification process provided by the embodiment of the present application, and the specific analysis is as follows:
[0187] Step 1: Network device 1 records the current clock source information of the received clock synchronization information.
[0188] Step 2: Network device 2 records the current clock source information of the received clock synchronization information.
[0189] Step 3: Network device 1 in the system initiates connection establishment to the peer device. Before synchronous data exchange, confirm whether the current clock source information of the clock synchronization information between the devices is consistent. If consistent, synchronous data exchange is directly performed. If inconsistent, proceed to steps 4-10 for clock calibration.
[0190] Step 4: The existing network device 1 sends a clock calibration request (carrying the network device ID, the received clock information, and the time T1 of sending step 4) to the peer device interactively.
[0191] Step 5: Network device 2 records the time T2 at which step 4 is received.
[0192] Step 6: Network device 2 records the time T3 at which the clock calibration request response of step 7 is sent.
[0193] Step 7: Network device 2 sends a clock calibration request reply (carrying time T2 and time T3) to network device 1.
[0194] Step 8: Network device 1 records the time T4 at which step 7 is received.
[0195] Step 9: Network device 1 sends a clock reply confirmation (carrying the network device ID and time T4) to network device 2.
[0196] Step 10: Network device 1 and network device 2 may determine clock deviation t based on information exchanged with the network devices, including time T1, time T2, time T3, and time T4. Clock time deviation t = 2 / T4 + T1 - (T3 + T2). After the clock is calibrated, network device 1 and network device 2 perform synchronous data exchange.
[0197] In the embodiment of the present application, when it is determined that the current clock source information in the clock synchronization information is different from the current clock source information of the internal system, the clock synchronization devices can be calibrated through the system control center, especially when the communication between the clock synchronization devices is not as convenient as the communication between the devices and the system control center. This makes the synchronization accuracy of the time data transmission of the clock synchronization devices more accurate, thereby improving the time synchronization accuracy of the clock synchronization devices in the entire system.
[0198] A clock synchronization system provided in an embodiment of the present application is described. The clock synchronization system described below and the clock synchronization method described above can refer to each other.
[0199] refer to Figure 6 , Figure 6 60 is a schematic diagram of the structure of the clock synchronization system provided in the embodiment of the present application. The clock synchronization system provided in the embodiment of the present application includes a parsing module 601, a determination comparison module 602 and a clock synchronization module 603.
[0200] The parsing module 601 is used to parse the received clock synchronization information to obtain the current clock source information;
[0201] A determination comparison module 602 is used to determine the reference clock source information of the clock synchronization system, and compare the current clock source information with the reference clock source information to obtain an information comparison result;
[0202] The clock synchronization module 603 is used to determine the reference clock source acquisition scenario of the reference clock source information if it is determined that the information comparison result is that the current clock source information is inconsistent with the reference clock source information, and perform clock verification on the clock information of the device in the clock synchronization system based on the reference clock source acquisition scenario.
[0203] The clock synchronization system provided in the embodiment of the present application parses the received clock synchronization information to obtain the current clock source information; determines the reference clock source information of the clock synchronization system, compares the current clock source information with the reference clock source information, and obtains the information comparison result; if it is determined that the information comparison result is that the current clock source information is inconsistent with the reference clock source information, then determines the reference clock source acquisition scenario of the reference clock source information, and performs clock calibration on the clock information of the device in the clock synchronization system based on the reference clock source acquisition scenario. In the process of clock synchronization, when it is determined that the current clock source information in the clock synchronization information is different from the current clock source information of the internal system, the clocks of the clock synchronization devices can be calibrated through the system control center, especially when the communication between the clock synchronization devices is not as convenient as the communication between the devices and the system control center, so that the synchronization accuracy of the time data transmission of the clock synchronization devices is more accurate, thereby improving the time synchronization accuracy of the clock synchronization devices in the entire system.
[0204] In one embodiment, the comparison module 602 is further configured to:
[0205] Acquire clock synchronization devices carrying the same target clock source information in the clock synchronization system, and determine whether the proportion of the number of the clock synchronization devices is greater than a preset proportion;
[0206] If it is determined that the quantity ratio is greater than the preset ratio, determining the target clock source information as the reference clock source information;
[0207] If it is determined that the quantity ratio is less than or equal to the preset ratio, a clock enable type is determined, and the reference clock source information is determined based on the clock enable type.
[0208] In one embodiment, the comparison module 602 is further configured to:
[0209] If it is determined that the clock enabling type is the first enabling type, the clock source information inside the clock synchronization system is determined as the reference clock source information; the first type represents the type of enabling the internal clock source information;
[0210] If it is determined that the clock enable type is the second enable type, the master clock synchronization device of the clock synchronization system is obtained, and the clock source information of the master clock synchronization device is determined as the reference clock source information; the second enable type represents the type of enabling external clock source information.
[0211] In one embodiment, the clock synchronization module 603 is further used to:
[0212] If it is determined that the reference clock source acquisition scenario is the first acquisition scenario, then the first sending time of the network device sending the clock calibration request to the system control center is obtained, and the first receiving time of the system control center receiving the clock calibration request is obtained; the first acquisition scenario characterizes that the clock source information of the clock synchronization devices whose number proportion is greater than the preset proportion is determined as the reference clock source information;
[0213] Acquire a first initiation time when the system control center initiates a clock calibration reply to the network device, and acquire a first confirmation time when the network device initiates a clock reply confirmation to the system control center;
[0214] A first clock deviation value is calculated based on the first sending time, the first receiving time, the first initiation time, and the first confirmation time, and clock information of a device in the clock synchronization system is checked based on the first clock deviation value.
[0215] In one embodiment, the clock synchronization module 603 is further used to:
[0216] If it is determined that the reference clock source acquisition scenario is the second acquisition scenario, a second sending time at which the network device sends a clock calibration request to the system control center is obtained, and a second receiving time at which the system control center receives the clock calibration request is obtained; the second acquisition scenario represents that the clock source information of the master clock synchronization device in the clock synchronization system is determined as the reference clock source information;
[0217] Acquire a second initiation time at which the system control center initiates a clock calibration reply to the network device, and acquire a second confirmation time at which the network device initiates a clock reply confirmation to the system control center;
[0218] A second clock deviation value is calculated based on the second sending time, the second receiving time, the second initiation time and the second confirmation time, and clock information of a device in the clock synchronization system is checked based on the second clock deviation value.
[0219] In one embodiment, the clock synchronization module 603 is further used to:
[0220] If it is determined that the reference clock source acquisition scenario is the third acquisition scenario, a third sending time of the network device sending the clock calibration request to the system control center is obtained, and a third receiving time of the system control center receiving the clock calibration request is obtained; the third acquisition scenario represents that the clock source information inside the clock synchronization system is determined as the reference clock source information;
[0221] Acquire a third initiation time at which the system control center initiates a clock calibration reply to the network device, and acquire a third confirmation time at which the network device initiates a clock reply confirmation to the system control center;
[0222] A third clock deviation value is calculated based on the third sending time, the third receiving time, the third initiation time and the third confirmation time, and clock verification is performed on the clock information of the device in the clock synchronization system based on the third clock deviation value.
[0223] In one embodiment, the clock synchronization module 603 is further used to:
[0224] If it is determined that the reference clock source acquisition scenario is the fourth acquisition scenario, clock information of the device in the clock synchronization system is clock-checked based on the first network device and the second network device at the opposite end thereof; the fourth acquisition scenario represents that clock calibration is performed between devices without determining the reference clock source information;
[0225] Accordingly, the specific steps of performing clock verification on the clock information of the device in the clock synchronization system based on the first network device and the second network device at the opposite end thereof include:
[0226] Acquire a fourth sending time at which the first network device sends a clock calibration request to the second network device, and acquire a fourth receiving time at which the second network device receives the clock calibration request;
[0227] Obtain a fourth initiation time at which the second network device initiates a clock calibration reply to the first network device, and obtain a fourth confirmation time at which the first network device initiates a clock reply confirmation to the second network device;
[0228] A fourth clock deviation value is calculated based on the fourth sending time, the fourth receiving time, the fourth initiation time and the fourth confirmation time, and clock verification is performed on the clock information of the device in the clock synchronization system based on the fourth clock deviation value.
[0229] Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7 As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call a computer program in the memory 730 to execute the steps of the clock synchronization method, for example including:
[0230] Parse the received clock synchronization information to obtain the current clock source information;
[0231] Determine reference clock source information of a clock synchronization system, and compare the current clock source information with the reference clock source information to obtain an information comparison result;
[0232] If it is determined that the information comparison result is that the current clock source information is inconsistent with the reference clock source information, a reference clock source acquisition scenario of the reference clock source information is determined, and clock information of the device in the clock synchronization system is checked based on the reference clock source acquisition scenario.
[0233] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.
[0234] On the other hand, an embodiment of the present application further provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium includes a computer program, and the computer program can be stored on the non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can perform the steps of the clock synchronization method provided in the above embodiments, for example, including:
[0235] Parse the received clock synchronization information to obtain the current clock source information;
[0236] Determine reference clock source information of a clock synchronization system, and compare the current clock source information with the reference clock source information to obtain an information comparison result;
[0237] If it is determined that the information comparison result is that the current clock source information is inconsistent with the reference clock source information, a reference clock source acquisition scenario of the reference clock source information is determined, and clock information of the device in the clock synchronization system is checked based on the reference clock source acquisition scenario.
[0238] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0239] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0240] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A clock synchronization method, It is characterized in that include: Parse the received clock synchronization information to obtain the current clock source information; Determine reference clock source information of a clock synchronization system, and compare the current clock source information with the reference clock source information to obtain an information comparison result; If it is determined that the information comparison result is that the current clock source information is inconsistent with the reference clock source information, a reference clock source acquisition scenario of the reference clock source information is determined, and clock information of the device in the clock synchronization system is checked based on the reference clock source acquisition scenario.
2. The clock synchronization method according to claim 1, It is characterized in that The performing clock verification on the clock information of the device in the clock synchronization system based on the reference clock source acquisition scenario includes: If it is determined that the reference clock source acquisition scenario is the first acquisition scenario, then the first sending time of the network device sending the clock calibration request to the system control center is obtained, and the first receiving time of the system control center receiving the clock calibration request is obtained; the first acquisition scenario characterizes that the clock source information of the clock synchronization devices whose number proportion is greater than the preset proportion is determined as the reference clock source information; Acquire a first initiation time when the system control center initiates a clock calibration reply to the network device, and acquire a first confirmation time when the network device initiates a clock reply confirmation to the system control center; A first clock deviation value is calculated based on the first sending time, the first receiving time, the first initiation time, and the first confirmation time, and clock information of a device in the clock synchronization system is checked based on the first clock deviation value.
3. The clock synchronization method according to claim 1, It is characterized in that The performing clock verification on the clock information of the device in the clock synchronization system based on the reference clock source acquisition scenario includes: If it is determined that the reference clock source acquisition scenario is the second acquisition scenario, a second sending time at which the network device sends a clock calibration request to the system control center is obtained, and a second receiving time at which the system control center receives the clock calibration request is obtained; the second acquisition scenario represents that the clock source information of the master clock synchronization device in the clock synchronization system is determined as the reference clock source information; Acquire a second initiation time at which the system control center initiates a clock calibration reply to the network device, and acquire a second confirmation time at which the network device initiates a clock reply confirmation to the system control center; A second clock deviation value is calculated based on the second sending time, the second receiving time, the second initiation time and the second confirmation time, and clock information of a device in the clock synchronization system is checked based on the second clock deviation value.
4. The clock synchronization method according to claim 1, It is characterized in that The performing clock verification on the clock information of the device in the clock synchronization system based on the reference clock source acquisition scenario includes: If it is determined that the reference clock source acquisition scenario is the third acquisition scenario, a third sending time of the network device sending the clock calibration request to the system control center is obtained, and a third receiving time of the system control center receiving the clock calibration request is obtained; the third acquisition scenario represents that the clock source information inside the clock synchronization system is determined as the reference clock source information; Acquire a third initiation time at which the system control center initiates a clock calibration reply to the network device, and acquire a third confirmation time at which the network device initiates a clock reply confirmation to the system control center; A third clock deviation value is calculated based on the third sending time, the third receiving time, the third initiation time and the third confirmation time, and clock verification is performed on the clock information of the device in the clock synchronization system based on the third clock deviation value.
5. The clock synchronization method according to claim 1, It is characterized in that The performing clock verification on the clock information of the device in the clock synchronization system based on the reference clock source acquisition scenario includes: If it is determined that the reference clock source acquisition scenario is the fourth acquisition scenario, clock information of the device in the clock synchronization system is clock-checked based on the first network device and the second network device at the opposite end thereof; the fourth acquisition scenario represents that clock calibration is performed between devices without determining the reference clock source information; Accordingly, the specific steps of performing clock verification on the clock information of the device in the clock synchronization system based on the first network device and the second network device at the opposite end thereof include: Acquire a fourth sending time at which the first network device sends a clock calibration request to the second network device, and acquire a fourth receiving time at which the second network device receives the clock calibration request; Obtain a fourth initiation time at which the second network device initiates a clock calibration reply to the first network device, and obtain a fourth confirmation time at which the first network device initiates a clock reply confirmation to the second network device; A fourth clock deviation value is calculated based on the fourth sending time, the fourth receiving time, the fourth initiation time and the fourth confirmation time, and clock verification is performed on the clock information of the device in the clock synchronization system based on the fourth clock deviation value.
6. The clock synchronization method according to any one of claims 1 to 5, It is characterized in that The step of determining the reference clock source information of the clock synchronization system includes: Acquire clock synchronization devices carrying the same target clock source information in the clock synchronization system, and determine whether the proportion of the number of the clock synchronization devices is greater than a preset proportion; If it is determined that the quantity ratio is greater than the preset ratio, determining the target clock source information as the reference clock source information; If it is determined that the quantity ratio is less than or equal to the preset ratio, a clock enable type is determined, and the reference clock source information is determined based on the clock enable type.
7. The clock synchronization method according to claim 6, It is characterized in that The determining the reference clock source information based on the clock enable type includes: If it is determined that the clock enabling type is the first enabling type, the clock source information inside the clock synchronization system is determined as the reference clock source information; the first type represents the type of enabling the internal clock source information; If it is determined that the clock enable type is the second enable type, the master clock synchronization device of the clock synchronization system is obtained, and the clock source information of the master clock synchronization device is determined as the reference clock source information; the second enable type represents the type of enabling external clock source information.
8. A clock synchronization system, It is characterized in that include: The parsing module is used to parse the received clock synchronization information to obtain the current clock source information; A determination comparison module is used to determine the reference clock source information of the clock synchronization system, and compare the current clock source information with the reference clock source information to obtain an information comparison result; The clock synchronization module is used to determine the reference clock source acquisition scenario of the reference clock source information if it is determined that the information comparison result is that the current clock source information is inconsistent with the reference clock source information, and perform clock verification on the clock information of the device in the clock synchronization system based on the reference clock source acquisition scenario.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the clock synchronization method according to any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium, the non-transitory computer-readable storage medium comprising a computer program, It is characterized in that When the computer program is executed by a processor, the clock synchronization method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Time acquisition method and device of clock module based on processor
CN120743039A
