OTN, PTN or IPRAN equipment clock synchronization method and device

By handling alarm status notifications in OTN, PTN or IPRAN devices and adjusting the system clock working mode, the problem of instantaneous clock source failure during clock synchronization is solved, and the stability of the device clock and service continuity are achieved.

CN119696723APending Publication Date: 2025-03-25BEIJING GW TECH +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411793428.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

The prior art cannot effectively handle instantaneous failures of the clock source during clock synchronization, resulting in unstable equipment clocks and affecting business continuity.

Method used

By implementing the alarm status notification processing mechanism in OTN, PTN or IPRAN devices, instantaneous failures of the clock source are filtered, the working mode of the system clock is adjusted, and the stability of clock synchronization is ensured through timer management.

Benefits of technology

Effectively filter the instantaneous failure of the clock source, ensure the stability of the equipment clock, and improve the continuity and reliability of services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119696723A_ABST
    Figure CN119696723A_ABST
Patent Text Reader

Abstract

The invention provides an OTN (Optical Transport Network), PTN (Packet Transport Network) or IPRAN (Internet Protocol Radio Access Network) equipment clock synchronization method and device, and the method comprises the steps: obtaining a first alarm state and a second alarm state of a clock source in response to a received alarm state notification; in response to the fact that the first alarm state is different from the second alarm state and the first alarm state is alarm generation, closing the SSM timer and starting the alarm timer; when timing of the alarm timer is finished, the latest alarm state and the SSM value of the clock source are obtained; and in response to the fact that the newly acquired alarm state and SSM value of the clock source are different from the alarm state in the alarm state and SSM value of the clock source stored in the system and / or the SSM value, updating the alarm state and SSM value of the stored clock source by using the latest alarm state and SSM value of the clock source, and restarting automatic source selection. According to the method, the instant fault of the clock source is filtered during clock source synchronization, and the stability of the equipment clock can be maintained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of communication technology, and in particular to a method and apparatus for synchronizing clocks of OTN, PTN or IPRAN equipment. Background Art

[0002] Usually, a clock-synchronized communication device has multiple clock sources. Currently, the clock source selection scheme on the network is mainly based on synchronization level information (SSM) and priority. For the instantaneous failure of the selected clock source, such as SSM unavailability and clock source alarm, no relevant processing is given. Such a clock synchronization scheme cannot guarantee the stability of the service. Summary of the invention

[0003] In view of this, the present application provides a method and apparatus for synchronizing the clock of an OTN, PTN or IPRAN device, which filters out instantaneous failures of the clock source when synchronizing the clock source, and can maintain the stability of the device clock.

[0004] To solve the above technical problems, the technical solution of this application is implemented as follows: In one embodiment, a method for synchronizing clocks of OTN, PTN or IPRAN devices is provided, the method comprising: In response to receiving an alarm status notification, obtaining a first alarm status and a clock source carried in the alarm status notification; and obtaining a second alarm status corresponding to the clock source stored in the system; In response to the first alarm state being different from the second alarm state and the first alarm state being alarm generation, determining whether the clock source is a system clock source and a state in which the system clock is operating; If it is determined that the clock source is a system clock source and the system clock is working in a tracking or locking state, first configure the working mode of the system clock to a holding mode, then turn off the SSM timer and turn on the alarm timer; otherwise, directly turn off the SSM timer and turn on the alarm timer; When the alarm timer expires, obtaining the latest alarm status and SSM value of the clock source; If it is determined according to the alarm timer that the clock source has no alarm, and the clock source is a system clock source, the operating mode of the system clock is configured to be an automatic operating mode, and then the alarm state and SSM value of the clock source most recently obtained are compared with the alarm state and SSM value of the clock source stored in the system; otherwise, the alarm state and SSM value of the clock source most recently obtained are directly compared with the alarm state and SSM value of the clock source stored in the system; In response to the alarm status and SSM value of the clock source most recently acquired being different from the alarm status and SSM value of the clock source stored in the system, and / or the SSM value being different, the stored alarm status and SSM value of the clock source are updated using the latest alarm status and SSM value of the clock source, and automatic source selection is restarted.

[0005] Wherein, the method further comprises: In response to the first alarm state being different from the second alarm state and the first alarm state being alarm elimination, turning off the SSM timer and starting the switchback timer; When the reversal timer ends, the latest alarm state and SSM value of the clock source are obtained; and the latest alarm state and SSM value of the clock source are compared with the alarm state and SSM value of the clock source stored in the system; In response to the alarm status and SSM value of the clock source most recently acquired being different from the alarm status and SSM value of the clock source stored in the system, and / or the SSM value being different, the stored alarm status and SSM value of the clock source are updated using the latest alarm status and SSM value of the clock source, and automatic source selection is restarted.

[0006] Wherein, the method further comprises: In response to the first alarm state being the same as the second alarm state, closing a currently enabled timer; If the clock source is a system clock source and the system clock works in the hold mode, first configure the system clock to the automatic working mode; then obtain the latest SSM value of the clock source; otherwise, directly obtain the latest SSM value of the clock source; Comparing the most recently acquired SSM value of the clock source with the SSM value of the clock source stored in the system; In response to the SSM value of the clock source that is most recently acquired being different from the SSM value of the clock source stored in the system, the SSM value of the clock source that is most recently stored is updated using the SSM value of the clock source, and automatic source selection is restarted.

