Method and device for carrying out clock timing on concentrator through carrier network, and storage medium

When clocking the concentrator through the carrier network, the system time deviation problem caused by the concentrator clock battery is solved, and the correct system time is obtained in a weak signal environment, reducing errors, and avoiding meter reading and data storage abnormalities.

CN120074728APending Publication Date: 2025-05-30QINGDAO ITECHENE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510301840.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-14
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

The clock battery of the concentrator is powered off, causing system time deviation, affecting the execution of meter reading tasks and data storage. Especially in an environment with weak GPS signals, it is difficult to effectively calibrate through GPS.

Method used

The clock calibration of the concentrator through the carrier network includes the process of synchronizing the carrier, counting the number of meters successfully formed, copying and reading the current time of the meter, judging the number of successful copying and reading, and calculating the current concentrator clock time.

Benefits of technology

It realizes that when the concentrator clock battery is out of power, the correct system time is obtained through the carrier network, the error between the system time and the real time is reduced, and the meter reading and data storage abnormalities are avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120074728A_ABST
    Figure CN120074728A_ABST
Patent Text Reader

Abstract

The invention provides a method and equipment for carrying out clock timing on a concentrator through a carrier network and a storage medium, and belongs to the technical field of concentrator timing based on computer data processing. The method comprises the following steps of: counting failure meters and timeout meters according to an early meter reading condition, skipping the meters with poor current network conditions in a subsequent round of reading, and counting the current time for reading all the meters with a minimum time error; and the error between the system time set by the concentrator and the real time is controlled within the threshold range as far as possible by using a calculation method of screening the size and threshold control, so that the error is reduced. The invention provides an effective algorithm for carrying out time calibration on the concentrator through a current existing power grid carrier system, the system time in the current power grid is calculated in the shortest time as far as possible, and various meter reading and recording abnormity problems of the concentrator caused by system time errors are prevented.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of concentrator time calibration based on computer data processing, and particularly relates to a method, device, and storage medium for clock calibration of a concentrator through a carrier network. Background Art

[0002] Due to the rapid development of the national power grid in recent years, each province has purchased and deployed a large number of concentrators. As the usage time of the concentrators increases, it has recently been found that the clock batteries in many concentrators will experience power loss. The clock batteries of the concentrators will have insufficient power, resulting in the clock being unable to keep accurate time. At this time, the system time after the concentrator is powered on will have a large deviation, or even be an invalid time directly. Also, since most meter reading tasks in domestic concentrators are configured with an effective execution time, due to the incorrect system time, the task execution time will be misjudged, which will further lead to the non-execution of the task, resulting in drawbacks. Even if the configured task execution time can be correctly scheduled, due to the incorrect system clock, serious problems such as incorrect reading time carried during meter reading, failure in clock judgment when receiving meter reading data, incorrect storage time stamp carried when storing data, and reverse power consumption will occur.

[0003] Therefore, after the concentrator is restarted and power loss is detected, an effective method is needed to calibrate the system time of the concentrator. Although most concentrators have a GPS on their 4G module, since many concentrators are deployed in places with poor signals such as building pipe wells and basements, the GPS signal will also be very weak. Therefore, a set of methods for effective time calibration through carriers is urgently needed. Summary of the Invention

[0004] In view of the above problems, the first aspect of the present invention provides a method for clock calibration of a concentrator through a carrier network, including the following processes: S1, after carrier synchronization is completed, count the number F of successfully networked electricity meters in the current network; S2, read the current clock time of each electricity meter, and obtain the time of N electricity meters with successful reading; S3, judge the number N of successfully read electricity meters; If N is equal to F, enter S4, count all the current times with successful reading, and obtain the current system time; If N is less than half of the number F of electricity meters, re-read and screen the electricity meters with failed reading. After screening, clear the previous reading data, re-read the electricity meters marked as successfully read for one round, enter S4, count all the current times with successful reading, and obtain the current system time; If N is greater than or equal to half of the number of electricity meters F, no supplementary reading is performed on the electricity meters with failed readings. Proceed to S4, count all the current times with successful readings, and obtain the current system time. S4. Based on the number of electricity meters N with successful readings and the corresponding designed different calculation methods, calculate the current concentrator clock time.

