Time correction method, device and computer readable storage medium

文档序号:1270159 发布日期:2020-08-25 浏览:27次 中文

阅读说明:本技术 时间校正方法、装置及计算机可读存储介质 (Time correction method, device and computer readable storage medium ) 是由 张健 王建忠 孙睿 胡忠勇 刘伟 于 2020-05-11 设计创作,主要内容包括:本发明公开了一种时间校正方法,包括获取网络标准时间,读取存储的最新一次的校时记录,所述校时记录包括校正时间,读出连接的电能表的当前时钟时间,判断所述标准时间与所述校正时间的第一时间差值和/或所述标准时间与所述当前时钟时间的第二时间差值是否符合预设校时条件,若所述第一时间差值和/或第二时间差值符合预设校时条件,则将所述当前时钟时间校正至所述标准时间。本发明还公开了一种时间校正装置和计算机可读存储介质。本发明旨在解决电能表内部时钟偏差的问题。(The invention discloses a time correction method, which comprises the steps of obtaining network standard time, reading a stored latest time correction record, wherein the time correction record comprises correction time, reading out the current clock time of a connected electric energy meter, judging whether a first time difference value between the standard time and the correction time and/or a second time difference value between the standard time and the current clock time meet a preset time correction condition or not, and correcting the current clock time to the standard time if the first time difference value and/or the second time difference value meet the preset time correction condition. The invention also discloses a time correction device and a computer readable storage medium. The invention aims to solve the problem of clock deviation in an electric energy meter.)

1. A time correction method, characterized in that the time correction method comprises:

acquiring network standard time;

reading a stored latest timing record, wherein the timing record comprises correction time;

reading the current clock time of the connected electric energy meter;

judging whether a first time difference value between the standard time and the correction time and/or a second time difference value between the standard time and the current clock time meet a preset time correction condition or not;

and if the first time difference value and/or the second time difference value meet a preset time correction condition, correcting the current clock time to the standard time.

2. The time correction method of claim 1, wherein said step of reading the current clock time of the connected power meter further comprises:

searching a valid electric energy meter communication address list;

establishing connection with the electric energy meter through the communication address of the electric energy meter;

and according to the connection established with the electric energy meter through the electric energy meter communication address, reading out the current clock time in the connected electric energy meter.

3. The time correction method according to claim 1, characterized in that the time correction method comprises:

reading the current clock time of the connected electric energy meter for the first time;

the correction time, the current clock time and the standard time are consistent.

4. The method according to claim 1, wherein the predetermined timing condition comprises a predetermined timing cycle, and the determining whether the first time difference between the standard time and the calibration time meets the predetermined timing condition comprises:

judging whether the first time difference value meets a preset timing period or not;

and if the first time difference value is a preset time correction period, correcting the current clock time to the standard time.

5. The method of claim 1, wherein the predetermined timing condition comprises a predetermined total accumulated time difference, and the determining whether the second time difference between the standard time and the calibration time meets the predetermined timing condition comprises:

judging whether the second time difference value exceeds the preset total accumulated time difference value or not;

and if the second time difference value exceeds the preset total accumulated time difference value, stopping time correction and uploading the fault information of the electric energy meter.

6. The method of claim 1, wherein the predetermined time calibration condition comprises a predetermined cumulative time difference of day, and the determining whether the second time difference between the standard time and the calibration time meets the predetermined time calibration condition further comprises:

judging whether the second time difference value exceeds the preset daily accumulated time difference value or not;

and if the second time difference value exceeds the preset daily accumulated time difference value, correcting the current clock time to the standard time.

7. The time correction method according to claims 4 to 6, wherein when the first time difference does not satisfy a preset time correction period, the determining whether the first time difference between the standard time and the correction time and/or the second time difference between the standard time and the current clock time satisfies a preset time correction condition further comprises:

judging whether the second time difference value exceeds a preset total accumulated time difference value or not;

if the second time difference value does not exceed a preset total accumulated time difference value, judging whether the second time difference value exceeds a preset daily accumulated time difference value or not;

if the second time difference value does not exceed a preset daily accumulated time difference value, executing the following steps: and reading out the current clock time of the connected electric energy meter.