[0007] Wherein, the method further comprises: In response to not receiving an alarm status notification, not starting an alarm timer, and receiving an SSM notification; obtaining a clock source and an SSM value carried in the SSM notification; and obtaining an SSM value corresponding to the clock source stored in the system; Comparing the SSM value carried in the SSM notification with the SSM value stored in the system; In response to the SSM value carried in the SSM notification being different from the SSM value stored in the system, determining whether the SSM value carried in the SSM notification and the SSM value stored in the system are valid; If the SSM value carried in the SSM notification is valid and the SSM value stored in the system is invalid, start the reversal timer; if the SSM value stored in the system is valid and the SSM value carried in the SSM notification is invalid, start the SSM timer; When the reversal timer or the SSM timer expires, obtaining the latest SSM value of the clock source; In response to the latest SSM value obtained being different from the SSM value stored in the system, the SSM value corresponding to the clock source stored in the system is updated using the latest SSM value obtained, and the automatic source selection is restarted; If the SSM value carried in the SSM notification is valid and the SSM value stored in the system is valid, the SSM value carried in the SSM notification is updated to the SSM value of the clock source stored in the system, and automatic source selection is enabled; In response to the SSM value carried in the SSM notification being the same as the SSM value stored in the system, the SSM timer and the switchback timer are turned off.

[0008] Wherein, the automatic source selection includes: Poll all clock sources; Determine whether the polled clock source is selectable; The best clock source is selected from the clock sources judged to be optional; wherein the optional clock source is a clock source with no alarm, a valid SSM value and a corresponding level higher than a preset level, and no lock command is configured.

[0009] Wherein, the method further comprises: The SSM values ​​of OTN and SDH ports are carried in the overhead and can be directly obtained; The SSM value of the Ethernet port needs to receive and parse the ESMC message sent by the peer end to obtain the SSM value; if the ESMC message sent by the peer end cannot be received within the preset time, the SSM value of the Ethernet port is configured to be invalid; The Ethernet port periodically sends a synchronization information message carrying the system clock SSM value. When the SSM value of the system clock changes, a synchronization event message is immediately sent to inform the peer device of the change in the local SSM.

[0010] Wherein, the method further comprises: Monitor the board status of the clock source board; In response to the board state of any clock source board changing from running to not running, the corresponding clock source is set to a not running flag, and automatic source selection is started; In response to the board status of any clock source board changing from not running to running, the corresponding clock source is set to the running flag, the latest alarm status and SSM value are obtained, and the latest alarm status and SSM value obtained are used to update the alarm status and SSM value of the clock source stored in the system, and automatic source selection is started.

[0011] In another embodiment, a clock synchronization device for OTN, PTN or IPRAN equipment is provided, the device comprising: A first acquisition unit is used to, in response to receiving an alarm status notification, acquire a first alarm status and a clock source carried in the alarm status notification; and acquire a second alarm status corresponding to the clock source stored in the system; a determining unit, configured to determine, in response to the first alarm state being different from the second alarm state and the first alarm state being alarm generation, whether the clock source is a system clock source and a working state of the system clock; The first processing unit is used for, if it is determined that the clock source is a system clock source and the system clock is working in a tracking or locking state, first configuring the working mode of the system clock to a holding mode, then turning off the SSM timer, and turning on the alarm timer; otherwise, directly turning off the SSM timer and turning on the alarm timer; A second acquisition unit, configured to acquire the latest alarm state and SSM value of the clock source when the alarm timer ends; A second processing unit is configured to configure the working mode of the system clock to an automatic working mode, and then compare the latest alarm status and SSM value of the clock source with the alarm status and SSM value of the clock source stored in the system, if it is determined according to the alarm timer that the clock source has no alarm, and the clock source is a system clock source; otherwise, directly compare the latest alarm status and SSM value of the clock source with the alarm status and SSM value of the clock source stored in the system; The third processing unit is used to respond to the alarm status and SSM value of the clock source most recently acquired being different from the alarm status and SSM value of the clock source stored in the system, and / or the SSM value being different, update the stored alarm status and SSM value of the clock source using the latest alarm status and SSM value of the clock source, and restart the automatic source selection.

[0012] In another embodiment, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements a clock synchronization method for OTN, PTN, or IPRAN equipment when executing the program.

[0013] In another embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, a method for synchronizing the clock of an OTN, PTN or IPRAN device is implemented.

[0014] It can be seen from the above technical solution that in the above embodiment, the alarm status in the alarm status notification is compared with the alarm status stored for the same clock source to see if they are the same. If they are not the same, the specific alarm status in the alarm status notification is considered to determine the switch timer, and by comparing the latest alarm status and SSM value of the clock source and the system stored alarm status and SSM value, it is determined whether to update the alarm status and SSM value stored in the clock source, and whether to start automatic source selection; and when the clock source is the system clock source, it is necessary to set the working mode of the system clock according to the working state of the system clock. It can be seen that in the embodiment of the present application, the instantaneous failure of the clock source is filtered out when the clock source is synchronized, and the stability of the device clock can be maintained. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0016] Figure 1 This is a schematic diagram of a clock synchronization process of an OTN, PTN or IPRAN device in an embodiment of the present application; Figure 2 This is another schematic diagram of the clock synchronization process of OTN, PTN or IPRAN equipment in an embodiment of the present application; Figure 3 A schematic diagram of a clock synchronization process in which an SSM notification is received in an embodiment of the present application; Figure 4 This is a schematic diagram of the automatic source selection process in the embodiment of the present application; Figure 5 A schematic diagram of a process for monitoring the clock source board status of the board where the clock source is located in an embodiment of the present application; Figure 6 This is a schematic diagram of the structure of a clock synchronization device for OTN, PTN or IPRAN equipment in an embodiment of the present application; Figure 7 A schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0017] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0018] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe the order or precedence of the objects. It should be understood that the data used in this way can be interchanged where appropriate, so that the implementation of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0019] The technical solution of the present invention is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0020] Usually, a clock-synchronized communication device has multiple clock sources. Currently, the clock source selection scheme on the network is mainly based on synchronization level information (SSM) and priority. For the instantaneous failure of the selected clock source, such as SSM unavailability and clock source alarm, no relevant processing is given. Such a clock synchronization scheme cannot guarantee the stability of the service.

