Multi-meter address dynamic switching method and system thereof
By using a dynamic switching method for multiple electricity meter addresses and employing technologies such as admission judgment primitives and offline flag files, the data consistency and network recovery issues in the concentrator system during the switching of electricity meter registration address types were resolved. This achieved seamless switching and business continuity, improving the system's reliability and compatibility.
Patent Information
- Application Number
- CN202611457171.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-18
- Publication Date
- 2026-11-24
AI Technical Summary
Existing concentrator systems suffer from several issues when switching meter registration address types, including insufficient data consistency guarantees, lack of operational mode linkage constraints, poor compatibility in downlink network recovery, and inadequate online status management of equipment. These issues affect the system's compatibility, reliability, and ease of operation and maintenance.
A multi-meter address dynamic switching method is adopted. A bidirectional address switching protection mechanism is executed through preset access judgment primitives. The data is synchronously written to all storage layers, an offline flag file is created, and all data is initialized to ensure state consistency and data cleanliness. It also enables automatic re-entry into the downlink network without reassembly.
It ensures state consistency and data cleanliness during the meter address switching process, eliminates the need for downlink network reorganization, and enables automatic and seamless re-entry into the network, thereby improving the system's reliability, security, and business continuity, and ensuring incremental meter reading compatibility.
Smart Images