8. The time correction method of claim 1, wherein said correcting said current clock time to be after said standard time further comprises:

reading the corrected clock time of the electric energy meter;

acquiring a third time difference value between the corrected clock time and the standard time;

judging whether the acquired third time difference value is within a preset time difference value interval or not;

and if the third time difference value is within the preset time difference value interval, finishing time correction, and storing and uploading a time correction record.

9. A time correction device, characterized in that the time correction device comprises: time correction program capable of executing the steps of the time correction method according to any one of claims 1 to 8.

10. A computer-readable storage medium characterized in that the computer-readable storage medium stores a time correction program capable of executing the steps of the time correction method according to any one of claims 1 to 8.

Technical Field

The present invention relates to the field of timing technologies, and in particular, to a time correction method and apparatus, and a computer-readable storage medium.

Background

Along with the expansion of the market scale of the electric energy meter, the number of the electric energy meter hanging nets is increased day by day, so that the requirement on the service life of the electric energy meter is longer and longer, and the functional requirement on the electric energy meter is also more and more.

After the existing electric energy meter is wired for a long time, the internal clock deviation can generate accumulated deviation along with the lengthening of the wired time, and if the accumulated deviation cannot be corrected for a long time, the functions of the electric energy meter can be influenced.

Disclosure of Invention

The invention mainly aims to provide a time correction method, a time correction device and a computer readable storage medium, and aims to solve the problem of internal clock deviation of an electric energy meter.

In order to achieve the above object, the present invention provides a time correction method, including:

acquiring network standard time;

reading a stored latest timing record, wherein the timing record comprises correction time;

reading the current clock time of the connected electric energy meter;

judging whether a first time difference value between the standard time and the correction time and/or a second time difference value between the standard time and the current clock time meet a preset time correction condition or not;

and if the first time difference value and/or the second time difference value meet a preset time correction condition, correcting the current clock time to the standard time.

Optionally, the step of reading the current clock time of the connected electric energy meter further comprises:

searching a valid electric energy meter communication address list;

establishing connection with the electric energy meter through the communication address of the electric energy meter;

and according to the connection established with the electric energy meter through the electric energy meter communication address, reading out the current clock time in the connected electric energy meter.

Optionally, the time correction method includes:

reading the current clock time of the connected electric energy meter for the first time;

the correction time, the current clock time and the standard time are consistent.

Optionally, the preset timing condition includes a preset timing cycle, and determining whether a first time difference value between the standard time and the correction time meets the preset timing condition includes:

judging whether the first time difference value meets a preset timing period or not;

and if the first time difference value is a preset time correction period, correcting the current clock time to the standard time.

Optionally, the preset timing condition includes a preset total accumulated time difference, and determining whether the second time difference between the standard time and the correction time meets the preset timing condition includes:

judging whether the second time difference value exceeds the preset total accumulated time difference value or not;

and if the second time difference value exceeds the preset total accumulated time difference value, stopping time correction and uploading the fault information of the electric energy meter.

Optionally, the preset time correction condition includes a preset daily accumulated time difference, and determining whether the second time difference between the standard time and the correction time meets the preset time correction condition further includes:

judging whether the second time difference value exceeds the preset daily accumulated time difference value or not;

and if the second time difference value exceeds the preset daily accumulated time difference value, correcting the current clock time to the standard time.

Optionally, when the first time difference does not satisfy a preset time correction period, the determining whether the first time difference between the standard time and the correction time and/or the second time difference between the standard time and the current clock time meets a preset time correction condition further includes:

judging whether the second time difference value exceeds a preset total accumulated time difference value or not;

if the second time difference value does not exceed a preset total accumulated time difference value, judging whether the second time difference value exceeds a preset daily accumulated time difference value or not;

if the second time difference value does not exceed a preset daily accumulated time difference value, executing the following steps: and reading out the current clock time of the connected electric energy meter.

Optionally, the correcting the current clock time to be after the standard time further includes:

reading the corrected clock time of the electric energy meter;

acquiring a third time difference value between the corrected clock time and the standard time;

judging whether the acquired third time difference value is within a preset time difference value interval or not;

and if the third time difference value is within the preset time difference value interval, finishing time correction, and storing and uploading a time correction record.