[0021] Based on the above problems, an embodiment of the present application provides a clock synchronization method for an optical transport network (OTN) device, a packet transmission network (PTN) device or an IP bearer network (IPRAN) device. The method can be used for clock synchronization of OTN, PTN or IPRAN devices. For the convenience of description, OTN, PTN and IPRAN devices can also be referred to as communication devices. When obtaining an alarm status notification, compare whether the alarm status in the alarm status notification is the same as the alarm status stored for the same clock source. If they are different, consider the specific alarm status in the alarm status notification to determine the switch timer, and determine whether to update the alarm status and SSM value stored in the clock source by comparing the latest alarm status and SSM value of the clock source and the system stored alarm status and SSM value, and whether to start automatic source selection; and when the clock source is a system clock source, it is necessary to set the working mode of the system clock according to the working state of the system clock. It can be seen that in the embodiment of the present application, the instantaneous failure of the clock source is filtered out when the clock source is synchronized, and the stability of the device clock can be maintained.

[0022] In the embodiment of the present application, before performing clock synchronization, the following configuration may be performed: For clock source configuration: 1. You can set the mandatory receiving and sending SSM values, or not set the mandatory receiving and sending SSM values; If you set forced SSM reception, it will not affect the SSM value actually received by the clock source. However, in the subsequent automatic source selection, the configured forced SSM is effective instead of the actual SSM.

[0023] If forced sending is set, the SSM actually sent by the clock source will be changed to the configured value.

[0024] 2. Set the priority for the clock source: Used for automatic source selection. When the SSM values ​​of multiple available clock sources are equal, the optimal clock source is selected based on priority.

[0025] 3. The external commands are as follows: (1) Clear command: can clear all external commands of the clock source.

[0026] (2) Lock command: remove the unselectable clock source from the automatic source selection queue.

[0027] (3) Manual source selection: Use the clock source as the system clock source of the communication device. If the clock source is not optimal, the command will not take effect and will be cleared after the command is executed.

[0028] When the clock source is automatically selected, if there is more than one clock source with the highest priority among the selectable clock sources, you can select the optimal clock source through manual source selection.

[0029] Clock unit configuration: 1. SSM protocol enabling: Whether the SSM protocol is enabled, whether to send and receive SSM values, and using SSM values ​​to select sources. In this embodiment, enabling is used as an example.

[0030] 2. Working mode: Automatic source selection: Select the optimal clock source based on the status of all clock sources.

[0031] 3. The time of the resetting timer: the waiting time after the clock source becomes available again.

[0032] 4. Preset level, used to select available clock sources during automatic source selection.

[0033] The embodiments of the present application involve three types of timers, namely, an alarm timer, an SSM timer and a reversal timer; among them, the reversal timer is started when the clock source changes from invalid to valid; the alarm timer is started when the alarm state changes to alarm generation; and the SSM timer is started when the SSM value becomes invalid.

[0034] The alarm status includes alarm generation and alarm elimination.

[0035] SSM reception processing: The SSM values ​​of OTN and SDH ports are carried in the overhead and can be directly obtained; The SSM value of the Ethernet port needs to receive and parse the ESMC message sent by the other end to obtain the SSM value; if the ESMC message sent by the other end is not received within the preset time, the SSM value of the Ethernet port is configured to be invalid; the preset time can be set to 5 seconds, but is not limited to this.

[0036] SSM sending process: The communication device sends the SSM value DNU (unavailable) for the selected clock source to prevent the generation of the clock ring, and sends the SSM value received by the selected clock source for other clock sources. The Ethernet port periodically sends a synchronization information message carrying the system clock SSM value. When the SSM value of the system clock changes, a synchronization event message is immediately sent to inform the opposite end device of the change in the local SSM. The period here can be 1 second, but is not limited to this.

[0037] The following describes in detail the process of implementing clock synchronization of OTN, PTN or IPRAN equipment in the embodiments of the present application in conjunction with the accompanying drawings.

[0038] See also Figure 1 , Figure 1 This is a schematic diagram of a clock synchronization process of an OTN, PTN or IPRAN device in an embodiment of the present application. The specific steps are: Step 101, in response to receiving an alarm status notification, obtaining a first alarm status and a clock source carried in the alarm status notification; and obtaining a second alarm status corresponding to the clock source stored in the system.

[0039] The port alarm is polled regularly (including the clock source). When the polled port alarm is inconsistent with the stored port alarm, an alarm change notification is issued. The alarm notification contains the port information, the current alarm and the last alarm. After the notification is issued, the port stored alarm is updated.

[0040] After receiving the alarm change notification, the clock module determines whether the current alarm is a clock source alarm generation or a clock source alarm elimination or triggers the execution of step 101 of the present application.

[0041] In the embodiment of the present application, for the convenience of description, an alarm including an alarm status and a clock source is referred to as an alarm status notification.

[0042] The first alarm state and the second alarm state here are not the difference between different alarm states, but the difference between the sources of the alarm states. The first alarm state is carried in the alarm state notification, and the second alarm state is the alarm state of the clock source stored in the system.

[0043] That is to say, the port alarm is polled periodically, and when there is a notification carrying the clock source and the alarm status of the clock source, the execution of this embodiment is triggered; other alarms do not trigger the execution of this embodiment.

[0044] Step 102: In response to the first alarm state being different from the second alarm state and the first alarm state being alarm generation, determine whether the clock source is a system clock source and the working state of the system clock.

[0045] Step 103, if it is determined that the clock source is the system clock source, and the system clock is working in a tracking or locking state, first configure the working mode of the system clock to the holding mode, then turn off the SSM timer and start the alarm timer; otherwise, directly turn off the SSM timer and start the alarm timer.

[0046] If the SSM timer is enabled in the current system, disable the SSM timer; if the SSM timer is not enabled, do not process the SSM timer.

[0047] Step 104: When the alarm timer expires, the latest alarm status and SSM value of the clock source are obtained.