[0005] Preferably, read the data item 0x40000200 for all 698 electricity meters with successful networking, and read the data items 0x04000101 and 0x04000102 for all 645 electricity meters, and collect the current time of each electricity meter.

[0006] Preferably, the supplementary reading and screening of the electricity meters with failed readings are specifically as follows: If there are failed or timed-out meters in the current round of reading, attempt to perform 3 rounds of supplementary reading on this meter, and count the number of timeouts and failures of each meter in the total four readings, and screen out the electricity meters with poor communication during the current period.

[0007] The screening criterion is that for the total four readings of the first round of reading plus the subsequent three rounds of supplementary reading, the electricity meters with (the number of failed readings + the number of timed-out readings) less than or equal to 2 are qualified meters.

[0008] Preferably, in S3, if F is less than or equal to 3, as long as there is an electricity meter with a successful reading, directly proceed to S4, count all the current times with successful readings, and obtain the current system time.

[0009] Preferably, S4 is specifically as follows: Count and sort all the current times with successful readings, and set a threshold thredhold in advance; a. If the number of data to be calculated is 1, record this time as the current time; b. If the number of data to be calculated is 2, take the average of the two times as the current time c. If the number of data to be calculated is greater than or equal to 3, find the maximum and minimum values of the obtained times from all the current data, and calculate the difference between the two: i. If the difference is less than or equal to thredhold, calculate the average of all the current data as the current system time; ii. If the difference is greater than thredhold, take the maximum and minimum values of the other values except these two maximum and minimum values, and calculate the difference between the two again, and judge with the threshold until the difference between the two is less than or equal to thredhold, or the number of remaining data to be calculated is less than or equal to 3. iii. Calculate the average value of the remaining data as the most likely time point. According to the three-point estimation algorithm in the beta distribution, that is, the maximum and minimum values in the beta distribution are given lower weight coefficients of 1, and the average value is given the highest weight coefficient of 4, so as to obtain a time value closer to the actual result: Expected value TE = (O + 4M + P) / 6 O is the maximum time value selected in ii; P is the minimum time value selected in ii; M is the average time calculated after removing the maximum and minimum values in ii.

[0010] Preferably, the specific way to set the threshold thredhold is as follows: Compare the minimum reading cycle time of all meter reading tasks configured in the current concentrator with the meter reading timeout time set in the concentrator, take the minimum of the two, and divide it by 2 to obtain the threshold thredhold.

[0011] The second aspect of the present invention provides a device for calibrating the clock of a concentrator through a carrier network. The device includes at least one processor and at least one memory, and the processor and the memory are coupled; a computer execution program is stored in the memory; when the processor executes the computer execution program stored in the memory, the processor executes a method for calibrating the clock of a concentrator through a carrier network as described in the first aspect.

[0012] The third aspect of the present invention provides a computer-readable storage medium. A computer program or instruction is stored in the computer-readable storage medium. When the program or instruction is executed by a processor, the processor executes a method for calibrating the clock of a concentrator through a carrier network as described in the first aspect.

[0013] Compared with the prior art, the present invention has the following beneficial effects: The present invention realizes a method for obtaining the correct system time through a carrier network when the clock battery of the concentrator is out of power and the correct system time cannot be obtained. By controlling the meter reading of the electric meter, the calculation and filtering of the timeout failure table, and the screening and calculation of the obtained data, the error between the obtained system time and the real time is reduced, and the error between the system time set by the concentrator and the real time is controlled within the threshold range as much as possible to reduce the error.

