Time-sensitive network end-to-end time synchronization method, device and storage medium
By obtaining and calibrating timestamps in complex network environments, analyzing and processing time delay factors, calculating network delay values and adjusting local clocks, the problems of insufficient synchronization accuracy and unstable time delay in traditional methods are solved, and high-precision and stable time synchronization are achieved.
Patent Information
- Application Number
- CN202510286367.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-12
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2045-03-12
AI Technical Summary
In complex network environments, traditional time synchronization methods face problems of insufficient synchronization accuracy and unstable delay, especially when there are dynamically changing network delays and unpredictable jitters.
By obtaining the timestamps of the source and target ends, time calibration and delay analysis are performed, time offset factors, jitter factors and stability factors are extracted, and the network delay value is finally calculated, and the local clock of the target end is adjusted based on this.
It significantly improves the accuracy and stability of end-to-end time synchronization, and improves the problems of insufficient synchronization accuracy and unstable delay in complex network environments.
Smart Images

Figure CN119788232A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of information processing, and in particular to a method, device and storage medium for end-to-end time synchronization in a time-sensitive network. Background Art
[0002] With the rapid development of industrial automation, intelligent manufacturing, unmanned driving, 5G communications and other fields, more and more applications have extremely high requirements for real-time and precision. Especially in distributed systems, time synchronization has become one of the key technologies. Time-sensitive networking (TSN), as a network technology for high-precision time synchronization, has been widely used in automation control, video surveillance, telemedicine, industrial Internet and other fields. Through high-precision time synchronization, it can ensure that all devices in the network work together to provide low-latency and high-stability services.
[0003] Among the related technical means, time synchronization methods usually rely on clock synchronization protocols (such as IEEE1588 Precision Time Protocol, PTP) to ensure the time consistency of each node in the system. Existing time synchronization technologies include two main solutions: one is to exchange timestamp information between the source and the target, and accurately synchronize the time between devices through network delay estimation and compensation; the other is to synchronize based on dedicated hardware (such as high-precision clock sources and dedicated synchronization modules). These solutions can usually support stable operation in a network environment while ensuring a certain degree of time synchronization accuracy.
[0004] For the above technical solution, end-to-end time synchronization can be achieved by adopting network delay estimation and compensation methods to ensure that the time of the source and target ends is highly consistent. However, when faced with more complex network environments, especially when there are dynamically changing network delays and unpredictable jitters, traditional methods often face problems of insufficient synchronization accuracy and unstable delays. Summary of the invention
[0005] In order to improve the problems of insufficient synchronization accuracy and unstable delay in a complex network environment, the present application provides a time-sensitive network end-to-end time synchronization method, device and storage medium.
[0006] The present invention provides a time-sensitive network end-to-end time synchronization method, comprising: obtaining a timestamp of a source end, performing time calibration on a time synchronization signal according to the timestamp of the source end to obtain a calibrated time synchronization signal, using the calibrated time synchronization signal to collect the time of a target end to obtain a timestamp of the target end; inputting the timestamp of the source end and the timestamp of the target end into a preset delay analysis model to obtain a delay factor set, performing classification processing on the delay factor set to obtain a time offset factor, a jitter factor and a stability factor; performing time domain analysis on the time offset factor to obtain a time offset reference and a time offset error, using the time offset reference to correct the jitter factor to obtain a jitter correction value; performing filtering processing on the time offset error and the stability factor to obtain a stability correction value, performing a combined operation on the jitter correction value and the stability correction value to obtain a network delay value; based on the network delay value, in combination with local clock information of the source end and the target end, correcting the timestamp of the target end to obtain a corrected timestamp of the target end, and adjusting the local clock of the target end according to the corrected timestamp of the target end and the timestamp of the source end.
[0007] As a preferred scheme, the steps of obtaining the timestamp of the source end, calibrating the time synchronization signal according to the timestamp of the source end to obtain the calibrated time synchronization signal, and using the calibrated time synchronization signal to collect the time of the target end to obtain the timestamp of the target end include: upon receiving the time synchronization signal that needs to align the source end with the target end, obtaining the timestamp of the source end, identifying and verifying the timestamp of the source end using a timestamp matching algorithm to obtain a valid timestamp; comparing the valid timestamp with the clock deviation parameter of the target end using a dynamic time normalization algorithm to generate a calibration factor and a residual error value, adjusting the time synchronization signal using the calibration factor to obtain an adjusted time synchronization signal, and calibrating the adjusted time synchronization signal using the residual error value to obtain a calibrated time synchronization signal; wherein the clock deviation parameters include frequency deviation and phase deviation; collecting the time of the target end according to the calibrated time synchronization signal to obtain the timestamp of the target end.
[0008] As a preferred solution, the steps of inputting the timestamp of the source end and the timestamp of the target end into a preset delay analysis model to obtain a delay factor set, classifying the delay factor set, and obtaining a time offset factor, a jitter factor, and a stability factor include: inputting the timestamp of the source end and the timestamp of the target end into a preset delay analysis model to perform timing difference calculation to obtain a preliminary delay data set, performing frequency domain decomposition of the preliminary delay data set using discrete Fourier transform to extract stable components and dynamic components; calculating the time variation trend based on the dynamic component to obtain a time offset factor, performing multi-order statistical analysis on the stable component using autoregressive analysis to obtain a jitter factor and a noise intensity parameter, and performing low-pass filtering on the noise intensity parameter using an FIR filter to generate a stability factor.
[0009] As a preferred scheme, the steps of performing time domain analysis on the time offset factor to obtain a time offset benchmark and a time offset error, and using the time offset benchmark to correct the jitter factor to obtain a jitter correction value include: using a piecewise linear regression method to construct a time offset trend curve based on the time offset factor, using a curve fitting algorithm to segment and analyze the time offset trend curve to generate a time offset benchmark, and calculating the time offset error based on the time offset benchmark; using the time offset benchmark, applying fuzzy logic rules to classify the jitter factor to generate a jitter value, performing piecewise optimization on the jitter value through a wavelet packet algorithm, and generating a jitter correction value based on the optimization result.
[0010] As a preferred solution, the step of using a piecewise linear regression method to construct a time offset trend curve based on the time offset factor, using a curve fitting algorithm to segment and analyze the time offset trend curve, generating a time offset benchmark, and calculating the time offset error according to the time offset benchmark includes: segmenting the time offset factor into multiple linear segments by piecewise linear regression to obtain the segment slope, segment intercept and segment residual of each linear segment, performing statistical analysis on the segment slope to obtain the slope mean and slope variance, adjusting the segment intercept by using the slope mean to obtain the adjusted intercept, and calculating the time offset error by using the slope. The segmented residual is corrected by using the variance to obtain the corrected residual; a time offset trend curve is constructed according to the adjusted intercept and the corrected residual, and a curve fitting is performed on the time offset trend curve by using a Fourier series fitting algorithm to obtain Fourier coefficients and fitting residuals; the Fourier coefficients are low-pass filtered to obtain filtered coefficients, the fitting residuals are smoothed to obtain smoothed residuals, the filtered coefficients and the smoothed residuals are combined to obtain a time offset benchmark, and the time offset benchmark is input into a preset time offset error calculation model to calculate the time offset error.
[0011] As a preferred scheme, the steps of filtering the time offset error and the stability factor to obtain a stability correction value, and combining the jitter correction value and the stability correction value to obtain a network delay value include: jointly filtering the time offset error and the stability factor using a Kalman filter to obtain a filtered dynamic correction factor, optimizing the parameters of the dynamic correction factor using a dynamic adaptive window algorithm to generate a stability correction value; performing fast Fourier transform on the jitter correction value to extract frequency domain characteristics, fusing the frequency domain characteristics with the stability correction value using a dynamic characteristic fusion algorithm based on convolution to generate a network dynamic delay factor, and performing matrix weighted summation on the network dynamic delay factor and the stability correction value to obtain a network delay value.
[0012] As a preferred solution, based on the network delay value, in combination with the local clock information of the source and target ends, the timestamp of the target end is corrected to obtain a corrected timestamp of the target end, and according to the corrected timestamp of the target end and the timestamp of the source end, the steps of adjusting the local clock of the target end include: correcting the network delay value and the timestamp of the target end by a nonlinear least squares method to obtain a time correction factor, performing linear interpolation processing on the time correction factor to obtain a corrected timestamp of the target end; comparing the corrected timestamp of the target end with the timestamp of the source end to generate a synchronization deviation parameter, using the synchronization deviation parameter to fine-tune the local clock frequency of the target end to obtain a frequency adjustment value, applying the frequency adjustment value to the local clock reference of the target end to complete the time reference adjustment.
[0013] The present application also provides a time-sensitive network end-to-end time synchronization device, including: an acquisition module, used to obtain the timestamp of the source end, perform time calibration on the time synchronization signal according to the timestamp of the source end, obtain the calibrated time synchronization signal, use the calibrated time synchronization signal to collect the time of the target end, and obtain the timestamp of the target end; a classification module, used to input the timestamp of the source end and the timestamp of the target end into a preset delay analysis model, obtain a delay factor set, classify the delay factor set, and obtain a time offset factor, a jitter factor, and a stability factor; a correction module, used to perform time domain calibration on the time offset factor Analysis is performed to obtain a time offset reference and a time offset error, and the jitter factor is corrected using the time offset reference to obtain a jitter correction value; a processing module is used to filter the time offset error and the stability factor to obtain a stability correction value, and the jitter correction value and the stability correction value are combined to obtain a network delay value; an adjustment module is used to correct the timestamp of the target end based on the network delay value and in combination with the local clock information of the source end and the target end to obtain a corrected timestamp of the target end, and adjust the local clock of the target end according to the corrected timestamp of the target end and the timestamp of the source end.
[0014] The present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the processor executes the time-sensitive network end-to-end time synchronization method as described in any one of the above.
[0015] Compared with the prior art, the present application has the following beneficial effects: high synchronization and stable delay. By obtaining the timestamp of the source end and performing accurate time calibration to ensure the accuracy of the time synchronization signal, the timestamps of the source end and the target end are analyzed in detail using the preset delay analysis model, and the time offset factor, jitter factor and stability factor affecting the time synchronization are extracted. Then, the time offset factor is analyzed in the time domain to determine the time offset benchmark and error, and the jitter factor is corrected to eliminate the influence of the fixed delay; the time offset error and the stability factor are filtered to obtain the stability correction value to reduce the interference of noise and unstable factors; the jitter correction value and the stability correction value are combined and calculated to accurately calculate the network delay value; based on the network delay value, combined with the local clock information of the source end and the target end, the timestamp of the target end is corrected, and the local clock of the target end is adjusted to effectively compensate for the fixed delay and random jitter in the network transmission process, significantly improve the accuracy and stability of end-to-end time synchronization, and improve the problems of insufficient synchronization accuracy and unstable delay in complex network environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0017] The structures, proportions, sizes, etc. illustrated in the drawings of this specification are only used to match the contents disclosed in the specification so as to facilitate understanding and reading by persons familiar with this technology. They are not used to limit the conditions under which the present invention can be implemented, and therefore have no substantive technical significance. Any structural modification, change in proportion or adjustment of size, without affecting the effects and purposes that can be achieved by the present invention, should still fall within the scope of the technical contents disclosed by the present invention.
[0018] Figure 1 It is a flowchart of a time-sensitive network end-to-end time synchronization method provided by an embodiment of the present invention; Figure 2 It is a schematic block diagram of the structure of a time-sensitive network end-to-end time synchronization device provided by an embodiment of the present invention.
[0019] Description of reference numerals: 10. Time-sensitive network end-to-end time synchronization device; 11. Acquisition module; 12. Classification module; 13. Correction module; 14. Processing module; 15. Adjustment module. DETAILED DESCRIPTION
[0020] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0021] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0022] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0023] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0024] The technical solution of the present invention is further described below with reference to the accompanying drawings and through specific implementation methods.
[0025] Embodiment 1: like Figure 1 As shown, the present application also provides a time-sensitive network end-to-end time synchronization method, including steps S100 to S500.
[0026] Step S100, obtaining the timestamp of the source end, calibrating the time synchronization signal according to the timestamp of the source end to obtain the calibrated time synchronization signal, and using the calibrated time synchronization signal to collect the time of the target end to obtain the timestamp of the target end.
[0027] In this step, obtaining the timestamp of the source end is the starting point of time synchronization. Ensuring the accuracy of the source end time is crucial to the entire synchronization process. Specifically, the local clock of the source end generates an accurate timestamp and records the current sending time. Then, according to the timestamp of the source end, the time synchronization signal to be sent is time-calibrated so that the time information of the signal is consistent with the actual time of the source end, and the calibrated time synchronization signal is obtained. Then, the calibrated time synchronization signal is sent to the target end. After the target end receives the signal, it uses it to collect the current time of the target end and records it as the timestamp of the target end.
[0028] For example, in an industrial control network, the timestamp of the source device is T1, and the time synchronization signal is sent to the target device through the network. The source calibrates the signal to ensure that the sending time is synchronized with T1. After receiving the synchronization signal, the target device immediately records the receiving time as T2 and obtains the timestamp of the target. In this way, the timestamps of the source and target are T1 and T2 respectively, providing basic data for subsequent delay analysis.
[0029] Step S200: Input the timestamp of the source end and the timestamp of the target end into a preset delay analysis model to obtain a delay factor set, classify the delay factor set, and obtain a time offset factor, a jitter factor, and a stability factor.
[0030] In this step, the timestamps of the source and target ends are processed using the preset delay analysis model to analyze the various delay factors in the network transmission process. Specifically, T1 and T2 are input into the delay analysis model to calculate the transmission delay Δt=T2-T1 to form a delay factor set. Then, the delay factor set is classified and processed, and divided into time offset factor, jitter factor and stability factor according to the characteristics of the delay. Among them, the time offset factor represents the fixed delay in the system; the jitter factor represents the random delay change caused by network load changes and other reasons; the stability factor is used to evaluate the trend and stability of the delay change.
[0031] For example, assuming that the delay data collected multiple times are Δt1, Δt2, Δt3..., through statistical analysis, the average value of these delays is calculated as the time offset factor, such as Δt_avg; the difference between each delay and the average value is calculated as the jitter factor; the delay data is trend analyzed to evaluate its changes over time to obtain the stability factor.
[0032] Step S300: Perform time domain analysis on the time offset factor to obtain a time offset reference and a time offset error, and use the time offset reference to correct the jitter factor to obtain a jitter correction value.
[0033] In this step, a more in-depth time domain analysis is performed on the time offset factor to determine the fixed delay benchmark of the system. Specifically, the time offset benchmark Δt0 is calculated using the time offset factor as a reference value in the synchronization process. At the same time, the difference between the time offset of each acquisition and the benchmark is calculated to obtain the time offset error Δt_err. Next, the jitter factor is corrected using the time offset benchmark, subtracting the effect of the fixed delay to obtain the jitter correction value caused purely by random changes.
[0034] For example, if the time offset reference Δt0=5ms, and the time offset of a certain measurement is Δt=5.2ms, then the time offset error Δt_err=Δt-Δt0=0.2ms. The jitter factor Jitter originally includes the influence of the fixed delay. After correction, the jitter correction value Jitter_corrected=Jitter-Δt0 is obtained, which reflects the actual jitter of the network.
[0035] Step S400: Filter the time offset error and the stability factor to obtain a stability correction value, and combine the jitter correction value and the stability correction value to obtain a network delay value.
[0036] In order to eliminate the noise and instability in the measurement data, the time offset error and stability factor are filtered. Specifically, an appropriate filtering algorithm (such as weighted average filtering, Kalman filtering, etc.) is used to process Δt_err and the stability factor to obtain a smoother stability correction value S_corrected. Then, the jitter correction value and the stability correction value are combined and calculated, and various delay factors are comprehensively considered to calculate the final network delay value Delay.
[0037] For example, a weighted average filter is used to process the time offset errors of multiple measurements to obtain a stability correction value S_corrected = (Δt_err1 + Δt_err2 + Δt_err3 ...) / N. Then, the network delay value Delay = Δt0 + S_corrected + Jitter_corrected is used as the basis for correcting the target end timestamp.
[0038] Step S500: Based on the network delay value and in combination with the local clock information of the source and target ends, the timestamp of the target end is corrected to obtain a corrected timestamp of the target end, and the local clock of the target end is adjusted according to the corrected timestamp of the target end and the timestamp of the source end.
[0039] In this step, the timestamp of the target end is corrected using the calculated network delay value to synchronize it with the time of the source end. Specifically, the corrected timestamp of the target end is T2_corrected = T2-Delay. Then, T2_corrected is compared with the timestamp T1 of the source end to calculate the time difference ΔT = T1-T2_corrected. Based on the time difference, the local clock of the target end is adjusted to compensate for the clock deviation, so as to achieve time synchronization between the source and the target end.
[0040] For example, assuming the calculated network delay value Delay = 5.5ms, the target end timestamp T2 = 1005.7ms, and the corrected target end timestamp T2_corrected = 1005.7ms-5.5ms = 1000.2ms. The source end timestamp T1 = 1000ms, and the calculated time difference ΔT = 1000ms-1000.2ms = -0.2ms. The local clock of the target end needs to be accelerated by 0.2ms to achieve time synchronization with the source end.
[0041] In this embodiment, the timestamp of the source end is first obtained, and the time synchronization signal is time-calibrated according to the timestamp of the source end to obtain the calibrated time synchronization signal. The time of the target end is collected using the calibrated time synchronization signal to obtain the timestamp of the target end. Then the timestamp of the source end and the timestamp of the target end are input into the preset delay analysis model to obtain a delay factor set, and the delay factor set is classified and processed to obtain a time offset factor, a jitter factor and a stability factor. Next, the time offset factor is analyzed in the time domain to obtain a time offset reference and a time offset error, and the jitter factor is corrected using the time offset reference to obtain a jitter correction value. Subsequently, the time offset error and the stability factor are filtered to obtain a stability correction value, and the jitter correction value and the stability correction value are combined to obtain a network delay value. Finally, based on the network delay value, the timestamp of the target end is corrected in combination with the local clock information of the source end and the target end to obtain a corrected timestamp of the target end, and the local clock of the target end is adjusted according to the corrected timestamp of the target end and the timestamp of the source end, effectively improving the accuracy and stability of the end-to-end time synchronization of the time-sensitive network.
[0042] By utilizing the classified analysis and precise correction of the time offset factor, jitter factor, and stability factor, the dynamic delay and jitter factors in the network can be fully compensated, and the network delay can be accurately calculated and corrected. In this way, in a complex network environment, the timestamp of the target end is corrected more accurately, and the local clock of the target end can be accurately synchronized with the source end, which significantly reduces the synchronization error, improves the real-time performance and reliability of the system, and improves the problems of insufficient synchronization accuracy and unstable delay in a complex network environment.
[0043] Embodiment 2: In step S100, after receiving a signal that requires time synchronization between the source end and the target end, the timestamp of the source end is obtained, and the timestamp of the source end is identified and verified using a timestamp matching algorithm to obtain a valid timestamp.
[0044] The timestamp of the source is accurately identified and verified by using a timestamp matching algorithm; specifically, first, after the source sends a time synchronization signal, the target receives the time synchronization signal, which contains the timestamp information of the source. In order to ensure the validity and accuracy of the timestamp, the target uses a timestamp matching algorithm to identify the format and verify the content of the received source timestamp. The timestamp matching algorithm includes format verification of the timestamp, such as whether it complies with the UTC (Coordinated Universal Time) standard format, and whether the year, month, day, hour, minute, second, millisecond, etc. in the timestamp are within a reasonable range; it also includes integrity verification of the timestamp, such as verifying whether the timestamp data is damaged or tampered with during transmission through a checksum (such as CRC check) or a hash function. Through these steps, a verified valid timestamp is obtained, providing a reliable data basis for the subsequent synchronization process.
[0045] For example, if the timestamp of the source is "2023-10-15T14:23:45.123456Z", after the target receives the time synchronization signal, it first checks whether the timestamp format is in the ISO8601 standard format, confirms that the year is "2023", the month is "10", the date is "15", the hour is "14", the minute is "23", the second is "45", and the millisecond is "123456", and verifies whether these values are within a reasonable range. Then, the target performs a CRC check on the timestamp data, calculates the checksum of the received timestamp, and compares it with the checksum sent by the source. After confirming that they are consistent, the timestamp is considered to be a valid timestamp to ensure the reliability of subsequent time synchronization processing.
[0046] A dynamic time normalization algorithm is used to compare the effective timestamp and the clock deviation parameters of the target end to generate a calibration factor and a residual error value, the calibration factor is used to adjust the time synchronization signal to obtain an adjusted time synchronization signal, and the residual error value is used to calibrate the adjusted time synchronization signal to obtain a calibrated time synchronization signal; wherein the clock deviation parameters include frequency deviation and phase deviation.
[0047] The clock deviation between the effective timestamp and the target end is accurately corrected by applying the dynamic time adjustment algorithm; specifically, first, the difference between the effective timestamp and the current time of the target end is calculated to obtain the initial time deviation. Among them, the clock deviation parameter of the target end is the systematic error of the clock of the target end device, including frequency deviation and phase deviation. Using the dynamic time adjustment algorithm, the initial time deviation is dynamically adjusted to generate a calibration factor by considering the frequency offset and phase difference of the target end clock. The calibration factor is used to compensate for the systematic deviation between the target end clock and the source end clock. Next, the residual error value between the adjusted time synchronization signal and the target end clock is calculated, and the error value may be caused by random jitter and noise. The adjusted time synchronization signal is finely calibrated using the residual error value to eliminate small random errors, and finally a calibrated time synchronization signal is obtained.
[0048] For example, assume that the valid timestamp is "2023-10-15T14:23:45.123456Z", the current time of the target end is "2023-10-15T14:23:45.120000Z", and the initial time deviation is 3.456 milliseconds. The clock frequency deviation of the target end is ±10ppm, which means that the deviation may be 10 microseconds per second. Through the dynamic time normalization algorithm, taking into account the frequency deviation and the initial time deviation, the calibration factor is calculated to be 3.456 milliseconds-(10ppm×time interval). Assuming that the time interval is 1 second, the time error caused by the frequency deviation is ±10 microseconds. The calibration factor is therefore adjusted to approximately 3.446 milliseconds. The time synchronization signal is time-adjusted using the calibration factor to obtain an adjusted time synchronization signal. The residual error value may be a small error caused by factors such as transmission delay jitter, such as 10 microseconds. The adjusted time synchronization signal is calibrated using the residual error value, and a high-precision calibrated time synchronization signal is finally obtained.
[0049] The time of the target end is collected according to the calibrated time synchronization signal to obtain the timestamp of the target end.
[0050] By using the calibrated time synchronization signal as a reference, the time of the target end is accurately collected; specifically, after receiving the calibrated time synchronization signal, the target end immediately triggers the local time acquisition module to record the local time at this moment as the timestamp of the target end. Since the previous calibration process has eliminated clock deviation and random errors as much as possible, the target end timestamp collected at this time has a high accuracy, providing reliable data for subsequent time synchronization calculations.
[0051] For example, after receiving the calibrated time synchronization signal, the target end immediately reads the local clock and obtains the target end timestamp of "2023-10-15T14:23:45.123466Z". Since the previous calibration has minimized the clock deviation between the source and target ends, the difference between the target end timestamp and the source end timestamp is only at the nanosecond level, meeting the requirements of high-precision time synchronization.
[0052] In step S200, the timestamp of the source end and the timestamp of the target end are input into a preset delay analysis model to calculate the timing difference to obtain a preliminary delay data set, and the preliminary delay data set is decomposed in the frequency domain using discrete Fourier transform to extract stable components and dynamic components.
[0053] The difference calculation and frequency domain analysis of the timestamps of the source and target ends are performed in the delay analysis model; specifically, first, the time difference between the timestamp of the source and the timestamp of the target is calculated to obtain a preliminary delay data set, which reflects the time difference between the source and the target in multiple measurements. Then, the discrete Fourier transform (DFT) is used to perform frequency domain decomposition on the preliminary delay data set to convert the delay data from the time domain to the frequency domain. By analyzing the frequency domain signal, stable components and dynamic components can be distinguished. The stable component corresponds to the low-frequency component, which represents the fixed delay of the system, such as line propagation delay, etc.; the dynamic component corresponds to the high-frequency component, which reflects the delay changes caused by jitter and network congestion during the transmission process.
[0054] For example, assuming that the initial delay data set is [3.456ms, 3.458ms, 3.460ms, 3.455ms, 3.457ms], perform DFT on the data set to obtain the frequency domain signal. Analysis of the spectrum shows that the main energy is concentrated in the DC and low-frequency components, and the corresponding stable component average is 3.457ms, while the dynamic component of the high-frequency component is less than ±0.003ms, indicating a small random change in the delay. This decomposition helps to distinguish between fixed delay and random jitter, facilitating the subsequent delay factor extraction.
[0055] The time variation trend is calculated based on the dynamic component to obtain the time offset factor. The autoregressive analysis method is used to perform multi-order statistical analysis on the stable component to obtain the jitter factor and noise intensity parameter. The noise intensity parameter is low-pass filtered through the FIR filter to generate the stability factor.
[0056] Through in-depth statistical analysis and filtering of dynamic components and stable components; specifically, for dynamic components, by calculating their changing trends over a period of time, we can identify whether there is a systematic time offset, such as linear drift. According to the time change trend, the time offset factor is calculated to quantify the degree of this systematic offset. Then, the autoregression (AR) analysis method is applied to the stable component to establish a multi-order autoregression model to capture the statistical characteristics of the delay data, extract the jitter factor, quantify the amplitude of random jitter, and the noise intensity parameter to reflect the impact of measurement noise on the delay data. Next, the finite impulse response (FIR) filter is used to low-pass filter the noise intensity parameter to filter out high-frequency noise and obtain a smooth stability factor, which represents the long-term stability of the delay data.
[0057] For example, for the dynamic component, the calculated time offset factor is 0.001ms per minute, indicating that the delay increases slightly over time. For the stable component, the third-order autoregressive model is applied to estimate the jitter factor as ±0.002ms and the noise intensity parameter as 0.0005ms. Then, the noise intensity parameter is low-pass filtered by the FIR filter, and the smoothed stability factor is 0.0004ms. This stability factor shows that the noise level of the delay data is low and the system has good delay stability.
[0058] In step S300, a time shift trend curve is constructed based on the time shift factor using a piecewise linear regression method, the time shift trend curve is segmented and analyzed using a curve fitting algorithm, a time shift benchmark is generated, and a time shift error is calculated based on the time shift benchmark.
[0059] By performing piecewise linear regression on the time offset factors, an accurate time offset trend curve is constructed; specifically, first, the time offset factors are sorted according to the time series to form a set of ordered time offset data. Then, the entire time series is divided into multiple intervals using the piecewise linear regression method, and linear regression analysis is performed on the time offset data in each interval to obtain the segment slope, segment intercept and segment residual of each linear segment. Next, the segment slopes of all linear segments are statistically analyzed, the mean and variance of the slopes are calculated, and the overall trend and fluctuation degree of the time offset are evaluated. The segment intercept is adjusted using the slope mean to obtain the adjusted intercept to eliminate the influence of deviation and error. Finally, the segment residual is corrected using the slope variance to obtain the corrected residual, thereby improving the fitting accuracy of the regression model. Through the above steps, a time offset benchmark is generated, which provides a reliable basis for the subsequent calculation of the time offset error.
[0060] For example, suppose that in a time synchronization process, the collected time offset factor sequence is: 0.5ms, 0.8ms, 1.2ms, 1.6ms, 2.0ms, 2.4ms, 2.8ms, and the corresponding time is t1, t2, t3, t4, t5, t6, t7. First, sort the data by time, and then divide the sequence into two intervals: [t_1, t_4] and [t_4, t_7]. In the first interval, linear regression is performed on 0.5ms, 0.8ms, 1.2ms, 1.6ms, and the segment slope is 0.3667ms / unit time, the segment intercept is 0.1333ms, and the segment residual is 0.0333ms, −0.0333ms, 0.0333ms, −0.0333ms. In the second interval, linear regression is performed on 1.6ms, 2.0ms, 2.4ms, and 2.8ms, and the segment slope is 0.4ms / unit time, the segment intercept is 1.2ms, and the segment residual is −0.1ms, 0.0ms, 0.1ms, and 0.0ms. Statistical analysis is performed on the segment slope, and the slope mean is 0.3833ms / unit time, and the slope variance is 0.000278ms² / unit time². The segment intercept is adjusted using the slope mean, and the new intercept is 0.15ms and 1.15ms. The segment residual is corrected using the slope variance, and the corrected residuals are finally 0.0306ms, −0.0306ms, 0.0306ms, −0.0306ms, and −0.0952ms, 0.0048ms, 0.1048ms, and 0.0048ms. Finally, a time migration trend curve was constructed, which laid the foundation for calculating the time migration error.
[0061] Using the time offset benchmark, fuzzy logic rules are applied to classify the jitter factors to generate jitter values. The jitter values are segmented optimized through wavelet packet algorithm, and jitter correction values are generated based on the optimization results.
[0062] By using the time offset benchmark as a reference, the jitter factor is finely classified and processed using fuzzy logic rules; specifically, first, according to the time offset benchmark, the threshold and classification standard of the jitter factor are determined, and a fuzzy set is constructed to divide the jitter factor into levels such as "high jitter", "medium jitter" and "low jitter". The membership function is used to calculate the degree to which each jitter factor belongs to each jitter level and generate the corresponding jitter value. Then, the wavelet packet algorithm is used to perform segmented optimization processing on the jitter value. The wavelet packet algorithm can perform time-frequency analysis on the jitter signal, accurately extract the jitter characteristics of different frequency bands, and eliminate noise and interference. By reconstructing the jitter signal of each frequency band, the optimized jitter value is obtained. Finally, based on the optimization results, the jitter correction value is calculated to compensate for the delay error caused by random jitter during the transmission process.
[0063] For example, assume that the jitter factor sequence is 0.05ms, 0.15ms, 0.25ms, 0.10ms, and 0.20ms. According to the time offset benchmark, the thresholds for jitter factor classification are set to 0.1ms and 0.2ms. Apply fuzzy logic rules to calculate the membership of each jitter factor to different jitter levels. For example, 0.05ms belongs to "low jitter" with a degree of 0.9 and "medium jitter" with a degree of 0.1; 0.15ms belongs to "medium jitter" with a degree of 0.8 and "high jitter" with a degree of 0.2. According to the membership, the corresponding jitter value is generated. Then, the wavelet packet algorithm is used to decompose the jitter value and extract the jitter characteristics of each frequency band. By thresholding and reconstructing the wavelet coefficients, high-frequency noise is eliminated, and the optimized jitter values of 0.048ms, 0.142ms, 0.238ms, 0.095ms, and 0.190ms are obtained. Finally, the jitter correction value is calculated as the basis for subsequent delay correction.
[0064] Among them, a piecewise linear regression method is used to construct a time offset trend curve based on the time offset factor, a curve fitting algorithm is used to segment and analyze the time offset trend curve, a time offset benchmark is generated, and the time offset error is calculated according to the time offset benchmark. The steps include: segmenting the time offset factor into multiple linear segments through piecewise linear regression, obtaining the segment slope, segment intercept and segment residual of each linear segment, performing statistical analysis on the segment slope to obtain the slope mean and slope variance, adjusting the segment intercept using the slope mean to obtain the adjusted intercept, and correcting the segment residual using the slope variance to obtain the corrected residual.
[0065] By performing piecewise linear regression and statistical analysis on the time offset factors, the time offset features are accurately extracted; specifically, first, the time offset factors are arranged in chronological order to form a time series. Then, according to the change trend and characteristics of the data, the time series is divided into multiple linear intervals. In each interval, the least squares method is used for linear regression to obtain the corresponding segment slope (indicating the rate of change of time offset), segment intercept (indicating the value of the time offset at the starting point of the segment) and segment residual (the difference between the actual observed value and the fitted value). Next, the segment slopes of all linear segments are statistically analyzed, the slope mean is calculated to reflect the average change trend of the overall time offset, and the slope variance is calculated to evaluate the fluctuation degree of the slope. Using the slope mean, the segment intercept of each linear segment is adjusted to make the trend between different segments consistent and eliminate the discontinuity between segments caused by measurement errors or random factors. Using the slope variance, the segment residual is corrected to reduce the deviation and improve the fitting accuracy of the model. Through the above steps, a more accurate time offset trend curve is constructed.
[0066] For example, suppose the time offset factor data is: time t1, t2, t3, t4, t5, and the corresponding time offset factors are 1ms, 2ms, 3ms, 5ms, 7ms. Divide the data into two segments, [t_1, t_3] and [t_3, t_5]. In the first segment, linear regression is performed to obtain a segment slope of 1ms / unit time, a segment intercept of 0ms, and a segment residual of 0ms. In the second segment, the segment slope is 1ms / unit time, the segment intercept is 2ms, and the segment residual is 0ms. Statistical analysis is performed on the segment slopes, and the slope mean is 1ms / unit time, and the slope variance is 0ms² / unit time². Using the slope mean, adjust the segment intercept of the second segment to make it consistent with the first segment, and the adjusted intercept is 0ms. Since the slope variance is zero, there is no need to correct the segment residual. Finally, a unified time offset trend curve is obtained.
[0067] A time migration trend curve is constructed according to the adjusted intercept and the corrected residual, and a curve fitting is performed on the time migration trend curve using a Fourier series fitting algorithm to obtain Fourier coefficients and fitting residuals.
[0068] By using the Fourier series fitting algorithm, the adjusted time offset trend curve is subjected to spectrum analysis to extract the periodic characteristics of the signal; specifically, first, the adjusted intercept and the corrected residual are used to reconstruct the complete time offset trend curve. Then, the Fourier series fitting algorithm is used to fit the time offset trend curve to decompose the time series signal into sine and cosine functions of different frequencies. Through fitting, a series of Fourier coefficients are obtained, including the DC component (average value), the amplitude and phase of the fundamental wave and each harmonic, which fully describe the spectral characteristics of the signal. At the same time, the fitting residual, that is, the difference between the original trend curve and the Fourier fitting curve, is calculated to evaluate the accuracy of the fitting.
[0069] For example, for a time-shifted trend curve , using Fourier series expansion, we get: in, is the DC component, and are the Fourier coefficients, is the basic angular frequency. Through calculation, we get the Fourier coefficients, for example, , , , , Etc. The fitting residual can be obtained by calculating the difference between the original curve and the fitting curve at each time point. If the residual is small, it indicates that the fitting effect is good.
[0070] The Fourier coefficients are low-pass filtered to obtain the filtered coefficients, the fitting residuals are smoothed to obtain the smoothed residuals, the filtered coefficients and the smoothed residuals are combined to obtain the time offset reference, the time offset reference is input into a preset time offset error calculation model to calculate the time offset error.
[0071] By filtering and smoothing the Fourier coefficients and fitting residuals, high-frequency noise and random errors are eliminated to obtain an accurate time offset benchmark; specifically, first, a low-pass filter is used for the Fourier coefficients to filter out high-frequency components, and only low-frequency components that have a significant impact on the time offset trend are retained. This step can eliminate high-frequency noise and interference and extract the main features of the signal. Then, a smoothing method, such as a moving average method or an exponential smoothing method, is applied to the fitting residuals to reduce the impact of random errors and fluctuations on the results. The filtered Fourier coefficients are recombined to construct a filtered time offset trend curve. The smoothed residuals are superimposed on the filtered trend curve to obtain the final time offset benchmark. Finally, the time offset benchmark is input into the preset time offset error calculation model, and the time offset error is accurately calculated in combination with the model parameters and algorithms for subsequent time synchronization adjustment.
[0072] For example, for Fourier coefficients, keep the coefficients below a certain frequency threshold, assuming that only keep , , , the coefficients after filtering are , , . Use the filtered coefficients to reconstruct the time offset trend curve . For the fitted residuals , the five-point moving average method is used for smoothing, and the smoothed residual is obtained . Adding the two together gives the time offset reference: Will Enter the time offset error calculation model. For example, the error calculation model is: in, is the actual measured time offset value. By calculation, the time offset error is obtained , providing an accurate basis for adjusting the target end clock.
[0073] In step S400, a Kalman filter is used to jointly filter the time offset error and the stability factor to obtain a filtered dynamic correction factor, and a dynamic adaptive window algorithm is used to optimize the parameters of the dynamic correction factor to generate a stability correction value.
[0074] By applying the Kalman filter, the time offset error and stability factor are jointly filtered, the information of the two is integrated, the noise and uncertainty are eliminated, and a more accurate dynamic correction factor after filtering is obtained; specifically, first, the state space model of the time offset error and the stability factor is established, the time offset error is regarded as the state variable of the system, the stability factor is used as the observation, the covariance matrix of the process noise and the measurement noise is introduced, and the initial parameters of the Kalman filter are constructed. Then, the time offset error is estimated and corrected by using the prediction and update steps of the Kalman filter, the influence of random jitter and noise is eliminated, and the dynamic correction factor after filtering is obtained. Then, the dynamic adaptive window algorithm is used to dynamically adjust the window size according to the changing trend of the dynamic correction factor, optimize the parameters of the dynamic correction factor, balance the sensitivity and stability of the filter, generate the stability correction value, and further improve the accuracy of time synchronization.
[0075] For example, suppose that during the time synchronization process, a series of time offset errors are measured , the corresponding stability factor is . First, establish the state space model: Equation of state: Observation equation: in, is the time offset error, is the stability factor, and are process noise and measurement noise respectively, assuming that they obey zero-mean Gaussian distribution, and the covariance matrices are Q and R. Set the initial state estimate and covariance matrix, apply the Kalman filter for iterative calculation, and obtain the dynamic correction factor after filtering, such as [0.105ms, 0.118ms, 0.143ms, 0.136ms, 0.132ms]. Then, the dynamic adaptive window algorithm is used to adjust the window size according to the change amplitude of the dynamic correction factor, such as increasing the window when the change is stable and reducing the window when the change is drastic, optimize the filtering parameters, and finally generate the stability correction value.
[0076] The jitter correction value is subjected to fast Fourier transform to extract the frequency domain characteristics. The frequency domain characteristics and the stability correction value are fused based on the convolution-based dynamic characteristic fusion algorithm to generate the network dynamic delay factor. The network dynamic delay factor and the stability correction value are summed up by matrix weighted summation to obtain the network delay value.
[0077] By performing frequency domain analysis on the jitter correction value, extracting its frequency components, combining it with the stability correction value, and using the dynamic characteristic fusion algorithm of convolution, the two are fused in the frequency domain to generate the network dynamic delay factor; specifically, first, apply the fast Fourier transform (FFT) to the jitter correction value sequence, convert the time domain signal into the frequency domain signal, obtain the amplitude spectrum and phase spectrum, extract the main frequency components, and analyze the frequency characteristics of the jitter. Then, using the dynamic characteristic fusion algorithm based on convolution, the jitter frequency domain characteristics are convolved with the stability correction value to achieve frequency domain fusion of the signal, emphasize the common frequency components, suppress noise and irrelevant information, and obtain the network dynamic delay factor. Next, construct a weight matrix, perform matrix weighted summation on the network dynamic delay factor and the stability correction value, comprehensively consider the impact of the two on the network delay, and obtain the final network delay value for accurate delay compensation.
[0078] For example, the jitter correction value sequence is 0.02ms, 0.03ms, −0.01ms, −0.02ms, 0.01ms. Perform FFT on it and get the frequency component: , the corresponding amplitude spectrum: The stability correction value is The amplitude spectrum is combined with the stability correction using a convolution operation, for example, to calculate: What you get This is the frequency domain representation of the network dynamic delay factor. Then, set the weighting matrix ,For example, , . Perform weighted summation of the network dynamic delay factor and stability correction value to calculate the network delay value After calculation, the network delay value is obtained, which is used for subsequent time synchronization adjustment.
[0079] In step S500, the network delay value and the timestamp of the target end are corrected by nonlinear least square method to obtain a time correction factor, and the time correction factor is linearly interpolated to obtain a corrected timestamp of the target end.
[0080] By adopting the nonlinear least square method, the relationship model between the network delay value and the target end timestamp is fitted, and the time correction factor is solved to correct the target end timestamp; specifically, firstly, a nonlinear relationship equation between the network delay value and the target end timestamp is established, for example, assuming that the relationship is ,in is the nonlinear function to be determined, Then, the nonlinear least squares method is used to minimize the residual sum of squares between the model prediction value and the actual observation value, using the measured network delay value and the corresponding target end timestamp as the data set, to solve the parameter , and obtain the time correction factor Next, the time correction factor is linearly interpolated to make it smoothly transition in the target end timestamp sequence, avoiding mutations caused by uneven sampling intervals, and obtaining the corrected target end timestamp, thereby improving the accuracy and stability of time synchronization.
[0081] The corrected timestamp of the target end is compared with the timestamp of the source end to generate a synchronization deviation parameter, and the local clock frequency of the target end is fine-tuned using the synchronization deviation parameter to obtain a frequency adjustment value, which is applied to the local clock reference of the target end to complete the time reference adjustment.
[0082] By accurately comparing the corrected target timestamp with the source timestamp, calculating the time difference between the two, and generating a synchronization deviation parameter, the frequency of the local clock of the target end is adjusted to achieve the purpose of accurate synchronization; specifically, first, obtain the corrected target timestamp and the corresponding source timestamp , calculate the synchronization deviation parameter Then, according to the synchronization deviation parameter, the frequency control algorithm is used to calculate the adjustment amount of the local clock frequency of the target end, that is, the frequency adjustment value This can be done by using a proportional-integral-derivative (PID) controller or other suitable control strategy to convert the time deviation into a frequency adjustment to eliminate the accumulated time error. Next, the calculated frequency adjustment value is The local clock reference applied to the target end adjusts the frequency of the clock oscillator so that the target end clock running speed is synchronized with the source end clock, thereby completing the adjustment of the time reference and meeting the requirements of high-precision time synchronization.
[0083] For example, suppose the corrected target timestamp is Seconds, the source timestamp is seconds, the synchronization deviation parameter is seconds. Assume that the local clock frequency of the target end is . Use the synchronization deviation parameter according to the frequency adjustment formula: in, is the update time interval, for example 1 second. Substitute the value to get the frequency adjustment value: Will The frequency adjustment value is applied to the local clock reference of the target end, adjusting the clock frequency from 20MHz to 19,999,940Hz. By fine-tuning the clock frequency, the target end clock will gradually correct the time deviation and keep in sync with the source end clock.
[0084] In this embodiment, the Kalman filter is used to jointly filter the time offset error and the stability factor to eliminate noise and uncertainty, and obtain a more accurate dynamic correction factor; then, the dynamic adaptive window algorithm is used to optimize the parameters of the dynamic correction factor to generate a stability correction value, thereby improving the accuracy and stability of time synchronization. Next, the jitter correction value is subjected to a fast Fourier transform to extract its frequency domain characteristics, and the frequency domain characteristics are fused with the stability correction value using a dynamic characteristic fusion algorithm based on convolution to generate a network dynamic delay factor; then, a more accurate network delay value is obtained by performing matrix weighted summation on the network dynamic delay factor and the stability correction value. Subsequently, the nonlinear least squares method is used to correct the network delay value and the timestamp of the target end to obtain the time correction factor, and a linear interpolation process is performed on it to obtain the corrected target end timestamp to ensure a smooth transition and accuracy between timestamps. Finally, the corrected target end timestamp is compared with the source end timestamp to generate a synchronization deviation parameter, which is used to fine-tune the local clock frequency of the target end to obtain a frequency adjustment value, which is applied to the local clock reference of the target end to achieve high-precision time reference adjustment, thereby effectively completing the time synchronization between the target end and the source end. This embodiment comprehensively uses advanced filtering algorithms, frequency domain analysis, and clock frequency adjustment technology to overcome the influence of network delay and jitter, achieve high-precision and stable time synchronization in a complex network environment, and improve the reliability and synchronization performance of the system.
[0085] Embodiment 3: like Figure 2 As shown, the present application also provides a time-sensitive network end-to-end time synchronization device 10, including an acquisition module 11, a classification module 12, a correction module 13, a processing module 14 and an adjustment module 15.
[0086] The acquisition module 11 is mainly used to obtain the timestamp of the source end, calibrate the time synchronization signal according to the timestamp of the source end to obtain the calibrated time synchronization signal, and use the calibrated time synchronization signal to collect the time of the target end to obtain the timestamp of the target end.
[0087] The classification module 12 is mainly used to input the timestamp of the source end and the timestamp of the target end into a preset delay analysis model to obtain a delay factor set, and classify the delay factor set to obtain a time offset factor, a jitter factor and a stability factor.
[0088] The correction module 13 is mainly used to perform time domain analysis on the time offset factor to obtain a time offset reference and a time offset error, and to correct the jitter factor using the time offset reference to obtain a jitter correction value.
[0089] The processing module 14 is mainly used to filter the time offset error and the stability factor to obtain a stability correction value, and to combine the jitter correction value and the stability correction value to obtain a network delay value.
[0090] The adjustment module 15 is mainly used to correct the timestamp of the target end based on the network delay value and the local clock information of the source and target ends to obtain the corrected timestamp of the target end, and adjust the local clock of the target end according to the corrected timestamp of the target end and the timestamp of the source end.
[0091] In this embodiment, the acquisition module 11 accurately acquires the timestamps of the source and target ends, and uses the timestamp of the source end to calibrate the time synchronization signal, thereby ensuring the accuracy of the synchronization signal and collecting the timestamp of the target end. The classification module 12 inputs the timestamps of the source and target ends into the preset delay analysis model to obtain a set of delay factors, and performs classification processing on them, extracts the time offset factor, the jitter factor and the stability factor, and deeply analyzes the composition of the network delay. The correction module 13 performs time domain analysis on the time offset factor to obtain the time offset reference and the time offset error, and uses the time offset reference to correct the jitter factor to obtain the jitter correction value, thereby eliminating the jitter error caused by the time offset. The processing module 14 performs filtering processing on the time offset error and the stability factor to obtain the stability correction value, and performs a combined operation on the jitter correction value and the stability correction value to obtain the network delay value, thereby effectively integrating various delay factors. The adjustment module 15 corrects the timestamp of the target end based on the network delay value and in combination with the local clock information of the source and target ends to obtain the corrected timestamp of the target end. Subsequently, the local clock of the target end is adjusted according to the corrected target end timestamp and the source end timestamp, thereby achieving accurate calibration of the target end clock.
[0092] It should be noted that technical personnel in the relevant technical field can clearly understand that for the convenience and conciseness of description, the specific working process of the above-described device and each module can refer to the corresponding process in the aforementioned time-sensitive network end-to-end time synchronization method embodiment, and will not be repeated here.
[0093] Embodiment 4: The present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the processor executes the time-sensitive network end-to-end time synchronization method as in Embodiment 1.
[0094] In this embodiment, by storing the time synchronization method in the form of a software program on a computer-readable storage medium, it has good portability and maintainability. When the processor runs the program, it can implement a series of steps such as timestamp acquisition, delay analysis, offset correction, filtering, delay calculation, and local clock adjustment, thereby achieving high-precision time synchronization between the target end and the source end. Through this design, the system can complete the complex time synchronization process without additional hardware support, reducing the implementation cost. At the same time, by using software updates, the synchronization algorithm can be easily upgraded and optimized to improve the adaptability and performance of the system. The solution of this embodiment enhances the flexibility of the time synchronization method, so that it can be applied to different hardware platforms and network environments, meet the needs of various time-sensitive applications for precise time synchronization, and effectively improve the overall performance and reliability of the time-sensitive network.
[0095] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A time-sensitive network end-to-end time synchronization method, characterized in that: include: Obtaining a timestamp of a source end, calibrating a time synchronization signal according to the timestamp of the source end to obtain a calibrated time synchronization signal, and using the calibrated time synchronization signal to collect the time of a target end to obtain a timestamp of the target end; Inputting the timestamp of the source end and the timestamp of the target end into a preset delay analysis model to obtain a delay factor set, and classifying the delay factor set to obtain a time offset factor, a jitter factor, and a stability factor; Performing time domain analysis on the time offset factor to obtain a time offset reference and a time offset error, and correcting the jitter factor using the time offset reference to obtain a jitter correction value; Filtering the time offset error and the stability factor to obtain a stability correction value, and combining the jitter correction value and the stability correction value to obtain a network delay value; Based on the network delay value and in combination with the local clock information of the source and target ends, the timestamp of the target end is corrected to obtain a corrected timestamp of the target end, and the local clock of the target end is adjusted according to the corrected timestamp of the target end and the timestamp of the source end.
2. The time-sensitive network end-to-end time synchronization method according to claim 1, characterized in that: The step of obtaining the timestamp of the source end, calibrating the time synchronization signal according to the timestamp of the source end to obtain the calibrated time synchronization signal, and collecting the time of the target end using the calibrated time synchronization signal to obtain the timestamp of the target end includes: After receiving a signal that requires time synchronization between the source and target ends, the timestamp of the source end is obtained, and the timestamp of the source end is identified and verified using a timestamp matching algorithm to obtain a valid timestamp; The effective timestamp and the clock deviation parameter of the target end are compared by using a dynamic time normalization algorithm to generate a calibration factor and a residual error value, the time synchronization signal is time-adjusted by using the calibration factor to obtain an adjusted time synchronization signal, and the adjusted time synchronization signal is calibrated by using the residual error value to obtain a calibrated time synchronization signal; wherein the clock deviation parameters include frequency deviation and phase deviation; The time of the target end is collected according to the calibrated time synchronization signal to obtain a timestamp of the target end.
3. The time-sensitive network end-to-end time synchronization method according to claim 1, characterized in that: The step of inputting the timestamp of the source end and the timestamp of the target end into a preset delay analysis model to obtain a delay factor set, and classifying the delay factor set to obtain a time offset factor, a jitter factor, and a stability factor includes: Inputting the timestamp of the source end and the timestamp of the target end into a preset delay analysis model to calculate the time series difference to obtain a preliminary delay data set, and performing frequency domain decomposition of the preliminary delay data set by discrete Fourier transform to extract stable components and dynamic components; Based on the dynamic component, the time variation trend is calculated to obtain the time offset factor. The stable component is subjected to multi-order statistical analysis using the autoregressive analysis method to obtain the jitter factor and the noise intensity parameter. The noise intensity parameter is subjected to low-pass filtering through an FIR filter to generate a stability factor.
4. The time-sensitive network end-to-end time synchronization method according to claim 1, characterized in that: The step of performing time domain analysis on the time offset factor to obtain a time offset reference and a time offset error, and correcting the jitter factor using the time offset reference to obtain a jitter correction value comprises: A time shift trend curve is constructed based on the time shift factor using a piecewise linear regression method, the time shift trend curve is segmented and analyzed using a curve fitting algorithm to generate a time shift benchmark, and a time shift error is calculated based on the time shift benchmark; The jitter factors are classified and processed by using the time offset reference and applying fuzzy logic rules to generate jitter values. The jitter values are segmentally optimized by using a wavelet packet algorithm, and jitter correction values are generated based on the optimization results.
5. The time-sensitive network end-to-end time synchronization method according to claim 4, characterized in that: The step of constructing a time shift trend curve based on the time shift factor by using a piecewise linear regression method, segmenting and analyzing the time shift trend curve by using a curve fitting algorithm to generate a time shift benchmark, and calculating the time shift error according to the time shift benchmark includes: The time offset factor is divided into a plurality of linear segments by piecewise linear regression to obtain the segment slope, segment intercept and segment residual of each linear segment, the segment slope is statistically analyzed to obtain the slope mean and slope variance, the segment intercept is adjusted by using the slope mean to obtain the adjusted intercept, and the segment residual is corrected by using the slope variance to obtain the corrected residual; Constructing a time offset trend curve according to the adjusted intercept and the corrected residual, and performing curve fitting on the time offset trend curve by a Fourier series fitting algorithm to obtain Fourier coefficients and fitting residuals; The Fourier coefficients are low-pass filtered to obtain filtered coefficients, the fitting residuals are smoothed to obtain smoothed residuals, the filtered coefficients and the smoothed residuals are combined to obtain a time offset reference, the time offset reference is input into a preset time offset error calculation model to calculate the time offset error.
6. The time-sensitive network end-to-end time synchronization method according to claim 1, characterized in that: The step of filtering the time offset error and the stability factor to obtain a stability correction value, and combining the jitter correction value and the stability correction value to obtain a network delay value comprises: Using a Kalman filter to jointly filter the time offset error and the stability factor to obtain a filtered dynamic correction factor, and using a dynamic adaptive window algorithm to perform parameter optimization on the dynamic correction factor to generate a stability correction value; The jitter correction value is subjected to fast Fourier transform to extract frequency domain characteristics, the frequency domain characteristics are fused with the stability correction value based on a convolution-based dynamic characteristic fusion algorithm to generate a network dynamic delay factor, and matrix weighted summation is performed on the network dynamic delay factor and the stability correction value to obtain a network delay value.
7. The time-sensitive network end-to-end time synchronization method according to claim 1, characterized in that: The step of correcting the timestamp of the target end based on the network delay value and combining the local clock information of the source end and the target end to obtain a corrected timestamp of the target end, and adjusting the local clock of the target end according to the corrected timestamp of the target end and the timestamp of the source end includes: Correcting the network delay value and the timestamp of the target end by a nonlinear least square method to obtain a time correction factor, and performing linear interpolation processing on the time correction factor to obtain a corrected timestamp of the target end; The corrected timestamp of the target end is compared with the timestamp of the source end to generate a synchronization deviation parameter, the local clock frequency of the target end is fine-tuned using the synchronization deviation parameter to obtain a frequency adjustment value, and the frequency adjustment value is applied to the local clock reference of the target end to complete the time reference adjustment.
8. A time-sensitive network end-to-end time synchronization device, characterized in that: include: An acquisition module is used to acquire a timestamp of a source end, calibrate a time synchronization signal according to the timestamp of the source end to obtain a calibrated time synchronization signal, and collect the time of a target end using the calibrated time synchronization signal to obtain a timestamp of the target end; A classification module, used for inputting the timestamp of the source end and the timestamp of the target end into a preset delay analysis model to obtain a delay factor set, and classifying the delay factor set to obtain a time offset factor, a jitter factor and a stability factor; A correction module, used for performing time domain analysis on the time offset factor to obtain a time offset reference and a time offset error, and correcting the jitter factor using the time offset reference to obtain a jitter correction value; A processing module, configured to filter the time offset error and the stability factor to obtain a stability correction value, and perform a combined operation on the jitter correction value and the stability correction value to obtain a network delay value; The adjustment module is used to correct the timestamp of the target end based on the network delay value and the local clock information of the source end and the target end to obtain a corrected timestamp of the target end, and adjust the local clock of the target end according to the corrected timestamp of the target end and the timestamp of the source end.
9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the processor is enabled to execute the time-sensitive network end-to-end time synchronization method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Time-sensitive network end-to-end time sequence synchronization method based on Kalman filtering
CN117856956A
Apparatus and method for synchronizating time
KR1020150027645A
Time synchronization using model correction
US11849016B1
Error adjustment method and system for time synchronization
WO2021190080A1
Clock synchronization method and device
WO2024179231A1
Cited By
Time calibration precision test method and system based on bidirectional timestamp statistical analysis
CN120295086A
Data stream analysis method based on TCP timestamp detection
CN120342784A
A data flow analysis method based on TCP timestamp detection
CN120342784B
Remote control method and system for intelligent traditional Chinese medicine water purification equipment
CN120416305A
Jitter test method and device, equipment, storage medium and computer program product
CN120546834A