CN109976442A - One kind is from clock information optimization method, device, electronic equipment and storage medium - Google Patents

One kind is from clock information optimization method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN109976442A
CN109976442A CN201910364232.8A CN201910364232A CN109976442A CN 109976442 A CN109976442 A CN 109976442A CN 201910364232 A CN201910364232 A CN 201910364232A CN 109976442 A CN109976442 A CN 109976442A
Authority
CN
China
Prior art keywords
information
clock information
clock
indicates
master
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910364232.8A
Other languages
Chinese (zh)
Other versions
CN109976442B (en
Inventor
余建国
单飞龙
王志方
李凯乐
马洁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing University of Posts and Telecommunications
Original Assignee
Beijing University of Posts and Telecommunications
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing University of Posts and Telecommunications filed Critical Beijing University of Posts and Telecommunications
Priority to CN201910364232.8A priority Critical patent/CN109976442B/en
Publication of CN109976442A publication Critical patent/CN109976442A/en
Application granted granted Critical
Publication of CN109976442B publication Critical patent/CN109976442B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/04Generating or distributing clock signals or signals derived directly therefrom
    • G06F1/12Synchronisation of different clock signals provided by a plurality of clock generators

Abstract

The present invention provides one kind from clock information optimization method, device, electronic equipment and storage medium, and method includes: step A, obtains master clock information;Master clock information is handled by synovial membrane controller, obtains the first information by step B;Interference treated the first information is handled by controlled device function, obtains the second information by step C;Step D will add and make an uproar that treated the second information be handled by Kalman filter, obtains from clock information;Step E, judges whether master clock information and the deviation from clock information meet preset condition;Step F, when master clock information and the deviation from clock information are unsatisfactory for preset condition, master clock information and the deviation from clock information are input to synovial membrane controller, execute step B- step E, until obtaining target from clock information when master clock information and the deviation from clock information meet preset condition.Present invention reduces master-salve clock deviation, realize that more accurately master-salve clock is synchronous.

Description

One kind is from clock information optimization method, device, electronic equipment and storage medium
Technical field
The present invention relates to field of communication technology, more particularly to one kind from clock information optimization method, device, electronic equipment And storage medium.
Background technique
In 2008, IEEE (Institute of Electrical and Electronics Engineers, the U.S. Institute of Electrical and Electric Engineers) agreement organizations propose IEEE1588V2 precise time transportation protocol, and which may be implemented The master-salve clock of submicrosecond class precision is synchronous, becomes the most popular Time Transmission agreement of industry.
The method that the prior art uses 1588 protocol realization master-salve clocks synchronous is by quickly handing over from clock with master clock Change message, acquisition time stamp;The relative difference for calculating the value of adjacent sync cycle time stamp, using the difference as opposite from clock In the drift value of master clock frequency, adjusted by the drift value from clock, to realize master-salve clock Frequency Synchronization.
Inventors have found that in the existing method synchronous using 1588 protocol realization master-salve clocks, the stability of clock crystal oscillator Seriously affect 1588 clock synchronization accuracy of IEEE.When crystal oscillator is in the environment of higher temperature, the stability of crystal oscillator will be big Amplitude reduction is mainly shown as from clock crystal oscillator oscillation frequency and biggish frequency drift occurs.If not to this frequency drift It is timely corrected, over time, master-salve clock deviation can be increasing.Therefore, how to reduce master-salve clock inclined Difference, and then realize that more accurately master-salve clock synchronization is still a technical problem to be solved urgently.
Summary of the invention
Being designed to provide for the embodiment of the present invention is a kind of from clock information optimization method, device, electronic equipment and storage Medium reduces master-salve clock deviation to realize, and then realizes that more accurately master-salve clock is synchronous.Specific technical solution is as follows:
In a first aspect, the embodiment of the invention discloses one kind from clock information optimization method, which comprises
Step A obtains master clock information;
The master clock information is handled by synovial membrane controller, obtains the first information by step B;
Step C carries out interference processing to the first information, and will interference treated the first information by controlled Object function is handled, and the second information is obtained;The controlled device function is that the master clock information is corresponding to be believed from clock The function that the function expression of breath is obtained by Laplace transform and discretization;
Step D is carried out plus is made an uproar processing to second information, and will be added and be made an uproar that treated second information passes through karr Graceful filter is handled, and is obtained from clock information;
Step E, judges whether the master clock information and the deviation from clock information meet preset condition;
Step F, when the master clock information and it is described be unsatisfactory for the preset condition from the deviation of clock information when, by institute State master clock information and it is described be input to the synovial membrane controller from the deviation of clock information, step B- step E is executed, until institute It states master clock information and described when meeting preset condition from the deviation of clock information, obtains target from clock information.
Optionally, described to handle the master clock information by synovial membrane controller, obtain the first information, comprising:
The master clock information input to synovial membrane controller is obtained by the first formula of the synovial membrane controller One median;
By the second formula of the synovial membrane controller, the second median is obtained;
By first median and second median, third median is obtained;
The third formula that the third median is inputted to the synovial membrane controller obtains first by the third formula Information.
Optionally, described that interference processing carried out to the first information, and will interference treated the first information warp It crosses controlled device function to be handled, obtains the second information, comprising:
Default interference information is added to the first information, obtains interference treated the first information;
Interference treated the first information is handled by controlled device function, obtains the second information;Wherein, The controlled device function representation are as follows:
X (k)=Ax (k-1)+B (u (k)+ω (k))
Y (k)=Cx (k)
Wherein, x (k) indicates the state variable at current time;The state variable of x (k-1) expression last moment;U (k) is indicated The first information;ω (k) indicates process noise;A indicates sytem matrix;B indicates input matrix;C indicates output matrix;y(k) Indicate second information.
Optionally, described that second information is carried out plus made an uproar processing, and will add and make an uproar that treated second information is led to It crosses Kalman filter to be handled, obtain from clock information, comprising:
By preset formula, carry out plus make an uproar to second information processing;The preset formula indicates are as follows:
yv(k)=y (k)+v (k)
Wherein, yv(k) it indicates plus second information of making an uproar that treated;Y (k) indicates second information;V (k) is indicated Measure noise;
To add and make an uproar that treated second information is calculated by the default equation group of Kalman filter, obtain from Clock information.
Second aspect, the embodiment of the invention discloses one kind to optimize device from clock information, and described device includes:
Master clock data obtaining module, for obtaining master clock information;
First information determining module obtains first for handling the master clock information by synovial membrane controller Information;
Second information determination module, for carrying out interference processing to the first information, and will interference that treated is described The first information is handled by controlled device function, obtains the second information;The controlled device function is master clock letter Cease the corresponding function obtained from the function expression of clock information by Laplace transform and discretization;
From clock information determining module, for processing that second information is carried out plus made an uproar, and the institute that makes an uproar that treated will be added It states the second information to be handled by Kalman filter, obtain from clock information;
Master-salve clock deviation judgment module, for judging whether are the master clock information and the deviation from clock information Meet preset condition;
Target is from clock information determining module, for described being discontented with when the master clock information and from the deviation of clock information Foot the preset condition when, by the master clock information and it is described be input to the synovial membrane controller from the deviation of clock information, The first information determining module is returned to continue to execute, until the master clock information and it is described from the deviation of clock information satisfaction When preset condition, target is obtained from clock information.
Optionally, the first information determining module, comprising:
First median determines submodule, for passing through the cunning for the master clock information input to synovial membrane controller First formula of film controller, obtains the first median;
Second median determines submodule, for passing through the second formula of the synovial membrane controller, obtains the second median;
Third median determines submodule, for obtaining third by first median and second median Median;
The first information determines submodule, for the third median to be inputted to the third formula of the synovial membrane controller, The first information is obtained by the third formula.
Optionally, second information determination module, comprising:
Interference processing submodule obtains interference treated institute for adding default interference information to the first information State the first information;
Second information determines submodule, for the first information that will interfere that treated by the progress of controlled device function Processing, obtains the second information;Wherein, the controlled device function representation are as follows:
X (k)=Ax (k-1)+B (u (k)+ω (k))
Y (k)=Cx (k)
Wherein, x (k) indicates the state variable at current time;The state variable of x (k-1) expression last moment;U (k) is indicated The first information;ω (k) indicates process noise;A indicates sytem matrix;B indicates input matrix;C indicates output matrix;y(k) Indicate second information.
It is optionally, described from clock information determining module, comprising:
Add to make an uproar and handle submodule, for by preset formula, to carry out plus make an uproar to second information processing;The default public affairs Formula indicates are as follows:
yv(k)=y (k)+v (k)
Wherein, yv(k) it indicates plus second information of making an uproar that treated;Y (k) indicates second information;V (k) is indicated Measure noise;
Submodule is determined from clock information, makes an uproar that treated for that will add second information passes through Kalman filter Default equation group is calculated, and is obtained from clock information.
The third aspect, the embodiment of the invention discloses a kind of electronic equipment, including processor, communication interface, memory and Communication bus, wherein the processor, the communication interface, the memory are completed each other by the communication bus Communication;
The memory, for storing computer program;
The processor when for executing the program stored on the memory, is realized above-mentioned from clock information optimization Any method and step in method.
Fourth aspect, the embodiment of the invention discloses a kind of computer readable storage medium, the computer-readable storage Dielectric memory contains computer program, when the computer program is executed by processor, realizes above-mentioned from clock information optimization side Any method and step in method.
In one kind provided in an embodiment of the present invention from clock information optimization method, device, electronic equipment and storage medium, First with sliding mode controller to being handled from the deviation of clock information and master clock information, it can be achieved that master-salve clock crystal oscillator Frequency drift control effectively and optimizes, and is then handled using Kalman filter sliding mode controller output information, Effective inhibition on influencing from clock crystal oscillator shake and the external interferences such as random error can be achieved, so obtain from clock information with The deviation of master clock information meets the corresponding target of preset condition from clock information.The obtained target is reduced from clock information It drifts about from clock crystal oscillator oscillation frequency and from clock crystal oscillator shake and random error to the influence from clock information accuracy, into And master-salve clock deviation is effectively reduced, realize more accurately master-salve clock synchronization.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Fig. 1 is the Precision Time Protocol PTP delay response mechanism schematic diagram of the embodiment of the present invention;
Fig. 2 is a kind of from clock information optimization method flow chart of the embodiment of the present invention;
Fig. 3 is a kind of from clock information optimization system frame diagram of the embodiment of the present invention;
Fig. 4 is that a kind of use from clock information optimization method of the embodiment of the present invention adds Kalman filter and existing skill Kalman filter processing result simulation comparison figure is not adopted in art;
Fig. 5 is the emulation of synchronizing cycle that T=1s is used from clock information optimization method of the embodiment of the present application a kind of Result figure;
Fig. 6 is master-salve clock simulation result under different synchronizing cycles in a kind of master-salve clock information of the embodiment of the present invention Comparison diagram;
Fig. 7 is that a kind of of the embodiment of the present invention optimizes apparatus structure schematic diagram from clock information;
Fig. 8 is a kind of electronic equipment structural schematic diagram of the embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
In the time synchronization research of 1588 agreements, frequency drift, the frequency of principal and subordinate's timing tracking accuracy and clock crystal oscillator Shake, random error have a relationship, Kalman filter that the application uses and sliding mode controller come realize to from clock this Three factor controllings simultaneously optimize, to realize that principal and subordinate's time accuracy is synchronous.
Protocol time synchronization principles and influence factor, PTP (Precision Time Protocol, when accurate are introduced first Between agreement) precision clock synchronization principles, the delay response mechanism proposed is broadly divided into six steps.Shown in Figure 1 The Precision Time Protocol PTP delay response mechanism schematic diagram of inventive embodiments.In Fig. 1, a is sync sync message, and b is Follow_up follows message, and c is that Delay_req postpones request message, and d is Delay_resq delay request response message, Master is master clock, and Slave is from clock.The packet sending and receiving process of delay response synchronization mechanism is as follows:
The sending sync message of master clock cycle, and record the accurate sending time that sync message leaves master clock t1.Accurate sending time t1 is encapsulated into Follow_up message by master clock, is sent to from clock.It is reported from clock log sync Text reach from clock it is accurate when arrival time t2.Delay_req message is issued from clock and records accurate sending time t3.Master clock records the accurate arrival time t4 that delay_req message reaches master clock.Master clock, which issues, carries precise time The delay_resp message of stamp information t4 is given from clock.The time deviation of the mechanism master-salve clock is offset;Message is in network The average delay of middle transmission is delay;Assuming that the time delay of the transmission link of sync message is symmetrical available:
According to above-mentioned two formula, time deviation offset and average delay delay can be obtained respectively.
The high precision clock synchronous protocol of 1588 agreements be based on idealization situation, and real network measure and control In system, have many influence factors, for example, timestamp accuracy, transmission link asymmetry, network delay inherently shake, The factors such as the drift of master-salve clock crystal oscillator and shake.Realize that the high-precision master-salve clock of 1588 agreements is synchronous, what is be affected is Two factors of transmission link asymmetry and the drift of master-salve clock crystal oscillator and shake.In time deviation offset and average delay In the calculating of delay, just assumes that transmission link is symmetrical to message in a network, but can pass through in the transmission of real network The equipment such as interchanger will lead to message in the unequal problem in the path delay of time back and forth of transmission.The main research master-salve clock of application is brilliant The influence of vibration drift, therefore, herein according to general control variate method, it is assumed that the transmission link of message in a network is symmetrical 's.
One kind of the application is from clock information optimization method, when 1588 agreement based on sliding formwork control and Kalman filter Between synchronization the sliding mode controller of research hotspot at this stage, Kalman filter, 1588 agreements are effectively combined, from And realize the time synchronization of 1588 agreement higher precisions.What approximately linear caused by drifting about for master-salve clock crystal oscillator frequency increased Error, the application are realized using sliding formwork control to its effective control and optimization;And for clock frequency shake and external interference The random error Deng caused by, the application realize the filtering to noises such as random errors using Kalman filter, realize effective Inhibit.It is described in detail in specific method following embodiment.
In a first aspect, the embodiment of the invention discloses one kind from clock information optimization method, as shown in Figure 2.Fig. 2 is this hair One kind disclosed in bright embodiment includes: from clock information optimization method flow chart, method
S201 obtains master clock information.
In application, master clock information is set as a standard clock source, the time expressed by the clock is local crystal oscillator Oscillation frequency accumulated time.It is intrinsic that the oscillation frequency of crystal oscillator depends not only on material, corner cut, shape, aging of crystal oscillator etc. Characteristic, but also with its locating for external environment such as temperature, humidity, pressure etc. is related.Due to environment temperature, crystal oscillator self deterioration Etc. factors influence, crystal oscillator can generate certain error and accumulate at any time, so as to cause mistake is generated between clock and master clock Difference offset, seriously affects synchronization accuracy.The influence that the self deterioration of crystal oscillator generates the frequency drift of crystal oscillator is relatively slow, and ring Border temperature can generate crystal oscillator to be influenced in real time.
Master clock information is obtained in this step, which can be the specific time, or make by oneself for implementation personnel The initial value of justice.Master clock information is set as: M (t)=t.
Master clock information is handled by synovial membrane controller, obtains the first information by S202.
It is first by the synovial membrane controller based on exponentially approaching rule by master clock information input to synovial membrane controller in this step First the drift of clock crystal oscillator frequency is control effectively and optimized.The master clock information of input can be indicated with yd.
Optionally, master clock information is handled in S202 by synovial membrane controller, obtains the first information, comprising:
Step 1, master clock information input to synovial membrane controller is obtained first by the first formula of synovial membrane controller Median;
First formula of the synovial membrane controller indicates are as follows:
yd(k+1)=2yd(k)-yd(k-1)
Wherein, yd(k) correspond to the position command of synovial membrane controller current input information, input for the first time is master clock letter Cease corresponding position command;yd(k-1) position command corresponding to the last input information of synovial membrane controller, believes in master clock Implementing personnel when breath is the input for the first time of synovial membrane controller can be yd(k-1) initial value is set;yd(k+1) correspond to synovial membrane to control The position command for inputting information next time of device.
The first median y can be obtained by first formulad(k+1)。
Step 2, by the second formula of synovial membrane controller, the second median is obtained;
First formula of the synovial membrane controller indicates are as follows:
dyd(k+1)=2dyd(k)-dyd(k-1)
Wherein, dyd(k) change rate corresponding to the position command of synovial membrane controller current input information;dyd(k-1) corresponding In the change rate of the position command of the last input information of synovial membrane controller;dyd(k+1) corresponding to the next of synovial membrane controller The change rate of the position command of secondary input information.
The second median y can be obtained by second formulad(k+1)、dyd(k)。
Step 3, by the first median and the second median, third median is obtained.
Y is calculated in this stepd=[yd(k)dyd(k)]TAnd Yd1=[yd(k+1)dyd(k+1)]T, and switched Function s (k)=Ce(Yd-x)。
Step 4, by the third formula of third median input synovial membrane controller, the first information is obtained by third formula.
The third formula of the synovial membrane controller indicates are as follows:
U (k)=(CeB)-1(CeYd1-CeAx(k)-s(k)-ds(k))
Wherein, u (k) indicates the first information obtained by the sliding formwork control of exponentially approaching rule;CeIndicate synovial membrane controller Coefficient matrix meets Hurwitz condition, Ce=[c 1], c are constant and c > 0;B indicates input matrix;Yd1=[yd(k+1)dyd (k+1)]T;A indicates sytem matrix;X (k) indicates the information for being input to synovial membrane controller, is for the first time main clock information, after For from the deviation of clock information and master clock information;S (k) indicates switching function, s (k)=Ce(Yd-x);Ds (k)=- ε T ε gn (s (k))-qTs (k), ε indicate that T indicates the synchronizing cycle of message, and sgn () indicates that jump function, q indicate index term coefficient.
S203 carries out interference processing to the first information, and will interference treated that the first information passes through controlled device function It is handled, obtains the second information;Controlled device function is that main clock information is corresponding to pass through from the function expression of clock information Cross Laplace transform and function that discretization obtains.
The controlled device function of this step is the process for causing output to change by state and input, passes through controlled device function The information that synovial membrane controller exports is optimized into processing, obtains the second information.
The transmission function of controlled device is by carrying out Laplace transform then and discretization from the function expression of clock information It obtains.
From the function expression of clock information are as follows:
Wherein,To be affected by temperature the frequency shift (FS) rate from clock signal, u (t) is the random error generated.
The controlled of sliding mode controller system then can be obtained by Laplace transform is carried out from the function expression of clock information Target transfer function,
Wherein, s, S2It indicates through the variable after Laplace transform;Discrete sampling is carried out according to above-mentioned formula, such as is adopted It is 0.001s with sample time Ts, by the discrete controlled device function for the application of above-mentioned formula.
Optionally, interference processing carried out to the first information in S203, and will interference treated the first information by controlled Object function is handled, and the second information is obtained, comprising:
Step a adds default interference information to the first information, obtains interference treated the first information.
In this step, default interference information w is added to the first information, then treated that the first information is represented by u for interference (k)=u (k)+wn (k).
Interference treated the first information is handled by controlled device function, obtains the second information by step b;Its In, controlled device function representation are as follows:
X (k)=Ax (k-1)+B (u (k)+ω (k))
Y (k)=Cx (k)
Wherein, x (k) indicates the state variable at current time;The state variable of x (k-1) expression last moment;U (k) is indicated The first information;ω (k) indicates process noise;A indicates sytem matrix;B indicates input matrix;C indicates output matrix;Y (k) is indicated Second information.
S204 is carried out plus is made an uproar processing to the second information, and will be added and be made an uproar that treated the second information passes through Kalman filter It is handled, obtains believing from clock.
This step is realized by Kalman filtering on the effective of the external interferences influence such as clock crystal oscillator shake and random error Inhibit.
Optionally, the second information is carried out plus is made an uproar processing in S204, and will added and make an uproar that treated the second information passes through karr Graceful filter is handled, and is obtained from clock information, comprising:
Step 1), by preset formula, carry out plus make an uproar to the second information processing;Preset formula indicates are as follows:
yv(k)=y (k)+v (k)
Wherein, yv(k) it indicates plus the second information of making an uproar that treated;Y (k) indicates the second information;V (k) indicates measurement noise.
Step 2) will add and make an uproar that treated the second information be calculated by the default equation group of Kalman filter, obtains To from clock information.
The default equation group of the Kalman filter indicates are as follows:
X (k)=Ax (k-1)+Mn(k)(yv(k)-CAx(k-1))
ye(k)=Cx (k)
Wherein, Mn(k) gain of hybrid cytokine or remnants is indicated;A indicates sytem matrix;The matrix of B expression input variable; C indicates output matrix;P (k) indicates Posterior estimator covariance;Indicate the intermediate computations of the prior estimate covariance at k moment As a result;R is indicated;P (k-1) is indicated;Q indicates procedure activation noise covariance;The current time of x (k) expression Kalman filter State equation;yv(k) it indicates plus the second information of making an uproar that treated;The last moment state side of x (k-1) expression Kalman filter Journey;ye(k) the slave clock information for indicating output, can be indicated in form with ye.
S205, judges whether master clock information and the deviation from clock information meet preset condition.
In the embodiment of the present invention, preset condition be level off to zero default value, specific value is by implementation personnel setting.This Judge whether be equal to or less than threshold value from the deviation of clock information and master clock information in step.As judge master clock yd-ye Difference whether be equal to or less than threshold value.Time of the meaning of the difference of yd-ye physically between upper master-salve clock is inclined Poor offset:
S206, when master clock information and the deviation from clock information are unsatisfactory for preset condition, by master clock information with from The deviation of clock information is input to synovial membrane controller, executes S202-S205, until master clock information and the deviation from clock information When meeting preset condition, target is obtained from clock information.
When the difference for judging yd-ye in above-mentioned S205 is greater than threshold value, the difference of yd-ye is controlled in the synovial membrane being input to Device continues to execute S202-S205, terminates when the difference of yd-ye is equal to or less than threshold value.Corresponding at this time it will believe from clock Breath, from clock information, illustrates to optimize frequency shift (FS) rate and random error at this time to the influence from clock accuracy as target, Target at this time is more accurate from clock information, and then it is synchronous accurately to realize master-salve clock.
It is provided in an embodiment of the present invention one kind from clock information optimization method, first with sliding mode controller to from when The deviation of clock information and master clock information handled, it can be achieved that master-salve clock crystal oscillator frequency drift control effectively with it is excellent Change, then using Kalman filter sliding mode controller output information is handled, it can be achieved that from clock crystal oscillator shake and Effective inhibition that the external interferences such as random error influence, and then obtain meeting from the deviation of clock information and master clock information default The corresponding target of condition is from clock information.The obtained target is reduced from clock information from clock crystal oscillator oscillation frequency drift motion And from clock crystal oscillator shake and random error to the influence from clock information accuracy, and then it is inclined to effectively reduce master-salve clock Difference realizes more accurately master-salve clock synchronization.
One kind in order to better illustrate the present invention, can be real just like the present invention shown in Fig. 3 from clock information optimization method Apply a kind of from clock information optimization system frame diagram of example.
In embodiments of the present invention, master clock information yd is input to synovial membrane controller first, passes through the synovial membrane controller It is handled, obtains the first information;The first information is added and controls interference w, and first information process after control interference will be added Controlled device function is handled, and the second information is obtained;It makes an uproar to measurement is added from controlled device function treated the second information The second information input after measuring noise v will be added to Kalman filter in sound v;Information is carried out by Kalman filter Processing, output are obtained from clock information ye;The difference for calculating yd-ye, judges whether the difference of yd-ye meets preset condition, when When the difference of yd-ye is unsatisfactory for preset condition, the difference of yd-ye is input to synovial membrane controller, repeats above-mentioned steps, directly To yd-ye difference preset condition when, using the value of ye at this time as target from clock information.
The advantages of simulink emulation illustrates the embodiment of the present invention can be used below.
For a kind of from clock information optimization method, settable sytem matrix of the applicationInput square Battle arrayInput matrix C=[1 0];Transmission matrix D=0;White noise signal ω (k) is [- 0.80.8];White noise Signal v (k) is [- 0.001 0.001], procedure activation noise covariance Q=10 in Kalman filter;Observe noise covariance R=10;In synovial membrane controller, coefficient matrix CeIn constant c=25;Approach rate ε=130 of diverter surface;Index term coefficient q =280;It is 0.000001s that initial master clock information and the deviation from clock information, which is arranged,;Master clock information is believed with from clock The deviation threshold of breath is 10us;Master clock information and the deviation offset from clock information are added into Kalman filter and non-added-time The result of Kalman filter compares, this, which compares figure, can be found in Fig. 4.Fig. 4 is that a kind of of the embodiment of the present invention believes from clock It is used in breath optimization method and adds Kalman filter and do not adopt Kalman filter processing result simulation comparison figure in the prior art. Offset1 indicates the application plus Kalman filter as a result, offset2 indicates that the prior art does not add Kalman to filter in Fig. 4 Wave device is result under natural conditions.
As can be known from Fig. 4, when not synchronizing master-salve clock, the approximately linear growth of time deviation, and along with Small shake, but into after crossing Kalman filter filtering, curve obviously becomes smooth, shakes more small, the time The shake of deviation is significantly inhibited.It can be seen that the application is using Kalman filter to the principal and subordinate for improving 1588 agreements Timing tracking accuracy has certain effect.
It, can by a kind of result figure from clock information optimization method of the application when using the synchronizing cycle of T=1s Referring to Fig. 5.Fig. 5 is the emulation of synchronizing cycle that T=1s is used from clock information optimization method of the embodiment of the present application a kind of Result figure.
As can be known from Fig. 5, Kalman filter and sliding mode controller are passed through in the slave clock information optimization method of the application Processing, principal and subordinate's time deviation offset not only by clock frequency drift about caused by approximately linear increase part obtain effectively Inhibit and optimize, and the random error caused by shaking from clock frequency is also well controlled, so that offset is in 5s It inside rapidly converges near a minimum, curve becomes more smooth, and keeps significantly stable.Thus may be used See, in the slave clock information optimization method of the application, is realized by sliding mode controller and Kalman filter to 1588 agreements The scheme that principal and subordinate's timing tracking accuracy improves has very big practicability and feasibility.
The master-salve clock information of three kinds of different synchronizing cycles (T1=0.1s, T2=0.5s, T3=1.0s) is used into this Shen Slave clock information optimization method please is handled, and result shown in fig. 6 can be obtained and compare figure.Fig. 6 is the embodiment of the present invention Master-salve clock simulation result comparison diagram under different synchronizing cycles in a kind of master-salve clock information.
As can be known from Fig. 6, as T3=1s synchronizing cycle, the fast convergence about in 5s;As T2=0.5s, about exist Fast convergence in 3s;As T1=0.1s, the fast convergence about in 2s.That is, continuous with message synchronizing cycle Reduce, principal and subordinate's time deviation is convergent faster, while the precision of time synchronization is also higher.The slave clock information optimization side of the application Method, based on Kalman filter and sliding mode controller to the signal of different synchronizing cycles can Effective Regulation from clock rate, So that it is quickly followed master clock, reach better timing tracking accuracy, to realize that 1588 agreement difference master-salve clocks are synchronous The control and optimization in period, improve the precision of time synchronization, so that meeting 5G (5G network, the 5th third generation mobile communication network) Requirement to time synchronization nanosecond.
Second aspect, the embodiment of the invention discloses one kind to optimize device from clock information, reference can be made to Fig. 7.Fig. 7 is this hair The a kind of of bright embodiment optimizes apparatus structure schematic diagram from clock information, and device includes:
Master clock data obtaining module 701, for obtaining master clock information;
First information determining module 702 obtains the first letter for handling master clock information by synovial membrane controller Breath;
Second information determination module 703, for carrying out interference processing to the first information, and will interference treated the first letter Breath is handled by controlled device function, obtains the second information;Controlled device function is that main clock information is corresponding from clock The function that the function expression of information is obtained by Laplace transform and discretization;
From clock information determining module 704, for processing that the second information is carried out plus made an uproar, and it will add and make an uproar that treated second Information is handled by Kalman filter, is obtained from clock information;
Whether master-salve clock deviation judgment module 705, the deviation for judging master clock information and from clock information meet Preset condition;
Target is unsatisfactory for pre- from clock information determining module 706 for the deviation when master clock information and from clock information If when conditions, master clock information and the deviation from clock information being input to synovial membrane controller, return to first information determining module It continues to execute, until obtaining target from clock information when master clock information and the deviation from clock information meet preset condition.
Optionally, of the invention from a kind of embodiment of clock information optimization device, first information determining module 702, comprising:
First median determines submodule, for passing through synovial membrane controller for master clock information input to synovial membrane controller The first formula, obtain the first median;
Second median determines submodule, for passing through the second formula of synovial membrane controller, obtains the second median;
Third median determines submodule, for obtaining third median by the first median and the second median;
The first information determines submodule, for passing through third for the third formula of third median input synovial membrane controller Formula obtains the first information.
Optionally, of the invention from a kind of embodiment of clock information optimization device, the second information determination module 703, comprising:
Interference processing submodule obtains interference treated the first letter for adding default interference information to the first information Breath;
Second information determines submodule, for the first information that will interfere that treated by controlled device function Reason, obtains the second information;Wherein, controlled device function representation are as follows:
X (k)=Ax (k-1)+B (u (k)+ω (k))
Y (k)=Cx (k)
Wherein, x (k) indicates the state variable at current time;The state variable of x (k-1) expression last moment;U (k) is indicated The first information;ω (k) indicates process noise;A indicates sytem matrix;B indicates input matrix;C indicates output matrix;Y (k) is indicated Second information.
Optionally, of the invention from a kind of embodiment of clock information optimization device, from clock information determining module 704, comprising:
Add to make an uproar and handle submodule, for by preset formula, to carry out plus make an uproar to the second information processing;Preset formula indicates Are as follows:
yv(k)=y (k)+v (k)
Wherein, yv(k) it indicates plus the second information of making an uproar that treated;Y (k) indicates the second information;V (k) indicates measurement noise;
Submodule is determined from clock information, makes an uproar that treated for that will add the second information passes through the default of Kalman filter Equation group is calculated, and is obtained from clock information.
The third aspect, the embodiment of the invention discloses a kind of electronic equipment, as shown in Figure 8.Fig. 8 is the embodiment of the present invention A kind of electronic equipment structural schematic diagram, including processor 801, communication interface 802, memory 803 and communication bus 804, wherein Processor 801, communication interface 802, memory 803 complete mutual communication by communication bus 804;
Memory 803, for storing computer program;
Processor 801 when for executing the program stored on memory 803, is realized above-mentioned from clock information optimization side Any method and step in method.
The communication bus 804 that above-mentioned electronic equipment is mentioned can be Peripheral Component Interconnect standard (Peripheral Component Interconnect, PCI) bus or expanding the industrial standard structure (Extended Industry Standard Architecture, EISA) bus etc..The communication bus 804 can be divided into address bus, data/address bus, control bus etc..For Convenient for indicating, only indicated with a thick line in figure, it is not intended that an only bus or a type of bus.
Communication interface 802 is for the communication between above-mentioned electronic equipment and other equipment.
Memory 803 may include random access memory (Random Access Memory, RAM), also may include Nonvolatile memory (Non-Volatile Memory, NVM), for example, at least a magnetic disk storage.Optionally, memory 803 can also be that at least one is located remotely from the storage device of aforementioned processor 801.
Above-mentioned processor 801 can be general processor, including central processing unit (Central Processing Unit, CPU), network processing unit (Network Processor, NP) etc.;It can also be digital signal processor (Digital Signal Processing, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic Device, discrete gate or transistor logic, discrete hardware components.
In a kind of electronic equipment provided in an embodiment of the present invention, first with sliding mode controller to from clock information and master The deviation of clock information, which is handled, to be control effectively and optimizes, it can be achieved that drifting about to master-salve clock crystal oscillator frequency, is then adopted Sliding mode controller output information is handled with Kalman filter, it can be achieved that from clock crystal oscillator shake and random error etc. Effective inhibition that external interference influences, and then obtain meeting preset condition from the deviation of clock information and master clock information corresponding Target is from clock information.The obtained target from clock information reduce from clock crystal oscillator oscillation frequency drift about and from clock crystalline substance Dynamic and random error flutter to the influence from clock information accuracy, and then effectively reduces master-salve clock deviation, realize compared with It is synchronous for accurately master-salve clock.
Fourth aspect, the embodiment of the invention discloses a kind of computer readable storage medium, computer readable storage mediums It is inside stored with computer program, when computer program is executed by processor, is realized above-mentioned any from clock information optimization method Method and step.
In a kind of computer readable storage medium provided in an embodiment of the present invention, first with sliding mode controller to from when The deviation of clock information and master clock information handled, it can be achieved that master-salve clock crystal oscillator frequency drift control effectively with it is excellent Change, then using Kalman filter sliding mode controller output information is handled, it can be achieved that from clock crystal oscillator shake and Effective inhibition that the external interferences such as random error influence, and then obtain meeting from the deviation of clock information and master clock information default The corresponding target of condition is from clock information.The obtained target is reduced from clock information from clock crystal oscillator oscillation frequency drift motion And from clock crystal oscillator shake and random error to the influence from clock information accuracy, and then it is inclined to effectively reduce master-salve clock Difference realizes more accurately master-salve clock synchronization.
In the above-described embodiments, can come wholly or partly by software, hardware, firmware or any combination thereof real It is existing.When implemented in software, it can entirely or partly realize in the form of a computer program product.Computer program product Including one or more computer instructions.When loading on computers and executing computer program instructions, all or part of real estate Raw process or function according to the embodiment of the present invention.Computer can be general purpose computer, special purpose computer, computer network, Or other programmable devices.Computer instruction may be stored in a computer readable storage medium, or from a computer Readable storage medium storing program for executing to another computer readable storage medium transmit, for example, computer instruction can from a web-site, Computer, server or data center by wired (such as coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wireless (such as Infrared, wireless, microwave etc.) mode transmitted to another web-site, computer, server or data center.Computer Readable storage medium storing program for executing can be any usable medium or include one or more usable medium collection that computer can access At the data storage devices such as server, data center.Usable medium can be magnetic medium, (for example, floppy disk, hard disk, magnetic Band), optical medium (for example, DVD) or semiconductor medium (such as solid state hard disk Solid State Disk (SSD)) etc..
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that There is also other identical elements in process, method, article or equipment including element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device, For electronic equipment and storage medium embodiment, since it is substantially similar to the method embodiment, so being described relatively simple, phase Place is closed to illustrate referring to the part of embodiment of the method.
The above is merely preferred embodiments of the present invention, it is not intended to limit the scope of the present invention.It is all in this hair Any modification, equivalent replacement, improvement and so within bright spirit and principle, are included within the scope of protection of the present invention.

Claims (10)

1. a kind of from clock information optimization method, which is characterized in that the described method includes:
Step A obtains master clock information;
The master clock information is handled by synovial membrane controller, obtains the first information by step B;
Step C carries out interference processing to the first information, and will interference treated that the first information passes through controlled device Function is handled, and the second information is obtained;The controlled device function is that the master clock information is corresponding from clock information The function that function expression is obtained by Laplace transform and discretization;
Step D is carried out plus is made an uproar processing to second information, and will plus make an uproar that treated second information passes through Kalman's filter Wave device is handled, and is obtained from clock information;
Step E, judges whether the master clock information and the deviation from clock information meet preset condition;
Step F, when the master clock information and it is described be unsatisfactory for the preset condition from the deviation of clock information when, by the master Clock information and it is described be input to the synovial membrane controller from the deviation of clock information, step B- step E is executed, until the master Clock information and described when meeting preset condition from the deviation of clock information, obtains target from clock information.
2. the method according to claim 1, wherein it is described by the master clock information by synovial membrane controller into Row processing, obtains the first information, comprising:
The master clock information input to synovial membrane controller is obtained in first by the first formula of the synovial membrane controller Between be worth;
By the second formula of the synovial membrane controller, the second median is obtained;
By first median and second median, third median is obtained;
The third formula that the third median is inputted to the synovial membrane controller obtains the first letter by the third formula Breath.
3. the method according to claim 1, wherein described carry out interference processing to the first information, and will Interference treated the first information is handled by controlled device function, obtains the second information, comprising:
Default interference information is added to the first information, obtains interference treated the first information;
Interference treated the first information is handled by controlled device function, obtains the second information;Wherein, described Controlled device function representation are as follows:
X (k)=Ax (k-1)+B (u (k)+ω (k))
Y (k)=Cx (k)
Wherein, x (k) indicates the state variable at current time;The state variable of x (k-1) expression last moment;Described in u (k) expression The first information;ω (k) indicates process noise;A indicates sytem matrix;B indicates input matrix;C indicates output matrix;Y (k) is indicated Second information.
4. the method according to claim 1, wherein described carry out second information to add processing of making an uproar, and will Add and make an uproar that treated second information is handled by Kalman filter, obtains from clock information, comprising:
By preset formula, carry out plus make an uproar to second information processing;The preset formula indicates are as follows:
yv(k)=y (k)+v (k)
Wherein, yv(k) it indicates plus second information of making an uproar that treated;Y (k) indicates second information;V (k) indicates that measurement is made an uproar Sound;
It will add and make an uproar that treated second information is calculated by the default equation group of Kalman filter, obtain from clock Information.
5. a kind of optimize device from clock information, which is characterized in that described device includes:
Master clock data obtaining module, for obtaining master clock information;
First information determining module obtains the first information for handling the master clock information by synovial membrane controller;
Second information determination module, for carrying out interference processing to the first information, and will interference treated described first Information is handled by controlled device function, obtains the second information;The controlled device function is the master clock information pair The function that the function expression for the slave clock information answered is obtained by Laplace transform and discretization;
From clock information determining module, for processing that second information is carried out plus made an uproar, and it will add that make an uproar that treated described the Two information are handled by Kalman filter, are obtained from clock information;
Master-salve clock deviation judgment module, for judging whether the master clock information and the deviation from clock information meet Preset condition;
Target is from clock information determining module, for when the master clock information and described being unsatisfactory for institute from the deviation of clock information When stating preset condition, by the master clock information and it is described be input to the synovial membrane controller from the deviation of clock information, return The first information determining module continues to execute, until the master clock information and it is described from the deviation of clock information meet preset When condition, target is obtained from clock information.
6. device according to claim 5, which is characterized in that the first information determining module, comprising:
First median determines submodule, for passing through the synovial membrane control for the master clock information input to synovial membrane controller First formula of device processed, obtains the first median;
Second median determines submodule, for passing through the second formula of the synovial membrane controller, obtains the second median;
Third median determines submodule, for obtaining among third by first median and second median Value;
The first information determines submodule, for the third median to be inputted to the third formula of the synovial membrane controller, passes through The third formula obtains the first information.
7. device according to claim 5, which is characterized in that second information determination module, comprising:
Interference processing submodule obtains interference treated described for adding default interference information to the first information One information;
Second information determines submodule, for the first information that will interfere that treated by controlled device function Reason, obtains the second information;Wherein, the controlled device function representation are as follows:
X (k)=Ax (k-1)+B (u (k)+ω (k))
Y (k)=Cx (k)
Wherein, x (k) indicates the state variable at current time;The state variable of x (k-1) expression last moment;Described in u (k) expression The first information;ω (k) indicates process noise;A indicates sytem matrix;B indicates input matrix;C indicates output matrix;Y (k) is indicated Second information.
8. device according to claim 5, which is characterized in that described from clock information determining module, comprising:
Add to make an uproar and handle submodule, for by preset formula, to carry out plus make an uproar to second information processing;The preset formula table It is shown as:
yv(k)=y (k)+v (k)
Wherein, yv(k) it indicates plus second information of making an uproar that treated;Y (k) indicates second information;V (k) indicates that measurement is made an uproar Sound;
Submodule is determined from clock information, makes an uproar that treated for that will add second information passes through the default of Kalman filter Equation group is calculated, and is obtained from clock information.
9. a kind of electronic equipment, which is characterized in that including processor, communication interface, memory and communication bus, wherein described Processor, the communication interface, the memory complete mutual communication by the communication bus;
The memory, for storing computer program;
The processor when for executing the program stored on the memory, realizes any side claim 1-4 Method step.
10. a kind of computer readable storage medium, which is characterized in that be stored with computer in the computer readable storage medium Program realizes claim 1-4 any method and step when the computer program is executed by processor.
CN201910364232.8A 2019-04-30 2019-04-30 Slave clock information optimization method and device, electronic equipment and storage medium Active CN109976442B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910364232.8A CN109976442B (en) 2019-04-30 2019-04-30 Slave clock information optimization method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910364232.8A CN109976442B (en) 2019-04-30 2019-04-30 Slave clock information optimization method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109976442A true CN109976442A (en) 2019-07-05
CN109976442B CN109976442B (en) 2020-07-28

Family

ID=67087500

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910364232.8A Active CN109976442B (en) 2019-04-30 2019-04-30 Slave clock information optimization method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109976442B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113835467A (en) * 2021-09-26 2021-12-24 深圳市杰普特光电股份有限公司 Clock synchronization system, method, electronic equipment and storage medium
CN117516901A (en) * 2023-11-06 2024-02-06 北京通泰恒盛科技有限责任公司 Clock synchronization method and system for fan blade monitoring based on inertial navigation technology

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201681266U (en) * 2010-05-31 2010-12-22 向洪莉 Clock
CN102857315A (en) * 2011-06-29 2013-01-02 中兴通讯股份有限公司 Method and system for serving slave clocks by master clock
CN104392136A (en) * 2014-11-28 2015-03-04 东南大学 High-precision data fusion method oriented to high-dynamic non-Gaussian-model robustness measurement
CN205725536U (en) * 2016-04-22 2016-11-23 湖南工业大学 A kind of adjacent cross-couplings synchronous control system based on sliding moding structure
US20170108612A1 (en) * 2015-10-15 2017-04-20 King Saud University Inertial system for gravity difference measurement
CN108501944A (en) * 2018-05-14 2018-09-07 吕杉 Automotive tyre explosion safety stable control method
CN109212285A (en) * 2018-11-29 2019-01-15 中电科西北集团有限公司 Outfield simulator
CN109546660A (en) * 2018-11-22 2019-03-29 中国航空综合技术研究所 Active power filter circuit and control method based on neural network sliding mode control strategy

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201681266U (en) * 2010-05-31 2010-12-22 向洪莉 Clock
CN102857315A (en) * 2011-06-29 2013-01-02 中兴通讯股份有限公司 Method and system for serving slave clocks by master clock
CN104392136A (en) * 2014-11-28 2015-03-04 东南大学 High-precision data fusion method oriented to high-dynamic non-Gaussian-model robustness measurement
US20170108612A1 (en) * 2015-10-15 2017-04-20 King Saud University Inertial system for gravity difference measurement
CN205725536U (en) * 2016-04-22 2016-11-23 湖南工业大学 A kind of adjacent cross-couplings synchronous control system based on sliding moding structure
CN108501944A (en) * 2018-05-14 2018-09-07 吕杉 Automotive tyre explosion safety stable control method
CN109546660A (en) * 2018-11-22 2019-03-29 中国航空综合技术研究所 Active power filter circuit and control method based on neural network sliding mode control strategy
CN109212285A (en) * 2018-11-29 2019-01-15 中电科西北集团有限公司 Outfield simulator

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113835467A (en) * 2021-09-26 2021-12-24 深圳市杰普特光电股份有限公司 Clock synchronization system, method, electronic equipment and storage medium
CN113835467B (en) * 2021-09-26 2024-03-29 深圳市杰普特光电股份有限公司 Clock synchronization system, method, electronic equipment and storage medium
CN117516901A (en) * 2023-11-06 2024-02-06 北京通泰恒盛科技有限责任公司 Clock synchronization method and system for fan blade monitoring based on inertial navigation technology

Also Published As

Publication number Publication date
CN109976442B (en) 2020-07-28

Similar Documents

Publication Publication Date Title
CN101895386B (en) Timing recovery unit and method for recovery of timing information by packet network
US9608753B2 (en) Time synchronization system, management node, and time synchronization method
CN109392074B (en) Clock calibration method and device
JP2004186877A (en) Wireless access network system, wireless communication method, synchronous server, and node unit
CN109976442A (en) One kind is from clock information optimization method, device, electronic equipment and storage medium
CN103116322B (en) Fine setting tunable oscillator is to mate method and the CAN communication controler of CAN
CN203340020U (en) Crystal oscillator frequency temperature compensation device
CN110958667B (en) Method, device and system for determining synchronization period
TW201543196A (en) Time-synchronizing a group of nodes
CN103959688A (en) Multiple clock domain clock synchronization method, wire card and Ethernet equipment
Puttnies et al. Estimators for time synchronization—survey, analysis, and outlook
CN107800529B (en) Clock frequency synchronization method of network node
CN103828288A (en) Frequency difference detection device, frequency difference detection method, and program
CN109104763A (en) Synchronization signal control method and device
JP6010802B2 (en) Time synchronization system, time synchronization method, slave node, and computer program
CN109428661B (en) FPGA-based master and slave clock phase alignment device and method
CN111464254B (en) Clock synchronization method and device and electronic equipment
CN106533598B (en) Circuit and method for estimating occurrence time difference between events, and computer-readable storage medium
CN104460826A (en) FPGA (field programmable gate array)-based MIPI (mobile industry processor interface) module DSI clock reconfiguration realizing method
US20170117980A1 (en) Time synchronization for network device
CN105429724A (en) Clock correction method, clock correcting device, and sound box
CN115826678A (en) Method, device and system for calibrating clock phases of multiple FPGAs (field programmable gate arrays) and storage medium
CN105491433B (en) Audio video synchronization display methods and device and splice displaying system based on 1588V2 agreement
Teng et al. Sparse-rotary oscillator array (SROA) design for power and skew reduction
US20190020465A1 (en) Device, System, and Method for Determining a Forwarding Delay Through a Networking Device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant