An edge gateway-based power consumption monitoring data breakpoint continuation method and system

CN122554397APending Publication Date: 2026-08-11STATE GRID TIANJIN ELECTRIC POWER COMPANY +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-14
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

现有技术中,网关因解码资源有限且通常串行处理,若某一监测终端持续发送大载荷数据包,易导致该网关解码能力被长时间独占,致使其他监测终端的数据包确认超时

Benefits of technology

本发明通过边缘网关维护解码余量值,基于链路质量与数据包有效载荷计算解码消耗值,并在解码消耗值大于余量值时将数据包存入待解码缓存队列,依据到达时间与数据包性质进行差异化调度;同时基于缓存队列载荷总和动态调整余量恢复速度,在等待超时后对实时数据包执行丢弃、对非实时数据包执行强制解码。由此,在网关解码资源受限场景下有效抑制了因响应延迟引发的监测终端链路超时与不必要的数据重传,平滑了多终端并发接入时的解码负载波动,提升了系统吞吐稳定性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122554397A_ABST
    Figure CN122554397A_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for resuming interrupted transmission of power consumption monitoring data based on an edge gateway. The method, executed by the edge gateway, includes: maintaining a decoding margin value for the monitoring terminal; receiving a first data packet sent by the monitoring terminal; reading the header information of the first data packet to obtain its payload size; calculating a decoding consumption value corresponding to the first data packet based on the link quality between the monitoring terminal and the edge gateway and the payload size; comparing the decoding consumption value with the decoding margin value; and processing the first data packet based on the comparison result. This invention smooths out decoding load fluctuations during concurrent access by multiple terminals and improves system throughput stability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electricity consumption monitoring technology, and in particular to a method and system for resuming interrupted data transmission of electricity consumption monitoring based on an edge gateway. Background Technology

[0002] Current power grid digitalization systems require the following functionalities: While meeting the needs of user scale monitoring and power consumption monitoring in terms of data operation and monitoring, the system urgently needs to improve its ability to ensure the integrity and timeliness of massive, high-frequency monitoring data during the deepening of inter-provincial spot market transactions. Specifically, the basic data management module requires data access monitoring, which needs to monitor the timeliness and response time of data access and scheduling operations for historical data on inter-provincial spot market transactions, power grid structure, power purchase paths, and channel capacity nationwide, and determine whether user tasks and operations are running normally. Simultaneously, a data quality evaluation mechanism should be constructed, evaluating data from three dimensions: timeliness, completeness, and utilization rate. A data access alarm function should also be included, statistically analyzing the quantity and quality of accessed data, and automatically reminding users to supplement data collection when too many null or zero values ​​are found.

[0003] In practical power monitoring scenarios, edge gateways need to concurrently process massive amounts of data and channel status data reported by multiple monitoring terminals. In existing technologies, gateways have limited decoding resources and typically process data serially. If a monitoring terminal continuously sends large payload data packets, the gateway's decoding capabilities can be monopolized for an extended period, causing data packet acknowledgments from other monitoring terminals to time out. At this point, monitoring terminals that haven't received decoding acknowledgments will misjudge a link interruption and frequently initiate unnecessary retransmissions based on existing breakpoint resumption mechanisms, further exacerbating link congestion and data access alarms.

[0004] Therefore, it is necessary to optimize the existing breakpoint resume triggering mechanism and suppress invalid breakpoint retransmission behavior from the root by actively scheduling resources and managing queues on the gateway side. Summary of the Invention

[0005] The purpose of this invention is to provide a method and system for resuming interrupted power consumption monitoring data based on an edge gateway, so as to effectively suppress invalid interrupted retransmission behavior.

[0006] To achieve the objectives of this invention, the technical solution provided by this invention is as follows: First aspect This invention provides a method for resuming interrupted power consumption monitoring data transmission based on an edge gateway. The method is executed by the edge gateway and includes the following steps: Step 1: Maintain the decoding margin value for the monitoring terminal; Step 2: Receive the first data packet sent by the monitoring terminal; Step 3: Read the header information of the first data packet to obtain the effective payload size of the first data packet; Step 4: Based on the link quality between the monitoring terminal and the edge gateway and the payload size, calculate the decoding consumption value corresponding to the first data packet; Step 5: Compare the decoding consumption value with the decoding margin value to obtain the comparison result; Step 6: Based on the comparison result, process the first data packet according to a first preset rule; the first preset rule is as follows: If the decoding cost is less than or equal to the decoding margin, directly decode the payload of the first data packet and update the decoding margin. If the decoding consumption value is greater than the decoding margin value, decoding will not be performed for the time being. The first data packet will be stored in the waiting-to-decode buffer queue of the corresponding monitoring terminal and the relevant information of the data packet will be recorded.

[0007] Furthermore, when the decoding consumption value is less than or equal to the decoding margin value, and after decoding is completed and the decoding margin value is updated, the method further includes: increasing the updated decoding margin value by the base recovery speed.

[0008] Furthermore, the data packet related information includes the arrival time of the first data packet, the data packet nature, the payload size, and the corresponding decoding consumption value.

[0009] Furthermore, the method also includes the following steps: Calculate the total payload size of all undecoded data packets in the undecoded buffer queue; The base recovery rate is updated based on the sum of the payload sizes to obtain the actual recovery rate. Increase the decoding margin value based on the actual recovery speed.