[0014] The present invention provides an effective algorithm for calibrating the concentrator through the existing power grid carrier system, and calculates the system time in the current power grid as quickly as possible to prevent various abnormal problems of meter reading and recording caused by the wrong system time of the concentrator. Description of the Drawings

[0015] Figure 1 This is a flowchart for the present invention to read the meter through the carrier network and obtain the current time of the electric meter.

[0016] Figure 2 This is an algorithm flowchart for the present invention to calculate the system time according to the acquired data.

[0017] Figure 3 This is a schematic diagram of the device structure for the present invention to perform clock calibration on the concentrator through the carrier network. Detailed implementation manner

[0018] After the initialization of the concentrator is completed, the present invention mainly performs carrier synchronization in the carrier module of the concentrator and runs after successfully networking with the electric meters.

[0019] Please refer to Figure 1 and Figure 2 The present invention mainly provides a method for performing clock calibration on the concentrator through the carrier network, including the following processes: S1. After the carrier synchronization is completed, count the number F of successfully networked electric meters in the current network; First, it is necessary to clarify the power line carrier communication protocol used by the concentrator. Different protocols have different instruction formats and operation methods.

[0020] Send instructions and receive responses: The concentrator connects to the electric meter and networks with the electric meter. After successful networking, count the number of successfully networked electric meters, and send communication messages to each electric meter through the carrier channel to query various information and status of the electric meter. After the electric meter receives the message, it makes a reply, and after the concentrator receives the reply, it makes corresponding processing on various reply information.

[0021] S2. Read the current clock time of each electric meter to obtain the time of N successfully read electric meters; For example, read the data item 0x40000200 for all successfully networked 698 electric meters, and read the data items 0x04000101 and 0x04000102 for all 645 electric meters, and collect the current time of each electric meter.

[0022] Assume that a certain programming environment (such as Python) is used for operation, and the concentrator and the electric meter have established a communication connection through the carrier channel.

[0023] Define two functions read_meter_data and calc_plc_current_time, which are used to read the data of the electric meter and calculate the current time according to the acquired data respectively (in practice, these two functions need to be implemented in detail according to the specific electric meter communication protocol and communication method).

[0024] Suppose there are two lists storing the 698 electric meter addresses and 645 electric meter addresses that have successfully formed a network respectively.

[0025] By looping through the list of 698 electric meter addresses, read the data item 0x40000200 for each electric meter to obtain its current time.

[0026] Similarly, by looping through the list of 645 electric meter addresses, read the data items 0x04000101 and 0x04000102 for each electric meter to obtain its current time.

[0027] S3. Judge the number N of electric meters for which the reading is successful; If N is equal to F, enter S4, count all the current times for which the reading is successful, and obtain the current system time; If N is less than half of the number F of electric meters, re-read and screen the electric meters for which the reading fails. After the screening is completed, clear the previous reading data, re-read the electric meters marked as successfully read once, enter S4, count all the current times for which the reading is successful, and obtain the current system time; re-read and screen the electric meters for which the reading fails. Specifically, if there are failed or timed-out meters in the current round of reading, try to re-read the meter 3 times, and count the number of timeouts and failures for each meter in the total of 4 readings, and screen out the electric meters with poor communication during the current period. The screening criterion is that for the total of 4 readings in the first round of reading plus the subsequent 3 rounds of re-reading, the electric meters for which (the number of failed readings + the number of timed-out readings) is less than or equal to 2 are qualified meters.

[0028] If N is greater than or equal to half of the number F of electric meters, do not re-read the electric meters for which the reading fails, enter S4, count all the current times for which the reading is successful, and obtain the current system time; At the same time, there is also a situation. If F is less than or equal to 3, as long as there is an electric meter for which the reading is successful, directly enter S4, count all the current times for which the reading is successful, and obtain the current system time. Here, 3 is taken because the three-point estimation method of beta distribution will be used when calculating the time later. In the three-point estimation, a maximum value, a minimum value, and a most likely value need to be found. When there are less than or equal to 3 meters, there is no need to eliminate invalid meters and perform three-point estimation. The sample size is too small, and it is more reasonable to directly take the average value.