[0048] Step 105, if it is determined according to the alarm timer that the clock source has no alarm, and the clock source is the system clock source, the working mode of the system clock is configured to the automatic working mode, and then the alarm status and SSM value of the latest acquired clock source are compared with the alarm status and SSM value of the clock source stored in the system; otherwise, the alarm status and SSM value of the latest acquired clock source are directly compared with the alarm status and SSM value of the clock source stored in the system.

[0049] In this step, if both of the following conditions are met at the same time, the system clock is configured to work in automatic mode, and the alarm status and SSM value of the latest acquired clock source are compared with the alarm status and SSM value of the clock source stored in the system: 1. Determine, based on the alarm timer, that the clock source has no alarm; and no alarm of the clock source occurs during the timing of the alarm timer.

[0050] 2. The clock source is the system clock source.

[0051] If one of the above conditions is met, or none of them is met, the alarm status and SSM value of the latest acquired clock source are compared with the alarm status and SSM value of the clock source stored in the system; the working mode is not configured.

[0052] Step 106, in response to the alarm status and SSM value of the latest acquired clock source being different from the alarm status and SSM value of the clock source stored in the system, and / or the SSM value being different, use the alarm status and SSM value of the latest clock source to update the stored alarm status and SSM value of the clock source, and restart the automatic source selection.

[0053] In the comparison result, if the alarm status is different, the SSM is different, or the SSM value and the alarm status are different, the different values ​​can be updated, or all can be updated uniformly; if the SSM value and the alarm status are the same, the relevant processing for the alarm status notification is terminated.

[0054] In the embodiment of the present application, when obtaining the alarm status notification, the alarm status in the alarm status notification is compared with the alarm status stored for the same clock source to see if they are the same. If they are different, the specific alarm status in the alarm status notification is considered to determine the switch timer, and by comparing the latest alarm status and SSM value of the clock source and the system stored alarm status and SSM value, it is determined whether to update the alarm status and SSM value stored in the clock source, and whether to start automatic source selection; and when the clock source is the system clock source, it is necessary to set the working mode of the system clock according to the working state of the system clock. It can be seen that in the embodiment of the present application, the instantaneous failure of the clock source is filtered out when the clock source is synchronized, and the stability of the device clock can be maintained.

[0055] See also Figure 2 , Figure 2This is another schematic diagram of the clock synchronization process of OTN, PTN or IPRAN equipment in the embodiment of the present application. The specific steps are: Step 201, in response to receiving an alarm status notification, obtaining a first alarm status and a clock source carried in the alarm status notification; and obtaining a second alarm status corresponding to the clock source stored in the system.

[0056] The port alarm is polled regularly (including the clock source). When the polled port alarm is inconsistent with the stored port alarm, an alarm change notification is issued. The alarm notification contains the port information, the current alarm and the last alarm. After the notification is issued, the port stored alarm is updated.

[0057] After receiving the alarm change notification, the clock module determines whether the current alarm is a clock source alarm generation or a clock source alarm elimination or triggers the execution of step 201 of the present application.

[0058] In the embodiment of the present application, for the convenience of description, an alarm including an alarm status and a clock source is referred to as an alarm status notification.

[0059] The first alarm state and the second alarm state here are not the difference between different alarm states, but the source of the difference alarm state. The first alarm state is carried in the alarm state notification, and the second alarm state is the alarm state of the clock source stored in the system. The alarm state includes: alarm generation and alarm elimination.

[0060] That is to say, the port alarm is polled periodically, and when there is a notification carrying the clock source and the alarm status of the clock source, the execution of this embodiment is triggered; other alarms do not trigger the execution of this embodiment.

[0061] Step 202: In response to the first alarm state being different from the second alarm state and the first alarm state being alarm generation, determine whether the clock source is a system clock source and the working state of the system clock.

[0062] Step 203, if it is determined that the clock source is the system clock source and the system clock is working in a tracking or locking state, first configure the working mode of the system clock to the holding mode, then turn off the SSM timer and start the alarm timer; otherwise, directly turn off the SSM timer and start the alarm timer.

[0063] If the SSM timer is enabled in the current system, disable the SSM timer; if the SSM timer is not enabled, do not process the SSM timer.

[0064] Step 204: When the alarm timer expires, the latest alarm status and SSM value of the clock source are obtained.

[0065] OTN, PTN, and IPRAN confirm the alarm status of the clock source by checking whether there are alarms such as LOS and LOF, and the Ethernet port determines whether the port is LINK; OTN, PTN, and IPRAN confirm the received SSM value through the overhead, and the Ethernet service obtains the SSM value by parsing the Ethernet message.

[0066] Step 205: If it is determined according to the alarm timer that the clock source has no alarm, and the clock source is the system clock source, the operating mode of the system clock is configured to the automatic operating mode, and then the alarm state and SSM value of the latest acquired clock source are compared with the alarm state and SSM value of the clock source stored in the system; otherwise, the alarm state and SSM value of the latest acquired clock source are directly compared with the alarm state and SSM value of the clock source stored in the system. Execute step 208.

[0067] In this step, if both of the following conditions are met at the same time, the system clock is configured to work in automatic mode, and the alarm status and SSM value of the latest acquired clock source are compared with the alarm status and SSM value of the clock source stored in the system: 1. Determine, based on the alarm timer, that the clock source has no alarm; and no alarm of the clock source occurs during the timing of the alarm timer.

[0068] 2. The clock source is the system clock source.

[0069] If one of the above conditions is met, or none of them is met, the alarm status and SSM value of the latest acquired clock source are compared with the alarm status and SSM value of the clock source stored in the system; the working mode is not configured.

[0070] Step 206: In response to the first alarm state being different from the second alarm state and the first alarm state being alarm elimination, the SSM timer is turned off and the switchback timer is turned on.

[0071] If the SSM timer for the clock source is currently enabled, the SSM timer is disabled; if the SSM timer for the clock source is currently not enabled, no processing is performed.