[0010] Furthermore, the basic recovery speed is updated based on the sum of the payload sizes to obtain the actual recovery speed, according to the following specific rules: If the total payload size is ≤1024 bytes: maintain the basic recovery speed unchanged; If 1024 bytes < total payload size ≤ 2048 bytes: increase recovery speed, actual recovery speed = base recovery speed + N1, where N1 is the first preset increase value; If 2048 bytes < total payload size ≤ 4096 bytes: further increase the recovery speed. Actual recovery speed = base recovery speed + N2, where N2 is the second preset increase value and N2 > N1. If the total effective payload size is greater than 4096 bytes: adjust to the highest recovery speed. The actual recovery speed = the basic recovery speed + N3, where N3 is the third preset increment value and N3 > N2.

[0011] Furthermore, the method also includes a dequeue processing step for the cache queue: Identify the second data packet with the earliest arrival time in the buffer queue to be decoded; Determine whether the decoding cost of the second data packet is greater than the decoding margin after the actual recovery speed improvement; If the decoding cost of the second data packet is less than or equal to the increased decoding margin, then a decoding operation is performed on the payload portion of the second data packet.

[0012] Furthermore, the method also includes a timeout handling step for the first data packet in the decryption buffer queue: The waiting time for the first data packet is determined based on the arrival time of the first data packet; Determine whether the waiting time is greater than the waiting time threshold; If the waiting time is greater than the waiting time threshold, the data packet nature of the first data packet is identified; If the first data packet is a real-time data packet, then discard the first data packet; If the first data packet is a non-real-time data packet, then without considering the decoding margin value, the decoding operation is performed on the payload portion of the first data packet.

[0013] Second aspect This application provides a power consumption monitoring data breakpoint resumption system based on an edge gateway, used to execute the aforementioned power consumption monitoring data breakpoint resumption method based on an edge gateway, including: The decoding margin value maintenance module is used to maintain the decoding margin value for the monitoring terminal. The first data packet receiving module is used to receive the first data packet sent by the monitoring terminal; The first data packet reading module is used to read the header information of the first data packet to obtain the effective payload size of the first data packet; The decoding consumption value calculation module is used to calculate the decoding consumption value corresponding to the first data packet based on the link quality between the monitoring terminal and the edge gateway and the payload size. The comparison module is used to compare the decoding consumption value with the decoding margin value to obtain a comparison result; The rule processing module is used to process the first data packet according to a first preset rule based on the comparison result; the first preset rule is as follows: If the decoding cost is less than or equal to the decoding margin, directly decode the payload of the first data packet and update the decoding margin. If the decoding consumption value is greater than the decoding margin value, decoding will not be performed for the time being. The first data packet will be stored in the waiting-to-decode buffer queue of the corresponding monitoring terminal and the relevant information of the data packet will be recorded.

[0014] Furthermore, it also includes a basic recovery speed enhancement module; when the decoding consumption value is less than or equal to the decoding margin value, and after decoding is completed and the decoding margin value is updated, the basic recovery speed enhancement module is used to enhance the updated decoding margin value with the basic recovery speed.

[0015] Furthermore, the data packet related information includes the arrival time of the first data packet, the data packet nature, the payload size, and the corresponding decoding consumption value.

[0016] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention maintains a decoding margin value at the edge gateway, calculates the decoding consumption value based on link quality and packet payload, and stores packets in a waiting-to-decode buffer queue when the decoding consumption value exceeds the margin value. Differential scheduling is performed based on arrival time and packet characteristics. Simultaneously, the margin recovery speed is dynamically adjusted based on the total load of the buffer queue. Real-time packets are discarded after a timeout, while non-real-time packets are forcibly decoded. Therefore, in scenarios with limited gateway decoding resources, this effectively suppresses monitoring terminal link timeouts and unnecessary data retransmissions caused by response delays, smooths decoding load fluctuations during concurrent access by multiple terminals, and improves system throughput stability. Attached Figure Description

[0017] Figure 1 A schematic diagram of the method for resuming interrupted transmission of power consumption monitoring data based on an edge gateway provided in an embodiment of the present invention; Figure 2 This is a schematic diagram illustrating the application scenario of the method in this embodiment of the invention; Figure 2 In the diagram, 111 is the first monitoring terminal, 112 is the edge gateway, and 113 is the second monitoring terminal. Figure 3 This is a schematic diagram of the data structure in an embodiment of the present invention. Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0019] It should be noted that the acquisition of data and collection of information in this application are legal, compliant, or obtained with the consent of the subject of the data collection.

[0020] Figure 1 This is a schematic flowchart of a method for resuming interrupted data transmission of electricity monitoring data based on an edge gateway, provided in an embodiment of the present invention. The method for resuming interrupted data transmission of electricity monitoring data based on an edge gateway provided in this embodiment includes the following steps: Step 1: Maintain the decoding margin value for the monitoring terminal; It should be noted that in this invention, the "decoding margin value" reflects the single-core CPU computing power and memory bandwidth required for the edge gateway to complete processes such as payload full recovery, CRC verification, memory transfer, protocol parsing, business field extraction, and application layer confirmation generation. The "decoding margin value" is a custom value summarized based on background running data and simulation results. For ease of implementation, the "decoding margin value" in this invention is defined as a dimensionless pure numerical value.

[0021] In one embodiment, after the entire system is powered on and initialized, the decoding margin is initialized to 180 points.

