An electricity meter and communication module configuration interaction method, device, equipment and medium

CN122457475BActive Publication Date: 2026-09-11SHENZHEN STAR INSTR
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610915059.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-06-24
Publication Date
2026-09-11
Estimated Expiration
2046-06-24

AI Technical Summary

Technical Problem

[0004]本发明实施例提供一种电表与通信模组的配置交互方法、装置、设备及介质,以解决现有技术中配置同步机制易导致通信链路反复中断,设备功耗异常升高的问题

Benefits of technology

[0010] Sixthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described configuration interaction method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122457475B_ABST
    Figure CN122457475B_ABST
Patent Text Reader

Abstract

This invention discloses a configuration interaction method, apparatus, device, and medium for an electricity meter and a communication module. The method, applicable to communication modules, includes the following steps: sending a management interaction frame to the electricity meter, the management interaction frame instructing the electricity meter to send parameter configuration frames; if an interaction confirmation frame is received from the electricity meter, receiving the parameter configuration frames sent sequentially by the electricity meter, and returning a configuration response frame to the electricity meter each time a parameter configuration frame is received; receiving a configuration completion notification frame sent by the electricity meter in response to the last configuration response frame, the configuration completion notification frame carrying a configuration version identifier, comparing the configuration version identifier with a local version identifier to obtain an identifier comparison result; if the identifier comparison result shows a version identifier inconsistency, obtaining the configuration change type of the electricity meter, and determining the parameter activation strategy for the changed configuration parameters based on the configuration change type; and executing the parameter activation strategy to apply the changed configuration parameters. This method can significantly improve the reliability of the configuration interaction process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communication technology, and in particular to a method, apparatus, device, and medium for configuring and interacting between an electricity meter and a communication module. Background Technology

[0002] In smart meter centralized data collection systems, the meter itself and the communication module (GPRS / 4G / NB-IoT / PLC, etc.) typically interact with each other via UART serial port. The communication module, acting as a bridge between the remote master station and the meter, not only transmits business data but also receives management configuration information (such as APN, master station IP, authentication password, etc.) from the meter or master station.

[0003] When the configuration of the electricity meter changes, the communication module needs to update the local configuration parameters synchronously. However, due to the different starting identifiers, command codes, and verification field positions of the proprietary management frames of various manufacturers, the communication module cannot accurately identify and parse the configuration parameters from the existing management frames. At the same time, after each power-on or hardware reset of the communication module, the electricity meter reissues all configuration parameters. Once the reset is triggered due to configuration changes, a new round of power-on notification and full configuration reissue will be triggered, resulting in repeated interruptions of the communication link, abnormally high power consumption of the device, and seriously affecting the stability and reliability of remote meter reading. Summary of the Invention

[0004] This invention provides a configuration interaction method, apparatus, device, and medium for electricity meters and communication modules, in order to solve the problem that the configuration synchronization mechanism in the prior art easily leads to repeated interruptions of the communication link and abnormally high power consumption of the device.

[0005] In a first aspect, this application provides a configuration interaction method between an electricity meter and a communication module, applicable to the communication module, comprising the steps of: sending a management interaction frame to the electricity meter, the management interaction frame including a control field byte, the control field byte including a transmission direction bit, a confirmation request bit, and an encryption protection bit; the management interaction frame is used to instruct the electricity meter to issue a parameter configuration frame, the transmission direction bit is used to indicate the transmission direction of the management interaction frame, the confirmation request bit is used to indicate whether an interaction confirmation frame for the management interaction frame needs to be returned, and the encryption protection bit is used to indicate whether the electricity meter needs to encrypt the configuration parameters; if an interaction confirmation frame for the management interaction frame returned by the electricity meter is received, then the electricity meter sequentially receives the interaction confirmation frame for the management interaction frame. The system sends out parameter configuration frames, each carrying corresponding encrypted configuration parameters. Upon receiving a parameter configuration frame, it returns a configuration response frame to the meter. It also receives a configuration completion notification frame sent by the meter in response to the last configuration response frame. This configuration completion notification frame carries a configuration version identifier. The configuration version identifier is compared with a locally stored local version identifier to obtain an identifier comparison result. If the identifier comparison result indicates a version identifier mismatch, the system obtains the meter's configuration change type and determines the parameter activation strategy for the changed configuration parameters based on the configuration change type. Finally, it executes the parameter activation strategy to apply the changed configuration parameters.

[0006] Secondly, this application provides a configuration interaction method between an electricity meter and a communication module, applicable to electricity meters, comprising the steps of: receiving a management interaction frame from a communication module, the management interaction frame including a control field byte, the control field byte including a transmission direction bit, a confirmation request bit, and an encryption protection bit; the management interaction frame being used to instruct the electricity meter to send a parameter configuration frame, the transmission direction bit being used to indicate the transmission direction of the management interaction frame, the confirmation request bit being used to indicate whether an interaction confirmation frame for the management interaction frame needs to be returned, and the encryption protection bit being used to indicate whether the electricity meter needs to encrypt the configuration parameters; sending an interaction confirmation frame for the management interaction frame to the communication module; and sending a parameter configuration frame to the communication module, the parameter... Each configuration frame carries corresponding encrypted configuration parameters. If a configuration response frame is received for the configuration frame, the next configuration frame is sent to the communication module until multiple configuration frames are sent to the communication module in sequence. In response to the last configuration response frame, a configuration completion notification frame is sent to the communication module. The configuration completion notification frame carries a configuration version identifier. The configuration version identifier is used by the communication module to obtain the configuration change type of the meter when it is inconsistent with the local version identifier stored in the communication module. Based on the configuration change type, the communication module determines the parameter activation strategy for the changed configuration parameters and executes the parameter activation strategy to apply the changed configuration parameters.

[0007] Thirdly, this application provides a configuration interaction device between an electricity meter and a communication module, applicable to the communication module, comprising: an interaction initiation module, used to send a management interaction frame to the electricity meter, the management interaction frame including a control field byte, the control field byte including a transmission direction bit, a confirmation request bit, and an encryption protection bit; the management interaction frame is used to instruct the electricity meter to send a parameter configuration frame, the transmission direction bit is used to indicate the transmission direction of the management interaction frame, the confirmation request bit is used to indicate whether an interaction confirmation frame for the management interaction frame needs to be returned, and the encryption protection bit is used to indicate whether the electricity meter needs to encrypt the configuration parameters; and a configuration receiving module, used to receive the parameter configuration frames sequentially sent by the electricity meter if an interaction confirmation frame for the management interaction frame returned by the electricity meter is received. The system comprises the following modules: a configuration frame, which carries corresponding encrypted configuration parameters, and a configuration response frame, which is returned to the meter each time the configuration frame is received; an identifier comparison module, which receives a configuration completion notification frame sent by the meter in response to the last configuration response frame, which carries a configuration version identifier, and compares the configuration version identifier with a locally stored local version identifier to obtain an identifier comparison result; a policy determination module, which, when the identifier comparison result indicates that the version identifiers are inconsistent, obtains the configuration change type of the meter and determines the parameter activation policy for the changed configuration parameters based on the configuration change type; and a policy execution module, which executes the parameter activation policy to apply the changed configuration parameters.

[0008] Fourthly, this application provides a configuration interaction device between an electricity meter and a communication module, applicable to electricity meters, comprising: an interaction receiving module, used to receive a management interaction frame from the communication module, the management interaction frame including a control field byte, the control field byte including a transmission direction bit, a confirmation request bit, and an encryption protection bit; the management interaction frame is used to instruct the electricity meter to send a parameter configuration frame, the transmission direction bit is used to indicate the transmission direction of the management interaction frame, the confirmation request bit is used to indicate whether an interaction confirmation frame for the management interaction frame needs to be returned, and the encryption protection bit is used to indicate whether the electricity meter needs to encrypt the configuration parameters; an interaction confirmation module, used to send an interaction confirmation frame for the management interaction frame to the communication module; and a configuration sending module, used to send a parameter configuration frame to the communication module. A configuration frame is generated, each carrying corresponding encrypted configuration parameters. If a configuration response frame is received for the configuration frame, the next configuration frame is sent to the communication module until multiple configuration frames are sequentially sent to the communication module. An identifier sending module is used to send a configuration completion notification frame to the communication module in response to the last configuration response frame. The configuration completion notification frame carries a configuration version identifier. The configuration version identifier is used by the communication module to obtain the configuration change type of the meter when it is inconsistent with the local version identifier stored in the communication module. Based on the configuration change type, the module determines the parameter activation strategy for the changed configuration parameters and executes the parameter activation strategy to apply the changed configuration parameters.

[0009] Fifthly, this application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer device is configured as a communication module, the processor executes the computer program to implement the configuration interaction method provided in the first aspect; or, when the computer device is configured as an electricity meter, the processor executes the computer program to implement the configuration interaction method provided in the second aspect.

[0010] Sixthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described configuration interaction method.