[0029] S4. Based on the number N of electric meters for which the reading is successful and different calculation methods designed accordingly, calculate the current concentrator clock time. A specific design method is as follows: Count and sort all the current times for which the reading is successful, and set a threshold thredhold in advance; a. If the number of data to be calculated is 1, record this time as the current time; b. If the number of data to be calculated is 2, then take the average of the two times as the current time c. If the number of data to be calculated is greater than or equal to 3, then find the maximum and minimum values of the obtained times from all the current data, and calculate the difference between the two: i. If the difference is less than or equal to the thredhold, then calculate the average of all the current data as the current system time; ii. If the difference is greater than the thredhold, then take the maximum and minimum values of the other values excluding these two maximum and minimum values, and calculate the difference between the two again, and judge with the threshold until the difference between the two is less than or equal to the thredhold, or the number of remaining data to be calculated is less than or equal to 3; iii. Calculate the average of the remaining data as the most likely time point. According to the three-point estimation algorithm in the beta distribution, that is, the maximum and minimum values in the beta distribution are given lower weight coefficients of 1, and the average value is given the highest weight coefficient of 4, so as to obtain a time value closer to the actual result: Expected value TE = (O + 4M + P) / 6 O is the maximum time value selected in ii; P is the minimum time value selected in ii; M is the average time calculated after excluding the maximum and minimum values in ii.

[0030] The specific method for setting the threshold thredhold is as follows: Compare the minimum reading cycle time of all the configured meter reading tasks in the current concentrator with the meter reading timeout time set in the concentrator, take the minimum of the two, and divide it by 2 to obtain the threshold thredhold.

[0031] Assume that the nearest electric meter connected to the concentrator is right in front, and the time spent on meter reading (sending a message plus receiving a message) is 0. For the farthest electric meter connected to the concentrator, the time spent on meter reading is exactly one meter reading cycle or one meter reading timeout time. Therefore, calculated according to the average time spent on one meter reading, it is (0 + Tm) / 2, which is the value of threadhold.

[0032] Such as Figure 3As shown, the present invention also provides a device for clock calibration of a concentrator through a carrier network. The device includes at least one processor and at least one memory, and also includes a communication interface and an internal bus; a computer execution program is stored in the memory; a computer execution program is stored in the memory; when the processor executes the computer execution program stored in the memory, the processor can execute a method for clock calibration of a concentrator through a carrier network as described above. The internal bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus. The memory may include high-speed RAM memory, and may also include non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a disk, or an optical disc, etc.

[0033] The device can be provided as a terminal, a server, or other forms of devices. In an exemplary embodiment, the electronic device can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for executing the above method.

[0034] The present invention also provides a computer-readable storage medium in which a computer execution program is stored. When the computer execution program is executed by a processor, the processor can execute a method for clock calibration of a concentrator through a carrier network as described above.

[0035] Specifically, a system, device, or equipment equipped with a readable storage medium can be provided. Software program codes for implementing the functions of any one of the above embodiments are stored on the readable storage medium, and the computer or processor of the system, device, or equipment is caused to read and execute the instructions stored in the readable storage medium. In this case, the program code read from the readable medium itself can implement the functions of any one of the above embodiments. Therefore, the machine-readable code and the readable storage medium storing the machine-readable code constitute a part of the present invention.

[0036] The above are only the preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the protection scope of the present application.

[0037] Although the specific implementation manners of the present invention are described above, they do not limit the protection scope of the present invention. Those skilled in the art should understand that, based on the technical solutions of the present invention, various modifications or deformations that can be made by those skilled in the art without creative efforts are still within the protection scope of the present invention.

Claims