[0022] To facilitate a clear description of the specific implementation of this invention, it is subsequently assumed that the method involves three entities, such as... Figure 2 As shown, the three entities are the edge gateway 112, the first monitoring terminal 111, and the second monitoring terminal 113. In one embodiment, the first monitoring terminal 111 is preferably configured as an electricity monitoring node, such as a real-time electricity acquisition terminal installed in a distribution box, branch circuit, or on the side of an important load, for periodically reporting real-time electricity consumption data. The second monitoring terminal 113 is preferably configured as a micro-meteorological monitoring terminal for the site, for collecting and reporting meteorological data related to the site's operating environment, such as temperature, humidity, air pressure, wind speed, wind direction, rainfall, and light intensity. Although the above meteorological data is essentially auxiliary monitoring data, its effective payload is significantly larger than that of real-time electricity consumption data because it can contain multiple sensor fields and continuous data segments within a time window. In a preferred embodiment, the real-time electricity consumption data packet reported by the first monitoring terminal 111 is a small data packet, and its effective payload size can be set to 64 bytes. The 64-byte payload may include, but is not limited to: a 4-byte terminal identifier, an 8-byte sampling timestamp, a 4-byte instantaneous voltage, a 4-byte instantaneous current, a 4-byte active power, a 4-byte reactive power, a 4-byte power factor, an 8-byte cumulative energy consumption, a 4-byte switch status, a 4-byte anomaly flag, and several reserved fields. For ease of air interface transmission, the header of this small data packet can be set to 16 to 24 bytes; in this embodiment, 20 bytes is preferred. In other words, the total length of the entire air interface data packet sent by the first monitoring terminal 111 can be approximately 84 bytes.

[0023] In a preferred embodiment, the meteorological data packet reported by the second monitoring terminal 113 is a large data packet, with a payload size that can be set to 1536 bytes. This 1536-byte payload may contain multiple meteorological subfields and sequence sampling results within a certain time period. For example, it may include: several temperature and humidity sampling points, air pressure sampling points, wind speed and direction sampling points, rainfall sampling points, light intensity sampling points, and short-time curve segments or historical buffer segments composed of these sampling points. Because meteorological data has many fields and may be uploaded in a single package for multiple sampling periods, its payload is typically significantly larger than the aforementioned real-time electricity consumption data packet. The header of this meteorological data packet can also preferably be set to 20 to 24 bytes; in this embodiment, 20 bytes is also acceptable, resulting in a total air interface data packet length of approximately 1556 bytes.

[0024] In one implementation, a corresponding decoding margin value is maintained for each monitoring terminal. That is, a first decoding margin value is maintained for the first monitoring terminal 111, and a second decoding margin value is maintained for the second monitoring terminal 113. In a specific example, the current decoding margin value corresponding to the first monitoring terminal 111 can be 38 points, and the current decoding margin value corresponding to the second monitoring terminal 113 can be 72 points. To prevent the margin value from accumulating indefinitely due to prolonged gateway idleness, this implementation can also set an upper limit value for the margin, for example, setting the upper limit of the decoding margin for a single terminal to 180 points. It is understood that the lower the current decoding margin value corresponding to a monitoring terminal, the more decoding resources of the edge gateway that monitoring terminal previously occupied.

[0025] Step 2: Receive the first data packet sent by the monitoring terminal; Step 3: Read the header information of the first data packet to obtain the effective payload size of the first data packet; In one implementation, the edge gateway 112 first receives the first data packet sent by the monitoring terminal completely over the air interface. Then, the edge gateway 112 reads the header information of the first data packet to obtain fields such as the payload size, terminal identifier, data packet nature, and timestamp. The header information can be set in the MAC layer header. In other words, at this stage, the edge gateway 112 is not required to have completed the business semantic level parsing of the entire payload; it only needs to extract header fields sufficient for scheduling decisions.

[0026] In one implementation, the header may include at least the following fields: terminal identifier field, packet nature field, payload length field, and transmission timestamp field. The data structure of the packet can be found in [reference needed]. Figure 3The data packet nature field is preferably used to distinguish between real-time data packets and non-real-time data packets. The real-time electricity consumption data packets sent by the first monitoring terminal 111 can be marked as real-time data packets; the meteorological data packets sent by the second monitoring terminal 113 can be marked as non-real-time data packets. This is because real-time electricity consumption data typically has strong timeliness, and its engineering value decreases if processing delays are too large; while meteorological data, even if processed after a certain time, usually still has retention value, and therefore can be decoded further when necessary.

[0027] Step 4: Based on the link quality between the monitoring terminal and the edge gateway and the payload size, calculate the decoding consumption value corresponding to the first data packet; In one implementation, when receiving the first data packet, the edge gateway 112 can also generate a link quality characterization result between the monitoring terminal and the edge gateway based on the air interface reception status. Preferably, the edge gateway 112 can determine the link quality based on the signal-to-noise ratio (SNR). In a specific implementation, the link quality can be divided into four levels: "Excellent," "Good," "Medium," and "Poor." Specifically, it can be preferably set as follows: when the SNR is not lower than 18dB, it is judged as "Excellent"; when the SNR is between 12dB and 18dB, it is judged as "Good"; when the SNR is between 7dB and 12dB, it is judged as "Medium"; and when the SNR is lower than 7dB, it is judged as "Poor."