[0011] In the above-mentioned calculation scheme for the configuration interaction method, device, equipment, and medium between the electricity meter and the communication module, the configuration interaction method between the electricity meter and the communication module is applicable to the communication module and includes the following steps: sending a management interaction frame to the electricity meter, the management interaction frame including a control field byte, the control field byte including a transmission direction bit, an acknowledgment request bit, and an encryption protection bit; the management interaction frame is used to instruct the electricity meter to send a parameter configuration frame, the transmission direction bit is used to indicate the transmission direction of the management interaction frame, the acknowledgment request bit is used to indicate whether an interaction acknowledgment frame for the management interaction frame needs to be returned, and the encryption protection bit is used to indicate whether the electricity meter needs to encrypt the configuration parameters; if an interaction acknowledgment frame for the management interaction frame is received from the electricity meter... The method receives parameter configuration frames sequentially from the meter, each carrying corresponding encrypted configuration parameters. Upon receiving a parameter configuration frame, it returns a configuration response frame to the meter. It also receives a configuration completion notification frame from the meter in response to the last configuration response frame. This notification frame carries a configuration version identifier, which is compared with a locally stored version identifier to obtain the identification comparison result. If the identifier comparison result shows a version identifier mismatch, the method obtains the meter's configuration change type and determines the parameter activation strategy for the changed configuration parameters based on the configuration change type. Finally, it executes the parameter activation strategy to apply the changed configuration parameters. This method, through a refined frame interaction mechanism and version comparison logic, significantly improves the reliability, security, and traceability of the configuration process, effectively avoiding communication interruptions and metering anomalies caused by version mismatches or parameter loss. Attached Figure Description

[0012] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 This is a schematic diagram illustrating the interaction principle between the electricity meter and the communication module in a configuration interaction method between the electricity meter and the communication module according to an embodiment of the present invention. Figure 2 This is a flowchart of the communication module side in the configuration and interaction method between the electricity meter and the communication module in one embodiment of the present invention; Figure 3 This is a detailed flowchart of a preliminary step of step S1 on the communication module side in the configuration and interaction method between the meter and the communication module in one embodiment of the present invention; Figure 4 This is a detailed flowchart of step S2 on the communication module side in the configuration and interaction method between the electricity meter and the communication module in one embodiment of the present invention; Figure 5This is a flowchart of the meter side in the configuration and interaction method between the meter and the communication module in one embodiment of the present invention; Figure 6 This is a detailed flowchart of a preliminary step of step S6 on the meter side in the configuration and interaction method between the meter and the communication module in one embodiment of the present invention. Figure 7 This is a flowchart of step S8 on the electricity meter side of the configuration interaction method between the electricity meter and the communication module in one embodiment of the present invention, in which a parameter configuration frame is sent to the communication module. Figure 8 This is a schematic diagram of a configuration and interaction device between an electricity meter and a communication module in one embodiment of the present invention; Figure 9 This is another schematic diagram of the configuration and interaction device between the electricity meter and the communication module in one embodiment of the present invention; Figure 10 This is a schematic diagram of a computer device according to an embodiment of the present invention. Detailed Implementation

[0014] 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 some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0015] It should be noted first that the configuration interaction process of this application adopts a custom MMEI (Meter Modem Exchange Interface) private management protocol to achieve security, reliability and self-decision-making throughout the configuration interaction process, and fundamentally eliminates the reset loop, ensuring compatibility with both new and old meters. The MMEI protocol communication frame consists of a 1-byte SOF (Start of Frame, with a fixed value of hexadecimal 0x6D), a 7 or 8-byte Header (the frame header in the protocol frame structure, typically containing control information and metadata), a variable-length Payload (the effective information portion of the transmitted data), a 2-byte CRC16 (Cyclic Redundancy Check, used to detect errors in data transmission), and a 1-byte EOF (End of Frame, with a fixed value of hexadecimal 0x11).

[0016] The Header defines a control field byte with the following bit definitions: bit 7 is the transmission direction bit (0 indicates the transmission direction is meter → communication module, 1 indicates the transmission direction is communication module → meter); bit 6 is the acknowledgment request bit (0 indicates the receiver does not need to reply with an acknowledgment frame, 1 indicates the receiver is required to reply with an acknowledgment frame within a specified time); bit 5 is the encryption protection bit (0 indicates the payload of this protocol frame and / or the return result of the receiver does not need to be encrypted, 1 indicates the payload of this protocol frame and / or the return result of the receiver needs to be encrypted); bits 4-0 are fixed and reserved, always set to 0. The payload uses a TLV (Type-Length-Value) encoding structure, where the Type field identifies the parameter type (e.g., 0x01 indicates communication frequency, 0x02 indicates APN configuration, 0x03 indicates heartbeat cycle), ensuring that the parameter type strictly matches the meter's capabilities and avoiding configuration failures or communication anomalies due to type misjudgment. For example, if the value of a control field byte in a protocol frame is 0xC0 (binary 11000000), then bit 7=1 indicates that the protocol frame was sent from the communication module to the meter; bit 6=1 indicates that after receiving the protocol frame, the meter must send an acknowledgment frame back to the communication module within 100ms; bit 5=0 indicates that the payload of the protocol frame is plaintext and does not need to be decrypted; bits 4~0=0 indicate that the protocol frame has no extended functionality. The entire judgment process only requires one bit operation and can be completed in one clock cycle, without any complex protocol parsing logic.

[0017] In one embodiment, such as Figure 1 and Figure 2 As shown, a configuration and interaction method between an electricity meter and a communication module is provided, applicable to communication modules, including the following steps: Step S1: Send a management interaction frame to the electricity meter. The management interaction frame is used to instruct the electricity meter to send a parameter configuration frame.

[0018] It should be noted that the management interaction frame adopts the MMEI protocol frame format, with its SOF fixed at 0x6D. The control field bytes in the Header are encoded according to the aforementioned bit definitions. The Payload is a TLV structure with Type=0x00 (identifying the management interaction type). CRC16 checksum covers the entire Header and Payload, and EOF is fixed at 0x11. The management interaction frame includes control field bytes, which include transmission direction bits, acknowledgment request bits, and encryption protection bits. The transmission direction bits indicate the transmission direction of the management interaction frame, the acknowledgment request bits indicate whether an interaction acknowledgment frame needs to be returned for the management interaction frame, and the encryption protection bits indicate whether the meter needs to encrypt the configuration parameters.

[0019] Combination Figure 1In this embodiment, the communication module sends a management interaction frame to the meter. This frame carries a preset control field byte, where bits 7-5 are the core control field bits, and bits 4-0 are reserved for future protocol evolution and expansion, ensuring backward compatibility and functional scalability. Specifically, bits 7=1, 6=1, and 5=1; bit 5=1 indicates that the meter needs to encrypt and encapsulate the configuration parameters into a parameter configuration frame to ensure that the configuration parameters are not stolen or tampered with during transmission; bit 6=1 requires the meter to return an interaction confirmation frame within 100ms to ensure the determinism of communication timing; bit 7=1 indicates that this frame is initiated by the communication module, constituting a reliable handshake starting point for master-slave collaboration.

[0020] In this application, the aforementioned MMEI protocol carries three control attributes—direction, acknowledgment, and encryption—simultaneously in a single byte, resulting in minimal ROM overhead for protocol parsing. It can be directly deployed in meter MCUs (Micro Control Units) without an operating system, eliminating the need for additional protocol stacks or external authentication modules, thus significantly reducing resource consumption and startup latency.

[0021] It should be noted that before executing step S1, the communication module needs to complete meter identification and link readiness determination to ensure that subsequent configuration interactions are based on real, addressable, and communicatively reachable devices. This process adopts a multi-level fault tolerance mechanism: the lightweight device identification mechanism built into the MMEI protocol proposed in this application is used first. After the communication module establishes a physical connection with the meter through the serial port, it sequentially attempts basic address detection mechanisms such as MMEI protocol identification, DLMS / COSEM protocol identification, and standard DL / T645 protocol identification to ensure strong robustness in complex field environments with mixed meter firmware versions and different meter models.

[0022] Specifically, such as Figure 3 As shown, before step S1, the procedure further includes: Step S101: Send a meter number read frame to the meter. The meter number read frame is used to request the meter to return a meter number response frame.

[0023] It should be noted that the meter number reading frame is a lightweight and scalable device identification instruction. It is a custom MMEI protocol instruction frame of this application with instruction code 0x3001, which is used to initiate a meter number query request to the electricity meter. The frame structure follows the SOF(0x6D)+Header+Payload+CRC16+EOF (0x11) specification.

[0024] In this embodiment, the serial communication parameters are set to 9600 8N1. The 9600 baud rate balances low power consumption and anti-interference capabilities, making it suitable for long-distance RS-485 bus deployment scenarios. The design of 8 data bits, no parity check, and 1 stop bit (8N1) ensures robust protocol frame parsing while minimizing the serial port driver overhead of the meter-side MCU, adapting to various resource-constrained metering chips. The communication module first sends a meter number read frame to the meter, which carries preset control field bytes. Bit 7=1 indicates that the frame is initiated by the communication module, forming the initial probe in the device identification phase; bit 6=1 forces the meter to respond within the first preset time, returning a meter number response frame to the meter, strictly controlling the first round of identification delay; bit 5=1 enables a lightweight response signature mechanism, performing CRC16-HASH digest encapsulation only on the meter number field, preventing forged responses and avoiding the computational overhead and memory usage caused by full-frame signature.

[0025] Step S102: If a meter number response frame corresponding to the meter number reading frame is received from the meter within the first preset time, the meter number response frame is parsed to obtain the meter number.

