A method and system for accurate supplementary reporting of electricity consumption data
By using an in-memory database and extended communication protocols in the electricity consumption data acquisition system, a precise supplementary reporting method was implemented, solving the problems of repeated transmission and high resource consumption in electricity consumption data supplementary reporting, and improving the supplementary reporting efficiency and the timeliness of data acquisition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- STATE GRID SHANGHAI MUNICIPAL ELECTRIC POWER CO
- Filing Date
- 2026-05-29
- Publication Date
- 2026-06-30
AI Technical Summary
The existing electricity consumption data supplementation process suffers from problems such as repeated transmission, high resource consumption, and low supplementation efficiency. In particular, it is difficult to meet the timeliness requirements of electricity consumption data collection when the missing data points are scattered and the missing period is long.
The system uses an in-memory database to dynamically record missing data information from the electricity meter's curve data. The master station extracts the missing data point information using a single acquisition terminal as the smallest unit, generates the missing data point sequence, and generates a precise supplementary reporting notification command through an extended communication protocol. The acquisition terminal only reports the missing data, and the master station performs comparison, verification, and updates the missing data marker.
This avoids redundant data transmission and processing, improves the efficiency of electricity data reporting, shortens the reporting time, reduces the resource consumption of the entire link, and ensures the integrity and real-time performance of electricity data collection.
Smart Images