[0028] Of course, those skilled in the art will understand that any other known parameters used to characterize the quality of wireless communication links can also be applied to this invention. In one embodiment, the decoding consumption value is calculated using a method combining payload interval mapping and link quality correction. Specifically, a basic consumption value can be determined first based on the payload size, and then a correction value can be added based on the link quality level to finally obtain the decoding consumption value. The decoding consumption value can be associated with the following: the single-core CPU computing power and memory bandwidth required for the edge gateway to complete the processing of a data packet, such as complete payload recovery, CRC verification, memory transfer, protocol parsing, service field extraction, and application layer confirmation generation.

[0029] In a specific example, the following mapping relationship can be preferably set: when the payload size is in the range of 0 to 128 bytes, the basic consumption value is set to 20 points; when the payload size is in the range of 129 to 512 bytes, the basic consumption value is set to 55 points; when the payload size is in the range of 513 to 1024 bytes, the basic consumption value is set to 100 points; when the payload size is in the range of 1025 to 1536 bytes, the basic consumption value is set to 140 points; when the payload size is greater than 1536 bytes but does not exceed 2048 bytes, the basic consumption value is set to 180 points.

[0030] Correspondingly, the link quality correction value can be preferably set as follows: when the link quality is "excellent", the correction value is 0 points; when the link quality is "good", the correction value is 6 points; when the link quality is "medium", the correction value is 18 points; and when the link quality is "poor", the correction value is 35 points. It should be noted that the decoding consumption value in this invention does not simply correspond to the CPU overhead of the application layer performing semantic parsing of the payload, but rather represents the comprehensive resources occupied by the edge gateway for the overall subsequent processing of data packets, including cache scheduling, state maintenance, duplicate detection, acknowledgment generation, anomaly handling, and payload parsing. Therefore, link quality in this invention is used to characterize the complexity of the communication context in which the data packet exists. When the link quality is poor, the data packet is more likely to be accompanied by additional processing requirements such as duplicate reception, sequence gaps, retransmission association, state updates, and anomaly handling; therefore, the decoding consumption value can be increased accordingly.

[0031] In a more specific example, the real-time power consumption data packet sent by the first monitoring terminal 111 has a payload size of 64 bytes, falling within the range of 0 to 128 bytes, corresponding to a base consumption value of 20 points; the terminal's current link quality is assessed as "good," with a corresponding correction value of 6 points. Therefore, the decoding consumption value corresponding to this first data packet can be determined to be 26 points.

[0032] The meteorological data packet sent by the second monitoring terminal 113 has a payload size of 1536 bytes, falling within the range of 1025 to 1536 bytes, corresponding to a base consumption value of 140 points. The current link quality of this terminal is assessed as "medium," with a corresponding correction value of 18 points. Therefore, the decoding consumption value for this meteorological data packet can be determined to be 158 points.

[0033] Step 5: Compare the decoding consumption value with the decoding margin value to obtain the comparison result; Step 6: Based on the comparison result, process the first data packet according to a first preset rule; the first preset rule is as follows: If the decoding cost is less than or equal to the decoding margin, directly decode the payload of the first data packet and update the decoding margin. If the decoding consumption value is greater than the decoding margin value, decoding will not be performed for the time being. The first data packet will be stored in the waiting-to-decode buffer queue of the corresponding monitoring terminal and the relevant information of the data packet will be recorded.

[0034] Specifically, if the decoding consumption value is less than or equal to the decoding margin value, the decoding operation is performed on the payload portion of the first data packet. In a specific embodiment, assuming that at 08:15:23.520, the first monitoring terminal 111 sends a real-time power consumption data packet to the edge gateway 112, the payload size of which is 64 bytes and the link quality is "good", its decoding consumption value is 26 points. Based on the aforementioned example, the decoding margin value corresponding to the first monitoring terminal 111 at this moment is 38 points. Since 26 points is less than 38 points, the edge gateway 112 determines that the data packet meets the condition for immediately entering the backend decoding process. At this time, the edge gateway 112 can directly perform the decoding operation on the payload portion of the first data packet and complete the subsequent CRC check, field parsing, power consumption extraction, and application layer confirmation generation.

[0035] The decoding margin value is updated based on the decoding consumption value to obtain the updated decoding margin value. In one specific embodiment, after decoding is completed, the edge gateway 112 can update the decoding margin value corresponding to the first monitoring terminal 111 according to the 26-point decoding consumption value. Specifically, after subtracting 26 points from the original 38 points, the updated decoding margin value becomes 12 points.

[0036] The method further includes increasing the updated decoding margin value at a base recovery rate. In one specific embodiment, to avoid the decoding margin value remaining at a low level for an extended period after a single processing step, a base recovery rate can be set. For example, the base recovery rate can be set to "recover 8 points every 20 milliseconds". If the decoding margin value is continuously increased at the base recovery rate, then if 40 milliseconds have elapsed after the small data packet is decoded, its decoding margin value can recover from 12 points to 28 points; if 60 milliseconds have elapsed, it can recover to 36 points; if it continues to recover until a set upper limit is reached, such as 180 points, then further increases will stop.