[0072] Step 207, when the reversal timer expires, obtain the latest alarm status and SSM value of the clock source; and compare the latest alarm status and SSM value of the clock source with the alarm status and SSM value of the clock source stored in the system.

[0073] Step 208: In response to the alarm status and SSM value of the latest acquired clock source being different from the alarm status and SSM value of the clock source stored in the system, and / or the SSM value being different, the alarm status and SSM value of the latest clock source are used to update the stored alarm status and SSM value of the clock source, and the automatic source selection is restarted. This process ends.

[0074] In the comparison result, if the alarm status is different, the SSM is different, or the SSM value and the alarm status are different, the different values ​​can be updated, or all can be updated uniformly; if the SSM value and the alarm status are the same, the relevant processing for the alarm status notification is terminated.

[0075] Step 209: In response to the first alarm state being the same as the second alarm state, turning off the currently enabled timer associated with the alarm source.

[0076] In the embodiment of the present application, the timers related to the alarm source include: an alarm timer, a reversal timer and an SSM timer. If any of these timers are turned on, all of them are turned off.

[0077] Step 210, if the clock source is a system clock source and the system clock works in the hold mode, first configure the system clock to the automatic working mode; then obtain the latest SSM value of the clock source; otherwise, directly obtain the latest SSM value of the clock source.

[0078] When the clock source meets the following two conditions, you need to configure the system clock to automatic working mode and obtain the latest SSM value. Otherwise, directly obtain the SSM value: 1. The clock source is the system clock source; 2. The system clock works in hold mode.

[0079] Step 211, comparing the most recently acquired SSM value of the clock source with the SSM value of the clock source stored in the system.

[0080] Step 212: In response to the SSM value of the latest acquired clock source being different from the SSM value of the clock source stored in the system, the SSM value of the stored clock source is updated using the SSM value of the latest clock source, and the automatic source selection is restarted.

[0081] In response to the SSM value of the latest acquired clock source being the same as the SSM value of the clock source stored in the system, the relevant processing for the secondary alarm status notification is terminated.

[0082] In the embodiment of the present application, when obtaining the alarm status notification, the alarm status in the alarm status notification is compared with the alarm status stored for the same clock source to determine whether they are the same, and different processing is performed respectively. At the same time, the specific alarm status in the alarm status notification needs to be considered to determine the switch timer, and by comparing the latest alarm status and SSM value of the clock source and the system stored alarm status and SSM value, it is determined whether to update the alarm status and SSM value stored in the clock source, and whether to start automatic source selection; and when the clock source is the system clock source, it is necessary to set the working mode of the system clock according to the working state of the system clock. When the alarm status is the same, the latest obtained SSM value and the system stored SSM value are compared to determine whether to start automatic source selection according to whether the clock source is the system clock source and the working mode of the system clock. It can be seen that in the embodiment of the present application, the instantaneous failure of the clock source is filtered out when the clock source is synchronized, and the stability of the device clock can be maintained.

[0083] See also Figure 3 , Figure 3 This is a schematic diagram of the clock synchronization process after receiving the SSM notification in an embodiment of the present application. The specific steps are: Step 301, in response to not receiving an alarm status notification, not starting an alarm timer, and receiving an SSM notification; obtaining a clock source and an SSM value carried in the SSM notification; and obtaining the SSM value corresponding to the clock source stored in the system.

[0084] The port SSM value is polled periodically (including the clock source). When the polled port SSM value is inconsistent with the stored port SSM value, an SSM value change notification is issued, which is called SSM notification.

[0085] In the embodiment of the present application, the focus is on the SSM value related to the clock source. Therefore, the SSM notification to be processed is the notification carrying the SSM value and the clock source.

[0086] The priority of alarm processing is higher than that of SSM value processing. Therefore, when no alarm status notification is currently received and the alarm timer is not turned on, it will be processed only if an SSM notification is received; if an alarm status notification is currently received or the alarm timer is being turned on, the relevant processing in this embodiment will not be performed even if an SSM notification is received.

[0087] Step 302: compare the SSM value carried in the SSM notification with the SSM value stored in the system.

[0088] Step 303: In response to the SSM value carried in the SSM notification being the same as the SSM value stored in the system, the SSM timer and the reversal timer are turned off, and this process ends.

[0089] Step 304: In response to the SSM value carried in the SSM notification being different from the SSM value stored in the system, determine whether the SSM value carried in the SSM notification and the SSM value stored in the system are valid.

[0090] Step 305: If the SSM value carried in the SSM notification is valid and the SSM value stored in the system is invalid, start the reversal timer; if the SSM value stored in the system is valid and the SSM value carried in the SSM notification is invalid, start the SSM timer.

[0091] Step 306: When the reversal timer or the SSM timer expires, the latest SSM value of the clock source is obtained.

[0092] When the reversal timer is turned on in step 305, step 306 is to obtain the latest SSM value of the clock source when the reversal timer expires; when the SSM timer is turned on in step 305, step 306 is to obtain the latest SSM value of the clock source when the SSM timer expires.

[0093] Step 307: In response to the latest SSM value obtained being different from the SSM value stored in the system, the SSM value corresponding to the clock source stored in the system is updated using the latest SSM value obtained, and the automatic source selection is restarted. This process ends.

[0094] Step 308: If the SSM value carried in the SSM notification is valid and the SSM value stored in the system is valid, the SSM value carried in the SSM notification is updated to the SSM value of the clock source stored in the system, and automatic source selection is enabled.

[0095] In this embodiment, when no alarm status notification is received, the alarm timer is not turned on, and an SSM notification is received, whether to update the SSM value stored in the system and whether to start automatic source selection are determined based on the SSM value carried in the SSM notification and the size of the SSM value stored in the system, as well as whether they are valid, so as to make the clock synchronization more stable.

