A local network communication method for an electricity meter and an electricity meter
By adding electricity meter address encoding rules and interface class configuration to the IEC 62056-47 link layer of the DLMS protocol, efficient data push of electricity meters in the local network is realized, solving the problems of low efficiency and insufficient real-time performance in the existing technology.
Patent Information
- Application Number
- CN202211288660.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-20
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2042-10-20
AI Technical Summary
The existing DLMS protocol is inefficient in local networks and cannot actively push data, resulting in data chaos and insufficient real-time performance.
By adding preset electricity meter address encoding rules to the IEC 62056-47 link layer of the DLMS protocol, and through electricity meter address addressing and interface class configuration, the electricity meter can actively push data to the master station system.
It improves communication efficiency, avoids data chaos and conflicts, and meets the real-time requirements of important data.
Smart Images

Figure CN115802198B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electricity meter technology, and specifically to a local network communication method for electricity meters and an electricity meter. Background Technology
[0002] DLMS communication protocol is an international communication protocol for peripheral devices to read instrument data. This protocol can use various communication media to complete data exchange, including GPRS networks, RS485 buses, and Mbus buses. The protocol can be broadly divided into three layers: the physical layer, the data link layer, and the application layer. The data link layer protocols mainly include IEC 62056-47 and IEC 62056-46, which are suitable for different application scenarios based on their characteristics.
[0003] The IEC 62056-46 link layer protocol is primarily used for communication on local networks, such as RS485 buses and Mbus buses. This protocol has a dedicated address field, facilitating address lookup between the data reader and the device being read. However, a drawback is that each DLMS application data exchange requires a handshake using the IEC 62056-46 link layer before the application layer interaction, resulting in low efficiency. Furthermore, due to the characteristics of local networks, the device being read cannot actively push data. Since the local network is a single communication bus with all devices connected, multiple devices actively pushing data would lead to data corruption on the bus. The device being read must passively wait to be read, impacting the real-time performance of critical data.
[0004] The IEC 62056-47 data link layer protocol is mainly used in GPRS / 3G / 4G communication networks. This data link layer uses IP addresses and port numbers for addressing during communication. While simple and highly efficient, this protocol lacks an address field, making it unsuitable for local area networks. Summary of the Invention
[0005] Therefore, in order to overcome the problem that the IEC 62056-47 link layer in the local network does not have an address field and cannot actively push data, the present invention provides a local network communication method for electricity meters and an electricity meter. The electricity meter device using the present invention not only conforms to the DLMS / COMSE specification requirements for all data formats, but also effectively improves communication efficiency, realizes active data push of the electricity meter slave, avoids the chaos and conflict of active data push by the electricity meter slave, and meets the real-time requirements of important data push.
[0006] To achieve the above objectives, the present invention provides the following technical solution:
[0007] In a first aspect, embodiments of the present invention provide a local network communication method for an electricity meter, applied to an electricity meter using the DLMS protocol, comprising:
[0008] A preset electricity meter address encoding rule is added to the IEC 62056-47 link layer of the DLMS protocol for address addressing in local network communication of electricity meters.
[0009] The main station system configures the preset interface class in the electricity meter's preset interface class.
[0010] The electricity meter actively pushes data to the main station system based on the preset electricity meter address coding rules and the interface class configuration of the main station system.
[0011] Optionally, the IEC 62056-47 link layer fields include: protocol version number, source port number, destination port number, and length;
[0012] Protocol version number, used to indicate the version number of the protocol;
[0013] Source port number, which is the port number of the sender;
[0014] Destination port number is the receiver's port number;
[0015] Length, used to indicate the number of bytes in the application layer data.
[0016] Optionally, the process of presetting the address coding rules for the electricity meter includes:
[0017] The electricity meter address is obtained based on the meter number;
[0018] Use the electricity meter address as the source port number or destination port number in the IEC 62056-47 link layer.
[0019] Optionally, the meter number is purely digital.
[0020] Optionally, the electricity meter address is:
[0021] Electricity meter address = last n digits of meter number + 32768
[0022] Where n is the preset number of bits, which converts the electricity meter address into hexadecimal.
[0023] Optionally, a preset interface class is provided, including: OBIS encoding, active sending object, push window, and maximum random number;
[0024] OBIS encoding is used to represent the identifier of an interface class;
[0025] Actively sent object: An identifier code used to indicate that object data needs to be actively sent.
[0026] The push window indicates the start time of the active sending;
[0027] Maximum random number, used to represent the maximum value of the random time actively sent.
[0028] Optionally, the process of the electricity meter actively pushing data to the master station system includes:
[0029] Query the current time in real time and determine whether the current time meets the start time of the push window;
[0030] If the current time meets the start time of the push window, retrieve the data of the actively sent object;
[0031] Generate a random number and compare it with the maximum random number. If the random number is less than the maximum random number, the random number is successfully generated. If the random number is greater than the maximum random number, continue generating random numbers until it is less than the maximum random number, and a successful random number is obtained.
[0032] When the preset random number delay condition is met, the electricity meter actively pushes object data to the master station system.
[0033] Optionally, the preset random number delay condition is the current time minus the start time of the push window plus the successful random number.
[0034] Optionally, object data can be actively sent, including: power consumption, current, voltage, time, frequency, and the logical device name and meter number of the energy meter.
[0035] Secondly, embodiments of the present invention provide an energy meter that communicates with a master station system based on any of the local network communication methods for energy meters provided in the first aspect of the present invention.
[0036] The technical solution of this invention has the following advantages:
[0037] The present invention provides a local network communication method and a power meter for power meters using the DLMS protocol. For power meters using the DLMS protocol, a preset power meter address encoding rule is added to the IEC 62056-47 link layer of the DLMS protocol for address addressing in local network communication. A preset interface class is configured by the master station system. Based on the preset power meter address encoding rule and the master station system's interface class configuration, the power meter actively pushes data to the master station system. Power meter devices using this invention not only ensure that all data formats conform to the DLMS / COMSE specification requirements, but also effectively improve communication efficiency, avoid confusion and conflicts in data actively pushed by the power meter slave, and meet the real-time requirements for important data pushes. Attached Figure Description
[0038] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0039] Figure 1 A flowchart illustrating the local network communication method for electricity meters provided in this embodiment of the invention;
[0040] Figure 2 A schematic diagram of the structure of the standard IEC 62056-47 link layer field provided in this embodiment of the invention;
[0041] Figure 3 This embodiment of the invention provides a schematic diagram of a master reading slave data from the standard IEC 62056-46 link layer.
[0042] Figure 4 This embodiment of the invention provides a schematic diagram of a master copying slave data at the standard IEC 62056-47 link layer.
[0043] Figure 5 This invention provides a schematic diagram of master-slave data reading based on the IEC 62056-47 link layer according to the electricity meter address encoding rules.
[0044] Figure 6 A diagram illustrating the attribute composition of the interface class provided in this embodiment of the invention;
[0045] Figure 7 A schematic diagram of the process of an energy meter actively pushing data to the master station system provided in this embodiment of the invention;
[0046] Figure 8 The present invention provides code for a slave device to actively push data to a master device based on the address encoding rules of an electricity meter. Detailed Implementation
[0047] To enable those skilled in the art to better understand the present invention, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of them, and are not intended to limit the scope of the present invention. Furthermore, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessary confusion regarding the concepts disclosed in the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0048] Furthermore, 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.
[0049] Example 1
[0050] This invention provides a local network communication method for electricity meters, applicable to electricity meters using the DLMS protocol, such as... Figure 1 As shown, the method includes the following steps:
[0051] Step S1: Add a preset electricity meter address encoding rule to the IEC 62056-47 link layer of the DLMS protocol for address addressing in the local network communication of the electricity meter.
[0052] In this embodiment, a schematic diagram of the field structure of the standard IEC 62056-47 link layer is shown below. Figure 2 As shown, it includes: protocol version number, source port number, destination port number, and length.
[0053] In one specific embodiment, the protocol version number, which contains 2 bytes, is used to indicate the version number of the protocol. This version number is maintained by the DLMS Association, and the current version number is 0x0001.
[0054] In one specific embodiment, the source port number, consisting of 2 bytes, is the sender's port number.
[0055] In one specific embodiment, the destination port number, consisting of 2 bytes, is the receiver port number.
[0056] In one specific embodiment, the length, comprising 2 bytes, is used to indicate the number of bytes of application layer data.
[0057] In this embodiment, the process of presetting the electricity meter address encoding rules includes: obtaining the electricity meter address based on the electricity meter number; and using the electricity meter address as the source port number or destination port number in the IEC 62056-47 link layer.
[0058] Specifically, for electricity meters, a 12-digit pure digital meter number is generally used as a unique address code for data communication. The meter number is converted to an electricity meter address as follows:
[0059] Electricity meter address = last n digits of meter number + 32768
[0060] Where n is the preset number of bits, which converts the electricity meter address into hexadecimal.
[0061] In one specific embodiment, the electricity meter address = the last 4 digits of the meter number + 32768. Specifically, the number of slave devices connected to a local network is generally no more than 32. Therefore, using the last 4 digits of the meter number provides 9999 addressing possibilities, which is sufficient to distinguish the electricity meter devices on the local network. Furthermore, port fields with values less than 32768 are generally encoded by the user's main system. Therefore, the electricity meter address = the last n digits of the meter number + 32768 avoids this field, meaning the minimum value is 32768 and the maximum value is 9999 + 32768 = 42767, which needs to be converted to hexadecimal HEX format. For example, if the electricity meter device number is 202087654321, the corresponding electricity meter address is 0x90E1. This is just an example and is not a limitation.
[0062] In this embodiment, the standard IEC 62056-46 link layer performs master-slave data reading. Figure 3 The standard IEC 62056-47 link layer is used for master-slave data copying. Figure 4 Based on the IEC62056-47 link layer standard for electricity meter address coding, the master reads slave data. Figure 5 Analysis shows that this invention uses the electricity meter address encoding rules and binds them to the port number field of the IEC 62056-47 link layer, which enables efficient data communication of the electricity meter in the local network.
[0063] Step S2: The master station system configures the preset interface class in the electricity meter preset interface class.
[0064] In this embodiment, the attribute composition diagram of the interface class is as follows: Figure 6 As shown, it includes: OBIS encoding, actively sent object, push window, and maximum random number. OBIS encoding is used to represent the identifier code of the interface class; the actively sent object is used to represent the identifier code of the object data that needs to be actively sent; the push window is used to represent the start time of the actively sent data; and the maximum random number is used to represent the maximum random time value of the actively sent data.
[0065] Step S3: The electricity meter actively pushes data to the main station system based on the preset electricity meter address coding rules and the interface class configuration of the main station system.
[0066] In this embodiment, the main station system configures parameters such as the time and content to be actively pushed by setting corresponding attribute values. Specifically, the main station system configures the push interface class as needed, and other attribute values of the interface class can be accessed through the OBIS encoding of the interface class; modifying the actively sending object can set the data object to be pushed, and write the data flag OBIS of the object data into this attribute; modifying the push window can set the push start time, such as 1:00 AM every day; modifying the maximum random number can set the maximum random number for push, which is used to avoid the possibility of simultaneous transmission by energy meters in the same network, realizing that all energy meter devices can push data on a local bus and prevent data conflicts.
[0067] In this embodiment, the electricity meter actively pushes data to the master station system, such as... Figure 7 As shown, it includes:
[0068] Step S31: Query the current time in real time and determine whether the current time meets the start time of the push window.
[0069] Step S32: When the current time meets the start time of the push window, obtain the actively sent object data. Specifically, the actively sent object data includes: power consumption, current, voltage, time, frequency, and the logical device name and meter number of the energy meter.
[0070] Step S33: Generate a random number and compare it with the maximum random number. If the random number is less than the maximum random number, the random number is successfully generated. If the random number is greater than the maximum random number, continue generating random numbers until it is less than the maximum random number, thus obtaining a successful random number. Specifically, a random number is generated based on a preset random number function.
[0071] Step S34: When the preset random number delay condition is met, the energy meter actively pushes the object data to the master station system. Specifically, the preset random number delay condition is the current time minus the start time of the push window plus the successful random number.
[0072] In practical applications, due to the limited number of energy meters on the bus, through steps S31-S34, data conflicts can be effectively avoided between energy meters, and data is pushed to the master system. The code for the slave device actively pushing data to the master based on the energy meter address encoding rules is as follows: Figure 8 As shown.
[0073] Example 2
[0074] This invention provides an energy meter that communicates with the master station system based on any of the local network communication methods for energy meters provided in Embodiment 1.
[0075] In this embodiment, the electricity meter is a CHS320.001 three-phase four-wire prepaid smart electricity meter product, which is only used as an example and is not limited thereto.
[0076] By using the energy meter device of the present invention, not only do all data formats conform to the requirements of DLMS / COMSE specifications, but communication efficiency can also be effectively improved, avoiding confusion and conflicts in the data actively pushed by the energy meter slave, and meeting the real-time requirements of important data push.
[0077] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.
Claims
1. A local network communication method for an electricity meter, applied to an electricity meter using the DLMS protocol, characterized in that, include: A preset electricity meter address encoding rule is added to the IEC 62056-47 link layer of the DLMS protocol for address addressing in local network communication of the electricity meter. The fields of the IEC 62056-47 link layer include: protocol version number, source port number, destination port number, and length. The protocol version number indicates the version of the protocol; the source port number is the sender's port number; the destination port number is the receiver's port number; and the length indicates the number of bytes in the application layer data. The process of setting the preset electricity meter address encoding rules includes: The electricity meter address is obtained based on the meter number; wherein the meter number is a pure number; the electricity meter address is: electricity meter address = last n digits of meter number + 32768, where n is a preset number of digits, and the electricity meter address is converted to hexadecimal; Use the electricity meter address as the source port number or destination port number in the IEC 62056-47 link layer; In the preset interface class of the energy meter, the master station system configures the preset interface class, which includes: OBIS encoding, active sending object, push window and maximum random number; The electricity meter actively pushes data to the main station system based on the preset electricity meter address coding rules and the interface class configuration of the main station system. The process of the electricity meter actively pushing data to the master station system includes: Query the current time in real time and determine whether the current time meets the start time of the push window; When the current time meets the start time of the push window, obtain the data of the actively sent object; A random number is generated and compared with the maximum random number. If the random number is less than the maximum random number, the random number is successfully generated. If the random number is greater than the maximum random number, random numbers are generated again until the random number is less than the maximum random number, thus obtaining a successful random number. When the preset random number delay condition is met, the energy meter actively pushes object data to the master station system based on the energy meter address encoding rule.
2. The local network communication method for electricity meters according to claim 1, characterized in that, The OBIS encoding is used to represent the identifier code of the interface class; The actively sent object is used to represent the identifier code of the object data that needs to be actively sent; The push window is used to indicate the start time of the active sending; The maximum random number is used to represent the maximum value of the random time actively sent.
3. The local network communication method for electricity meters according to claim 1, characterized in that, The preset random number delay condition is the current time minus the start time of the push window plus the successful random number.
4. The local network communication method for an electricity meter according to claim 1, characterized in that, The actively transmitted object data includes: power consumption, current, voltage, time, frequency, and the logical device name and meter number of the energy meter.
5. An electricity meter, characterized in that, The electricity meter includes a first module, which communicates with the master station system based on the local network communication method of the electricity meter according to any one of claims 1 to 4.
Citation Information
Patent Citations
Programmer for electric energy meters
CN102621921A
Mother-child topology structure of intelligent ammeterselectric energy meter, and method
CN109377743A