Disclosure of Invention
In order to solve the defects and shortcomings in the prior art, the invention provides an electric meter clock correction method based on average difference, which is used for improving the accuracy of a clock in an electric meter.
In order to achieve the technical purpose, the invention provides an electric meter clock correction method based on an average difference value, which comprises the following steps:
networking the ammeter groups including the target ammeter to obtain an ammeter timing network;
regularly extracting ammeter error values in an ammeter timing network, and solving an average difference value of all the ammeter error values;
obtaining a factory error mean value of all ammeter types in an ammeter timing network, and obtaining a calibration mean value by combining the average difference value;
and broadcasting the calibration mean value in the ammeter timing network, and enabling the received ammeter to calibrate the clock of the ammeter based on the calibration mean value.
Optionally, networking the ammeter groups including the target ammeter to obtain an ammeter timing network, including:
enabling the target electricity meter to broadcast the target equipment code in a wireless mode;
the electric meter in the broadcast radiation area stores the received target equipment code, and broadcasts a reply message containing the target equipment code, the own equipment code and the current time;
and (4) establishing the target ammeter and the ammeter which sends the reply message as an ammeter timing network, and establishing communication connection between each ammeter in the ammeter timing network.
Optionally, the timing extracting an electric meter error value in the electric meter timing network, and solving an average difference value of all electric meter error values includes:
determining an ammeter error value of each sample ammeter according to the current time in the received reply message by taking the current time of the target ammeter as a reference;
and calculating an average difference value representing the average error of the electric meter clock based on all the received electric meter error values.
Optionally, the obtaining of the factory error mean value of all the electric meter types in the electric meter timing network and the obtaining of the calibration mean value by combining the average difference value includes:
reading the self equipment code of each electric meter from the reply message, and determining the corresponding electric meter model based on the self equipment code;
and obtaining a factory error mean value of each electric meter model, selecting a minimum value from the factory error mean values, and summing the minimum value and the average difference value to obtain a calibration mean value.
Optionally, the obtaining of the factory error mean value of each electric meter model includes:
and reading the factory error mean value from the specification of the electric meter or a factory inspection list.
The technical scheme provided by the invention has the beneficial effects that:
and carrying out average value solving based on the current errors of all the electric meters in the network, and calibrating the electric meters in the whole network by taking the obtained average value as a calibration quantity. Because the step of extracting the error value of the electric meter is triggered at regular time, the error of the electric meter in the whole network can be effectively reduced through repeated iteration operation, the reduced error is used for calibrating the electric meter in the whole network, the electric meter in the whole network can be in a state of small error, and the accuracy of the clock in the electric meter is effectively improved.
Detailed Description
To make the structure and advantages of the present invention clearer, the structure of the present invention will be further described with reference to the accompanying drawings.
Example one
The invention provides an electric meter clock correction method based on an average difference value, as shown in fig. 1, the electric meter clock correction method comprises the following steps:
11. networking the ammeter groups including the target ammeter to obtain an ammeter timing network;
12. regularly extracting ammeter error values in an ammeter timing network, and solving an average difference value of all the ammeter error values;
13. obtaining a factory error mean value of all ammeter types in an ammeter timing network, and obtaining a calibration mean value by combining the average difference value;
14. and broadcasting the calibration mean value in the ammeter timing network, and enabling the received ammeter to calibrate the clock of the ammeter based on the calibration mean value.
In implementation, in order to calibrate a clock in an electric meter, the embodiment provides a method for calibrating electric meters in a whole network based on networking the electric meters and further based on an average value of errors of all the electric meters in the electric network. Because the step of extracting the error value of the electric meter is triggered at regular time, the error of the electric meter in the whole network can be effectively reduced through repeated iteration operation, the reduced error is used for calibrating the electric meter in the whole network, the electric meter in the whole network can be in a state of small error, and the accuracy of the clock in the electric meter is effectively improved.
Specifically, step 11 is a step of establishing a network for executing the electricity meter timing network, specifically:
111. enabling the target electricity meter to broadcast the target equipment code in a wireless mode;
112. the electric meter in the broadcast radiation area stores the received target equipment code, and broadcasts a reply message containing the target equipment code, the own equipment code and the current time;
113. and (4) establishing the target ammeter and the ammeter which sends the reply message as an ammeter timing network, and establishing communication connection between each ammeter in the ammeter timing network.
In practice, the purpose of establishing the meter timing network is to acquire as large a number of meters as possible, and then to select the meter which needs to be most corrected from the meters.
The specific step 12 is to obtain an average difference value in the electric meter timing network, and specifically includes:
121. determining an ammeter error value of each sample ammeter according to the current time in the received reply message by taking the current time of the target ammeter as a reference;
122. and calculating an average difference value representing the average error of the electric meter clock based on all the received electric meter error values.
In implementation, based on the electric meter timing network constructed in the foregoing step 11, after the network is successfully constructed, the target electric meter can collect the current time of the rest electric meters in the network. On the basis of the time, the result of the superposition after the inherent transmission delay in the electric meter timing network is differed from the moment when the target electric meter receives the reply information, so that the electric meter error value existing in each sample electric meter can be obtained.
And then, calculating the average of all the electric meter error values on the basis of the electric meter error value corresponding to each sample electric meter to obtain an average difference value representing the clock average error of the electric meter.
The specific step 13 is to obtain a calibration mean value, specifically:
131. reading the self equipment code of each electric meter from the reply message, and determining the corresponding electric meter model based on the self equipment code;
132. and obtaining a factory error mean value of each electric meter model, selecting a minimum value from the factory error mean values, and summing the minimum value and the average difference value to obtain a calibration mean value.
In implementation, in order to improve the accuracy of the electric meter clock calibration, the step of obtaining the delivery error mean value of the electric meter according to the difference of each electric meter model in the electric meter timing network is also carried out on the basis of determining the average difference value according to the reply information.
And obtaining the factory error mean value according to the self equipment codes in the reply information in the electric meter calibration network mentioned in the foregoing, and obtaining the factory error mean value corresponding to each electric meter by referring to the self equipment codes of each electric meter.
Considering that, in the prior art, even though the factory errors of different types of electric meters are not very different, in order to improve the calibration efficiency, the minimum value is directly selected from all the obtained error mean values, and the minimum value is summed with the average difference value provided in the foregoing to obtain the calibration mean value for calibration.
In the established electric meter timing network, the target electric meter broadcasts the calibration mean value, so that other electric meters calibrate themselves according to the received calibration mean value, and the effect of reducing the clock error of themselves is achieved.
Optionally, the obtaining of the factory error mean value of each electric meter model includes:
and reading the factory error mean value from the specification of the electric meter or a factory inspection list.
The invention provides an ammeter clock correction method based on average difference, which comprises the steps of networking ammeter groups including a target ammeter to obtain an ammeter timing network; regularly extracting ammeter error values in an ammeter timing network, and solving an average difference value of all the ammeter error values; obtaining a factory error mean value of all ammeter types in an ammeter timing network, and obtaining a calibration mean value by combining the average difference value; and broadcasting the calibration mean value in the ammeter timing network, and enabling the received ammeter to calibrate the clock of the ammeter based on the calibration mean value. And carrying out average value solving based on the current errors of all the electric meters in the network, and calibrating the electric meters in the whole network by taking the obtained average value as a calibration quantity. Because the step of extracting the error value of the electric meter is triggered at regular time, the error of the electric meter in the whole network can be effectively reduced through repeated iteration operation, the reduced error is used for calibrating the electric meter in the whole network, the electric meter in the whole network can be in a state of small error, and the accuracy of the clock in the electric meter is effectively improved.
The sequence numbers in the above embodiments are merely for description, and do not represent the sequence of the assembly or the use of the components.
The above description is only exemplary of the present invention and should not be taken as limiting the invention, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.