The method of reading power meters logout in the AMI system
Technical field
The present invention relates to the method for reading power meters logout in a kind of AMI system, especially under DLMS agreement (a kind of international ammeter communication protocol), concentrator or main website read the ammeter logout.
Background technology
Currently use power line carrier communication or GPRS communication to set up AMI(Advanced Metering Infrastructure at electric energy meter) during system, use international ammeter communication protocol DLMS/COSEM(to be formed by DLMS and COSEM two parts organic assembling, the former defines message specification, the latter defines the electric energy meter interface model) communicate with concentrator or main website, strictly follow and read logout under the protocol requirement and can have following several problem:
If a plurality of events have occured in 1 table meter in certain time period, main website or concentrator need the mode of usage data piece that these data are read up, communication process requires complete continuous, as long as wherein occur in any one data block communication process unusually, so just need again again complete reading.Owing to using at present power line carrier, PLC to communicate by letter with GPRS, packet loss appears in power line carrier, PLC especially in communication process or other unusual probability are higher, can reduce significantly system communication efficient if the data of usage data piece read.
2, packet is usually all larger during usage data piece reading out data, can reduce the system communication success ratio when using power line carrier, PLC, further has influence on system communication efficient.
3, concentrator or main website are when cyclic query ammeter event, that event class is gone inquiry one by one at present, because the event type of storage is many in the ammeter, even like this when ammeter does not have event to occur or event only occurs seldom, also need to take the query time of more long concentrator or main website, greatly consume the communication utilization ratio of communication media, when using GPRS communication, also can increase the communication flows of a large portion.
The inefficiency that the problems referred to above cause the ammeter logout of AMI system to read badly influences the user to the experience of AMI system, has taken simultaneously quite large communication media service time, and the extendability of follow-up AMI systemic-function also is very limited.
Summary of the invention
The technical problem to be solved in the present invention is: the method for reading power meters logout in a kind of AMI system is provided for the problem of above-mentioned existence, to avoid in the transmission of data packets abnormal problem such as loss of data, improves the success ratio of communication.
The technical solution adopted in the present invention is: the method for reading power meters logout in the AMI system is characterized in that step is as follows:
A, main website or concentrator are regularly initiated ammeter current event status information to ammeter and are read frame;
B, ammeter send to main website or concentrator with self current event status information as replying frame after receiving that state information of event reads frame;
If the logout of one or more types is arranged in the c state information of event, main website or concentrator are judged first its event type, then the logout to ammeter initiation corresponding event type reads frame, reads the sometime interior logout of section, and be the current time closing time of this time period;
If d should have one or more logout in the time period, event log data corresponding to that event that ammeter then will occur the earliest replies to main website or concentrator, comprises the type of event and the time that event occurs in the event log data;
E, main website or concentrator initiate next time to this ammeter that logout reads frame, and upgrade and read the time period, and its zero-time is next second of previous event time of origin;
If f still has one or more logout in the new time period, ammeter then replies to main website or concentrator with event log data corresponding to that event that occurs the earliest in the new time period, and then successively repeating step e, f do not have logout until ammeter is replied;
G, main website or concentrator initiate to remove the state information of event frame to ammeter, remove the state information of event that has recorded in the ammeter.
Described state information of event is totally 4 bytes, a kind of event type of each corresponding indication wherein, as long as a certain moment, event occurs, ammeter just with in the state information of event to should event type become 1.
Among the described step c, if there is not logout in the state information of event, returns step a next piece ammeter is operated.
Among the described step c, the zero-time of described time period is main website or concentrator last time to the time that this ammeter initiated event status information reads frame.
Among the step c, if carry out first reading of logout after this ammeter operation, the zero-time of described time period is the time that ammeter brings into operation.
Among the described step c, if multiple event type is arranged, main website or concentrator with the logout of a certain type in the above-mentioned time period read complete after, read successively again the logout of other types in this time period.
Among the described step f, if do not have logout in the new time period, then replying does not have logout, and execution in step g.
After step g is finished, returns step a next piece ammeter is operated.
All types of events that described state information of event has occured when having comprised the ammeter operation.
The mode of described ammeter recording events status information is that ammeter just is recorded in the event type of this event in the state information of event, and can not delete voluntarily this state information of event as long as a certain moment, event occurs.
The invention has the beneficial effects as follows: 1, main website or concentrator read logout and adopt the on a time period mode of retrieval among the present invention, namely only read the logout in a certain event section, control simultaneously ammeter and at most only reply a logout (if should in the time period logout be arranged) at every turn, thereby reduced the data volume of each communication, the abnormal problems such as loss of data that the data packet transmission of having avoided multiple affair to cause is brought have increased the success ratio of communication greatly.2, state information of event totally 4 bytes (32), wherein a kind of event type of each corresponding indication if a certain position wherein is 1, then shows the event that this type occured, if 0, then show the event that this type do not occur; Main website or concentrator only need regularly go to read state information of event, just can know all events that current table meter occurs, and navigate to fast the current event of table meter, and avoided one by one that event type goes to inquire about shared a large amount of communication medias and time, improved communication efficiency.
Description of drawings
Fig. 1 is intelligent grid the framework of the information system figure among the present invention.
Fig. 2 is the process flow diagram of reading power meters logout among the present invention.
Embodiment
As shown in Figure 1, this routine intelligent grid is comprised of one group of intelligent electric meter 3 under main website 1, concentrator 2 and this concentrator, wherein is connected by line of electric force 4 between concentrator 2 and each ammeter 3, realizes the transmission of information.As shown in Figure 2, the method for the present embodiment reading power meters logout may further comprise the steps:
A, main website 1 regularly initiate ammeter current event status informations to ammeter 3 by GPRS network or concentrator 2 by line of electric force 4 and read frame (be reading among Fig. 2 state-event frame), and main website 1 or concentrator 2 only operate some ammeters at every turn.
B, ammeter 3 can reply self current event status information at once receiving after state information of event reads frame, namely send a reply the state-event frame to main website 1 or concentrator 2.All types of events that ammeter 3 occurs have been comprised in the state information of event when operation.The mode of ammeter 3 recording events status informations is as long as a certain moment, event occurs, ammeter 3 just is recorded in the event type of this event in the state information of event (be ammeter will in the state information of event position that should event type be become 1), and can not delete voluntarily this state information of event, only have main website 1 and concentrator 2 can remove this information, assurance event one is in time read by main website 1 or concentrator 2 surely.
C, main website 1 or concentrator 2 are analyzed after receiving the state information of event that ammeter 3 replys, analytic process is as follows: if there is not logout in the state information of event, when then showing this ammeter operation any event did not occur, return step a next piece ammeter is operated this moment; If the logout of one or more event types is arranged in the state information of event, one or more events occured when then showing this ammeter operation, what type what this moment, main website 1 or concentrator 2 were judged first generation is, the logout of then initiating the corresponding event type to ammeter 3 reads frame (it is not identical that its logout of different event types reads frame), read the sometime interior logout of section, be that main website 1 or concentrator 2 read the on a time period mode of retrieval of logout employing, each logout that only reads in some time periods, the zero-time of this time period can arbitrarily be set, but the skip for fear of logout, guarantee simultaneously the efficient that logout reads, this example should the time period zero-time be set as main website 1 or 2 last times of concentrator to time that these ammeter 3 initiated event status informations read frame, if reading of the postrun first logout of ammeter, then this zero-time is the time that ammeter brings into operation, and is always the current time closing time.
D, ammeter 3 after receiving logout that main website 1 or concentrator 2 send and reading frame, logout that can be within the time period (time period described in the step c) that table inner retrieval main website 1 or concentrator 2 will read; If one or more logout should be arranged in the time period, 3 in ammeter is replied that logout that occurs the earliest in this time period, event log data corresponding to that event that is about to occur the earliest in this time period replies to main website 1 or concentrator 2, comprises the type (being the event of what type) of event and the time that event occurs in the event log data of answer.
E, main website 1 or concentrator 2 are received (being that ammeter 3 has been replied an event log data) after the event log data that ammeter replys, main website 1 or concentrator 2 are according to the temporal information in this event log data (being the time that event occurs), the time period is read in renewal, and again read frame to this ammeter initiated event record, the zero-time of this time period is next second of previous event time of origin, and still be the current time closing time.
If f still has one or more logout in the new time period, 3 in ammeter is replied that logout that occurs the earliest in the new time period, event log data corresponding to that event that is about to occur the earliest in the new time period replies to main website 1 or concentrator 2, then successively repeating step e, f, until replying, ammeter 3 do not have logout, last main website 1 or concentrator 2 stop logout and read, and execution in step g; If do not have logout in the new time period, 3 answers of ammeter do not have logout, and main website 1 or concentrator 2 stop logout and read, and execution in step g.Specialize as of the present invention, if ammeter 3 has recorded three events, the time of record is respectively the 12:00:00(12 point 0 minute and 0 second of 2012-5-1), the 12:03:00(12 point of 2012-5-1 3 minutes and 0 second), the 12:05:00(12 point of 2012-5-1 5 minutes and 0 second), suppose that the current time is the 12:06:00 of 2012-5-1, main website 1 or concentrator 2 can be done following retrieval
It is the 12:06:00 of 11:59:00 ~ 2012-5-1 of 2012-5-1 that main website 1 or concentrator 2 issue the retrieval time section, and this moment, 3 in ammeter was replied a logout that occurs the earliest in this time period, and the time is the 12:00:00 of 2012-5-1;
Main website 1 or concentrator 2 are initiated for the second time, and logout reads frame, the zero-time of revising section retrieval time is next second of previous event time of origin, be the 12:06:00 of 12:00:01 ~ 2012-5-1 of 2012-5-1,3 in ammeter is replied the logout that occur the earliest in the section new retrieval time at this moment, and the time is the 12:03:00 of 2012-5-1;
Main website 1 or concentrator 2 are initiated for the third time, and logout reads frame, the zero-time of revising section retrieval time is next second of previous event time of origin, be the 12:06:00 of 12:03:01 ~ 2012-5-1 of 2012-5-1,3 in ammeter is replied the logout that occur the earliest in the section new retrieval time at this moment, and the time is the 12:05:00 of 2012-5-1;
Main website 1 or concentrator 2 are initiated the 4th logout and are read frame, the zero-time of revising section retrieval time is next second of previous event time of origin, be the 12:06:00 of 12:05:01 ~ 2012-5-1 of 2012-5-1, this moment, ammeter 3 answers did not have logout, main website 1 or concentrator 2 stop logout and read, and execution in step g.
G, main website 1 or concentrator 2 initiate to remove the state information of event frame to this ammeter, remove the state information of event that has recorded in the ammeter 3.
H, return step a, next piece ammeter 3 is operated.
Among the described step c, if polytype event is arranged, generally process successively according to the importance of event type, be that main website 1 or concentrator 2 are initiated first the corresponding logout of most important events type and read frame, and with all logouts in the described time period (corresponding to the most important events type) read complete after, initiate time corresponding logout of critical event type to this ammeter again and read frame, and read all logouts in the described time period (corresponding to inferior critical event type) complete, so repeat from high to low according to importance, until that all event types all read is complete.
Improvement as the present embodiment, the state information of event that ammeter 3 provides is totally 4 bytes, namely 32, indicate different event types with wherein each, all event types that 4 byte state information of event can either indicate present ammeter to support have reduced again the communication data amount dramatically.Specialize as of the present invention, ammeter is supported 19 kinds of event types at present, represent respectively every kind of event type with 19 in the 4 byte state information of event, because event is small probability event, the event of any type all might occur, whether the event that main website 1 and concentrator 2 do not need regularly to go to inquire about respectively these 19 types has new events to occur, only need regularly go to read state information of event, just can know all events that current table meter occurs, greatly save communication time and communication media.