To achieve the above object, the present invention also provides a time correction device, and the time correction program can execute the steps of the time correction method.

To achieve the above object, the present invention also provides a computer-readable storage medium, wherein the time correction program is capable of executing the steps of the time correction method as described above.

The invention provides a time correction method, which is characterized in that standard time is acquired, stored time correction record information is acquired, an effective electric energy meter communication address list is searched, one-to-one connection with an electric energy meter is realized through a communication address of the electric energy meter, then the current clock time of the electric energy meter is read according to an established connection channel, and further, whether a first time difference value between the standard time and the correction time in the time correction record and a second time difference value between the standard time and the current clock time meet a preset time correction condition or not is judged, and the current clock time of the electric energy meter is corrected to the standard time under the condition that the time correction condition is met, so that the problem of clock deviation in the electric energy meter is solved.

Drawings

FIG. 1 is a schematic diagram of an apparatus in a hardware operating environment according to an embodiment of the present invention;

FIG. 2 is a schematic flow chart illustrating a time calibration method according to a first embodiment of the present invention;

FIG. 3 is a detailed flowchart of step S12 in FIG. 2;

FIG. 4 is a schematic flow chart of the second, third, fourth and fifth embodiments of the time calibration method of the present invention;

FIG. 5 is a schematic flow chart of the time correction and confirmation method of the present invention.

The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.

Detailed Description

It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

The main solution of the embodiment of the invention is as follows:

in the prior art, after the electric energy meter is wired for a long time, the internal clock deviation can generate accumulated deviation along with the lengthening of the wired time, and if the accumulated deviation cannot be corrected for a long time, the functions of the electric energy meter can be influenced.

The invention provides a solution, which is characterized in that a first time difference value between standard time and correction time in a correction record and a second time difference value between the standard time and the current clock time are judged by acquiring the standard time, the correction record and the current clock time of an electric energy meter, and the current clock time of the electric energy meter is corrected to the standard time under the condition that a preset time correction condition is met, so that the problem of clock deviation in the electric energy meter is solved.

As shown in fig. 1, fig. 1 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present invention.

As shown in fig. 1, this type of time correction apparatus may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a timing interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include an infrared receiving module for receiving a control command triggered by a user through a remote controller, and the optional user interface 1003 may further include a standard wired interface or a wireless interface. The timing interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.

It will be appreciated by those skilled in the art that the time correction device configuration shown in fig. 1 is not intended to be limiting of the present invention and may include more or fewer components than shown, or some components in combination, or a different arrangement of components.

As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a timing communication module, a user interface module, and a time correction program.

In the terminal shown in fig. 1, the timing interface 1004 is mainly used for connecting to a background server and performing data communication with the background server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be configured to call the time correction program stored in the memory 1005 and perform the following operations:

acquiring network standard time;

reading a stored latest timing record, wherein the timing record comprises correction time;

reading the current clock time of the connected electric energy meter;

judging whether a first time difference value between the standard time and the correction time and/or a second time difference value between the standard time and the current clock time meet a preset time correction condition or not;

and if the first time difference value and/or the second time difference value meet a preset time correction condition, correcting the current clock time to the standard time.

Further, the processor 1001 may call the time correction program stored in the memory 1005, and also perform the following operations:

searching a valid electric energy meter communication address list;

establishing connection with the electric energy meter through the communication address of the electric energy meter;

and according to the connection established with the electric energy meter through the electric energy meter communication address, reading out the current clock time in the connected electric energy meter.

Further, the processor 1001 may call the time correction program stored in the memory 1005, and also perform the following operations:

reading the current clock time of the connected electric energy meter for the first time;

the correction time, the current clock time and the standard time are consistent. Further, the processor 1001 may call the time correction program stored in the memory 1005, and also perform the following operations:

judging whether the first time difference value meets a preset timing period or not;

and if the first time difference value is a preset time correction period, correcting the current clock time to the standard time.

Further, the processor 1001 may call the time correction program stored in the memory 1005, and also perform the following operations:

judging whether the second time difference value exceeds the preset total accumulated time difference value or not;

and if the second time difference value exceeds the preset total accumulated time difference value, stopping time correction and uploading the fault information of the electric energy meter.