1. A method for clock synchronization of a concentrator through a carrier network, characterized in that: The process includes: S1, after carrier synchronization is completed, count the number of successfully networked meters in the current network F; S2, reading the current clock time of each electric meter, and obtaining the time of N electric meters that have been successfully read; S3, determining the number N of electricity meters that have been successfully read; If N is equal to F, then enter S4 to count all current times of successful copying and obtain the current system time; If N is less than half of the number of meters F, the meters that failed to be read are read again and screened. After the screening is completed, the previous reading data is cleared, and a round of reading is performed again for the meters marked as successfully read. Enter S4, count all the current times of successful reading, and obtain the current system time; If N is greater than or equal to half of the number of meters F, the meters that failed to be read are not read again, and the process goes to S4 to count all current times that were successfully read and obtain the current system time; S4, based on the number N of successfully read electricity meters and the corresponding different calculation methods, calculate the current concentrator clock time.

2. The method for clock synchronization of a concentrator through a carrier network as claimed in claim 1, characterized in that: For all 698 meters that are successfully networked, read the data item 0x40000200, for all 645 meters, read the data items 0x04000101 and 0x04000102, and collect the current time of each meter.

3. The method for clock synchronization of a concentrator through a carrier network as claimed in claim 1, characterized in that: The method of re-reading and screening the failed meters is as follows: if there is a failed or timed-out meter in the current round of reading, try to re-read the meter for 3 rounds, and count the number of timeouts and failures of each meter in the total of four readings, and screen out the meters with poor communication in the current period.

4. A method for clock synchronization of a concentrator through a carrier network as claimed in claim 3, characterized in that: In S3, if F is less than or equal to 3, as long as there is an electricity meter with successful reading, directly enter S4, count all current times of successful reading, and obtain the current system time.

5. The method for clock synchronization of a concentrator through a carrier network as claimed in claim 1, characterized in that: The S4 is specifically: Statistically sort all the current times of successful copying and read, and set a threshold thredhold in advance; a. If the number of data to be calculated is 1, then record this time as the current time; b. If the number of data to be calculated is 2, take the average of the two times as the current time c. If the number of data to be calculated is greater than or equal to 3, find the maximum and minimum values ​​of the acquired time from all current data and calculate the difference between the two: i. If the difference is less than or equal to threshold, the average value of all current data is calculated as the current system time; ii. If the difference is greater than thredhold, take the maximum and minimum values ​​of the values ​​other than the two maximum and minimum values, and calculate the difference between the two again, and judge with the threshold until the difference between the two is less than or equal to thredhold, or the number of remaining data to be calculated is less than or equal to 3; iii. Calculate the average value of the remaining data as the most likely time point. According to the three-point estimation algorithm in the Beta distribution, the maximum and minimum values ​​in the Beta distribution are given a lower weight coefficient of 1, and the average value is given the highest weight coefficient of 4, so as to obtain a time value closer to the actual result: Expected value TE = (O + 4M + P) / 6 O is the maximum time value screened in ii; P is the minimum time value screened in ii; M is the average time calculated after removing the maximum and minimum values ​​in ii.

6. The method for clock synchronization of a concentrator through a carrier network as claimed in claim 1, characterized in that: The specific method of setting the threshold thredhold is: The minimum reading cycle time of all meter reading tasks configured in the current concentrator is compared with the meter reading timeout time set in the concentrator, and the minimum value of the two is taken and divided by 2 to obtain the threshold thredhold.

7. A device for clock synchronization of a concentrator via a carrier network, characterized in that: The device includes at least one processor and at least one memory, the processor and the memory are coupled; a computer execution program is stored in the memory; when the processor executes the computer execution program stored in the memory, the processor executes a method for clock synchronization of a concentrator through a carrier network as described in any one of claims 1 to 6.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program or instruction, and when the program or instruction is executed by the processor, the processor executes a method for clock synchronization of a concentrator through a carrier network as described in any one of claims 1 to 6.