CN111355569A - Time synchronization method, device, system, node and readable storage medium - Google Patents

Time synchronization method, device, system, node and readable storage medium Download PDF

Info

Publication number
CN111355569A
CN111355569A CN202010126405.5A CN202010126405A CN111355569A CN 111355569 A CN111355569 A CN 111355569A CN 202010126405 A CN202010126405 A CN 202010126405A CN 111355569 A CN111355569 A CN 111355569A
Authority
CN
China
Prior art keywords
clock source
time
source node
node
external network
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010126405.5A
Other languages
Chinese (zh)
Other versions
CN111355569B (en
Inventor
吴业亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuxi Huayun Data Technology Service Co Ltd
Original Assignee
Wuxi Huayun Data Technology Service Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuxi Huayun Data Technology Service Co Ltd filed Critical Wuxi Huayun Data Technology Service Co Ltd
Priority to CN202010126405.5A priority Critical patent/CN111355569B/en
Publication of CN111355569A publication Critical patent/CN111355569A/en
Application granted granted Critical
Publication of CN111355569B publication Critical patent/CN111355569B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L7/00Arrangements for synchronising receiver with transmitter
    • H04L7/0008Synchronisation information channels, e.g. clock distribution lines

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

The application provides a time synchronization method, a device, a system, a node and a readable storage medium, wherein a clock source system comprises a main clock source node and a standby clock source node, wherein: the master clock source node is used for establishing connection with an external network clock source, synchronizing the standard time of the external network clock source and synchronizing the standard time to each service node through an internal network; and the standby clock source node is used for establishing connection with the outer network clock source when the main clock source node fails, synchronizing the standard time of the outer network clock source and synchronizing the standard time to each service node through the inner network. Therefore, in the scene that the service nodes are not allowed to be accessed to the external network, the time consistency and the reliability of each service node are realized through the relay of the main clock source node and the standby clock source node. In addition, when the main clock source node fails, the clock source system can also realize the time synchronization of each service node through the standby clock source node, so that the whole clock source system has high availability and high reliability.

Description

Time synchronization method, device, system, node and readable storage medium
Technical Field
The present application relates to the field of internet technologies, and in particular, to a time synchronization method, apparatus, system, node, and readable storage medium.
Background
In internet traffic, the time required for different services is highly consistent in many scenarios. For example, in some scenarios, a service node needs to access a system and needs to acquire a security token, but generally, the security token has a certain validity period due to security considerations, and if the time of the service node is inconsistent with that of the system, the security token is likely to fail.
In the current common service node time synchronization scheme, a service node acquires standard time in an external network clock source through an external network for synchronization, so that the consistency and reliability of the time of the service node and the time of each node in a system are ensured. In many scenarios, however, the service node is not allowed to access the foreign network for traffic security reasons. For such a scenario, how to implement time consistency and reliability of each service node becomes an urgent problem to be solved.
Disclosure of Invention
An object of the embodiments of the present application is to provide a time synchronization method, apparatus, system, node, and readable storage medium, so as to solve a problem how to implement time consistency and reliability of each service node in a scenario where a service node is not allowed to access an external network.
The embodiment of the application provides a clock source system, which comprises a main clock source node and a standby clock source node;
the master clock source node is used for establishing connection with an external network clock source, synchronizing the standard time of the external network clock source and synchronizing the standard time to each service node through an internal network; and the standby clock source node is used for establishing connection with an external network clock source when the main clock source node fails, synchronizing the standard time of the external network clock source and synchronizing the standard time to each service node through an internal network.
In the clock source system, under normal conditions, a master clock source node is connected with an external network clock source, and then the master clock source node synchronizes standard time to each service node through an internal network, and when the master clock source node fails, the master clock source node is connected with the external network clock source through a standby clock source node, and then the standard time is synchronized to each service node through the internal network. Therefore, in the scene that the service nodes are not allowed to be accessed to the external network, each service node can be synchronized with the standard time through the relay of the main clock source node and the standby clock source node, and the time consistency and reliability of each service node are realized. In addition, when the main clock source node fails, the clock source system can also realize the time synchronization of each service node through the standby clock source node, so that the whole clock source system has high availability and high reliability.
Further, the master clock source node is specifically configured to synchronize its own master board time according to the standard time of the external network clock source; and the master clock source node is also used for synchronizing the time of the mainboard of the master clock source node to each service node when the master clock source node is disconnected with the external network clock source.
In the clock source system, the main clock source node synchronizes the time of the main board according to the standard time of the external network clock source, so that when the main clock source node is disconnected with the external network clock source, the time of the main board can be synchronized to each service node, and the time consistency and the reliability of each service node are ensured to a certain extent.
Further, the master clock source node is further configured to synchronize the standard time to the slave clock source node; the standby clock source node is also used for acquiring the standard time from the main clock source node so as to synchronize the time of the main board; and the standby clock source node is also used for synchronizing the mainboard time of the standby clock source node to each service node when the main clock source node fails and the standby clock source node cannot establish connection with an external network clock source.
In the clock source system, the standby clock source node synchronizes the mainboard time of the standby clock source node according to the standard time acquired from the main clock source node, so that when the main clock source node fails and the standby clock source node cannot establish connection with an external network clock source, the mainboard time of the standby clock source node is synchronized to each service node, and the time consistency and reliability of each service node are ensured to a certain extent.
Furthermore, the master clock source node and the standby clock source node both comprise an external network card and an internal network card; the external network card is used for communicating with the external network clock source and only allows the message related to time synchronization to pass through; the intranet network card is used for communicating with other nodes except the intranet node, and only allows request messages of the other nodes and time information of the intranet network card to pass through; the intranet nodes comprise the main clock source node, the standby clock source node and the service node; the time information includes the standard time and the mainboard time.
In the clock source system, the external network card is used for communicating with the external network clock source and only allowing the messages related to time synchronization to pass, and the internal network card is used for communicating with other nodes except the internal network node and only allowing the request messages of the other nodes and the time information of the internal network node to pass. Therefore, the isolation between the service node and the external network is effectively realized, and the safety of a service system (namely a system formed by each service node) is improved.
Further, the master clock source node and the standby clock source node refuse access requests for the time information through the external network card.
In the above clock source system, the time information of the master clock source node or the slave clock source node cannot be obtained through the external network card, so that the isolation between the service node and the external network is further enhanced, and the security of the service system (i.e. the system formed by each service node) is improved.
The embodiment of the present application further provides a time synchronization method, applied to a standby clock source node, including:
when the main clock source node fails, connection is established with an external network clock source; acquiring standard time from the external network clock source in real time; and synchronizing the standard time to each service node in the intranet through the intranet.
In the implementation process, when the master clock source node fails, the standby clock source node can establish connection with an external network clock source, and then the standard time is synchronized to each service node through the internal network. Therefore, in the scene that the service nodes do not allow to access the external network, each service node can be synchronized with the standard time through the relay of the standby clock source node, and the time consistency and the reliability of each service node are realized. Meanwhile, when the main clock source node fails, the standby clock source node can realize the time synchronization of each service node, so that the scheme provided by the embodiment of the application has high availability and high reliability.
Further, the method further comprises: and when the master clock source node fails, acquiring time information from the master clock source node to synchronize the time of the master board.
In the implementation process, when the master clock source node fails, time information can be acquired from the master clock source node to synchronize the own mainboard time, so that the consistency of the own mainboard time and a service system is ensured.
Further, after obtaining the standard time from the external network clock source in real time, the method further includes: and synchronizing the mainboard time of the computer according to the standard time.
In the implementation process, the mainboard time of the user can be synchronized according to the standard time, so that the consistency of the mainboard time of the user and a service system is ensured.
Further, the method further comprises: and synchronizing the time of the mainboard of the master clock source to each service node when the master clock source node fails and cannot establish connection with the external network clock source.
In the implementation process, when the master clock source node fails and the standby clock source node cannot establish connection with the external network clock source, the time of the main board of the standby clock source node can be synchronized to each service node, so that the time consistency and reliability of each service node are ensured to a certain extent.
The embodiment of the present application further provides a time synchronization method, applied to a master clock source node, including:
establishing connection with an external network clock source; synchronizing the mainboard time of the external network clock source according to the standard time of the external network clock source, and synchronizing the standard time to each service node through the internal network; and when the connection with the external network clock source is disconnected, synchronizing the time of the mainboard of the user to each service node.
In the implementation process, each service node can synchronize with standard time through the relay of the master clock source node, and the time consistency and reliability of each service node are realized. In addition, when the master clock source node is disconnected with the external network clock source, the time of the master board of the master clock source node can be synchronized to each service node, so that the time consistency and reliability of each service node are ensured to a certain extent.
Further, when the standard time is synchronized to each service node through the intranet, the method further includes: and synchronizing the standard time to a standby clock source so that the standby clock source synchronizes the mainboard time of the standby clock source according to the standard time.
In the implementation process, the master clock source node may synchronize the standard time to the standby clock source, so that the standby clock source synchronizes the motherboard time of the standby clock source according to the standard time, thereby making the motherboard time of the standby clock source consistent with that of the service system.
Further, when synchronizing the time of the motherboard to each service node, the method further includes: and synchronizing the mainboard time to a standby clock source so that the standby clock source synchronizes the mainboard time of the standby clock source according to the mainboard time of the main clock source node.
In the implementation process, when the main clock source node is disconnected from the external network clock source, the main board time of the main clock source node is synchronized to the standby clock source, so that the standby clock source synchronizes the main board time of the standby clock source according to the main board time of the main clock source node, and the main board time of the standby clock source is consistent with that of the service system.
The embodiment of the present application further provides a time synchronization apparatus, which is applied to a standby clock source node, and includes: the device comprises a first connection module, an acquisition module and a first synchronization module; the first connection module is used for establishing connection with an external network clock source when the main clock source node fails; the acquisition module is used for acquiring standard time from the external network clock source in real time; and the first synchronization module is used for synchronizing the standard time to each service node in the intranet through the intranet.
The embodiment of the present application further provides a time synchronization apparatus, which is applied to a master clock source node, and includes: a second connection module and a second synchronization module; the second connection module is used for establishing connection with an external network clock source; the second synchronization module is used for synchronizing the mainboard time of the second synchronization module according to the standard time of the external network clock source and synchronizing the standard time to each service node through the internal network; and the system is used for synchronizing the time of the mainboard of the system to each service node when the system is disconnected with the external network clock source.
An embodiment of the present application further provides a clock source node, including: the system comprises an external network card, an internal network card, a processor, a memory and a communication bus; the external network card is used for communicating with the external network clock source; the intranet network card is used for communicating with other nodes except the clock source node in the intranet nodes, and the intranet nodes comprise a main clock source node, a standby clock source node and a service node; the clock source node is the master clock source node or the slave clock source node; the communication bus is used for realizing the connection and communication among the external network card, the internal network card, the processor and the memory; the processor is configured to execute one or more programs stored in the memory to implement any of the time synchronization methods described above.
Also provided in an embodiment of the present application is a readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement any of the time synchronization methods described above.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a schematic diagram of interaction between a clock source system and the outside according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram of a more specific clock source system interacting with the outside according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a time synchronization method executed by a master clock source node according to an embodiment of the present application;
fig. 4 is a schematic flowchart of a time synchronization method executed by a standby clock source node according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a time synchronization apparatus applied to a standby clock source node according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a time synchronization apparatus applied to a master clock source node according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a clock source node according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
The first embodiment is as follows:
in the embodiment of the present application, a clock source system is provided, as shown in fig. 1, where the clock source system includes a master clock source node and a slave clock source node. Wherein:
the main clock source node is used for establishing connection with an external network clock source, synchronizing the standard time of the external network clock source and synchronizing the standard time to each service node.
And the standby clock source node is used for establishing connection with the external network clock source when the main clock source node fails, synchronizing the standard time of the external network clock source and synchronizing the standard time to each service node.
In this embodiment, the external network clock source may be a device having a standard time in the external network. The standard Time in the embodiment of the present application may be Coordinated Universal Time (UTC), or may be a motherboard Time of an external network clock source device.
It should be further noted that, in the embodiment of the present application, there may be a plurality of external network clock sources, where one of the external network clock sources is a main external network clock source, and the others are standby external network clock sources. The master clock source node establishes a connection with a master external network clock source by default, and when the connection with the master external network clock source cannot be established (for example, when the master clock source fails), the master clock source node establishes a connection with a standby external network clock source so as to obtain standard time from the standby external network clock source. Similarly, when the main clock source node fails, the standby clock source node defaults to establish connection with the main external network clock source, and when the main external network clock source cannot be established, the standby clock source node establishes connection with the standby external network clock source so as to obtain standard time from the standby external network clock source.
It should be understood that, in the embodiment of the present application, the master clock source node and the slave clock source node may have a master board time. The master clock source node and the standby clock source node can autonomously time the time of the mainboard, namely, fixed timing steps are arranged in the master clock source node and the standby clock source node, so that autonomous time is realized, and the time of the mainboard is obtained. In the embodiment of the present application, the timing step lengths set in the master clock source node and the slave clock source node should be kept as consistent as possible with the timing step length of the standard time of the external network clock source.
It should be further understood that, in the embodiment of the present application, when the master clock source node synchronizes the standard time of the external network clock source, the master clock source node may synchronize its own motherboard time according to the standard time of the external network clock source, that is, the master clock source node may synchronize its own motherboard time according to the standard time of the external network clock source, thereby ensuring the consistency between its own motherboard time and the standard time.
In the embodiment of the application, the master clock source node is normally connected with the external network clock source to synchronize the standard time of the external network clock source. However, in some cases, a situation that the master clock source node cannot be connected to the external network clock source may occur (for example, a situation that the master clock source node is disconnected from the network). The main clock source node can carry out autonomous timing according to a fixed timing step, and the timing step is set to be as consistent as possible with the timing step of the standard time of the external network clock source, so that the time of each service node can be ensured to be consistent, and the consistency of the time of each service node and the equipment in the external network can be realized to a certain extent.
It should be understood that, when the master clock source node cannot be connected to the external network clock source, the master clock source node may continuously try to establish connection with the external network clock source while synchronizing the own master board time of the master clock source node to each service node, so as to continue to synchronize the standard time of the external network clock source and synchronize the standard time to each service node after reestablishing the connection.
It should also be understood that, in this embodiment of the present application, when the master clock source node cannot be connected to the external network clock source, the master clock source node may notify the standby clock source node, so that the standby clock source node attempts to connect to the external network clock source, if the standby clock source node can be connected to the external network clock source, it is considered that the master clock source node fails, the standby clock source node synchronizes the standard time of the external network clock source, and synchronizes the standard time to each service node, and the master clock source node no longer synchronizes the master board time of the master clock source node to each service node.
In the embodiment of the present application, when the master clock source node fails, the master clock source node may synchronize the standard time to each service node and synchronize the standard time to the standby clock source node. The standby clock source node can synchronize the mainboard time of the standby clock source node according to the standard time.
In the embodiment of the application, when the master clock source node fails but has a normal communication function, the master clock source node may actively send a failure notification to the standby clock source node, so as to inform the standby clock source node that the master clock source node fails. When a fault (for example, sudden power failure of the master clock source node) occurs, which may cause loss of the communication function, the standby clock source node may confirm the fault of the master clock source node according to the standard time that the master clock source node is not synchronized.
It should be noted that although the slave clock source node does not receive the standard time from which the master clock source node synchronizes, the slave clock source node may consider that the master clock source node fails, therefore, a connection is established with the external network clock source, but, for system stability considerations (for example, a standby clock source node at a certain time point may not receive the standard time synchronized by the master clock source node due to transient network instability, and at this time, the master clock source node has substantially no fault, if the standby clock source node also establishes a connection with the external network clock source and synchronizes the standard time to each service node, the time synchronization logic of each service node is easily confused, and at the same time, the resource waste of the clock source system may also be caused), when the standby clock source node does not receive the standard time synchronized by the master clock source node, the fault confirmation of the master clock source node may be performed first.
In a feasible failure confirmation method according to the embodiment of the present application, when the standby clock source node does not receive the standard time synchronized by the master clock source node, the standby clock source node may send an inquiry packet to the master clock source node, and if a reply packet returned by the master clock source node is received and the standard time synchronized by the master clock source node is received again, the master clock source node is considered to have no failure, otherwise, the master clock source node is considered to have a failure.
In another feasible failure confirmation method of the embodiment of the present application, when the standby clock source node does not receive the standard time synchronized by the master clock source node, the standby clock source node may send an inquiry packet to each service node to inquire whether each service node receives the standard time synchronized by the master clock source node. If the feedback of each service node does not receive the standard time synchronized by the master clock source node, the master clock source node is considered to be in fault; otherwise, the master clock source node is considered to be failed.
In the embodiment of the application, if a failure of the master clock source node occurs and the standby clock source node cannot establish connection with the external network clock source, the standby clock source node can synchronize the time of the main board of the standby clock source node to each service node, so that the time of each service node is consistent with the time of equipment in the external network to a certain extent while the time of each service node is ensured to be consistent. It should be understood that the standby clock source node may continuously try to establish connection with the external network clock source while synchronizing the own motherboard time of the standby clock source node to each service node, so as to synchronize the standard time of the external network clock source to each service node after establishing connection with the external network clock source.
In a feasible implementation manner of the embodiment of the present application, after the master clock source node is recovered, the master clock source node may notify the standby clock source node, so as to recover to establish connection between the master clock source node and the external network clock source, and provide time synchronization service (i.e., synchronize the standard time of the external network clock source and synchronize the standard time to each service node), while the standby clock source node does not provide time synchronization service. In another possible implementation manner of the embodiment of the present application, the master clock source node performs an operation of the original slave clock source node after recovery, that is, in this possible implementation manner, after the master clock source node fails, the slave clock source node is switched to a new master clock source node, and after the original master clock source node recovers, the master clock source node is switched to the slave clock source node.
It should be noted that, in the embodiment of the present application, the number of clock source nodes may be multiple. When there are multiple standby clock source nodes, there is one and only one standby clock source node executing the operation when the main clock source node fails. For convenience of description, the standby clock source node that performs the operation when the master clock source node fails may be referred to as a standby clock source executing node. In the embodiment of the present application, priorities may be set for each standby clock source node in advance, and then the standby clock source nodes are confirmed and executed according to the priority order. Specifically, the standby clock source node with the highest priority can be taken as the executing standby clock source node when the main clock source node fails; and when the master clock source node and the standby clock source node with the highest priority fail, taking the standby clock source node with the second highest priority as the executing standby clock source node, and so on. It should be noted that, in the scheme of switching the master clock source node to the standby clock source node after the master clock source node is recovered, the priority of the master clock source node may be set to be higher than that of all the standby clock source nodes, so that after the master clock source node is recovered, the master clock source node becomes the latest standby clock source node with the highest priority.
It should be noted that, in the embodiment of the present application, in order to better implement isolation between each service node in an intranet and an external network and improve security of a service system including each service node, as shown in fig. 2, each of the master clock source node and the slave clock source node includes an extranet network card and an intranet network card.
Wherein:
the external network card is used for communicating with an external network clock source and only allows messages related to time synchronization to pass through. The intranet card is used for communicating with other nodes except the intranet node, and only allows the request messages of the other nodes and the time information of the intranet node to pass through. It should be noted that the intranet node refers to each node that realizes connection through an intranet, including a master clock source node, a slave clock source node, and a service node, and the time information refers to standard time or motherboard time for synchronization. Therefore, the isolation between the service node and the external network is effectively realized, and the safety of the service system is improved.
In the embodiment of the present application, in order to allow only the message related to time synchronization to pass through by the external network card, and allow only the request messages of the other nodes and the time information of the internal network card to pass through, security audit can be performed in the master clock source node and the standby clock source node, a firewall (firewall) can be set, and message screening can be performed through the firewall. For example, it can only allow the message that the rest nodes request their 123 port to pass through firewall.
It should be noted that, in the embodiment of the present application, in the master clock source node and the slave clock source node, the clock source ports of the intranet (i.e., the ports of the master clock source node and the slave clock source node that implement time synchronization of the standard time or the motherboard to each service node) access the service nodes through the internal network, and the services inside the service nodes can only be accessed through the internal network, so that once the time information of the master clock source node or the slave clock source node is requested through the external network card, the master clock source node or the slave clock source node does not provide the services, that is, the master clock source node and the slave clock source node will refuse the access request for the time information through the external network card, thereby further enhancing the isolation between the service nodes and the external network, and improving the security of the service system.
It should be understood that, in the practical application process, the communication between the master clock source node and the slave clock source node and the service node may be implemented by an information transfer device (such as a router, a switch, a load balancer, and the like).
Based on the clock source system, the time synchronization process is described below from the perspective of the master clock source node and the slave clock source node, respectively.
Referring to fig. 3, fig. 3 provides a time synchronization method applied in a master clock source node, including:
s301: and the master clock source node establishes connection with the external network clock source.
S302: and synchronizing the mainboard time of the external network clock source according to the standard time of the external network clock source, and synchronizing the standard time to each service node.
S303: and when the connection with the external network clock source is disconnected, synchronizing the time of the mainboard of the user to each service node.
It should be understood that when synchronizing standard time or motherboard time to each service node, the master clock source node may also synchronize standard time or motherboard time to the standby clock source. The standby clock source can synchronize the mainboard time of the standby clock source according to the standard time or the mainboard time of the main clock source node, so that the time of the standby clock source is consistent with each service node in the intranet.
It should also be understood that, when the master clock source node fails and the intranet communication function is not lost, the master clock source node may notify the standby clock source node of the failure, so that the standby clock source provides the time synchronization service. As shown in fig. 4, fig. 4 is a time synchronization method applied to a standby clock source node according to an embodiment of the present application, and includes:
s401: and when the main clock source node fails, the standby clock source node is connected with the external network clock source.
S402: and acquiring standard time from an external network clock source in real time.
S403: and synchronizing the real-time standard time to each service node in the intranet through the intranet.
It should be noted that, when the standby clock source node acquires the standard time in real time, the standby clock source node synchronizes the own motherboard time according to the standard time. In addition, when the master clock source node fails, time information is obtained from the master clock source node to synchronize the time of the master board. Therefore, when the main clock source node fails and the standby clock source node cannot establish connection with the external network clock source, the main board time of the standby clock source node can be synchronized to each service node.
It should be noted that, in the embodiment of the present application, in the master clock source node and the slave clock source node, ntpd (Network Time protocol progress) may be used to implement Time synchronization, and may also be used to implement Time synchronization by using chrony.
It should be further noted that the node described in this embodiment may be a server, a terminal, or other devices.
According to the clock source system and the time synchronization method provided by the embodiment of the application, under the normal condition, the connection is established between the main clock source node and the external network clock source, the main clock source node synchronizes the standard time to each service node through the internal network, and when the main clock source node fails, the connection is established between the main clock source node and the external network clock source through the standby clock source node, and the standard time is synchronized to each service node through the internal network. Therefore, in the scene that the service nodes are not allowed to be accessed to the external network, each service node can be synchronized with the standard time through the relay of the main clock source node and the standby clock source node, and the time consistency and reliability of each service node are realized. In addition, when the main clock source node fails, the clock source system can also realize the time synchronization of each service node through the standby clock source node, so that the whole clock source system has high availability and high reliability. In addition, by the clock source system provided by the embodiment of the application, the isolation between the service node and the external network can be realized, and the safety of the service system is improved.
Example two:
based on the same inventive concept, the embodiment of the application also provides two time synchronization devices. Referring to fig. 5 and 6, fig. 5 shows a time synchronizer 100 corresponding to the method shown in fig. 4, and fig. 6 shows a time synchronizer 200 corresponding to the method shown in fig. 3. It should be understood that the specific functions of the time synchronizer 100 and the time synchronizer 200 can be referred to the above description, and the detailed description is appropriately omitted here to avoid redundancy. The time synchronization apparatuses 100 and 200 include at least one software function module that can be stored in a memory in the form of software or firmware or solidified in an operating system of the time synchronization apparatuses 100 and 200. Specifically, the method comprises the following steps:
referring to fig. 5, the time synchronization apparatus 100 is applied to a clock source node, and includes: a first connection module 101, an acquisition module 102, and a first synchronization module 103. Wherein:
the first connection module 101 is configured to establish connection with an external network clock source when a master clock source node fails;
an obtaining module 102, configured to obtain standard time in real time from an external network clock source;
the first synchronization module 103 is configured to synchronize the real-time standard time to each service node in the intranet through the intranet.
In a feasible implementation manner of the embodiment of the present application, the obtaining module 102 is further configured to obtain time information from the master clock source node to synchronize the own master time when the master clock source node fails.
In a possible implementation manner of the embodiment of the present application, the first synchronization module 103 is further configured to synchronize the motherboard time of the first synchronization module according to the standard time after the obtaining module 102 obtains the standard time from the external network clock source in real time.
In a feasible implementation manner of the embodiment of the present application, the first synchronization module 103 is further configured to synchronize the time of the main board to each service node when the main clock source node fails and cannot establish a connection with an external network clock source.
Referring to fig. 6, the time synchronization apparatus 200 is applied to a master clock source node, and includes: a second connection module 201 and a second synchronization module 202. Wherein:
a second connection module 201, configured to establish a connection with an external network clock source;
the second synchronization module 202 is configured to synchronize a motherboard time of the second synchronization module according to a standard time of the external network clock source, and synchronize the standard time to each service node; and the system is used for synchronizing the time of the mainboard of the system to each service node when the system is disconnected with the external network clock source.
In a feasible implementation manner of the embodiment of the present application, the second synchronization module 202 is further configured to synchronize the standard time to the standby clock source when synchronizing the standard time to each service node, so that the standby clock source synchronizes the motherboard time of the standby clock source according to the standard time.
In a feasible implementation manner of the embodiment of the present application, the second synchronization module 202 is further configured to synchronize the motherboard time to the standby clock source when synchronizing the motherboard time of the second synchronization module to each service node, so that the standby clock source synchronizes the motherboard time of the standby clock source according to the motherboard time of the master clock source node.
It should be understood that, for the sake of brevity, the contents described in some embodiments are not repeated in this embodiment.
Example three:
the present embodiment provides a clock source node, as shown in fig. 7, which includes an external network card 701, an internal network card 702, a processor 703, a memory 704, and a communication bus 705. Wherein:
the extranet card 701 is used for communicating with the extranet clock source.
The intranet card 702 is used for communicating with other nodes except the clock source node itself in the intranet node.
It should be understood that the intranet nodes include a master clock source node, a slave clock source node, and a service node, and the clock source node is the master clock source node or the slave clock source node.
The communication bus 705 is used for realizing connection and communication among the external network card 701, the internal network card 702, the processor 703 and the memory 704.
The processor 703 is configured to execute one or more programs stored in the memory 704 to implement the time synchronization method in the first embodiment.
It is to be understood that the clock source node is an electronic device, the structure shown in fig. 7 is only an illustration, and the clock source node may also include more or less components than those shown in fig. 7, or have a different configuration than that shown in fig. 7, for example, may also have components such as a communication interface.
The present embodiment further provides a readable storage medium, such as a floppy disk, an optical disk, a hard disk, a flash Memory, a usb (secure digital Card), an MMC (Multimedia Card), etc., in which one or more programs for implementing the above steps are stored, and the one or more programs can be executed by one or more processors to implement the time synchronization method in the first embodiment. And will not be described in detail herein.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
In addition, units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
Furthermore, the functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
In this context, a plurality means two or more.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (16)

1. A clock source system is characterized in that the clock source system comprises a main clock source node and a standby clock source node;
the master clock source node is used for establishing connection with an external network clock source, synchronizing the standard time of the external network clock source and synchronizing the standard time to each service node through an internal network;
and the standby clock source node is used for establishing connection with an external network clock source when the main clock source node fails, synchronizing the standard time of the external network clock source and synchronizing the standard time to each service node through an internal network.
2. The clock source system of claim 1, wherein the master clock source node is specifically configured to synchronize its own motherboard time according to a standard time of the external network clock source;
and the master clock source node is also used for synchronizing the time of the mainboard of the master clock source node to each service node when the master clock source node is disconnected with the external network clock source.
3. The clock source system of claim 1, wherein the master clock source node is further configured to synchronize the standard time to the slave clock source node;
the standby clock source node is also used for acquiring the standard time from the main clock source node so as to synchronize the time of the main board;
and the standby clock source node is also used for synchronizing the mainboard time of the standby clock source node to each service node when the main clock source node fails and the standby clock source node cannot establish connection with an external network clock source.
4. The clock source system according to any of claims 1-3, wherein the master clock source node and the slave clock source node each include an extranet network card and an intranet network card;
the external network card is used for communicating with the external network clock source and only allows the message related to time synchronization to pass through;
the intranet network card is used for communicating with other nodes except the intranet node, and only allows request messages of the other nodes and time information of the intranet network card to pass through; the intranet nodes comprise the main clock source node, the standby clock source node and the service node; the time information includes the standard time and the mainboard time.
5. The clock source system of claim 4, wherein the master clock source node and the slave clock source node deny access requests for the time information through the external network card.
6. A time synchronization method is applied to a standby clock source node, and comprises the following steps:
when the main clock source node fails, connection is established with an external network clock source;
acquiring standard time from the external network clock source in real time;
and synchronizing the standard time to each service node in the intranet through the intranet.
7. The time synchronization method of claim 6, wherein the method further comprises:
and when the master clock source node fails, acquiring time information from the master clock source node to synchronize the time of the master board.
8. The time synchronization method of claim 6, wherein after obtaining the standard time from the external network clock source in real time, further comprising:
and synchronizing the mainboard time of the computer according to the standard time.
9. The time synchronization method of claim 7 or 8, wherein the method further comprises:
and synchronizing the time of the mainboard of the master clock source to each service node when the master clock source node fails and cannot establish connection with the external network clock source.
10. A time synchronization method applied to a master clock source node includes:
establishing connection with an external network clock source;
synchronizing the mainboard time of the external network clock source according to the standard time of the external network clock source, and synchronizing the standard time to each service node through the internal network;
and when the connection with the external network clock source is disconnected, synchronizing the time of the mainboard of the user to each service node.
11. The time synchronization method according to claim 10, wherein when synchronizing the standard time to each service node over an intranet, the method further comprises:
and synchronizing the standard time to a standby clock source so that the standby clock source synchronizes the mainboard time of the standby clock source according to the standard time.
12. The time synchronization method of claim 10, wherein in time synchronizing the own motherboard to each service node, the method further comprises:
and synchronizing the mainboard time to a standby clock source so that the standby clock source synchronizes the mainboard time of the standby clock source according to the mainboard time of the main clock source node.
13. A time synchronization device applied to a clock source node comprises: the device comprises a first connection module, an acquisition module and a first synchronization module;
the first connection module is used for establishing connection with an external network clock source when the main clock source node fails;
the acquisition module is used for acquiring standard time from the external network clock source in real time;
and the first synchronization module is used for synchronizing the standard time to each service node in the intranet through the intranet.
14. A time synchronization apparatus applied in a master clock source node, comprising: a second connection module and a second synchronization module;
the second connection module is used for establishing connection with an external network clock source;
the second synchronization module is used for synchronizing the mainboard time of the second synchronization module according to the standard time of the external network clock source and synchronizing the standard time to each service node through the internal network; and the system is used for synchronizing the time of the mainboard of the system to each service node when the system is disconnected with the external network clock source.
15. A clock source node, comprising: the system comprises an external network card, an internal network card, a processor, a memory and a communication bus;
the external network card is used for communicating with the external network clock source;
the intranet network card is used for communicating with other nodes except the clock source node in the intranet nodes, and the intranet nodes comprise a main clock source node, a standby clock source node and a service node; the clock source node is the master clock source node or the slave clock source node;
the communication bus is used for realizing the connection and communication among the external network card, the internal network card, the processor and the memory;
the processor is configured to execute one or more programs stored in the memory to implement the time synchronization method of any of claims 6-12.
16. A readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the time synchronization method of any one of claims 6-12.
CN202010126405.5A 2020-02-27 2020-02-27 Time synchronization method, device, system, node and readable storage medium Active CN111355569B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010126405.5A CN111355569B (en) 2020-02-27 2020-02-27 Time synchronization method, device, system, node and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010126405.5A CN111355569B (en) 2020-02-27 2020-02-27 Time synchronization method, device, system, node and readable storage medium

Publications (2)

Publication Number Publication Date
CN111355569A true CN111355569A (en) 2020-06-30
CN111355569B CN111355569B (en) 2024-01-09

Family

ID=71197145

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010126405.5A Active CN111355569B (en) 2020-02-27 2020-02-27 Time synchronization method, device, system, node and readable storage medium

Country Status (1)

Country Link
CN (1) CN111355569B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112105079A (en) * 2020-08-19 2020-12-18 吴穹 Signal synchronization method of wireless two-way relay communication system based on OFDM
CN112181049A (en) * 2020-08-27 2021-01-05 济南浪潮数据技术有限公司 Cluster time synchronization method, device, system, equipment and readable storage medium
CN114362866A (en) * 2021-11-25 2022-04-15 北京卓越信通电子股份有限公司 Hot standby system of time synchronization master clock of TSN network

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102263630A (en) * 2011-07-21 2011-11-30 中兴通讯股份有限公司 Clock source selection method
CN103107876A (en) * 2011-11-15 2013-05-15 中兴通讯股份有限公司 Implementation method, system and device for multi-clock synchronization technology hybrid networking
US20130272362A1 (en) * 2012-04-11 2013-10-17 Telefonaktiebolaget L M Ericsson (Publ) Clock switching algorithm based on preferred clock source
CN104363083A (en) * 2014-11-05 2015-02-18 许继电气股份有限公司 Intelligent substation IEEE1588 clock synchronous redundancy system and method
CN104579624A (en) * 2014-12-29 2015-04-29 云南电网公司电力科学研究院 Clock synchronization method of network sampling intelligent substation
WO2016106908A1 (en) * 2014-12-31 2016-07-07 北京东土科技股份有限公司 Method and system for synchronizing clocks in sdh network

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102263630A (en) * 2011-07-21 2011-11-30 中兴通讯股份有限公司 Clock source selection method
CN103107876A (en) * 2011-11-15 2013-05-15 中兴通讯股份有限公司 Implementation method, system and device for multi-clock synchronization technology hybrid networking
US20130272362A1 (en) * 2012-04-11 2013-10-17 Telefonaktiebolaget L M Ericsson (Publ) Clock switching algorithm based on preferred clock source
CN104363083A (en) * 2014-11-05 2015-02-18 许继电气股份有限公司 Intelligent substation IEEE1588 clock synchronous redundancy system and method
CN104579624A (en) * 2014-12-29 2015-04-29 云南电网公司电力科学研究院 Clock synchronization method of network sampling intelligent substation
WO2016106908A1 (en) * 2014-12-31 2016-07-07 北京东土科技股份有限公司 Method and system for synchronizing clocks in sdh network

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112105079A (en) * 2020-08-19 2020-12-18 吴穹 Signal synchronization method of wireless two-way relay communication system based on OFDM
CN112181049A (en) * 2020-08-27 2021-01-05 济南浪潮数据技术有限公司 Cluster time synchronization method, device, system, equipment and readable storage medium
CN112181049B (en) * 2020-08-27 2023-02-24 济南浪潮数据技术有限公司 Cluster time synchronization method, device, system, equipment and readable storage medium
CN114362866A (en) * 2021-11-25 2022-04-15 北京卓越信通电子股份有限公司 Hot standby system of time synchronization master clock of TSN network

Also Published As

Publication number Publication date
CN111355569B (en) 2024-01-09

Similar Documents

Publication Publication Date Title
CN111355569B (en) Time synchronization method, device, system, node and readable storage medium
CN106331098B (en) Server cluster system
JP4413965B2 (en) Load balancing communication device and load balancing management device
CN110324375B (en) Information backup method and related equipment
CN110932876B (en) Communication system, method and device
CN116048538A (en) Service grid deployment method and device for DPU
CN113467873A (en) Virtual machine scheduling method and device, electronic equipment and storage medium
CN101145972B (en) A disaster tolerance network management system and login method of network management clients
CN116886497A (en) Service grid business centralized proxy switching method and processing system based on DPU
CN111262892A (en) Multi-ROS service discovery system
JP2009194787A (en) Gateway apparatus
CN116192863B (en) Micro-service flow processing method, DPU service grid deployment method and system
KR100947240B1 (en) Load distributed type duplex system
JP7480434B2 (en) Distributed management system and method for smart card management device
CN111064622B (en) Network device, synchronization apparatus, and information transmission method
CN111106966B (en) Information processing method and device, equipment and storage medium
CN113821334A (en) Method, device and system for configuring edge side equipment
CN108616597B (en) Distributed operation method for realizing service uninterrupted forever
CN115134220B (en) Master-slave server switching method and device, computing equipment and storage medium
CN113852514A (en) Data processing system with uninterrupted service, processing equipment switching method and connecting equipment
CN115643237B (en) Data processing system for conference
CN114996200B (en) RDMA-based data transmission method, device, equipment and storage medium
CN113286321B (en) Backup management method, device, equipment and machine readable storage medium
CN113890817A (en) Communication optimization method and device
CN117979327A (en) Disaster recovery system, method and equipment based on edge UPF backup group

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 214100 No. 6, science and education software park, Binhu District, Wuxi City, Jiangsu Province

Applicant after: Huayun data holding group Co.,Ltd.

Address before: No. 6 Science and Education Software Park, Binhu District, Wuxi City, Jiangsu Province

Applicant before: WUXI CHINAC DATA TECHNICAL SERVICE Co.,Ltd.

GR01 Patent grant
GR01 Patent grant