Further, the processor 1001 may call the time correction program stored in the memory 1005, and also perform the following operations:

judging whether the second time difference value exceeds the preset daily accumulated time difference value or not;

and if the second time difference value exceeds the preset daily accumulated time difference value, correcting the current clock time to the standard time.

Further, the processor 1001 may call the time correction program stored in the memory 1005, and also perform the following operations:

judging whether the second time difference value exceeds a preset total accumulated time difference value or not;

if the second time difference value does not exceed a preset total accumulated time difference value, judging whether the second time difference value exceeds a preset daily accumulated time difference value or not;

if the second time difference value does not exceed a preset daily accumulated time difference value, executing the following steps: and reading out the current clock time of the connected electric energy meter.

Further, the processor 1001 may call the time correction program stored in the memory 1005, and also perform the following operations:

reading the corrected clock time of the electric energy meter;

acquiring a third time difference value between the corrected clock time and the standard time;

judging whether the acquired third time difference value is within a preset time difference value interval or not;

and if the third time difference value is within the preset time difference value interval, finishing time correction, and storing and uploading a time correction record.

The specific embodiment of the time calibration apparatus of the present invention is substantially the same as the following embodiments of the time calibration method, and will not be described herein again.

Referring to fig. 2, a first embodiment of the present invention provides a time correction method, including:

step S10, acquiring network standard time;

in this embodiment, the time calibration apparatus includes a structure as shown in fig. 1, and in addition, a microcontroller mcu (microcontroller unit), an NBIOT (Narrow Band Internet of Things) communication module, and a wired/wireless connection communication module, which are hardware-based communication apparatuses, and the time calibration apparatus may execute a time calibration program stored in the memory 1005 and used by the processor 1001; after the time correction device is installed and powered on, the NBIOT communication module can automatically acquire the standard time of the network, wherein the acquisition of the standard time of the network is not limited to the NBIOT network, and the standard time of the network can be acquired by using networks such as a GPRS network, a WIFI network, a 3G network, a 4G network, a 5G network and the like.

Step S11, reading the stored latest timing record, wherein the timing record comprises the correction time;

in this embodiment, the time correction device sequentially obtains the correction time corresponding to each electric energy meter by extracting the history correction record list in which the connected local electric energy meters are stored, screens out the correction time in the latest time correction of each electric energy meter according to the sequence of the correction times, and arranges the screened correction times according to the sequence of the correction times.

In addition, the history correction record in the present embodiment further includes history data information of clock skew of each electric energy meter, history data of a judgment correction condition used in correction, other related performance data of the electric energy meter, and the like.

Step S12, reading the current clock time of the connected electric energy meter;

step S13, determining whether a first time difference between the standard time and the correction time and/or a second time difference between the standard time and the current clock time meets a preset time correction condition;

in this embodiment, according to the standard time, the correction time, and the current clock time information obtained by the time correction device, a first time difference between the standard time and the correction time is obtained through an information processing module of the time correction device, and a second time difference between the standard time and the current clock time is obtained at the same time, and the first time difference and the second time difference are compared with a preset time correction condition; in this embodiment, the first time difference value and the second time difference value at least satisfy one of the preset timing conditions, and then the preset timing conditions can be regarded as being met. When the method is applied for the first time, the correction time is the same as the standard time for acquiring the NBIOT network.

Step S14, correcting the current clock time to the standard time;

in this embodiment, when the first time difference and the second time difference at least satisfy one of the preset timing conditions, the information processing module of the time correction device updates the current clock time to the standard time of the NBIOT network, and updates the current clock time in time through the connected electric energy meter.

In this embodiment, a time correction method is provided, in which a standard time is obtained, stored time correction record information is obtained, an effective communication address list of an electric energy meter is searched, one-to-one connection with the electric energy meter is realized through a communication address of the electric energy meter, and then a current clock time of the electric energy meter is read according to an established network channel, and further, the current clock time of the electric energy meter is corrected to the standard time under a condition that a first time difference between the standard time and the correction time in the time correction record and a second time difference between the standard time and the current clock time satisfy the time correction condition through a preset time correction condition, so as to solve a problem of clock skew inside the electric energy meter.