[0096] See also Figure 4 , Figure 4 This is a schematic diagram of the automatic source selection process in the embodiment of this application. The specific steps are: Step 401, poll all clock sources.

[0097] Step 402: determine whether the polled clock source is selectable.

[0098] Step 403, selecting the best clock source from the clock sources determined to be optional; wherein the optional clock source is a clock source that has no alarm, a valid SSM value and a corresponding level higher than a preset level, and is not configured with a lock command.

[0099] When selecting the best clock source from the selectable clock sources, the system first selects the best clock source based on the SSM value. If the SSM values ​​are the same, the system selects the best clock source based on the priority. If the priority still cannot select the best clock source, the system selects the best clock source manually.

[0100] In this embodiment, all clock sources are polled, and a determination is first made as to whether each clock source is selectable; the selectable clock source satisfies the following conditions: the clock source has no alarm, the SSM value is valid and the corresponding level is higher than the preset level, and no lock command is configured, and the best clock source is found among the selectable clock sources and selected; in this embodiment, whether the lock command is configured is taken into consideration when determining the selectable clock source; the clock source can be selected more accurately.

[0101] See also Figure 5 , Figure 5 This is a flow chart of monitoring the clock source board status of the board where the clock source is located in the embodiment of the present application. The specific steps are: Step 501, monitoring the board status of the clock source board.

[0102] Step 502: In response to the board state of any clock source board changing from running to not running, the corresponding clock source is set to a not running flag, and automatic source selection is enabled. This process ends.

[0103] Step 503, in response to the board status of any clock source board changing from not running to running, the corresponding clock source is set to the running flag, the latest alarm status and SSM value are obtained, and the alarm status and SSM value of the clock source stored in the system are updated using the latest alarm status and SSM value, and automatic source selection is started.

[0104] In this embodiment, by monitoring the board status of the clock source board, the clock source can be set to not running in time when the status changes to not running, and it will not be selected as the optimal clock source; the alarm status and SSM value can be updated in time when the status changes to running, so that the clock source can participate in the clock source selection.

[0105] Based on the same inventive concept, an embodiment of the present application also provides a clock synchronization device for OTN, PTN or IPRAN equipment. Figure 6 , Figure 6 This is a schematic diagram of the structure of the clock synchronization device for OTN, PTN or IPRAN equipment in the embodiment of the present application. The device includes: The first acquisition unit 601 is used to obtain the first alarm state and clock source carried in the alarm state notification in response to receiving the alarm state notification; and obtain the second alarm state corresponding to the clock source stored in the system; A determining unit 602 is configured to determine whether the clock source is a system clock source and a working state of the system clock in response to the first alarm state being different from the second alarm state and the first alarm state being alarm generation; The first processing unit 603 is used to, if it is determined that the clock source is a system clock source and the system clock is working in a tracking or locking state, first configure the working mode of the system clock to a holding mode, then turn off the SSM timer, and start the alarm timer; otherwise, directly turn off the SSM timer and start the alarm timer; The second acquisition unit 604 is used to acquire the latest alarm state and SSM value of the clock source when the alarm timer ends; The second processing unit 605 is configured to configure the working mode of the system clock to the automatic working mode if it is determined according to the alarm timer that the clock source has no alarm and the clock source is the system clock source, and then compare the alarm state and SSM value of the latest acquired clock source with the alarm state and SSM value of the clock source stored in the system; otherwise, directly compare the alarm state and SSM value of the latest acquired clock source with the alarm state and SSM value of the clock source stored in the system; The third processing unit 606 is used to respond to the alarm status and SSM value of the latest acquired clock source being different from the alarm status and SSM value of the clock source stored in the system, and / or the SSM value being different, update the stored alarm status and SSM value of the clock source using the latest alarm status and SSM value of the clock source, and restart the automatic source selection.

[0106] In another example, The first processing unit 603 is further configured to, in response to the first alarm state being different from the second alarm state and the first alarm state being alarm elimination, turn off the SSM timer and start the reversal timer; The second acquisition unit 604 is further configured to acquire the latest alarm state and SSM value of the clock source when the reversal timer expires; and compare the latest alarm state and SSM value of the clock source with the alarm state and SSM value of the clock source stored in the system; The third processing unit 606 is further specifically used to respond to the alarm status and SSM value of the latest acquired clock source being different from the alarm status and SSM value of the clock source stored in the system, and / or the SSM value being different, to update the stored alarm status and SSM value of the clock source using the latest alarm status and SSM value of the clock source, and restart the automatic source selection.

[0107] In another example, The first processing unit 603 is further configured to, in response to the first alarm state being the same as the second alarm state, turn off the currently enabled timer; The second acquisition unit 604 is further configured to, if the clock source is a system clock source and the system clock works in a hold mode, first configure the system clock to an automatic working mode; then acquire the latest SSM value of the clock source; otherwise, directly acquire the latest SSM value of the clock source; The third processing unit 606 further specifically compares the SSM value of the latest acquired clock source with the SSM value of the clock source stored in the system; in response to the SSM value of the latest acquired clock source being different from the SSM value of the clock source stored in the system, the SSM value of the stored clock source is updated using the SSM value of the latest clock source, and the automatic source selection is restarted.

[0108] In another example, The first acquisition unit 601 is further configured to, in response to not receiving an alarm status notification at present, not starting an alarm timer, and receiving an SSM notification; obtain a clock source and an SSM value carried in the SSM notification; and obtain an SSM value corresponding to the clock source stored in the system; in response to the SSM value carried in the SSM notification being the same as the SSM value stored in the system, turn off the SSM timer and the reversal timer; The second acquisition unit 604 is further used to compare the SSM value carried in the SSM notification with the SSM value stored in the system; in response to the SSM value carried in the SSM notification and the SSM value stored in the system being different, determine whether the SSM value carried in the SSM notification and the SSM value stored in the system are valid; if the SSM value carried in the SSM notification is valid and the SSM value stored in the system is invalid, start the reversal timer; if the SSM value stored in the system is valid and the SSM value carried in the SSM notification is invalid, start the SSM timer; when the reversal timer or the SSM timer expires, obtain the latest SSM value of the clock source; The third processing unit 606 is further used to, in response to the latest SSM value obtained being different from the SSM value stored in the system, use the latest SSM value obtained to update the SSM value corresponding to the clock source stored in the system, and restart the automatic source selection; if the SSM value carried in the SSM notification is valid and the SSM value stored in the system is valid, the SSM value carried in the SSM notification is updated to the SSM value of the clock source stored in the system, and the automatic source selection is started.

