Gated cycle control method, system, and device based on clock fault tolerance
By generating clock transition signals and clock stabilization signals for fault tolerance and adjusting the gating cycle start time, the instability of the gating cycle caused by clock failure in the IEEE 802.1Qbv standard is resolved, thereby improving the stability and reliability of the scheduling mechanism.
Patent Information
- Application Number
- CN202211654611.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-22
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2042-12-22
AI Technical Summary
The IEEE 802.1Qbv standard suffers from instability and reliability issues in the gating cycle due to clock failures, especially when network devices wait to restart execution during clock transitions, causing the scheduling mechanism to fail.
By generating clock transition signals and clock stabilization signals, fault tolerance is achieved based on the clock state, and the start time of the gating cycle is adjusted to ensure that the start time of the cycle can be adjusted in a timely and accurate manner in the event of a clock failure, thereby improving the stability and reliability of the gating cycle.
It achieves stable operation of the gating cycle in the event of a clock failure, ensuring the stability and reliability of the 802.1Qbv scheduling mechanism and avoiding scheduling errors caused by clock jumps.
Smart Images

Figure CN115981904B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a gated cycle control method, system, and apparatus based on clock fault tolerance. Background Technology
[0002] The current IEEE 802.1Qbv standard provides an enhancement mechanism for scheduled traffic. Bridges or terminal devices can support this mechanism to allow Ethernet data from different queues to be transmitted according to a specific time schedule. To achieve this, each queue is controlled by a transmission gate. The opening or closing of the transmission gate controls the transmission of data in that queue. Each port should maintain an ordered list containing transmission gate actions, called a gating list. A periodic timer state machine controls the execution of the gating list and ensures that each port operates according to a given gating cycle. When a clock transition occurs, the device may transition to a historical time, causing the current time of the entire network device to regress. The network device needs to wait for the gating cycle to restart. If the current time differs significantly from the configured reference time, the device will remain in a waiting state, the gating mechanism will fail, and the stability and reliability of the gating cycle will be poor. Summary of the Invention
[0003] One objective of this invention is to provide a gated cycle control method based on clock fault tolerance, which possesses fault tolerance capability and can adjust the cycle start time in a timely and accurate manner based on a stable clock signal to generate a cycle start signal when a clock fault occurs, thereby improving the stability and reliability of gated cycle control and ensuring the stable operation of the 802.1Qbv scheduling mechanism. Another objective of this invention is to provide a gated cycle control device based on clock fault tolerance. A further objective of this invention is to provide a gated cycle control system based on clock fault tolerance. A further objective of this invention is to provide a computer-readable medium. A still further objective of this invention is to provide a computer device.
[0004] To achieve the above objectives, this invention discloses a gated cycle control method based on clock fault tolerance, comprising:
[0005] Based on the received clock events, a clock transition signal and a clock stabilization signal are generated. The clock events include the current master clock release time.
[0006] If the current master clock release time is less than the set configuration base time, the clock status is determined based on the clock transition signal;
[0007] Based on the clock state and the clock stability signal, clock fault tolerance is performed, and a gated cycle start signal is generated.
[0008] Preferably, the clock events include master clock transition events;
[0009] Based on the received clock events, a clock transition signal and a clock stabilization signal are generated, including:
[0010] In response to receiving a master clock transition event, a clock transition signal is generated and the value of the clock transition signal is set to true;
[0011] The clock stability signal is periodically generated by comparing the time difference between the last received master clock release time and the current master clock release time with the set check period.
[0012] Preferably, a clock stabilization signal is periodically generated by comparing the time difference between the last received master clock release time and the current master clock release time with a set check period, including:
[0013] If the difference between the time difference between the last received master clock release time and the current master clock release time and the check period is less than the set period threshold, a clock stabilization signal is generated and the value of the clock stabilization signal is set to true.
[0014] If the time difference between the last received master clock release time and the current master clock release time is greater than or equal to the difference between the check period and the set period threshold, a clock stabilization signal is generated, and the value of the clock stabilization signal is set to false.
[0015] Preferably, before setting the value of the clock stabilization signal to true, the method further includes:
[0016] Increment the set clock synchronization stability counter by one;
[0017] Determine whether the count value of the clock synchronization stabilization counter after incrementing by one is greater than the set count threshold;
[0018] If so, continue with the step of setting the value of the clock stabilization signal to true;
[0019] If not, continue with the step of periodically generating a clock stability signal by comparing the time difference between the last received master clock release time and the current master clock release time with the set check period.
[0020] Preferably, after setting the value of the clock stabilization signal to false, the method further includes:
[0021] The count value of the clock synchronization stabilizer counter is cleared to zero.
[0022] Preferably, the method further includes:
[0023] If the current master clock release time is greater than or equal to the set configuration base time, generate the gating cycle start time based on the configuration base time and the set configuration period;
[0024] If the current master clock publication time reaches the gating cycle start time, a gating cycle start signal is generated.
[0025] Preferably, the clock state is determined based on the clock transition signal, including:
[0026] If the value of the clock transition signal is true, it is determined that a clock transition has occurred.
[0027] If the value of the clock transition signal is false, it is determined that the clock state has not transitioned.
[0028] Preferably, the clock state is one in which no transition has occurred;
[0029] Clock fault tolerance is performed based on the stable clock signal, and a gated cycle start signal is generated, including:
[0030] Set the configuration base time as the start time of the gating cycle;
[0031] If the current master clock publication time reaches the gating cycle start time, a gating cycle start signal is generated.
[0032] Preferably, the clock state is in the state of transition;
[0033] Clock fault tolerance is performed based on the stable clock signal, and a gated cycle start signal is generated, including:
[0034] If the value of the clock stability signal is true, the start time of the gated cycle after fault tolerance is generated based on the configured base time and the set configuration period.
[0035] If the current master clock release time reaches the start time of the gated cycle after fault tolerance, a gated cycle start signal is generated.
[0036] If the value of the clock stability signal is false, determine whether there was a previous startup cycle time and whether the gating cycle execution timed out;
[0037] If so, generate a gated cycle start signal;
[0038] If not, repeat the steps of generating clock transition signals and clock stabilization signals based on the received clock events.
[0039] Preferably, based on the configuration baseline time and the set configuration period, the start time of the gated period after fault tolerance is generated, including:
[0040] Subtract the configuration period from the configuration base time to obtain the initial gating period start time;
[0041] Subtract the current master clock release time from the initial gating cycle start time to obtain the configuration difference;
[0042] Determine if the configuration difference is less than the configuration cycle;
[0043] If so, the initial gating cycle start time will be determined as the gating cycle start time after fault tolerance.
[0044] If not, the initial gating cycle start time is set as the configuration base time, and the process of subtracting the current master clock release time from the initial gating cycle start time to obtain the configuration difference continues until the configuration difference is less than the configuration cycle.
[0045] Preferably, after generating the start time of the gated period after fault tolerance based on the configuration baseline time and the set configuration period, the method further includes:
[0046] Set the value of the clock transition signal to false;
[0047] Update the configuration base time to the start time of the gated cycle after fault tolerance.
[0048] This invention also discloses a gated cycle control system based on clock fault tolerance, comprising:
[0049] Clock synchronization status feedback module and periodic timer;
[0050] The clock synchronization status feedback module is used to receive clock events and generate clock transition signals and clock stabilization signals based on the received clock events; the clock transition signals and clock stabilization signals are sent to the periodic timer, and the clock events include the current master clock release time;
[0051] The periodic timer is used to determine the clock state based on the clock transition signal if the current master clock release time is less than the set configuration base time; based on the clock state, clock fault tolerance is performed according to the clock stability signal, and a gated cycle start signal is generated.
[0052] Preferably, the clock state is in the state of transition;
[0053] The periodic timer is specifically used to generate the start time of the gated cycle after fault tolerance based on the configured base time and the set configuration period if the value of the clock stability signal is true; if the current master clock release time reaches the start time of the gated cycle after fault tolerance, a gated cycle start signal is generated; if the value of the clock stability signal is false, it is determined whether there was a previous start cycle time and the gated cycle execution timed out; if yes, a gated cycle start signal is generated; if no, the clock synchronization feedback module re-executes the steps of generating clock transition signals and clock stability signals based on the received clock events.
[0054] Preferably, the periodic timer is also used to set the value of the clock transition signal to false and return the clock transition signal; update the configuration reference time to the start time of the gated cycle after fault tolerance;
[0055] The clock synchronization feedback module is used to receive the clock transition signal returned by the periodic timer, and the value of the clock transition signal is set to false.
[0056] This invention also discloses a gated cycle control device based on clock fault tolerance, comprising:
[0057] The clock signal generation unit is used to generate clock transition signals and clock stabilization signals based on the received clock events. The clock events include the current master clock release time.
[0058] The clock state determination unit is used to determine the clock state based on the clock transition signal if the current master clock release time is less than the set configuration reference time.
[0059] The clock fault tolerance unit is used to perform clock fault tolerance based on the clock state and the clock stability signal, and to generate a gated cycle start signal.
[0060] Preferably, the clock events include master clock transition events;
[0061] The clock signal generation unit is specifically used to generate a clock transition signal in response to the received master clock transition event and set the value of the clock transition signal to true; it also periodically generates a stable clock signal by comparing the time difference between the last received master clock release time and the current master clock release time with the set check period.
[0062] Preferably, the clock signal generation unit is specifically used to generate a clock stable signal and set the value of the clock stable signal to true if the difference between the time difference between the last received master clock release time and the current master clock release time and the check period is less than a set period threshold; and to generate a clock stable signal and set the value of the clock stable signal to false if the difference between the time difference between the last received master clock release time and the current master clock release time and the check period is greater than or equal to the set period threshold.
[0063] Preferably, the device further includes:
[0064] The accumulator unit is used to increment the set clock synchronization stabilization counter by one.
[0065] The counting value judgment unit is used to determine whether the count value of the clock synchronization stabilization counter after incrementing by one is greater than the set counting threshold. If yes, it triggers the clock signal generation unit to continue executing the step of setting the value of the clock stabilization signal to true. If no, it triggers the clock signal generation unit to continue executing the step of periodically generating the clock stabilization signal by comparing the time difference between the last received master clock release time and the current master clock release time with the set check period.
[0066] Preferably, the device further includes:
[0067] The clear unit is used to clear the count value of the clock synchronization stabilizer counter.
[0068] Preferably, the device further includes:
[0069] The start time generation unit is used to generate the gated cycle start time based on the configuration base time and the set configuration period if the current master clock release time is greater than or equal to the set configuration base time.
[0070] The start signal generation unit is used to generate a gated cycle start signal if the current master clock publication time reaches the gated cycle start time.
[0071] Preferred,
[0072] The clock state determination unit is specifically used to determine that the clock state has changed if the value of the clock transition signal is true, and to determine that the clock state has not changed if the value of the clock transition signal is false.
[0073] Preferably, the clock state is one in which no transition has occurred;
[0074] The clock fault tolerance unit is specifically used to determine the configuration reference time as the gated cycle start time; if the current master clock publication time reaches the gated cycle start time, a gated cycle start signal is generated.
[0075] Preferably, the clock state is in the state of transition;
[0076] The clock fault tolerance unit is specifically used to generate the start time of the gated cycle after fault tolerance based on the configured base time and the set configuration period if the value of the clock stability signal is true; generate the gated cycle start signal if the current master clock release time reaches the start time of the gated cycle after fault tolerance; and determine whether there is a previous start cycle time and the gated cycle execution timeout if the value of the clock stability signal is false. If yes, generate the gated cycle start signal; otherwise, trigger the clock signal generation unit to re-execute the steps of generating the clock transition signal and the clock stability signal based on the received clock event.
[0077] Preferably, the clock fault tolerance unit is specifically used to subtract the configuration period from the configuration reference time to obtain the initial gating period start time; subtract the current master clock release time from the initial gating period start time to obtain the configuration difference; determine whether the configuration difference is less than the configuration period; if yes, determine the initial gating period start time as the gating period start time after fault tolerance; if no, determine the initial gating period start time as the configuration reference time, and continue to execute the step of subtracting the current master clock release time from the initial gating period start time to obtain the configuration difference, until the configuration difference is less than the configuration period.
[0078] Preferably, the device further includes:
[0079] The setting unit is used to set the value of the clock transition signal to false.
[0080] The update unit is used to update the configuration base time to the start time of the gated cycle after fault tolerance.
[0081] The present invention also discloses a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method described above.
[0082] The present invention also discloses a computer device, including a memory and a processor, wherein the memory is used to store information including program instructions, and the processor is used to control the execution of the program instructions, wherein the processor executes the program to implement the method described above.
[0083] The present invention also discloses a computer program product, including a computer program / instruction, which, when executed by a processor, implements the method described above.
[0084] This invention generates a clock transition signal and a clock stabilization signal based on received clock events. The clock events include the current master clock release time. If the current master clock release time is less than the set configuration reference time, the clock state is determined based on the clock transition signal. Based on the clock state and the clock stabilization signal, clock fault tolerance is performed, and a gated cycle start signal is generated. This invention has fault tolerance capability and can adjust the cycle start time in a timely and accurate manner based on the clock stabilization signal to generate a cycle start signal when a clock fault occurs. This improves the stability and reliability of gated cycle control, thereby ensuring the stable operation of the 802.1Qbv scheduling mechanism. Attached Figure Description
[0085] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0086] Figure 1 A schematic diagram of a gated cycle control system based on clock fault tolerance provided in an embodiment of the present invention;
[0087] Figure 2 A flowchart of a gated cycle control method based on clock fault tolerance provided in an embodiment of the present invention;
[0088] Figure 3 A flowchart of another gated cycle control method based on clock fault tolerance provided in an embodiment of the present invention;
[0089] Figure 4 A schematic diagram of a gated cycle control device based on clock fault tolerance provided in an embodiment of the present invention;
[0090] Figure 5 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Detailed Implementation
[0091] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0092] To facilitate understanding of the technical solution provided in this application, the relevant content of the technical solution is explained below. Transmission gates are used to control the transmission of Ethernet data in queues. Each transmission gate action changes the state of the corresponding transmission gates for all queues under that port. In typical implementations that do not support the 802.1Qbv mechanism, each transmission gate remains permanently open. The execution of gating actions in the gating list is controlled by three state machines: a periodic timer state machine, a list execution state machine, and a list configuration state machine. The periodic timer state machine initiates the execution of the gating list and ensures that each port is scheduled to run according to a given gating cycle. Its periodic timer state machine contains three parts: periodic idle, set period start time, and start period. The set period start time determines the start time of each gating list execution cycle. The state machine will jump to this state after the network device starts or after each cycle execution ends to confirm the start time of the next cycle. The setting of this time needs to refer to the following variables: current time, i.e., the current master clock release time, configuration base time, configuration cycle, configuration cycle extension time, configuration change time, and new configuration pending. After the gating cycle becomes idle or the previous gating cycle has completed, the start time of the next cycle should be set. The gating cycle should be started when the conditions are met, in accordance with the following standards:
[0093] Standard 1: When there are no new configurations pending, if the current master clock publication time is less than the configuration reference time, the cycle start time is set to the configuration reference time. In this case, the current master clock publication time has not yet reached the configuration reference time, and the network device needs to wait. At this time, since the gating cycle has not started, no gating scheduling is performed, and the transmission gates of each queue remain open.
[0094] Standard 2: When there is no new configuration pending, if the current master clock release time is greater than the configuration reference time, the cycle start time is set to the configuration reference time + N × configuration cycle, and the minimum value of N is taken so that the cycle start time is greater than the current master clock release time.
[0095] Standard 3: If the current master clock release time is greater than the cycle start time, the cycle start signal is set to true, and the cycle starts from the set cycle start time state.
[0096] Under normal circumstances, the current master clock broadcast time is normal and monotonically increasing, and should remain in the state described in Standard 2 after one occurrence of the scenario described in Standard 1. However, in Time-Sensitive Networks (TSNs), the current master clock broadcast time of network devices is PTP time, which is obtained by synchronizing with the local master clock as specified by IEEE 802.1AS. If the master clock fails or switches, the current master clock may not maintain monotonically increasing but instead jumps to a historical time (time step), causing the current master clock broadcast time of the entire network device to regress. This will cause the network device to incorrectly return from the state described in Standard 2 to the state described in Standard 1, and the network device will begin waiting for the gating cycle to restart. In particular, if the current master clock broadcast time differs significantly from the configured reference time after the clock jump, the network device will remain in a waiting state, and the gating mechanism will fail.
[0097] To solve the above-mentioned technical problems, the present invention adds a clock transition signal and a clock stabilization signal, and improves the standard specification 1, so as to effectively tolerate the transition caused by clock failure, so that the gated cycle can maintain continuous operation.
[0098] Figure 1 A schematic diagram of a gated cycle control system based on clock fault tolerance provided in an embodiment of the present invention is shown below. Figure 1 As shown, the system includes a clock synchronization status feedback module 100 and a periodic timer 200. The clock synchronization status feedback module 100 is always communicatively connected to the periodic timer 200.
[0099] The clock synchronization status feedback module 100 can be implemented using driver layer software or hardware. An external clock sends clock events to the clock synchronization status feedback module 100. Clock events include the current master clock release time and fault events. Fault events are clock transition events or other fault interrupt events. Clock transition events can be collected through clock synchronization related program interfaces (APIs), such as the PTP clock time modification API (ptp_adjust_time) in the Linux system. Other fault interrupt events are events from other fault sources, such as related module error interrupt signals caused by Qbv mechanism failures. Specifically, the period start signal generated by the Qbv mechanism can be used by Direct Memory Access (DMA) device modules that periodically schedule data. Clock transitions can cause Qbv mechanism failures, that is, the generation period of the period start signal becomes disordered, which in turn can cause scheduling errors in this type of DMA device, manifested as errors such as a full data queue, generating corresponding error interrupt signals. These interrupt signals can be used to trigger clock transition events. For example, network data transmission and reception failures can be used to diagnose problems. Specifically, after synchronization, the clock can directly control the transmission and reception of certain high real-time periodic network data. Communication applications use time-related APIs in the system to determine the timing of message transmission and reception. When the network data transmission and reception cycle becomes disordered, it can be determined that a clock transition has occurred. The current master clock release time should be based on the hardware-maintained PTP timestamp to ensure its accuracy, rather than using the software-maintained system timestamp.
[0100] The cycle timer 200 can be implemented using driver layer software or hardware. The current master clock release time and configuration reference time received by the cycle timer 200 should both be in PTP time format. Parameters such as the configuration reference time and configuration cycle are provided by a list configuration state machine (not listed in the standard state machine diagram), and these parameters can be sent by the application layer software through the operating system's ioctl (input / output control) API. The generated cycle start signal is a periodic signal, meaning it should be generated at the start of each gating cycle. The cycle generated by this signal can be used as the basis for the timer module to determine timeout; the cycle should conform to the configuration cycle and configuration cycle extension parameters. If the cycle signal fails, a fault interrupt signal can be provided to the clock synchronization status feedback module 100 by other modules.
[0101] The clock synchronization status feedback module 100 is used to receive clock events sent by an external clock, and generate clock transition signals and clock stabilization signals according to the received clock events; and send the clock transition signals and clock stabilization signals to the period timer 200.
[0102] Specifically, the clock stabilization signal can be controlled by calculating the time difference, and the clock synchronization stabilization signal is controlled only by the clock synchronization status feedback module 100. Besides using the method of recording the local time difference, a comprehensive judgment can also be made by combining indicators such as the master clock time error in clock synchronization. First, the link delay with adjacent devices is calculated by periodically parsing the Pdelay-related messages in the PTP synchronization messages. If the link delay is within a threshold range and remains stable for a certain period, the timestamps of the Sync type messages in the PTP synchronization messages (i.e., the timestamps published by the current master clock) are further compared with the local time by periodically parsing them. If the error remains within the threshold range and remains stable for a certain period, the clock can be considered stable. The method for determining whether the value remains stable for a certain period can refer to a similar method of recording the local time difference.
[0103] The cycle timer 200 is used to determine the clock state based on the clock transition signal if the current master clock release time is less than the set configuration base time; based on the clock state, clock fault tolerance is performed according to the clock stability signal, and a gated cycle start signal is generated.
[0104] In this embodiment of the invention, if the clock state is in transition, the period timer 200 is specifically used to generate the start time of the gated cycle after fault tolerance based on the configured reference time and the set configuration period if the value of the clock stability signal is true; generate the gated cycle start signal if the current master clock release time reaches the start time of the gated cycle after fault tolerance; determine whether there is a previous start cycle time and the gated cycle execution timeout if the value of the clock stability signal is false; if yes, generate the gated cycle start signal; if no, the clock synchronization feedback module 100 re-executes the steps of generating the clock transition signal and the clock stability signal based on the received clock event.
[0105] It is worth noting that once the value of the clock transition signal is true, the true value will be maintained until the period timer 200 returns the clock transition signal, which is set to false, to the clock synchronization feedback module 100.
[0106] In this embodiment of the invention, the period timer 200 is also used to set the value of the clock transition signal to false and return the clock transition signal; update the configuration reference time to the start time of the gated cycle after fault tolerance; and the clock synchronization feedback module 100 is used to receive the clock transition signal returned by the period timer 200, and the value of the clock transition signal is set to false.
[0107] It is worth noting that, Figure 1 The clock fault-tolerant gated cycle control system shown is also used to execute Figure 2 or Figure 3 The clock fault-tolerant gated cycle control method shown will not be elaborated further here.
[0108] The following uses a clock fault-tolerant gated cycle control device as an example to illustrate the implementation process of the clock fault-tolerant gated cycle control method provided in this embodiment of the invention. It is understood that the execution entity of the clock fault-tolerant gated cycle control method provided in this embodiment of the invention includes, but is not limited to, a clock fault-tolerant gated cycle control device.
[0109] Figure 2 A flowchart of a gated cycle control method based on clock fault tolerance provided in an embodiment of the present invention is shown below. Figure 2 As shown, the method includes:
[0110] Step 101: Based on the received clock events, generate clock transition signals and clock stabilization signals. The clock events include the current master clock release time.
[0111] Step 102: If the current master clock release time is less than the set configuration base time, determine the clock status based on the clock transition signal.
[0112] Step 103: Based on the clock status and the clock stability signal, perform clock fault tolerance and generate a gated cycle start signal.
[0113] It is worth noting that the acquisition, storage, use, and processing of data in the technical solution of this application all comply with the relevant provisions of national laws and regulations. The user information in the embodiments of this application was obtained through legal and compliant means, and the acquisition, storage, use, and processing of user information have been authorized and agreed upon by the client.
[0114] In the technical solution provided by this invention, a clock transition signal and a clock stabilization signal are generated based on the received clock event. The clock event includes the current master clock release time. If the current master clock release time is less than the set configuration reference time, the clock state is determined based on the clock transition signal. Based on the clock state and the clock stabilization signal, clock fault tolerance is performed, and a gated cycle start signal is generated. This provides fault tolerance capability, enabling timely and accurate adjustment of the cycle start time and generation of the cycle start signal in the event of a clock fault. This improves the stability and reliability of the gated cycle control, thereby ensuring the stable operation of the 802.1Qbv scheduling mechanism.
[0115] Figure 3 A flowchart of another gated cycle control method based on clock fault tolerance provided in an embodiment of the present invention is shown below. Figure 3 As shown, the method includes:
[0116] Step 201: In response to receiving the master clock transition event, generate a clock transition signal and set the value of the clock transition signal to true.
[0117] In this embodiment of the invention, each step is executed by a gated cycle control device based on clock fault tolerance.
[0118] In this embodiment of the invention, clock events include the current master clock release time and fault events. Fault events are clock transition events or other fault interruption events. Clock transition events can be collected through clock synchronization-related program interfaces (APIs), such as the PTP clock time modification API (ptp_adjust_time) in the Linux system. Other fault interruption events are events from other fault sources, such as related module error interrupt signals caused by Qbv mechanism failures.
[0119] In this embodiment of the invention, the network device, acting as a slave clock, receives synchronization messages from the master clock. Under synchronization convergence conditions, it typically maintains synchronization by changing its local clock frequency. Only when the master clock fails or switches, and the difference between its master clock publication time and local time becomes too large, is the clock transition signal set to true. Once the clock transition signal is set to true, it remains true until processed by the periodic timer.
[0120] It is worth noting that if no clock transition event is received, it indicates that no clock transition has occurred, a clock transition signal is generated, and the value of the clock transition signal is set to false.
[0121] Step 202: Compare the time difference between the last received master clock release time and the current master clock release time with the set check period, and periodically generate a clock stability signal.
[0122] In this embodiment of the invention, the current master clock release time is the current time, and the clock synchronization status feedback module modifies the local time according to the master clock release time to synchronize with the master clock.
[0123] In this embodiment of the invention, step 202 specifically includes:
[0124] Step 2021: Determine whether the difference between the time difference between the last received master clock release time and the current master clock release time and the check period is less than the set period threshold. If yes, proceed to step 2022; otherwise, proceed to step 2025.
[0125] In this embodiment of the invention, if the difference between the time difference between the last received master clock release time and the current master clock release time and the check period is less than the set period threshold, it indicates that the time difference between the last received master clock release time and the current master clock release time is small, and the clock is in a stable state, so step 2022 is executed; if the difference between the time difference between the last received master clock release time and the current master clock release time and the check period is greater than or equal to the set period threshold, it indicates that the time difference between the last received master clock release time and the current master clock release time is too large, and the clock is in an unstable state, so step 2025 is executed.
[0126] It is worth noting that the inspection cycle is controlled by the network device itself and is not affected by the external master clock. It can be set according to actual needs, and this embodiment of the invention does not limit it.
[0127] It is worth noting that the period threshold can be set according to actual needs, and this embodiment of the invention does not limit it.
[0128] Step 2022: Increment the set clock synchronization stability counter.
[0129] In this embodiment of the invention, the clock synchronization stabilization counter is used to count the number of cycles in which the clock is continuously in a stable state.
[0130] It is worth noting that the initial value of the clock synchronization stabilization counter can be set according to actual needs, and this embodiment of the invention does not limit this. As an optional solution, the initial value of the clock synchronization stabilization counter is 0.
[0131] Step 2023: Determine whether the count value of the clock synchronization stabilization counter after incrementing by one is greater than the set count threshold; if yes, proceed to step 2024; if no, proceed to step 2021.
[0132] In this embodiment of the invention, if the count value of the clock synchronization stabilization counter after incrementing is greater than the count threshold, it indicates that the clock is in a stable state, and step 2024 is executed; if the count value of the clock synchronization stabilization counter after incrementing is less than or equal to the count threshold, it indicates that the clock has failed to maintain a stable state, and monitoring needs to continue, and step 2021 is executed.
[0133] Step 2024: Generate a clock stabilization signal and set the value of the clock stabilization signal to true.
[0134] In this embodiment of the invention, if the clock remains stable, the value of the clock stability signal will be set to true.
[0135] Step 2025: Generate a stable clock signal and set the value of the stable clock signal to false.
[0136] In this embodiment of the invention, if the clock is in an unstable state, the value of the clock stability signal will be set to false.
[0137] Furthermore, if the clock is in an unstable state, the count value of the clock synchronization stabilization counter is cleared to zero, and the number of consecutive stable clock cycles is counted again.
[0138] It is worth noting that the clock stability signal is controlled solely by the clock synchronization status feedback module. Besides using time difference as a criterion, it can also be determined comprehensively by combining indicators such as the master clock time error in clock synchronization.
[0139] Step 203: Determine whether the current master clock release time is less than the set configuration base time. If yes, proceed to step 204; otherwise, proceed to step 205.
[0140] In this embodiment of the invention, if the current master clock release time is less than the configured reference time, it indicates that the reference time has not been reached, and step 204 is executed; if the current master clock release time is greater than or equal to the configured reference time, it indicates that the reference time has been exceeded, and the gating cycle start time needs to be adjusted, and step 205 is executed.
[0141] It is worth noting that the configuration reference time is provided by the list configuration state machine, and this embodiment of the invention does not limit this. The configuration reference time may be related to the network-wide data scheduling. Scheduling is performed on the configuration reference time to ensure that the Qbv data scheduling mechanisms of various network devices do not conflict.
[0142] Step 204: Determine the clock state based on the clock transition signal, and continue to step 207.
[0143] Specifically, if the value of the clock transition signal is true, it indicates that the clock has transitioned, and the clock state is determined to have transitioned; if the value of the clock transition signal is false, it indicates that the clock has not transitioned, and the clock state is determined to have not transitioned, and step 207 is continued.
[0144] Step 205: Generate the gating cycle start time based on the configuration base time and the set configuration cycle.
[0145] In this embodiment of the invention, if the current master clock release time exceeds the reference time, the gating cycle start time needs to be adjusted. Both the configuration reference time and configuration cycle are provided by the list configuration state machine, and this embodiment of the invention does not limit this.
[0146] Specifically, the gating cycle start time is set to an integer multiple of the configuration period based on the configuration base time, i.e.: configuration base time + N × configuration period, taking the minimum value of N, so that the gating cycle start time is greater than the current master clock release time.
[0147] Step 206: If the current master clock publication time reaches the gating cycle start time, generate the gating cycle start signal, and the process ends.
[0148] In this embodiment of the invention, if the current master clock release time reaches the gating cycle start time, a gating cycle start signal is generated, and the network device enters the start cycle state from the set cycle start time state.
[0149] Step 207: Based on the clock status and the clock stability signal, perform clock fault tolerance and generate a gated cycle start signal.
[0150] In this embodiment of the invention, the clock state includes no transition and a transition. If the clock does not transition, the difference between the current master clock release time and the configuration reference time can be considered reasonable, and the gated cycle start time can be executed according to the configuration reference time. If the clock transitions, it indicates that the difference between the current master clock release time and the configuration reference time is unreasonable, and the clock is not yet stable. It is impossible to determine whether the current master clock release time will continue to transition. At this time, only the possibility of the cycle start signal failing due to long-term timeout is considered, and the cycle start time is not set. When the clock stabilizes, since the clock has transitioned to a historical time, the current master clock release time and the configuration reference time may differ significantly, and the cycle start time needs to be reset.
[0151] When the clock state has not changed, step 207 specifically includes:
[0152] Step 2071: Set the configuration reference time as the start time of the gating cycle.
[0153] In this embodiment of the invention, since the clock has not changed, the difference between the current master clock release time and the configuration reference time is reasonable. The gating cycle can be executed according to the configuration reference time, and the configuration reference time is determined as the start time of the gating cycle.
[0154] Step 2072: If the current master clock publication time reaches the gating cycle start time, generate a gating cycle start signal.
[0155] In this embodiment of the invention, if the current master clock release time reaches the gating cycle start time, a gating cycle start signal is generated, and the network device enters the start cycle state from the set cycle start time state.
[0156] When the clock state transitions, step 207 specifically includes:
[0157] Step 3071: Determine if the value of the clock stability signal is true. If yes, proceed to step 3072; otherwise, proceed to step 3074.
[0158] In this embodiment of the invention, if the value of the clock stabilization signal is true, it indicates that the clock is in a stable state, and step 3072 is executed; if the value of the clock stabilization signal is false, it indicates that the clock is not yet stable, and step 3074 is executed.
[0159] Step 3072: Generate the start time of the gate control cycle after fault tolerance based on the configuration base time and the set configuration cycle.
[0160] Specifically, the initial gating cycle start time is obtained by subtracting the configuration period from the configuration base time; the configuration difference is obtained by subtracting the current master clock release time from the initial gating cycle start time; it is determined whether the configuration difference is less than the configuration period; if so, the initial gating cycle start time is determined as the gating cycle start time after fault tolerance; if not, the initial gating cycle start time is determined as the configuration base time, and the step of subtracting the current master clock release time from the initial gating cycle start time to obtain the configuration difference is continued until the configuration difference is less than the configuration period.
[0161] In this embodiment of the invention, both the configuration base time and the configuration period are provided by the list configuration state machine, and this embodiment of the invention does not limit this. The gating period start time is set to an integer multiple of the configuration base time minus the configuration period, that is: configuration base time - N × configuration period, taking the smallest value of N, so that the difference between the gating period start time and the current master clock release time is less than the configuration period.
[0162] Furthermore, setting the value of the clock transition signal to false indicates that a clock transition event has been processed, and the periodic timer returns the clock transition signal with a false value to the clock synchronization feedback module.
[0163] Furthermore, the configuration base time is updated to the start time of the gated cycle after fault tolerance, so that the gated list can enter a new steady-state operation.
[0164] Step 3073: If the current master clock release time reaches the start time of the gated cycle after fault tolerance, generate the gated cycle start signal and the process ends.
[0165] In this embodiment of the invention, if the current master clock release time reaches the gating cycle start time, a gating cycle start signal is generated, and the network device enters the start cycle state from the set cycle start time state.
[0166] Step 3074: Determine if there is a previous startup cycle time and the gating cycle execution timeout. If yes, proceed to step 3075; otherwise, proceed to step 3076.
[0167] In this embodiment of the invention, if the clock is not yet stable and it is impossible to determine whether the current master clock release time will continue to change, only the possibility of the cycle start signal failing due to long timeout is considered, without setting a cycle start time.
[0168] In this embodiment of the invention, the previous startup cycle time is the start time of the previous gating cycle. Specifically, the previous startup cycle time is obtained, and it is determined whether the difference between the previous startup cycle time and the current master clock release time is greater than or equal to the configuration cycle. If yes, it indicates that the gating cycle execution has timed out; if no, it indicates that the gating cycle has not timed out.
[0169] In this embodiment of the invention, if there is a previous start cycle time and the gating cycle execution timeout, it indicates that a gating cycle has been executed previously and the gating list control has failed. At this time, fault tolerance is enabled, and step 3075 is executed. If there is no previous start cycle time or the gating cycle execution has not timed out, it indicates that the gating cycle has not been executed previously or is still waiting to be executed. It is necessary to continue monitoring the clock transition signal and the clock stability signal, and step 3076 is executed.
[0170] Step 3075: Generate the gating cycle start signal.
[0171] In this embodiment of the invention, fault tolerance is enabled, and a gating cycle start signal is generated, so that the network device enters the startup cycle state from the set cycle start time state.
[0172] Furthermore, the configuration base time is set to the current master clock release time.
[0173] Step 3076: Generate clock transition signal and clock stabilization signal based on the received clock event.
[0174] In this embodiment of the invention, the clock transition signal and the clock stabilization signal are continuously monitored until the clock remains stable, that is, the value of the clock stabilization signal is true. The specific monitoring process is detailed in steps 201 to 204, and will not be repeated here.
[0175] This invention adds a clock synchronization status feedback module, which can notify the relevant 802.1Qbv state machine of the clock synchronization status in real time, ensuring that the calls to the current PTP time in the state machine are reliable. The logic related to setting the cycle start time in the state machine is modified to ensure fault tolerance capability when a clock failure occurs, still correctly adjusting the cycle start time and generating the cycle start signal, thus guaranteeing the stable operation of the 802.1Qbv scheduling mechanism.
[0176] In the technical solution of the gated cycle control method based on clock fault tolerance provided in this invention embodiment, a clock transition signal and a clock stabilization signal are generated according to the received clock event. The clock event includes the current master clock release time. If the current master clock release time is less than the set configuration reference time, the clock state is determined according to the clock transition signal. Based on the clock state and the clock stabilization signal, clock fault tolerance is performed, and a gated cycle start signal is generated. This method has fault tolerance capability and can adjust the cycle start time in a timely and accurate manner according to the clock stabilization signal when a clock fault occurs, thereby generating a cycle start signal. This improves the stability and reliability of the gated cycle control, thus ensuring the stable operation of the 802.1Qbv scheduling mechanism.
[0177] Figure 4 This is a schematic diagram of a gated cycle control device based on clock fault tolerance, provided in an embodiment of the present invention. This device is used to execute the aforementioned gated cycle control method based on clock fault tolerance, such as... Figure 4 As shown, the device includes: a clock signal generation unit 11, a clock state determination unit 12, and a clock fault tolerance unit 13.
[0178] The clock signal generation unit 11 is used to generate clock transition signals and clock stabilization signals based on the received clock events. The clock events include the current master clock release time.
[0179] The clock state determination unit 12 is used to determine the clock state based on the clock transition signal if the current master clock release time is less than the set configuration reference time.
[0180] The clock fault tolerance unit 13 is used to perform clock fault tolerance based on the clock stability signal according to the clock state, and generate a gated cycle start signal.
[0181] In this embodiment of the invention, the clock event includes a master clock transition event; the clock signal generation unit 11 is specifically used to generate a clock transition signal in response to receiving the master clock transition event, and set the value of the clock transition signal to true; and periodically generate a clock stability signal by comparing the time difference between the last received master clock release time and the current master clock release time with the set check period.
[0182] In this embodiment of the invention, the clock signal generation unit 11 is specifically used to generate a clock stable signal and set the value of the clock stable signal to true if the difference between the time difference between the last received master clock release time and the current master clock release time and the check period is less than a set period threshold; and to generate a clock stable signal and set the value of the clock stable signal to false if the difference between the time difference between the last received master clock release time and the current master clock release time and the check period is greater than or equal to the set period threshold.
[0183] In this embodiment of the invention, the device further includes an accumulation unit 14 and a count value judgment unit 15.
[0184] The accumulator unit 14 is used to increment the set clock synchronization stable counter by one.
[0185] The counting value judgment unit 15 is used to determine whether the count value of the clock synchronization stabilization counter after incrementing by one is greater than the set counting threshold; if yes, it triggers the clock signal generation unit 11 to continue executing the step of setting the value of the clock stabilization signal to true; if no, it triggers the clock signal generation unit 11 to continue executing the step of periodically generating the clock stabilization signal by comparing the time difference between the last received master clock release time and the current master clock release time with the set check period.
[0186] In this embodiment of the invention, the device further includes a zeroing unit 16.
[0187] The clearing unit 16 is used to clear the count value of the clock synchronization stable counter.
[0188] In this embodiment of the invention, the device further includes a start time generation unit 17 and a start signal generation unit 18.
[0189] The start time generation unit 17 is used to generate the gating cycle start time based on the configuration base time and the set configuration cycle if the current master clock release time is greater than or equal to the set configuration base time.
[0190] The start signal generation unit 18 is used to generate a gated cycle start signal if the current master clock release time reaches the gated cycle start time.
[0191] In this embodiment of the invention, the clock state determination unit 12 is specifically used to determine that the clock state has changed if the value of the clock transition signal is true, and to determine that the clock state has not changed if the value of the clock transition signal is false.
[0192] In this embodiment of the invention, the clock state is no transition; the clock fault tolerance unit 13 is specifically used to determine the configuration reference time as the gated cycle start time; if the current master clock release time reaches the gated cycle start time, a gated cycle start signal is generated.
[0193] In this embodiment of the invention, the clock state is in the state of transition; the clock fault tolerance unit 13 is specifically used to generate the gated cycle start time after fault tolerance based on the configured reference time and the set configuration period if the value of the clock stability signal is true; generate the gated cycle start signal if the current master clock release time reaches the gated cycle start time after fault tolerance; determine whether there is a previous start cycle time and the gated cycle execution timeout if the value of the clock stability signal is false; if yes, generate the gated cycle start signal; if no, trigger the clock signal generation unit 11 to re-execute the steps of generating the clock transition signal and the clock stability signal based on the received clock event.
[0194] In this embodiment of the invention, the clock fault tolerance unit 13 is specifically used to subtract the configuration period from the configuration reference time to obtain the initial gated period start time; subtract the current master clock release time from the initial gated period start time to obtain the configuration difference; determine whether the configuration difference is less than the configuration period; if yes, determine the initial gated period start time as the gated period start time after fault tolerance; if no, determine the initial gated period start time as the configuration reference time, and continue to execute the step of subtracting the current master clock release time from the initial gated period start time to obtain the configuration difference, until the configuration difference is less than the configuration period.
[0195] In this embodiment of the invention, the device further includes a setting unit 19 and an updating unit 20.
[0196] Setting unit 19 is used to set the value of the clock transition signal to false.
[0197] The update unit 20 is used to update the configuration base time to the start time of the gated cycle after fault tolerance.
[0198] In the embodiment of the present invention, a clock transition signal and a clock stabilization signal are generated based on the received clock event. The clock event includes the current master clock release time. If the current master clock release time is less than the set configuration reference time, the clock state is determined based on the clock transition signal. Based on the clock state and the clock stabilization signal, clock fault tolerance is performed, and a gated cycle start signal is generated. This provides fault tolerance capability, enabling timely and accurate adjustment of the cycle start time and generation of the cycle start signal in the event of a clock fault. This improves the stability and reliability of the gated cycle control, thereby ensuring the stable operation of the 802.1Qbv scheduling mechanism.
[0199] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer device, specifically, a computer device can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or any combination of these devices.
[0200] This invention provides a computer device, including a memory and a processor. The memory is used to store information including program instructions, and the processor is used to control the execution of the program instructions. When the program instructions are loaded and executed by the processor, they implement the steps of the above-described embodiment of the clock fault-tolerant gated cycle control method. For a detailed description, please refer to the above-described embodiment of the clock fault-tolerant gated cycle control method.
[0201] The following is for reference. Figure 5 It shows a schematic diagram of the structure of a computer device 600 suitable for implementing the embodiments of this application.
[0202] like Figure 5 As shown, the computer device 600 includes a central processing unit (CPU) 601, which can perform various appropriate tasks and processes based on programs stored in read-only memory (ROM) 602 or programs loaded from storage section 608 into random access memory (RAM) 603. The RAM 603 also stores various programs and data required for the operation of the computer device 600. The CPU 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0203] The following components are connected to I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal feedback (LCD), etc., and speakers, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to I / O interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 610 as needed so that computer programs read from it can be installed in storage section 608 as needed.
[0204] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program including program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 609, and / or installed from removable medium 611.
[0205] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0206] For ease of description, the above devices are described separately by function as various units. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware.
[0207] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0208] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0209] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0210] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0211] The acquisition, storage, use, and processing of data in this application all comply with the relevant provisions of national laws and regulations.
[0212] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0213] This application can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0214] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0215] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A clock fault-tolerant based gated period control method, characterized in that, The method includes: Based on the received clock events, a clock transition signal and a clock stabilization signal are generated, wherein the clock events include the current master clock release time; If the current master clock release time is less than the set configuration base time, the clock state is determined based on the clock transition signal; Based on the clock state and the clock stability signal, clock fault tolerance is performed, and a gated cycle start signal is generated. The clock state is a transition; The step of performing clock fault tolerance based on the clock stability signal and generating a gated cycle start signal includes: If the value of the clock stability signal is true, subtract the set configuration period from the configuration reference time to obtain the initial gating cycle start time; subtract the current master clock release time from the initial gating cycle start time to obtain the configuration difference; determine whether the configuration difference is less than the configuration period; if yes, determine the initial gating cycle start time as the gating cycle start time after fault tolerance; if no, determine the initial gating cycle start time as the configuration reference time, and continue to execute the step of subtracting the current master clock release time from the initial gating cycle start time to obtain the configuration difference, until the configuration difference is less than the configuration period; If the current master clock release time reaches the gated cycle start time after fault tolerance, a gated cycle start signal is generated. Set the value of the clock transition signal to false; Update the configuration base time to the start time of the fault-tolerant gating cycle.
2. The gated cycle control method based on clock fault tolerance according to claim 1, characterized in that, The clock events include master clock transition events; The step of generating a clock transition signal and a clock stabilization signal based on the received clock event includes: In response to receiving the master clock transition event, the clock transition signal is generated, and the value of the clock transition signal is set to true; The clock stability signal is periodically generated by comparing the time difference between the last received master clock release time and the current master clock release time with the set check period.
3. The gated cycle control method based on clock fault tolerance according to claim 2, characterized in that, The step of periodically generating the clock stability signal by comparing the time difference between the last received master clock release time and the current master clock release time with a set check period includes: If the difference between the time difference between the last received master clock release time and the current master clock release time and the check period is less than the set period threshold, the clock stabilization signal is generated and the value of the clock stabilization signal is set to true; If the difference between the time difference between the last received master clock release time and the current master clock release time and the difference between the check period is greater than or equal to the set period threshold, the clock stabilization signal is generated, and the value of the clock stabilization signal is set to false.
4. The gated cycle control method based on clock fault tolerance according to claim 3, characterized in that, Before setting the value of the clock stabilization signal to true, the method further includes: Increment the set clock synchronization stability counter by one; Determine whether the count value of the clock synchronization stabilization counter after incrementing by one is greater than the set count threshold; If so, continue with the step of setting the value of the clock stabilization signal to true; If not, continue with the step of periodically generating the clock stability signal by comparing the time difference between the last received master clock release time and the current master clock release time with the set check period.
5. The gated cycle control method based on clock fault tolerance according to claim 4, characterized in that, After setting the value of the clock stabilization signal to false, the method further includes: The count value of the clock synchronization stabilization counter is cleared to zero.
6. The gated cycle control method based on clock fault tolerance according to claim 1, characterized in that, The method further includes: If the current master clock release time is greater than or equal to the set configuration base time, generate the gating cycle start time based on the configuration base time and the set configuration period; If the current master clock publication time reaches the gated cycle start time, a gated cycle start signal is generated.
7. The gated cycle control method based on clock fault tolerance according to claim 1, characterized in that, Determining the clock state based on the clock transition signal includes: If the value of the clock transition signal is true, it is determined that the clock state has transitioned. If the value of the clock transition signal is false, it is determined that the clock state has not transitioned.
8. The gated cycle control method based on clock fault tolerance according to claim 1, characterized in that, The clock state is that no transition has occurred; The step of performing clock fault tolerance based on the clock stability signal and generating a gated cycle start signal includes: The configured reference time is determined as the start time of the gating cycle; If the current master clock publication time reaches the gated cycle start time, a gated cycle start signal is generated.
9. The gated cycle control method based on clock fault tolerance according to claim 1, characterized in that, The clock state is a transition; Also includes: If the value of the clock stability signal is false, determine whether there was a previous startup cycle time and whether the gating cycle execution timed out; If so, generate a gated cycle start signal; If not, repeat the steps of generating clock transition signals and clock stabilization signals based on the received clock events.
10. A gated cycle control system based on clock fault tolerance, characterized in that, The system includes: a clock synchronization status feedback module and a periodic timer; The clock synchronization status feedback module is used to receive clock events and generate clock transition signals and clock stabilization signals based on the received clock events; and sends the clock transition signals and clock stabilization signals to the periodic timer, wherein the clock events include the current master clock release time; The periodic timer is used to determine the clock state based on the clock transition signal if the current master clock release time is less than the set configuration reference time; and to perform clock fault tolerance based on the clock stability signal according to the clock state, and generate a gated cycle start signal. The clock state is a transition; The periodic timer is specifically used to: if the clock stability signal is true, subtract the set configuration period from the configuration reference time to obtain the initial gating cycle start time; subtract the current master clock release time from the initial gating cycle start time to obtain a configuration difference; determine whether the configuration difference is less than the configuration period; if yes, determine the initial gating cycle start time as the fault-tolerant gating cycle start time; if no, determine the initial gating cycle start time as the configuration reference time, and continue executing the step of subtracting the current master clock release time from the initial gating cycle start time to obtain the configuration difference until the configuration difference is less than the configuration period; if the current master clock release time reaches the fault-tolerant gating cycle start time, generate a gating cycle start signal. The period timer is also used to set the value of the clock transition signal to false; and to update the configuration reference time to the start time of the fault-tolerant gating cycle.
11. The gated cycle control system based on clock fault tolerance according to claim 10, characterized in that, The periodic timer is specifically used to determine whether there was a previous start cycle time and the gating cycle execution timeout if the value of the clock stability signal is false; if yes, generate a gating cycle start signal; if no, the clock synchronization status feedback module re-executes the step of generating a clock transition signal and a clock stability signal based on the received clock event.
12. The gated cycle control system based on clock fault tolerance according to claim 11, characterized in that, The periodic timer is also used to return the clock transition signal; The clock synchronization status feedback module is used to receive the clock transition signal returned by the periodic timer, and the value of the clock transition signal is set to false.
13. A gated cycle control device based on clock fault tolerance, characterized in that, The device includes: A clock signal generation unit is used to generate a clock transition signal and a clock stability signal based on the received clock events, wherein the clock events include the current master clock release time; A clock state determination unit is used to determine the clock state based on the clock transition signal if the current master clock release time is less than the set configuration reference time. A clock fault tolerance unit is used to perform clock fault tolerance based on the clock state and the clock stability signal, and to generate a gated cycle start signal. The clock state is a transition; The clock fault tolerance unit is specifically configured to: if the clock stability signal is true, subtract the set configuration period from the configuration reference time to obtain the initial gated cycle start time; subtract the current master clock release time from the initial gated cycle start time to obtain a configuration difference; determine whether the configuration difference is less than the configuration period; if yes, determine the initial gated cycle start time as the fault-tolerant gated cycle start time; if no, determine the initial gated cycle start time as the configuration reference time, and continue executing the step of subtracting the current master clock release time from the initial gated cycle start time to obtain the configuration difference until the configuration difference is less than the configuration period; if the current master clock release time reaches the fault-tolerant gated cycle start time, generate a gated cycle start signal. The device further includes: The setting unit is used to set the value of the clock transition signal to false. The update unit is used to update the configuration reference time to the start time of the gated cycle after fault tolerance.
14. The gated cycle control device based on clock fault tolerance according to claim 13, characterized in that, The clock events include master clock transition events; The clock signal generation unit is specifically used to generate the clock transition signal in response to receiving the master clock transition event, and set the value of the clock transition signal to true; and to periodically generate the clock stability signal by comparing the time difference between the last received master clock release time and the current master clock release time with the set check period.
15. The gated cycle control device based on clock fault tolerance according to claim 14, characterized in that, The clock signal generation unit is specifically configured to generate the clock stability signal and set the value of the clock stability signal to true if the difference between the time difference between the last received master clock release time and the current master clock release time and the check period is less than a set period threshold; and to generate the clock stability signal and set the value of the clock stability signal to false if the difference between the time difference between the last received master clock release time and the current master clock release time and the check period is greater than or equal to the set period threshold.
16. The gated cycle control device based on clock fault tolerance according to claim 15, characterized in that, The device further includes: The accumulator unit is used to increment the set clock synchronization stabilization counter by one. The counting value judgment unit is used to determine whether the count value of the clock synchronization stabilization counter after incrementing by one is greater than the set counting threshold; if yes, it triggers the clock signal generation unit to continue executing the step of setting the value of the clock stabilization signal to true; if no, it triggers the clock signal generation unit to continue executing the step of periodically generating the clock stabilization signal by comparing the time difference between the last received master clock release time and the current master clock release time with the set check period.
17. The gated cycle control device based on clock fault tolerance according to claim 16, characterized in that, The device further includes: The clearing unit is used to clear the count value of the clock synchronization stabilization counter to zero.
18. The gated cycle control device based on clock fault tolerance according to claim 13, characterized in that, The device further includes: The start time generation unit is used to generate a gated cycle start time based on the configuration reference time and the set configuration period if the current master clock release time is greater than or equal to the set configuration reference time. A start signal generation unit is used to generate a gated cycle start signal if the current master clock release time reaches the gated cycle start time.
19. The gated cycle control device based on clock fault tolerance according to claim 13, characterized in that, The clock state determination unit is specifically used to determine that the clock state has changed if the value of the clock transition signal is true, and to determine that the clock state has not changed if the value of the clock transition signal is false.
20. The gated cycle control device based on clock fault tolerance according to claim 13, characterized in that, The clock state is that no transition has occurred; The clock fault tolerance unit is specifically used to determine the configuration reference time as the gated cycle start time; if the current master clock release time reaches the gated cycle start time, a gated cycle start signal is generated.
21. The gated cycle control device based on clock fault tolerance according to claim 13, characterized in that, The clock state is a transition; The clock fault tolerance unit is specifically used to determine whether there is a previous start cycle time and the gating cycle execution timeout if the value of the clock stability signal is false; if yes, generate a gating cycle start signal; if no, trigger the clock signal generation unit to re-execute the steps of generating clock transition signals and clock stability signals based on the received clock events.
22. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the clock fault-tolerant gated cycle control method as described in any one of claims 1 to 9.
23. A computer device comprising a memory and a processor, the memory for storing information including program instructions, and the processor for controlling the execution of the program instructions, characterized in that, When the program instructions are loaded and executed by the processor, they implement the clock fault-tolerant gated cycle control method according to any one of claims 1 to 9.
24. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the clock fault-tolerant gated cycle control method according to any one of claims 1 to 9.