[0026] It should be noted that the first preset time is a configurable timeout threshold, typically 500ms. Its setting must balance communication link stability and device real-time response; too short a timeout may lead to misjudgments due to momentary interference, while too long a timeout will affect recognition efficiency and system response speed. Its setting needs to be dynamically optimized based on actual measurement data from the field communication environment and can be adjusted online via remote configuration commands.

[0027] In this embodiment, if a meter number response frame corresponding to the meter number reading frame is received from the meter within the first preset time of 500ms, the meter number response frame is parsed, the meter number field is extracted, and the validity of the lightweight response signature is verified. If the signature verification is successful and the meter number field is not empty, the meter identity is confirmed to be legitimate and the link is reachable, and the process proceeds to step S1. If the signature is invalid or the meter number is empty, the identification is considered to have failed, and the downgrade identification process in step S103 is triggered.

[0028] Step S103: If no meter number response frame corresponding to the meter number read frame is received from the meter within the first preset time, a connection establishment request frame is sent to the meter. The connection establishment request frame is used to request the meter to establish a communication connection. The meter returns a connection establishment response frame. After receiving the connection establishment response frame, a logical device name read frame is sent to the meter. The logical device name read frame is used to request the meter to return a logical device name response frame.

[0029] It should be noted that the connection establishment request frame is a general connection establishment instruction defined in the DLMS / COSEM protocol standard. It is used to request the meter to establish a standard application layer association and is a crucial step in the device identity initialization process within the DLMS / COSEM protocol stack. The connection establishment response frame is a standard AARE (Application Association Response) returned by the meter. Its result field explicitly indicates the association establishment status; if the result is "successful," it indicates that the link-level application association is ready, and subsequent DLMS object access operations can be safely performed. The logical device name read frame is a standard object access instruction defined in the DLMS / COSEM protocol. It is used to read the meter's internal LDN (Logical Device Name) object instance (0x2A attribute). This object uniquely identifies the meter's logical identity in the DLMS application layer using a byte OID (Object Identifier), serving as a key anchor point for cross-vendor device interoperability and remote management. The byte OID carried in the logical device name response frame needs to be Base16 encoded and converted into an 8-16 digit hexadecimal string, serving as the meter's unique logical identity identifier within the system, i.e., the meter number.

[0030] In this embodiment, if the meter number response frame corresponding to the meter number read frame returned by the meter has been received for more than 500ms, it is determined to be a timeout response. Alternatively, if an "unsupported command" error code is received, that is, if the meter number response frame corresponding to the meter number read frame returned by the meter is not received within the first preset time of 500ms, the serial communication parameters are still set to 96008N1, and a connection establishment request frame is sent to the meter. The connection establishment request frame contains a standard AARQ (Application Association Request) application association request, whose context identifier is set to 0x01 and the service type is "no authentication association" to reduce handshake overhead. In the AARQ (Application Association Response) frame of the meter response, if the return result is "success", the communication module immediately initiates a logical device name read operation; otherwise, it enters the parameter adaptive retry process in step S105.

[0031] In this application, the above process does not rely on pre-set keys or certificates, but achieves a link-level trusted handshake through lightweight context negotiation, laying the foundation for subsequent parameter reading and secure operations.

[0032] Step S104: If a logical device name response frame corresponding to the logical device name read frame returned by the meter is received within the second preset time, the logical device name response frame is parsed to obtain the meter number.

[0033] It should be noted that the second preset time refers to the timeout threshold for the meter to respond to the logical device name reading frame. Its specific value should be set comprehensively based on the stability of the communication link, the meter's response capability, and the on-site electromagnetic environment. A typical value is 3000ms. If no response is received within the timeout period, it is determined that the logical device name reading under the current link has failed, triggering the parameter adaptive retry process in step S105.

[0034] In this embodiment, if a logical device name response frame corresponding to the logical device name read frame is received from the meter within the second preset time of 3000ms, the logical device name response frame is parsed. The parsing process of the logical device name response frame strictly follows the encoding specifications of LDN objects (Class 0, Instance 0) in the DLMS / COSEM protocol. Its 6-byte OID field is located at the starting offset of the application layer data segment of the response frame at offset 0x04, arranged in big-endian order. During parsing, the frame integrity (such as HDLC FCS) and the application layer return status (such as DLMS return code 0x00 indicating success) need to be verified, and 6 consecutive bytes after the offset are extracted and Base16 encoded to generate a standard 12-bit meter number string. The parsing process must ensure byte alignment and encoding consistency to avoid meter number generation deviation due to endianness misjudgment or Base16 mapping errors. In actual deployment, it is advisable to add verification logic to perform format validity verification on the generated 12-bit meter number (such as all hexadecimal characters and a strict length of 12).

[0035] Step S105: If no connection establishment response frame is received within the second preset time, switch the serial communication parameters and send a read address command frame to the meter. The read address command frame is used to request the meter to return a read address response frame.

[0036] It should be noted that the read address command frame is a standard command in the DL / T 645 protocol. Its frame format consists of a start character (0x68), a length field, an address field, a control code (0x11 indicates reading data), a data identifier (0x00000000 indicates the table address), a check field, and an end character (0x16). This command does not rely on application layer authentication and is suitable for fallback addressing in scenarios where the key is missing or negotiation fails. The read address response frame is the meter's response to the read address command frame. Its frame structure includes a start character, an address field, a control code (0x91 for 0x11), a data field (containing a 6-byte table address in BCD format), a check field, and an end character. During parsing, the integrity of the frame format must be verified (e.g., the start character and end character match, and the check field is correct). The 6-byte BCD code in the address field is extracted and converted to ASCII to generate a 12-bit table number string.

[0037] In this embodiment, if no logical device name response frame corresponding to the logical device name read frame is received from the meter within the second preset time of 3000ms, the serial communication parameters are switched to 9600 8E1, the parity bit is switched from N (no parity) to E (even parity), and the data bits and stop bits remain unchanged to minimize the impact of parameter disturbances on communication stability. Simultaneously, a read address command frame is sent to the meter to complete the first addressing attempt after the serial port parameter switch. This operation is not a compromise, but a proactive adaptation to complex environments, reflecting the flexible fault-tolerant design of the communication protocol stack at the edge.

[0038] Step S106: If a meter reading address response frame is received within the third preset time, the meter reading address response frame is parsed to obtain the meter number.

[0039] It should be noted that the third preset time refers to the timeout threshold for the meter to respond to the read address command frame. Its value needs to take into account both protocol compatibility and field robustness, with a typical value of 5000ms.

[0040] In this embodiment, if a read address response frame is received within the third preset time of 5000ms, the read address response frame is parsed. The parsing of the read address response frame must strictly follow the DL / T 645 protocol. Its address field is in 6-byte BCD code format, with the high-order byte first. During parsing, the start and end characters need to be stripped, the 6-byte BCD code is extracted and converted into a 12-bit ASCII string, and the high-order byte is checked byte by byte to ensure the validity of the BCD. The converted ASCII string is checked to see if it conforms to the meter address encoding standard (e.g., the first byte is not zero, and there are no illegal characters), and a leading zero is filled to a fixed length of 12 bits. If the check fails, an error log is recorded and the exception handling branch is entered.

[0041] It should be noted that after successfully obtaining the meter number, the meter number is stored in the non-volatile memory of the communication module and reported to the master station. Simultaneously, the communication module can record the protocol used in the last successful meter number acquisition, and prioritize using that protocol on the next power-on to expedite the acquisition process.

[0042] Furthermore, if no meter reading address response frame is received within the third preset time, it is determined that the meter does not support the DL / T 645 protocol, triggering the subsequent physical layer renegotiation process, including retrying serial port parameter combinations (such as trying other baud rates, parity bits, and stop bits such as 2400 8E1), switching to the infrared communication channel, or triggering a hardware reset and re-initiating the key negotiation process; all renegotiation actions must record a complete context log (including timestamp, failure reason code, and current serial port configuration), and limit the number of renegotiations in a single session to no more than 3 times to prevent getting stuck in an infinite loop.

[0043] Furthermore, after physical layer renegotiation fails, a device self-test mechanism should be triggered to scan the local firmware version and meter model compatibility matrix. If a known incompatible combination is found, the device should automatically downgrade to the basic communication mode (such as 9600bps / 8N1) and report a "protocol compatibility alarm" to the master station. All abnormal paths must ensure that the state machine can be rolled back to ensure that the system does not lose its core functionality during abnormal disturbances and can still maintain basic communication capabilities when the protocol is incompatible. This provides maintenance personnel with diagnosable on-site status information and supports triggering parameter synchronization and verification processes after security downgrade via remote commands.

[0044] In this application, the pre-step steps prior to step S1 above achieve automatic protocol stack rollback and check bit / baud rate linkage switching through the communication module. Without any firmware modification on the meter side, it can obtain meter numbers from meters of different eras and protocols, achieving automatic identification and seamless adaptation of meter numbers across protocols, eras, and manufacturers. At the same time, the measured success rate of meter number acquisition has increased from 60%-80% to over 99%, and on-site installation achieves "plug and play," significantly shortening the installation and debugging time of a single meter to an average of less than 2 minutes, reducing on-site maintenance manpower input by about 40%, and laying a solid foundation for subsequent remote batch upgrades and dynamic parameter distribution.