[0037] In a preferred embodiment, processing the first data packet based on the comparison result of the decoding consumption value and the decoding margin value includes: If the decoding cost is greater than the decoding margin, no decoding operation is performed on the payload portion of the first data packet. In a specific embodiment, assuming that at 08:15:23.480, the second monitoring terminal 113 sends a meteorological data packet to the edge gateway 112, with a payload size of 1536 bytes, a link quality of "medium", and a corresponding decoding cost of 158 points. According to the aforementioned example, the decoding margin of the second monitoring terminal 113 at this moment is only 72 points. Since 158 points is greater than 72 points, the edge gateway 112 determines that the data packet does not currently meet the conditions for entering the backend for complete decoding.

[0038] The first data packet is stored in the decoding buffer queue corresponding to the monitoring terminal, and its arrival time, data packet nature, payload size, and corresponding decoding consumption value are recorded. In one specific embodiment, the edge gateway 112 does not perform backend decoding operations on the payload portion of the first data packet, but instead stores the first data packet in the decoding buffer queue, and records its arrival time, data packet nature, payload size, and corresponding decoding consumption value. Specifically, the following information can be recorded: arrival time is 08:15:23.480; data packet nature is "non-real-time data packet"; payload size is 1536 bytes; decoding consumption value is 158 points. It should be noted that in some embodiments of the present invention, the decoding consumption value of the data packet in the decoding buffer queue can be determined once based on the link quality and payload size measured when the data packet first arrives at the edge gateway, and will not be repeatedly updated thereafter. This configuration avoids the edge gateway from continuously remeasuring link quality and repeatedly calculating decoding costs for cached data packets, thereby reducing processor overhead, memory access overhead, and scheduling control overhead, which is beneficial for improving the overall processing efficiency under a single-core serial architecture. Furthermore, the time data packets spend in the decoding buffer queue is usually short, and the link quality generally does not change significantly during this short period. Therefore, using the initially measured link quality as a representative parameter for subsequent scheduling is consistent with general understanding in the field. Moreover, even in extreme cases where the link quality changes significantly, causing a deviation between the decoding cost and the actual overhead, the edge gateway can still continue processing by incorporating existing wireless communication protocols' timeout confirmation, retransmission requests, buffer continuation, and abnormal retry mechanisms.

[0039] In a preferred embodiment, the method further includes: calculating the sum of the payload sizes of all first data packets to be decoded in the queue to be decoded; The actual recovery speed is obtained by updating the base recovery speed based on the sum of the payload sizes. In one embodiment, when multiple unprocessed data packets accumulate in the decoding buffer queue corresponding to a certain monitoring terminal, the edge gateway 112 can further calculate the sum of the payload sizes of all unprocessed data packets in the decoding buffer queue and update the base recovery speed based on this sum to obtain the actual recovery speed. The purpose of this step is that when a terminal has a continuous accumulation of large data packets to be processed, if its decoding margin is slowly replenished at a fixed base recovery speed, the terminal will be in a state of "decoding consumption value greater than decoding margin value" for a long time, resulting in excessively long data packet retention time in the buffer queue. This not only occupies gateway memory space but may also amplify scheduling jitter due to prolonged unqueued data packets. Through the design of this technical solution, without changing the principle of low consumption and stable scheduling in light-load scenarios, terminals with severe backlogs can obtain faster margin replenishment, thereby accelerating the clearing of the buffer queue and reducing the negative impact of long-term retention of large data packets on the overall responsiveness of the system.

[0040] In one specific implementation, the base recovery rate is updated based on the sum of the payload sizes to obtain the actual recovery rate, and the specific rule is as follows: If the total payload size is ≤1024 bytes: maintain the basic recovery speed unchanged; If 1024 bytes < total payload size ≤ 2048 bytes: increase recovery speed, actual recovery speed = base recovery speed + N1, where N1 is the first preset increase value; If 2048 bytes < total payload size ≤ 4096 bytes: further increase the recovery speed. Actual recovery speed = base recovery speed + N2, where N2 is the second preset increase value and N2 > N1. If the total effective payload size is greater than 4096 bytes: adjust to the highest recovery speed. The actual recovery speed = the basic recovery speed + N3, where N3 is the third preset increment value and N3 > N2.

[0041] Taking the second monitoring terminal 113 as an example, assuming that in addition to the 1536-byte meteorological data packet arriving at 08:15:23.480, its decoding buffer queue also caches two other meteorological-related data packets, one with a payload size of 1024 bytes and the other with a payload size of 768 bytes. The total payload size in the decoding buffer queue is then 3328 bytes. The base recovery speed can be updated using a segmented adjustment method based on this total. In one specific embodiment, if the total payload size in the decoding buffer queue is not higher than 1024 bytes, the base recovery speed remains unchanged at 8 points every 20 milliseconds; if the total is greater than 1024 bytes but not higher than 2048 bytes, the actual recovery speed is increased to 12 points every 20 milliseconds; if the total is greater than 2048 bytes but not higher than 4096 bytes, the actual recovery speed is increased to 16 points every 20 milliseconds; and if the total is greater than 4096 bytes, the actual recovery speed is increased to 20 points every 20 milliseconds. Based on this rule, since the total load of the cache queue to be decoded corresponding to the second monitoring terminal 113 is 3328 bytes, which falls within the range of "greater than 2048 bytes and not higher than 4096 bytes", the recovery speed of its decoding margin value can be increased from the basic recovery speed of 8 points every 20 milliseconds to the actual recovery speed of 16 points every 20 milliseconds.

[0042] Increase the decoding margin value based on the actual recovery speed.