[0109] In another example, Automatic source selection includes: polling all clock sources; Determine whether the polled clock source is selectable; The best clock source is selected from the clock sources judged to be optional; wherein the optional clock source is a clock source with no alarm, a valid SSM value and a corresponding level higher than a preset level, and no lock command is configured.

[0110] In another example, The SSM values ​​of OTN and SDH ports are carried in the overhead and can be directly obtained; The SSM value of the Ethernet port needs to receive and parse the ESMC message sent by the peer end to obtain the SSM value; if the ESMC message sent by the peer end cannot be received within the preset time, the SSM value of the Ethernet port is configured to be invalid; The Ethernet port periodically sends a synchronization information message carrying the system clock SSM value. When the SSM value of the system clock changes, a synchronization event message is immediately sent to inform the peer device of the change in the local SSM.

[0111] In another example, The determination unit 602 is further configured to monitor the board status of the clock source board; The third processing unit 606 is further used to respond to the board status of any clock source board changing from running to not running, set the corresponding clock source to a not running flag, and start automatic source selection; respond to the board status of any clock source board changing from not running to running, set the corresponding clock source to a running flag, obtain the latest alarm status and SSM value, and use the latest alarm status and SSM value to update the alarm status and SSM value of the clock source stored in the system, and start automatic source selection.

[0112] In another embodiment, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements a clock synchronization method for OTN, PTN, or IPRAN equipment when executing the program.

[0113] In another embodiment, a computer-readable storage medium is provided, on which computer instructions are stored. When the instructions are executed by a processor, a method for synchronizing the clock of an OTN, PTN or IPRAN device is implemented.

[0114] Figure 7 Schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. Figure 7 As shown, the electronic device may include: a processor (Processor) 710, a communication interface (Communications Interface) 720, a memory (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 the logic instructions in the memory 730 to execute the following method: In response to receiving an alarm status notification, obtaining a first alarm status and a clock source carried in the alarm status notification; and obtaining a second alarm status corresponding to the clock source stored in the system; In response to the first alarm state being different from the second alarm state and the first alarm state being alarm generation, determining whether the clock source is a system clock source and the state in which the system clock is operating; If the clock source is determined to be the system clock source and the system clock is working in the tracking or locking state, first configure the working mode of the system clock to the holding mode, then disable the SSM timer and enable the alarm timer; otherwise, directly disable the SSM timer and enable the alarm timer; When the alarm timer expires, the latest alarm status and SSM value of the clock source are obtained; If it is determined according to the alarm timer that the clock source has no alarm and the clock source is the system clock source, the working mode of the system clock is configured to the automatic working mode, and then the alarm status and SSM value of the latest clock source obtained are compared with the alarm status and SSM value of the clock source stored in the system; otherwise, the alarm status and SSM value of the latest clock source obtained are directly compared with the alarm status and SSM value of the clock source stored in the system; In response to the alarm status and SSM value of the latest acquired clock source being different from the alarm status and SSM value of the clock source stored in the system, and / or the SSM value being different, the alarm status and SSM value of the latest clock source are used to update the stored alarm status and SSM value of the clock source, and automatic source selection is restarted.

[0115] 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 invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for 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 methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0116] 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.

[0117] 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, 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.

[0118] The flow chart and block diagram in the accompanying drawings of the present application show the possible architecture, function and operation of the system, method and computer program product according to the various embodiments disclosed in the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the box can also occur in the order of the standards in different figures. For example, the boxes represented by two connections can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0119] Those skilled in the art will appreciate that the features described in the various embodiments and / or claims disclosed in this application may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in this application. In particular, without departing from the spirit and teachings of this application, the features described in the various embodiments and / or claims of this application may be combined and / or combined in a variety of ways, and all of these combinations and / or combinations fall within the scope disclosed in this application.

[0120] Specific embodiments are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core ideas, and is not used to limit the present application. For those skilled in the art, changes can be made in the specific implementation methods and application scopes according to the ideas, spirits and principles of the present invention, and any modifications, equivalent substitutions, improvements, etc. made therein should be included in the scope of protection of this application.

Claims

1. A method for synchronizing clocks of OTN, PTN or IPRAN equipment, characterized in that: The method comprises: In response to receiving an alarm status notification, obtaining a first alarm status and a clock source carried in the alarm status notification; and obtaining a second alarm status corresponding to the clock source stored in the system; In response to the first alarm state being different from the second alarm state and the first alarm state being alarm generation, determining whether the clock source is a system clock source and a state in which the system clock is operating; If it is determined that the clock source is a system clock source and the system clock is working in a tracking or locking state, first configure the working mode of the system clock to a holding mode, then turn off the SSM timer and turn on the alarm timer; otherwise, directly turn off the SSM timer and turn on the alarm timer; When the alarm timer expires, obtaining the latest alarm status and SSM value of the clock source; If it is determined according to the alarm timer that the clock source has no alarm, and the clock source is a system clock source, the operating mode of the system clock is configured to be an automatic operating mode, and then the alarm state and SSM value of the clock source most recently obtained are compared with the alarm state and SSM value of the clock source stored in the system; otherwise, the alarm state and SSM value of the clock source most recently obtained are directly compared with the alarm state and SSM value of the clock source stored in the system; In response to the alarm status and SSM value of the clock source most recently acquired being different from the alarm status and SSM value of the clock source stored in the system, and / or the SSM value being different, the stored alarm status and SSM value of the clock source are updated using the latest alarm status and SSM value of the clock source, and automatic source selection is restarted.