Further, referring to fig. 3, the present invention provides a flowchart detailed in step S12, wherein based on the embodiment shown in fig. 2, the reading of the current clock time of the connected electric energy meter includes;

step S20, searching an effective electric energy meter communication address list;

in this embodiment, the communication module of the time correction device searches the communication address list of the electric energy meter, and selects an effective communication address of the electric energy meter.

Step S21, establishing connection with the electric energy meter through the communication address of the electric energy meter;

and according to the communication addresses of the effective electric energy meters obtained in the step S20, establishing connections between the effective electric energy meter addresses and the electric energy meters one by one, wherein the connection between the effective electric energy meter addresses and the electric energy meters can be a bluetooth connection, an RS-485 connection, a carrier communication connection, a GPRS connection, and the like.

Step S22, establishing connection with the electric energy meter through the communication address of the electric energy meter, and reading the current clock time in the connected electric energy meter;

the current clock time in the connected electric energy meter is obtained according to the connection channel in step S21, wherein the current clock time is the same as the standard time for obtaining the NBIOT network when the method is applied for the first time.

In this implementation, through searching for the effective communication address of the electric energy meter, the network control electric energy meter is realized, and then the clock time of the electric energy meter is obtained through the connecting channel, thereby facilitating the abnormal condition of the clock to be found in time, and then improving the network-hanging operational reliability of the electric energy meter, and improving the operability of the electric energy meter.

Referring to fig. 4, a second embodiment of the present invention provides a time correction method, based on the embodiment shown in fig. 2, where the preset timing condition includes a preset timing cycle, and the determining whether a first time difference value between the standard time and the correction time meets the preset timing condition includes:

step S40, judging whether the first time difference value meets a preset timing cycle;

in this embodiment, the preset module preset timing condition in the time correction device includes a preset timing cycle, and the execution selection of the subsequent step is further determined according to a coincidence condition of the acquired first time difference value and the preset timing cycle, where the timing cycle of the electric energy meter may be set in different timing cycles according to an actual condition of the electric energy meter.

The time correction period is a time period which needs to be corrected within a set time interval, when the time interval is a fixed time interval, for example, 10 days when the time correction period of the connected electric energy meter is set, namely, the time correction is performed on the electric energy meter every 10 days, when the first time difference value between the current clock time of the electric energy meter and the last correction time obtained by the time correction device is 10 days, the corresponding electric energy meter at the moment accords with the preset time correction condition.

The time interval of the timing cycle may also be a time interval with a certain regular arrangement, for example, the timing cycle may be set to an arithmetic progression satisfying (a + (N-1) × d) (N is the number of times of correction by the timing cycle, a is the cycle of first correction, and d is the difference of interval time of correction by the timing cycle), when a is 5 days and d is 2 days, the timing cycle that the first time difference of the first timing cycle time correction needs to be satisfied is 5 days, the timing cycle that the first time difference of the second timing cycle time correction needs to be satisfied is 7 days, and when the first time difference of the current clock time and the last correction time acquired by the electric energy meter satisfies the timing cycle of the arithmetic progression, the corresponding electric energy meter at this time conforms to the preset timing condition.

For example, a preset sequence of the timing cycle in a certain range of values may also be set, for example, the timing cycle satisfies (b + c COS pi (N-1)) (N is the number of times of correction by the timing cycle, b is the cycle of first correction, and c is the set time interval of fluctuation, where b ≧ c), when b is 10 days and c is 5 days, the timing cycle which the first time difference value of the first timing cycle correction needs to satisfy is 15 days, the timing cycle which the first time difference value of the second timing cycle needs to satisfy is 5 days, and when the first time difference value of the current clock time and the last correction time obtained by the electric energy meter satisfies the timing cycle, the corresponding electric energy meter at this time satisfies the preset timing condition.

In addition to the set time interval meeting a certain rule, the invention can set the time correction period as the acquired network real-time, specifically, two or more time points are selected each month, for example, 06 minutes 06 seconds at 06 days 06, 06 minutes 06 seconds at 16 days 06, 06 minutes 06 seconds at 26 days 06 of each month, when the acquired network standard time reaches the time point of the set time correction period, the corresponding electric energy meter at this time meets the preset time correction condition.