[0045] Step S2: If an interaction confirmation frame for the management interaction frame is received from the meter, then the parameter configuration frames sent by the meter in sequence are received, and a configuration response frame for the parameter configuration frame is returned to the meter each time a parameter configuration frame is received.

[0046] It should be noted that the interaction confirmation frame is a positive response from the meter after the legality and integrity of the management interaction frame have been verified. Whether to generate an interaction confirmation frame is determined by the setting status of the confirmation request bit in the corresponding control field byte of the management interaction frame. When the confirmation request bit is 1, the meter must return an interaction confirmation frame; otherwise, it is considered a protocol violation, and the communication module will record a "control field response missing" alarm and terminate the current management interaction process. The parameter configuration frame is a structured data carrier sent by the meter to the communication module, carrying encrypted configuration parameters, including but not limited to meter number, APN, master station IP address, authentication password, etc. Each frame contains an independent frame sequence number, checksum, and frame length field to ensure that the receiving end can accurately identify frame boundaries and integrity. The parameter configuration frame carries corresponding encrypted configuration parameters, and its frame structure strictly follows the frame format specification of the custom MMEI protocol in this application, ensuring that its integrity verification is passed before proceeding to subsequent parsing and application processes.

[0047] In this embodiment, the transmission direction bit in the control field byte of the parameter configuration frame is 0, indicating that the parameter configuration frame is a downlink configuration frame (i.e., sent from the meter to the communication module); the confirmation request bit is 1, the communication module must return a configuration response frame, otherwise it will be judged as "response missing", triggering a local alarm and terminating the current parameter interaction process; the encryption protection bit is 1, indicating that the content of the parameter configuration frame has been protected by AES-256-GCM encryption, the communication module needs to verify the integrity of the GCM authentication tag before decryption, any verification failure will trigger an "encryption frame authentication failure" alarm and discard the entire frame.

[0048] Furthermore, if an interactive confirmation frame is received from the meter, the parameter configuration frame reception and response closed loop begins. The communication module parses the frame sequence number of the parameter configuration frame frame by frame and verifies its checksum and frame length fields frame by frame to ensure frame integrity. If any verification fails, the frame is discarded and a "parameter frame verification error" log is recorded. At the same time, a NACK response is returned to the meter, triggering retransmission. Only when all verifications pass will the parameter configuration frame be sent to the decryption module for key negotiation and plaintext restoration, providing a trusted input for subsequent parameter parsing and secure writing. The module then returns a configuration response frame carrying the corresponding frame sequence number to the meter, completing a full parameter interaction closed loop.

[0049] The transmission of configuration response frames strictly follows the timing constraints of the MMEI protocol to ensure that the frame interval is not less than 50ms, so as to avoid the overflow of the meter receiving buffer due to excessively fast response. At the same time, before sending each configuration response frame, the communication module dynamically updates the local interactive state machine to the "waiting for the next parameter frame" state and starts a 1.5-second timeout monitoring. If no new frame is received within the timeout, a heartbeat probe frame is actively sent to detect the link activity.

[0050] Specifically, such as Figure 4 As shown, the execution logic of the parameter configuration frame reception and response closed loop in step S2 can be subdivided into the following sub-steps: Step S21: Extract the frame sequence number of the received parameter configuration frame.

[0051] It should be noted that the frame sequence number is a unique identifier for the parameter configuration frame, used to establish the frame-level timing synchronization and retransmission anchor point between the communication module and the meter. Its value is an unsigned 16-bit integer, allocated in natural increment order, with an initial value of 0x0001. It increments by 1 for each successfully received and acknowledged frame. When the frame sequence number overflows, it automatically wraps back to 0x0001, but a frame sequence number reset notification must be sent to the meter synchronously to prevent timing misalignment between the two parties.

[0052] In this embodiment, for each parameter configuration frame, after receiving the corresponding parameter configuration frame, the communication module immediately performs frame sequence number extraction to obtain the corresponding frame sequence number, which is used for subsequent configuration response frame construction and state machine advancement.

[0053] Step S22: Generate a configuration response frame carrying a frame sequence number and return the configuration response frame to the meter.

[0054] In this embodiment, for the obtained frame sequence number, the communication module will generate a corresponding configuration response frame. The frame structure of the configuration response frame strictly follows the response frame format defined by the MMEI protocol: the first byte is a fixed frame header 0xAA, the second byte is a frame type identifier 0x02 (indicating configuration response), the next two bytes are a 16-bit frame sequence number (completely consistent with the received parameter configuration frame), the next two bytes are a checksum (CRC-16-CCITT), and the last byte is a frame tail 0x55. After generation, it is immediately sent to the meter through the corresponding serial port, and the hardware-level transmission timer is simultaneously enabled to ensure that after the frame tail 0x55 is sent, a strict wait of ≥50ms is required before returning to step S21 to start the next frame processing. If a serial port abnormality is detected during transmission (such as a full TX buffer or a disconnected line), the state machine is immediately frozen, a "physical layer transmission interruption" log is recorded, and the link self-healing process is triggered. The communication module is restarted and a secure session is re-established to ensure that the key parameters take effect in the full-link trusted context.

[0055] In some embodiments, if no interactive confirmation frame is received from the meter, the communication module will initiate a three-level retry mechanism (interval of 100ms / 300ms / 1s), and trigger a "management interaction timeout" alarm after the third failure. At the same time, it will automatically switch to the backup management channel (such as the carrier-assisted channel or the local infrared interface) to retransmit the management interaction frame, ensuring that the critical configuration process is not interrupted due to a single point of communication failure.

[0056] Step S3: Receive the configuration completion notification frame sent by the meter in response to the last configuration response frame. The configuration completion notification frame carries a configuration version identifier. Compare the configuration version identifier with the local version identifier stored locally to obtain the identifier comparison result.

[0057] It should be noted that the configuration completion notification frame is a terminal-level confirmation signal actively sent by the meter to the communication module after receiving all configuration response frames and completing the local parameter writing and verification. This configuration completion notification frame has a 0xBB header, followed by a byte indicating the frame type 0x03 (configuration completion notification), and then two bytes representing the currently effective configuration version identifier. This identifier uses big-endian encoding, and the last byte is a checksum (XOR-8) to ensure the version identifier has basic anti-interference capabilities during channel transmission. When constructing this frame, the meter synchronously updates its local configuration status register, setting it to the "pending synchronization" state and triggering a version snapshot write to the local non-volatile storage area, ensuring that the latest valid configuration baseline can still be traced in the event of a power outage. The configuration version identifier is a globally unique and tamper-proof configuration snapshot fingerprint, which can be generated by the meter after completing the writing of all configuration parameters using a hash algorithm (such as SHA-256) to perform a digest operation on the complete configuration parameter set, ensuring that even a small change in any parameter results in a fingerprint-level difference. The local version identifier is the hash value of the last successfully written configuration snapshot, which is read and cached by the communication module before the start of the current configuration session. This value can also be generated by SHA-256 digest and stored in big-endian order in the non-volatile configuration area to form a trusted baseline anchor point.

[0058] In this embodiment, upon receiving a configuration completion notification frame, the communication module immediately parses its frame structure and extracts the configuration version identifier. If parsing fails (e.g., frame header error, checksum mismatch, or version field out of bounds), the frame is discarded, a "configuration completion notification frame parsing error" log is recorded, and a link-level alarm is reported to the master control. Simultaneously, the current session state is maintained, waiting for the next timeout retry window to open. If parsing succeeds, the extracted big-endian configuration version identifier is compared byte-by-byte with the local version identifier in the local cache, generating a Boolean identifier comparison result. If the identifier comparison result shows a version identifier inconsistency, it indicates that the new configuration has been successfully written to the meter side, while the communication module's local cache remains stuck on the old baseline. The communication module then needs to synchronously update its local version identifier to the new configuration version and report a "configuration baseline synchronized" event to the master control, while simultaneously triggering a version cache refresh operation in the local non-volatile storage area. If the comparison result shows that the version identifier is consistent, it indicates that the configuration on the meter side has not been substantially updated. The communication module maintains the local version identifier unchanged, prohibits any reset operation, maintains network connection and service channel, only replies "success" to the meter and records the "configuration not changed, skip reset" event, and reports the "configuration baseline has not changed" status event to the master control, and ends the current configuration session.

[0059] In this application, by introducing a configuration version identifier as a comparison basis, the communication module actively compares and synchronizes the configuration version identifier, which not only realizes the atomicity of the configuration status, but also establishes a reliable, traceable and verifiable collaborative baseline between the meter and the communication module. While ensuring accuracy, it greatly reduces the RAM (Random Access Memory) and CPU time required for comparison by the communication module.

[0060] Step S4: When the identification comparison result shows that the version identification is inconsistent, obtain the configuration change type of the meter, and determine the parameter activation strategy of the changed configuration parameters according to the configuration change type.