[0043] In a preferred embodiment, the method further includes: Identify the second data packet with the earliest arrival time in the queue to be decoded; it is understood that this step should be performed when the edge gateway is not decoding other data packets.

[0044] Determine whether the decoding cost of the second data packet is greater than the increased decoding margin. If the decoding cost of the second data packet is less than or equal to the increased decoding margin, then a decoding operation is performed on the payload portion of the second data packet. In one specific embodiment, the edge gateway 112 preferably selects the data packet with the earliest arrival time from the decoding buffer queue in a first-in-first-out (FIFO) order as the candidate decoding data packet. Taking the decoding buffer queue of the second monitoring terminal 113 as an example, the earliest arriving data packet is a 1536-byte meteorological data packet that entered the queue at 08:15:23.480, with a decoding cost of 158 points. After entering the buffer queue, the decoding margin corresponding to the second monitoring terminal 113 continues to increase at an actual recovery rate of 16 points every 20 milliseconds. If the margin value of the data packet when it entered the queue was 72 points, then after 120 milliseconds, its decoding margin value can increase by 96 points, thus increasing from 72 points to 168 points. At this time, the edge gateway 112 can determine that the 158-point decoding cost value corresponding to the candidate decoding data packet is less than or equal to the current increased 168-point decoding margin value, and therefore performs a decoding operation on the payload portion of the earliest arriving meteorological data packet. After decoding the 1536-byte meteorological data packet, the decoding margin value corresponding to the second monitoring terminal 113 can be reduced by 158 points from 168 points, updating to 10 points. Subsequently, the edge gateway 112 can continue to retain the remaining cached data packets corresponding to this terminal and further restore the remaining values ​​according to the actual recovery speed, so as to continue processing the 1024-byte and 768-byte data packets in the queue at subsequent times.

[0045] In a preferred embodiment, the method further includes: The waiting time for the first data packet is determined based on the arrival time of the first data packet; Determine if the waiting time exceeds the waiting time threshold; If it is determined that the waiting time is greater than the waiting time threshold, then continue to determine the data packet nature of the first data packet; If the first data packet is determined to be a real-time data packet, then the first data packet is discarded; If the first data packet is determined to be a non-real-time data packet, then the payload portion of the first data packet is decoded without considering the decoding margin. In one embodiment, in certain scenarios, although the edge gateway 112 has adopted independent margin values ​​and dynamic recovery speed control, the waiting time of a data packet in the decoding buffer queue may still exceed a preset threshold due to excessively concentrated data arrivals in a short period of time or a sudden deterioration in the link quality of a certain terminal. Therefore, in this embodiment, a waiting time detection and timeout handling mechanism can be further set.

[0046] Specifically, the edge gateway 112 can determine the waiting time of the first data packet based on its arrival time and determine whether it exceeds a waiting time threshold. The waiting time can preferably be defined as the time difference between the current determination time and the time the data packet enters the decoding buffer queue. For ease of implementation, the waiting time threshold can be set to 400 milliseconds. Of course, in other implementations, it can also be set to 300 milliseconds, 500 milliseconds, or 800 milliseconds, depending on the terminal reporting cycle and service timeliness requirements.

[0047] In one specific embodiment, suppose the first monitoring terminal 111 sends a real-time power consumption data packet at 08:15:24.000. Due to a temporary deterioration in link quality at that time, this data packet is judged as "poor," its payload size remains 64 bytes, its base consumption value is 20 points, and its link correction value is 35 points, therefore its decoding consumption value becomes 55 points. Further suppose that the decoding margin value corresponding to the first monitoring terminal 111 at this moment is only 32 points. Therefore, this data packet is temporarily stored in the decoding buffer queue corresponding to the first monitoring terminal 111, and its arrival time is recorded as 08:15:24.000, its data packet nature is "real-time data packet," its payload size is 64 bytes, and its decoding consumption value is 55 points. If the edge gateway 112 checks this data packet again at 08:15:24.460, its waiting time is 460 milliseconds, which is greater than the waiting time threshold of 400 milliseconds. At this point, if the real-time power consumption data packet is continued to be decoded at the backend, the operating time reflected by it will be significantly outdated. Therefore, the edge gateway 112 can discard the real-time data packet to avoid outdated real-time data continuing to occupy backend processing resources.

[0048] In one simulation embodiment, to verify the performance of the present invention compared to existing serial decoding and passive breakpoint resumption schemes, a power consumption monitoring data access simulation environment was constructed. The test hardware included an edge gateway prototype and a host computer. The edge gateway prototype used an ARM Cortex-A7 single-core processor with a clock speed of 800MHz, 512MB of RAM, and 8GB of flash memory, with the decoding thread bound to a single core. The host computer used an Intel Core i5 processor and 16GB of RAM to generate concurrent data streams from multiple terminals and to statistically analyze the test results. The test software environment included a Linux 5.10 operating system, a GCC 9.4 compilation environment, and a data access simulation program written in C++17. The comparison scheme is the existing serial decoding scheme, where the edge gateway decodes data packets sequentially according to their arrival order and returns an acknowledgment after decoding. The present invention maintains a decoding margin value as described in the aforementioned embodiment and performs scheduling processing based on link quality, payload size, the queue of data packets to be decoded, and waiting time thresholds.

