Disclosure of Invention
In order to solve the problems, the invention provides a method and a system for collecting and accurately time service of electric energy information, which can improve the time service precision and meet the requirement of current time-period charging on time precision.
The invention provides an electric energy information acquisition accurate time service method, which comprises the following steps: calculating and obtaining time delay delta t; according to the time delay delta T and the time service time T of the first time server1Calculating the correction time T of the second time server2The expression formula is: t is2=T1+Δt。
Preferably, the acquisition time delay Δ t includes: the first time server sends k times of first sending time t to the second time serverS1,nThe second time server records the first receiving time t for receiving the k times of first message informationR1,n(ii) a Wherein k is not less than 1, n is 1,2, k; the second time server sends j times of second sending time t to the first time serverS2,mThe first time server records a second receiving time t for receiving the j times of second message informationR2,m(ii) a Wherein j is not less than 1, m is 1,2, j is k +/-1; the time delay Δ t is expressed as the following equation:
preferably, the first time server or the second time server calculates the time delay Δ t.
Preferably, the first time server is a primary time server, and the second time server is a secondary time server; the first time server includes: one of an astronomical time service module, a background server and a concentrator; the second timeserver comprises: background server, concentrator, terminal equipment.
Further preferably, the terminal device includes an acquisition terminal, an electric energy meter or a handheld terminal.
Preferably, when the second timeserver does not support millisecond accuracy calibration, a calibration time T for the second timeserver is calculated3The expression formula is: t is3=T2+ Δ t ', where Δ t' is the millisecond delay required to integrate into a whole second.
Preferably, the first time server and the second time server adopt TDMA timing.
The invention also provides a system for collecting and accurately time-service electric energy information, which comprises: a first time server and a second time server; one of the first time server or the second time server is used for calculating an acquisition time delay delta t; one of the first time server or the second time server is used for sending the time service time T according to the time delay delta T and the time service time T sent by the first time server1Calculating the correction time T of the second time server2The expression formula is: t is2=T1+Δt。
Preferably, the first time server is a primary time server, and the second time server is a secondary time server; the first time server includes: one of an astronomical time service module, a background server and a concentrator; the second timeserver comprises: background server, concentrator, terminal equipment. The terminal equipment comprises an acquisition terminal, an electric energy meter or a handheld terminal.
The invention has the beneficial effects that: the time error is compensated and corrected by considering and calculating the time delay delta t caused by factors such as communication transmission and the like, so that the time error is controlled in a specified index range and controlled in millisecond level, and the requirement of the current time interval charging on the time precision can be completely met.
Detailed Description
The present invention is described in further detail below with reference to specific embodiments and with reference to the attached drawings, it should be emphasized that the following description is only exemplary and is not intended to limit the scope and application of the present invention.
This embodiment provides an accurate timing system of electric energy information acquisition, includes: a first timeserver and a second timeserver. The first time server comprises one or more of an astronomical time service module, a background server and a concentrator; the second timeserver comprises: one or more of a background server, a concentrator and a terminal device. The accurate timing system for electric energy information collection shown in fig. 1 includes: the system comprises an astronomical time service module, a background server, a concentrator and terminal equipment, wherein the concentrator and the terminal equipment are multiple. The terminal equipment comprises one of an acquisition terminal, an electric energy meter or a handheld terminal. When each primary time server carries out time service on a secondary time server (for example, an astronomical time service module carries out time service on a background server, the background server carries out time service on a concentrator, and the concentrator carries out time service on terminal equipment), transmission delay and equipment response delay exist in the communication process of each primary time server and the secondary time server, so that time error exists in the time service time of the terminal equipment for about 5 min. In order to eliminate the time error, the embodiment provides an electric energy information acquisition accurate timing method, including: calculating and obtaining time delay delta t; according to the time delay delta T and the time service time T of the first time server1Calculating the correction time T of the second time server2The expression formula is: t is2=T1+Δt。
Wherein, the calculation of the time delay Δ t comprises: the first time server sends to the instituteThe second time server sends k times of times carrying the first sending time tS1,nThe second time server records the first receiving time t for receiving the k times of first message informationR1,n(ii) a Wherein k is not less than 1, n is 1,2, k; the second time server sends j times of second sending time t to the first time serverS2,mThe first time server records a second receiving time t for receiving the j times of second message informationR2,m(ii) a Wherein j is not less than 1, m is 1,2, j is k +/-1; the time delay Δ t is expressed as the following equation:
taking a link in the whole system of fig. 1 as an example, the concentrator is used as a primary time server, and the terminal device (preferably an electric energy meter) is used as a secondary time server. As shown in fig. 2, the specific process is as follows:
s11, the concentrator initiates broadcast time service requests to a plurality of electric energy meters and sends time tS1,1The time service request is carried in the time service request;
s21, after the electric energy meter receives the time service request sent by the concentrator, firstly, the received time t is recordedR1,1And analyzing the time error, wherein the time error is tR1,1-tS1,1:
If the time error is within the preset error range, stopping correcting the time and informing the concentrator that the time does not need to be corrected;
and if the time error exceeds the preset error range, the next step is carried out.
S31, the electric energy meter sends time service confirmation information to the concentrator and sends time tS2,1And associated transmission time tS1,1Reception time tR1,1And the time service confirmation information is carried in the time service confirmation information.
S41, the concentrator receives the time service confirmation information sent by the electric energy meter and records the receiving time tR2,1。
According to t as aboveS1,1,tR1,1,tS2,1And tR2,1The time delay deltat can be calculated,
in the above process, the concentrator and the electric energy meter respectively send message information to the opposite party once and receive message information sent by the opposite party once.
In order to reduce a certain probability event and improve the calculation accuracy of the time delay delta t, as shown in fig. 2, the concentrator and the electric energy meter send message information mutually for multiple times, then an average value is obtained to obtain the time delay delta t,
wherein k is equal to or greater than 1, j is k ± 1, n is 1,2, k, m is 1,2, j.
In the process shown in fig. 2, a timing request is first initiated by the concentrator. It is understood that a timing request can also be initiated from the power to the concentrator, and the specific process is shown in fig. 3, and the principle process is basically similar to that in fig. 2.
S12, the electric energy meter initiates a timing request to the concentrator and sends time tS2,1The time correction request is carried in the time correction request;
s22, after the concentrator receives a timing request sent by the electric energy meter, recording the receiving time tR2,1;
S32, the concentrator sends timing confirmation information to the electric energy meter, and sends time tS1,1And associated transmission time tS2,1Reception time tR2,1And carried together in the timing confirmation information.
S42, the electric energy meter receives the timing confirmation information sent by the concentrator and records the receiving time tR1,1。
Similarly, according to t aboveS2,1,tR2,1,tS1,1And tR1,1The time delay deltat can be calculated,
It can also be understood that the concentrator and the electric energy meter send message information to each other for a plurality of times, and then an average value is obtained to obtain the time delay Δ t.
The time delay Δ t obtained by the above calculation; then according to the time service time T of the first time server1Calculating the correction time T of the second time server2The expression formula is: t is2=T1+ Δ t. The calculation of the time delay Δ t is performed by the body that received the message information last time, for example: a concentrator or an electric energy meter. Because the astronomical time service module, the background server and the concentrator all have the time service function, the accuracy of millisecond level is supported, but the electric energy meter does not necessarily support the function of millisecond calibration. For the electric energy meter which does not support the millisecond calibration function, the concentrator adopts a millisecond synchronization mechanism, namely: integration into whole seconds is done by millisecond delay. As shown in FIG. 4, the calibration time T of the electric energy meter is calculated3,T3=T2+ Δ t ', where Δ t' is the millisecond delay required to integrate into a second.
Electric energy meter supporting millisecond calibration function according to calibration time T2Electric energy meter not supporting millisecond calibration function according to calibration time T3And performing time calibration.
By the time error measuring algorithm, the communication transmission time of each stage and the time delay delta t caused by equipment response can be obtained, the time error of the terminal equipment can be controlled within 250ms by correcting and compensating the time delay, the clock error is greatly reduced, good technical support is provided for time-sharing charging of the electricity information acquisition system, and dispute between resident users and an electric power company about the problem of time-sharing cost is eliminated. Meanwhile, in order to be compatible with different types of electric meter types, a millisecond timing synchronization mechanism is designed, so that the method has wide application.
In addition, in order to ensure that unexpected uncertain delay caused by busy channels and other reasons of communication cannot occur in the process of calculating the time delay delta t, an independent service TDMA time sequence is designed in the communication based on the broadband carrier. And by adopting the TDMA time sequence, the reliable sending opportunity can be determined, and the busy time period of the channel is avoided.
Each terminal device comprises a carrier communication unit II, and each concentrator comprises a carrier communication unit I; the carrier communication unit I plans a timing sequence in advance and maintains a communication network clock, as shown in fig. 5, divides the working timing sequence into a routing time slot, a contention time slot and a TDMA time slot, and informs each carrier communication unit II of the timing sequence arrangement information and the network clock through a communication protocol, and each carrier communication unit II calibrates the communication network clock to the network clock consistent with the carrier communication unit I, so that the whole network clocks are synchronized, and all communication units work according to the unified network clock and the unified timing sequence arrangement, and keep the whole network timing synchronization. And the carrier communication unit II acquires the TDMA working time slot according to the time sequence and the network clock planned by the carrier communication unit I, synchronizes the network clock of the carrier communication unit II with the network clock of the carrier communication unit I, and completes corresponding communication services according to the arranged working time sequence. Therefore, when the terminal works in the TDMA time slot section, other non-TDMA services stop communication, and only the independent bound TDMA services work, so that reliable transmission of specific services caused by routing transmission or busy communication is ensured.
When the concentrator needs to correct the time of the terminal device, a broadband carrier unit I in the concentrator waits for the arrival of a network time sequence TDMA, all the terminal devices work in a TDMA time period, the whole network is located at the same starting point in the TDMA time slot, and the concentrator starts a time correction process and corrects the clock of the target terminal device. Because the time of communication transmission in the bound TDMA communication is determined, the special communication time slot belonging to the specific service does not cause uncertain transmission delay caused by collision avoidance or routing and the like caused by heavy network communication in network transmission.
The foregoing is a more detailed description of the invention in connection with specific/preferred embodiments and is not intended to limit the practice of the invention to those descriptions. It will be apparent to those skilled in the art that various substitutions and modifications can be made to the described embodiments without departing from the spirit of the invention, and these substitutions and modifications should be considered to fall within the scope of the invention.