[0061] It should be noted that configuration change type is a semantic classification of the changed configuration parameter set after the meter has completed all parameter writing and verification, based on a preset parameter sensitivity classification rule. This classification is based on the degree of impact of the parameter change on the meter's operational safety, metering accuracy, and communication link stability. Configuration change types include critical parameter changes and non-critical parameter changes. Critical parameter changes refer to adjustments affecting the meter's operational safety, metering accuracy, or communication link stability, such as current / voltage range, metering constant, key index, and heartbeat cycle. Non-critical parameter changes refer to adjustments affecting only auxiliary functions or local display behavior, such as LCD backlight duration, event log retention days, and debugging information output level. The parameter activation strategy dynamically matches the most suitable activation mechanism based on the differences in the impact of the parameter change type on the system. Parameter activation strategies include reset and reconnection strategies and hot-load strategies. The reset and reconnect strategy requires the communication module to actively disconnect the current TCP / UDP session after completing parameter synchronization, clear all runtime contexts (including key cache, heartbeat timer, and unacknowledged message queue), and trigger a hardware-level module reset. After the reset, the communication module re-executes the link establishment process, including physical layer handshake, TLS 1.3 negotiation, two-way authentication, and session key derivation. Only after the link is successfully rebuilt and the meter returns a "configuration loading ready" response frame is the critical parameter considered to have taken effect. The hot-load strategy allows the communication module to parse and inject changed configuration parameters locally without interrupting the current TCP / UDP session. It only refreshes the runtime configuration cache of the corresponding functional module (such as the backlight control register and log rolling threshold variable), synchronously updates the local parameter snapshot, and reports a "non-critical parameter hot-load complete" event to the master controller. The entire process takes less than 10ms, and the hot-load process causes zero disturbance to the communication link, ensuring that business continuity is not affected.

[0062] In this embodiment, when the identification comparison result shows that the version identification is inconsistent, the configuration parameters after configuration changes are completely written into the configuration storage area corresponding to the communication module, and the local version identification is updated to complete the closed-loop confirmation of configuration synchronization.

[0063] Furthermore, the communication module identifies changed configuration parameters in the corresponding configuration storage area, determining the type of parameter change. If a change is detected in network attachment parameters (APN, IP, authentication information), the configuration change type is determined to be a critical parameter change, and the corresponding parameter activation policy is determined to be a reset and reconnection policy. If a change is detected that only involves non-critical parameters such as log switch or heartbeat cycle, the configuration change type is determined to be a non-critical parameter change, and the corresponding parameter activation policy is determined to be a hot-load policy.

[0064] In this application, by refining the classification of configuration change parameters, the precise identification of the configuration change type of the electricity meter and the matching of parameter activation strategies are achieved. This significantly improves the response efficiency and business continuity of remote configuration while ensuring the safe operation and metering reliability of the electricity meter.

[0065] Step S5: Execute the parameter activation policy to apply the changed configuration parameters.

[0066] In this embodiment, when the reset and reconnection strategy is adopted, the communication module immediately terminates the current session, triggers a software reset or hardware reset, clears the runtime context and rebuilds the communication link. After the link is successfully rebuilt and the meter returns a "configuration loading ready" response frame, the application and verification of the corresponding changed configuration parameters are completed.

[0067] Furthermore, when the hot-loading strategy is adopted, the communication module, while maintaining the continuous online TCP / UDP long connection, parses the non-critical fields in the parameter configuration frame in real time, locates the memory mapping address of the corresponding functional module, atomically updates the configuration cache and synchronously refreshes the local snapshot; at the same time, it triggers an interrupt to the main control MCU and reports the "non-critical parameter hot loading completed" event. There is no link jitter, no packet drop, and no service interruption throughout the process, and the end-to-end effective delay is consistently below 8.3ms (millisecond-level precision in a single cycle).

[0068] In this application, by granting reset decision-making power to the communication module and deeply coupling configuration change type identification with parameter activation policy execution, the communication module achieves autonomous decision-making and closed-loop execution of configuration changes. This avoids invalid reset operations caused by unchanged configuration parameters, breaks the deadlock between configuration distribution and reset, significantly reduces the probability of abnormal communication link interruption, and improves the overall robustness of the system and the efficiency of remote operation and maintenance. Furthermore, in actual testing, the number of resets was reduced to 0 when the configuration remained unchanged; while in scenarios involving configuration parameter changes, the service interruption time was shortened from approximately 30 seconds to approximately 5 seconds. The differentiated parameter activation policy also improved operational flexibility and reduced unnecessary communication link interruptions by 95%.

[0069] In one embodiment, such as Figure 1 and Figure 5As shown, a configuration and interaction method between an electricity meter and a communication module is provided, applicable to electricity meters, including the following steps: Step S6: Receive a management interaction frame from the communication module. The management interaction frame is used to instruct the meter to send a parameter configuration frame.

[0070] It should be noted that the management interaction frame includes control field bytes, which include transmission direction bits, confirmation request bits, and encryption protection bits. The transmission direction bits are used to indicate the transmission direction of the management interaction frame, the confirmation request bits are used to indicate whether an interaction confirmation frame for the management interaction frame needs to be returned, and the encryption protection bits are used to indicate whether the meter needs to encrypt the configuration parameters.

[0071] Combination Figure 1 After receiving the management interaction frame from the communication module, the meter parses its control field bytes, verifies the frame's validity based on the transmission direction bit, presets the interaction confirmation frame's pending state based on the confirmation request bit, and initiates the configuration parameter encryption process based on the encryption protection bit, ensuring that the configuration parameters have end-to-end confidentiality and integrity protection during transmission.

[0072] In this embodiment, in the control field byte of the management interaction frame, the value of the corresponding transmission direction bit is 1 to indicate the downlink direction (communication module → meter); the value of the corresponding confirmation request bit is 1 to indicate that an interaction confirmation frame needs to be returned; the value of the corresponding encryption protection bit is 1, and the meter uses the AES-256-GCM algorithm to encrypt the configuration parameters to ensure that the ciphertext has strong anti-replay capability and uniqueness.

[0073] It should be noted that before the meter receives a management interaction frame from the communication module, it needs to start a preset time window to listen for the arrival of the management interaction frame. If no management interaction frame is received within the preset time window, the timeout handling mechanism is started, triggering the communication module reset process to ensure that the system can actively restore its communication sensing capability even in an abnormal silent state.

[0074] Specifically, such as Figure 6 As shown, before step S6, the method further includes: Step S601: Detect whether a management interaction frame from the communication module has been received.

[0075] In this embodiment, the system continuously monitors the arrival of management interaction frames from the communication module and uses a hardware-level edge-triggered mechanism to capture the frame start signal of the serial port / USB interface. This ensures the real-time performance and anti-interference capability of the frame start signal capture and avoids false triggering due to signal jitter or glitches.

[0076] Step S602: If no management interaction frame is received within the preset time window, the communication module is reset.

[0077] It should be noted that the preset time window is a dynamically adjustable timeout threshold, which can be dynamically adjusted based on preset communication link stability indicators and historical interaction data to ensure that the adaptive adjustment strategy of the preset time window takes into account both the instantaneous jitter and long-term attenuation characteristics of the communication link. For example, it can be dynamically configured within a range of 5 to 30 minutes according to the actual communication environment.

[0078] In this embodiment, the preset time window is 15 minutes. The meter starts a 15-minute timeout timer. If the timer overflows and no MMEI frame is captured, a low-level pulse is triggered through the hardware reset pin. The pulse width is 100ms to ensure that the communication module can be reliably restarted and re-enter the initialization state.

[0079] It should be noted that if continuous business data transparent communication is detected on the serial port between the electricity meter and the communication module within the preset time window (such as detecting a byte stream that conforms to the characteristics of DLMS WRAPPER or DL / T645 frame, and the interval between bytes is less than 50ms), the communication module is determined to be in normal business processing state. Even if there is no management frame, it will not trigger a reset, thus preventing the communication module from being reset erroneously during batch meter reading and greatly improving the continuity of communication services.

[0080] Step S7: Send an interaction confirmation frame to the communication module for the management interaction frame.

[0081] In this embodiment, for the management interaction frame corresponding to the confirmation requirement location 1, after the meter completes parameter parsing and local storage, it immediately constructs and sends an interaction confirmation frame. The interaction confirmation frame also adopts the MMEI frame format. Its frame header includes a version number, frame type identifier (0x02), frame length field and 16-bit CRC check code. Its payload field includes a confirmation status code (0x00 indicates success, 0x01 indicates parsing failure), local parameter version number and timestamp, ensuring that the interaction process has traceability and status consistency.

[0082] Step S8: Send parameter configuration frames to the communication module. If a configuration response frame for the parameter configuration frame is received, continue to send the next parameter configuration frame to the communication module until multiple parameter configuration frames are sent to the communication module in sequence.

[0083] It should be noted that the parameter configuration frame carries corresponding encrypted configuration parameters, the specific meaning of which has been described above and will not be repeated here.

[0084] In this embodiment, based on the encryption protection bit set to 1 in the management interaction frame, the meter initiates the AES-256 key derivation process. The meter's unique identifier and the preset initial key jointly participate in the key derivation. The generated session key is used to encapsulate the subsequent configuration parameters into a parameter configuration frame using AES-256-GCM authentication encryption. This ensures that the encryption process has forward security and anti-replay capability, preventing the decryption of historical communications or the replaying of old configuration frames by attackers after key leakage.

[0085] Furthermore, the configuration parameters include configuration items such as meter number, APN, master station address, and authentication password. Each parameter configuration frame contains one configuration item, and the frame header carries a 1-byte frame sequence number generated by the meter accumulation, which is used to identify the parameter type and distribution order of the configuration parameters carried in the current parameter configuration frame. The configuration response frame returned by the corresponding communication module to the meter must also carry the same frame sequence number, so that the meter can verify the matching between the configuration response frame and the currently distributed parameter configuration frame, and prevent misjudgment due to channel interference or communication module abnormality.

