Self-adaptive frequency and priority processing method and device for high-frequency power acquisition data based on resource load feedback, and storage medium
By quantifying node load in real time and utilizing a dual-time-domain closed-loop mechanism and hierarchical queue management, the real-time and scalability issues of the electricity information acquisition system were resolved, enabling stable and reliable acquisition and processing of high-frequency data, and improving the responsiveness and stability of the power system.
Patent Information
- Application Number
- CN202511189059.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-25
- Publication Date
- 2025-11-07
AI Technical Summary
Existing electricity consumption information collection systems suffer from insufficient real-time performance, poor scalability, and a lack of dynamic resource load adjustment and critical data protection mechanisms when processing high-frequency, high-throughput data, leading to system response delays and stability risks.
By quantifying node load in real time, adjusting the sampling period using a dual-time-domain closed-loop mechanism, and employing hierarchical queue management for messages, we can achieve flexible control of the acquisition link and ensure the latency of critical data. We also use a silo queue algorithm for differentiated transmission strategies to ensure priority processing of critical data.
In high-concurrency environments, it significantly reduces link pressure, ensures that the latency of key data acquisition is within the specified range, improves the real-time response capability and stability of the system, simplifies the parameter update process, and enhances the performance and reliability of power data acquisition and processing.
Smart Images