Figure CN122309503A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electricity data acquisition technology, specifically to a method and system for accurate supplementary reporting of electricity data. Background Technology
[0002] In existing technologies, electricity information collection systems mainly adopt a question-and-answer interactive mode, where the master station issues a call command through a timed task, and the collection terminals passively respond and report data. When data loss occurs, a supplementary collection period is usually determined based on the start and end points of the data loss, and all data points within the period are reported, including those that have already been successfully collected, in order to complete the data supplementation work.
[0003] However, the method of supplementing missing data based on the beginning and end of the missing time period will contain a large amount of duplicate data that has already been successfully collected in actual operation. Since the supplementation process needs to transmit and process non-missing data points, it results in long processing time for a single supplementation, heavy bandwidth consumption of communication channels, and consumption of a large amount of computing and storage resources on the terminal's local cache and the main station side. Especially when the missing data points are scattered and the missing time period is long, the efficiency of electricity data supplementation is low and it is difficult to meet the timeliness requirements of electricity data collection. Summary of the Invention
[0004] This invention provides a method and system for accurate supplementary reporting of electricity consumption data, aiming to solve the technical problems of repeated transmission, large resource consumption, and low reporting efficiency in the existing technology of supplementary reporting of electricity consumption data.
[0005] In view of the above problems, the present invention provides a method and system for accurate supplementary reporting of electricity consumption data.
[0006] In a first aspect, the present invention provides a method for accurately supplementing electricity consumption data, comprising: The main station uses an in-memory database to dynamically initialize and record the missing curve data information for each electricity meter. When precise supplementary reporting is triggered, the main station side uses a single data acquisition terminal as the smallest unit to extract only the missing data point information from the memory database and generate the missing data point sequence for each electricity meter. The main station generates a precise supplementary reporting notification instruction carrying only the missing data point information based on the missing data point sequence through an extended communication protocol for precise supplementary reporting, and sends it to the data acquisition terminal. According to the precise supplementary reporting notification instruction, the data acquisition terminal extracts the missing data point sequence, extracts only the missing data corresponding to the missing data point sequence from the local cache, and reports it to the main station in batches. After receiving the missing data, the main station compares and verifies it based on the locally maintained missing data status information. Once the verification is successful, it completes the supplementary reporting and updates the missing data marker.
[0007] Secondly, this invention provides a system for accurately reporting electricity consumption data, comprising: The missing data recording module is used by the main station to dynamically initialize and record the missing data information of the curve data of each electricity meter based on the in-memory database. The missing data point generation module is used to generate the missing data point sequence for each electricity meter by extracting only the missing data point information from the memory database, using a single data acquisition terminal as the smallest unit, when precise supplementary reporting is triggered. The supplementary reporting instruction issuance module is used by the main station to generate a precise supplementary reporting notification instruction carrying only the missing data point information according to the missing data point sequence, through an extended communication protocol for precise supplementary reporting, and to issue it to the acquisition terminal. The missing data reporting module is used by the acquisition terminal to extract the missing data point sequence according to the precise supplementary reporting notification instruction, extract only the missing data corresponding to the missing data point sequence from the local cache, and report it to the main station in batches. The missing data verification and update module is used to compare and verify the missing data based on the locally maintained missing data status information after the main station receives the missing data. After the verification is successful, the missing data is reported and the missing data mark is updated.
[0008] One or more technical solutions provided in this invention have at least the following technical effects or advantages: This invention provides a method and system for accurate electricity consumption data supplementation. First, the master station dynamically maintains the curve missing data information for each electricity meter based on a memory database. When accurate supplementation is triggered, only the missing data point information is extracted and a sequence of missing data points is generated. Second, a supplementation command carrying only the missing data point information is assembled and sent to the terminal via an extended communication protocol. After parsing the command, the terminal extracts only the corresponding missing data from its local cache and reports it in batches. Finally, the master station receives the data and compares it with the local missing data status for verification. If the verification is successful, the missing data marker is updated. This invention avoids the transmission and processing of duplicate data, effectively improves the efficiency of electricity consumption data supplementation, shortens the supplementation time, reduces the resource consumption of the entire link, and effectively ensures the integrity and real-time performance of electricity consumption data collection. Attached Figure Description
[0009] Figure 1 A flowchart illustrating a method for accurately supplementing electricity consumption data according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the overall architecture of a method for accurately supplementing electricity consumption data according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the missing data point sequence record generated by the master station in a method for accurately supplementing electricity consumption data provided in an embodiment of the present invention; Figure 4This is a schematic diagram of the structure of an accurate electricity consumption data reporting system provided in an embodiment of the present invention; The components represented by each number in the attached diagram are explained below: Missing data information recording module 11, missing data sequence generation module 12, supplementary reporting instruction issuing module 13, missing data reporting module 14, and missing data verification and update module 15. Detailed Implementation
[0010] This invention provides a method and system for accurate supplementary reporting of electricity consumption data, which addresses the technical problems of repeated transmission, high resource consumption, and low reporting efficiency in the existing technology for supplementary reporting of electricity consumption data.
[0011] Example 1, as Figure 1 , Figure 2 As shown, the present invention provides a method for accurate supplementary reporting of electricity consumption data, the method comprising: S100: The main station uses an in-memory database to dynamically initialize and record the missing curve data information for each electricity meter.
[0012] During electricity data collection, the master station needs to monitor the missing data points of each electricity meter's curve data in real time so that it can quickly extract the missing data point information when precise supplementary reporting is triggered. If a traditional relational database is used to store the collection status, each query for missing data requires executing a structured query statement. In the face of high-frequency data backflow from a massive number of electricity meters, this results in high query latency and insufficient concurrent processing capabilities. Therefore, this step introduces an in-memory database as the storage medium. Leveraging its characteristics of data residing in memory and fast access speed, the curve data points of each electricity meter are initialized and dynamically marked, thereby achieving real-time and efficient maintenance of missing data information.
[0013] Step S100 in the method provided in this embodiment of the invention includes: On a daily basis, initialize all points of the curve data for each electricity meter in the memory database; Mark all initialized points as missing data; Based on the successfully acquired curve data in real time, the corresponding points of the electricity meters in the memory database are filled with markings to dynamically update the missing data point information for each electricity meter.
[0014] First, the curve data points for each electricity meter in the in-memory database are initialized on a daily basis. An in-memory database stores all data in random access memory, eliminating disk I / O operations and providing sub-millisecond response times. This method uses a Redis in-memory database. Electricity meters are devices installed on the user's side to measure electricity consumption; each meter has a unique meter number. Curve data refers to a sequence of electricity consumption or electrical quantities collected at fixed time intervals, such as voltage, current, and active power. Each curve data set contains multiple data points, each corresponding to a collection time. A data point is the smallest unit of curve data, representing the collected value at a specific point in time.
[0015] Specifically, the main station retrieves the preset curve data collection scheme for each electricity meter stored in the in-memory database, using natural days as the unit. This scheme includes the curve type and data density, such as 24 points / day or 96 points / day. Based on the total number of points in the collection scheme, a record structure for the missing data for that day is created in the in-memory database for that electricity meter. This record structure uses the electricity meter number + data date + curve type as the key, and a bitmap or bit array as the value, where each bit corresponds to one point. During initialization, all bits are set to 1, indicating that all points have not yet been successfully collected.
[0016] For example, assume the first electricity meter is numbered M001, the data date is May 18, 2026, and the curve type is a 24-point voltage curve, meaning one point per hour, for a total of 24 points. The main station constructs a bitmap with the key M001:20260518:VOLTAGE_24 in a Redis in-memory database. This bitmap contains 24 bits. During initialization, all points from the first to the twenty-fourth point in this bitmap are assigned a binary 1, indicating that all points are in a missing data state.
[0017] Secondly, all data points after initialization are marked as being in a "missing data" state. A missing data state refers to the state where a certain curve data point has not yet been successfully collected from the master station. In this method, a missing data state is represented by a bit value of 1, and a collected data state is represented by a bit value of 0. Since all data point bits were set to 1 during initialization, meaning all data points are in a missing data state by default, this step requires no additional operation; it only requires confirming that the initial bitmap values corresponding to each energy meter and each curve type in the memory database are all 1. This missing data state marker will serve as the basis for subsequent real-time updates and accurate supplementary data extraction.
[0018] For example, for the 24-point voltage curve of the first energy meter M001, all 24 bits are 1 after initialization. The main station can confirm by reading this bit map: the first bit (corresponding to the period from 00:00 to 01:00) being 1 indicates a missing data sample, the second bit (corresponding to the period from 01:00 to 02:00) being 1 indicates a missing data sample, ..., the twenty-fourth bit (corresponding to the period from 23:00 to 00:00) being 1 indicates a missing data sample.
[0019] Next, based on the successfully acquired curve data in real time, the corresponding points of the electricity meters in the memory database are marked for filling in the missing data points, so as to dynamically update the missing data point information for each electricity meter. The successfully acquired curve data in real time refers to the electricity meter curve data that has been successfully parsed and entered into the database by the main station through timed reporting, immediate reporting, or other modes. Each data entry includes the electricity meter number, data date, curve type, point number, and measured value. Filling in the missing data points refers to the operation of changing the missing data point marker in the memory database from 1 to 0.
[0020] Specifically, after successfully receiving and parsing each electricity meter curve data entry, the main station extracts the electricity meter number, data date, curve type, and location number from the data. This information is used to construct the key name for the in-memory database, locating the corresponding bitmap. The bit corresponding to the location number in the bitmap is then changed from 1 to 0. If multiple locations of the same electricity meter and curve type are successfully acquired simultaneously, all corresponding bits are set to 0 at once. This update operation uses atomic writes to ensure real-time consistency between the missing data state and the actual acquisition results.
[0021] For example, at 01:00 on May 18, 2026, the master station receives a voltage value of 220.5 volts from the second point P2 (corresponding to the period from 01:00 to 02:00) in the 24-point voltage curve reported by the first energy meter M001. The master station extracts the following information: first energy meter number M001, data date 20260518, curve type VOLTAGE_24, and point number P2. Then, a bitmap operation is performed in Redis, changing the bit of the second point of the key M001:20260518:VOLTAGE_24 from 1 to 0. At this time, the first point P1 of the bitmap is still 1, the second point P2 becomes 0, and the third point P3 to the twenty-fourth point P24 are still 1. After another 15 minutes, the master station receives the voltage value of the third point P3 (corresponding to the period from 02:00 to 03:00) and sets the third point P3 to 0 as well. As time progresses, each time a data point is successfully collected, its corresponding bit is marked as collected instead of missing. By 23:00 on the same day, if all 24 data points have been successfully collected, all 24 bits will be 0, indicating that there are no missing data points.
[0022] In this embodiment of the invention, the master station initializes missing data markers for all points of each electricity meter curve data in the in-memory database, using a bitmap data structure on a daily basis. It then atomically updates the corresponding points based on successfully acquired real-time data. Utilizing the high-speed read / write capabilities of the in-memory database, the state changes of missing data points can be recorded in real-time and accurately. Compared to relational databases, this method avoids the latency caused by frequent query and update operations, providing an efficient and reliable data foundation for quickly extracting missing data point information during subsequent accurate supplementary reporting.
[0023] S200: When precise supplementary reporting is triggered, the master station side uses a single data acquisition terminal as the smallest unit to extract only the missing data point information from the memory database and generate the missing data point sequence for each electricity meter.
[0024] After dynamically maintaining the missing data points for each electricity meter in the in-memory database, when precise supplementary reporting is required, the master station needs to efficiently extract the missing data point information from the in-memory database and organize it into a format that the data acquisition terminal can recognize and process. Since the supplementary reporting operation is performed at the individual data acquisition terminal level, and a single data acquisition terminal typically connects to multiple electricity meters, querying the missing data information for each meter individually and then issuing separate instructions would result in excessive interactions between the master station and the terminals, leading to decreased supplementary reporting efficiency. Therefore, this step extracts the missing data point information for all electricity meters under a single data acquisition terminal at once, and organizes it according to a standardized missing data point sequence format, providing a data foundation for the generation of subsequent precise supplementary reporting instructions.
[0025] Step S200 in the method provided in this embodiment of the invention includes: The triggering of precise supplementary reporting can be achieved in any of the following ways: timed triggering by the main station, manual triggering, or triggering by a data collection failure event. Using the data acquisition terminal, electricity meter, and data date as indexes, extract the missing curve data information of all electricity meters under a single data acquisition terminal from the memory database; The missing data information of the curve data is used to generate a missing data point sequence in a format that includes the electricity meter identifier, data date, and a list of missing point numbers.
[0026] First, the triggering of precise data reporting can be achieved in any of the following ways: timed triggering by the master station, manual triggering, or triggering due to a data acquisition failure event. Precise data reporting refers to a one-time data reporting process initiated by the master station to the acquisition terminal for missing data points during historical acquisition periods, containing only the missing points. Timed triggering by the master station means that the master station automatically starts the precise data reporting process at a fixed time each day according to a pre-configured time strategy. This time is set during idle communication channel periods to avoid interfering with normal acquisition tasks. Manual triggering refers to operation and maintenance personnel manually initiating precise data reporting operations for specific acquisition terminals or specific data dates through a human-machine interface, commonly used for fault diagnosis or emergency data supplementation scenarios. Triggering due to a data acquisition failure event means that during real-time acquisition, the master station automatically triggers the precise data reporting process for a terminal when it detects multiple consecutive acquisition failures or a completeness rate below a preset threshold under a certain acquisition terminal.
[0027] Specifically, the main station maintains a precise data replenishment trigger event monitoring module. This module monitors three types of trigger sources: first, the scheduled task scheduler, which automatically generates a trigger signal when the system clock reaches a preset trigger time, such as 00:30 daily; second, manual trigger requests from the human-machine interface, which carry the target acquisition terminal number and data date; and third, the acquisition status monitoring logic, which automatically generates a trigger signal when it detects that the daily data integrity rate of a certain acquisition terminal is lower than a preset threshold, such as below 85%. After any type of trigger signal is generated, the main station enters the precise data replenishment process and performs subsequent missing data extraction operations.
[0028] For example, assume the daily scheduled trigger time is configured to be 00:30 AM. At 00:30:00 on May 19, 2026, the scheduled task scheduler on the main station side automatically triggers the precise supplementary reporting process, with the target data date being the previous day, May 18, 2026. At this time, the main station side prepares to extract the missing data point information for May 18, 2026 from all energy meters connected to the first data acquisition terminal T001.
[0029] Secondly, using the data acquisition terminal, electricity meter, and data date as indexes, the missing curve data information for all electricity meters under a single data acquisition terminal is extracted from the in-memory database. A data acquisition terminal refers to a data acquisition device installed in a distribution area or on the user side, such as a concentrator, used to collect data from connected electricity meters and communicate with the master station. Each data acquisition terminal has a unique terminal number. An index refers to a combination of key fields used when retrieving data in the in-memory database. In this step, the data acquisition terminal number + data date is used as the first-level index to locate the set of electricity meters under the terminal, and then the electricity meter number + data date + curve type is used as the second-level index to retrieve the missing data bitmap for each electricity meter.
[0030] In this context, "missing data information" refers to information about which data points for a specific type of curve data from a particular electricity meter have not yet been successfully collected. In this method, missing data information is stored in bitmap format, where a bit value of 1 indicates a missing data point and a bit value of 0 indicates a data point that has been collected.
[0031] Specifically, the master station first obtains the target data acquisition terminal number and the target data date determined when precise supplementary reporting is triggered. The master station maintains a data acquisition terminal-electricity meter affiliation table, which records all electricity meter numbers connected to each data acquisition terminal. Based on this table, a list of all electricity meter numbers under the target data acquisition terminal is obtained. For each electricity meter number in this list, for the target data date, the missing data bitmaps corresponding to all preset curve types under that electricity meter are queried in the in-memory database. For each bitmap, all bits are scanned, and the position number of the bit with a value of 1 is recorded; this position number is the missing data point number. The missing data information for each electricity meter is organized into a temporary data structure containing the electricity meter number, curve type, and a list of missing data point numbers.
[0032] For example, the target data acquisition terminal is the first acquisition terminal T001, and the target data date is May 18, 2026. The first acquisition terminal T001 is connected to 200 electricity meters, including the first electricity meter M001, the second electricity meter M002, the third electricity meter M003, ..., the 200th electricity meter M200. The main station iterates through the first electricity meter M001, querying the bitmap with the key M001:20260518:VOLTAGE_24 in the Redis in-memory database. Assuming the scan yields the following results: the first point P1 is 1, the second point P2 is 0, and among the points P3 to P24, the seventeenth point P17 to the twenty-third point P23 are 1, and the rest are 0. The missing data collection point numbers for the first energy meter M001 are recorded as: P1, P17, P18, P19, P20, P21, P22, and P23. Similarly, query the 24-point current curve bitmap M001:20260518:CURRENT_24 and the 24-point energy reading curve bitmap M001:20260518:ENERGY_24 for the first energy meter M001, and record their respective missing data collection points. Continue to traverse all 200 energy meters, including the second energy meter M002 and the third energy meter M003, and extract the missing data collection point information for each meter.
[0033] Next, the missing data information of the curve data is processed into a missing data point sequence, which includes the electricity meter identifier, data date, and a list of missing point numbers. The missing data point sequence refers to the sequence formed by arranging the numbers of all missing points under a given electricity meter, data date, and curve type in ascending order. This sequence is used to inform the data acquisition terminal of the specific point numbers that need to be reported. The electricity meter identifier is a unique number for each electricity meter, used to locate the specific electricity meter object on the data acquisition terminal side. The missing point number list consists of one or more point numbers separated by delimiters. For consecutive point numbers, they can be combined and represented as a start number - end number to compress the data length.
[0034] Specifically, the master station organizes the extracted missing data point sequence lists for each electricity meter and each curve type according to a preset data format. This data format is row-based, with each row containing at least four fields: acquisition terminal number, electricity meter identifier, data date, curve type identifier, and missing point sequence list. Data from multiple electricity meters are arranged sequentially to form a complete set of missing data point sequences. For the missing data point sequence list, if there are consecutive sequence ranges, such as P17, P18, P19, P20, P21, P22, and P23, they are merged and represented as P17-P23 to shorten the length of subsequent instruction messages. If the points are not consecutive, such as P1, P5, and P9, they are retained as a single sequence number separated by commas. The merged missing point sequence list is the final point sequence. After this missing data point sequence is generated, it is temporarily stored in the master station's memory data structure, awaiting subsequent steps to assemble it into a precise supplementary notification instruction.
[0035] For example, for the 24-point voltage curve of the first energy meter M001 on May 18, 2026, the missing data point numbers are P1, P17, P18, P19, P20, P21, P22, and P23. P1 is an isolated missing data point, and P17 to P23 are consecutive missing data points. When generating the missing data point sequence, this list is merged and represented as [P1, P17-P23]. For the 24-point current curve of the first energy meter M001, assuming the missing data point numbers are P10, P11, and P12, it is merged and represented as [P10-P12]. For the 24-point energy reading curve of the first energy meter M001, assuming the missing data point numbers are P15, P16, P17, and P18, it is merged and represented as [P17-P18]. A missing data point sequence record generated by the main station is as follows: Figure 3 As shown. For other energy meters under the first data acquisition terminal T001, such as the second energy meter M002 and the third energy meter M003, corresponding missing data point sequence records are also generated. The set of all records constitutes a complete missing data point sequence.
[0036] In this embodiment of the invention, the master station uses the data acquisition terminal as the smallest unit. Through high-speed index scanning of the in-memory database, it extracts the missing data point information of all electricity meters under a single data acquisition terminal in one go, and generates a missing data point sequence according to a standardized format. This method avoids the efficiency loss caused by querying each electricity meter individually and multiple interactions, aggregating the scattered missing data point information into a compact data structure. In particular, by merging consecutive points into intervals, the data volume is compressed. This missing data point sequence provides a directly usable input for assembling subsequent accurate supplementary reporting instructions, enabling the data acquisition terminal to accurately know which points need to be reported, thus providing a foundation for transmitting only missing data and avoiding duplicate data.
[0037] S300: The master station generates a precise supplementary reporting notification instruction carrying only the missing data point information through an extended communication protocol for precise supplementary reporting, based on the missing data point sequence, and sends it to the data acquisition terminal.
[0038] After generating the missing data point sequence, the master station needs to transmit this sequence information to the acquisition terminal to notify the terminal to report the missing data according to the specified points. Traditional supplementary reporting methods can only issue instructions based on the start and end points of the missing time period, requiring the terminal to report all data points within the entire time period, resulting in a large amount of duplicate data reporting. Therefore, this method extends the existing communication protocol of the electricity consumption information acquisition system, adding a dedicated, precise supplementary reporting object and method, compactly encapsulating the missing data point sequence within the instruction message. This extended protocol fully utilizes the bit-string data type to mark missing points, minimizing the instruction message length while ensuring that the terminal can accurately parse the point information that needs to be supplemented.
[0039] Step S300 in the method provided in this embodiment of the invention includes: According to the extended communication protocol of the electricity information collection system, the missing data points are sequentially encapsulated into the message of the precise supplementary reporting notification instruction; The precise supplementary reporting notification instruction is sent to the corresponding data collection terminal through the front-end layer.
[0040] First, in accordance with the extended communication protocol of the electricity information collection system, the missing data points are sequentially encapsulated into the message of the precise supplementary reporting notification instruction. The extended communication protocol refers to adding a precise reporting object with an object identifier (OI) of 60F0 to the existing DL / T 698.45 protocol, and adding method 127 for this object, specifically for the main station side to notify the collection terminal to initiate curve data supplementary reporting. This extended protocol defines the parameter structure of the precise supplementary reporting notification instruction, including data time, data item object attribute description (OAD), supplementary reporting start time, supplementary reporting end time, the number of reports to be supplemented this time, and defect information.
[0041] Specifically, encapsulating the missing data points into a precise supplementary reporting notification message includes: Using a bit string data type, missing data points for each electricity meter are marked on an hourly basis. Each bit corresponds to a data point within a preset time period. A bit of 1 indicates that the data for the corresponding time period is missing, and a bit of 0 indicates that the data for the corresponding time period has been collected. The measurement point number of each energy meter is combined with the bit string into a fixed-length unit, which includes a first segment for storing the measurement point number and a second segment for storing the bit string. The fixed-length units corresponding to all energy meters under the same precise supplementary reporting notification instruction are sequentially spliced together to form the defect information field; The defect information field, along with the data time, data item object attribute description, supplementary reporting start time, supplementary reporting end time, and the number of supplementary reports in this instance, are encapsulated together in the message of the precise supplementary reporting notification instruction.
[0042] First, a bit-string data type is used to mark missing data points for each electricity meter on an hourly basis. Each bit corresponds to a data point within a preset time period. A bit of 1 indicates missing data for that time period, while a bit of 0 indicates that data for that time period has been collected. A bit-string is a sequence data type composed of binary bits (0 and 1), with each bit independently representing a binary state. In this method, each bit corresponds to a data point within a preset time period. Marking refers to setting the bit corresponding to each time period to 1 or 0, where 1 indicates that the corresponding data point within that time period is missing, and 0 indicates that the corresponding data point within that time period has been successfully collected.
[0043] Specifically, the master station acquires the missing data point sequence generated in S200. This sequence records the missing point sequence number list for each curve type of each energy meter on a specific data date. For each energy meter and each curve type, the master station determines the total number of data points per day based on the collection density of that curve type, such as one point every 15 minutes or one point per hour. The master station maps each preset time period to a bit, starting from the beginning of the day, in chronological order. It iterates through all data points of the energy meter; if the sequence number of a data point exists in the missing point sequence number list, the corresponding bit is set to 1; otherwise, it is set to 0. To avoid excessively long messages, this method organizes bits by hour. All bits within each hourly time period are arranged sequentially to form the bit substring for that hour. All 24-hour bit substrings are concatenated in hourly order to form the complete bit string for that curve type of the energy meter.
[0044] For example, assume that the voltage curve of the first electricity meter M001 on May 18, 2026 is a 24-point curve, with one data point per hour. The missing points are the 2nd hour (corresponding to 01:00~02:00) and the 8th to 10th hours (corresponding to 08:00~11:00). The master station creates a 24-bit sequence, setting the bit of the second point P2 to 1, setting the bits of the eighth point P8, the ninth point P9, and the tenth point P10 to 1, and setting the remaining bits to 0. The final bit string is: 0,0,1,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0.
[0045] Secondly, the measurement point number of each electricity meter is combined with the bit string into a fixed-length unit. This fixed-length unit includes a first segment for storing the measurement point number and a second segment for storing the bit string. The measurement point number refers to the serial number assigned to each electricity meter connected to the acquisition terminal, used to uniquely identify a block of electricity meters on the terminal side. A fixed-length unit is a data structure with a predetermined number of bytes, internally divided into different segments, each used to store a specific type of information. In this method, every 5 bytes constitute a fixed-length unit, with the first 2 bytes used to store the measurement point number and the last 3 bytes used to store the bit string. The first segment, the field in the fixed-length unit used to store the measurement point number, is 2 bytes long. The second segment, the field in the fixed-length unit used to store the bit string, is 3 bytes long, or 24 bits, which is sufficient to store the missing data status for 24 hours of a day.
[0046] Specifically, the main station extracts the measurement point number from the data acquisition terminal for each energy meter that needs supplementary reporting. This measurement point number is converted to binary representation and padded to the first two bytes of a fixed-length unit. Simultaneously, a 24-bit string generated for the corresponding curve type of the energy meter is padded to the last three bytes of the fixed-length unit. Each energy meter generates an independent fixed-length unit. All fixed-length units for all energy meters have the same length, which is 5 bytes.
[0047] For example, the first measurement point number of the first energy meter M001 under the first data acquisition terminal T001 is 1. The main station fills the first measurement point number 1 into the first segment, i.e., hexadecimal 0x00 0x01. The generated 24-bit bit string is filled into the second segment. The binary representation of this bit string is: 00010000 01110000 00000000, arranged in 8-bit bytes. After combination, a fixed-length unit corresponding to the first energy meter M001 is obtained, which is 5 bytes in total.
[0048] Next, the fixed-length units corresponding to all energy meters under the same precise supplementary reporting notification command are sequentially concatenated to form a defect information field. The defect information field is a parameter in the precise supplementary reporting notification command, used to carry the measurement point numbers of all energy meters requiring supplementary reporting and their corresponding missing point distribution information. This field is an octet string, composed of multiple fixed-length units concatenated sequentially. Concatenation refers to linking multiple fixed-length units end-to-end according to the measurement point numbers of the energy meters under the data acquisition terminal, forming a continuous binary data block.
[0049] Specifically, the main station determines a list of all energy meters requiring supplementary reporting under the data acquisition terminals targeted by this precise supplementary reporting notification command. Each energy meter in the list is traversed in ascending order of measurement point number, and a fixed-length cell generated by that meter is retrieved. The binary data of each fixed-length cell is sequentially written into a contiguous data buffer, with the first cell written appearing at the beginning of the buffer, followed by the next cell. After the traversal is complete, the contents of the entire buffer constitute the defect information field. The length of this field is equal to the length of a single fixed-length cell multiplied by the number of energy meters.
[0050] For example, the energy meters requiring supplementary voltage curve reporting for 24 points under the first data acquisition terminal T001 include the first energy meter M001, the second energy meter M002, the third energy meter M003, the fourth energy meter M004, and the fifth energy meter M005, a total of 5 energy meters. The main station has already generated a 5-byte fixed-length unit for the first energy meter M001, and a 5-byte unit corresponding to the second measurement point number 2 for the second energy meter M002, and so on. The main station sequentially concatenates the fixed-length units according to the measurement point numbers from 1 to 5: first concatenating the 5-byte unit of M001, then concatenating the 5-byte unit of the second energy meter M002, then concatenating the 5-byte unit of the third energy meter M003, then concatenating the 5-byte unit of the fourth energy meter M004, and finally concatenating the 5-byte unit of the fifth energy meter M005. After concatenation, the defect information field is obtained, with a total length of 25 bytes.
[0051] Furthermore, the defect information field, along with the data time, data item object attribute description, supplementary reporting start time, supplementary reporting end time, and the number of supplementary reports in this instance, are encapsulated together in the message of the precise supplementary reporting notification instruction. The data time refers to the date corresponding to the missing data, used to inform the terminal which day's data needs to be supplemented. The data item object attribute description is the code used in the communication protocol to identify a specific data item; the terminal determines the type of curve data to be supplemented based on this description. The supplementary reporting start time and supplementary reporting end time refer to the time range within which the terminal searches for the missing data in its local cache, typically the start and end times of a day corresponding to the data date. The number of supplementary reports in this instance refers to the total number of energy meters to be supplemented carried in this precise supplementary reporting notification instruction, used by the terminal to verify whether the received fixed-length unit count is correct. Encapsulation refers to combining the above parameters into a complete instruction message according to the message structure specified by the extended communication protocol, following a specified order and data type.
[0052] Specifically, the master station first constructs the message framework for the precise supplementary reporting notification instruction. According to the extended communication protocol, namely the newly added 60F0 object and method 127, the instruction message consists of multiple parameters. The master station sequentially fills in the following parameters: Data time: encoded in date format, occupying a fixed length; Data item object attribute description: encoded in object attribute descriptor format, occupying a fixed length; Supplementary reporting start time: encoded in date and time format, occupying a fixed length; Supplementary reporting end time: encoded in date and time format, occupying a fixed length; Number of supplementary reports this time: encoded as a long unsigned integer, occupying a fixed length; Defect information: the generated defect information field is filled in as an octet. After all parameters are arranged in protocol order, the necessary message header is appended to form a complete precise supplementary reporting notification instruction message. This message is the final instruction sent to the acquisition terminal.
[0053] For example, the main station constructs a precise supplementary reporting notification instruction for the first data acquisition terminal T001, with a data date of May 18, 2026, and a 24-point voltage curve. Data time: May 18, 2026, encoded as hexadecimal 0x26 0x05 0x12. Data item object attribute description: The object attribute descriptor value corresponding to the 24-point voltage curve (e.g., 0x20 0x00 0x010x01). Supplementary reporting start time: May 18, 2026, 00:00:00, encoded as 0x26 0x05 0x12 0x00 0x00 0x00. Supplementary reporting end time: May 18, 2026, 23:59:59, encoded as 0x26 0x05 0x12 0x17 0x3B 0x3F. The number of reports to be supplemented this time is 5, encoded as 0x00 0x00 0x00 0x05. Defect information: A concatenated 25-byte octet. The above parameters are encapsulated according to the protocol format, and an object identifier 60F0 and a method identifier 127 are added to the outermost layer to generate a complete instruction message.
[0054] Finally, the precise supplementary reporting notification instruction is sent to the corresponding data acquisition terminal via the front-end layer. The front-end layer refers to the communication service node deployed between the master station and the data acquisition terminal, responsible for protocol conversion, message sending and receiving, connection management, and communication link maintenance. The front-end layer includes a communication front-end service and a data acquisition front-end service, which interact with each other through a message queue. Sending refers to the process by which the master station sends the assembled precise supplementary reporting notification instruction to the target data acquisition terminal via the front-end layer. The sending process uses a persistent connection and supports instruction confirmation and retransmission mechanisms.
[0055] Specifically, after completing message encapsulation, the master station writes the precise supplementary reporting notification instruction to be sent and the unique identifier of the target acquisition terminal into a specific topic in the message queue that interacts with the front-end layer. This topic is specifically used to store instructions to be sent. The acquisition front-end service in the front-end layer consumes instruction data from this message queue topic. According to the requirements of the extended communication protocol, the acquisition front-end service further assembles the instruction data into a communication message conforming to the physical transmission frame format and writes it into another message queue topic, which is specifically used to store frame data to be sent. The communication front-end service in the front-end layer consumes frame data from this message queue topic and sends the precise supplementary reporting notification instruction to the target acquisition terminal through an established Transmission Control Protocol (TCP) long connection. The communication front-end service supports a confirmation mechanism after instruction issuance: if no confirmation message is received from the acquisition terminal within a predetermined time, the instruction is automatically resent, up to a predetermined number of times, to ensure the reliability of instruction transmission. After issuance, the front-end layer records an issuance log, including issuance time, target terminal number, instruction content summary, and whether confirmation has been received.
[0056] For example, the master station has already assembled the notification message for accurate 24-point voltage curve supplementation for the first acquisition terminal T001. The master station writes this instruction and the first acquisition terminal number T001 into the topic Topic-sendCommand of the message queue. After consuming this message, the acquisition front-end service assembles the transmission frame, adding fields such as frame header, frame length, and checksum to obtain a complete transmission frame, and then writes it into the topic Topic-sendFrame. The communication front-end service consumes this frame from the Topic-sendFrame topic and sends the instruction message to the first acquisition terminal T001 through a pre-established TCP long connection. After sending, a 30-second timer is started to wait for confirmation. After receiving the instruction, the first acquisition terminal T001 immediately returns an confirmation message. After receiving the confirmation, the communication front-end service records the successful delivery. If no confirmation is received within 30 seconds, the communication front-end service automatically resends the instruction until confirmation is received or the maximum number of resends is reached.
[0057] In this embodiment of the invention, the master station, based on the extended communication protocol, encapsulates the missing data point sequence as a fixed-length unit labeled by hour using bit strings. This unit is then concatenated into a defect information field and assembled with other parameters into a precise supplementary reporting notification command. This command is reliably sent to the target acquisition terminal via a message queue and long-connection mechanism in the front-end layer. This method utilizes the compactness of bit strings to shorten the command message length. The fixed-length unit design allows the terminal to quickly parse the measurement point number and the distribution of missing points, avoiding redundant transmission caused by sending complete time period information. Simultaneously, the front-end layer's confirmation and retransmission mechanism ensures the reliability of the command delivery. This precise supplementary reporting notification command enables the acquisition terminal to accurately determine which missing points of which energy meters need to be reported, providing a clear execution basis for the terminal to achieve on-demand reporting and avoid duplicate data transmission.
[0058] S400: The acquisition terminal extracts the missing data point sequence according to the precise supplementary reporting notification instruction, extracts only the missing data corresponding to the missing data point sequence from the local cache, and reports it to the main station in batches.
[0059] After receiving the precise supplementary reporting notification instruction from the master station, the data acquisition terminal needs to accurately extract the sequence of missing data points from the instruction and then report only the missing data points from its local cache based on this sequence. In traditional supplementary reporting methods, the terminal typically reports all data within the entire time period according to the start and end times specified by the master station, resulting in the transmission of a large amount of duplicate data and wasting the terminal's computing resources, storage and retrieval bandwidth, and communication channel resources. To address this, in this step, the data acquisition terminal parses the precise supplementary reporting notification instruction to accurately obtain the list of missing point numbers corresponding to each energy meter and each data item, and then extracts only the missing data of specific points from its local cache, reporting them in batches to the master station in a compact data format. This achieves the goal of on-demand reporting and eliminating duplicate data transmission.
[0060] Step S400 in the method provided in this embodiment of the invention includes: The data acquisition terminal parses the precise supplementary reporting notification instruction and extracts the sequence of the missing data points; Based on the missing data point sequence, locate and extract the missing data corresponding to the missing data point sequence from the local cache; The extracted missing data is encapsulated and reported to the main station.
[0061] First, the data acquisition terminal parses the precise supplementary reporting notification instruction and extracts the missing data point sequence. Parsing refers to the process by which the acquisition terminal reconstructs each parameter from the received precise supplementary reporting notification instruction binary message according to the message format of the extended communication protocol. The missing data point sequence refers to the list of missing point numbers for each energy meter reconstructed from the defect information field. This list indicates which specific time points of data the terminal needs to extract from its local cache.
[0062] Specifically, after receiving the accurate supplementary reporting notification instruction, the data acquisition terminal first performs an integrity check on the message to confirm that there are no transmission errors. After successful verification, according to the extended communication protocol, the following parameters are extracted from the message sequentially: data time, data item object attribute description, supplementary reporting start time, supplementary reporting end time, number of supplementary reports, and defect information field. The data acquisition terminal divides the defect information field into N units, each 5 bytes long, where N equals the number of supplementary reports. For each fixed-length unit, the data acquisition terminal reads the first two bytes as the measurement point number and the last three bytes as a bit string. The data acquisition terminal iterates through each bit in the bit string; if a bit is 1, it records the corresponding hour period as a missing point; if the bit is 0, it skips it. All recorded missing hour periods are converted into corresponding point numbers, forming the missing data point sequence for the corresponding energy meter. The data acquisition terminal organizes all energy meter measurement point numbers and their missing data point sequences into an internal data structure for use in subsequent steps.
[0063] For example, the first data acquisition terminal T001 receives a precise supplementary reporting notification instruction from the main station side for the 24-point voltage curve and the data date May 18, 2026. After parsing the message, the terminal obtains the defect information field, which contains 5 fixed-length units, each unit being 5 bytes. Taking the first fixed-length unit as an example, its hexadecimal representation is: 0x000x01 0x10 0x70 0x00. The first 2 bytes 0x00 0x01 represent that the measurement point is number 1, corresponding to the first energy meter M001. The last 3 bytes 0x10 0x70 0x00 converted to binary are: 00010000 01110000 00000000. Interpreting the bits from low to high: the 2nd bit is 1, the 8th, 9th, and 10th bits are 1, and the rest are 0. Therefore, the missing data points for the first energy meter M001 are: hour 2, hour 8, hour 9, and hour 10. The terminal records this missing data point sequence as: Measurement point 1 needs to report voltage data for hours 2, 8, 9, and 10 on May 18, 2026. Similarly, the terminal parses the subsequent four fixed-length units sequentially to obtain the missing data point sequences for the second energy meter M002, the third energy meter M003, the fourth energy meter M004, and the fifth energy meter M005, respectively.
[0064] Secondly, based on the sequence of missing data points, the missing data corresponding to the sequence is located and extracted from the local cache. The local cache refers to the storage area within the acquisition terminal used to store the acquired data, typically using Flash memory. During normal daily data acquisition, the terminal writes the acquired electricity meter data sequentially to the local cache according to date, measurement point, data item type, and time point. Location refers to calculating the specific address of the data in the storage medium, such as sector, page, or offset, based on the data date, measurement point number, data item type, and point sequence number. Extraction refers to reading the acquired data value for that point, such as voltage, current, or energy consumption, from the located storage address.
[0065] Specifically, the data acquisition terminal iterates through the generated sequence list of missing data points for all electricity meters. For each record in the list, the terminal locates the data storage area for that electricity meter on that day in its local cache based on the data date and measurement point number. Within this storage area, the terminal calculates the storage offset of the data at that point based on the data item type and point number. Since the data at each point typically occupies a fixed length, the terminal calculates the precise starting address for reading using the following formula: Starting address = Base address + Point number × Single-point data length. The terminal reads a fixed length of binary data from this starting address to obtain the acquired value for that point. For multiple missing points on the same electricity meter, the above location and reading operations are repeated sequentially, and all read data values are temporarily stored in the terminal's memory in order of point number. If, during the location process, it is found that the data for a missing point is not present in the local cache, that point is marked as locally missing and recorded in the exception list; this point will not be reported subsequently.
[0066] For example, the first data acquisition terminal T001 needs to extract voltage data for the 2nd, 8th, 9th, and 10th hours of May 18, 2026, for the first energy meter M001. The first data acquisition terminal T001 first uses the voltage data storage base address of the first measurement point based on the data date May 18, 2026. Each voltage data point occupies 4 bytes. Therefore, the offset of the second point is 2 × 4 = 8 bytes, the actual read address is 0x10008, and 4 bytes are read to obtain a voltage value of 220.5 volts. The offset of the eighth point P8 is 32 bytes, address 0x10020, and 221.3 volts are read. The address of the 9th hour is 0x10024, and 219.8 volts are read. The address of the 10th hour is 0x10028, and 220.1 volts are read. The first data acquisition terminal T001 stores the four voltage values along with the point number into the memory buffer sequentially. For other energy meters such as the second energy meter M002 and the third energy meter M003, the terminal performs the same extraction operation.
[0067] Next, the extracted missing data is encapsulated and reported to the master station. Encapsulation refers to organizing the extracted missing data according to the reporting data format specified by the extended communication protocol, forming an uplink message conforming to the DL / T 698.45 standard message format. This method uses a compact data format for encapsulation, containing only necessary header information, measurement point number, data time, data item type, point sequence number, and corresponding data value. Batch reporting refers to merging data from multiple energy meters and multiple points under the same acquisition terminal into one or more short frame messages and sending them to the master station at once to reduce the number of interactions. The short frame window refers to the maximum allowed length of a single message as specified in the communication protocol. When the length of the encapsulated message exceeds the short frame window size, the terminal needs to split the data into multiple short frames and report them sequentially. Reporting without acknowledgment means that after the terminal reports data, it continues to send the next frame without waiting for acknowledgment from the master station to improve reporting efficiency. However, the master station will perform verification upon receiving the message; if the verification fails, it will notify the terminal to re-report via an error response code.
[0068] Specifically, the acquisition terminal encapsulates all the extracted missing data according to the reporting data format defined in the extended communication protocol. The basic unit of encapsulation is all the missing point data under each data item type for each energy meter. The encapsulated message contains the following fields: terminal identifier, energy meter measurement point number, data date, data item object attribute description, number of missing points, point sequence number list and corresponding data value list. To shorten the message length, the terminal adopts a compact data format: the point sequence number list is represented by continuous interval merging, and the data value list is arranged in order without adding redundant separators. The terminal calculates the length of the encapsulated data in real time during the encapsulation process. When the cumulative length approaches the size of the short frame window, the terminal outputs the currently encapsulated data as a message frame and clears the buffer to continue encapsulating the remaining data. After all message frames are generated, the terminal sends each message frame to the master station through the communication channel in sequence according to the principle of reporting without acknowledgment. During the transmission process, it does not wait for the master station's acknowledgment response and directly sends the next frame. After the terminal completes the transmission of all message frames, it may optionally send a supplementary report completion notification to the master station, informing the master station of the total number of data messages sent in this supplementary report.
[0069] For example, the missing voltage data that the first data acquisition terminal T001 needs to report for the first energy meter M001 includes: hour 2 (220.5V), hour 8 (221.3V), hour 9 (219.8V), and hour 10 (220.1V). The terminal encapsulates the data in a compact data format: First data acquisition terminal identifier: T001; First measurement point number: 1; Data date: May 18, 2026; Data item object attribute description: Voltage 24-point curve; Number of missing points: 4; Point sequence number list: [P2, P8-P10]; List of missing voltage data values: [220.5, 221.3, 219.8, 220.1]. The above information is encoded into a binary message, assuming a length of 80 bytes, which does not exceed the short frame window size, and therefore is sent directly as a message frame. For the missing data of the second energy meter M002 to the fifth energy meter M005, the terminal encapsulates them into independent message frames respectively. After all message frames are generated, the terminal sends them sequentially to the master station. After sending each frame, it immediately sends the next frame without waiting for confirmation. After transmission is complete, the terminal records a transmission log, including information such as transmission time, number of message frames, and number of data entries.
[0070] In this embodiment of the invention, the data acquisition terminal first parses the precise supplementary reporting notification instruction, extracting the measurement point number and the sequence of missing data points for each electricity meter from the defect information field. Then, based on this sequence, it precisely locates and extracts only the data values corresponding to the missing points in the local Flash cache. Finally, it encapsulates the data using a compact data format and splits it according to a short frame window limit, sending it in batches to the master station in a no-confirmation reporting manner. This method allows the terminal to report only the truly missing data points from the master station, avoiding the overhead of storage, reading, encapsulation, and transmission caused by repeatedly reporting collected data in the traditional method, thus improving supplementary reporting efficiency and reducing terminal resource consumption. Simultaneously, the batch reporting and no-confirmation mechanism reduce the number of interactions, further shortening the supplementary reporting completion time.
[0071] S500: After receiving the missing data, the master station performs a comparison and verification based on the locally maintained missing data status information. After the verification is successful, the missing data is reported and the missing data flag is updated.
[0072] After the terminals report missing data in batches, the master station needs to verify the received data to confirm that the reported data matches the missing data status recorded locally. This prevents data inconsistencies caused by communication errors, terminal cache abnormalities, or malicious reporting. To this end, in this step, the master station uses the missing data status information maintained in real-time in the in-memory database to compare and verify each missing data reported by the terminals. This ensures that only truly missing data points with valid data are accepted and persistently stored. Simultaneously, the missing data marker is updated in real-time to provide accurate missing data status information for subsequent supplementary reporting. In cases of verification failure, an error response code triggers the terminal re-reporting mechanism, and after multiple failures, an operation and maintenance alarm is triggered, thereby ensuring the integrity and reliability of the supplementary data reporting.
[0073] Step S500 in the method provided in this embodiment of the invention includes: After receiving the missing data reported by the acquisition terminal, the main station compares and verifies the missing data reported by the acquisition terminal based on the missing data status information maintained locally. If the verification passes, the missing data reported by the acquisition terminal is stored in the relational database, and the missing data point markers in the memory database are updated. If the verification fails, an error response code is returned to the acquisition terminal, and a re-reporting mechanism is triggered.
[0074] First, after receiving the missing data reported by the acquisition terminal, the master station compares and verifies the reported missing data against the locally maintained missing data status information. The locally maintained missing data status information refers to the missing data markers for each electricity meter, each data date, and each curve data point stored in the master station's memory database in bitmap form; a bit of 1 indicates missing data collection, and a bit of 0 indicates data collection has occurred. The comparison and verification involves checking the consistency of the electricity meter identifier, data date, and point number in the reported missing data with the missing data markers in the memory database and verifying the validity of the data values.
[0075] Specifically, the master station consumes missing data packets reported by the acquisition terminals from the message queue topic through the data storage service. For each missing data record, the master station extracts the electricity meter identifier, data date, data item type, and location number from the record. Using the electricity meter identifier, data date, and data item type as keys, the master station searches for the corresponding missing data bitmap in the memory database. It then reads the value of the bit corresponding to the location number from the bitmap. If the value of this bit is 1, and the reported data value is within a preset valid range (e.g., voltage between 0 and 380 volts), the verification is considered successful. If the value of this bit is 0, it indicates successful acquisition and should not be reported again; or if the reported data value exceeds the valid range, has an incorrect format, or is empty, the verification is considered unsuccessful. The master station performs the above comparison and verification on each reported missing data record and records the verification result for each data record, including whether it passed or failed.
[0076] For example, the master station receives a report from the first data acquisition terminal T001 regarding missing voltage data for the first energy meter M001. The data includes: energy meter identifier M001, data date May 18, 2026, location number P2, and data value 220.5 volts. The master station searches for the bitmap with the key M001:20260518:VOLTAGE_24 in the Redis in-memory database and reads the second bit. Assuming this bit is currently 1, and the voltage value of 220.5 volts is within the valid range of 0 to 380 volts, the verification is considered successful. If the same terminal reports another data value for the second location P2 of the first energy meter M001, since the second location P2 in the in-memory database has been updated to 0 after the first report, the bit read during the second verification will be 0, thus the verification is considered unsuccessful. If the reported data value is NULL or exceeds 380 volts, the verification is also considered unsuccessful.
[0077] If the verification passes, the missing data reported by the acquisition terminal is stored in the relational database, and the missing acquisition point markers in the memory database are updated.
[0078] If the verification passes, the missing data reported by the acquisition terminal is stored in a relational database, and the missing data point markers in the in-memory database are updated, including: If the verification passes, the electricity meter identifier, data timestamp, data item type and data value in the missing data reported by the acquisition terminal will be stored in a relational database for access by business applications. Update the missing data markers for the electricity meter, data date, and data point in the memory database to the collected status.
[0079] First, if the verification passes, the meter identifier, data timestamp, data item type, and data value from the missing data reported by the data acquisition terminal are stored in a relational database for access by business applications. A relational database is a database that uses a tabular structure to store data and supports Structured Query Language (SQL). It is used to persistently store the collected electricity consumption data for access by business applications. The data timestamp refers to the specific point in time corresponding to the missing data. For a 24-point curve, the data timestamp is the hour of the current day, such as 02:00:00.
[0080] Specifically, for each missing data entry that passes verification, the master station constructs a relational database insert statement. This statement includes the following fields: meter identifier, data date, data timestamp, data item type, and data value. The master station executes this insert statement, writing the data into the corresponding data table in the relational database. After writing, the data is available for querying and analysis by upper-layer business applications. If multiple data entries belong to the same meter, the same day, and the same data item type, batch inserts can be used to improve writing efficiency. For example, if the voltage missing data for the first meter M001 passes verification, the master station constructs an SQL statement, executes it, and stores the data in the relational database.
[0081] Secondly, the missing data markers for the electricity meter, data date, and data point in the in-memory database are updated to the collected status. Updating the missing data marker refers to changing the bit value of the corresponding point in the bitmap of the in-memory database from 1 to 0. This update ensures that the missing data status in the in-memory database is consistent with the actual stored data in the relational database, avoiding duplicate reporting. Atomicity means that the update operation is executed as an indivisible unit, guaranteeing that partial updates will not occur in a concurrent environment.
[0082] Specifically, after the main station passes the verification and completes the write to the relational database, it immediately performs an update operation on the corresponding missing bitmap in the in-memory database. Using the meter identifier, data date, and data item type as keys, the corresponding bitmap is located. The bit corresponding to the position number in that bitmap is atomically changed from 1 to 0. After the update, the position in the in-memory database becomes "sampled". When precise supplementary reporting is triggered again subsequently, this position will no longer be extracted as missing information. This update operation and the relational database write can use a transaction mechanism to ensure consistency, meaning both can succeed or fail simultaneously. However, in this method, since the relational database and the in-memory database are different storage systems, the order of writing to the relational database first and then updating the in-memory database is adopted, and an operation log is recorded for rollback in case of anomalies.
[0083] For example, after the master station stores the voltage data of the first energy meter M001 into the relational database, it performs a bitmap update operation in the Redis in-memory database: the bit of the second point of the key M001:20260518:VOLTAGE_24 is changed from 1 to 0. After the operation is completed, the second point of the bitmap becomes 0, indicating that the voltage data for the second hour of May 18, 2026 has been successfully collected. If a precise supplementary report is triggered again in the future, this point will not be included in the missing data point sequence.
[0084] If the verification fails, an error response code is returned to the acquisition terminal, and a re-reporting mechanism is triggered.
[0085] If the verification fails, an error response code is returned to the data acquisition terminal, and a re-reporting mechanism is triggered, including: The master station returns a preset error response code to the acquisition terminal, indicating that there is a problem with the missing data reported by the acquisition terminal; After receiving the error response code, the data acquisition terminal resends the corresponding missing data. If the verification still fails after resubmission, a resubmission failure log will be recorded and an operation and maintenance alarm will be triggered.
[0086] First, the master station returns a preset error response code to the acquisition terminal, indicating that there is a problem with the missing data reported by the acquisition terminal. The error response code is a code defined by the master station to identify different error types; for example, "0x01" indicates an incorrect message format, "0x02" indicates an invalid data value, and "0x03" indicates a mismatch between the reported location and the missing data status. The acquisition terminal executes corresponding processing logic based on the different error response codes. The preset error response codes refer to the values and meanings of the error response codes being pre-agreed upon between the master station and the acquisition terminal and written into their respective protocol specifications.
[0087] Specifically, when the master station verifies a missing data entry or batch, if the verification fails, it generates a corresponding error response code based on the specific reason for the failure. The master station encapsulates this error response code into a short response message and sends it to the corresponding data acquisition terminal through the front-end communication channel. After transmission, the master station logs the verification failure, including the terminal identifier, energy meter identifier, data date, point sequence number, reason for failure, and the returned error response code.
[0088] For example, if the first data acquisition terminal T001 reports the voltage data of the second point P2 of the first energy meter M001, and the master station finds that the bit of the second point P2 is already 0 in the memory database, then the verification is deemed to have failed because the reported point does not match the missing data status. The master station generates an error response code 0x03 and encapsulates it into a response message to send to the first data acquisition terminal T001.
[0089] Secondly, after receiving the error response code, the acquisition terminal retransmits the corresponding missing data. Retransmission means that the acquisition terminal, based on the received error response code, reads the missing data for the corresponding location from its local cache again, repackages it according to the same reporting format, and sends it to the main station. The retransmission mechanism means that the acquisition terminal retransmits the data that failed verification a limited number of times until it receives a successful verification or reaches the maximum number of retries.
[0090] Specifically, after receiving the error response code from the master station, the data acquisition terminal parses the code to determine the cause of the failure. If the error response code indicates a retryable type, such as a network transmission error or invalid data value possibly caused by a momentary fault, the data acquisition terminal retrieves the missing data corresponding to the electricity meter, data date, and location number from its local cache and repackages it into a reporting message according to the encapsulation format. The data acquisition terminal then resends this message to the master station and waits for the next verification result. The data acquisition terminal internally maintains a retry counter for each missing data point, incrementing the counter by 1 with each retry. If the number of retries reaches the preset maximum number of retries, for example, if verification fails after 3 attempts, retries stop, the point is marked as a failed supplementary report, and a record is made in the local log.
[0091] For example, the first acquisition terminal T001 receives an error response code 0x03 returned by the master station. After parsing it, the terminal determines that the error cannot be retried because it has already been marked as acquired in the memory database, indicating that the data already exists and does not need to be reported again. Therefore, the terminal does not resend the data, but records the local log "M001-20260518-Failed to report point 2, reason: already exists on the master station side". If the error response code is 0x02, the data value is invalid, such as a voltage value that is empty. The terminal assumes that there may be a momentary error in reading the local cache, so it rereads the point data from the Flash and reports it again.
[0092] Finally, if the verification still fails after resubmission, a resubmission failure log is recorded and an operation and maintenance alarm is triggered. The resubmission failure log is a record containing detailed information about the resubmission failure, including terminal identifier, electricity meter identifier, data date, location number, data value, reason for failure, number of retries, and timestamp. This log is used by operation and maintenance personnel to troubleshoot problems. The operation and maintenance alarm is triggered when data resubmission fails after multiple retries; the main station automatically sends an alarm message to the operation and maintenance monitoring platform to remind operation and maintenance personnel to intervene. Alarm methods can include SMS, email, and monitoring system pop-ups.
[0093] Specifically, the master station performs a second comparison and verification after the data acquisition terminal re-reports. If the second verification still fails, the master station determines that the re-reporting of that data point has failed. The master station writes detailed information about this re-reporting failure into the re-reporting failure log table. Simultaneously, the master station generates maintenance alarm information according to preset alarm rules. The alarm information includes the terminal identifier, the number of failed data points, and a summary of the failure reason. The master station sends the information to the maintenance monitoring platform through the alarm interface, and the platform notifies maintenance personnel to handle the issue, such as checking the terminal communication status, meter operating status, and local cache integrity. After reaching the maximum number of retries, the data acquisition terminal also records a local re-reporting failure log and can proactively report alarm information to the master station.
[0094] For example, suppose the voltage data of the second point P2 of the first energy meter M001 reported by the first data acquisition terminal T001 is invalid (0x02), triggering a re-report. The terminal re-reports an invalid value the first time, the second time, and the third time. After the third re-retry, the verification by the master station still fails. The master station records the re-reporting failure log: First data acquisition terminal T001, first energy meter M001, May 18, 2026, second point P2, failure reason: invalid data value, 3 retry attempts. At the same time, the master station detects that the first data acquisition terminal T001 has had 10 data point re-reporting failures on that day, exceeding the threshold of 5, and generates an alarm message: "The re-reporting failure rate of the first data acquisition terminal T001 is too high. Please check the terminal and the status of the connected meters," and sends it to the operation and maintenance monitoring platform. After receiving the alarm, the operation and maintenance personnel perform remote diagnosis or on-site troubleshooting on the terminal.
[0095] In this embodiment of the invention, the master station utilizes the missing data status information maintained in real-time in the in-memory database to accurately compare and verify the missing data reported by the acquisition terminals, ensuring that only points with truly missing data and valid data are accepted. Data that passes verification is simultaneously stored in a relational database and the missing data marker in the in-memory database, forming a consistent closed loop of dual storage. For cases where verification fails, the master station returns an error response code to trigger the terminal's re-reporting mechanism. After multiple failures, logs are recorded and maintenance alarms are triggered, ensuring the final integrity and traceability of the supplementary data report. This method effectively avoids duplicate data entry and erroneous updates to the missing data status, providing a highly reliable data supplementation guarantee for the electricity information acquisition system.
[0096] Through the specific implementation methods described above, the embodiments of the present invention achieve the following technical effects: This invention provides a method and system for accurate electricity consumption data supplementation reporting. It maintains the missing data status in real time through a master station's in-memory database. When supplementation reporting is triggered, the system extracts only the missing data points and generates a sequence of missing data points, using the data collection terminal as the smallest unit. Based on an extended communication protocol, the sequence of points is compactly encapsulated into a precise supplementation reporting notification instruction and sent to the terminal. After parsing the instruction, the terminal extracts the corresponding missing data from its local cache and reports it in batches. The master station receives the notification and compares it with its local missing data status for verification. If the verification is successful, the missing data is added to the database and the missing data marker is updated. This method achieves accurate location and on-demand reporting of missing data points, avoiding the repetitive data transmission and processing caused by reporting complete time periods in traditional methods. It shortens the supplementation reporting time for a single electricity meter and all electricity meters under a single terminal, reduces communication bandwidth usage and the daily data processing volume of the master station, effectively improves data supplementation reporting efficiency, reduces end-to-end resource consumption, and provides a reliable guarantee for the integrity and timeliness of electricity consumption information collection.
[0097] Example 2, as Figure 4 As shown, the present invention provides a system for accurate supplementary reporting of electricity consumption data, the system comprising: The missing data recording module 11 is used by the main station to dynamically initialize and record the missing data information of the curve data of each electricity meter based on the in-memory database. The missing data point generation module 12 is used to generate the missing data point sequence for each electricity meter by extracting only the missing data point information from the memory database, with a single data acquisition terminal as the smallest unit, when precise supplementary reporting is triggered. The supplementary reporting instruction issuing module 13 is used by the main station to generate a precise supplementary reporting notification instruction carrying only the missing data point information according to the missing data point sequence through an extended communication protocol for precise supplementary reporting, and to issue it to the acquisition terminal. The missing data reporting module 14 is used by the acquisition terminal to extract the missing data point sequence according to the precise supplementary reporting notification instruction, extract only the missing data corresponding to the missing data point sequence from the local cache and report it to the main station in batches; The missing data verification and update module 15 is used to compare and verify the missing data based on the locally maintained missing data status information after the main station receives the missing data. After the verification is passed, the missing data is reported and the missing data mark is updated.
[0098] In one embodiment, the missing data recording module 11 is further configured to: On a daily basis, initialize all points of the curve data for each electricity meter in the memory database; Mark all initialized points as missing data; Based on the successfully acquired curve data in real time, the corresponding points of the electricity meters in the memory database are filled with markings to dynamically update the missing data point information for each electricity meter.
[0099] In one embodiment, the missing point sequence generation module 12 is further configured to: The triggering of precise supplementary reporting can be achieved in any of the following ways: timed triggering by the main station, manual triggering, or triggering by a data collection failure event. Using the data acquisition terminal, electricity meter, and data date as indexes, extract the missing curve data information of all electricity meters under a single data acquisition terminal from the memory database; The missing data information of the curve data is used to generate a missing data point sequence in a format that includes the electricity meter identifier, data date, and a list of missing point numbers.
[0100] In one embodiment, the supplementary reporting instruction issuing module 13 is further configured to: According to the extended communication protocol of the electricity information collection system, the missing data points are sequentially encapsulated into the message of the precise supplementary reporting notification instruction; The precise supplementary reporting notification instruction is sent to the corresponding data collection terminal through the front-end layer.
[0101] Specifically, encapsulating the missing data points into a precise supplementary reporting notification message includes: Using a bit string data type, missing data points for each electricity meter are marked on an hourly basis. Each bit corresponds to a data point within a preset time period. A bit of 1 indicates that the data for the corresponding time period is missing, and a bit of 0 indicates that the data for the corresponding time period has been collected. The measurement point number of each energy meter is combined with the bit string into a fixed-length unit, which includes a first segment for storing the measurement point number and a second segment for storing the bit string. The fixed-length units corresponding to all energy meters under the same precise supplementary reporting notification instruction are sequentially spliced together to form the defect information field; The defect information field, along with the data time, data item object attribute description, supplementary reporting start time, supplementary reporting end time, and the number of supplementary reports in this instance, are encapsulated together in the message of the precise supplementary reporting notification instruction.
[0102] In one embodiment, the missing data reporting module 14 is further configured to: The data acquisition terminal parses the precise supplementary reporting notification instruction and extracts the sequence of the missing data points; Based on the missing data point sequence, locate and extract the missing data corresponding to the missing data point sequence from the local cache; The extracted missing data is encapsulated and reported to the main station.
[0103] In one embodiment, the missing sample verification and update module 15 is further configured to: After receiving the missing data reported by the acquisition terminal, the main station compares and verifies the missing data reported by the acquisition terminal based on the missing data status information maintained locally. If the verification passes, the missing data reported by the acquisition terminal is stored in the relational database, and the missing data point markers in the memory database are updated. If the verification fails, an error response code is returned to the acquisition terminal, and a re-reporting mechanism is triggered.
[0104] If the verification passes, the missing data reported by the acquisition terminal is stored in a relational database, and the missing data point markers in the in-memory database are updated, including: If the verification passes, the electricity meter identifier, data timestamp, data item type and data value in the missing data reported by the acquisition terminal will be stored in a relational database for access by business applications. Update the missing data markers for the electricity meter, data date, and data point in the memory database to the collected status.
[0105] If the verification fails, an error response code is returned to the data acquisition terminal, and a re-reporting mechanism is triggered, including: The master station returns a preset error response code to the acquisition terminal, indicating that there is a problem with the missing data reported by the acquisition terminal; After receiving the error response code, the data acquisition terminal resends the corresponding missing data. If the verification still fails after resubmission, a resubmission failure log will be recorded and an operation and maintenance alarm will be triggered.
[0106] It should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for accurately supplementing electricity consumption data, characterized in that, include: The main station uses an in-memory database to dynamically initialize and record the missing curve data information for each electricity meter. When precise supplementary reporting is triggered, the main station side uses a single data acquisition terminal as the smallest unit to extract only the missing data point information from the memory database and generate the missing data point sequence for each electricity meter. The main station generates a precise supplementary reporting notification instruction carrying only the missing data point information based on the missing data point sequence through an extended communication protocol for precise supplementary reporting, and sends it to the data acquisition terminal. According to the precise supplementary reporting notification instruction, the data acquisition terminal extracts the missing data point sequence, extracts only the missing data corresponding to the missing data point sequence from the local cache, and reports it to the main station in batches. After receiving the missing data, the main station compares and verifies it based on the locally maintained missing data status information. Once the verification is successful, it completes the supplementary reporting and updates the missing data marker.
2. The method for accurately supplementing electricity consumption data as described in claim 1, characterized in that, The main station uses an in-memory database to dynamically initialize and record missing curve data information for each electricity meter, including: On a daily basis, initialize all points of the curve data for each electricity meter in the memory database; Mark all initialized points as missing data; Based on the successfully acquired curve data in real time, the corresponding points of the electricity meters in the memory database are filled with markings to dynamically update the missing data point information for each electricity meter.
3. The method for accurately supplementing electricity consumption data as described in claim 1, characterized in that, When precise supplementary reporting is triggered, the main station, using a single data acquisition terminal as the smallest unit, extracts only the missing data point information from the memory database to generate the missing data point sequence for each electricity meter, including: The triggering of precise supplementary reporting can be achieved in any of the following ways: timed triggering by the main station, manual triggering, or triggering by a data collection failure event. Using the data acquisition terminal, electricity meter, and data date as indexes, extract the missing curve data information of all electricity meters under a single data acquisition terminal from the memory database; The missing data information of the curve data is used to generate a missing data point sequence in a format that includes the electricity meter identifier, data date, and a list of missing point numbers.
4. The method for accurately supplementing electricity consumption data as described in claim 1, characterized in that, The main station, based on the sequence of the missing data points, generates a precise supplementary reporting notification instruction carrying only the missing data point information through an extended communication protocol for precise supplementary reporting, and sends it to the data acquisition terminal, including: According to the extended communication protocol of the electricity information collection system, the missing data points are sequentially encapsulated into the message of the precise supplementary reporting notification instruction; The precise supplementary reporting notification instruction is sent to the corresponding data collection terminal through the front-end layer.
5. The method for accurately supplementing electricity consumption data as described in claim 4, characterized in that, The missing data points are encapsulated into a message of a precise supplementary reporting notification instruction, including: Using a bit string data type, missing data points for each electricity meter are marked on an hourly basis. Each bit corresponds to a data point within a preset time period. A bit of 1 indicates that the data for the corresponding time period is missing, and a bit of 0 indicates that the data for the corresponding time period has been collected. The measurement point number of each energy meter is combined with the bit string into a fixed-length unit, which includes a first segment for storing the measurement point number and a second segment for storing the bit string. The fixed-length units corresponding to all energy meters under the same precise supplementary reporting notification instruction are sequentially spliced together to form the defect information field; The defect information field, along with the data time, data item object attribute description, supplementary reporting start time, supplementary reporting end time, and the number of supplementary reports in this instance, are encapsulated together in the message of the precise supplementary reporting notification instruction.
6. The method for accurately supplementing electricity consumption data as described in claim 1, characterized in that, The data acquisition terminal, according to the precise supplementary reporting notification instruction, extracts the missing data point sequence, retrieves only the missing data corresponding to the missing data point sequence from the local cache, and reports it in batches to the main station, including: The data acquisition terminal parses the precise supplementary reporting notification instruction and extracts the sequence of the missing data points; Based on the missing data point sequence, locate and extract the missing data corresponding to the missing data point sequence from the local cache; The extracted missing data is encapsulated and reported to the main station.
7. The method for accurately supplementing electricity consumption data as described in claim 1, characterized in that, After receiving the missing data, the main station performs a comparison and verification based on the locally maintained missing data status information. Upon successful verification, it completes the supplementary reporting and updates the missing data marker, including: After receiving the missing data reported by the acquisition terminal, the main station compares and verifies the missing data reported by the acquisition terminal based on the missing data status information maintained locally. If the verification passes, the missing data reported by the acquisition terminal is stored in the relational database, and the missing data point markers in the memory database are updated. If the verification fails, an error response code is returned to the acquisition terminal, and a re-reporting mechanism is triggered.
8. The method for accurately supplementing electricity consumption data as described in claim 7, characterized in that, If the verification passes, the missing data reported by the acquisition terminal is stored in a relational database, and the missing data point markers in the in-memory database are updated, including: If the verification passes, the electricity meter identifier, data timestamp, data item type and data value in the missing data reported by the acquisition terminal will be stored in a relational database for access by business applications. Update the missing data markers for the electricity meter, data date, and data point in the memory database to the collected status.
9. The method for accurately supplementing electricity consumption data as described in claim 7, characterized in that, If the verification fails, an error response code is returned to the data acquisition terminal, and a re-reporting mechanism is triggered, including: The master station returns a preset error response code to the acquisition terminal, indicating that there is a problem with the missing data reported by the acquisition terminal; After receiving the error response code, the data acquisition terminal resends the corresponding missing data. If the verification still fails after resubmission, a resubmission failure log will be recorded and an operation and maintenance alarm will be triggered.
10. A precise electricity consumption data reporting system, characterized in that, A method for accurately supplementing electricity consumption data according to any one of claims 1-9 includes: The missing data recording module is used by the main station to dynamically initialize and record the missing data information of the curve data of each electricity meter based on the in-memory database. The missing data point generation module is used to generate the missing data point sequence for each electricity meter by extracting only the missing data point information from the memory database, using a single data acquisition terminal as the smallest unit, when precise supplementary reporting is triggered. The supplementary reporting instruction issuance module is used by the main station to generate a precise supplementary reporting notification instruction carrying only the missing data point information according to the missing data point sequence, through an extended communication protocol for precise supplementary reporting, and to issue it to the acquisition terminal. The missing data reporting module is used by the acquisition terminal to extract the missing data point sequence according to the precise supplementary reporting notification instruction, extract only the missing data corresponding to the missing data point sequence from the local cache, and report it to the main station in batches. The missing data verification and update module is used to compare and verify the missing data based on the locally maintained missing data status information after the main station receives the missing data. After the verification is successful, the missing data is reported and the missing data mark is updated.