The setting of the timing period in which the present invention can be implemented is not limited to the above-described example.

According to the judgment result in the step S40, when the first time difference value satisfies the preset timing period, performing step S14: the current clock time is corrected to the standard time.

The implementation provides a time correction method, which includes setting a preset time correction period, judging whether the preset time correction period is met according to an acquired first time difference value between the standard time and the correction time, and correcting the current clock time to the standard time when the preset time correction period is met.

Referring to fig. 4, a third embodiment of the present invention provides a time correction method, based on the embodiment shown in fig. 2, where the preset time correction condition includes a preset total accumulated time difference value, and whether a second time difference value between the standard time and the correction time meets a preset time correction condition is determined;

step S50, judging whether the second time difference value exceeds the preset total accumulated time difference value;

in this embodiment, the preset module in the time correction device presets a timing condition including a preset total accumulated time difference value, and obtains a second time difference value between the standard time and the current clock time, that is, a time difference value of the accumulated clock deviation of the electric energy meter in a period from the latest correction to the current clock time of the electric energy meter is calculated, so as to determine the magnitude of the second time difference value and the preset total accumulated time difference value; the technical conditions of the existing electric energy meter definitely require that the total accumulated time difference in the full-temperature range is not more than 5 minutes, so that the preset total accumulated time difference is not more than 5 minutes.

Step S51, stopping timing and uploading the fault information of the electric energy meter;

according to the judgment result in the step S50, when the second time difference exceeds the preset total accumulated time difference, that is, the second time difference exceeds a preset critical value difference that the electric energy meter can be normally used, the calibration needs to be stopped and the fault information of the electric energy meter needs to be uploaded, because the internal clock deviation of the electric energy meter will generate an accumulated deviation along with the lengthening of the grid-connection time, and the clock deviation is not calibrated for a long time, the electric energy meter will continuously affect the use of the corresponding function of the electric energy meter along with the increase of the accumulated deviation, and if the internal clock deviation exceeds a certain set value, the electric energy meter will not be normally used subsequently, and a new electric energy meter needs to be replaced.

In this embodiment, a preset total accumulated time difference value is set, and according to a second time difference value between the acquired standard time and the current clock time, when the second time difference value exceeds the preset total accumulated time difference value, the electric energy meter with the fault is conveniently and timely found by stopping timing and uploading fault information of the electric energy meter, and then relevant countermeasures are taken, so that various problems caused by clock deviation in the electric energy meter are avoided.

Referring to fig. 4, a fourth embodiment of the present invention provides a time correction method, based on the embodiment shown in fig. 2, where the preset time correction condition includes a preset cumulative time difference of day, and the determining whether a second time difference between the standard time and the correction time meets the preset time correction condition further includes:

step S60, judging whether the second time difference value exceeds the preset daily accumulated time difference value;

in this embodiment, the preset timing condition of the preset module in the time correction device includes a preset daily accumulated time difference, a second time difference between the standard time and the current clock time is calculated, that is, a clock deviation value accumulated every 24 hours after the electric energy meter is corrected for the latest time is calculated, and the technical condition of the electric energy meter clearly requires that a daily accumulated error of a full temperature range is less than 1 second, so that the preset daily accumulated time difference is not greater than 1 second.

According to the judgment result of the step S60, when the second time difference value exceeds the condition of the daily cumulative time difference value, the step S14 may be performed: the current clock time is corrected to the standard time.

The embodiment provides a time correction method, which includes acquiring a second time difference between the standard time and the current clock time when an electric energy meter is corrected every 24 hours at the latest time from a preset daily accumulated time difference, and correcting the current clock time to the standard time when the second time difference exceeds the preset daily accumulated time difference, so that the embodiment judges the magnitude of the second time difference and the preset daily accumulated time difference by acquiring the second time difference of the electric energy meter every 24 hours, thereby avoiding the unpredictable problem caused by long-time accumulation, ensuring that the clock time of the electric energy meter is consistent with the standard time, further solving the problem of clock bias inside the electric energy meter, and prolonging the service life of the electric energy meter.