[0049] The simulation conditions were set as follows: 40 real-time power consumption monitoring terminals and 8 non-real-time auxiliary monitoring terminals simultaneously connected to the same edge gateway. The real-time power consumption monitoring terminals sent a real-time data packet every 100 milliseconds, with a header length of 20 bytes and a payload size of 64 bytes; the non-real-time auxiliary monitoring terminals sent a non-real-time data packet every 500 milliseconds, with a payload size varying between 768 and 1536 bytes. The terminal confirmation waiting time threshold was set to 400 milliseconds. Each test lasted 30 minutes, and the average value was taken after 10 repetitions.

[0050] Simulation results show that the average acknowledgment delay of real-time data packets in the existing serial decoding scheme is 186.7 milliseconds, while that of the present invention is 153.4 milliseconds, a reduction of approximately 17.8%; the real-time data packet acknowledgment timeout rate of the existing scheme is 8.9%, while that of the present invention is 7.4%; the non-real-time data packet integrity processing rate of the existing scheme is 96.8%, while that of the present invention is 98.1%; the existing scheme generates 15,840 invalid breakpoint retransmissions within 30 minutes, while that of the present invention is 13,060, a reduction of approximately 17.6%; and the peak length of the decoding queue in the existing scheme is 286 data packets, while that of the present invention is 238 data packets, a reduction of approximately 16.8%.

[0051] The results above show that, under conditions of limited edge gateway decoding resources and concurrent access of multiple types of monitoring data, the solution of this invention can moderately reduce the real-time data packet acknowledgment latency and acknowledgment timeout rate without significantly increasing system complexity, reduce invalid breakpoint resumes caused by response latency, and improve buffer queue backlog. Simultaneously, the solution of this invention maintains high data integrity by employing delayed processing and forced decoding when necessary for non-real-time data packets. Therefore, compared with existing serial decoding and passive breakpoint resume solutions, this invention offers superior performance in terms of data access timeliness, integrity, and gateway-side scheduling stability.

[0052] In addition, corresponding to the above method, the present invention also provides a power consumption monitoring data breakpoint resumption system based on an edge gateway, used to execute the aforementioned power consumption monitoring data breakpoint resumption method based on an edge gateway, including: The decoding margin value maintenance module is used to maintain the decoding margin value for the monitoring terminal. Specifically, this module is used to maintain the decoding margin value for the monitoring terminal and to increase the decoding margin value based on the basic recovery speed or the actual recovery speed in subsequent processing.

[0053] The first data packet receiving module is used to receive the first data packet sent by the monitoring terminal; The first data packet reading module is used to read the header information of the first data packet to obtain the effective payload size of the first data packet; The decoding consumption value calculation module is used to calculate the decoding consumption value corresponding to the first data packet based on the link quality between the monitoring terminal and the edge gateway and the payload size. The comparison module is used to compare the decoding consumption value with the decoding margin value to obtain a comparison result; The rule processing module is used to process the first data packet according to a first preset rule based on the comparison result; the first preset rule is as follows: If the decoding cost is less than or equal to the decoding margin, directly decode the payload of the first data packet and update the decoding margin. If the decoding consumption value is greater than the decoding margin value, decoding will not be performed for the time being. The first data packet will be stored in the waiting-to-decode buffer queue of the corresponding monitoring terminal and the relevant information of the data packet will be recorded.

[0054] Figure 2 A schematic diagram illustrating an application scenario of the method in an embodiment of the present invention is shown. The system includes an edge gateway 112 deployed on the network access side, and at least two monitoring terminals communicatively connected to the edge gateway 112. The first monitoring terminal 111 is used to collect and report small data packets, such as real-time electricity consumption data; the second monitoring terminal 113 is used to collect and report large data packets, such as historical data on inter-provincial spot market transactions, power grid structure data, or meteorological data. The edge gateway 112 receives data packets from the aforementioned monitoring terminals to perform subsequent decoding processing. In power IoT monitoring scenarios, considering both equipment cost and deployment power consumption, the edge gateway 112 typically uses a resource-constrained embedded industrial computer. For example, in a specific application example of the present invention, the edge gateway 112 uses a Huawei AR502H series edge computing gateway based on an ARM Cortex-A7 single-core processor. Limited by the single-core serial processing architecture and limited memory bandwidth of this gateway model, it does not have the ability to perform physical parallel decoding of multiple data streams. When the second monitoring terminal 113 continuously sends data packets with large payloads, the decoding resources of the edge gateway 112 are easily monopolized by these large data packets, causing small data packets from the first monitoring terminal 111 to accumulate, resulting in decoding and response delays at the receiving end. If the first monitoring terminal 111 fails to receive application layer processing confirmation from the edge gateway 112 within the preset timeout period, it will determine that the current link has been interrupted based on the existing transmission protocol mechanism, thereby triggering unnecessary breakpoint resumption and data retransmission processes. This invalid retransmission caused by gateway-side decoding congestion not only exacerbates uplink bandwidth consumption but also leads to repeated writing of system monitoring data and a decrease in overall throughput.

[0055] Finally, it should be noted that the above embodiments are merely illustrative and explanatory of the present invention, and are not intended to limit the present invention to the scope of the described embodiments. Furthermore, those skilled in the art will understand that the present invention is not limited to the above embodiments, and many more variations and modifications can be made based on the teachings of the present invention, all of which fall within the scope of protection claimed by the present invention.

Claims

