An electric energy meter system
By adopting the step-by-step transmission mechanism of reporting requests and response frames in the electric energy meter system, the problem of long time-consuming search of traditional electric energy meters is solved, and fast and conflict-free address acquisition is achieved.
Patent Information
- Application Number
- CN202410719307.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2023-09-28
- Filing Date
- 2024-06-05
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-06-05
AI Technical Summary
The traditional energy meter search method takes a long time due to 485 bus communication conflicts and other reasons, which affects the real-time and convenience of meter search.
The first electric energy meter is used to send a report request frame to the second electric energy meter through the second communication line. The second electric energy meter responds and sends the address through the first communication line. If there is a next-level electric energy meter, it sends it to the next-level electric energy meter. Report request frame and pass the response to the upper-level energy meter to avoid multiple energy meters from sending addresses at the same time and reduce communication conflicts.
This shortens the energy meter search time, improves the real-time performance and convenience of meter search, and ensures that the first energy meter quickly obtains the addresses of all slave energy meters.
Smart Images

Figure CN118300918B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communications, and in particular to an electric energy meter system. Background Art
[0002] The multi-user energy meter is composed of a host energy meter and several slave energy meters. The host energy meter and the slave energy meter are connected together by a side-inserted cable. It has the characteristics of small size, low cost and easy installation, and is deeply favored by customers. Compared with the use of traditional single energy meters, it saves about 70% of installation space and about 40% of cost. Among them, the host energy meter has a Bluetooth module and has the function of external communication, while the slave energy meter does not have a Bluetooth module and does not have the function of external communication.
[0003] Users can use the mobile phone Bluetooth application software to pay for multi-user electricity meters online, and can also read the archive information of multi-user electricity meters remotely. Taking the communication protocol DL / T645-2007 of the power industry as an example, when a user wants to communicate with a certain electricity meter, he needs to know the meter address of the electricity meter first. Since only the host electricity meter of the multi-user electricity meter has a Bluetooth module and has the function of external communication, when the user wants to communicate with the host, the broadcast information of the Bluetooth module contains the host meter address information, so the user can know the host meter address by searching the broadcast information of nearby Bluetooth devices through the mobile phone application software or Bluetooth gateway. Then, the DL / T645-2007 communication protocol can be used to communicate with the host electricity meter and read the archive information of the multi-user electricity meter (the meter address of all slave electricity meters). After the user knows the meter address of all slave electricity meters, he can communicate with a slave electricity meter alone. When a user wants to communicate with a slave energy meter, the data is first sent to the master energy meter through the mobile phone application software or Bluetooth gateway, and the master energy meter forwards it through the 485 bus. The response data of the slave energy meter is returned to the master energy meter through the 485 bus. After the master energy meter receives it, it returns it to the mobile phone application software or Bluetooth gateway through the Bluetooth module.
[0004] It can be seen that the host electric energy meter needs to have a table search function, and can quickly search out the table addresses of all slave electric energy meters after power-on. At present, the traditional method of searching electric energy meters is: the electric energy meters are connected through the 485 bus, using the DL / T645-2007 communication protocol, and reading the table address 68AAAAAAAAAAAA681300CS16 command, using the method of gradually reducing the table search, starting from the low byte of the address, the table address increases from 00 to 99, to the high byte, and all electric energy meters are searched step by step. However, due to the 485 bus communication conflict and other reasons, this method takes a long time. It may take more than half an hour to search the table once, which greatly affects the real-time and convenience of the table search. Summary of the invention
[0005] In order to shorten the meter search time of an electric energy meter and avoid communication conflicts of the electric energy meter, the present invention proposes an electric energy meter system.
[0006] The system comprises: a first electric energy meter and a plurality of second electric energy meters, wherein the first electric energy meter and the second electric energy meters are connected in parallel via a first communication line, and the first electric energy meter and the second electric energy meters are connected in series via a second communication line in turn;
[0007] The first electric energy meter is used to send a reporting request frame to a second electric energy meter directly connected to the first electric energy meter through a second communication line;
[0008] The second electric energy meter is used to send a number response frame to the electric energy meter that sent the number request frame through the second communication line after receiving the number request frame, and send the address of the second electric energy meter to the first electric energy meter through the first communication line; if the second electric energy meter has a lower-level electric energy meter, the second electric energy meter is also used to send a number request frame to the lower-level electric energy meter; if the second electric energy meter receives a number response frame sent by the lower-level electric energy meter, the second electric energy meter is also used to send the number response frame sent by the lower-level electric energy meter to the upper-level electric energy meter.
[0009] Through the above system, the first electric energy meter and each second electric energy meter are connected in parallel through the first communication line, and the first electric energy meter and each second electric energy meter are connected in series through the second communication line in turn. Each second electric energy meter receives the number request frame sent by the upper-level electric energy meter in turn through the second communication line, and returns its own number response frame and the received number response frame of the next-level electric energy meter to the upper-level electric energy meter at the same time, and sends its own address to the first electric energy meter through the first communication line after receiving the number request frame. Since each second electric energy meter receives the number request frame in turn, when returning its own address to the first electric energy meter, it also sends it in turn through the first communication line, and there is no situation where multiple second electric energy meters send their own addresses to the first electric energy meter at the same time, which avoids the conflict of the first communication line caused by multiple second electric energy meters sending addresses at the same time, and shortens the time for the first electric energy meter to search for the address of each second electric energy meter.
[0010] In an optional implementation, the reporting response frame includes a reporting value, and the reporting value in the reporting response frame sent by the second electric energy meter is 1 greater than the reporting value in the reporting response frame of the second electric energy meter at the previous level.
[0011] Through the above system, the reporting values in the reporting response frames in each second electric energy meter are different, and change in the order in which each electric energy meter is connected to the second communication line, showing a trend of increasing successively. That is to say, the reporting value in the reporting response frame can be used to know which second electric energy meter the reporting response frame belongs to.
[0012] In an optional implementation, the first electric energy meter is further used to receive each reporting response frame; and store the address of each second electric energy meter according to the order of receiving each reporting response frame and the reporting value in each reporting response frame.
[0013] Through the above system, the first electric energy meter can determine whether each second electric energy meter feeds back its own address in sequence by comparing the order of the received report response frame with the report value, and then determine whether to store the address of each second electric energy meter.
[0014] In an optional implementation manner, storing the address of the second electric energy meter according to the receiving order and the reported value of the reported response frame includes:
[0015] When the order of receiving the number-reporting response frame is consistent with the reported value in the number-reporting response frame, the address of the second electric energy meter is stored.
[0016] Through the above system, since each second electric energy meter receives the number response frame in sequence according to the order of serial connection with the electric energy meter and sends the address to the first electric energy meter, the order of the number response frames received by the first electric energy meter should be consistent with the reporting value in the number response frame. When the order of the number response frames received by the first electric energy meter is consistent with the reporting value in the number response frame, it indicates that each second electric energy meter sends its own address to the first electric energy meter in sequence according to the position connection order between the electric energy meters. At this time, the first electric energy meter stores the address of the second electric energy meter.
[0017] In an optional implementation manner, storing the address of the second electric energy meter according to the receiving order and the reported value of the reported response frame includes:
[0018] When the order of receiving the count response frames is inconsistent with the count values in the count response frames, the count request frame is resent to the second electric energy meter directly connected to the first electric energy meter.
[0019] Through the above system, when the order of each number response frame received by the first electric energy meter is inconsistent with the reported value in each number response frame, it indicates that the second electric energy meters have not sent their respective addresses to the first electric energy meter in sequence according to the position connection order between the electric energy meters. At this time, the first electric energy meter does not store the received addresses of the second electric energy meters.
[0020] In an optional implementation, the second electric energy meter is further configured to receive a current detection request frame from an upper level electric energy meter via the second communication line; and to send a current detection response frame and an abnormal response frame to the upper level electric energy meter.
[0021] Through the above system, after receiving the monitoring request frame from the upper level electric energy meter, the second electric energy meter sends a detection response frame and an abnormal response frame to the upper level electric energy meter to feedback whether each second electric energy meter is in a normal state.
[0022] In an optional implementation, the abnormal response frame is determined based on the detection response frame of the next level electric energy meter at the current moment, the detection response frame of the next level electric energy meter at the previous moment, and the abnormal response frame of the next level electric energy meter at the current moment.
[0023] Through the above system, the abnormal response frame of the second electric energy meter is not only related to its own state, but also related to the states of the lower electric energy meters.
[0024] In an optional embodiment, the first electric energy meter is also used to determine the abnormal response frame of the first electric energy meter at a current moment based on the detection response frame of the second electric energy meter directly connected to the first electric energy meter at a current moment, the detection response frame of the second electric energy meter directly connected to the first electric energy meter at a previous moment, and the abnormal response frame of the second electric energy meter directly connected to the first electric energy meter at a current moment.
[0025] In an optional implementation, the abnormal response frame is determined according to the detection response frame of the next-level electric energy meter at the current moment, the detection response frame of the next-level electric energy meter at the previous moment, and the abnormal response frame of the next-level electric energy meter at the current moment, including:
[0026] When the data in the abnormal response frame of the next-level electric energy meter at the current moment is equal to the first preset value, the data in the abnormal response frame of the electric energy meter at the current moment is set to the first preset value.
[0027] Through the above system, when the data in the abnormal response frame of the next-level electric energy meter of the electric energy meter at the current moment is the first preset value, it indicates that the status of the lower-level electric energy meters of the next-level electric energy meter is abnormal. At this time, the abnormal response frame of the electric energy meter should also indicate an abnormal status. Therefore, the abnormal response frame of the electric energy meter is also set to the first preset value.
[0028] In an optional implementation, the abnormal response frame is determined according to the detection response frame of the next-level electric energy meter at the current moment, the detection response frame of the next-level electric energy meter at the previous moment, and the abnormal response frame of the next-level electric energy meter at the current moment, including:
[0029] When the data in the abnormal response frame of the next-level electric energy meter at the current moment is not equal to the first preset value, the abnormal response frame of the electric energy meter at the current moment is determined according to the detection response frame of the next-level electric energy meter at the current moment and the detection response frame of the next-level electric energy meter at the previous moment.
[0030] Through the above system, when the data in the abnormal response frame of the next-level electric energy meter at the current moment is not the first preset value, it indicates that the status of the subordinate electric energy meters of the next-level electric energy meter is normal. At this time, the abnormal response frame of the electric energy meter should also be determined based on the detection response frame of the next-level electric energy meter at the current moment and the detection response frame at the previous moment.
[0031] In an optional implementation, when the data in the abnormal response frame of the first electric energy meter is equal to the first preset value, the first electric energy meter is further configured to resend the reporting request frame to the second electric energy meter directly connected to the first electric energy meter.
[0032] Through the above system, when the abnormal response frame in the first electric energy meter contains the first preset value, it indicates that the subordinate electric energy meters of the first electric energy meter have abnormal conditions. At this time, the first electric energy meter should resend the reporting request frame to the second electric energy meter directly connected to the first electric energy meter. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0034] Figure 1 is a structural block diagram of an electric energy meter system proposed according to an exemplary embodiment;
[0035] Figure 2 is a diagram showing the composition of a request frame in an example;
[0036] Figure 3 is a diagram showing the composition of a reporting response frame in an example;
[0037] Figure 4 is a diagram of a composition of an address response frame in an example;
[0038] Figure 5 In one example, a diagram showing the composition of a detection request frame;
[0039] Figure 6 is a diagram of a composition of a detection response frame in an example;
[0040] Figure 7 is a diagram of a composition of an abnormal response frame in an example;
[0041] Figure 8 is a connection diagram of each electric energy meter in an example;
[0042] Fig. 9 In one example, a table search flow chart of a first electric energy meter;
[0043] Fig.10 In one example, the second electric energy meter replies with a reporting response frame and sends a reporting request frame;
[0044] Fig.11In an example, a first electric energy meter performs a state detection on a second electric energy meter 2 directly connected thereto;
[0045] Fig.12 In one example, the second electric energy meter sends / receives a detection request frame. DETAILED DESCRIPTION
[0046] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0047] In addition, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0048] In order to shorten the meter search time of an electric energy meter and avoid communication conflicts of the electric energy meter, the present invention proposes an electric energy meter system.
[0049] Figure 1 This is a structural block diagram of an electric energy meter system proposed according to an exemplary embodiment. The system includes: a first electric energy meter 1 and multiple second electric energy meters 2, the first electric energy meter 1 and each second electric energy meter 2 are connected in parallel through a first communication line 3, and the first electric energy meter 1 and each second electric energy meter 2 are connected in series through a second communication line 4 in turn.
[0050] In an optional embodiment, the first electric energy meter 1 serves as the host electric energy meter in the electric energy meter system. The first electric energy meter 1 may have a Bluetooth function to facilitate the electric energy meter system to communicate with the outside world. When a user wants to communicate with the first electric energy meter 1, since the broadcast information of the Bluetooth module includes the address of the first electric energy meter 1, the user can search for the broadcast information of the first electric energy meter 1 through a mobile phone application software or a Bluetooth gateway, thereby obtaining the address of the first electric energy meter 1, and then communicate with the first electric energy meter 1 through a communication protocol.
[0051] In an optional embodiment, each second electric energy meter 2 serves as a slave electric energy meter in the electric energy meter system. Each second electric energy meter 2 does not have a Bluetooth function and does not communicate with the outside world.
[0052] In an optional embodiment, the first communication line 3 may be a 485 bus. Each electric energy meter is connected in parallel via the 485 bus. The first communication line 3 may use the DL / T645-2007 communication protocol to transmit data.
[0053] The first electric energy meter 1 is used to send a reporting request frame to the second electric energy meter 2 directly connected to the first electric energy meter 1 through the second communication line 4.
[0054] In an optional embodiment, the second communication line 4 can use a custom DL / T645 communication protocol to transmit data.
[0055] The second electric energy meter 2 is used for sending a counting response frame to the electric energy meter that sent the counting request frame through the second communication line 4 after receiving the counting request frame, and sending the address of the second electric energy meter 2 to the first electric energy meter 1 through the first communication line 3; if the second electric energy meter 2 has a lower-level electric energy meter, the second electric energy meter 2 is also used for sending a counting request frame to the lower-level electric energy meter; if the second electric energy meter 2 receives a counting response frame sent by the lower-level electric energy meter, the second electric energy meter 2 is also used for sending the counting response frame sent by the lower-level electric energy meter to the upper-level electric energy meter.
[0056] In an optional embodiment, the first electric energy meter 1 obtains the address of each second electric energy meter 2 through the first communication line 3. When the outside world needs the address information of the second electric energy meter 2, it needs to communicate with the first electric energy meter 1 to obtain the required address of the second electric energy meter 2.
[0057] Through the above system, the first electric energy meter 1 and each second electric energy meter 2 are connected in parallel through the first communication line 3, and the first electric energy meter 1 and each second electric energy meter 2 are connected in series through the second communication line 4 in turn. Each second electric energy meter 2 receives the number request frame sent by the upper-level electric energy meter through the second communication line 4 in turn, and returns its own number response frame and the received number response frame of the next-level electric energy meter to the upper-level electric energy meter, and sends its own address to the first electric energy meter 1 through the first communication line 3 after receiving the number request frame. Since each second electric energy meter 2 receives the counting request frame in sequence, when returning their respective addresses to the first electric energy meter 1, they are also sent in sequence through the first communication line 3. There is no situation where multiple second electric energy meters 2 send their respective addresses to the first electric energy meter 1 through the first communication line 3 at the same time. This avoids the conflict of the first communication line 3 caused by multiple second electric energy meters 2 sending addresses at the same time, and shortens the time for the first electric energy meter 1 to search for the address of each second electric energy meter 2. At the same time, after receiving the counting request frame in sequence, each second electric energy meter 2 returns a counting response frame to its own upper-level electric energy meter in sequence through the second communication line 4 to which it is connected. That is, the counting response frame is transmitted upward step by step, and there will be no conflict on the second communication line 4.
[0058] In one example, the structure of the request frame is as follows: Figure 2 As shown in the figure, 68H is the frame start character, CS is the check code, and 16H is the end character. A0…A5 represents the address of the first electric energy meter 1, 07H represents the control code, 01H represents the data length, and NUM represents the reported value.
[0059] In the embodiment of the present invention, the reporting value in the reporting request frame sent by the first electric energy meter 1 is 0.
[0060] In one example, the reporting response frame includes a reporting value, and the reporting value in the reporting response frame sent by the second electric energy meter 2 is 1 greater than the reporting value in the reporting response frame of the second electric energy meter 2 at the previous level.
[0061] In the embodiment of the present invention, the reported values in the reported value response frames replied by the subordinate electric energy meters of the first electric energy meter 1 are 1, 2, 3, ..., n respectively.
[0062] In an optional embodiment, the structure of the report response frame is as follows: Figure 3 As shown in the figure, 87H indicates the control code and 00H indicates the data length.
[0063] In an embodiment of the present invention, the reporting values in the reporting response frames in each second electric energy meter 2 are different, and the reporting values change according to the connection positions of each electric energy meter on the second communication line 4, showing a trend of increasing successively, that is, the reporting value in the reporting response frame can be used to determine the second electric energy meter 2 corresponding to the reporting response frame.
[0064] In one example, the first electric energy meter 1 is further used to receive each reporting response frame; and store the address of each second electric energy meter 2 according to the order of receiving each reporting response frame and the reporting value in each reporting response frame.
[0065] In the embodiment of the present invention, the first electric energy meter 1 can determine whether each second electric energy meter 2 feeds back its own address in sequence according to the connection order by comparing the order of receiving the report response frame with the report value, and then determine whether to store the address of each second electric energy meter 2.
[0066] In one example, when the order of receiving the number response frame is consistent with the number response frame, the first electric energy meter 1 stores the address of the second electric energy meter 2 .
[0067] Since each second electric energy meter 2 receives the number response frame in sequence according to the order of serial connection with the electric energy meters and replies the address to the first electric energy meter 1, the order of the number response frames received by the first electric energy meter 1 should be consistent with the reporting values in the number response frames. When the order of the number response frames received by the first electric energy meter 1 is consistent with the reporting values in the number response frames, it indicates that the second electric energy meters 2 send their respective addresses to the first electric energy meter 1 in sequence according to the position connection order between the electric energy meters. At this time, the first electric energy meter 1 stores the address of the second electric energy meter 2.
[0068] In one example, when the order of receiving the reporting response frames is inconsistent with the reporting values in the reporting response frames, the first electric energy meter 1 resends the reporting request frame to the second electric energy meter 2 directly connected to the first electric energy meter 1 .
[0069] In an embodiment of the present invention, when the order of the number response frames of the second electric energy meter 2 received by the first electric energy meter 1 is inconsistent with the reported values in each number response frame, it indicates that the second electric energy meters 2 have not sent their respective addresses to the first electric energy meter 1 in sequence according to the position connection order between the electric energy meters. At this time, the first electric energy meter 1 does not store the addresses of the second electric energy meters 2.
[0070] In an embodiment of the present invention, the first electric energy meter 1 can store the addresses of the second electric energy meters 2 according to the order of receiving each number response frame and the reported value in each number response frame within a preset time period, and can also store the addresses of the second electric energy meters 2 in real time according to the order of receiving each number response frame and the reported value in each number response frame, without specific restrictions herein. In addition, the first electric energy meter 1 can also determine whether all the addresses in the second electric energy meters 2 have been received by the number of number response frames received within a period of time. When the addresses of all the second electric energy meters 2 are not received, the first electric energy meter 1 does not store the addresses of the second electric energy meters 2 and resends the number request frame. When the addresses of all the second electric energy meters 2 are received, the addresses of the second electric energy meters 2 are stored according to the order of receiving each number response frame and the reported value in each number response frame.
[0071] In one example, each second electric energy meter 2 sends its own address to the first electric energy meter 1 via the first communication line 3. The address of each second electric energy meter 2 can be fed back to the first electric energy meter 1 via an address response frame. Figure 4 97H represents the control code, 01H represents the data length, NUM represents the reported value of the second electric energy meter 2, and A0...A5 represents the address of the second electric energy meter 2.
[0072] In one example, the second electric energy meter 2 is also used to receive the detection request frame of the upper electric energy meter at the current moment through the second communication line 4; and send the detection response frame and abnormal response frame of the current moment to the upper electric energy meter. The detection request frame is used to detect whether each electric energy meter is in a normal state. Among them, the detection request frame sent by the upper electric energy meter is used to detect the health state of the lower electric energy meter, and the detection response frame fed back by the lower electric energy meter to the upper electric energy meter is used to characterize the health state of the lower electric energy meter. Figure 5 This is the structure diagram of the detection request frame. Figure 5 As shown, 18H in the detection request frame represents the control code, and 00H represents the data length. Figure 6 This is the structure of the detection response frame. In the detection response frame, 98H represents the control code and 00H represents the data length. Figure 7This is a diagram of the composition of an abnormal response frame. C8H in the abnormal response frame indicates a control code, 01H indicates data length, and ERR indicates the abnormal type. For example, it can be set that when ERR is 1, the next level of the electric energy meter is plugged in or out; when ERR is 0, the next level of the electric energy meter is not plugged in or out.
[0073] In an optional embodiment, the abnormal response frame of the second electric energy meter 2 is related to the health status of the next-level electric energy meter and the status of each lower-level electric energy meter of the next-level electric energy meter. The abnormal response frame is determined based on the detection response frame of the next-level electric energy meter at the current moment, the detection response frame of the next-level electric energy meter at the previous moment, and the abnormal response frame of the next-level electric energy meter at the current moment.
[0074] In an optional embodiment, the first electric energy meter 1 is also used to determine the abnormal response frame of the first electric energy meter 1 at a current moment based on the detection response frame of the second electric energy meter 2 directly connected to the first electric energy meter 1 at a current moment, the detection response frame of the second electric energy meter 2 directly connected to the first electric energy meter 1 at a previous moment, and the abnormal response frame of the second electric energy meter 2 directly connected to the first electric energy meter 1 at a current moment.
[0075] In an optional embodiment, when the data in the abnormal response frame of the next-level electric energy meter at the current moment is equal to the first preset value, the data in the abnormal response frame of the electric energy meter at the current moment is set to the first preset value. When the data in the abnormal response frame of the next-level electric energy meter at the current moment is the first preset value, it indicates that the state of each electric energy meter below the next-level electric energy meter is abnormal, and the abnormal response frame of the electric energy meter should also indicate an abnormal state, and the abnormal state is transmitted to the first electric energy meter 1 step by step. At this time, the abnormal response frame of the electric energy meter is also set to the first preset value.
[0076] In an optional embodiment, when the data in the abnormal response frame of the next-level electric energy meter at the current moment is not equal to the first preset value, the abnormal response frame of the electric energy meter at the current moment is determined according to the detection response frame of the next-level electric energy meter at the current moment and the detection response frame of the next-level electric energy meter at the previous moment. When the data in the abnormal response frame of the next-level electric energy meter at the current moment is not the first preset value, it indicates that the state of each electric energy meter below the next-level electric energy meter is in a normal state. At this time, the abnormal response frame of the electric energy meter should also be determined according to the detection response frame of the next-level electric energy meter at the current moment and the detection response frame of the previous moment. Exemplarily, when the detection response frame of the next-level electric energy meter at the current moment is different from the detection response frame of the previous moment, it indicates that the health state of the next-level electric energy meter has changed. At this time, it indicates that the plug-in action of the electric energy meter has occurred, and the abnormal response frame is set to the first preset value. When the detection response frame of the next-level electric energy meter at the current moment is the same as the detection response frame of the previous moment, it indicates that the health state of the next-level electric energy meter has not changed, and the next-level electric energy meter is in a normal state.
[0077] In an optional embodiment, when the data in the abnormal response frame of the first electric energy meter 1 is equal to the first preset value, the first electric energy meter 1 is also used to resend the reporting request frame to the second electric energy meter 2 directly connected to the first electric energy meter 1. When the data in the abnormal response frame in the first electric energy meter 1 is the first preset value, it indicates that the subordinate electric energy meters of the first electric energy meter 1 are in an abnormal state. At this time, the first electric energy meter 1 should resend the reporting request frame to the second electric energy meter 2 directly connected to the first electric energy meter 1.
[0078] Figure 8 The figure is a connection diagram of each electric energy meter. Among them, the two 485 buses are the first communication lines, and the internal communication line is the second communication line. The first electric energy meter 1 is connected to an internal communication line, and the second electric energy meter 2 is connected to the first internal communication line and the second internal communication line. It is connected to the electric energy meter of the previous level through the first internal communication line, and is connected to the electric energy meter of the next level through the second internal communication line. The first internal communication line and the second internal communication line are not connected. The internal communication line of the first electric energy meter 1 is connected to the first internal communication line of the first second electric energy meter 2, and the second internal communication line of the first second electric energy meter 2 is connected to the first internal communication line of the second second electric energy meter 2, and so on. The internal communication line of the first electric energy meter 1 is connected to the power supply VCC inside the first electric energy meter 1 through a resistor. The internal communication line of the first electric energy meter 1 is also connected to the receiving end (Receive Data, RXD) inside the first electric energy meter 1, and is connected to the transmitting end (TransmitData, TXD) inside the first electric energy meter 1 through a diode. The first internal communication line of the second electric energy meter 2 is connected to the power supply VCC inside itself through a resistor, and the first internal communication line of the second electric energy meter 2 is also connected to the internal RXD1 of itself, and connected to the internal TXD1 of itself through a diode. The second internal communication line of the second electric energy meter 2 is connected to the power supply VCC inside itself through a resistor, and the second internal communication line of the second electric energy meter 2 is also connected to the internal RXD2 of itself, and connected to the internal TXD2 of itself through a diode. Taking the first electric energy meter 1 and the first second electric energy meter 2 as an example, when the first electric energy meter 1 sends data through the internal communication line TXD, the first internal communication line RXD1 of the first second electric energy meter 2 will receive the data. When the first second electric energy meter 2 sends data through the first internal communication line TXD1, the internal communication line RXD of the first electric energy meter 1 will receive the data. Therefore, the internal communication line has the function of sending and receiving data at the same time.
[0079] like Fig. 9As shown, when powered on, the first electric energy meter 1 should quickly complete the table search work of all second electric energy meters 2, and write the multi-user electric energy meter file information (address information) for users to read. First, the report value in the report request frame of the first electric energy meter 1 is assigned to 0, and the counter Time is assigned to 0. The counter is incremented every 100ms. The report request frame is sent to the second electric energy meter 2 directly connected to the first electric energy meter 1 through the second communication line 4 (internal communication line). After receiving the signal, the second electric energy meter 2 replies with a count response frame to the first electric energy meter 1 through the first internal communication line, and at the same time sends an address response frame (including the address of the second electric energy meter 2) to the 485 bus through the first communication line 3 (485 bus). After the address response frame is sent, the report value NUM in the count request frame is incremented by 1, and the count request frame after the increment operation is sent to the second second electric energy meter 2 through the second internal communication line; after receiving the signal, the second second electric energy meter 2 replies with a count response frame to the first second electric energy meter 2 through the first internal communication line, and at the same time sends an address response frame to the 485 bus through the 485 bus. After the address response frame is sent, the report value NUM in the count request frame is incremented by 1, and the count request frame after the increment operation is sent to the second second electric energy meter 2 through the second internal communication line. The reporting value in the query frame continues to be incremented by 1, and the reporting request frame after the increment operation is sent to the third second electric energy meter 2 through the second internal communication line, and so on. Each second electric energy meter 2 receives the reporting request frame sent by the second electric energy meter 2 of the previous level, replies with the reporting response frame to the electric energy meter of the previous level through the internal communication line, and sends the address response frame to the first electric energy meter 1 through the 485 bus. At the same time, the reporting response frame received from the electric energy meter of the next level is sent to the electric energy meter of the previous level. After the first electric energy meter 1 receives the address response frame of each second electric energy meter 2 on the 485 bus, the counter is assigned a value of 0, and the address response frame of each second electric energy meter 2 is stored in the order of receipt. The value of the counter is set to 20, indicating that the first electric energy meter 1 should receive all the address response frames of the second electric energy meter 2 within two seconds. At this time, it is determined whether the address response frame is correct. When the address response frame is correct, the address in the address response frame is extracted to complete a round of table search. Fig.10 In the embodiment, after the second electric energy meter 2 is powered on, after receiving the reporting request frame through the first internal communication line, it replies with a reporting response frame to the upper-level electric energy meter, sends an address response frame through the 485 bus, and then sends a reporting request frame to the lower-level electric energy meter through the second internal communication line.
[0080] Under normal circumstances, the reported values in the report response frame received by the first electric energy meter 1 from the second electric energy meter 2 should be in the order of 1, 2, 3, ..., n. If the reported values in the received second electric energy meters 2 are arranged in this order, the address in the received address response frame of the second electric energy meter 2 is extracted and stored in the electric energy meter file information; if the reported values in the received second electric energy meters 2 are not arranged in this order, the reported value sequence is wrong or there are reported values missing in the middle, then the first electric energy meter 1 re-initiates the table search. With this method, the first electric energy meter 1 can realize fast table search. Under normal circumstances, the table addresses of all second electric energy meters 2 can be searched within three seconds after power-on.
[0081] Fig.11 This is a flow chart of the first electric energy meter 1 performing status detection on the second electric energy meter 2 directly connected thereto. Fig.12It is a flowchart of the second electric energy meter 2 sending / receiving a detection request frame. After power-on and completing the quick table search, the first electric energy meter 1 sends a detection request frame (heartbeat request frame) to the second electric energy meter 2 directly connected thereto. In normal operation, the first electric energy meter 1 sends a detection request frame to the second electric energy meter 2 directly connected thereto through the internal communication line every 100 ms, and the second electric energy meter 2 directly connected thereto sends a detection request frame to the second electric energy meter 2 of the next level through the second internal communication line every 100 ms, ..., the nth second electric energy meter 2 sends a detection request frame to the n+1th second electric energy meter 2 through the second internal communication line every 100 ms, and the detection request frame is sent down step by step, so that each second electric energy meter 2 receives the detection request frame. After receiving the detection request frame, the second electric energy meter 2 replies with a detection response frame through the first internal communication line as soon as possible. Among them, the detection response frame represents the information that the electric energy meter is in a normal state or an abnormal state. The principle of the lower-level electric energy meter replying to the detection response frame is: the electric energy meter defines a flag LastHeartFlag to record the last detection response frame flag of the electric energy meter and the flag HeartFlag of the current detection response frame, and defines an abnormal response frame flag ErrFlag, wherein LastHeartFlag and ErrFlag are assigned 0 when powered on; when the detection response frame flag HeartFlag is 1, it indicates that the electric energy meter is in a normal state; when HeartFlag is 2, it indicates that the electric energy meter is in an abnormal state. For the abnormal response frame flag ErrFlag in the electric energy meter, if the HeartFlag fed back by the lower-level electric energy meter is 1 and the LastHeartFlag is 2, then the ErrFlag in the electric energy meter is assigned 1, and it is considered that a lower-level electric energy meter is unplugged; if the HeartFlag fed back by the lower-level electric energy meter is 2 and the LastHeartFlag is 1, then the ErrFlag in the electric energy meter is assigned 1, and it is considered that a second electric energy meter 2 is inserted. When the electric energy meter receives the abnormal response frame ErrFlag sent by the next-level electric energy meter as 1, the abnormal response frame ErrFlag in the electric energy meter is set to 1, and a detection response frame representing the abnormality is sent to the next-level electric energy meter. In this way, the abnormal response frame will be passed up step by step until the first electric energy meter 1 receives the abnormal response frame. After the first electric energy meter 1 receives the abnormal response frame, the ErrFlag in the first electric energy meter 1 is assigned to 1, and it is considered that a lower-level electric energy meter is plugged in or out. The first electric energy meter 1 resends the reporting request frame through the internal communication line to initiate a new round of fast meter search.
[0082] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0083] The above is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but should conform to the widest scope consistent with the principles and novel features applied herein.
Claims
1. An electric energy meter system, characterized in that: The system comprises: a first electric energy meter and a plurality of second electric energy meters, wherein the first electric energy meter and each of the second electric energy meters are connected in parallel via a first communication line, and the first electric energy meter and each of the second electric energy meters are connected in series via a second communication line in sequence; The first electric energy meter is used to send a reporting request frame to a second electric energy meter directly connected to the first electric energy meter through the second communication line; The second electric energy meter is used to send a count response frame to the electric energy meter that sent the count request frame through the second communication line after receiving the count request frame, and send the address of the second electric energy meter to the first electric energy meter through the first communication line; if there is a lower-level electric energy meter for the second electric energy meter, the second electric energy meter is also used to send a count request frame to the lower-level electric energy meter; if the second electric energy meter receives a count response frame sent by the lower-level electric energy meter, the second electric energy meter is also used to send a count response frame sent by the lower-level electric energy meter to the upper-level electric energy meter; The second electric energy meter is also used to receive the detection request frame of the upper electric energy meter at the current moment through the second communication line; and send the detection response frame and the abnormal response frame of the current moment to the upper electric energy meter; The abnormal response frame is determined according to the detection response frame of the next-level electric energy meter at the current moment, the detection response frame of the next-level electric energy meter at the previous moment, and the abnormal response frame of the next-level electric energy meter at the current moment; The abnormal response frame is determined according to the detection response frame of the next-level electric energy meter at the current moment, the detection response frame of the next-level electric energy meter at the previous moment, and the abnormal response frame of the next-level electric energy meter at the current moment, and includes: When the data in the abnormal response frame of the next-level electric energy meter at the current moment is equal to the first preset value, setting the data in the abnormal response frame of the electric energy meter at the current moment to the first preset value; The abnormal response frame is determined according to the detection response frame of the next-level electric energy meter at the current moment, the detection response frame of the next-level electric energy meter at the previous moment, and the abnormal response frame of the next-level electric energy meter at the current moment, and includes: When the data in the abnormal response frame of the next-level electric energy meter at the current moment is not equal to the first preset value, the abnormal response frame of the electric energy meter at the current moment is determined according to the detection response frame of the next-level electric energy meter at the current moment and the detection response frame of the next-level electric energy meter at the previous moment.
2. The system according to claim 1, characterized in that The reporting response frame includes a reporting value, and the reporting value in the reporting response frame sent by the second electric energy meter is 1 greater than the reporting value in the reporting response frame of the second electric energy meter at the previous level.
3. The system according to claim 2, characterized in that The first electric energy meter is further used for receiving each of the report response frames; and storing the address of each of the second electric energy meters according to the order of receiving each of the report response frames and the report value in each of the report response frames.
4. The system according to claim 3, characterized in that According to the receiving order and the reported value of the reported response frame, the address of the second electric energy meter is stored, including: When the order of receiving the number response frame is consistent with the number response frame, the address of the second electric energy meter is stored.
5. The system according to claim 3, characterized in that According to the receiving order and the reported value of the reported response frame, the address of the second electric energy meter is stored, including: When the order of receiving the report response frame is inconsistent with the report value in the report response frame, the report request frame is resent to the second electric energy meter directly connected to the first electric energy meter.
6. The system according to claim 1, characterized in that The first electric energy meter is also used to determine the abnormal response frame of the first electric energy meter at a current moment based on the detection response frame of the second electric energy meter directly connected to the first electric energy meter at a current moment, the detection response frame of the second electric energy meter directly connected to the first electric energy meter at a previous moment, and the abnormal response frame of the second electric energy meter directly connected to the first electric energy meter at a current moment.
7. The system according to claim 6, characterized in that When the data in the abnormal response frame of the first electric energy meter is equal to the first preset value, the first electric energy meter is further used to resend the reporting request frame to the second electric energy meter directly connected to the first electric energy meter.