[0086] Specifically, such as Figure 7 As shown, sending a parameter configuration frame to the communication module includes the following steps: Step S81: Obtain the unique identifier of the electricity meter and generate an encryption vector based on the unique identifier of the electricity meter.

[0087] It should be noted that the unique identifier of an electricity meter is a unique hardware identity identifier for the meter, which is usually composed of an unalterable serial number or chip UID written during the manufacturing stage.

[0088] In this embodiment, the meter's unique identifier is the meter number, which is an 8-16 digit string. The lower 12 bytes of the meter number's ASCII code value are taken, padding with 0s if necessary, to form the encryption vector. For example, the meter number "123456789012" corresponds to the hexadecimal encryption vector "31 32 33 34 35 36 37 38 39 30 31 32". This vector participates in the AES-256-GCM encryption operation throughout the process, working in conjunction with the session key to ensure the uniqueness and unpredictability of each ciphertext frame.

[0089] In this application, a unique encryption vector is generated using the unique identifier of the electricity meter, achieving one encryption per meter. Any intercepted legitimate ciphertext cannot be replayed across electricity meters, solving the existing problems of cross-meter replay attacks and identity spoofing, and significantly improving the anti-penetration capability of the metering terminal in a wide-area IoT environment. At the same time, this derived method does not require an additional random number generator, thus not increasing hardware costs.

[0090] Step S82: Encrypt the configuration parameters according to the encryption vector to obtain the encrypted configuration parameters.

[0091] It should be noted that the encryption process strictly follows the AES-256-GCM standard, ensuring that the authentication tag is 128 bits long. This tag is rigorously verified during the decryption and verification phase; configuration parameters are only received and parsed if the tag matches, thus eliminating the risk of tampering and forgery. The encrypted configuration parameters are encrypted ciphertext data, with the same length as the original configuration parameters, and include a 16-byte GCM authentication tag. This tag is encapsulated along with the ciphertext in the payload field of the parameter configuration frame. It must be verified synchronously during decryption on the communication module side. Only after successful decryption and tag verification is the parameter written to the runtime configuration area and the corresponding policy execution triggered.

[0092] In this embodiment, encryption employs the AES-256-GCM standard algorithm. The preset initial key is the ASCII code value "5368656E7A68656E5374617232303139," which is pre-installed in the firmware of both the communication module and the meter at the factory. This ensures that the key material remains isolated from the communication channel throughout the device's lifecycle, eliminating the risk of leakage during operation. Furthermore, the key can be updated online via the MMEI encryption command. The update message itself is encrypted with the old key and a forced encryption flag is applied, ensuring secure key distribution. After key derivation based on the encryption vector and the preset initial key, AES-256-GCM encryption is performed on the configuration parameters to generate an encrypted ciphertext payload and a 16-byte GCM authentication tag. These two elements together constitute the complete encrypted configuration parameters.

[0093] Step S83: Encapsulate the encrypted configuration parameters into a parameter configuration frame and send the parameter configuration frame to the communication module.

[0094] In this embodiment, the meter encapsulates the encrypted configuration parameters into a parameter configuration frame format conforming to the MMEI protocol specification, including a frame header, encrypted configuration parameter payload, GCM authentication tag, and frame tail verification field. The frame header contains a frame type identifier "0x83", a length field, and reserved bits. The payload area strictly carries the encrypted payload output by AES-256-GCM and a 16-byte tag. The frame tail uses CRC-16-CCITT verification to ensure transmission integrity. Simultaneously, in the corresponding control field bytes, the transmission direction is set to 0, the confirmation request is set to 1, and the encryption flag is synchronously set to 1. This ensures that the communication module side forcibly enables the AES-256-GCM decryption and GCM tag verification process to return the corresponding configuration response frame to the meter, completing the end-to-end trusted configuration closed loop.

[0095] Furthermore, after sending a parameter configuration frame, the meter immediately initiates a timeout retransmission mechanism, starting a 100ms timeout timer. If a configuration response frame is not received from the communication module before the timeout, the parameter configuration frame is automatically retransmitted, with a maximum of 3 retries. Simultaneously, the encryption vector can be updated before each retransmission to ensure that the same configuration parameters generate unique ciphertext in different transmission instances, preventing replay attacks.

[0096] In this application, when the encryption protection position of the management interaction frame is set to 1, the configuration parameters of the electricity meter are encrypted and encapsulated into a parameter configuration frame format conforming to the MMEI protocol specification and sent to the communication module. The communication module parses the frame structure of the parameter configuration frame, verifies the CRC-16-CCITT, and calls the key material and derived logic pre-set in the local firmware to complete decryption and tag verification. Only after all verifications pass is the decrypted configuration parameters allowed to be written to the runtime configuration area, and the corresponding configuration response frame is returned to the electricity meter, thereby completing the end-to-end trusted configuration closed loop. This ensures that the parameter distribution process has strong anti-tampering, anti-replay, and identity binding capabilities, providing dual protection of confidentiality and integrity, eliminating cross-device replay attacks, and incurring no additional hardware costs. At the same time, the frame sequence number design can effectively prevent sequence number rollback and frame order replay, ensuring application layer reliability and order consistency, and avoiding the risk of configuration parameters being incorrectly overwritten or configuration failure.

[0097] Step S9: In response to the last configuration response frame, a configuration completion notification frame is sent to the communication module. The configuration completion notification frame carries a configuration version identifier. The configuration version identifier is used by the communication module to obtain the configuration change type of the meter when the configuration version identifier is inconsistent with the local version identifier stored in the communication module. Based on the configuration change type, the module determines the parameter activation policy of the changed configuration parameters and executes the parameter activation policy to apply the changed configuration parameters.

[0098] It should be noted that the configuration completion notification frame itself does not carry the parameters to be configured. Its payload only contains the configuration version identifier and verification information. It does not participate in key derivation or decryption operations, nor does it trigger any configuration write action.

[0099] In this embodiment, the configuration version identifier is a monotonically increasing version number, incrementing by 1 after each configuration update, with an initial value of 1, ensuring that the version sequence is strictly monotonic and traceable. This design avoids the risk of hash collisions, simplifies the version comparison logic of the communication module, ensures that the version comparison logic is lightweight and efficient, and adapts to resource-constrained embedded environments.

[0100] In other embodiments, the configuration version identifier can be generated by concatenating the configuration parameters corresponding to each parameter configuration frame and calculating a CRC32 or SHA-256 hash value. This ensures that the version identifier is strongly bound to the actual configuration content, eliminating the risk of "fake updates" where only the version number is updated without changing the parameters. This hash generation process is completed in the meter's secure execution environment. The input data undergoes memory erasure and zero-copy processing to avoid leaving sensitive parameters. Before being encapsulated into the notification frame, the hash result is securely signed and encapsulated into the notification frame payload to ensure that the version identifier cannot be tampered with or replaced during transmission. For example, after the meter completes the distribution and verification of all 12 parameter configuration frames, the secure execution environment will sequentially extract the payload of each frame (384 bytes in total), perform zero-copy concatenation and memory erasure processing, call the hardware acceleration engine to calculate the SHA-256 hash value, take the first 8 bytes (0x7A2F…E1C8) as the compact configuration version identifier for this configuration, encapsulate it into the notification frame payload, and send it after signing with the ECDSA-P256 key pair. The configuration version identifier is reproduced and compared on the communication module side using the same hash logic. If they match, the incremental parameter loading process is triggered; if they do not match, the difference analysis mechanism is started, and only the frame with changed parameters is retransmitted, which significantly reduces bandwidth usage and power consumption.

[0101] It should be noted that the meter and communication module enter "adaptive mode" by default after power-on. In this mode, after the meter and communication module complete security context initialization, key negotiation, and security context establishment, the configuration version synchronization process is automatically initiated. That is, it proceeds to step S1 or S6. If a valid MMEI frame start character 0x6D, the correct length, and CRC16 are detected, it enters command mode parsing; otherwise, it maintains data pass-through. This method allows the same serial port to support both the old pure pass-through service and the new configuration management interaction, achieving smooth upgrades without modifying existing hardware interfaces or communication protocol stacks. Deployment can be completed solely through firmware upgrades, significantly reducing the system upgrade threshold and maintenance costs.