2. The method according to claim 1, characterized in that The method further comprises: In response to the first alarm state being different from the second alarm state and the first alarm state being alarm elimination, turning off the SSM timer and starting the switchback timer; When the reversal timer ends, the latest alarm state and SSM value of the clock source are obtained; and the latest alarm state and SSM value of the clock source are compared with the alarm state and SSM value of the clock source stored in the system; In response to the alarm status and SSM value of the clock source most recently acquired being different from the alarm status and SSM value of the clock source stored in the system, and / or the SSM value being different, the stored alarm status and SSM value of the clock source are updated using the latest alarm status and SSM value of the clock source, and automatic source selection is restarted.

3. The method according to claim 1, characterized in that The method further comprises: In response to the first alarm state being the same as the second alarm state, closing a currently enabled timer; If the clock source is a system clock source and the system clock works in the hold mode, first configure the system clock to the automatic working mode; then obtain the latest SSM value of the clock source; otherwise, directly obtain the latest SSM value of the clock source; Comparing the most recently acquired SSM value of the clock source with the SSM value of the clock source stored in the system; In response to the SSM value of the clock source that is most recently acquired being different from the SSM value of the clock source stored in the system, the SSM value of the clock source that is most recently stored is updated using the SSM value of the clock source, and automatic source selection is restarted.

4. The method according to claim 1, characterized in that: The method further comprises: In response to not receiving an alarm status notification, not starting an alarm timer, and receiving an SSM notification; obtaining a clock source and an SSM value carried in the SSM notification; and obtaining an SSM value corresponding to the clock source stored in the system; Comparing the SSM value carried in the SSM notification with the SSM value stored in the system; In response to the SSM value carried in the SSM notification being different from the SSM value stored in the system, determining whether the SSM value carried in the SSM notification and the SSM value stored in the system are valid; If the SSM value carried in the SSM notification is valid and the SSM value stored in the system is invalid, start the reversal timer; if the SSM value stored in the system is valid and the SSM value carried in the SSM notification is invalid, start the SSM timer; When the reversal timer or the SSM timer expires, obtaining the latest SSM value of the clock source; In response to the latest SSM value obtained being different from the SSM value stored in the system, using the latest SSM value obtained to update the SSM value corresponding to the clock source stored in the system, and restarting the automatic source selection; If the SSM value carried in the SSM notification is valid and the SSM value stored in the system is valid, the SSM value carried in the SSM notification is updated to the SSM value of the clock source stored in the system, and automatic source selection is enabled; In response to the SSM value carried in the SSM notification being the same as the SSM value stored in the system, the SSM timer and the switchback timer are turned off.

5. The method according to any one of claims 1 to 4, characterized in that: The automatic source selection comprises: Poll all clock sources; Determine whether the polled clock source is selectable; The best clock source is selected from the clock sources judged to be optional; wherein the optional clock source is a clock source with no alarm, a valid SSM value and a corresponding level higher than a preset level, and no lock command is configured.

6. The method according to claim 1, characterized in that The method further comprises: The SSM values ​​of OTN and SDH ports are carried in the overhead and can be directly obtained; The SSM value of the Ethernet port needs to receive and parse the ESMC message sent by the peer end to obtain the SSM value; if the ESMC message sent by the peer end cannot be received within the preset time, the SSM value of the Ethernet port is configured to be invalid; The Ethernet port periodically sends a synchronization information message carrying the system clock SSM value. When the SSM value of the system clock changes, a synchronization event message is immediately sent to inform the peer device of the change in the local SSM.

7. The method according to claim 1, characterized in that The method further comprises: Monitor the board status of the clock source board; In response to the board state of any clock source board changing from running to not running, the corresponding clock source is set to a not running flag, and automatic source selection is started; In response to the board status of any clock source board changing from not running to running, the corresponding clock source is set to the running flag, the latest alarm status and SSM value are obtained, and the latest alarm status and SSM value obtained are used to update the alarm status and SSM value of the clock source stored in the system, and automatic source selection is started.

8. A clock synchronization device for OTN, PTN or IPRAN equipment, characterized in that: The device comprises: A first acquisition unit is used to, in response to receiving an alarm status notification, acquire a first alarm status and a clock source carried in the alarm status notification; and acquire a second alarm status corresponding to the clock source stored in the system; a determining unit, configured to determine, in response to the first alarm state being different from the second alarm state and the first alarm state being alarm generation, whether the clock source is a system clock source and a working state of the system clock; The first processing unit is used for, if it is determined that the clock source is a system clock source and the system clock is working in a tracking or locking state, first configuring the working mode of the system clock to a holding mode, then turning off the SSM timer, and turning on the alarm timer; otherwise, directly turning off the SSM timer and turning on the alarm timer; A second acquisition unit, configured to acquire the latest alarm state and SSM value of the clock source when the alarm timer ends; A second processing unit is configured to configure the working mode of the system clock to an automatic working mode, and then compare the latest alarm status and SSM value of the clock source with the alarm status and SSM value of the clock source stored in the system, if it is determined according to the alarm timer that the clock source has no alarm, and the clock source is a system clock source; otherwise, directly compare the latest alarm status and SSM value of the clock source with the alarm status and SSM value of the clock source stored in the system; The third processing unit is used to respond to the alarm status and SSM value of the clock source most recently acquired being different from the alarm status and SSM value of the clock source stored in the system, and / or the SSM value being different, update the stored alarm status and SSM value of the clock source using the latest alarm status and SSM value of the clock source, and restart the automatic source selection.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method described in any one of claims 1 to 7 is implemented.