Electric energy meter registration method and system based on primary and secondary electric energy meters
Patent Information
- Application Number
- CN202611173416.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-04
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2046-08-04
AI Technical Summary
[0004]本发明实施例提供一种基于子母电能表的电能表注册方法和系统,以解决相关技术中子电能表批量注册时并发冲突严重且注册效率较低的问题
[0015]In summary, the energy meter registration method and system based on master and slave energy meters disclosed herein, through a probabilistic response mechanism based on response comparison counts and response time windows, enables slave energy meters to probabilistically select response times, reducing the collision probability of multiple meters reporting concurrently at the same time; through an identity verification method based on comparing the slave energy meter device identifier with a preset device information table, legitimacy verification can be completed without relying on certificates or pre-shared keys, ensuring access security while reducing key management and deployment costs; by using the low-order field or hash value of the slave energy meter device identifier as a wake-up identifier to generate wake-up protocol data units, the length of the directed wake-up frame is significantly shortened, reducing downlink signaling overhead; and by enabling after wake-up... The design of the information receiving window ensures that the sub-meters only activate their full receiving path after being correctly woken up, reducing power consumption and preventing non-target sub-meters from mistakenly receiving registration commands. By adaptively adjusting the response comparison count and response time window based on the total number of sub-meters to be registered, a low response comparison count and long response time window are used for sparse discovery and batch locking when the number of sub-meters is large, while a high response comparison count and short response time window accelerate the final convergence when the number is small, achieving a dynamic balance between registration speed and success rate. A periodic heartbeat detection mechanism after registration can promptly detect offline sub-meters and trigger re-registration, ensuring long-term reliability of the link after registration.
Smart Images