Referring to fig. 4, a fifth embodiment of the present invention provides a time correction method, based on the embodiment shown in fig. 2, where when the first time difference does not satisfy a preset time correction period, the determining whether the first time difference between the standard time and the correction time and/or the second time difference between the standard time and the current clock time meets a preset time correction condition further includes:

step S50: judging whether the second time difference value exceeds a preset total accumulated time difference value or not;

if not, go to step S60: judging whether the second time difference value exceeds a preset daily accumulated time difference value or not;

if not, go to step S12: and reading out the current clock time of the connected electric energy meter.

In this embodiment, under the condition that the first time difference value does not satisfy the preset timing period, step S50 is further executed: judging whether the second time difference value exceeds the preset total accumulated time difference value or not;

if the second time difference value does not exceed the preset total accumulated time difference value, the electric energy meter can be continuously used after being corrected;

step S60 is further executed: judging whether the second time difference value exceeds a preset daily accumulated time difference value or not;

if the second time difference still does not exceed the preset daily accumulated time difference, no correction is needed, and the electric energy meter can be normally used, so that the step S12 is executed: reading the current clock time of the connected electric energy meter; if the first time difference does not exceed 24 hours and the second time difference still exceeds the preset daily cumulative time difference, step S14 may be executed: the current clock time is corrected to the standard time.

This embodiment provides a time correction method, which includes presetting the time correction period, a total accumulated time difference value, and a daily accumulated time difference value, and according to a first time difference value between the acquired standard time and the correction time, and a second time difference value between the standard time and the current clock time, when the first time difference value does not satisfy a condition of the preset time correction period, further determining the size of the second time difference value, the preset total accumulated time difference value, and the daily accumulated time difference value, so as to avoid a problem of using each function due to clock deviation of an electric energy meter when the second time difference value is not within the preset time correction period.

Referring to fig. 5, the time calibration method according to the present invention provides a schematic flow chart of confirmation after time calibration, and based on the embodiment shown in fig. 2, the calibrating the current clock time to the standard time further includes:

step S80, reading the corrected clock time of the electric energy meter;

step S81, acquiring a third time difference value between the corrected clock time and the standard time;

in this embodiment, after the current clock time of the electric energy meter is updated only by the standard time, the time correction device reads the corrected clock time of the electric energy meter again, and further obtains a third time difference between the corrected clock time of the electric energy meter and the standard time.

Step S82, determining whether the acquired third time difference is within a preset time difference interval;

in this embodiment, the time correction device presets a time difference interval, that is, a time difference interval that can be ignored in the electric energy meter, and determines whether the third time difference is within the preset time difference interval according to the third time difference obtained in step S81.

Step S83, finishing timing and storing and uploading timing records;

in this embodiment, if the third time difference is within a preset time difference interval, it is regarded that the current correction operation is completed and the uploading correction time record information is stored; meanwhile, after the time calibration of the electric energy meter is completed each time, the second time difference value of the electric energy meter is the third time difference value.

If the third time difference is not within the preset time difference interval, continuing to step S12: and reading out the current clock time of the connected electric energy meter.

In this implementation, a time difference interval is preset, a third time difference between the corrected clock time and the standard time is obtained, and whether the third time difference is in the preset time difference interval is further judged, when the third time difference is in the preset time difference interval, the electric energy meter is corrected and confirmed, and then relevant correction record information is uploaded, and meanwhile, the stored correction record information not only can provide data support for next correction, but also can be used for checking historical correction records of the corresponding electric energy meter, and further the purpose of analyzing the performance of the electric energy meter is achieved.

In addition, if the invention is applied to the field, the time correction fault information does not need to be uploaded, the time correction period is set to be shorter, the electric energy meter can be locally connected with the time correction device, the manual time correction is executed, and the time correction information is obtained.

The specific embodiment of the computer-readable storage medium of the present invention is substantially the same as the embodiments of the time correction method described above, and is not repeated herein.

It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.

The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.

Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention essentially or contributing to the prior art can be embodied in the form of a software product, which is stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above and includes several instructions for causing a terminal device (which may be a time correction device, etc.) to execute the method according to the embodiments of the present invention.

The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

16页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种提高GNSS同步授时精度方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!