[0102] In summary, this application discloses a configuration interaction method between an electricity meter and a communication module. When applied to a communication module, the method includes the following steps: sending a management interaction frame to the electricity meter. The management interaction frame includes control field bytes, which include a transmission direction bit, a confirmation request bit, and an encryption protection bit. The management interaction frame is used to instruct the electricity meter to send a parameter configuration frame. The transmission direction bit is used to indicate the transmission direction of the management interaction frame. The confirmation request bit is used to indicate whether an interaction confirmation frame for the management interaction frame needs to be returned. The encryption protection bit is used to indicate whether the electricity meter needs to encrypt the configuration parameters. If an interaction confirmation frame for the management interaction frame is received from the electricity meter, the receiving electricity meter then sequentially... The system sends out parameter configuration frames, each carrying corresponding encrypted configuration parameters. Upon receiving a parameter configuration frame, it returns a configuration response frame to the meter. It also receives a configuration completion notification frame from the meter in response to the last configuration response frame. This notification frame carries a configuration version identifier, which is compared with a locally stored version identifier to obtain the identification comparison result. If the identifier comparison result shows a version identifier mismatch, the system obtains the meter's configuration change type and determines the parameter activation policy for the changed configuration parameters based on the configuration change type. Finally, it executes the parameter activation policy to apply the changed configuration parameters. When applied to an electricity meter, the steps include: receiving a management interaction frame from a communication module, the management interaction frame including control field bytes, the control field bytes including transmission direction bits, acknowledgment request bits, and encryption protection bits; the management interaction frame is used to instruct the electricity meter to send a parameter configuration frame, the transmission direction bits are used to indicate the transmission direction of the management interaction frame, the acknowledgment request bits are used to indicate whether an interaction acknowledgment frame needs to be returned for the management interaction frame, and the encryption protection bits are used to indicate whether the electricity meter needs to encrypt the configuration parameters; sending an interaction acknowledgment frame for the management interaction frame to the communication module; and sending a parameter configuration frame to the communication module, the parameter configuration frame carrying the corresponding encrypted configuration. If a configuration response frame is received for a parameter configuration frame, the next parameter configuration frame is sent to the communication module, until multiple parameter configuration frames are sequentially sent to the communication module. In response to the last configuration response frame, a configuration completion notification frame is sent to the communication module. The configuration completion notification frame carries a configuration version identifier. The configuration version identifier is used by the communication module to obtain the configuration change type of the meter when it is inconsistent with the local version identifier stored in the communication module. Based on the configuration change type, the module determines the parameter activation strategy for the changed configuration parameters and executes the parameter activation strategy to apply the changed configuration parameters. This method significantly improves the reliability, security, and traceability of the configuration process through a refined frame interaction mechanism and version comparison logic, effectively avoiding communication interruptions and metering anomalies caused by version mismatch or parameter loss.

[0103] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0104] In one embodiment, a configuration interaction device for an electricity meter and a communication module is provided, applicable to the communication module. This configuration interaction device corresponds one-to-one with the configuration interaction method applicable to the communication module described in the above embodiments. Figure 8 As shown, the configuration interaction device between the electricity meter and the communication module includes an interaction initiation module 101, a configuration receiving module 102, an identifier comparison module 103, a policy determination module 104, and a policy execution module 105. Detailed descriptions of each functional module are as follows: The interactive initiation module 101 is used to send a management interactive frame to the electricity meter. The management interactive frame includes a control field byte, which includes a transmission direction bit, a confirmation request bit, and an encryption protection bit. The management interactive frame is used to instruct the electricity meter to send a parameter configuration frame. The transmission direction bit is used to indicate the transmission direction of the management interactive frame. The confirmation request bit is used to indicate whether an interactive confirmation frame for the management interactive frame needs to be returned. The encryption protection bit is used to indicate whether the electricity meter needs to encrypt the configuration parameters.

[0105] The configuration receiving module 102 is configured to receive parameter configuration frames sequentially sent by the meter if it receives an interaction confirmation frame for the management interaction frame returned by the meter. The parameter configuration frame carries corresponding encrypted configuration parameters, and returns a configuration response frame for the parameter configuration frame to the meter each time a parameter configuration frame is received.

[0106] The identifier comparison module 103 is used to receive the configuration completion notification frame sent by the meter in response to the last configuration response frame. The configuration completion notification frame carries a configuration version identifier. The configuration version identifier is compared with the local version identifier stored locally to obtain the identifier comparison result.

[0107] The strategy determination module 104 is used to obtain the configuration change type of the meter when the identification comparison result is inconsistent with the version identification, and determine the parameter activation strategy of the changed configuration parameters according to the configuration change type.

[0108] The strategy execution module 105 is used to execute the parameter activation strategy to apply the changed configuration parameters.

[0109] In another embodiment, a configuration interaction device for an electricity meter and a communication module is provided, applicable to electricity meters. This configuration interaction device corresponds one-to-one with the configuration interaction method applicable to electricity meters in the above embodiments. For example... Figure 9As shown, the configuration interaction device between the electricity meter and the communication module includes an interaction receiving module 106, an interaction confirmation module 107, a configuration sending module 108, and an identification sending module 109. Detailed descriptions of each functional module are as follows: The interactive receiving module 106 is used to receive management interactive frames from the communication module. The management interactive frame includes control field bytes, which include transmission direction bits, confirmation request bits, and encryption protection bits. The management interactive frame is used to instruct the meter to send parameter configuration frames. The transmission direction bits are used to indicate the transmission direction of the management interactive frame. The confirmation request bits are used to indicate whether an interactive confirmation frame for the management interactive frame needs to be returned. The encryption protection bits are used to indicate whether the meter needs to encrypt the configuration parameters.

[0110] The interaction confirmation module 107 is used to send an interaction confirmation frame for the management interaction frame to the communication module.

[0111] The configuration distribution module 108 is used to distribute parameter configuration frames to the communication module. The parameter configuration frame carries corresponding encrypted configuration parameters. If a configuration response frame for the parameter configuration frame is received, the next parameter configuration frame will continue to be sent to the communication module until multiple parameter configuration frames are distributed to the communication module in sequence.

[0112] The identifier sending module 109 is used to send a configuration completion notification frame to the communication module in response to the last configuration response frame. The configuration completion notification frame carries a configuration version identifier. The configuration version identifier is used by the communication module to obtain the configuration change type of the meter when the configuration version identifier is inconsistent with the local version identifier stored in the communication module. Based on the configuration change type, the module determines the parameter activation policy of the changed configuration parameters and executes the parameter activation policy to apply the changed configuration parameters.

[0113] Specific limitations regarding the configuration and interaction device between the electricity meter and the communication module can be found in the limitations on the configuration and interaction method described above, and will not be repeated here. Each module in the aforementioned configuration and interaction device between the electricity meter and the communication module can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independently of the processor in the computer device, or stored in software in the memory of the computer device, so that the processor can call and execute the operations corresponding to each module.

[0114] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 10As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a configuration interaction method between an electricity meter and a communication module.

[0115] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer device is configured as a communication module, the processor executes the computer program to implement the configuration interaction method applicable to the communication module described in the above embodiments, for example... Figure 2 S1-S5, as shown, will not be repeated here to avoid repetition. Alternatively, when the processor executes the computer program, it implements the functions of each module / unit in this embodiment of the configuration interaction device suitable for the communication module, for example... Figure 8 The functions of the interactive startup module 101, configuration receiving module 102, identifier comparison module 103, policy determination module 104, and policy execution module 105 shown are not described again here to avoid repetition.

[0116] In another embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer device is configured as an electricity meter, the processor executes the computer program to implement the configuration interaction method applicable to electricity meters described in the above embodiments, for example... Figure 5 S6-S9, as shown, will not be repeated here to avoid repetition. Alternatively, when the processor executes the computer program, it implements the functions of each module / unit in this embodiment of the configuration interaction device suitable for the electricity meter, for example... Figure 9 The functions of the interactive receiving module 106, interactive confirmation module 107, configuration sending module 108, and identifier sending module 109 shown are not described again here to avoid repetition.

[0117] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When executed by a processor, the computer program implements the configuration and interaction method between the electricity meter and the communication module described in the above embodiment, for example... Figure 2 As shown in S1-S5, or Figure 5 S6-S9, as shown, will not be repeated here to avoid repetition. Alternatively, when the computer program is executed by the processor, it implements the functions of each module / unit in this embodiment of the configuration and interaction device between the electricity meter and the communication module, for example... Figure 8 The functions of the interactive initiation module 101, configuration receiving module 102, identifier comparison module 103, policy determination module 104, and policy execution module 105 shown are as follows: Figure 9 The functions of the interactive receiving module 106, interactive confirmation module 107, configuration sending module 108, and identifier sending module 109 shown are not described again here to avoid repetition. The computer-readable storage medium can be non-volatile or volatile.

[0118] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0119] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0120] It should be noted that any AI models, software tools, or components not belonging to this company appearing in the embodiments of this application are merely illustrative examples and do not represent actual use. All user personal information involved in the embodiments of this application has been authorized (with the knowledge and consent) by the relevant parties or has been fully authorized by all parties, and the executing entity may obtain it through various legal and compliant means. The collection, storage, use, processing, transmission, provision, and disclosure of the information, data, and signals involved all comply with relevant laws and regulations and do not violate public order and good morals.

[0121] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A method for configuration interaction of a meter and a communication module, suitable for the communication module, characterized in that, Including the following steps: A management interaction frame is sent to the electricity meter. The management interaction frame includes a control field byte, which includes a transmission direction bit, a confirmation request bit, and an encryption protection bit. The management interaction frame is used to instruct the electricity meter to send a parameter configuration frame. The transmission direction bit is used to indicate the transmission direction of the management interaction frame. The confirmation request bit is used to indicate whether an interaction confirmation frame needs to be returned for the management interaction frame. The encryption protection bit is used to indicate whether the electricity meter needs to encrypt the configuration parameters. If an interaction confirmation frame for the management interaction frame is received from the meter, then the parameter configuration frames sent by the meter in sequence are received. The parameter configuration frames carry corresponding encrypted configuration parameters. Each time the parameter configuration frame is received, a configuration response frame for the parameter configuration frame is returned to the meter. The configuration completion notification frame sent by the meter in response to the last configuration response frame is received. The configuration completion notification frame carries a configuration version identifier. The configuration version identifier is compared with the local version identifier stored locally to obtain the identifier comparison result. When the identification comparison result shows that the version identification is inconsistent, the configuration change type of the meter is obtained, and the parameter activation strategy of the changed configuration parameters is determined according to the configuration change type. Execute the parameter activation policy to apply the changed configuration parameters; The configuration change types include critical parameter changes and non-critical parameter changes, and the parameter activation strategies include reset and reconnection strategies and hot-load strategies. The process of obtaining the configuration change type of the meter and determining the parameter activation strategy for the changed configuration parameters based on the configuration change type includes: When the configuration change type is a critical parameter change, the parameter activation strategy is determined to be a reset and reconnection strategy; When the configuration change type is a non-critical parameter change, the parameter activation strategy is determined to be a hot-load strategy.