Figure CN122718243B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of smart energy meters, and in particular to a method and system for registering energy meters based on master and slave energy meters. Background Technology
[0002] In low-voltage power meter reading systems, a master-slave meter networking mode is commonly used. The master meter is a smart meter with power metering functions and built-in concentrator communication management capabilities. Slave meters are installed at end-user locations and are responsible for metering user electricity consumption. Newly installed or batch-replaced slave meters must first be connected to the master meter and registered to establish a reliable communication link, enabling the master meter to remotely read meters, control fees, and monitor loads. In related technologies, automatic slave meter registration typically employs a broadcast discovery mechanism based on a shared channel. The master meter periodically sends out broadcast discovery commands, and all unregistered slave meters receive these commands and send back a report containing their own identifier. Some schemes also incorporate frame time slots, dividing time into several time slots for slave meters to randomly select and send their reports to reduce collisions.
[0003] However, the aforementioned broadcast-discovery-based registration scheme can lead to massive concurrent conflicts in scenarios with large-scale sub-meters being powered on simultaneously. When multiple sub-meters collide in the same time slot, resulting in reception failure, the collided sub-meters immediately reset to an unregistered state and continue to participate in the next round of broadcast competition, repeatedly overlapping with newly registered sub-meters and causing a cascading spread of channel conflicts, potentially paralyzing the entire substation's registration process. Furthermore, it cannot dynamically adjust the response probability and time slot size based on the number of sub-meters to be registered, making it difficult to achieve an optimal balance between registration speed and success rate. Therefore, there is an urgent need for an automatic sub-meter registration method that can avoid registration conflicts and provide dynamic parameter adjustment capabilities. Summary of the Invention
[0004] This invention provides a method and system for registering electricity meters based on master and slave electricity meters, in order to solve the problems of severe concurrent conflicts and low registration efficiency when registering slave electricity meters in batches in related technologies.
[0005] In a first aspect, the present invention provides a method for registering an energy meter based on a master-daughter energy meter, applied to a master energy meter, comprising: Obtain the total number of energy meters to be registered as sub-energy meters, and based on the total number of energy meters, determine the number of response comparisons and the response time window for the sub-energy meters to be registered; Based on the response comparison number and response time window, a discovery protocol data unit is generated and broadcast to the sub-energy meter to be registered, so that when the sub-energy meter to be registered receives the discovery protocol data unit, the sub-energy meter status of the sub-energy meter to be registered will be changed from the unlocked state to the locked state. Receive the discovery report returned by the sub-energy meter to be registered within the response time window. The discovery report carries the sub-energy meter device identifier of the sub-energy meter to be registered. The discovery report is generated by the sub-energy meter to be registered when deciding to respond to the discovery protocol data unit based on the discovery protocol data unit. Based on the sub-meter device identifier and the preset device information table, the identity of the sub-meter to be registered is verified to obtain the sub-meter identity verification result; If the identity verification result of the sub-electricity meter is successful, a wake-up protocol data unit is generated based on the device identifier of the sub-electricity meter, and the wake-up protocol data unit is sent to the sub-electricity meter to be registered, so that the sub-electricity meter to be registered can open the information receiving window based on the wake-up protocol data unit; Send a registration protocol data unit to the sub-meter to be registered. The registration protocol data unit contains a communication address assigned to the sub-meter to be registered, so that the sub-meter to be registered can receive the registration protocol data unit based on the information receiving window, and when the sub-meter to be registered receives the registration protocol data unit, change the sub-meter status from locked to registered. Receive the registration confirmation information returned by the registration protocol data unit from the sub-meter to be registered.
[0006] In some embodiments, based on the total number of electricity meters, the response comparison number and response time window for the sub-electricity meters to be registered are determined, including: When the total number of electricity meters is less than or equal to a preset threshold, the response comparison number is determined as the first response comparison number, and the window length of the response time window is the first duration. When the total number of electricity meters exceeds a preset threshold, the response comparison number is determined as the second response comparison number, the window length of the response time window is the second duration, the second response comparison number is less than the first response comparison number, and the second duration is greater than the first duration.
[0007] In some embodiments, based on the sub-meter device identifier and a preset device information table, the identity of the sub-meter to be registered is verified to obtain the sub-meter identity verification result, including: Based on the preset equipment information table, the identification of the sub-electricity meter equipment is queried to obtain the identification query results; If the identifier query result shows that there is device information in the preset device information table that matches the device identifier of the sub-energy meter, then the identity verification result of the sub-energy meter is determined to be verified successfully. If the query result indicates that there is no device information matching the device identifier of the sub-meter in the preset device information table, then the identity verification result of the sub-meter is determined to be verification failure.
[0008] In some embodiments, a wake-up protocol data unit is generated based on the sub-meter device identifier, including: Use the low-order field of a preset length in the sub-energy meter device identifier as the wake-up identifier, or calculate the hash value of the sub-energy meter device identifier and determine the hash value as the wake-up identifier. Based on the wake-up identifier, a wake-up protocol data unit carrying the wake-up identifier is generated.
[0009] In some embodiments, after receiving the registration confirmation information returned by the registration protocol data unit in response to the sub-meter to be registered, the method further includes: Based on the registration confirmation information, identify the sub-electricity meters that have completed registration; Periodically perform heartbeat detection on the registered sub-electricity meters to obtain the heartbeat detection results; If the heartbeat detection result indicates that the registered sub-meter does not respond within the preset time, the registered sub-meter will be re-registered.
[0010] Secondly, the present invention provides a method for registering a power meter based on a master-slave power meter, applied to a slave power meter to be registered, comprising: The system receives the discovery protocol data unit broadcast by the main energy meter and changes the sub-energy meter status from the unlocked state to the locked state. The discovery protocol data unit is generated by the main energy meter based on the response comparison number and the response time window. The response comparison number and the response time window are determined by the main energy meter based on the total number of energy meters to be registered sub-energy meters. When deciding to respond to the discovery protocol data unit based on the discovery protocol data unit, a discovery report is generated and sent to the main energy meter within the response time window. The discovery report carries the sub-energy meter device identifier, so that when the main energy meter receives the discovery report within the response time window, it can verify the identity of the sub-energy meter based on the preset device information table and the sub-energy meter device identifier carried in the discovery report. Receive the wake-up protocol data unit sent by the main energy meter, and open the information receiving window based on the wake-up protocol data unit. The wake-up protocol data unit is generated and sent by the main energy meter based on the device identifier of the sub-energy meter after the identity verification is passed. Based on the information receiving window, the system receives the registration protocol data unit sent by the main energy meter and changes the status of the sub-energy meter from the locked state to the registered state. The registration protocol data unit contains the communication address assigned by the main energy meter to the sub-energy meter. In response to the registration protocol data unit, return registration confirmation information to the main energy meter.
[0011] In some embodiments, after receiving the discovery protocol data unit broadcast by the main energy meter, the method further includes: In response to the discovery protocol data unit, a response random number is generated; If the response random number is greater than the response comparison number, then the response discovery protocol data unit is abandoned. If the response random number is less than or equal to the response comparison number, then the response discovery protocol data unit is determined, and the response timing of the response discovery protocol data unit is determined based on the response time window.
[0012] In some embodiments, when deciding to respond to a discovery protocol data unit based on a discovery protocol data unit, a discovery report is generated, including: Obtain the meter number of the sub-meter to be registered; Based on the preset meter number mapping rules, the meter number is mapped to obtain the sub-meter device identifier; A discovery report is generated based on the sub-meter device identifier.
[0013] In some embodiments, opening an information receiving window based on a wake-up protocol data unit includes: The wake-up protocol data unit is parsed to obtain the wake-up identifier; The consistency between the wake-up identifier and the sub-energy meter device identifier is verified to obtain the identifier identification result; If the identification result shows that the wake-up identifier corresponds to the sub-electricity meter device identifier, then the information receiving window will be opened.
[0014] Thirdly, the present invention provides an energy meter registration system based on a master-daughter energy meter, comprising: a master energy meter and a daughter energy meter to be registered, wherein the master energy meter is used to perform the energy meter registration method based on a master-daughter energy meter as described in the first aspect, and the daughter energy meter to be registered is used to perform the energy meter registration method based on a master-daughter energy meter as described in the second aspect.
[0015] In summary, the energy meter registration method and system based on master and slave energy meters disclosed herein, through a probabilistic response mechanism based on response comparison counts and response time windows, enables slave energy meters to probabilistically select response times, reducing the collision probability of multiple meters reporting concurrently at the same time; through an identity verification method based on comparing the slave energy meter device identifier with a preset device information table, legitimacy verification can be completed without relying on certificates or pre-shared keys, ensuring access security while reducing key management and deployment costs; by using the low-order field or hash value of the slave energy meter device identifier as a wake-up identifier to generate wake-up protocol data units, the length of the directed wake-up frame is significantly shortened, reducing downlink signaling overhead; and by enabling after wake-up... The design of the information receiving window ensures that the sub-meters only activate their full receiving path after being correctly woken up, reducing power consumption and preventing non-target sub-meters from mistakenly receiving registration commands. By adaptively adjusting the response comparison count and response time window based on the total number of sub-meters to be registered, a low response comparison count and long response time window are used for sparse discovery and batch locking when the number of sub-meters is large, while a high response comparison count and short response time window accelerate the final convergence when the number is small, achieving a dynamic balance between registration speed and success rate. A periodic heartbeat detection mechanism after registration can promptly detect offline sub-meters and trigger re-registration, ensuring long-term reliability of the link after registration. Attached Figure Description
[0016] 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.
[0017] Figure 1 This is a flowchart of an energy meter registration method based on a mother-daughter energy meter applied to a mother energy meter according to an embodiment of the present invention; Figure 2 This is a detailed flowchart of S101 in one embodiment of the present invention; Figure 3 This is a detailed flowchart of S104 in one embodiment of the present invention; Figure 4 This is a detailed flowchart of S105 in one embodiment of the present invention; Figure 5 This is a flowchart illustrating the specific execution following S107 in one embodiment of the present invention; Figure 6 This is a flowchart of an energy meter registration method based on a master-slave energy meter, applied to a sub-energy meter to be registered, according to an embodiment of the present invention. Figure 7This is a detailed flowchart of S601 in one embodiment of the present invention; Figure 8 This is a detailed flowchart of S602 in one embodiment of the present invention; Figure 9 This is a detailed flowchart of S603 in one embodiment of the present invention; Figure 10 This is an interactive example diagram of an energy meter registration system based on a master-slave energy meter in one embodiment of the present invention. Detailed Implementation
[0018] As an example, such as Figure 1 As shown, a method for registering electricity meters based on master and slave electricity meters is provided, applied to master electricity meters, including: S101, obtain the total number of energy meters to be registered for the sub-energy meters, and determine the number of responses and the response time window for the sub-energy meters to be registered based on the total number of energy meters; S102, based on the response comparison number and response time window, generate a discovery protocol data unit and broadcast the discovery protocol data unit to the sub-energy meters to be registered; S103, Receive the discovery report returned by the sub-energy meter to be registered within the response time window; S104, Based on the sub-electricity meter device identifier and the preset device information table, perform identity verification on the sub-electricity meter to be registered, and obtain the sub-electricity meter identity verification result; S105, if the identity verification result of the sub-energy meter is successful, then based on the sub-energy meter device identifier, a wake-up protocol data unit is generated and sent to the sub-energy meter to be registered; S106, Send a registration protocol data unit to the sub-meter to be registered. The registration protocol data unit contains the communication address assigned to the sub-meter to be registered. S107, Receive the registration confirmation information returned by the registration protocol data unit in response to the sub-electricity meter to be registered.
[0019] As an example, in step S101, the main energy meter first obtains the total number of sub-energy meters to be registered in the current distribution area. This total number can be obtained based on prior information from the installation plan or estimated based on historical registration records. Based on this total number, the main energy meter adaptively determines the number of response comparisons and the response time window used in this round of registration.
[0020] Among them, the response comparison number is used to probabilistically control the proportion of the sub-energy meters to be registered to initiate responses in this round, and the response time window is used to define the time-domain discrete range of the response time of the sub-energy meters to be registered.
[0021] In one embodiment, the main energy meter can estimate the current inventory of sub-energy meters to be registered based on prior information about the number of unlocked sub-energy meters in the system, or from a list of locked sub-energy meters that have been discovered but not registered, and dynamically adjust the response comparison number and response time window accordingly.
[0022] For example, in a residential community, one main energy meter and 200 new sub-energy meters are installed under a transformer substation. The main energy meter has pre-stored the factory meter number information of all 200 sub-energy meters. Based on this total number, the number of responses to be compared and the response time window are determined during the first round of registration.
[0023] As an example, in step S102, the main energy meter constructs a Discover Protocol Data Unit (Discover PDU) based on the determined response comparison number and response time window parameters, and broadcasts it to all sub-energy meters to be registered via a shared channel. When a sub-energy meter to be registered receives the Discover Protocol Data Unit, it immediately changes its sub-energy meter status from unlocked to locked and stops responding to subsequent full-broadcast discovery commands.
[0024] The sub-meter status includes three types: Unlocked (New_And_Unlocked, NAU), which means the sub-meter has not yet received any valid discovery request, corresponding to the initial state after initial power-on or abnormal reset; Locked (New_And_Locked, NAL), which means the sub-meter has received at least one discovery protocol data unit but has not yet completed registration, stops responding to full broadcast discovery commands, and only waits for subsequent directional processing by the parent meter; Registered (Register_And_Locked, RAL), which means the sub-meter has completed registration and obtained an assigned formal communication address, and enters the normal working state.
[0025] In one embodiment, it was found that the protocol data unit carries at least two control parameters: the number of response comparisons and the response time window.
[0026] Optionally, when a sub-meter is in the locked state, it immediately and unconditionally transitions from the unlocked state to the locked state, regardless of whether it generates an actual response based on probabilistic decision-making. Through this mechanism, all sub-meters that have received instructions after the first round of broadcasting are immediately locked out of the competition pool. Even if a large number of sub-meters respond simultaneously in the first round, causing severe collisions and the main meter failing to receive any reports, the entire channel will immediately return to absolute silence after these sub-meters enter the locked state, thus completely isolating the collisions and avoiding a vicious cycle of registration failures caused by collisions.
[0027] As an example, in step S103, the main energy meter continuously monitors the channel within the time range corresponding to the response time window, receiving discovery reports returned by each sub-energy meter to be registered in its selected time slot. The discovery report carries the sub-energy meter device identifier of the sub-energy meter to be registered, serving as a credential for authentication. The discovery report is generated and sent by the sub-energy meter to be registered when making probability decisions and determining the response based on the discovery protocol data unit.
[0028] In one embodiment, the response time window defines a time interval. The total duration of the window can be the number of allowed time slots multiplied by the unit time slot duration. For example, if the unit time slot duration is 1 second and the number of allowed time slots is 500, then the response time window is 500 seconds. The sub-meter to be registered randomly selects a time slot within this window to send a discovery report, thereby reducing the probability of collisions.
[0029] As an example, in step S104, the main energy meter extracts the device identifier of the sub-energy meter carried in the discovery report and compares it with the pre-stored preset device information table to complete the identity verification of the sub-energy meter to be registered. The preset device information table is pre-built by the main energy meter and stores the expected device identifiers of all the sub-energy meters it manages.
[0030] In one embodiment, the preset device information table can be constructed by pre-storing a list of all managed sub-meters' factory serial numbers in the main energy meter. Following the same identifier derivation rules as the sub-meters, the expected sub-meter device identifier for each sub-meter is calculated locally, forming a mapping table between meter numbers and device identifiers. Only when the received device identifier matches the expected mapping table is the report considered to originate from a legitimate sub-meter, thus achieving lightweight authentication without relying on certificates or pre-shared keys.
[0031] For example, if an attempt is made to forge a sub-meter to connect to the system, a device identifier is arbitrarily created and a discovery report is sent. After receiving the report, the main meter compares the received device identifier with its local preset device information table one by one. If none of them match, the device is determined to be an illegal device, the report is discarded, and an abnormal alarm is recorded.
[0032] As an example, in step S105, when the identity verification result is successful, the main energy meter generates a wakeup protocol data unit (Wakeup PDU) based on the device identifier of the sub-energy meter to be registered, and sends it to the corresponding sub-energy meter to be registered. After receiving the matching wakeup protocol data unit, the sub-energy meter to be registered opens the information receiving window, enters the pre-registration state, and waits to receive the registration protocol data unit that follows.
[0033] In one embodiment, the wake-up protocol data unit adopts a lightweight frame design with a short frame structure, carrying only compressed indication information (i.e., wake-up identifier) of the target sub-meter device identifier, significantly reducing the downlink frame length compared to the registration frame of a complete communication session. The master meter traverses the locked list of sub-meters to be registered and sends the wake-up protocol data unit to each sub-meter to be registered in sequence, which can support pipelined batch processing.
[0034] Optionally, after sending the wake-up protocol data unit, the main energy meter can immediately send the registration protocol data unit for the sub-energy meter to be registered, or it can send it after a fixed minimum protection time slot (e.g., 200ms) to offset channel transmission delay. This ensures that the sub-energy meter first fully parses the wake-up identifier, completes the identifier comparison, and opens the information receiving window before receiving subsequent registration protocol data units. The woken-up sub-energy meter to be registered directly captures the registration protocol data unit within the opened information receiving window, without the need for additional handshake interaction, further reducing the number of interactions and shortening the overall registration time.
[0035] As an example, in step S106, the main energy meter sends a Registration Protocol Data Unit (Register PDU) to the sub-energy meter to be registered, which contains a unique communication address assigned to the sub-energy meter to be registered. The sub-energy meter to be registered receives the Registration Protocol Data Unit based on the opened information receiving window, and after successful verification, changes its own status from locked to registered.
[0036] In one embodiment, the assigned communication address is a short address or a logical address, used for subsequent unicast communication between the master energy meter and the child energy meter to be registered. After the child energy meter enters the registered state, it permanently exits the broadcast discovery contention domain and only responds to unicast commands for the newly assigned communication address, thus avoiding repeated false discovery of the registered child energy meter.
[0037] Optionally, the main energy meter compares all pre-stored expected identifiers of sub-energy meters with the registered list to identify the remaining sub-energy meters that have not yet reported a discovery but are already in a locked state. It then directly sends wake-up protocol data units and registration protocol data units to these remaining sub-energy meters sequentially, completing batch registration. Because each wake-up protocol data unit is extremely short, the main energy meter can complete the wake-up and registration of all remaining sub-energy meters in a short time, and the entire channel is free from any contention or conflict.
[0038] As an example, in step S107, the main energy meter receives the registration confirmation information returned by the registration protocol data unit from the sub-energy meter to be registered, confirming that the sub-energy meter has successfully received and enabled the assigned communication address, and the registration process is completed.
[0039] Optionally, after the main energy meter sends a wake-up protocol data unit and a registration protocol data unit to a locked sub-energy meter to be registered, if it does not receive a successful confirmation within a preset time, it will re-add the sub-energy meter to be registered to the registration list and try to register again in subsequent rounds. Furthermore, a maximum number of retries for re-registration can be set (e.g., 3 times). If no registration confirmation information is received after exceeding this number of retries, the sub-energy meter to be registered is marked as a registration abnormal device, targeted delivery is suspended, and it is stored in the abnormal device list for maintenance and troubleshooting, thus avoiding infinitely looping message delivery and consuming channel resources.
[0040] In summary, the method disclosed herein is applied to a master energy meter, comprising: obtaining the total number of energy meters of the sub-energy meters to be registered, and determining the response comparison number and response time window of the sub-energy meters to be registered based on the total number of energy meters; generating a discovery protocol data unit based on the response comparison number and response time window, and broadcasting the discovery protocol data unit to the sub-energy meters to be registered, so that when the sub-energy meters to be registered receive the discovery protocol data unit, the sub-energy meter status of the sub-energy meters to be registered changes from an unlocked state to a locked state; receiving a discovery report returned by the sub-energy meters to be registered within the response time window, the discovery report carrying the sub-energy meter device identifier of the sub-energy meters to be registered, the discovery report being generated by the sub-energy meters to be registered when deciding to respond to the discovery protocol data unit based on the discovery protocol data unit; and based on the sub-energy meter device identifier and preset device... The information table verifies the identity of the sub-meter to be registered, obtaining the sub-meter identity verification result. If the sub-meter identity verification result is successful, a wake-up protocol data unit is generated based on the sub-meter device identifier and sent to the sub-meter to be registered, so that the sub-meter to be registered opens the information receiving window based on the wake-up protocol data unit. A registration protocol data unit containing the communication address assigned to the sub-meter to be registered is sent to the sub-meter to be registered, so that the sub-meter to be registered receives the registration protocol data unit based on the information receiving window, and when the sub-meter to be registered receives the registration protocol data unit, the sub-meter status changes from locked to registered. The registration confirmation information returned by the sub-meter to be registered in response to the registration protocol data unit is received.This method achieves adaptive parameter configuration by determining the number of response comparisons and the response time window based on the total number of sub-meters to be registered, providing a parameter basis for the distributed and orderly access of sub-meters to be registered. Through the broadcast discovery protocol data unit, the sub-meters to be registered immediately change their state from unlocked to locked upon receiving the discovery command, promptly locking discovered sub-meters out of the broadcast contention domain. This fundamentally avoids collision sub-meters repeatedly participating in subsequent broadcast contention, effectively suppressing the accumulation of conflicts and channel congestion during large-scale concurrent access. By receiving discovery reports carrying sub-meter device identifiers from sub-meters to be registered within the response time window, the method achieves orderly collection of sub-meter discovery information. Identity verification is performed based on the sub-meter device identifier and a preset device information table, without relying on certificates or pre-defined protocols. Under the premise of a complex key system such as shared keys, the legitimacy verification of sub-meters was completed, which not only prevented unauthorized devices from accessing the network, but also reduced the deployment and management costs of identity authentication. By sending a wake-up protocol data unit to the verified sub-meters to be registered, the information receiving window was opened in a targeted manner, achieving precise wake-up of the target sub-meters and avoiding the waste of resources caused by continuous reception across all channels. By sending a registration protocol data unit containing the communication address assigned to the sub-meters to be registered, the sub-meters to be registered completed the transition from a locked state to a registered state after receiving the registration instruction. The registration process was closed-loop by receiving the registration confirmation information returned by the sub-meters to be registered. This achieved fully automated registration of sub-meters from broadcast discovery, identity verification, targeted wake-up to address allocation, and reliable network access without manual intervention.
[0041] As an example, such as Figure 2 As shown, in step S101 above, determining the response comparison number and response time window of the sub-electricity meter to be registered based on the total number of electricity meters includes: S201, when the total number of electricity meters is less than or equal to a preset threshold, the response comparison number is determined as the first response comparison number, and the window length of the response time window is the first duration; S202, when the total number of electricity meters is greater than the preset threshold, the response comparison number is determined as the second response comparison number, and the window length of the response time window is the second duration.
[0042] As an example, in step S201, when the total number of sub-electricity meters to be registered is small, less than or equal to the preset number threshold, it indicates that the registration is in the final stage or the total number of registrations is small. At this time, the risk of conflict is low. The mother electricity meter adopts a higher number of response comparisons (first response comparisons) and a shorter time window (first duration) to accelerate the discovery and registration of sub-electricity meters to be registered and to converge quickly.
[0043] For example, during the registration completion phase, the main energy meter sets the response comparison number to a high value of 80% to 100% and sets the number of allowable time slots corresponding to the response time window to a smaller value of 10 to 50.
[0044] As an example, in step S202, when the total number of sub-meters to be registered is large, exceeding the preset threshold, it indicates that the system is in the initial stage of batch power-on. At this time, the risk of conflict is high. The main energy meter uses a lower number of response comparisons (second response comparison number) and a longer time window (second duration) to ensure that only a small number of sub-meters to be registered actually respond in each round, and that the response times are sufficiently discrete to almost eliminate collisions. This stage is the sparse discovery period, and its purpose is not to achieve successful registration at once, but to smoothly pull as many sub-meters as possible into the locked state.
[0045] Among them, the number of comparisons for the second response is less than the number of comparisons for the first response, and the second duration is greater than the first duration.
[0046] For example, in the initial stage of batch power-on, the bus energy meter sets the response comparison number to a low value of 10% to 30%, and sets the allowable time slot number corresponding to the response time window to a larger value of 500 to 2000.
[0047] It should be understood that the main energy meter performs closed-loop control and dynamically adjusts parameters as the registration progresses: when the amount of data to be registered is large, it locks the data in batches with a low probability of a long window; when the amount of data to be registered is small, it accelerates the registration process with a high probability of a short window, thus achieving adaptive optimization of registration speed and success rate.
[0048] As an example, such as Figure 3 As shown, in step S104 above, based on the sub-meter device identifier and the preset device information table, the identity of the sub-meter to be registered is verified to obtain the sub-meter identity verification result, including: S301, based on the preset equipment information table, perform an identification query on the sub-electricity meter equipment identification to obtain the identification query result; S302, if the identifier query result shows that there is device information in the preset device information table that matches the device identifier of the sub-energy meter, then the identity verification result of the sub-energy meter is determined to be verified as passed; S303, if the identifier query result is that there is no device information matching the device identifier of the sub-electricity meter in the preset device information table, then the identity verification result of the sub-electricity meter is determined to be verification failure.
[0049] As an example, in step S301, the main energy meter uses the received sub-energy meter device identifier as an index to perform a query and match in a preset device information table. The preset device information table stores the expected device identifiers of all valid sub-energy meters.
[0050] As an example, in step S302, if the query result shows that there is an entry in the preset device information table that completely matches the currently received device identifier, it indicates that the sub-meter is a legally registered device and the identity verification is successful. The main meter adds the sub-meter to the list of locked sub-meters, awaiting subsequent targeted registration.
[0051] As an example, in step S303, if the query results show that there is no matching device information in the preset device information table, it indicates that the discovery report may have come from an illegally counterfeited device or a faulty device, and the identity verification failed. The main power meter discards the report and may selectively record abnormal alarm information to facilitate operation and maintenance troubleshooting.
[0052] As an example, such as Figure 4 As shown, in step S105 above, the wake-up protocol data unit is generated based on the sub-meter device identifier, including: S401, use the low-order field of a preset length in the sub-electricity meter device identifier as the wake-up identifier, or calculate the hash value of the sub-electricity meter device identifier and determine the hash value as the wake-up identifier; S402, based on the wake-up identifier, generates a wake-up protocol data unit carrying the wake-up identifier.
[0053] As an example, in step S401, the main energy meter compresses the device identifier of the sub-energy meter to generate a wake-up identifier. The compression method can be to extract a preset number of low-order bytes from the device identifier as the wake-up identifier; or to perform a hash operation on the complete device identifier and use the resulting hash value as the wake-up identifier. This shortens the identifier length and achieves lightweight wake-up frame execution.
[0054] For example, if the sub-meter device identifier is a 5-byte derived system header, and its lower 2 bytes are extracted as a wake-up identifier, then the wake-up frame only needs to carry a 2-byte compressed instruction.
[0055] As an example, in step S402, the main energy meter constructs a wake-up protocol data unit based on the generated wake-up identifier. This data unit only carries the compressed wake-up identifier and the necessary frame header information to shorten the overall frame structure, thereby improving channel utilization and batch registration efficiency.
[0056] As an example, such as Figure 5 As shown, after receiving the registration confirmation information in step S107 above, the process further includes: S501, based on the registration confirmation information, determines the sub-electricity meters that have completed registration; S502, periodically perform heartbeat detection on the registered sub-electricity meter and obtain the heartbeat detection result; S503, if the heartbeat detection result indicates that the registered sub-meter does not respond within a preset time, then the registered sub-meter shall be re-registered.
[0057] As an example, in step S501, the main energy meter marks the corresponding sub-energy meter as registered based on the received registration confirmation information and includes it in the normal management list.
[0058] As an example, in step S502, for registered sub-meters, the main meter periodically performs heartbeat detection via unicast heartbeat detection messages. Upon receiving the message, the sub-meters reply with heartbeat response messages to confirm their online status. The main meter obtains the heartbeat detection result based on whether it receives a response within a preset time.
[0059] As an example, in step S503, if a registered sub-meter fails to respond to heartbeat detection for an extended period, the main meter marks its status as failed. If necessary, the main meter can re-initiate the discovery and registration process for the sub-meter to restore the communication link.
[0060] It should be understood that if the heartbeat detection result indicates that the registered sub-meter responds within a preset time, its registered status will be maintained and normal communication will continue.
[0061] As an example, such as Figure 6 As shown, a method for registering energy meters based on master-slave energy meters is provided, applied to the slave energy meter to be registered, including: S601 receives the discovery protocol data unit broadcast by the main energy meter and changes the sub-energy meter status from unlocked to locked. S602, when deciding to respond to the discovery protocol data unit based on the discovery protocol data unit, a discovery report is generated and sent to the main energy meter within the response time window; S603 receives the wake-up protocol data unit sent by the main energy meter and opens the information receiving window based on the wake-up protocol data unit; S604, based on the information receiving window, receives the registration protocol data unit sent by the main energy meter and changes the status of the sub-energy meter from the locked state to the registered state; S605, in response to the registration protocol data unit, returns registration confirmation information to the main energy meter.
[0062] As an example, in step S601, the sub-meters to be registered, which are in an unlocked state, continuously listen to the shared broadcast channel. When a valid Discover Protocol Data Unit (Discover PDU) broadcast by the master meter is captured, a state transition is immediately performed, changing the sub-meter's state from the initial unlocked state to the locked state. The Discover Protocol Data Unit is generated by the master meter based on the response comparison count and the response time window, which are determined by the master meter according to the total number of sub-meters to be registered.
[0063] The sub-meter status includes three types: unlocked state, which means that the sub-meter has not yet received any valid discovery request, corresponding to the initial state after initial power-on or abnormal reset; locked state, which means that the sub-meter has received at least one discovery protocol data unit but has not yet completed registration, stops responding to the full broadcast discovery command, and only waits for the subsequent targeted processing of the mother meter; and registered state, which means that the sub-meter has completed registration and obtained an assigned formal communication address, and enters the normal working state.
[0064] In one embodiment, the protocol data unit is found to carry at least the number of response comparisons and the response time window. After the registered sub-energy meter receives the data, the above parameters are extracted for subsequent probability decision-making and time slot selection.
[0065] Optionally, the sub-meter to be registered starts a timer while in the locked state. If a matching wake-up protocol data unit or registration protocol data unit is not received after a preset timeout period, the sub-meter's state is automatically rolled back from the locked state to the unlocked state, and it waits for broadcast discovery again. This locked state timeout rollback mechanism can cope with registration interruptions caused by abnormalities on the main meter side or poor channel conditions, ensuring self-recovery capability in abnormal situations. For example, the preset timeout period can be set to 30 minutes.
[0066] Optionally, when a sub-meter to be registered reverts from a locked state to an unlocked state, the temporary registration parameters such as the number of responses compared in this round, the response time window, and the random response time slot in the local cache of the sub-meter to be registered can be cleared, and the initial listening logic after power-on can be restored to avoid old parameters interfering with the next round of broadcast discovery response decision.
[0067] Optionally, upon receiving the discovery protocol data unit, the sub-meters to be registered immediately and unconditionally transition from an unlocked state to a locked state, regardless of whether they generate an actual response based on probabilistic decision-making. Through this mechanism, all sub-meters to be registered that have received instructions after the first round of broadcasting are immediately locked out of the contention pool. Even if a severe collision occurs in the first round due to a large number of sub-meters responding simultaneously, and the main meter fails to receive any reports, the entire channel will immediately return to absolute silence after these sub-meters enter the locked state, completely isolating the collision and thus avoiding a vicious cycle of registration failure caused by collisions.
[0068] As an example, in step S602, the sub-meter to be registered makes a probabilistic decision based on the response comparison count carried in the discovery protocol data unit. If a response is determined, a discovery report is generated and sent to the master meter at the selected response time. The discovery report carries the sub-meter device identifier of the sub-meter to be registered as a credential for identity authentication, so that when the master meter receives the discovery report within the response time window, it can verify the identity of the sub-meter to be registered based on the preset device information table and the sub-meter device identifier.
[0069] In one embodiment, the response time window defines a time interval. The total duration of the window can be the number of allowed time slots multiplied by the unit time slot duration. For example, if the unit time slot duration is 1 second and the number of allowed time slots is 500, then the response time window is 500 seconds. After determining the response, the sub-meter to be registered randomly selects a time slot within this window as the timing for sending the discovery report, in order to reduce the probability of collision.
[0070] As an example, in step S603, the sub-meter to be registered, which is in a locked state, remains in silent listening. When it receives a wakeup protocol data unit (Wakeup PDU) sent by the master meter, it performs consistency identification based on the wakeup identifier in the wakeup frame and its own sub-meter device identifier. After identification and matching, it opens the information receiving window, enters the pre-registration state, and waits to receive the registration protocol data unit that follows. The wakeup protocol data unit is generated and sent by the master meter based on the sub-meter device identifier after the identity verification is successful.
[0071] In one embodiment, the wake-up protocol data unit adopts a lightweight frame design with a short frame structure, carrying only compressed indication information of the target sub-meter device identifier (i.e., the wake-up identifier), significantly reducing the downlink frame length compared to the registration frame of a complete communication session. A sub-meter in a locked state only opens its information receiving window when the wake-up identifier matches its own device identifier. Unmatched sub-meters remain silent, avoiding accidental reception of registration commands from other sub-meters.
[0072] As an example, in step S604, the sub-meter to be registered receives a Registration Protocol Data Unit (Register PDU) sent by the master meter within the opened information receiving window. The Registration Protocol Data Unit contains a unique communication address assigned by the master meter to the sub-meter to be registered. After successfully receiving and verifying the registration instruction, the sub-meter to be registered changes its own state from locked to registered, completing the core state transition of the registration process.
[0073] In one embodiment, the assigned communication address is a short address or a logical address, used for subsequent unicast communication between the master energy meter and the sub-energy meter to be registered. After the sub-energy meter to be registered enters the registered state, it permanently exits the broadcast discovery contention domain and only responds to unicast commands for the newly assigned communication address, thus avoiding repeated false discovery of the registered sub-energy meter.
[0074] Optionally, after the registered sub-meter saves the assigned communication address, all subsequent communications with the main meter will use this address, and it will no longer respond to any full broadcast discovery commands, ensuring the stability of the communication link after registration.
[0075] As an example, in step S605, after the sub-meter to be registered receives the registration protocol data unit and saves the assigned communication address, it returns registration confirmation information to the main meter, notifying the main meter that the registration has been successfully completed. After receiving the registration confirmation information, the main meter confirms that the sub-meter to be registered has successfully received and enabled the assigned communication address, thus closing the registration process.
[0076] Optionally, after the sub-meter to be registered enters the registered state, it receives unicast heartbeat detection messages periodically sent by the master meter and returns a heartbeat response message to confirm its online status. If the sub-meter to be registered has not communicated with the master meter for a long time due to channel abnormalities or power outages, it can wait for the master meter to re-initiate the registration process after the power is restored.
[0077] In summary, the method disclosed herein is applied to a sub-meter to be registered, comprising: receiving a discovery protocol data unit broadcast by the master energy meter, and changing the sub-meter status of the sub-meter from an unlocked state to a locked state. The discovery protocol data unit is generated by the master energy meter based on the response comparison count and the response time window, which are determined by the master energy meter based on the total number of sub-meters to be registered. When deciding to respond to the discovery protocol data unit based on the discovery protocol data unit, a discovery report is generated and sent to the master energy meter within the response time window. The discovery report carries the sub-meter device identifier of the sub-meter, so that the master energy meter receives the notification within the response time window. Upon receiving a discovery report, the system verifies the identity of the sub-meter based on a preset device information table and the sub-meter device identifier carried in the discovery report. It receives a wake-up protocol data unit from the master meter and opens an information receiving window based on this data unit. The wake-up protocol data unit is generated and sent by the master meter based on the sub-meter device identifier after successful identity verification. Based on the information receiving window, the system receives a registration protocol data unit from the master meter and changes the sub-meter's status from locked to registered. The registration protocol data unit contains the communication address assigned to the sub-meter by the master meter. In response to the registration protocol data unit, the system returns registration confirmation information to the master meter. This method immediately changes the state from unlocked to locked upon receiving the discovery protocol data unit, exiting broadcast contention regardless of response. This, combined with the main energy meter, achieves physical isolation between the discovery process and the collision domain, fundamentally avoiding channel congestion caused by repeated retries after collisions. By performing probabilistic decisions based on the discovery protocol data unit and selecting the timing to send the discovery report within the response time window, it achieves time-domain discretization of the reporting time, effectively reducing the probability of concurrent collisions. By carrying the sub-energy meter device identifier in the discovery report, it provides credentials for lightweight identity verification on the main energy meter side. By receiving the wake-up protocol data unit and only opening the information receiving window after identifier matching, it achieves targeted wake-up and on-demand reception, reducing the power consumption overhead caused by continuous full-power reception by the sub-energy meter and preventing non-target sub-energy meters from mistakenly receiving registration commands. By receiving the registration protocol data unit containing the communication address and completing the state transition from locked to registered, and finally completing the registration process loop by returning registration confirmation information, it achieves a fully automated network access process on the sub-energy meter side from receiving discovery, probabilistic reporting, being woken up, to completing registration, enabling reliable access without manual configuration.
[0078] As an example, such as Figure 7 As shown, after receiving the discovery protocol data unit broadcast by the main energy meter in step S601 above, the method further includes: S701, in response to the discovery protocol data unit, generates a response random number; S702, if the response random number is greater than the response comparison number, then abandon the response discovery protocol data unit; S703 If the response random number is less than or equal to the response comparison number, then the response discovery protocol data unit is determined, and the response timing of the response discovery protocol data unit is determined based on the response time window.
[0079] As an example, in step S701, after the registered sub-energy meter receives the discovery protocol data unit, it extracts the response comparison number parameter carried therein and generates a response random number (i.e., the first random number) for probabilistic decision-making on whether to respond in this round.
[0080] For example, the response random number ranges from 0 to 99, corresponding to the response comparison number which ranges from 0 to 100, thus achieving probability control in the form of a percentage.
[0081] As an example, in step S702, the sub-meter to be registered compares the generated response random number with the response comparison number. If the response random number is greater than the response comparison number, it is determined that the current round is silent, the response is abandoned, no message is sent, and the locked state is maintained to wait for subsequent targeted wake-up.
[0082] As an example, in step S703, if the response random number is less than or equal to the response comparison number, then a response is determined for this round. At this time, the sub-meter to be registered further generates a second random number within the time slot range corresponding to the response time window. This random number is the time slot number for sending the discovery report, corresponding to the response timing. The sub-meter to be registered waits for the time slot to arrive before sending the discovery report.
[0083] It should be understood that regardless of whether the probabilistic decision result is to respond or not, the registered sub-meters will immediately perform a state transition upon receiving the discovery protocol data unit, changing from an unlocked state to a locked state. In other words, the state locking does not depend on whether a report is actually sent; it locks as soon as a broadcast is received.
[0084] For example, sub-meter A, to be registered, generates a first random number 15, which is less than the response comparison number 20, and thus determines to respond; it then generates a second random number 203 and sends a discovery report in the 203rd second slot. Sub-meter B, to be registered, generates a first random number 88, which is greater than the response comparison number 20, and thus determines to remain silent, without sending any messages. Regardless of whether it responds or not, both sub-meters A and B, upon receiving the discovery protocol data unit, immediately change their state from unlocked to locked and cease responding to subsequent broadcasts.
[0085] As an example, such as Figure 8 As shown, in step S602 above, when deciding on the response to the discovery protocol data unit based on the discovery protocol data unit, a discovery report is generated, including: S801, Obtain the meter number of the sub-meter to be registered; S802, based on the preset meter number mapping rules, maps the meter number to obtain the sub-meter device identifier; S803 generates a discovery report based on the sub-meter device identifier.
[0086] As an example, in step S801, the sub-electricity meter to be registered obtains its own inherent factory-issued meter number, which is a unique physical identifier preset at the factory of the sub-electricity meter to be registered, such as a 12-digit decimal number.
[0087] As an example, in step S802, the sub-meter to be registered calculates and maps the sub-meter device identifier from the factory meter number according to the internally preset meter number mapping rule (i.e., the aforementioned identifier derivation rule). The mother meter side pre-calculates the expected device identifier of each sub-meter using the same mapping rule and stores it in the preset device information table, so that the device identifiers generated on both sides can be matched one-to-one.
[0088] For example, the preset meter number mapping rule can be to extract the last 8 digits of the electricity meter number, convert them into a hexadecimal byte string, and arrange them in byte order of "low address first, high byte second" to generate the derived system title of the sub-electricity meter, i.e., the sub-electricity meter device identifier. For example, when the last 8 digits of the meter number are "12345678", a specific 5-byte derived system title is generated.
[0089] As an example, in step S803, the sub-meter to be registered encapsulates the mapped sub-meter device identifier into a discovery report and sends it to the master meter in the selected response time slot. Since this device identifier is generated based on the factory meter number according to agreed rules, the master meter can pre-generate an expected identifier mapping table using the same rules for comparison and verification. Lightweight identity authentication can be achieved without key distribution, and any counterfeit device that does not know the mapping rules will not be able to generate a device identifier that can be verified.
[0090] As an example, such as Figure 9 As shown, in step S603 above, opening the information receiving window based on the wake-up protocol data unit includes: S901, parse the wake-up protocol data unit to obtain the wake-up identifier; S902, perform consistency identification on the wake-up identifier and the sub-energy meter device identifier to obtain the identifier identification result; S903, if the identification result is that the wake-up identifier corresponds to the sub-electricity meter device identifier, then the information receiving window is opened.
[0091] As an example, in step S901, the sub-electricity meter to be registered parses and extracts the wake-up identifier from the received wake-up protocol data unit. The wake-up identifier is a compressed form of the sub-electricity meter device identifier, which can be a low-order field of a preset length in the sub-electricity meter device identifier, or it can be the hash value of the sub-electricity meter device identifier.
[0092] As an example, in step S902, the sub-meter to be registered performs consistency verification between the parsed wake-up identifier and the corresponding part of its own sub-meter device identifier. If the wake-up identifier is a low-order field, the corresponding low-order byte of its own sub-meter device identifier is extracted and compared; if the wake-up identifier is a hash value, the hash value of its own sub-meter device identifier is calculated and compared to obtain the identifier recognition result.
[0093] As an example, in step S903, if the identification result shows that the wake-up identifier matches the identifier of its own sub-meter device, it means that the wake-up protocol data unit is sent to itself by the mother meter. The sub-meter to be registered is successfully woken up, opens the information receiving window, enters the pre-registration state, and waits to receive the registration protocol data unit that follows. If the identification result is a mismatch, it maintains the locked state of silent listening, does not open the information receiving window, and continues to listen for the next wake-up protocol data unit. Through this matching mechanism, only the target sub-meter will open the receiving window, which reduces the power consumption of non-target sub-meters and avoids address allocation conflicts caused by multiple sub-meters receiving registration instructions at the same time.
[0094] As an example, such as Figure 10 As shown, this disclosure proposes an energy meter registration system based on a master-daughter energy meter, including a master energy meter and a daughter energy meter to be registered, and its interaction steps include: S1001, the main energy meter obtains the total number of energy meters of the sub-energy meters to be registered, and determines the number of responses and the response time window of the sub-energy meters to be registered based on the total number of energy meters; S1002, the main energy meter generates a discovery protocol data unit based on the response comparison number and response time window, and broadcasts the discovery protocol data unit to the sub-energy meters to be registered; S1003, The sub-electricity meter to be registered changes the sub-electricity meter status from unlocked to locked; S1004, the sub-energy meter to be registered generates a response random number in response to the discovery protocol data unit, and decides whether to respond based on the comparison result of the response random number and the response comparison number; S1005, the registered sub-energy meter that decides to respond determines the response time within the response time window and generates a discovery report carrying the sub-energy meter device identifier; S1006, The sub-meter to be registered sends a discovery report to the master meter at the selected response time; S1007, Equipment identification for extracting sub-electricity meters from the main electricity meter; S1008, the main energy meter verifies the identity of the sub-energy meter to be registered based on the sub-energy meter device identifier and the preset device information table, and obtains the sub-energy meter identity verification result; S1009, If the identity verification result of the sub-electricity meter is successful, the mother electricity meter generates a wake-up protocol data unit based on the device identifier of the sub-electricity meter and sends the wake-up protocol data unit to the sub-electricity meter to be registered; S1010, the sub-energy meter to be registered receives the wake-up protocol data unit and performs consistency identification between the wake-up identifier and its own sub-energy meter device identifier; S1011, After successful identification, the information receiving window of the sub-electricity meter to be registered will be opened; S1012, The main energy meter sends a registration protocol data unit to the sub-energy meter to be registered; S1013, The sub-meter to be registered receives the registration protocol data unit based on the information receiving window and changes the sub-meter status from locked to registered. S1014, The sub-electricity meter to be registered responds to the registration protocol data unit and returns registration confirmation information to the mother electricity meter; As an example, alternative implementations of step S1001 can be found in [reference needed]. Figure 1 Step S101 Figure 2 ,and Figure 1 , Figure 2 Other related parts in the embodiments involved in step S101 will not be described again here.
[0095] In one optional embodiment, when the total number of electricity meters is less than or equal to a preset threshold, the response comparison number is determined as the first response comparison number, and the window length of the response time window is the first duration; when the total number of electricity meters is greater than the preset threshold, the response comparison number is determined as the second response comparison number, and the window length of the response time window is the second duration, wherein the second response comparison number is less than the first response comparison number, and the second duration is greater than the first duration.
[0096] As an example, alternative implementations of step S1002 can be found in [reference needed]. Figure 1 Step S102, and Figure 1 Other related parts in the embodiments involved in step S102 will not be described again here.
[0097] As an example, alternative implementations of step S1003 can be found in [reference needed]. Figure 6 Step S601, and Figure 6 Other related parts in the embodiments involved in step S601 will not be described again here.
[0098] In an optional embodiment, after receiving the discovery protocol data unit, the sub-meter further includes: generating a response random number for probability decision-making; if the response random number is greater than the response comparison number, then abandoning the response; if it is less than or equal to the response number, then deciding to respond and determining the response timing. Regardless of whether a response is made or not, the state is immediately changed to locked.
[0099] In one optional embodiment, the sub-meter starts a timer when it is locked. If a matching wake-up protocol data unit or registration protocol data unit is not received after a preset timeout period, the sub-meter automatically reverts from the locked state to the unlocked state and waits for broadcast discovery again.
[0100] As an example, alternative implementations of step S1004 can be found in [reference needed]. Figure 7 Steps S701 to S703, and Figure 7 Other related parts in the embodiments involved in steps S701 to S703 will not be described again here.
[0101] As an example, alternative implementations of step S1005 can be found in [reference needed]. Figure 6 Step S602 Figure 8 ,and Figure 6 , Figure 8 Other related parts in the embodiments involved in step S602 will not be described again here.
[0102] In one optional embodiment, generating a discovery report includes: obtaining the meter number of the sub-meter to be registered; mapping the meter number based on a preset meter number mapping rule to obtain the sub-meter device identifier; and generating a discovery report based on the sub-meter device identifier.
[0103] As an example, alternative implementations of step S1006 can be found in [reference needed]. Figure 1 Step S103, and Figure 1 Other related parts in the embodiments involved in step S103 will not be described again here.
[0104] As an example, alternative implementations of step S1007 can be found in [reference needed]. Figure 1 Step S104 Figure 3 ,and Figure 1 , Figure 3 Other related parts in the embodiments involved in step S104 will not be described again here.
[0105] In one optional embodiment, the identity verification includes: performing an identifier query on the sub-meter device identifier based on a preset device information table to obtain an identifier query result; if the identifier query result shows that there is device information in the preset device information table that matches the sub-meter device identifier, then the sub-meter identity verification result is determined to be successful; if the identifier query result shows that there is no device information in the preset device information table that matches the sub-meter device identifier, then the sub-meter identity verification result is determined to be unsuccessful.
[0106] As an example, alternative implementations of step S1008 can be found in [reference needed]. Figure 1 Step S105 Figure 4 ,and Figure 1 , Figure 4 Other related parts in the embodiments involved in step S105 will not be described again here.
[0107] In one optional embodiment, generating a wake-up protocol data unit includes: using a low-order field of a preset length in the sub-electricity meter device identifier as a wake-up identifier, or calculating the hash value of the sub-electricity meter device identifier and determining the hash value as the wake-up identifier; and generating a wake-up protocol data unit carrying the wake-up identifier based on the wake-up identifier.
[0108] As an example, alternative implementations of step S1009 can be found in [reference needed]. Figure 6 Step S603 Figure 9 ,and Figure 6 , Figure 9 Other related parts in the embodiments involved in step S603 will not be described again here.
[0109] In one optional embodiment, consistency identification includes: parsing the wake-up protocol data unit to obtain a wake-up identifier; performing consistency identification on the wake-up identifier and the sub-energy meter device identifier to obtain an identifier identification result; if the identifier identification result shows that the wake-up identifier corresponds to the sub-energy meter device identifier, then opening the information receiving window.
[0110] As an example, alternative implementations of step S1010 can be found in [reference needed]. Figure 9 Step S903, and Figure 9 Other related parts in the embodiments involved in step S903 will not be described again here.
[0111] As an example, alternative implementations of step S1011 can be found in [reference needed]. Figure 1 Step S106, and Figure 1 Other related parts in the embodiments involved in step S106 will not be described again here.
[0112] In one optional embodiment, after the main energy meter sends the wake-up protocol data unit, it can immediately send the registration protocol data unit for the sub-energy meter to be registered, or it can send it at a fixed minimum protection time slot (such as 200ms) to form a combination frame pair of wake-up frame and registration frame. The sub-energy meter to be registered can directly capture the registration protocol data unit in the opened information receiving window without additional handshake interaction.
[0113] As an example, alternative implementations of step S1012 can be found in [reference needed]. Figure 6 Step S604, and Figure 6 Other related parts in the embodiments involved in step S604 will not be described again here.
[0114] In one optional embodiment, after the sub-meter to be registered enters the registered state, it permanently exits the broadcast discovery contention domain and only responds to unicast commands of the assigned communication address to avoid being repeatedly falsely discovered.
[0115] As an example, alternative implementations of step S1013 can be found in [reference needed]. Figure 6 Step S605, and Figure 6 Other related parts in the embodiments involved in step S605 will not be described again here.
[0116] As an example, alternative implementations of step S1014 can be found in [reference needed]. Figure 1 Step S107 Figure 5 ,and Figure 1 , Figure 5 Other related parts in the embodiments involved in step S107 will not be described again here.
[0117] In one optional embodiment, after receiving the registration confirmation information, the method further includes: determining the registered sub-meters based on the registration confirmation information; periodically performing heartbeat detection on the registered sub-meters to obtain heartbeat detection results; if the heartbeat detection result indicates that the registered sub-meters do not respond within a preset time, then re-registering the registered sub-meters.
[0118] In one optional embodiment, the main energy meter compares the preset device information table with the registered list, identifies the remaining sub-energy meters that have not yet reported a discovery report but are already in a locked state, and directly sends wake-up protocol data units and registration protocol data units to the remaining sub-energy meters in sequence to complete the batch registration.
[0119] In one optional embodiment, after the main energy meter sends the wake-up protocol data unit and the registration protocol data unit, if it does not receive registration confirmation information within a preset time, it will re-include the sub-energy meter to be registered in the registration list and try to register again in subsequent rounds.
[0120] 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 processor executes the computer program, it implements the above-described method for registering electricity meters based on both a main electricity meter and a sub-electricity meter to be registered.
[0121] In one embodiment, a computer-readable storage medium is provided, the computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-described method for registering electricity meters based on both a main electricity meter and a sub-electricity meter to be registered.
[0122] Those skilled in the art will understand that all or part of the processes in the methods of 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 of the above methods. 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 can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), IAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0123] 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.
[0124] 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 registering electricity meters based on master-daughter electricity meters, applied to master electricity meters, characterized in that, include: Obtain the total number of energy meters to be registered as sub-energy meters, and based on the total number of energy meters, determine the number of responses to be compared and the response time window for the sub-energy meters to be registered; Based on the response comparison number and the response time window, a discovery protocol data unit is generated and broadcast to the sub-energy meter to be registered, so that when the sub-energy meter to be registered receives the discovery protocol data unit, the sub-energy meter status of the sub-energy meter to be registered is changed from an unlocked state to a locked state. Receive the discovery report returned by the sub-energy meter to be registered within the response time window. The discovery report carries the sub-energy meter device identifier of the sub-energy meter to be registered. The discovery report is generated by the sub-energy meter to be registered when deciding to respond to the discovery protocol data unit based on the discovery protocol data unit. Based on the sub-meter device identifier and the preset device information table, the identity of the sub-meter to be registered is verified to obtain the sub-meter identity verification result. If the identity verification result of the sub-electricity meter is successful, a wake-up protocol data unit is generated based on the device identifier of the sub-electricity meter, and the wake-up protocol data unit is sent to the sub-electricity meter to be registered, so that the sub-electricity meter to be registered opens the information receiving window based on the wake-up protocol data unit; Send a registration protocol data unit to the sub-electricity meter to be registered. The registration protocol data unit contains a communication address assigned to the sub-electricity meter to be registered, so that the sub-electricity meter to be registered can receive the registration protocol data unit based on the information receiving window, and when the sub-electricity meter to be registered receives the registration protocol data unit, change the sub-electricity meter status from locked to registered. Receive the registration confirmation information returned by the registration protocol data unit in response to the sub-electricity meter to be registered.
2. The method according to claim 1, characterized in that, The step of determining the response comparison number and response time window of the sub-electricity meter to be registered based on the total number of electricity meters includes: When the total number of the electricity meters is less than or equal to a preset threshold, the response comparison number is determined as the first response comparison number, and the window length of the response time window is the first duration. When the total number of electricity meters is greater than the preset number threshold, the response comparison number is determined as the second response comparison number, the window length of the response time window is the second duration, the second response comparison number is less than the first response comparison number, and the second duration is greater than the first duration.
3. The method according to claim 1, characterized in that, The process of verifying the identity of the sub-electricity meter to be registered based on the sub-electricity meter device identifier and a preset device information table, and obtaining the sub-electricity meter identity verification result, includes: Based on the preset device information table, the device identifier of the sub-electricity meter is queried to obtain the identifier query result; If the identifier query result shows that there is device information in the preset device information table that matches the device identifier of the sub-electricity meter, then the identity verification result of the sub-electricity meter is determined to be verified successfully. If the identifier query result indicates that there is no device information matching the device identifier of the sub-electricity meter in the preset device information table, then the identity verification result of the sub-electricity meter is determined to be verification failure.
4. The method according to claim 1, characterized in that, The step of generating a wake-up protocol data unit based on the sub-electricity meter device identifier includes: Use the low-order field of a preset length in the sub-electricity meter device identifier as the wake-up identifier, or calculate the hash value of the sub-electricity meter device identifier and determine the hash value as the wake-up identifier; Based on the wake-up identifier, a wake-up protocol data unit carrying the wake-up identifier is generated.
5. The method according to claim 1, characterized in that, After receiving the registration confirmation information returned by the sub-meter to be registered in response to the registration protocol data unit, the method further includes: Based on the registration confirmation information, the sub-electricity meters that have completed registration are identified; Periodically perform heartbeat detection on the registered sub-electricity meter to obtain the heartbeat detection results; If the heartbeat detection result indicates that the registered sub-meter does not respond within a preset time, then the registered sub-meter will be re-registered.
6. A method for registering energy meters based on master-daughter energy meters, applied to a slave energy meter to be registered, characterized in that, include: The system receives the discovery protocol data unit broadcast by the main energy meter and changes the sub-energy meter status from the unlocked state to the locked state. The discovery protocol data unit is generated by the main energy meter based on the response comparison number and the response time window. The response comparison number and the response time window are determined by the main energy meter based on the total number of energy meters of the sub-energy meters to be registered. When deciding to respond to the discovery protocol data unit based on the discovery protocol data unit, a discovery report is generated, and the discovery report is sent to the main energy meter within the response time window. The discovery report carries the sub-energy meter device identifier of the sub-energy meter, so that when the main energy meter receives the discovery report within the response time window, it performs identity verification on the sub-energy meter based on the preset device information table and the sub-energy meter device identifier carried in the discovery report. The system receives the wake-up protocol data unit sent by the main energy meter and opens an information receiving window based on the wake-up protocol data unit. The wake-up protocol data unit is generated and sent by the main energy meter based on the device identifier of the sub-energy meter after the identity verification is passed. Based on the information receiving window, the registration protocol data unit sent by the main energy meter is received, and the status of the sub-energy meter is changed from locked to registered. The registration protocol data unit contains the communication address assigned by the main energy meter to the sub-energy meter. In response to the registration protocol data unit, registration confirmation information is returned to the main energy meter.
7. The method according to claim 6, characterized in that, Following the discovery protocol data unit that receives the broadcast from the main energy meter, the system further includes: In response to the discovery protocol data unit, a response random number is generated; If the response random number is greater than the response comparison number, then the response to the discovery protocol data unit is abandoned; If the response random number is less than or equal to the response comparison number, then it is decided to respond to the discovery protocol data unit, and the timing of responding to the discovery protocol data unit is determined based on the response time window.
8. The method according to claim 6, characterized in that, When deciding to respond to the discovery protocol data unit based on the discovery protocol data unit, a discovery report is generated, including: Obtain the meter number of the sub-electricity meter to be registered; Based on the preset meter number mapping rules, the meter number of the energy meter is mapped to obtain the device identifier of the sub-energy meter; The discovery report is generated based on the sub-meter device identifier.
9. The method according to claim 6, characterized in that, The step of opening an information receiving window based on the wake-up protocol data unit includes: The wake-up protocol data unit is parsed to obtain the wake-up identifier; The consistency between the wake-up identifier and the sub-energy meter device identifier is verified to obtain the identifier identification result; If the identification result shows that the wake-up identifier corresponds to the identifier of the sub-electricity meter device, then the information receiving window is opened.
10. A power meter registration system based on a master-slave power meter, characterized in that, include: A main energy meter and a sub-energy meter to be registered, wherein the main energy meter is used to perform the energy meter registration method based on the main and sub-energy meters according to any one of claims 1 to 5, and the sub-energy meter to be registered is used to perform the energy meter registration method based on the main and sub-energy meters according to any one of claims 6 to 9.
Citation Information
Patent Citations
Electric meter plug-and-play method based on random back-off
CN109905896A
Electric energy meter communication method and system based on follow-up frame dynamic registration
CN116233200A