Figure CN120915730A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to a high-frequency power data acquisition adaptive frequency and priority processing method and device based on resource load feedback and a storage medium, and belongs to the technical field of high-frequency power data processing. BACKGROUND
[0002] In the process of the new power system accelerating evolution towards intelligence, the construction of smart grids is continuously promoted, and the intelligent degree of power equipment is continuously improved. This development trend makes the power consumption information acquisition system face more stringent requirements in real-time, expandability and controllability and other key dimensions. The traditional power consumption information acquisition mode has gradually exposed many shortcomings at present, and it is difficult to meet the current demand for high-frequency and high-throughput data processing.
[0003] In recent years, the number of various power equipment such as smart meters and sensors has shown a sharp growth trend, and the amount of data generated has also shown an explosive increase. Since these devices need to collect and transmit the changes of voltage, current, power and other key parameters in real time, the power consumption information acquisition system faces new challenges in processing capacity and real-time response capability. When the traditional power consumption information acquisition system faces these challenges, it exposes many limitations:
[0004] First, in terms of data transmission and processing, the real-time performance is poor. The traditional power system mainly relies on centralized data acquisition and processing mode, and the communication technology such as GPRS and HPLC used has certain limitations in transmission speed and reliability. This makes the data delay high in the transmission process, which affects the accuracy of real-time data acquisition. Especially in the application scenarios such as load scheduling and fault warning that require fast response, this high delay may cause the system to respond lag, even cause wrong judgment, and seriously affect the stable operation of the power system.
[0005] Second, the system expansion is insufficient, and it is difficult to adapt to large-scale equipment and data processing needs. Most of the existing power consumption data acquisition systems adopt centralized architecture, which is not capable of dealing with the rapid growth of power equipment and data volume. Whenever new equipment or acquisition points need to be added, the existing system often needs to be modified or expanded on a large scale, which not only increases the complexity and cost of system maintenance, but also causes the system to be unable to meet the demand of smart grid and other application scenarios for large-scale and high-frequency data acquisition in a timely manner.
[0006] Finally, there is a lack of dynamic adjustment of resource load and key data guarantee mechanism. The existing acquisition link usually adopts a fixed sampling period and gives the same priority to all telemetry data, without fully considering the real-time fluctuations of system resources such as CPU, memory and network bandwidth. When the concurrent traffic suddenly increases or the node resources are temporarily strained, low-priority point data and alarm information will compete for limited communication channels, which can easily lead to queue blocking, memory overflow and alarm delay and other problems. These problems can further weaken the reliability of load scheduling and fault warning, and bring potential risks to the stable operation of the power system.
[0007] Therefore, it is urgent to provide a high-frequency power data acquisition adaptive frequency and priority processing strategy based on resource load feedback to solve the related technical defects in the prior art. SUMMARY
[0008] The purpose of the present application is to provide a high-frequency power data acquisition adaptive frequency and priority processing method, device and storage medium based on resource load feedback, which aims to realize the elastic regulation and key data delay guarantee of the acquisition link without relying on prediction models by quantifying the node load in real time, adjusting the sampling period using a double-time-domain closed-loop mechanism, and managing messages using a hierarchical queue.
[0009] To solve the above technical problems, the present application is implemented by using the following technical solutions:
[0010] In a first aspect, the present application provides a high-frequency power data acquisition adaptive frequency and priority processing method based on resource load feedback, which includes:
[0011] Real-time acquisition of resource load information of the smart terminal node on the distribution network side;
[0012] According to the resource load information, it is judged whether the preset sampling period of the power monitoring data needs to be adjusted. If yes, the preset sampling period is dynamically corrected through a double-layer fast-slow loop adjustment mechanism to obtain the final adjusted sampling period. Otherwise, the original preset sampling period remains unchanged;
[0013] Acquisition of power monitoring data collected by the smart terminal node on the distribution network side under the preset acquisition period or the final adjusted sampling period;
[0014] Based on the preset priority queue grading rules, the cylinder queue algorithm is used to adopt a differentiated transmission strategy for the collected power monitoring data to realize the priority processing of different levels of data.
[0015] Through the cooperation of load quantization, double-loop feedback control and priority arrangement, the method exhibits excellent performance in a high concurrency environment. It can ensure that the collection time delay of key data is strictly controlled within the specified range, while significantly reducing the link pressure. It is worth mentioning that the method does not rely on prediction algorithms or complex scheduling frameworks, and has the advantages of simple implementation process, hot parameter update, strong real-time response capability and high robustness.
[0016] Optionally, the resource load information includes: CPU utilization, memory occupancy, link bandwidth occupancy and kernel PSI pressure value.
[0017] Optionally, a periodic trigger probe is preloaded in the operating system kernel layer of the smart terminal node on the network side, and the probe is bound with the system clock source; when the probe is periodically triggered, four reading operations are performed, including:
[0018] The ready queue length of the current processor is read and converted to obtain the CPU utilization;
[0019] The allocated physical memory occupancy and the limit ratio in the process control group are read to obtain the memory occupancy;
[0020] The export byte amount of the network interface in the last cycle window is read and converted according to the link peak capacity to obtain the link bandwidth occupancy;
[0021] The CPU stall percentage of the kernel pressure subsystem is read to obtain the kernel PSI pressure value.
[0022] Optionally, after the probe is periodically triggered to perform the four reading operations, a quadruple formed by the CPU utilization, the memory occupancy, the link bandwidth occupancy and the kernel PSI pressure value is written into a first ring buffer of a segment of permanent memory together with the corresponding absolute time stamp; the first ring buffer adopts an overwrite writing strategy to maintain time sequence continuity; the overwrite writing strategy is that when the write pointer rolls back to the starting position of the buffer, the oldest sample is overwritten.
[0023] Optionally, the double-layer fast and slow loop adjustment mechanism includes: fast loop inhibition adjustment and slow loop PI adjustment;
[0024] The processing process of the fast loop inhibition adjustment includes: when the latest detected kernel PSI pressure value exceeds the preset threshold of the pressure index, it is determined that the system is in a transient high congestion state, and then the preset sampling period is controlled to be multiplied, but the sampling period after the multiplication operation cannot exceed the upper limit of the preset sampling period.
[0025] Optionally, the same moment of controlling the preset sampling period to perform the multiplication operation also starts a two-second cooling counter; before the cooling counter is reset, if the latest detected core PSI pressure value again exceeds the preset threshold of the pressure index, the multiplication operation of the sampling period is not triggered again.
[0026] Optionally, the process of the slow loop PI adjustment includes:
[0027] The deviation between the real-time load metric and the target load metric is evaluated at a preset periodic interval, and the sampling period after the multiplication operation is adjusted again by a proportional-integral algorithm to obtain the final adjusted sampling period, so that the real-time load metric gradually falls back to the target load metric.
[0028] Optionally, if the difference between the new and old periods corresponding to the adjustment of the sampling period satisfies , it is determined that the adjustment behavior of the current sampling period is not effective, which is used to reduce the synchronization cost of the threads on both sides when the period is switched.
[0029] Optionally, the process of the real-time load metric includes:
[0030] The CPU utilization rate, memory occupancy rate, link bandwidth occupancy rate and core PSI pressure value are subjected to sliding filter processing to obtain a smoothed result after sliding filter processing, denoted as:
[0031]
[0032] In the formula, denotes the smoothed result after sliding filter processing of the current sampling period, denotes the new and old data weight distribution, denotes a four-tuple formed by the CPU utilization rate, memory occupancy rate, link bandwidth occupancy rate and core PSI pressure value, denotes the smoothed result after sliding filter processing of the last sampling period;
[0033] The four-dimensional smoothed values corresponding to the smoothed result after sliding filter processing of the current sampling period are each linearly scaled to closed interval to obtain a four-dimensional linear scaling value after linear scaling, and then according to the four-dimensional linear scaling value and the introduced weight vector, the final real-time load metric is obtained, denoted as:
[0034]
[0035] In the formula, denotes the real-time load metric, denotes the four-dimensional linear scaling value after linear scaling, denotes the introduced weight vector.
[0036] Optionally, based on the preset priority queue grading rule, a differential transmission strategy is adopted for the collected power monitoring data by using a bucket queue algorithm to realize the priority processing of data of different levels, including:
[0037] The power monitoring data is sequentially set as P0-level priority queue data, P1-level priority queue data and P2-level priority queue data from low to high according to the priority of data types;
[0038] A piece of power monitoring data is acquired, and the corresponding priority and the millisecond-level timestamp The target bucket index information is calculated, which is expressed as:
[0039]
[0040] Based on the calculated target bucket index information, the current bucket to be dequeued is located in constant time through the detection of the most leading set bit in the bitmap , thereby realizing the priority processing of data of different levels.
[0041] Optionally, the queue manager reserves a set of sequentially numbered second circular buffers in the memory, the number of which is fixed at 256, denoted as buckets , and the system simultaneously maintains a bitmap of 32 bytes in length to identify which buckets are currently empty.
[0042] Optionally, the head of the P0-level priority queue data is additionally attached with a two-byte countdown counter, the initial value of which is set to The background maintenance thread scans from the tail of the bucket forward at a period of 50 ms:
[0043] When it is detected that a P0-level priority queue data still resides in the queue and , the countdown counter of the P0-level priority queue data is decremented; if the countdown counter decreases to 0, the bucket read pointer slides through the P0-level priority queue data to complete a self-destruction operation, which is used to make the P0-level priority queue data unable to occupy the queue for more than one second.
[0044] Optionally, the queue manager continuously aggregates the instant occupied bytes in all buckets, and when it is first detected that the instant occupied bytes are greater than or equal to a default threshold, a compression threshold process is started.
[0045] Optionally, the instant occupied bytes are calculated by the following formula:
[0046]
[0047] In the formula, represents the instant occupied bytes, represents the write pointer position of the bucket, represents the read pointer position of the bucket.
[0048] In a second aspect, the present application further provides a high-frequency power data acquisition adaptive frequency and priority processing device based on resource load feedback, comprising:
[0049] A resource load information acquisition module is configured to acquire resource load information of the smart terminal node on the distribution network side in real time;
[0050] A sampling period adaptive adjustment module is configured to determine whether the preset sampling period of the power monitoring data needs to be adjusted according to the resource load information, and if yes, dynamically correct the preset sampling period through a double-layer fast-slow loop adjustment mechanism to obtain the final adjusted sampling period, and if not, maintain the original preset sampling period unchanged;
[0051] A power monitoring data acquisition module is configured to acquire the power monitoring data collected by the smart terminal node on the distribution network side in the preset acquisition period or the final adjusted sampling period;
[0052] And a priority processing module is configured to use a queue algorithm to adopt a differentiated transmission strategy for the collected power monitoring data based on a preset priority queue classification rule, so as to realize priority processing of different levels of data.
[0053] In a third aspect, the present application further provides a computer readable storage medium having a computer program stored thereon, and the computer program is executed by a processor to perform the steps of the high-frequency power data acquisition adaptive frequency and priority processing method based on resource load feedback as described in the first aspect.
[0054] Compared with the prior art, the present application has the following beneficial effects:
[0055] The application quantifies the resource load information of the smart terminal node on the network side in real time, dynamically adjusts the sampling period of the power monitoring data by using a double-layer fast-slow ring adjustment mechanism, realizes the elastic regulation and control of the collection link, adopts a differentiated transmission strategy for the collected power monitoring data based on the preset priority queue grading rules and the barrel queue algorithm, realizes the priority processing of different levels of data, can ensure that the collection delay of key data is strictly controlled within the specified range, significantly reduces the link pressure, and does not need to rely on prediction algorithms or complex scheduling frameworks, has the advantages of simple implementation process, hot update of parameters, strong real-time response capability and high robustness, etc., and specifically, the period trigger probe is loaded in the operating system kernel layer and the system clock source is bound to obtain the resource load information and write it into the ring buffer of the resident memory to maintain the time sequence continuity, the fast ring inhibition adjustment in the double-layer fast-slow ring adjustment mechanism can quickly respond when the system is instantaneously high in congestion, and the slow ring PI adjustment gradually falls back to the target load metric through the proportional-integral algorithm, in the real-time load metric processing, the sliding filter and linear scaling are combined with the weight vector calculation to obtain a more accurate real-time load metric, in the priority processing, different priority queues are set for the power monitoring data according to the priority, the barrel queue algorithm is used to calculate the target barrel index information to realize the constant time positioning of the dequeued barrel, and the countdown counter is set for the P0 level priority queue data to prevent long-term occupation of the queue, and the queue manager continuously summarizes the instant occupied byte number in the barrel and starts the compression threshold process to ensure the stable operation of the system, and the performance and reliability of the high-frequency power data collection and processing are improved as a whole. BRIEF DESCRIPTION OF DRAWINGS
[0056] Figure 1 Fig. 1 shows a flowchart of an embodiment of the adaptive frequency and priority processing method for high-frequency power data collection based on resource load feedback of the application;
[0057] Figure 2 Fig. 2 shows a general architecture diagram of an embodiment of the adaptive frequency and priority processing method for high-frequency power data collection based on resource load feedback of the application;
[0058] Figure 3 Fig. 3 shows a double-ring control flowchart of the adaptive sampling frequency of the adaptive frequency and priority processing method for high-frequency power data collection based on resource load feedback of the application;
[0059] Figure 4 Fig. 4 shows a multi-level priority barrel queue structure diagram of the adaptive frequency and priority processing method for high-frequency power data collection based on resource load feedback of the application. DETAILED DESCRIPTION
[0060] The technical solutions of the present application will be described in detail below with reference to the drawings and specific embodiments. It should be understood that the embodiments and specific features in the embodiments are detailed descriptions of the technical solutions of the present application, rather than limitations of the technical solutions of the present application. In the case of no conflict, the technical features in the embodiments and the embodiments can be combined with each other.
[0061] Embodiment 1
[0062] Reference Figure 1 With Figure 2 This embodiment introduces a high-frequency power data acquisition adaptive frequency and priority processing method based on resource load feedback, which includes:
[0063] Real-time acquisition of resource load information of the distribution network side intelligent terminal node;
[0064] According to the resource load information, it is judged whether the preset sampling period of the power monitoring data needs to be adjusted. If yes, the preset sampling period is dynamically corrected through a double-layer fast and slow loop adjustment mechanism to obtain the final adjusted sampling period. Otherwise, the original preset sampling period remains unchanged;
[0065] Acquisition of power monitoring data collected by the distribution network side intelligent terminal node under the preset acquisition period or the final adjusted sampling period;
[0066] Based on the preset priority queue classification rule, the differential transmission strategy is adopted for the collected power monitoring data by using the queue algorithm, so as to realize the priority processing of different levels of data.
[0067] In practical application, the embodiment first integrates and processes multiple key performance indicators of the collection node, specifically including CPU utilization, memory occupation, network throughput, and system lag degree, fuses these scattered indicators into a unified load indicator, and applies the load indicator as a feedback signal to system regulation. In terms of sampling rate control, the method adopts a double-loop feedback mechanism. The millisecond-level fast loop has high sensitivity and can quickly respond and immediately slow down the sampling rate when detecting a sudden rise in load to prevent the system from being abnormal due to high load. Subsequently, the second-level slow loop further plays a role in more detailed and accurate adjustment of the sampling period to ensure that the load can smoothly fall back, while avoiding system oscillation and maintaining stable operation of the system. For processing of the sampling data, the method constructs a multi-level priority queue mechanism. The sampling data is classified into three levels of “alarm—key—normal” and sequentially enters the corresponding multi-level priority queue. Under this mechanism, high-priority information can always occupy the shortest transmission path to ensure that it can be transmitted at the fastest speed. When the system resources are tight, low-priority data can be compressed, delayed, or discarded as appropriate to ensure efficient overall operation of the system.
[0068] Embodiment 2
[0069] Reference Figures 1 to 4 For the scenario of the smart terminal node on the distribution network side reporting voltage, current, power and other monitoring data at a millisecond level, the embodiment can dynamically adjust the sampling frequency and manage telemetry messages according to priority by relying only on real-time resource load information of the node itself, ensure that key data such as alarms and overruns are sent at a second level, and suppress the occupation of CPU, memory and link resources under sudden high voltage conditions. The specific implementation process is described as follows.
[0070] I. Resource monitoring and load evaluation
[0071] Index collection: a periodic trigger lightweight probe is preloaded in the kernel layer of the operating system of the smart terminal node on the distribution network side, and the probe is bound with the system clock source to automatically wake up at a fixed 50 ms period. Four reading operations are performed immediately upon each trigger:
[0072] Read the ready queue length of the current processor and convert it to obtain the CPU utilization ;
[0073] Read the allocated physical memory occupation and quota ratio in the process control group to obtain the memory occupation rate ;
[0074] Read the outgoing byte amount of the network interface in the last 50 ms window and convert it according to the link peak capacity to obtain the link bandwidth occupation rate ;
[0075] reading a CPU Stall percentage of a kernel pressure subsystem, obtaining the kernel PSI pressure value .
[0076] The obtained quadruple and the absolute timestamp of this sampling are jointly written into a first ring buffer of a segment of persistent memory, and an overwrite writing strategy is used to maintain time sequence continuity: the oldest sample is overwritten when the writing pointer rolls back to the starting position of the buffer, so that explicit garbage collection is not required, and any blocking can also be avoided.
[0077] Sliding filtering: the user space daemon thread takes out a batch of samples that have not been consumed at the same 50ms period, and immediately sorts them in ascending order of timestamp. If a jump in sampling interval is found, the gap is filled with the previous valid value. The CPU utilization rate, memory occupancy rate, link bandwidth occupancy rate and kernel PSI pressure value are subjected to sliding filtering to obtain a smoothed result after sliding filtering, denoted as:
[0078]
[0079] In the formula, denotes the smoothed result after sliding filtering of the current sampling period, denotes a quadruple formed by the CPU utilization rate, the memory occupancy rate, the link bandwidth occupancy rate and the kernel PSI pressure value, denotes the smoothed result after sliding filtering of the previous sampling period, and the first frame is initialized with the arithmetic mean of the first five frames at the beginning of sampling, denotes the allocation of new and old data weights, When 0.6 is taken, both the rapid tracking of sustained load increase and the effective suppression of false positives caused by single-frame sudden increase can be achieved, and if the application scene changes in complexity, the value can be adjusted in the range of 0.3-0.9 and is synchronously issued without affecting subsequent calculation logic.
[0080] Normalization and load function calculation: after sliding filtering is completed, the four-dimensional smoothed values corresponding to the smoothed result after sliding filtering of the current sampling period are each linearly scaled to closed interval to obtain four-dimensional linear scaling values after linear scaling, and then according to the four-dimensional linear scaling values and the introduced weight vector, the final real-time load metric is obtained, denoted as:
[0081]
[0082] wherein the introduced weight vector is set to Each weight measures the relative importance of the corresponding resource to the overall health of the subsystem, and the sum of all weights is always 1 to ensure that the load function does not change with the dimensionality.
[0083] Further, the calculation result is written into the node-level shared memory area. The write operation is accompanied by a memory barrier instruction to ensure that the value is immediately visible to all concurrent threads after it is generated. The weight vector and the filter coefficients are stored in a centralized configuration repository and can be updated to all collection nodes through a single point at runtime, thereby supporting on-demand reallocation of the importance of each resource dimension without downtime or recompilation.
[0084] In extreme cases, if any resource indicator is continuously invalid due to permission restrictions or hardware failures, the daemon thread will first use the latest valid value for time-limited compensation; if the duration of the failure exceeds the set threshold, the corresponding normalized component is actively set to 1 to immediately reflect the potential risk in the formula for calculating the real-time load metric, driving the subsequent control logic to adopt a conservative strategy. For old systems that lack kernel probe support, the same four indicators can be collected using user space timed polling, with the sampling period remaining the same as the above two calculation formulas. This alternative method is an allowed equivalent implementation of the present application.
[0085] By continuously executing the above steps, the present embodiment can obtain a unified real-time load metric containing CPU, memory, network, and thread blocking pressure information every 50 ms period, providing real-time, accurate, and online-tunable basic data for subsequent dynamic sampling adjustment and priority queue management.
[0086] II. Dynamic sampling control
[0087] Fast ring suppression adjustment: when the sampling controller detects that the latest kernel PSI pressure value exceeds the set threshold , it determines that the system is in a transient high blocking state. To prevent CPU preemption and network contention from continuing to worsen, the control preset sampling period is multiplied, but the sampling period after multiplication cannot exceed the upper limit of the preset sampling period, denoted as:
[0088]
[0089] In addition, the same moment when the control preset sampling period is multiplied also starts a two-second cooling counter. Before the counter returns to zero, even if the subsequent sampling period is again higher than the threshold, the multiplication operation is not triggered again. In this way, the system can avoid frequent "speed up - slow down - speed up again" oscillation near the pressure boundary, and at the same time, a buffer time is left for slow ring adjustment.
[0090] Slow loop PI regulation: To smoothly converge the period to the level matching the load after the fast loop coarse adjustment, the controller evaluates the deviation between the real-time load metric and the target load metric every second interval, and makes a secondary adjustment to the multiplied sample period through a proportional-integral algorithm to obtain the final adjusted sample period, so as to gradually bring the real-time load metric back to the target load metric.
[0091] Specifically, first, the expected load is set , and the instantaneous error is defined . Then the increment is obtained according to the following formula:
[0092]
[0093] And is added to the current sample period according to the following formula, while clipping interval, where :
[0094]
[0095] If the condition occurs for three consecutive periods, the system determines that the real-time load deviates seriously from the target load, and dynamically reduces or shortens the integral window to suppress overshoot and shorten the steady-state recovery time. All PI coefficients support online adjustment during operation, without the need for shutdown.
[0096] Jitter protection and concurrent consistency: If the difference between the new and old periods calculated by the controller satisfies , it is considered as a small jitter that is not enough to significantly improve the system state, and the current period is not effective to reduce the synchronization cost of the threads on both sides when the period is switched. Before actually writing to the shared memory, the controller first enters a fixed 10ms mutex delay area to queue multiple update requests that may come in the same time period; when the lock is released, the final period value is submitted through the memory barrier instruction to ensure that all concurrent sampling threads visually see an atomic, monotonically increasing or decreasing period update, thereby completely eliminating the sampling misalignment caused by race conditions.
[0097] III. Multi-level priority queue and elastic discard
[0098] First of all, it is worth mentioning that the power monitoring data is set according to the priority of the data type from low to high as P0-level priority queue data, P1-level priority queue data and P2-level priority queue data. Secondly, the queue manager will reserve a set of sequentially numbered circular buffers in memory, with a fixed number of 256, collectively referred to as buckets . The system maintains a bitmap of length 32 bytes , to identify which buckets are currently non-empty. Whenever a message msg enters the queue, first its priority is compared with the low five bits of the millisecond-level timestamp , and the target bucket index is computed according to the following formula , denoted as:
[0099]
[0100] where the smaller the bucket number, the higher the priority. The current bucket that should be dequeued can be located in constant time by detecting the most significant set bit in the bitmap , without traversing the entire buffer.
[0101] Specifically, the enqueue process is preceded by an atomic set: when a new message is produced by the sampling thread, the system first writes its key metadata (timestamp, measurement point ID, priority digest) into the local write-ahead log in sequential append mode, to ensure that it can be replayed completely even in the event of a transient power failure. Subsequently, the bucket number is computed according to the priority and the millisecond-level timestamp , denoted as:
[0102]
[0103] Further, the complete payload is written into the corresponding ring buffer . The ring buffer is not locked for concurrent write threads, but relies on independent write pointers for each bucket to achieve natural queuing. After a successful write, the th bit of the bitmap is set to 1 via an atomic bit operation, and a lightweight kernel event is immediately raised; this way, any consumer thread can learn the "highest-priority non-empty bucket" in constant time, and the dequeue path does not need to wait for the lock to be released, fundamentally eliminating the tail latency caused by write-read mutual exclusion in high-concurrency scenarios.
[0104] TTL control and self-destruction policy: to prevent priority0 data from occupying too much memory during periods of high load, the system appends a two-byte countdown counter to the header of such messages, with an initial value corresponding to a 1-second survival period (20 ms per time unit). A background maintenance thread scans forward from the end of the bucket every 50 ms: when it detects a message that is still resident in the queue and , it decrements the counter; as soon as the counter falls to 0, the bucket read pointer is slid over the message to complete "self-destruction". This time-limited retention mechanism ensures that low-priority data cannot occupy the queue for more than one second, even in the worst-case scenario, while high-priority data can remain complete and reachable at any time without constraints.
[0105] Adaptive compression threshold: when the queue occupancy exceeds 64 KB, only the contiguous low-priority message blocks are delta-compressed to release memory without affecting high-priority transmissions.
[0106] First, the queue manager continuously aggregates the instantaneous occupancy bytes in all buckets, denoted as:
[0107]
[0108] wherein, represents the instantaneous occupancy bytes, represents the write pointer position of the bucket (total bytes of cumulative writes or write offset), represents the read pointer position of the bucket (total bytes of reads or read offset).
[0109] Further, when the first time (the default threshold) is detected, a "lazy compression" procedure is initiated: the system only performs delta-encoding (replacing the original value with the difference between adjacent values to reduce redundancy) on the P0 priority queue data and the message blocks with contiguous physical positions, then applies a lightweight lossless compression function to generate a compact representation, and finally replaces the original load in place. After compression, the total occupancy is scaled to , wherein the compression rate is between 0 and 1. Since compression is only triggered when the total capacity approaches the upper limit, and high-priority data is never processed, it ensures that the system memory is not overwhelmed by ordinary telemetry, and the timeliness of critical message channels is not sacrificed.
[0110] With the dual protection of time-limited reservation and threshold compression, the queue can still maintain a limited length under extreme concurrency. That is, a multi-level elastic queue with the principle of "critical first, ordinary second, time-sensitive first, and compression second" is constructed without explicit locking: critical alarms can be dequeued in constant time, and ordinary telemetry is automatically time-limited or compressed during high-pressure periods, providing smooth and controllable data flow for subsequent network export.
[0111] Embodiment 3
[0112] The embodiment provides a high-frequency power data acquisition adaptive frequency and priority processing device based on resource load feedback, which comprises:
[0113] The resource load information acquisition module is configured to acquire resource load information of a smart terminal node on a power distribution network side in real time.
[0114] The sampling period adaptive adjustment module is configured to determine whether the preset sampling period of the power monitoring data needs to be adjusted according to the resource load information, and if yes, dynamically correct the preset sampling period through a double-layer fast and slow loop adjustment mechanism to obtain a final adjusted sampling period; otherwise, maintain the original preset sampling period unchanged.
[0115] The power monitoring data acquisition module is configured to acquire the power monitoring data collected by the smart terminal node on the distribution network side in the preset collection period or the final adjusted sampling period.
[0116] In addition, the priority processing module is configured to adopt a differentiated transmission strategy for the collected power monitoring data based on a preset priority queue grading rule by using a queue algorithm, so as to realize priority processing of different levels of data.
[0117] In combination with Figures 1 to 4 The high-frequency power data acquisition adaptive frequency and priority processing device based on resource load feedback can execute the high-frequency power data acquisition adaptive frequency and priority processing method based on resource load feedback as described in Embodiment 1 or 2, and the specific function implementation of each functional module is not described herein.
[0118] Embodiment 4
[0119] The embodiment provides a computer readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the high-frequency power data acquisition adaptive frequency and priority processing method based on resource load feedback as described in Embodiment 1 or 2 are implemented.
[0120] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0121] The present application is described with reference to flowcharts and / or block diagrams of the method, device (system) and computer program product according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device that implements the flowcharts and / or block diagrams. Figure 1one or more processes and / or blocks Figure 1 an apparatus for performing the functions specified in the flowchart or multiple flows and / or blocks.
[0122] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the flowchart or multiple flows and / or blocks. Figure 1 one or more processes and / or blocks Figure 1 an apparatus for performing the functions specified in the flowchart or multiple flows and / or blocks.
[0123] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the flowchart or multiple flows and / or blocks. Figure 1 one or more processes and / or blocks Figure 1 an apparatus for performing the functions specified in the flowchart or multiple flows and / or blocks.
[0124] The above description is merely the preferred embodiment of the present application, it should be pointed out that for those skilled in the art, without departing from the technical principles of the present application, a number of improvements and modifications can be made, these improvements and modifications should also be considered as the protection scope of the present application.
Claims
1. A high-frequency power data acquisition adaptive frequency and priority processing method based on resource load feedback, characterized in that, The method comprises the following steps: real-time acquisition of resource load information of a smart terminal node on a power distribution network side; determination of whether the preset sampling period of power monitoring data needs to be adjusted according to the resource load information, and if so, dynamic correction of the preset sampling period through a double-layer fast-slow loop adjustment mechanism to obtain a final adjusted sampling period; otherwise, the original preset sampling period is maintained unchanged; acquisition of power monitoring data collected by the smart terminal node on the power distribution network side in the preset collection period or the final adjusted sampling period; based on preset priority queue grading rules, differential transmission strategies are adopted for the collected power monitoring data by using a queue algorithm to achieve priority processing of data at different levels.
2. The adaptive frequency and priority processing method for high frequency power data acquisition based on resource load feedback according to claim 1, characterized in that, The resource load information includes CPU utilization, memory occupancy, link bandwidth occupancy and kernel PSI stress value; a periodically triggered probe is preloaded in the operating system kernel layer of the smart terminal node on the power distribution network side, and the probe is bound to the system clock source, and when the probe is periodically triggered, four reading operations are performed, including: reading the ready queue length of the current processor and converting it to obtain the CPU utilization; reading the allocated physical memory occupancy and quota ratio in the process control group to obtain the memory occupancy; reading the export byte amount of the network interface in the last cycle window and converting it according to the link peak capacity to obtain the link bandwidth occupancy; reading the CPU Stall percentage of the kernel stress subsystem to obtain the kernel PSI stress value; wherein, after the four reading operations are performed when the probe is periodically triggered, a quadruple formed by the CPU utilization, memory occupancy, link bandwidth occupancy and kernel PSI stress value is written into a first ring buffer of a segment of permanent memory together with the corresponding absolute time stamp; the first ring buffer adopts an overwrite strategy to maintain time sequence continuity; the overwrite strategy is that when the write pointer rolls back to the starting position of the buffer, the oldest sample is overwritten.
3. The adaptive frequency and priority processing method for high frequency power data acquisition based on resource load feedback according to claim 2, characterized in that, The double-layer fast-slow loop adjustment mechanism includes fast loop inhibition adjustment and slow loop PI adjustment; The processing process of the fast loop inhibition adjustment includes: when the latest detected kernel PSI stress value exceeds the preset threshold of the stress indicator, it is determined that the system is in a transient high congestion state, and then the preset sampling period is controlled to perform a multiplication operation, but the sampling period after the multiplication operation must not exceed the upper limit of the preset sampling period; wherein, at the same time when the preset sampling period is controlled to perform the multiplication operation, a two-second cooling counter is also started; before the cooling counter is reset to zero, if the latest detected kernel PSI stress value again exceeds the preset threshold of the stress indicator, the multiplication operation of the sampling period is not triggered again. The processing process of the slow loop PI adjustment includes: evaluation of the deviation between the real-time load metric and the target load metric at a preset period interval, and secondary adjustment of the sampling period after the multiplication operation through a proportional-integral algorithm to obtain the final adjusted sampling period, so that the real-time load metric gradually falls back to the target load metric.
4. The adaptive frequency and priority processing method for high frequency power data acquisition based on resource load feedback according to claim 3, characterized in that, If the difference between the new and old periods corresponding to the adjustment before and after the sampling period satisfies If the difference between the new and old periods corresponding to the adjustment before and after the sampling period satisfies If the difference between the new and old periods corresponding to the adjustment before and after the sampling period satisfies 5. The adaptive frequency and priority processing method for high frequency power data acquisition based on resource load feedback according to claim 4, characterized in that, The processing process of the real-time load metric includes: The CPU utilization, memory occupancy, link bandwidth occupancy and kernel PSI stress value are subjected to sliding filtering processing to obtain a smooth result after sliding filtering processing, denoted as: In the formula, represents the smoothing result of the current sampling period after the sliding filter processing, represents the new and old data weight distribution, represents a four-tuple formed by CPU utilization, memory occupancy, link bandwidth occupancy and kernel PSI stress value, represents the smoothing result of the last sampling period after the sliding filter processing; linearly scale the four-dimensional smoothing values corresponding to the smoothing results of the current sampling period after the sliding filter processing respectively to obtain the four-dimensional linearly scaled values after linear scaling, and further obtain the final real-time load metric according to the four-dimensional linearly scaled values and the introduced weight vector, which is expressed as: wherein represents a real-time load metric, represents a four-dimensional linearly scaled value after linear scaling, represents an introduced weight vector.
6. The adaptive frequency and priority processing method for high frequency power data acquisition based on resource load feedback according to claim 5, wherein, Based on the preset priority queue grading rule, a differentiated transmission strategy is adopted for the collected power monitoring data by using the barrel queue algorithm to realize priority processing of data of different levels, including: The power monitoring data is sequentially set as P0-level priority queue data, P1-level priority queue data and P2-level priority queue data from low to high according to the priority of the data type; acquire a piece of power monitoring data and according to its corresponding priority and millisecond-level timestamps calculate target bucket index information, denoted as: Based on the calculated target bucket index information, and through detecting the bitmap The most front set bit in the bitmap can locate the current bucket that should be dequeued in constant time, thereby realizing the priority processing of different levels of data. Wherein, the queue manager reserves a set of sequentially numbered second circular buffers in memory, the number is fixed to 256, represented as buckets , and the system maintains a bitmap of length 32 bytes , to identify which buckets are currently non-empty.
7. The adaptive frequency and priority processing method for high frequency power data acquisition based on resource load feedback according to claim 6, wherein, The head of the P0 priority queue data is attached with a two-byte countdown counter, and the initial value is set to The background maintenance thread scans from the end of the bucket to the front at a period of 50 ms. When it is detected that P0 priority queue data still resides in the queue and The countdown counter for the P0 priority queue data is then decremented; if the countdown counter falls to zero, the bucket read pointer is slid past the P0 priority queue data to complete a self-destruct operation for the P0 priority queue data to prevent it from occupying the queue for more than one second.
8. The adaptive frequency and priority processing method for high frequency power data acquisition based on resource load feedback according to claim 7, wherein, The queue manager continuously aggregates the instant occupancy byte number in all barrels, and when it is first detected that the instant occupancy byte number is greater than or equal to a default threshold, a compression threshold process is started; The instant occupancy byte number is calculated by the following formula: wherein represents the number of bytes occupied instantaneously, represents the write pointer position of the bucket, represents the read pointer position of the bucket.
9. A high frequency power data acquisition adaptive frequency and priority processing device based on resource load feedback, characterized in that, including: The resource load information acquisition module is configured to acquire resource load information of the power distribution network side intelligent terminal node in real time; The sampling period adaptive adjustment module is configured to determine whether the preset sampling period of the power monitoring data needs to be adjusted according to the resource load information, and if so, dynamically correct the preset sampling period through a double-layer fast and slow loop adjustment mechanism to obtain a final adjusted sampling period; Otherwise, the original preset sampling period remains unchanged; The power monitoring data acquisition module is configured to acquire the power monitoring data collected by the power distribution network side intelligent terminal node in the preset collection period or the final adjusted sampling period; and the priority processing module is configured to adopt a differentiated transmission strategy for the collected power monitoring data by using the barrel queue algorithm based on the preset priority queue grading rule to realize priority processing of data of different levels. 10.A computer readable storage medium having stored thereon a computer program, which, when executed by a processor, implements the steps of the resource load feedback based high-frequency power data acquisition adaptive frequency and priority processing method according to any one of claims 1-8.
Citation Information
Cited By
High-concurrency scene-oriented data security storage and privacy protection method
CN121413033A
Heat exchange station leak detection positioning system based on pressure fluctuation rule
CN121702656A
Box transformer substation integrated electric vehicle group charging priority management method and system
CN121903319A
Timer adjusting method and system based on DPDK dynamic load awareness
CN121957915A
A timer adjustment method and system based on DPDK dynamic load awareness
CN121957915B