2. The configuration interaction method of claim 1, wherein, The step of returning a configuration response frame corresponding to the received parameter configuration frame to the meter each time the parameter configuration frame is received includes: Extract the frame sequence number of the received parameter configuration frame; Generate the configuration response frame carrying the frame sequence number, and return the configuration response frame to the electricity meter.

3. The configuration interaction method of claim 1, wherein, The method further includes: Send a meter number read frame to the meter, the meter number read frame being used to request the meter to return a meter number response frame; If a meter number response frame corresponding to the meter number reading frame is received from the meter within a first preset time, the meter number response frame is parsed to obtain the meter number.

4. The configuration interaction method of claim 3, wherein, The method further includes: If no meter number response frame corresponding to the meter number reading frame is received from the meter within the first preset time, a connection establishment request frame is sent to the meter. The connection establishment request frame is used to request the meter to establish a communication connection and to receive the connection establishment response frame returned by the meter. After receiving the connection establishment response frame, a logical device name read frame is sent to the meter, which is used to request the meter to return a logical device name response frame. If a logical device name response frame corresponding to the logical device name read frame is received from the meter within a second preset time, the logical device name response frame is parsed to obtain the meter number.

5. The configuration interaction method of claim 4, wherein, The method further includes: If the connection establishment response frame is not received within the second preset time, the serial communication parameters are switched and a read address command frame is sent to the meter. The read address command frame is used to request the meter to return a read address response frame. If the meter reading address response frame is received within the third preset time period, the meter reading address response frame is parsed to obtain the meter number.

6. A configuration and interaction method between an electricity meter and a communication module, applicable to electricity meters, characterized in that, Including the following steps: The system receives a management interaction frame from the communication module. The management interaction frame includes a control field byte, which includes a transmission direction bit, a confirmation request bit, and an encryption protection bit. The management interaction frame is used to instruct the meter to send a parameter configuration frame. The transmission direction bit is used to indicate the transmission direction of the management interaction frame. The confirmation request bit is used to indicate whether an interaction confirmation frame needs to be returned for the management interaction frame. The encryption protection bit is used to indicate whether the meter needs to encrypt the configuration parameters. Send an interaction confirmation frame to the communication module in response to the management interaction frame; A parameter configuration frame is sent to the communication module. The parameter configuration frame carries corresponding encrypted configuration parameters. If a configuration response frame for the parameter configuration frame is received, the next parameter configuration frame is sent to the communication module until multiple parameter configuration frames are sent to the communication module in sequence. In response to the last configuration response frame, a configuration completion notification frame is sent to the communication module. The configuration completion notification frame carries a configuration version identifier. The configuration version identifier is used by the communication module to obtain the configuration change type of the meter when the configuration version identifier is inconsistent with the local version identifier stored in the communication module. The communication module then determines the parameter activation strategy of the changed configuration parameters based on the configuration change type and executes the parameter activation strategy to apply the changed configuration parameters. The configuration change types include critical parameter changes and non-critical parameter changes, and the parameter activation strategies include reset and reconnection strategies and hot-load strategies. The process of obtaining the configuration change type of the meter and determining the parameter activation strategy for the changed configuration parameters based on the configuration change type includes: When the configuration change type is a critical parameter change, the parameter activation strategy is determined to be a reset and reconnection strategy; When the configuration change type is a non-critical parameter change, the parameter activation strategy is determined to be a hot-load strategy.

7. The configuration interaction method according to claim 6, characterized in that, Sending the parameter configuration frame to the communication module includes: Obtain the unique identifier of the electricity meter and generate an encryption vector based on the unique identifier of the electricity meter; The configuration parameters are encrypted according to the encryption vector to obtain the encrypted configuration parameters. The encrypted configuration parameters are encapsulated into a parameter configuration frame, and the parameter configuration frame is sent to the communication module.

8. The configuration interaction method according to claim 6, characterized in that, The method further includes: Detect whether a management interaction frame has been received from the communication module; If the management interaction frame is not received within the preset time window, the communication module is reset.

9. The configuration interaction method according to claim 6, characterized in that, The method further includes: The configuration parameters corresponding to each of the parameter configuration frames are concatenated to calculate the configuration version identifier.

10. A configuration and interaction device for an electricity meter and a communication module, applicable to a communication module, characterized in that, include: An interactive initiation module is used to send a management interactive frame to the electricity meter. The management interactive frame includes a control field byte, which includes a transmission direction bit, a confirmation request bit, and an encryption protection bit. The management interactive frame is used to instruct the electricity meter to send a parameter configuration frame. The transmission direction bit is used to indicate the transmission direction of the management interactive frame. The confirmation request bit is used to indicate whether an interactive confirmation frame needs to be returned for the management interactive frame. The encryption protection bit is used to indicate whether the electricity meter needs to encrypt the configuration parameters. The configuration receiving module is configured to receive parameter configuration frames sequentially sent by the electricity meter if it receives an interaction confirmation frame for the management interaction frame returned by the electricity meter. The parameter configuration frame carries corresponding encrypted configuration parameters, and the module returns a configuration response frame for the parameter configuration frame to the electricity meter each time it receives the parameter configuration frame. The identifier comparison module is used to receive the configuration completion notification frame sent by the meter in response to the last configuration response frame. The configuration completion notification frame carries a configuration version identifier. The module compares the configuration version identifier with the local version identifier stored locally to obtain the identifier comparison result. The strategy determination module is used to obtain the configuration change type of the electricity meter when the identification comparison result is that the version identification is inconsistent, and determine the parameter activation strategy of the changed configuration parameters according to the configuration change type. The strategy execution module is used to execute the parameter activation strategy to apply the changed configuration parameters; The configuration change types include critical parameter changes and non-critical parameter changes, and the parameter activation strategies include reset and reconnection strategies and hot-load strategies. The process of obtaining the configuration change type of the meter and determining the parameter activation strategy for the changed configuration parameters based on the configuration change type includes: When the configuration change type is a critical parameter change, the parameter activation strategy is determined to be a reset and reconnection strategy; When the configuration change type is a non-critical parameter change, the parameter activation strategy is determined to be a hot-load strategy.

11. A configuration and interaction device for an electricity meter and a communication module, applicable to electricity meters, characterized in that, include: An interactive receiving module is used to receive management interactive frames from a communication module. The management interactive frame includes control field bytes, which include a transmission direction bit, a confirmation request bit, and an encryption protection bit. The management interactive frame is used to instruct the meter to send a parameter configuration frame. The transmission direction bit is used to indicate the transmission direction of the management interactive frame. The confirmation request bit is used to indicate whether an interactive confirmation frame needs to be returned for the management interactive frame. The encryption protection bit is used to indicate whether the meter needs to encrypt the configuration parameters. An interaction confirmation module is used to send an interaction confirmation frame to the communication module in response to the management interaction frame. The configuration distribution module is used to distribute parameter configuration frames to the communication module. The parameter configuration frame carries corresponding encrypted configuration parameters. If a configuration response frame is received for the parameter configuration frame, the next parameter configuration frame is sent to the communication module until multiple parameter configuration frames are distributed to the communication module in sequence. The identifier sending module is used to send a configuration completion notification frame to the communication module in response to the last configuration response frame. The configuration completion notification frame carries a configuration version identifier. The configuration version identifier is used by the communication module to obtain the configuration change type of the meter when the configuration version identifier is inconsistent with the local version identifier stored in the communication module. The module then determines the parameter activation strategy of the changed configuration parameters based on the configuration change type and executes the parameter activation strategy to apply the changed configuration parameters. The configuration change types include critical parameter changes and non-critical parameter changes, and the parameter activation strategies include reset and reconnection strategies and hot-load strategies. The process of obtaining the configuration change type of the meter and determining the parameter activation strategy for the changed configuration parameters based on the configuration change type includes: When the configuration change type is a critical parameter change, the parameter activation strategy is determined to be a reset and reconnection strategy; When the configuration change type is a non-critical parameter change, the parameter activation strategy is determined to be a hot-load strategy.

12. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the computer device is configured as a communication module, the processor executes a computer program to implement the configuration interaction method as described in any one of claims 1 to 5; or, when the computer device is configured as an electricity meter, the processor executes a computer program to implement the configuration interaction method as described in any one of claims 6 to 9.

13. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the configuration interaction method as described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Meter management method integrating remote parameter configuration and local response control

    CN121037214A

  • Techniques for partial configuration of autonomously smart relay devices

    US20220321199A1