CN-122018636-A - Dynamic time keeping method for monitoring clock of ultra-large scale metering device
Abstract
The application provides a dynamic time keeping method for monitoring a clock of a super-large scale metering device, which comprises the steps of inputting a crystal oscillator offset related parameter into a preset multidimensional working condition and crystal oscillator offset mapping model, calculating a current crystal oscillator frequency offset, triggering clock drift rate assessment according to the current crystal oscillator frequency offset to obtain a clock drift rate, fitting a relation between the drift rate and time by adopting a linear regression model according to the clock drift rate and a historical record of a reference signal in a low-power consumption scene, predicting a subsequent synchronization error based on a fitting result, distributing a correction instruction to each node clock module under the system stability requirement, fusing multi-source data comprising NTP, PTP and a local clock by adopting a data fusion method, and executing dynamically adjusted optimization time synchronization operation by adopting a reference signal broadcasting mechanism to obtain a synchronized clock state.
Inventors
- DING JIANSHUN
- CHENG XIANGQUN
- GONG BIN
- Weng Tongyang
- Ji Aiqiong
- ZHANG SHIKANG
- Cai Pengkang
- WANG YAHAO
- WANG YONG
- XU LIANJIE
- GAO YIN
- WANG KAI
- LIU DANHUA
- XIA ZEJU
- CAO YOUXIA
- WANG XI
Assignees
- 国网安徽省电力有限公司营销服务中心
Dates
- Publication Date
- 20260512
- Application Date
- 20251229
Claims (10)
- 1. A dynamic time keeping method for clock monitoring of a very large scale metering device, comprising: Collecting original data of a super-large-scale metering device through each node sensor in a distributed network, wherein the original data comprise battery health parameters, power supply voltage data, environment temperature data and load rate data, filtering the original data to obtain crystal oscillator offset related parameters, and the crystal oscillator offset related parameters comprise battery health indexes, voltage stability values, temperature compensation coefficients and load influence weights; Inputting the crystal oscillator offset related parameters into a preset mapping model, calculating a crystal oscillator frequency offset, and evaluating a clock drift rate according to the crystal oscillator frequency offset; under a low power consumption scene, according to the clock drift rate and the reference signal history record, fitting the relation between the drift rate and time, and predicting the subsequent synchronization error; judging a node synchronization error state according to the follow-up synchronization error prediction result, if the synchronization error is greater than or equal to a preset tolerance threshold, adjusting correction frequency, and acquiring adjacent node time synchronization data based on the adjusted correction frequency; According to the adjacent node time synchronization data, multi-source clock data are fused, wherein the multi-source clock data comprise network time protocol data, precision time protocol data and local clock data, and a weight distribution algorithm is adopted to determine comprehensive correction amplitude so as to generate a correction instruction; distributing the correction instruction to each node clock module, fusing the multi-source clock data, and executing time synchronization operation by adopting a reference signal broadcasting mechanism to obtain a synchronized clock state; And according to the synchronized clock state, monitoring the performance index of the distributed network, adjusting the calibration parameters, and circularly executing the original data acquisition to form a continuous dynamic clock calibration cycle.
- 2. The method for dynamically keeping in time the clock monitoring of the ultra-large scale metering device according to claim 1, wherein the steps of collecting the original data of the ultra-large scale metering device by each node sensor in the distributed network, and processing the original data by filtering to obtain the crystal oscillator offset related parameters, wherein the crystal oscillator offset related parameters comprise battery health indexes, voltage stability values, temperature compensation coefficients and load influence weights, and the method comprises the steps of: Acquiring the original data according to a preset period through each node sensor in a distributed network, wherein the original data comprises a battery internal resistance value, a discharging depth, a charging and discharging cycle number, a power supply voltage instantaneous value, an environment temperature value and an equipment load rate, and generating a multi-dimensional data set with a time stamp, wherein the equipment load rate is obtained by monitoring CPU occupancy rate, memory use rate and communication module data transmission quantity and comprehensively calculating; Performing Kalman filtering processing on the multi-dimensional data set, setting the internal resistance value and the discharge depth of the battery as state variables, setting the instantaneous value of the power supply voltage and the environmental temperature value as observation variables, predicting the state value of the next moment through a state transition equation, calculating a measurement residual error according to the observation equation, and updating a state estimation value by using Kalman gain to obtain the battery health index and the voltage stability value; Calculating a change rate according to the battery health index, if the change rate exceeds a preset change rate threshold, extracting a standard deviation of a voltage stability value, generating a temperature compensation coefficient by multiplying a difference value between an ambient temperature value and a crystal oscillator nominal temperature by a preset temperature coefficient, and generating a load influence weight by combining a device load rate and a crystal oscillator frequency offset correlation coefficient calculated by adopting a Pearson correlation coefficient quantization, wherein the preset change rate threshold is determined according to the monthly change rate of the battery health index, and the standard deviation of the voltage stability value is calculated by voltage data in a continuous minute time window; and processing the battery health index, the voltage stability value, the temperature compensation coefficient and the load influence weight by adopting a normalization method to generate the crystal oscillator offset related parameters.
- 3. The method for dynamically keeping in time the clock monitoring of the very large scale metering device according to claim 1, wherein the step of inputting the crystal oscillator offset correlation parameter into a preset mapping model to calculate the crystal oscillator frequency offset comprises the steps of: Inputting the crystal oscillator offset related parameters into a preset mapping model, and calculating the crystal oscillator frequency offset, wherein the preset mapping model is established by a multiple linear regression method, and regression coefficients corresponding to the parameters are obtained by adopting least square fitting; According to the crystal oscillator frequency offset, recording a crystal oscillator frequency value at fixed sampling intervals in a preset time window, calculating the difference between the frequency offset of each sampling point and the frequency offset of the previous sampling point, and dividing the difference by the sampling interval to obtain the frequency change rate of each sampling point; And if the average value of the frequency change rates of the sampling points exceeds a preset stability threshold, subtracting the frequency offset of the first sampling point from the frequency offset of the last sampling point in the time window to obtain a frequency offset change, and dividing the frequency offset change by the length of the time window to generate the clock drift rate.
- 4. The method for dynamically keeping in time the clock monitoring of the very large scale metering device according to claim 1, wherein said predicting the subsequent synchronization error in the low power consumption scenario based on the clock drift rate and the reference signal history, fitting the relationship between the drift rate and time, comprises: Extracting time sequence data of the clock drift rate according to the equipment dormancy period and the wakeup moment, calculating synchronization deviation, and generating a drift rate numerical sequence; Constructing a linear regression model by adopting the drift rate numerical sequence, and calculating regression coefficients comprising slope parameters and intercept parameters by a least square method to obtain a linear relation of drift rate and time; substituting and calculating any time from the current time to the day to obtain a predicted drift rate of the time according to the linear relation, multiplying the predicted drift rate by a time interval from the current time to the any time, and calculating to obtain a synchronous error accumulation amount in the period to obtain the subsequent synchronous error predicted value.
- 5. The method for dynamically keeping in time the clock monitoring of the very large scale metering device according to claim 1, wherein the step of determining the node synchronization error state according to the subsequent synchronization error prediction result, adjusting the correction frequency if the synchronization error is greater than or equal to a preset tolerance threshold, and collecting the adjacent node time synchronization data based on the adjusted correction frequency comprises: Comparing the subsequent synchronous error predicted value with a preset tolerance threshold, if the subsequent synchronous error predicted value is larger than or equal to the tolerance threshold, adjusting the correction frequency, multiplying a correction frequency parameter by a preset adjustment factor to generate an updated correction frequency value, wherein the adjustment factor is dynamically determined according to the ratio of the predicted error value to the tolerance threshold; Broadcasting a time synchronization request to adjacent nodes in the distributed network according to the updated correction frequency value, and collecting adjacent node time synchronization data; preprocessing the time synchronization data, removing abnormal data, and generating a preprocessed synchronization data set.
- 6. The method for dynamically keeping in time the clock monitoring of the very large scale metering device according to claim 1, wherein the step of merging the multi-source clock data according to the adjacent node time synchronization data, determining the comprehensive correction amplitude by adopting a weight distribution algorithm, and generating the correction instruction comprises the following steps: according to the adjacent node time synchronization data, network time protocol data, precision time protocol data and local clock data are obtained, and the data and the adjacent node data are subjected to format unification and time zone alignment to generate a standardized multi-source clock data set; Calculating the time deviation standard deviation of each clock source for the multi-source clock data set to generate a self-adaptive weight distribution result; Calculating a weighted average time value according to the self-adaptive weight distribution result, generating the comprehensive correction amplitude, and judging whether the corrected time deviation of each node is smaller than a preset consistency threshold value or not; If the comprehensive correction amplitude meets the consistency requirement and does not exceed the preset single adjustment upper limit, directly generating the correction instruction containing the correction amplitude; If the comprehensive correction amplitude exceeds the preset single adjustment upper limit, decomposing the comprehensive correction amplitude into a plurality of small amplitude adjustments, setting a progressive correction time interval and generating a step-by-step correction instruction.
- 7. The method for dynamically keeping time of clock monitoring of a very large scale metering device according to claim 6, wherein said distributing the correction command to each node clock module, merging the multi-source clock data, performing time synchronization operation by using a reference signal broadcasting mechanism, and obtaining a synchronized clock state comprises: determining the distribution sequence of the correction instructions or the step-by-step correction instructions according to the node load state and the communication quality, and recording the distribution completion state; Each node analyzes the correction instruction, fuses the multi-source clock data and generates a fused reference time value; Broadcasting a synchronizing signal by adopting the fused reference time value, calculating the deviation between a reference time stamp and a local clock, adjusting the clock frequency to gradually synchronize when the deviation is smaller than a preset deviation threshold value, directly adjusting the clock phase when the deviation is larger than or equal to the preset deviation threshold value, and generating clock adjustment track data; And calculating the frequency change rate and the time deviation fluctuation range of each node after adjustment according to the clock adjustment track data, and generating the synchronized clock state if the evaluation results of all the nodes are within a preset range.
- 8. The method of claim 7, wherein the monitoring the distributed network performance index according to the synchronized clock state, adjusting calibration parameters, and performing the raw data acquisition in a loop comprises: According to the clock state after synchronization, extracting time deviation values and synchronization precision data of all nodes, calculating a time deviation mean value and a time deviation variance to be used as consistency indexes, counting the maximum time difference among the nodes to be used as a dispersion index, and comparing the consistency indexes and the dispersion index with values before synchronization to obtain performance improvement degree; According to the performance improvement degree, if the consistency index improvement exceeds a preset improvement threshold value and the dispersion amplitude reduction reaches the preset amplitude reduction or more, confirming that the current calibration parameters are valid, recording valid correction frequency, weight distribution scheme and calibration period parameters, taking the parameters as initial configuration of next round of calibration, and generating an optimized calibration parameter set; and configuring an acquisition period and a filtering parameter according to the optimized calibration parameter set, re-executing the original data acquisition, processing the original data by adopting Kalman filtering to generate the crystal oscillator offset associated parameter, and circularly executing clock calibration.
- 9. The method for dynamically keeping in time the clock monitoring of the very large scale metering device according to claim 3, wherein if the average value of the frequency change rates of the sampling points exceeds a preset stability threshold, subtracting the frequency offset of the first sampling point from the frequency offset of the last sampling point in the time window to obtain a frequency offset change, dividing the frequency offset change by the time window length, and generating the clock drift rate, further comprises: If the average value of the frequency change rates of all the sampling points does not exceed a preset stability threshold value, adopting the average value of the frequency offset of all the sampling points in the time window as a reference offset, and generating the clock drift rate by combining the historical drift rate average value output by the mapping model; the historical drift rate mean value is calculated by extracting drift rate data of which the frequency change rate mean value in the past day is smaller than or equal to a preset stability threshold period and adopting an arithmetic average method.
- 10. The method for dynamically keeping watch on a clock of a very large scale metering device according to claim 7, wherein determining the distribution sequence of the correction command or the step-by-step correction command according to the node load state and the communication quality, recording the distribution completion state, comprises: If the node CPU occupancy rate is smaller than or equal to a preset occupancy rate value and the memory utilization rate is smaller than or equal to a preset utilization rate value, judging that the load is normal; if the CPU occupancy rate is larger than the preset occupancy rate value or the memory utilization rate is larger than the preset utilization rate value, judging that the load is too high; If the packet loss rate between the nodes and the distribution nodes is smaller than or equal to a preset packet loss rate threshold value and the average time delay is smaller than or equal to preset time, judging that the communication quality is qualified, and if the packet loss rate is larger than the preset packet loss rate or the average time delay is larger than the preset time, judging that the communication quality is unqualified; the method comprises the steps that instructions are preferentially distributed to key metering nodes comprising an electric energy metering node and a cost settlement node, and the instructions are distributed to common metering nodes only for state monitoring after the key metering nodes feed back confirmation messages comprising node identifiers and receiving time stamps; If the key metering node judges that the load is too high or the communication quality is unqualified, the load and the communication state of the key metering node are re-detected after fixed time intervals until the load is normal and the communication is qualified, and then the instruction is distributed.
Description
Dynamic time keeping method for monitoring clock of ultra-large scale metering device Technical Field The invention relates to the technical field of information, in particular to a dynamic time keeping method for monitoring a clock of a super-large-scale metering device. Background In the long-term operation of the ultra-large scale metering device, the time synchronization of all the devices is a key for ensuring the normal operation of the system, otherwise, the data time stamps may be disordered, so that subsequent decision errors, such as power distribution calculation errors and even equipment faults, are caused by the time dyssynchrony in the smart grid. To realize time synchronization, the core is to control the clock precision of the equipment, the precision of the equipment clock is mainly determined by the crystal oscillator frequency, the crystal oscillator frequency is stable, the clock running time is accurate, the crystal oscillator frequency is offset, and the clock is deviated, and the deviation is called clock drift. The prior art generally maintains time synchronization in a fixed period calibration, such as correcting the local clock with the satellite time signal every 1 hour. However, this method has a key problem, which makes it difficult to ensure the synchronization accuracy. On one hand, the conventional method does not consider the influence of the battery state on the crystal oscillator, and the fixed calibration cannot adapt to the change caused by the aging of the battery. The metering device mostly depends on battery power supply, and the battery can age for a long time, and the aged battery can lead to supply voltage to be unstable, and voltage fluctuation can directly let crystal oscillator frequency offset again, and then makes the clock drift rate grow. Because the existing method is calibrated according to a fixed period, whether the battery is aged or not and whether the crystal oscillator is offset or not is corrected according to the same interval, the situation that the calibration is not matched with the actual requirement easily occurs, and finally, the time synchronization error is larger and larger. On the other hand, in low power consumption scenarios, such as where part of the sensor is to extend battery life, it may reduce the frequency of communication with other devices, and only operate when necessary, the above problem may be further exacerbated. In a low-power consumption scene, the communication frequency of the device is reduced for saving electricity, which means that the opportunities for acquiring external reference signals and transmitting calibration data are reduced, the crystal oscillator offset caused by battery aging cannot be handled by original fixed period calibration, the data required by the current continuous calibration are difficult to acquire in time, not only clock drift cannot be accurately corrected, but also more electric quantity is consumed because of forced communication for acquiring the calibration data, and vicious cycles of error accumulation, difficult calibration and more power consumption are involved. Therefore, how to solve the problem of association between the battery state and the crystal oscillator offset, and then adapt to the low-power consumption scene in a targeted manner, so that the metering device can dynamically adjust the clock calibration strategy according to the battery state, and meanwhile, the metering device can also calibrate accurately and avoid error accumulation under low power consumption, which becomes the core requirement to be solved at present. Disclosure of Invention The invention provides a dynamic time keeping method for monitoring a clock of a super-large scale metering device, which mainly comprises the following steps: Collecting original data of a super-large-scale metering device through each node sensor in a distributed network, wherein the original data comprise battery health parameters, power supply voltage data, environment temperature data and load rate data, filtering the original data to obtain crystal oscillator offset related parameters, and the crystal oscillator offset related parameters comprise battery health indexes, voltage stability values, temperature compensation coefficients and load influence weights; Inputting the crystal oscillator offset related parameters into a preset mapping model, calculating a crystal oscillator frequency offset, and evaluating a clock drift rate according to the crystal oscillator frequency offset; under a low power consumption scene, according to the clock drift rate and the reference signal history record, fitting the relation between the drift rate and time, and predicting the subsequent synchronization error; judging a node synchronization error state according to the follow-up synchronization error prediction result, if the synchronization error is greater than or equal to a preset tolerance threshold, adjusting correction frequency,