Figure CN123164094A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of smart meter management technology for power line systems, and in particular to a method and system for dynamic switching of multiple meter addresses. Background Technology
[0002] In low-voltage power user electricity consumption information collection systems, the concentrator, as the core data aggregation node within a distribution area, undertakes the crucial functions of data collection, event monitoring, and record management of its subordinate electricity meters. The core basis for the concentrator to identify and register meters within its jurisdiction is the meter registration address. Currently, the main types of mainstream meter registration addresses include the following two: (1) Device serial number / meter number. This address is in BCD format and is 6 bytes long. In the human-machine interface, it is usually presented as a 12-bit pure numeric ASCII string. This address is generated based on the globally unique hardware serial number burned into the meter at the factory and is uniformly managed by the head-end system (HES).
[0003] (2) Logical Device Name (LDN). This address conforms to the IEC 62056 series of international standards, is 16 bytes long, and is represented as a 16-bit ASCII string. Its structure usually includes a combination of vendor-specific code and numeric address, and is also maintained and managed by the master station system. It is mainly used to support object-oriented protocol standards.
[0004] With the diversification of electricity information collection needs, the same distribution area may face the practical scenario of switching between different address types due to access to different standard systems (such as State Grid standards, China Southern Power Grid standards, or international standards) or different manufacturers' meter equipment, or due to the need for system upgrades or maintenance changes. However, existing concentrator software systems generally have the following technical limitations when handling the switching of meter registration address types: (i) There is a lack of systematic data consistency guarantee mechanism for address type switching.
[0005] When switching meter registration address types, existing concentrator software typically simplifies the operation by modifying only a single state variable in memory. This approach neglects the requirement for data consistency between modules within the system and fails to synchronously perform multi-level consistency updates to persistent storage, caching systems, and operational status. After the switch, residual data such as online device status, meter online information and status records, and event caches from the old address format coexist with data from the new address format, causing device registration anomalies and event information corruption. Furthermore, existing solutions lack audit logs and traceability capabilities for the switch operation, failing to meet the auditability requirements for critical operational activities.
[0006] (ii) There is a lack of linkage constraints between address type and system operation mode.
[0007] The effective operation of different meter registration address types often depends on the specific system operating mode and downlink communication network mode of the concentrator (such as power line carrier PLC, RS-485, or low-power wireless RF) as prerequisites. In other words, the availability of a specific meter registration address type is not unconditional; it is strongly coupled with the overall operating state of the concentrator. However, existing solutions do not address this interdependent constraint. The switched meter registration address type may be compromised by subsequent user errors (such as changing the operating mode or switching the downlink network mode), causing the system to enter an illegal state combination without timely error reporting, thus creating hidden protocol compatibility vulnerabilities.
[0008] (iii) There is a compatibility defect between the downlink network recovery after the switch and the incremental copying mechanism of the main station system.
[0009] When the meter registration address type changes, existing solutions typically require the concentrator to dismantle the current downstream meter network and re-establish the entire network. This process is time-consuming and severely impacts the continuity of data collection. More critically, the master station system generally uses a timestamp-based incremental meter reading mechanism to optimize communication load. After the meter registration address type changes, if the concentrator does not update the meter's network entry timestamp, the master station system will be unable to detect the change in meter address type and will continue to use the old network entry time reference to initiate incremental data reading requests. This results in the master station being unable to correctly identify and collect meter data under the new address format, creating a long-term data collection blind spot and directly affecting the success rate and completeness of electricity consumption information collection.
[0010] (iv) There are deficiencies in the online status management of equipment during the switching process.
[0011] After the meter registration address type was switched, the system failed to effectively clean up the dynamic online status information built based on the old address format. This information included, but was not limited to, the list of currently online devices, the list of data actively pushed by the meters, and the list of device status changes. Simultaneously, the system did not automatically trigger a complete and accurate online status reconstruction process for the new address format. This lack of management resulted in a significant deviation between the device status view maintained by the concentrator after the switch and the actual physical status on site. Specifically, meters with new addresses that were actually online were misjudged as offline, or meters with old addresses that had been removed were still displayed as online by the system, severely impacting the accuracy of subsequent data collection strategy formulation and fault diagnosis.
[0012] In summary, existing concentrator systems exhibit significant shortcomings in multiple dimensions, including multi-level data consistency assurance, operational mode linkage constraints, business process continuity, and equipment status management, when handling changes in meter registration address types. To overcome these deficiencies, there is an urgent need for a technical solution that can ensure safe, efficient, and smooth switching between any two meter registration address types, thereby improving system compatibility, reliability, and ease of operation and maintenance. Summary of the Invention
[0013] The technical problem to be solved by the present invention is to provide a method and system for dynamic switching of multiple electricity meter addresses, which can ensure the consistency of state and the cleanliness of data during the electricity meter address switching process, and enable automatic and seamless re-entry into the downlink network without reassembly after switching.
[0014] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: Methods for dynamically switching the addresses of multiple electricity meters include: Pre-define the access control primitives corresponding to each electricity meter's registration address type; After receiving the switching instruction for the corresponding new electricity meter registration address type issued by the HES system, the concentrator calls the access determination primitive corresponding to the new electricity meter registration address type to execute the bidirectional address switching protection mechanism. After passing the positive access check in the bidirectional address switching protection mechanism, the new meter registration address type is synchronously written to all storage layers. Create a decommissioning flag file to identify the decommissioning of old electricity meter registration address types; Initialize the concentrator's local records of all data regarding the old meter registration address type.
[0015] Optionally, the complete data on the registration address type of the old electricity meter locally recorded by the initialization concentrator specifically includes: Delete the online meter information record files and status record database files in the main database and backup database; Clear the temporary data area and parameter storage area; Reset the communication status of all meters in the downstream network.
[0016] Optionally, the initialization concentrator locally records all data regarding the old meter registration address type, and then further includes: After the concentrator's downlink communication module restarts based on the initialization, if it reads the offline flag file, it determines that a change in the meter registration address type occurred in the previous operating cycle and performs a full-device offline reporting operation; wherein, the full-device offline reporting operation includes: the concentrator reporting to the HES system that the communication status of all meters in its downlink network is offline, and deleting the offline flag file after the reporting is completed; The concentrator rereads the registration address of each meter according to the format of the new meter registration address type, and updates the network access time of each meter at the same time.
[0017] Optionally, the concentrator rereads the registration address of each meter according to the format of the new meter registration address type, and updates the network access time of each meter. Afterwards, it further includes: The concentrator reports online events to the HES system using the new meter registration address type. The online events carry the registration address read by each meter according to the format of the new meter registration address type, and its updated network access time. The HES system updates the reading address association of each meter based on the received online events of the meters.
[0018] Optionally, the access determination primitive includes: a forward access check before handover, a first reverse locking condition protection after handover, and a second reverse locking condition protection after handover; The implementation of the bidirectional address switching protection mechanism specifically includes: Perform a forward access check before switching: determine whether the current operating state meets all access constraints corresponding to the new meter registration address type; if any access constraint is not met, the forward access check is deemed to have failed and the switching instruction is refused; if all access constraints are met, switching to the new meter registration address type is allowed, and the first reverse locking condition protection and the second reverse locking condition protection after switching are continued to be executed. The first reverse locking condition protection after the switch is executed: when a modification instruction corresponding to the current operating state is received from the HES system, it is determined whether the current operating state belongs to the first operating dependency constraint condition corresponding to the new meter registration address type; if so, the modification operation is refused. The second reverse locking condition protection after the switch is executed: when a shutdown command corresponding to a configuration is received from the HES system, it is determined whether the configuration belongs to the second runtime dependency constraint corresponding to the new meter registration address type; if so, the shutdown operation is refused.
[0019] Optionally, before initializing the concentrator's locally recorded full data on the old meter registration address type, it also includes: Record the meter registration address type before the switch and the new meter registration address type after the switch.
[0020] Optionally, the offline flag file is created in a specified path; the specified path is a persistent storage path that is not affected by memory cleanup operations.
[0021] Optionally, it also includes: A pre-defined mapping table between the registered address type and address length of the electricity meter; In the mapping table, add a new record regarding the new electricity meter's registration address type and address length; Configure the access determination primitives corresponding to the newly added new electricity meter registration address type.
[0022] Optionally, all storage layers include a memory structure storage layer, a static configuration storage layer, a shared cache layer, and a disk configuration file layer; The disk configuration file layer stores the new electricity meter registration address type in key-value pair format.
[0023] Another technical solution provided by this invention is: The multi-meter address dynamic switching system includes a sequentially connected HES system, a concentrator, and each meter. The HES system is configured to perform the steps executed by the HES system in the above-mentioned dynamic switching method for multiple electricity meter addresses. The concentrator is configured to perform the steps in the above-described method for dynamic switching of multi-meter addresses executed by the concentrator.
[0024] The beneficial effects of this invention are as follows: This invention performs multi-level pre-access judgment through preset access judgment primitives, effectively avoiding illegal address switching and improving system reliability and security; by synchronously writing the new meter registration address type into all storage layers, and combining the creation of offline flag files and full data initialization processing, it ensures consistency of status data and complete synchronization of storage layers during the switching process, eliminating interference from old data; after switching, the concentrator's downlink network does not need to be dismantled and reassembled, automatically triggering offline reporting for all devices, and can directly reuse existing communication links to reread the new format registration address and report it. The HES system updates the online status and network access time accordingly, achieving automatic seamless re-entry without reassembly, significantly improving service continuity; and ensuring that the incremental meter reading mechanism of the HES system can correctly perceive the meter after the address type change, effectively guaranteeing incremental meter reading compatibility. Attached Figure Description
[0025] Figure 1 This is a flowchart illustrating a method for dynamically switching the addresses of multiple electricity meters according to an embodiment of the present invention. Figure 2 A complete flowchart of the meter registration address type switching provided for a specific embodiment of the present invention; Figure 3 A flowchart of multi-layer synchronous write fault tolerance recovery provided for a specific embodiment of the present invention; Figure 4 The flowchart illustrates the post-switching data cleanup, downlink network reorganization-free process, and network access time update for specific embodiments of the present invention. Detailed Implementation
[0026] To explain in detail the technical principles, specific implementable solutions, possible application scenarios, and achievable objectives and effects of the present invention, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. It is understood that the embodiments described herein and the embodiments shown in the accompanying drawings are only used to more clearly illustrate the technical solutions of the present invention, and are therefore only examples intended to explain the present invention, and should not be construed as limiting the present invention. It should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein.
[0027] Please see Figures 1 to 4 The present invention provides a method for dynamic switching of multiple meter addresses.
[0028] The present invention provides a method for dynamic switching of multiple electricity meter addresses, the basic process of which is as follows: Figure 1 As shown. Please also refer to... Figure 1 and Figure 2 To understand this, the method for dynamically switching the addresses of multiple meters specifically includes: Step S1: Preset the access determination primitives corresponding to the registration address types of each electricity meter.
[0029] To address the problem in existing technologies where different meter registration address types depend on varying combinations of system operating states during runtime, making the switching operation susceptible to system state fluctuations and subsequent erroneous operations, this embodiment provides a bidirectional address switching protection mechanism based on atomic access control primitives.
[0030] Specifically, this embodiment abstracts and models all the necessary operating conditions for each type of electricity meter registration address into a corresponding atomic access determination primitive. This primitive is logically indivisible and simultaneously performs the dual functions of forward access check before switching and reverse locking condition protection after switching. This constructs a complete closed-loop protection mechanism from "forward access permission" to "reverse state locking," effectively preventing confusion in the electricity meter management mechanism under mixed multi-parameter conditions, ensuring that the legitimate results of the switching operation are not corrupted in subsequent operations, and effectively isolating the interference and impact of erroneous operations on the state of the switched address.
[0031] In some specific implementations, the admission determination primitive includes at least the following three rules: (1) Positive access check before switching: The current operating status must meet all access constraints of the new meter registration address type.
[0032] (2) First reverse locking condition protection after switching; when the current operating state belongs to the first operating dependency constraint of the new meter registration address type, the current operating state is not modified.
[0033] (3) Second reverse locking condition protection after switching; when the configuration corresponding to the current shutdown command belongs to the second running dependency constraint of the new meter registration address type, the shutdown operation is rejected.
[0034] Among them, rules (2) and (3) together constitute the core of the reverse state lockout protection mechanism. The function of this mechanism is to prevent users from changing the operating mode and destroying the preconditions on which the current address type depends for normal operation after the concentrator system switches to the new meter registration address type. Unlike the existing technology, which only provides one-way protection against "illegal entry", this invention constructs a two-way closed-loop protection mechanism covering "entry control + maintenance protection". That is, for any meter registration address type, before and after the system switch, its corresponding operating preconditions are continuously protected throughout the entire operation period, thereby ensuring both the legality of the meter registration address type before the switch and the stability and controllability of the execution environment after the switch.
[0035] For example, the three rules in the admission determination primitive are described in Table 1 below: Table 1 Step S2: After receiving the switching instruction for the corresponding new meter registration address type issued by the HES system, the concentrator calls the access determination primitive corresponding to the new meter registration address type to execute the bidirectional address switching protection mechanism.
[0036] In some specific embodiments, the bidirectional address switching protection mechanism specifically includes the following steps: (1) Perform a positive admission check before the handover: Determine whether the current operating status of the concentrator meets all the access constraints set for the corresponding new electricity meter registration address type; If any admission constraint is not met, the positive admission check is deemed to have failed, and the switching instruction is refused to be executed. If all access constraints are met, the switch to the new meter registration address type is allowed, step S3 is executed, and the first reverse locking condition protection and the second reverse locking condition protection after the switch are continued.
[0037] (2) Execute the first reverse locking condition protection after the switch: When a modification instruction to modify the current operating status of the concentrator is received from the HES system, it is determined whether the current operating status belongs to the first operating dependency constraint condition corresponding to the new meter registration address type; If yes, then the modification operation is rejected; otherwise, the modification operation is allowed.
[0038] (3) Execute the second reverse locking condition protection after the switch: When a shutdown command is received from the HES system to shut down a configuration in the concentrator, it is determined whether the configuration belongs to the second operational dependency constraint corresponding to the new meter registration address type; If yes, then the shutdown operation is refused; otherwise, the shutdown operation is allowed.
[0039] It is understandable that steps (2) and (3) above are in real-time detection state after step (1) is passed.
[0040] In some specific implementations, the access determination primitive is pre-set with a set of constraints corresponding to steps (1)-(3) above. Specifically, the set of access constraints corresponding to the forward access check, the set of first operational dependency constraints corresponding to the first reverse locking condition protection, and the set of second operational dependency constraints corresponding to the second reverse locking condition protection. Among them, the set of access constraints for switching between any meter registration address types is determined by the inherent attributes of the new meter registration address type, and different meter registration address types may correspond to different combinations of access constraints.
[0041] For example, consider the switch from the first meter registration address type to the second meter registration address type. Assume that normal operation of the second meter registration address type requires both "gateway operating mode" and "mixed mode" as prerequisites. Then, the access determination primitives corresponding to this switch integrate the following three constraints: Access determination primitive = (Current registered address type has been set to the second electricity meter registered address type) AND (Gateway mode) AND (Mixed mode); All three constraints are indispensable. If any constraint is not met, the admission decision primitive returns "false".
[0042] Preferably, the admission determination primitive is implemented using atomic determination logic and is configured to be callable by more than ten modules in the entire system, replacing the original repetitive conditional expressions scattered in various places.
[0043] Step S3: After passing the positive access check in the bidirectional address switching protection mechanism, the new meter registration address type is synchronously written to all storage layers.
[0044] Specifically, all storage layers include: a memory structure storage layer, a static configuration storage layer, a shared cache layer, and a disk configuration file layer.
[0045] In some specific implementations, a four-layer synchronous write strategy is adopted to synchronously write the new meter registration address type to all storage layers. The four-layer synchronous write strategy is as follows: the write operation of the new meter registration address type is executed sequentially in a strict order, namely: memory structure field, static configuration file, Redis database, and disk configuration file. Simultaneously, each layer of write has an independent error checking mechanism and rollback processing logic to ensure that if any layer fails, the operation of that layer automatically rolls back to the state before the write, and the data in the remaining layers remains consistent and unaffected, thereby ensuring data consistency and system reliability across multiple storage layers.
[0046] Preferably, the new meter registration address type is stored in a key-value pair format in the disk configuration file layer. Under this format, new and old configuration items can coexist. Even if the concentrator software is upgraded and a new meter registration address type option is added, the old configuration file can still be correctly read and parsed, thus achieving backward compatibility.
[0047] For example, the timing of multi-layer synchronous write fault tolerance recovery is as follows: Figure 3 As shown.
[0048] Step S4: Create a decommissioning flag file to identify the decommissioning of the old meter registration address type.
[0049] In this embodiment, the switching of the meter registration address type will trigger a logical reconstruction (i.e., subsequent step S5). After reconstruction, all memory states are lost, and the concentrator's downlink communication module cannot know whether the meter registration address type switching occurred in the previous running cycle, which leads to address resolution errors and repeated execution of instructions. This can result in data collection errors or even paralysis of the entire downlink meter reading network communication.
[0050] To this end, this embodiment specifically sets up an offline flag file mechanism to realize status transmission across address types, so as to ensure that the downlink communication module of the concentrator can know the switch of the meter registration address type as soon as it is rebuilt, avoid repeated switching and address resolution errors, and ensure seamless connection of meter reading tasks.
[0051] In some specific implementations, the offline flag file mechanism is implemented using a "producer-consumer" model, and the specific implementation process is as follows: Producer (Concentrator Main Process): Before step S5, a shutdown flag file is created under a specified path. The specified path is a persistent storage path that is not affected by memory cleanup operations and can be retained even after the main process terminates.
[0052] Consumer (Concentrator Downlink Communication Module Process): After the concentrator is reloaded following the initialization in step S5, its downlink communication module reads the offline flag file upon startup. If the file exists, it is determined that a change in the meter registration address type occurred in the previous operating cycle, and a full-device offline reporting operation is performed to report all subordinate meters to the HES system that they are offline. Subsequently, the offline flag file is deleted. If the file does not exist, the normal process is followed to restore the device online status recorded in the previous operating cycle.
[0053] In this embodiment, the offline flag file mechanism has the following three technical effects: First, it enables cross-service and cross-lifecycle state transfer. This flag file does not rely on memory state and can continuously retain the key information "address type switch has occurred" after service termination and application reload, thus effectively solving the problem of state information loss during the long period of "switch-application reload-re-re-online".
[0054] Second, it achieves clear isolation between the old and new online status formats. Through full-device offline reporting, the HES system ensures that all meter online status records under the old address format are cleared. After the concentrator application is reloaded, the concentrator will reread the meter registration address using the new address format and report it as online. This ensures that all online events received by the HES system are based on the new address format, thus achieving complete isolation between old and new data at the entire link from HES to the concentrator. It should be noted that "full-device offline reporting" here refers to the logical offline notification sent by the concentrator to the HES system; the meter nodes in its downstream physical network are not actually offline.
[0055] Third, it features a self-cleaning design. The concentrator's downlink communication module deletes the flag file immediately after consuming it, preventing accidental triggering of full-device offline operation during normal application overload of the concentrator, and ensuring that this mechanism is executed only once.
[0056] Step S5: Initialize the concentrator's local records of all data regarding the old meter registration address type.
[0057] In some specific embodiments, step S5 specifically includes: 1. Delete the online meter information record file and status record database file in the concentrator master database; 2. Delete the meter online information record files and status record database files in the concentrator backup library; 3. Clear the concentrator's temporary data area and parameter storage area; 4. Reset the communication status (online / offline status) of all meters in the concentrator's downstream network.
[0058] The data in items 1 and 2 above are the meter registration information recorded locally by the concentrator; item 3 is the operating parameters cached locally by the concentrator; and item 4 is the online status table maintained locally by the concentrator.
[0059] Preferably, this step is executed automatically by an independent process and has a retry mechanism.
[0060] Existing technologies typically require manual clearing of old data or reliance on timers to gradually eliminate old data after switching address types. This embodiment, however, automatically clears all data of the old meter registration address type after switching to the new one, achieving "switching and clearing simultaneously." This allows the concentrator system to start operating from scratch with the new address format, fundamentally eliminating the problem of mixed data from the old and new address formats.
[0061] Step S6: After the handover, the downlink network is not reassembled and the network access time is updated.
[0062] This step specifically includes the following sub-steps: Sub-step S61: After the concentrator's downlink communication module is restarted based on the initialization in step S5, if it reads the offline flag file, it determines that a change in the meter registration address type has occurred in the previous operating cycle and performs a full-device offline reporting operation.
[0063] Specifically, the offline reporting operation for all devices includes: the concentrator reporting to the HES system that the communication status of all meters in its downlink network is offline, and deleting the offline flag file after the reporting is completed.
[0064] Sub-step S62: The concentrator rereads the registration addresses of all meters based on the new meter registration address type, and updates the network access time of each meter.
[0065] In some specific implementations, after the concentrator's downlink communication module application restarts, it proactively initiates a registration address reading process to all electricity meters in its downlink network.
[0066] The registration address reading process specifically includes: rereading the registration address of each meter according to the format of the new meter registration address type; and updating the network access timestamp of each meter to the system time when its new format registration address was reread.
[0067] The update of the electricity meter's network access time indicates that although it is physically the same electricity meter and has not actually been re-entered into the network, the system regards it as an electricity meter device that is "registering for the first time under the new address format" because the registration address type has changed.
[0068] Preferably, the concentrator will update its local files according to the newly read registration addresses of each meter in the new registration address format and the updated network access time of each meter, so as to ensure that the local records of the concentrator are consistent with the current address configuration of the downlink network.
[0069] Existing technologies typically require dismantling and reorganizing the entire downstream meter network after address type switching. This involves all meters going offline, being rediscovered, re-registered, and having their communication addresses reassigned. The entire process can take tens of minutes or even hours, during which time data acquisition is completely interrupted.
[0070] This embodiment completely abandons the above approach. Since the data cleanup scope in the preceding step S5 is limited to the local logical data layer of the concentrator, namely the online meter information and status record database, temporary data area, and parameter storage area, and does not involve the concentrator's downlink physical network, the actual physical meter nodes in the downlink meter network remain online before and after the registration address type switch, and the downlink physical communication link remains connected. Therefore, the downlink meters do not perceive the change in the concentrator's address type, and the concentrator's downlink communication module can directly reuse the existing downlink physical communication link to communicate with the downlink meter nodes. The downlink meter nodes are never truly offline, and there is no need to perform a re-entry process. The reorganization-free process and network entry time update can be achieved through the aforementioned step S6.
[0071] In some specific implementations, after step S6, the following steps are also included: Step S7: The concentrator reports online data and status to the HES system using the new meter registration address type.
[0072] This step specifically includes the following sub-steps: Sub-step S71: The concentrator reports online events to the HES system using the new meter registration address type.
[0073] The online event of the meter carries the registration address read by each meter according to the format of the new meter registration address type, and its updated network access time; Sub-step S72: The HES system updates the information of the corresponding electricity meter in the meter reading address association relationship based on the received online meter event.
[0074] The HES system identifies "new device online" based on the online events in the table and re-establishes the copy-read relationship with the new registration address type.
[0075] The core purpose of synchronously updating the network access time of each meter in the HES system is to adapt to the incremental meter reading mechanism of the HES system. The HES system typically performs incremental meter reading based on timestamps, meaning it only reads data generated after the network access time. If the network access time is not synchronously updated, the HES system will perform incremental meter reading based on the old network access time, failing to recognize that the meter has switched to the new address type, thus resulting in the meter data under the new address format not being collected correctly.
[0076] For example, the timing of post-handover data cleanup, downlink network reassembly exemption, and network access time update is as follows: Figure 4 As shown.
[0077] As can be seen from the above, the post-processing scheme for switching the electricity meter registration address type provided in this embodiment (i.e., steps S5-S7) has at least the following technical effects: (1) Zero interruption of physical network. The downstream meter network remains connected before and after the registration address type is switched, and the meter nodes do not need to go offline and re-enter the network, which completely avoids the long-term communication interruption caused by network reorganization in the existing technology.
[0078] (2) Precise cleanup of the logic layer. Data initialization only cleans up the logic records and status data of the concentrator locally, without involving the downlink physical network, thus achieving a precise switching effect of "logic reconstruction, physical continuity".
[0079] (3) Rapid service recovery. Since there is no need to rebuild the network, only address rereading and network access time update operations need to be performed after the switchover is completed, and the data collection service can resume normal operation in a very short time.
[0080] (4) Data collection integrity. Through the network access time update mechanism, the incremental meter reading of the HES system can be ensured to correctly detect the electricity meter after the address type has changed, and the data collection blind spot caused by address switching is eliminated.
[0081] Another embodiment of the present invention is a further extension based on the above embodiments.
[0082] This embodiment provides a method for dynamic switching of multiple electricity meter addresses, which, after step S5 (initializing the full data of the old electricity meter registration address type locally recorded by the concentrator) in the above embodiment, further includes: Step S51: Record the meter registration address type before the switch and the new meter registration address type after the switch.
[0083] In some specific implementations, step S51 specifically involves generating an operation log record containing the "old meter registration address type name before switching" and the "new meter registration address type name after switching".
[0084] Preferably, an operation log may be generated that only records the key information "switch to [target meter registration address type name]".
[0085] The above operation logs can provide a complete operation trajectory for fault tracing and auditing.
[0086] In addition, the multi-meter address dynamic switching method provided in this embodiment also includes: S0: Preset mapping table between meter registration address type and address length.
[0087] S8: Add a new record in the mapping table regarding the new meter's registration address type and address length.
[0088] S9: Configure the access determination primitives corresponding to the newly added new electricity meter registration address type.
[0089] As described above, when new meter registration address types (such as 24-byte extended addresses) need to be supported in the future, only a new mapping record needs to be added to the mapping table, and the admission judgment primitive corresponding to the new meter registration address type needs to be configured. The core code of the switching engine does not need to be modified at all. Therefore, this invention has good scalability and compatibility, can flexibly adapt to the diverse needs of different power business scenarios for registration address type formats, effectively reduces system upgrade and maintenance costs, and significantly enhances the long-term applicability of the system.
[0090] In some specific implementations, the multi-meter address dynamic switching method provided in this embodiment can be abstracted into a universal switching model independent of specific meter registration address types. This universal switching model takes "switching operation to target address type" as the basic processing unit, extends forward to the access constraint verification bound to the target address type, and extends backward to the post-switching downlink network recovery without reassembly, network access time update, and thorough cleaning of all old format data, thus forming a complete closed loop covering "access and locking, writing, marking, cleaning to recovery".
[0091] This universal switching model has extremely strong compatibility guarantees, specifically reflected in the following dimensions: Dimension 1: It has the ability to be compatible with any type of electricity meter registration address.
[0092] Whether switching between currently known device serial numbers and logical device names, or switching between any address types that may be added in the future, the same core switching process can be reused. When a new meter registration address type needs to be added, only a new mapping record needs to be added to the "Meter Registration Address Type and Address Length" mapping table, and the access control primitive corresponding to the new meter registration address type needs to be configured; when an existing meter registration address type needs to be modified, only the corresponding configuration in the mapping table needs to be modified. All of the above operations require no modification to the core code, significantly reducing the complexity of system expansion and maintenance, and improving the flexibility and efficiency of business adaptation.
[0093] Dimension Two: Possesses the ability to isolate data based on the registration address type and format of both old and new electricity meters.
[0094] A strategy of "physical deletion + logical reconstruction" is used to achieve complete isolation between the registration address type format data of the old and new electricity meters: (1) Physical deletion. By step S5 (initializing the full data of the old meter registration address type recorded locally by the concentrator), the old format data is completely cleared from the storage level, eliminating the possibility of mixing the old and new format data from the root.
[0095] (2) Logic reconstruction. After the concentrator application is reloaded, the downlink communication module rereads the registration address of each meter with the new address format and reconstructs the local file. Thereafter, all newly generated data is based on the new address format to ensure the purity and consistency of data at the logic level.
[0096] (3) Cross-address type status isolation. Through the offline flag file mechanism, the concentrator performs full device offline reporting to HES to ensure that the old format online status is cleared on the HES side, thereby achieving end-to-end data isolation from the concentrator to HES.
[0097] Dimension 3: Possesses backward compatibility during the switching process.
[0098] When the concentrator system switches from one address type to another, the following compatibility can be guaranteed: (1) Backward compatibility. In the multi-layer synchronous write in step S3, the disk configuration file layer is stored in key-value pair format, and new version configuration items and old version configuration items can coexist. Even if the concentrator software is upgraded and an address type option is added, the old configuration file can still be read and parsed correctly, ensuring the integrity and availability of configuration data during system evolution.
[0099] (2) Backward compatibility of the protocol. The switching instructions issued through the DLMS / COSEM protocol are identified by a unified address type enumeration value. Adding a new address type only requires expanding the enumeration range, without affecting the parsing and execution of existing address type instructions, thus ensuring the natural adaptation of the communication protocol layer to future expansion.
[0100] (3) Operational state compatibility. The admission decision primitive adopts the "condition combination" model, where each address type declares the complete set of operational conditions on which its normal operation depends. When adding a new address type, only the complete set of its corresponding operational conditions needs to be declared, and the admission decision logic of existing address types is not affected, thus achieving decoupling and scalability of the operational state level switching logic.
[0101] Therefore, this universal handover model not only ensures the reusability and consistency of the handover process across different address types, but also provides a flexible technical foundation for the continuous evolution of the system and the adaptation to diverse services.
[0102] Another embodiment of the present invention provides a multi-meter address dynamic switching system based on any of the above embodiments.
[0103] This embodiment provides a dynamic switching and active configuration system for electricity meter addresses, including an HES system, a concentrator, and various electricity meters that are sequentially connected in communication.
[0104] The HES system is configured to implement the steps executed by the HES system in the multi-meter address dynamic switching method described in any of the above embodiments. The specific steps are not detailed here; please refer to the descriptions in the above embodiments for more information.
[0105] The concentrator is configured to perform the steps in the multi-meter address dynamic switching method described in any of the above embodiments. The specific steps are not detailed here; please refer to the descriptions in the above embodiments for more information.
[0106] Furthermore, those skilled in the art will understand that all or part of the processes in the above technical solutions can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the methods described above. After being executed by a processor, the program can also achieve the beneficial effects of the corresponding methods.
[0107] The storage medium can be a disk, optical disc, read-only memory (ROM), or random access memory (RAM), etc.
[0108] In summary, the multi-meter address dynamic switching method and system provided by this invention have at least the following advantages: (1) The switching process is fully automated. The address type switching is upgraded from the existing variable assignment operation to a complete and automated transactional process, which does not require manual intervention.
[0109] (2) Improved system state security. By using access control primitives, the system ensures the operational state constraints and two-way locking protection of the new meter registration address type, protecting the system from both "entry" and "maintenance" directions. Illegal operations are actively intercepted, and illegal state combinations are eliminated from the design level.
[0110] (3) Reliable status transfer across address types. By using the "producer-consumer" model of the offline flag file, a lightweight file existence check is used to achieve status transfer across processes and lifecycles, ensuring that the downlink module accurately judges and automatically completes the online status isolation between the old and new formats after the switch.
[0111] (4) Downlink network is reorganized without interruption, improving service continuity. After the switchover, the downlink meter network does not need to be dismantled and reorganized. Existing physical links are reused to reread the new format registration address and update the network access time, avoiding long-term communication interruption and enabling rapid recovery of data collection services.
[0112] (5) Incremental meter reading compatibility guarantee. Through the network access time update mechanism, the HES incremental meter reading is guaranteed to correctly detect the electricity meter after the address type has changed, avoiding blind spots in the collection.
[0113] (6) Multi-type compatibility and scalability. The switching engine is implemented based on a general switching model. When a new address type is added, only the mapping table needs to be expanded and the admission conditions need to be declared. The core switching logic does not need to be modified, ensuring the system's compatibility with future address types.
[0114] Although preferred embodiments of the invention have been described, those skilled in the art, upon understanding the basic inventive concept, can make other changes and modifications to the embodiments. Therefore, the appended claims are intended to cover the preferred embodiments and all equivalent modifications falling within the scope of protection defined by the claims and their equivalents. Clearly, those skilled in the art can make various alterations and variations to the invention without departing from its spirit and scope. If such modifications and variations fall within the scope of protection defined by the claims and their equivalents, the invention also intends to include them.
[0115] It should be noted that any reference signs placed between parentheses in the claims should not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention can be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware.
[0116] In this invention, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "multiple" means two or more, unless otherwise explicitly specified. The term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone.
[0117] In this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0118] In this specification, the use of terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refers to a specific feature, structure, material, or characteristic described in connection with that embodiment or example, which is included in at least one embodiment or example of the present invention. The illustrative expressions of the above terms in this specification should not be construed as necessarily referring to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0119] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A method for dynamic switching of multiple electricity meter addresses, characterized in that, include: Pre-define the access control primitives corresponding to each electricity meter's registration address type; After receiving the switching instruction for the corresponding new electricity meter registration address type issued by the HES system, the concentrator calls the access determination primitive corresponding to the new electricity meter registration address type to execute the bidirectional address switching protection mechanism. After passing the positive access check in the bidirectional address switching protection mechanism, the new meter registration address type is synchronously written to all storage layers. Create a decommissioning flag file to identify the decommissioning of old electricity meter registration address types; Initialize the concentrator's local records of all data regarding the old meter registration address type.
2. The method for dynamic switching of multiple meter addresses as described in claim 1, characterized in that, The initialization concentrator locally records complete data regarding the old meter registration address type, specifically including: Delete the online meter information record files and status record database files in the main database and backup database; Clear the temporary data area and parameter storage area; Reset the communication status of all meters in the downstream network.
3. The method for dynamic switching of multiple meter addresses as described in claim 1, characterized in that, The initialization concentrator locally records all data regarding the old meter registration address type, and then includes: After the concentrator's downlink communication module restarts based on the initialization, if it reads the offline flag file, it determines that a change in the meter registration address type occurred in the previous operating cycle and performs a full-device offline reporting operation; wherein, the full-device offline reporting operation includes: the concentrator reporting to the HES system that the communication status of all meters in its downlink network is offline, and deleting the offline flag file after the reporting is completed; The concentrator rereads the registration address of each meter according to the format of the new meter registration address type, and updates the network access time of each meter at the same time.
4. The method for dynamic switching of multiple meter addresses as described in claim 3, characterized in that, The concentrator rereads the registration address of each meter according to the format of the new meter registration address type, and updates the network access time of each meter. Afterwards, it also includes: The concentrator reports online events to the HES system using the new meter registration address type. The online events carry the registration address read by each meter according to the format of the new meter registration address type, and its updated network access time. The HES system updates the reading address association of each meter based on the received online events of the meters.
5. The method for dynamic switching of multiple meter addresses as described in claim 1, characterized in that, The access determination primitives include: a positive access check before handover, a first reverse locking condition protection after handover, and a second reverse locking condition protection after handover. The implementation of the bidirectional address switching protection mechanism specifically includes: Perform a forward access check before switching: determine whether the current operating state meets all access constraints corresponding to the new meter registration address type; if any access constraint is not met, the forward access check is deemed to have failed and the switching instruction is refused; if all access constraints are met, switching to the new meter registration address type is allowed, and the first reverse locking condition protection and the second reverse locking condition protection after switching are continued to be executed. The first reverse locking condition protection after the switch is executed: when a modification instruction corresponding to the current operating state is received from the HES system, it is determined whether the current operating state belongs to the first operating dependency constraint condition corresponding to the new meter registration address type; if so, the modification operation is refused. The second reverse locking condition protection after the switch is executed: when a shutdown command corresponding to a configuration is received from the HES system, it is determined whether the configuration belongs to the second runtime dependency constraint corresponding to the new meter registration address type; if so, the shutdown operation is refused.
6. The method for dynamic switching of multiple meter addresses as described in claim 1, characterized in that, Prior to the initialization concentrator's local record of all data regarding the old meter registration address type, it also included: Record the meter registration address type before the switch and the new meter registration address type after the switch.
7. The method for dynamic switching of multiple meter addresses as described in claim 1, characterized in that, The offline flag file is created in a specified path; the specified path is a persistent storage path that is not affected by memory cleanup operations.
8. The method for dynamic switching of multiple meter addresses as described in claim 1, characterized in that, Also includes: A pre-defined mapping table between the registered address type and address length of the electricity meter; In the mapping table, add a new record regarding the new electricity meter's registration address type and address length; Configure the access determination primitives corresponding to the newly added new electricity meter registration address type.
9. The method for dynamic switching of multiple meter addresses as described in claim 1, characterized in that, All storage layers include a memory structure storage layer, a static configuration storage layer, a shared cache layer, and a disk configuration file layer; The disk configuration file layer stores the new electricity meter registration address type in key-value pair format.
10. A multi-meter address dynamic switching system, characterized in that, This includes the HES system, concentrator, and various electricity meters that are connected in sequence via communication. The HES system is configured to implement the steps executed by the HES system in the multi-meter address dynamic switching method according to any one of claims 1 to 9; The concentrator is configured to perform the steps executed by the concentrator in the multi-meter address dynamic switching method according to any one of claims 1 to 9.