1. An edge gateway-based method for data breakpoint continuation of electricity consumption monitoring, the method being performed by an edge gateway, characterized in that, Includes the following steps: Step 1: Maintain the decoding margin value for the monitoring terminal; Step 2: Receive the first data packet sent by the monitoring terminal; Step 3: Read the header information of the first data packet to obtain the effective payload size of the first data packet; Step 4: Based on the link quality between the monitoring terminal and the edge gateway and the payload size, calculate the decoding consumption value corresponding to the first data packet; Step 5: Compare the decoding consumption value with the decoding margin value to obtain the comparison result; Step 6: Based on the comparison result, process the first data packet according to a first preset rule; the first preset rule is as follows: If the decoding cost is less than or equal to the decoding margin, directly decode the payload of the first data packet and update the decoding margin. If the decoding consumption value is greater than the decoding margin value, decoding will not be performed for the time being. The first data packet will be stored in the waiting-to-decode buffer queue of the corresponding monitoring terminal and the relevant information of the data packet will be recorded.

2. The method for resuming interrupted transmission of power consumption monitoring data based on an edge gateway according to claim 1, characterized in that, When the decoding consumption value is less than or equal to the decoding margin value, and decoding is completed and the decoding margin value is updated, the method further includes: increasing the updated decoding margin value by the base recovery speed.

3. The method for resuming interrupted transmission of power consumption monitoring data based on an edge gateway according to claim 1, characterized in that, The data packet information includes the arrival time of the first data packet, the data packet nature, the payload size, and the corresponding decoding cost.

4. The method for resuming interrupted transmission of power consumption monitoring data based on an edge gateway according to claim 3, characterized in that, The method further includes the following steps: Calculate the total payload size of all undecoded data packets in the undecoded buffer queue; The base recovery rate is updated based on the sum of the payload sizes to obtain the actual recovery rate. Increase the decoding margin value based on the actual recovery speed.

5. The method for resuming interrupted transmission of power consumption monitoring data based on an edge gateway according to claim 4, characterized in that, The base recovery rate is updated based on the sum of the payload sizes to obtain the actual recovery rate, according to the following rules: If the total payload size is ≤1024 bytes: maintain the basic recovery speed unchanged; If 1024 bytes < total payload size ≤ 2048 bytes: increase recovery speed, actual recovery speed = base recovery speed + N1, where N1 is the first preset increase value; If 2048 bytes < total payload size ≤ 4096 bytes: further increase the recovery speed. Actual recovery speed = base recovery speed + N2, where N2 is the second preset increase value and N2 > N1. If the total effective payload size is greater than 4096 bytes: adjust to the highest recovery speed. The actual recovery speed = the basic recovery speed + N3, where N3 is the third preset increment value and N3 > N2.

6. The method for resuming interrupted transmission of power consumption monitoring data based on an edge gateway according to claim 4, characterized in that, The method also includes a cache queue dequeue processing step: Identify the second data packet with the earliest arrival time in the buffer queue to be decoded; Determine whether the decoding cost of the second data packet is greater than the decoding margin after the actual recovery speed improvement; If the decoding cost of the second data packet is less than or equal to the increased decoding margin, then a decoding operation is performed on the payload portion of the second data packet.

7. The method for resuming interrupted transmission of power consumption monitoring data based on an edge gateway according to claim 3, characterized in that, The method also includes a timeout handling step for the first data packet in the decryption buffer queue: The waiting time for the first data packet is determined based on the arrival time of the first data packet; Determine whether the waiting time is greater than the waiting time threshold; If the waiting time is greater than the waiting time threshold, the data packet nature of the first data packet is identified; If the first data packet is a real-time data packet, then discard the first data packet; If the first data packet is a non-real-time data packet, then without considering the decoding margin value, the decoding operation is performed on the payload portion of the first data packet.

8. A power consumption monitoring data breakpoint resumption system based on an edge gateway, used to execute the power consumption monitoring data breakpoint resumption method based on an edge gateway as described in any one of claims 1-7, characterized in that, include: The decoding margin value maintenance module is used to maintain the decoding margin value for the monitoring terminal. The first data packet receiving module is used to receive the first data packet sent by the monitoring terminal; The first data packet reading module is used to read the header information of the first data packet to obtain the effective payload size of the first data packet; The decoding consumption value calculation module is used to calculate the decoding consumption value corresponding to the first data packet based on the link quality between the monitoring terminal and the edge gateway and the payload size. The comparison module is used to compare the decoding consumption value with the decoding margin value to obtain a comparison result; The rule processing module is used to process the first data packet according to a first preset rule based on the comparison result; the first preset rule is as follows: If the decoding cost is less than or equal to the decoding margin, directly decode the payload of the first data packet and update the decoding margin. If the decoding consumption value is greater than the decoding margin value, decoding will not be performed for the time being. The first data packet will be stored in the waiting-to-decode buffer queue of the corresponding monitoring terminal and the relevant information of the data packet will be recorded.

9. A power consumption monitoring data interruption resumption system based on an edge gateway according to claim 8, characterized in that, It also includes a basic recovery speed enhancement module; when the decoding consumption value is less than or equal to the decoding margin value, and after decoding is completed and the decoding margin value is updated, the basic recovery speed enhancement module is used to enhance the updated decoding margin value with the basic recovery speed.

10. A power consumption monitoring data interruption resumption system based on an edge gateway according to claim 8, characterized in that, The data packet information includes the arrival time of the first data packet, the data packet nature, the payload size, and the corresponding decoding cost.