A new energy power grid flexible regulation method and system based on load prediction
Patent Information
- Application Number
- CN202611468075.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-21
- Publication Date
- 2026-10-30
AI Technical Summary
[0006]为了解决如何将边缘网关内部多协议并发处理所引入的动态转换时延实时纳入调控决策模型,以降低协议转换损耗对调控时效性破坏的技术问题,本发明提供一种基于负载预测的新能源电网柔性调控方法及系统
基于上述技术方案,本发明提供的一种基于负载预测的新能源电网柔性调控方法及系统,通过实时协议特征熵分析报文表面长度以度量内核协议栈在多协议并发场景下的微观逻辑判断工作量,将异构协议解析的动态损耗实时映射为具有时间量纲的可预测参数,并耦合并发协议数、缓冲区队列长度及CPU利用率构建动态转换时延模型,实现了网关内部协议转换损耗向调控决策的实时闭环映射;在此基础上,进一步通过对目标执行时刻反向平移并对调节幅值前馈增强,使经协议转换后的调控动作精准命中电网负荷波动峰值,有效降低动态时延引发的电网频率二次震荡风险,提高虚拟电厂在异构通信环境下的削峰填谷指令精准执行与电网供需平衡维持的准确性。
Smart Images

Figure CN123019248A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power grid control technology, and in particular to a flexible control method and system for new energy power grids based on load forecasting. Background Technology
[0002] Virtual power plants manage distributed resources within a park through a cloud platform, issuing peak-shaving and valley-filling control commands when the power grid needs them to maintain supply and demand balance. These commands must be parsed by on-site edge gateways and converted into underlying communication protocols that specific devices can recognize before execution. In renewable energy grid control scenarios, the protocol conversion efficiency of the edge gateways directly determines the response time of control commands.
[0003] In the prior art, Chinese patent application document with publication number CN121584771A discloses a method and system for improving the response time of multi-user control in photovoltaic power distribution areas. Its core features include: the master station pre-negotiates the communication key with the photovoltaic protocol converter according to the execution plan; when the group control command is issued, the master station sends the encrypted command string of multi-inverter control according to the distribution area combination to the smart terminal at one time; after the smart terminal decomposes the command string, it sends it to its respective photovoltaic protocol converter in parallel, and immediately feeds back the execution status information to the master station after the converter replies to the command, so as to improve the overall response efficiency.
[0004] However, while the aforementioned existing technologies have optimized the command issuance stage, their assessment of the execution timeliness of control commands only stops at the interactive confirmation at the communication link layer, completely ignoring the dynamic processing losses within the protocol converter. In industrial and commercial settings, a massive number of heterogeneous communication protocols coexist on the same edge gateway. For example, smart meters use the DL / T645 protocol, while air conditioner controllers use proprietary protocols or Modbus protocols. The parsing depth and verification mechanisms of different protocol stacks vary significantly. Because existing technologies do not incorporate the dynamic conversion delays caused by multiple protocol concurrency within the gateway into the control timeliness model, they cannot predict millisecond-level protocol parsing time when handling multi-protocol concurrency scenarios. This results in an uncontrollable phase shift between the actual execution time of the control action and the true peak time of the power grid load fluctuation.
[0005] Therefore, how to incorporate the dynamic conversion latency introduced by the concurrent processing of multiple protocols within the edge gateway into the control decision model in real time, so as to reduce the damage of protocol conversion loss to the timeliness of control, is a technical problem that urgently needs to be solved. Summary of the Invention
[0006] To address the technical challenge of incorporating the dynamic conversion delay introduced by concurrent processing of multiple protocols within the edge gateway into the control decision model in real time, thereby reducing the impact of protocol conversion losses on control timeliness, this invention provides a flexible control method and system for new energy power grids based on load forecasting.
[0007] In a first aspect, the present invention provides a flexible control method for a new energy power grid based on load forecasting, which adopts the following technical solution: A flexible control method for renewable energy power grids based on load forecasting includes the following steps: S1. Obtain real-time operating data of the edge gateway at each sampling moment; S2. Based on the real-time operating data, calculate the real-time protocol feature entropy at each sampling moment. The real-time protocol feature entropy is used to characterize the dynamic basic time complexity required for parsing the corresponding protocol; S3. Based on the real-time protocol feature entropy, combined with the number of concurrent protocols of the edge gateway, the buffer queue length, and CPU utilization, calculate the dynamic conversion latency of the edge gateway at the current sampling moment; S4. Respond to the control instructions issued by the cloud, and based on the dynamic conversion latency, enhance the adjustment amplitude of the control instructions in advance to achieve flexible scheduling.
[0008] This invention provides a flexible control method for renewable energy power grids based on load forecasting, which can effectively improve the accuracy of flexible control. In implementing flexible control, this invention addresses the issue that existing control commands do not consider the dynamic delays caused by protocol conversion and data processing at the edge gateway, leading to command execution lagging behind actual load changes and resulting in control failure. To solve this problem, this invention acquires real-time operating data from the edge gateway and calculates the protocol characteristic entropy and dynamic conversion delay based on this data, thereby accurately predicting the actual execution time of commands at the physical device end. Furthermore, this invention enhances the compensation of the adjustment amplitude of control commands in advance, effectively offsetting the phase lag caused by time delays. This ensures that flexible control actions such as peak shaving and valley filling accurately hit the peak or valley load times, effectively improving the accuracy and response speed of renewable energy power grid control, avoiding secondary grid oscillations that may be caused by control lag, and thus effectively enhancing grid stability.
[0009] According to the present invention, a flexible control method for a new energy power grid based on load forecasting is provided. The step of obtaining real-time operating data of the edge gateway at each sampling time includes: listening to and recording the raw data stream on all active communication links at each sampling time in real time through the physical drive interface of the edge gateway; preprocessing the raw data stream to obtain real-time operating data; wherein, the real-time operating data includes at least the protocol message length, function code, number of concurrent protocols, buffer queue length, and CPU utilization at the current sampling time.
[0010] According to the present invention, a flexible control method for a new energy power grid based on load forecasting is provided. The step of calculating the real-time protocol feature entropy at each sampling time based on real-time operating data includes: statistically analyzing the function code distribution of the protocol corresponding to the current sampling time based on a sliding window, and calculating the Shannon information entropy of the protocol using the information entropy formula; multiplying the ratio of the message length of the protocol at the current sampling time to the rated processing speed of the edge gateway by the Shannon information entropy to obtain the real-time protocol feature entropy of the protocol at the current sampling time.
[0011] This invention provides a method for calculating protocol feature entropy based on the probability of function code occurrence. This method can convert the inherent logical complexity of protocol parsing and the disorder of data flow into specific processing time overhead, thereby more accurately assessing the parsing difficulty and potential latency of the edge gateway at the current moment, and providing input parameters that are closer to physical reality for the calculation of dynamic conversion latency.
[0012] According to the present invention, a flexible control method for a new energy power grid based on load forecasting is provided. The calculation of the dynamic switching delay of the edge gateway at the current sampling time includes: multiplying and accumulating the real-time protocol feature entropy of each concurrent protocol at the current sampling time with the corresponding weight factor to obtain the theoretical parsing time; dividing the buffer queue length at the current sampling time by the hardware forwarding throughput to obtain the basic queuing time; and multiplying the sum of the theoretical parsing time and the basic queuing time by a linear penalty factor constructed from the CPU utilization at the current sampling time to obtain the dynamic switching delay at the current sampling time.
[0013] This invention calculates dynamic transition latency by combining theoretical parsing time, queuing time, and a penalty term based on CPU utilization. This allows for the assessment of nonlinear latency spikes caused by resource contention under high load. Compared to existing linear latency estimation models, this invention can more accurately predict the performance drop of edge gateways near their computing power limits, thus providing more reliable latency predictions at critical moments and avoiding insufficient adjustment and compensation due to underestimating high-load latency.
[0014] According to the present invention, a flexible control method for a new energy power grid based on load forecasting is provided. The linear penalty factor is obtained by multiplying the environmental disturbance coefficient by the CPU utilization rate at the current sampling time and adding 1. The weight factor is used to characterize the priority coefficient of the corresponding protocol, and the weight factor of the control protocol is greater than that of the acquisition protocol.
[0015] This invention provides a method for obtaining linear penalty factors. By setting differentiated weighting factors for different protocol types, it ensures that important control instructions receive higher parsing priority, avoiding blocking by data acquisition tasks. Simultaneously, through a linear combination of environmental disturbance coefficients and CPU utilization, it accurately analyzes the physical process of drastic bandwidth contraction under high load.
[0016] According to the present invention, a flexible control method for a new energy power grid based on load forecasting is provided. The method for enhancing the adjustment amplitude of the control command in advance includes: obtaining the time corresponding to the future load exceeding the limit as the target execution time according to the LSTM load forecasting algorithm; using the difference between the target execution time and the dynamic conversion delay as the physical time node for triggering execution; and issuing a control command with enhanced adjustment amplitude when the system natural time reaches the physical time node.
[0017] This invention provides a precise method for calculating control commands. Based on the principles of feedforward control and phase compensation in automatic control theory, the predicted load change rate is integrated within a time delay window, enabling early assessment of future disturbances. By calculating the cumulative total load power fluctuation within the time delay window, the amplitude adjustment is combined with the cumulative deviation of the predicted load, avoiding overcompensation or undercompensation.
[0018] According to the present invention, a flexible regulation method for a new energy power grid based on load forecasting is provided. The method for obtaining the regulation amplitude includes: obtaining the time interval covered by the dynamic conversion delay duration traced back from the target execution time as the endpoint; summing the load change rate within the time interval to obtain the time delay energy accumulation value; calculating a compensation operator based on the ratio of the dynamic conversion delay to the fixed sampling period of the meter; and multiplying the time delay energy accumulation value by the compensation operator to obtain the regulation amplitude.
[0019] According to the present invention, a flexible control method for a new energy power grid based on load forecasting is provided, wherein the compensation operator is the reciprocal of the complement of the ratio with respect to 1.
[0020] According to the present invention, a flexible control method for a new energy power grid based on load forecasting is provided. After the flexible scheduling is achieved, the method further includes: continuously collecting the actual response value returned by the terminal through an edge gateway within a fixed sampling period of the meter after the control command is issued; for each sampling moment, calculating the absolute value of the difference between the historical adjustment amplitude corresponding to the control command and the actual response value, and dividing the absolute value of the difference by the historical adjustment amplitude corresponding to the control command to obtain the relative deviation rate at the current sampling moment; within a preset window range, statistically analyzing the relative deviation rates of all sampling moments; if the relative deviation rate of any sampling moment exceeds a preset safety threshold, or the relative deviation rates of multiple consecutive sampling moments all exceed a preset warning threshold, then the control execution is determined to be abnormal.
[0021] Secondly, the present invention provides a flexible control system for a new energy power grid based on load forecasting, which adopts the following technical solution: A flexible control system for a new energy power grid based on load forecasting includes a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement the aforementioned flexible control method for a new energy power grid based on load forecasting.
[0022] By adopting the above technical solution, a computer program for a new energy power grid flexible control method based on load forecasting is generated and stored in a memory so that it can be loaded and executed by a processor. Terminal equipment can then be made based on the memory and processor for convenient use.
[0023] The present invention has the following technical effects: Based on the above technical solutions, this invention provides a flexible control method and system for new energy power grids based on load forecasting. It analyzes the message surface length using real-time protocol characteristic entropy to measure the workload of the kernel protocol stack in micro-logic judgment scenarios under multi-protocol concurrency. It maps the dynamic losses from heterogeneous protocol parsing into predictable parameters with time dimensions in real time, and couples the number of concurrent protocols, buffer queue length, and CPU utilization to construct a dynamic conversion delay model, realizing a real-time closed-loop mapping of gateway internal protocol conversion losses to control decisions. Furthermore, by reverse-shifting the target execution time and enhancing the feedforward of the adjustment amplitude, the control actions after protocol conversion accurately hit the peak of power grid load fluctuations, effectively reducing the risk of secondary oscillations in power grid frequency caused by dynamic delays, and improving the accuracy of peak-shaving and valley-filling commands and the maintenance of power grid supply-demand balance in virtual power plants under heterogeneous communication environments. Attached Figure Description
[0024] Figure 1 A flowchart illustrating a flexible control method for a new energy power grid based on load forecasting, provided in an embodiment of the present invention; Figure 2 A comparison chart of control accuracy schemes based on phase feedforward compensation provided in an embodiment of the present invention. Detailed Implementation
[0025] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.
[0026] This invention discloses a flexible control method for renewable energy power grids based on load forecasting. For details, please refer to [link / reference]. Figure 1 As shown, Figure 1 This invention provides a flowchart illustrating a flexible control method for a new energy power grid based on load forecasting. The method specifically includes the following steps: S1: Obtain real-time operational data from the edge gateway.
[0027] It should be noted that this step is the physical starting point of the flexible control closed loop, enabling non-interventional acquisition of the underlying raw physical signals. Industrial and commercial sites contain a vast array of heterogeneous communication protocols. If this data acquisition step is not performed and subsequent processing proceeds directly, the system will be unable to obtain raw input data with a true time anchor point. This will cause all subsequent delay compensation calculations to be based on offline statistical averages rather than real-time physical true values, leading to the failure of the control phase shift and causing the virtual power plant's peak shaving actions to become disconnected from the load peak on the time axis.
[0028] Based on this, embodiments of the present invention can establish a high-frequency lossless image capture mechanism to ensure that each input parameter has its original physical attributes and time tags.
[0029] Furthermore, within the unified operating system framework, the gateway kernel monitors and records the raw data streams on all active communication links in real time at each sampling moment through the physical driver interface. It monitors and records the raw bitstream in the buffer, the CPU instruction cycle count within the gateway, the real-time queuing bitmap of the kernel task scheduler, and the raw sampled values with timestamps sent by the terminal at each sampling moment through the physical driver interface. After preprocessing, real-time running data is obtained. This real-time running data includes at least the message length, function code, number of concurrent protocols within the edge gateway, buffer queue length, and CPU utilization of the corresponding protocol at the current sampling moment.
[0030] The data acquisition frequency can be set to 10kHz, corresponding to a sampling period of 0.1 milliseconds, which can be adjusted according to actual needs. Preprocessing can include interpolation of missing data, data standardization, etc.
[0031] Thus, by processing the real-time mirror acquisition of the underlying heterogeneous original physical parameters, the embodiments of the present invention can effectively provide the most basic objective basis for reducing the black box effect in the control process, thereby providing an accurate data foundation for subsequent digital modeling.
[0032] S2: Calculate the real-time protocol feature entropy at each sampling time.
[0033] For example, the real-time protocol feature entropy required for parsing each protocol message at the current sampling time can be calculated based on real-time running data. The real-time protocol feature entropy is positively correlated with the message length and function code distribution disorder of the corresponding protocol within the edge gateway, and negatively correlated with the rated processing speed of the edge gateway.
[0034] It should be noted that this step is the starting point for data processing, aiming to transform the acquired raw bitstream into an assessable protocol processing difficulty. Because the message payload and control code distribution may shift instantaneously at different sampling times in industrial and commercial scenarios, without processing, the system will be unable to capture the dynamic changes in protocol parsing difficulty, leading to linear distortion in latency prediction during peak message periods.
[0035] Based on this, embodiments of the present invention can monitor protocol complexity in real time, transforming implicit software processing losses into explicit computational resource consumption.
[0036] Furthermore, to address the problem that static complexity cannot describe the unpredictable processing time caused by fluctuations in real-time processing pressure, this embodiment of the invention maps the uncertainty of a message to a complexity benchmark with time dimensions in real time using a formula. This is because information entropy in Shannon's information theory can penetrate the surface length of a message and directly measure the amount of micro-logical judgment work required by the kernel protocol stack during data reassembly, thus mapping abstract protocol logic branches to specific computational execution time. Based on this, a hardware processing time term is introduced, mapping information complexity to specific time consumption through hardware processing speed, allowing information theory concepts to be directly applied to the time analysis of real-time systems.
[0037] For ease of understanding, the current sampling time is recorded as the sampling time in this embodiment of the invention. Processing is performed so that all sampling times can be used as sampling times. Perform the following data processing.
[0038] For example, in this embodiment of the invention, the Shannon information entropy of a protocol at the current sampling time is calculated based on the sliding window statistical function code distribution and the information entropy formula. The Shannon information entropy is then multiplied by the ratio of the message length of the protocol data frame at the current sampling time to the rated processing speed of the edge gateway to obtain the real-time protocol feature entropy of the protocol at the current sampling time.
[0039] For ease of understanding, embodiments of the present invention provide a relational formula for calculating the feature entropy of a real-time protocol, used to describe the logical relationships between various features. Specifically, the calculation of the feature entropy of a real-time protocol can be found in the following relational formula: ; in, Sampling time No. The real-time protocol feature entropy of the first protocol is used to characterize the feature entropy of the second protocol. The dynamic basic time complexity required for protocol parsing, in seconds; Sampling time No. The Shannon information entropy of the protocol is obtained by the kernel-mode protocol monitoring module in real time by statistically analyzing the coding distribution within the sliding window. This value is a dimensionless quantity. Sampling time No. The message length of a protocol data frame is used to characterize the... Time of the first The actual byte length of the protocol data frame, in bytes ( This can be read directly from the packet capture interface, and the specific settings can be configured according to actual needs; The rated processing speed of the edge gateway is used to characterize the hardware computing power level of the gateway. Optionally, in this embodiment of the invention, it can be set to 102400 bytes per second. ).
[0040] In this relation, the Shannon information entropy formula is: This describes the real-time consumption of computing power by the amount of information. The total number of function code symbols, used to represent the first... The total number of feature fields defined by the protocol can optionally be set to 256 in this embodiment of the invention; Sampling time No. The first of the agreements The probability density of the occurrence of a function code is used to characterize the instantaneous probability density of the occurrence of the function code. This value can be obtained by the kernel mode protocol monitoring module in real time by statistically analyzing the code distribution within the sliding window, and the value ranges from 0 to 1. It is a logarithmic function with base 2. Specifically, information entropy represents the disorder of a data structure. A higher entropy value means that the protocol stack needs to go through more logical decision branches when performing pattern matching and field reorganization, directly increasing the execution time of the CPU instruction stream.
[0041] The ratio increases dramatically due to the increased message length or more random coding distribution at the current sampling time, causing a sharp increase in the total number of clock cycles required for the gateway to parse a single frame message. It represents the most basic pure time overhead required for hardware to process a data frame of this length under an absolutely ideal physical state where there are no code branch prediction errors and system resources are completely idle.
[0042] Because the disorder of the underlying data structure determines the computational workload during kernel parsing, when complex business instructions suddenly appear in industrial and commercial sites, the distribution of control function codes contained in the message will become more discrete and random, resulting in a sharp increase in information entropy. As the gateway kernel parses such single-frame messages, the cache hit rate drops significantly, which forces a sharp increase in the total number of underlying clock cycles of the central processing unit, thereby increasing the entropy of the real-time protocol features. The two exhibit a significant positive correlation and causal linkage at the physical execution level.
[0043] Calculation example: If at a certain sampling time, the first... Protocol message length 512 bytes, gateway computing power level The data rate is 102,400 bytes per second. The accumulated entropy of the function code information, obtained through sliding window statistics, is 4.
[0044] Substituting the above formula into the calculation, we can obtain Seconds. That is, the current basic time complexity of this protocol is 0.02 seconds.
[0045] Thus, by measuring the entropy complexity of protocol features, this embodiment of the invention can convert network packet fluctuations into specific time loss values, thereby providing an accurate data foundation for the construction of subsequent dynamic protocol conversion delay models.
[0046] S3: Calculate the dynamic switching latency of the edge gateway.
[0047] For example, the dynamic switching delay of the edge gateway at the current sampling time can be obtained based on the real-time protocol characteristic entropy, the number of concurrent protocols in the edge gateway, the buffer queue length, and the CPU utilization. The dynamic switching delay is positively correlated with the real-time protocol characteristic entropy, buffer queue length, and CPU utilization of all concurrent protocols in the edge gateway.
[0048] It should be noted that this step couples the calculated single-protocol complexity with the overall concurrency state of the gateway at the current moment. The gateway device is in a high-load, multi-threaded task concurrency preemption state most of the time. The massive number of parsing tasks of different protocol types compete for the gateway's extremely limited internal cache space and system bus bandwidth. Therefore, the time consumption of the gateway parsing task is affected by system load, memory swapping, and kernel scheduling algorithms.
[0049] If only the complexity of a single protocol is considered, the context protection and recovery losses caused by multi-task switching will be ignored, resulting in an underestimation of latency in multi-load scenarios. Such deviations will accumulate in the final control loop, causing unpredictable delays in control commands.
[0050] Based on this, embodiments of the present invention can convert the physical operating status of the gateway into congestion resistance in real time over a time dimension.
[0051] Furthermore, to address the difficulty in determining the dwell time of instructions within the gateway's internal buffer under high concurrency environments, this embodiment of the invention introduces a linear penalty factor with system load rate as the independent variable. This factor directly amplifies the base latency proportionally using CPU utilization, thus fitting the latency growth characteristics exhibited by the operating system when approaching its computing power limit due to frequent interrupt handling and task preemption. By calculating the dynamic conversion delay at each sampling moment, a closed-loop mapping from protocol characteristics to physical waiting time is achieved.
[0052] For example, the real-time protocol feature entropy of each concurrent protocol at the sampling time is multiplied by its corresponding weight factor and summed to obtain the theoretical parsing time at the sampling time; the buffer queue length at the sampling time is divided by the hardware forwarding throughput to obtain the basic queuing time; the sum of the theoretical parsing time and the basic queuing time is multiplied by the linear penalty factor to obtain the dynamic conversion delay at the sampling time, where the linear penalty factor is 1 plus the product of the environmental disturbance coefficient and the gateway CPU utilization at the sampling time.
[0053] The basic queuing time, derived from the buffer queue length and hardware forwarding throughput, is the fundamental service time model in queuing theory. However, traditional queuing models typically assume that the service times of all tasks follow the same distribution. Therefore, this invention introduces a weighted value of the real-time protocol characteristic entropy to incorporate the differences in service times of different tasks in multi-protocol concurrent scenarios into the model. Furthermore, it amplifies the time overhead differences in gateway processing different protocol packets through weighted scheduling priority. Based on this, considering that the service rate in traditional queuing theory is usually assumed to be constant, this invention uses a linear penalty factor to fit the physical process of operating system task scheduling, interrupt handling, and context switching overhead increasing with CPU utilization, enabling the latency model to reflect the linear impact of system resource contention on processing capacity.
[0054] For ease of understanding, embodiments of the present invention provide a relational formula for calculating dynamic transition delay, used to describe the logical relationship between various features. Specifically, the calculation of dynamic transition delay can be found in the following relational formula: ; in, Sampling time The dynamic conversion delay is used to characterize the total estimated dwell time of the control command, in seconds; Sampling time The total number of concurrent protocols, used to characterize the sampling time. The number of protocol types that the gateway is concurrently resolving; Sampling time No. Real-time protocol feature entropy of the protocol; The preset weighting factor is used to characterize the priority coefficient of the protocol. Optionally, in this embodiment of the invention, the important control class can be set to 1.2 and the acquisition class can be set to 0.8. The specific settings can be made according to actual needs. Sampling time The length of the buffer queue is used to characterize the sampling time. The amount of packets piling up in the gateway's pending buffer; The hardware forwarding throughput is used to characterize the fixed limit value of the hardware. In this embodiment of the invention, it can be optionally set to 5000 packets / second. The environmental disturbance coefficient is used to characterize a static constant. Optionally, in this embodiment of the invention, it can be set to 1.05. Sampling time Gateway CPU utilization.
[0055] In this relation, the priority-weighted parse term The theoretical parsing time for all currently active concurrent tasks, considering system scheduling priorities, was calculated. Basic physical queuing term. This describes the absolute physical latency after a packet enters the gateway, purely limited by memory read / write operations and bus queuing. Resource contention penalty item. The amplification effect of resource contention under high load is described.
[0056] As system load increases, the kernel needs to handle more context switches and interrupt responses. When the system load approaches a critical value, the CPU frequently performs page fault handling and task preemption, leading to a sharp contraction in effective processing bandwidth. Because the increase in the total number of concurrent protocols or the rise in system load causes frequent interruptions in the instruction pipeline within the kernel, the higher the CPU utilization, the greater the dynamic translation latency, reflecting the computational strain effect under high load. The resulting data value is also larger, showing a positive correlation.
[0057] Calculation example: If the total theoretical parsing time is 0.02 seconds, the length of the queue to be processed... For 50 packets, hardware forwarding throughput With a throughput of 1000 packets per second, the base queuing time is 0.05 seconds. Current system load rate. The environmental disturbance coefficient is 0.8. Take 1.05. Substitute it into the relation, and the penalty result is... The dynamic conversion delay is then... Second.
[0058] Thus, by calculating the dynamic protocol transition delay of state awareness, this embodiment of the invention can identify nonlinear delays caused by gateway load fluctuations online, thereby providing an accurate data basis for subsequent phase shift compensation.
[0059] S4: Adjust the adjustment amplitude of the control command to achieve flexible scheduling.
[0060] For example, in response to the control commands issued by the cloud, the execution time of the control commands is predicted, and the adjustment amplitude of the control commands is enhanced in advance based on the dynamic conversion delay to offset the phase lag of the physical execution end. The adjustment amplitude is positively correlated with the dynamic conversion delay and the load change rate.
[0061] It should be noted that the goal of this step is to reconstruct the theoretical control commands issued from the cloud by performing a reverse shift on the physical time axis using the real-time latency data output from the previous steps. In industrial and commercial microgrid production environments containing massive distributed photovoltaic and energy storage devices, the power balance system at the park level is extremely fragile and highly time-sensitive. The power peak-shaving commands issued from the cloud base are usually generated based on the assumption of an ideal network environment, ignoring the physical time spent on protocol conversion within the edge gateway. If strict reverse shift and amplitude compensation are not performed at this stage, the circuit breaker action at the physical end will always lag behind the actual peak load fluctuations in the power grid in absolute physical time. This kind of phase shift in the time dimension is a significant physical cause of the failure of flexible control in virtual power plants.
[0062] Based on this, embodiments of the present invention can use the currently collected microscopic delay to predict the future action lag, and realize the preemptive intervention of instructions on the time axis.
[0063] For example, the triggering logic for predicting the execution time of the control command and increasing the adjustment amplitude of the control command in advance based on the dynamic switching delay is as follows: the difference between the target execution time and the dynamic switching delay is used as the physical time node for triggering execution; the system at the sampling time... Continuous detection is performed, and when the system's natural time reaches the physical time node, control commands based on the adjusted amplitude are issued through the standard interface of the Elec-Tech operating system.
[0064] For example: Target execution time The time of sampling is 14:00:00, which is the precise time point of future load fluctuations predicted by the algorithm, i.e., the ideal time for control actions to occur. The dynamic conversion latency is 0.5 seconds, which is the physical time consumed in real time due to different protocol conversions, hardware processing, and network congestion. To trigger the execution at the physical time point, the system needs to immediately trigger the action at 13:59:59.5.
[0065] Furthermore, to address the issue that delays caused by instruction conversion within the gateway can lead to adjustments deviating from the target load change range, this embodiment of the invention constructs a compensation operator to offset physical delays by reverse-shifting the integral window on the time axis.
[0066] Specifically, based on feedforward control and phase compensation in automatic control theory, feedforward compensation can be performed for a known dynamic time-delay disturbance. Traditional feedforward compensation relies on the measurability of the disturbance. This embodiment of the invention further integrates the predicted load change rate within the time delay window, thus combining the amplitude adjustment of the control command with the predicted cumulative load deviation, achieving advance assessment of future disturbances and thereby realizing feedforward compensation.
[0067] Based on this, the embodiments of the present invention incorporate the compression effect of time delay on the execution window into the compensation amount calculation, which can ensure that the predetermined control task is completed within a limited time, thereby achieving the goal of offsetting system lag by taking actions in advance and increasing the amplitude.
[0068] For example, the target execution time can be obtained by using a Long Short-Term Memory (LSTM) artificial neural network load forecasting algorithm; the time interval covered by the dynamic conversion delay duration traced back from the target execution time can be obtained; the cumulative energy value of the delay can be determined by summing the discrete sequence of load change rate output by the cloud-based load forecasting algorithm within the time interval; a compensation index can be calculated, which is the complement of the ratio of dynamic conversion delay to the fixed sampling period of the meter relative to 1; the reciprocal of the compensation index can be used as the compensation operator; and the cumulative energy value of the delay can be multiplied by the compensation operator to obtain the adjustment amplitude of the predictive control command.
[0069] The LSTM load forecasting algorithm is deployed on a cloud-based converged platform. The step of obtaining future load trends through this algorithm to determine the time when future load exceeds the limit can be implemented by existing technologies, and will not be described in detail here.
[0070] For example, the adjustment amplitude of the predictive control command can be calculated using the following formula: ; in, To predict the adjustment amplitude of the control command, it is used to characterize the terminal adjustment amplitude that must actually be executed at the target execution time after phase feedforward compensation calculation; The target execution time is used to characterize the specific absolute physical time of future load exceeding the limit given by the cloud load forecasting algorithm; This is the cumulative energy value due to time delay, used to characterize the total amount of load power fluctuations that have objectively occurred in the power grid and cannot be adjusted in a timely manner during the period when the command is delayed or stuck by the internal parsing mechanism of the gateway. Sampling time Dynamic conversion latency; To fix the sampling period of the electricity meter, optionally, in this embodiment of the invention, it can be set to 60 seconds, but the specific setting can be made according to actual needs.
[0071] in, . It is the target execution time minus the dynamic transition delay, i.e., the starting point of the time interval, the target execution time. It is the end of the time interval.
[0072] In this relationship, the lag window energy integral term This describes how, due to the forced occupancy of gateway latency, physical devices need to catch up with the fluctuations in the prediction curve within a limited sampling period. Therefore, the larger the dynamic conversion latency, the greater the demand for overcompensation after compensation in order to complete the original energy balance task within the shortened remaining time, resulting in a larger final data value, showing a positive correlation.
[0073] Figure 2 This is a comparison chart of control accuracy schemes based on phase feedforward compensation provided in an embodiment of the present invention. The horizontal axis represents the running time, and the vertical axis represents the power adjustment range.
[0074] This figure illustrates the actual effect of phase feedforward compensation. Existing technologies not only lag behind the ideal target in time but also exhibit significantly lower adjustment amplitudes due to the lack of offsetting physical losses, creating a noticeable control blind spot. The optimized curve of this invention effectively reduces phase shift by predicting dynamic delays and intervening in advance, bringing the adjustment peak closer to the ideal requirement in time. Simultaneously, the curve peak height is slightly higher than the ideal value, reflecting the strategy of using the load change rate function to enhance the adjustment amplitude in advance, thereby offsetting the physical lag at the execution end.
[0075] Thus, by calculating the phase shift and intensity enhancement of the command, the embodiments of the present invention can effectively transform the prediction at the purely digital level into feedforward control with physical execution significance, thereby providing an accurate data foundation for the subsequent implementation and verification of flexible control commands.
[0076] Industrial environments are subject to uncontrollable factors such as electromagnetic interference, power grid voltage fluctuations, and delayed response of terminal equipment, which may cause the actual physical response to deviate from the expected target. Therefore, embodiments of the present invention can establish a feedback verification and anomaly handling mechanism after the command is issued to ensure the reliability of the control closed loop.
[0077] Furthermore, to transform complex execution trajectory deviations into quickly quantifiable engineering indicators, this embodiment of the invention uses the relative deviation rate as the judgment criterion. This indicator directly reflects the achievement of control commands at the physical execution end by calculating the degree of deviation between the actual response value and the target value.
[0078] For example, within a fixed sampling period of the meter after the control command is issued, the actual response value transmitted back by the terminal is continuously collected through the edge gateway; for each sampling moment, the absolute value of the difference between the historical adjustment amplitude corresponding to the control command and the actual response value is calculated, and the absolute value of the difference is divided by the historical adjustment amplitude corresponding to the control command to obtain the relative deviation rate of the current sampling moment; within a preset window range, the relative deviation rate of all sampling moments is statistically analyzed. If the relative deviation rate of any sampling moment exceeds the preset safety threshold, or the relative deviation rate of multiple consecutive sampling moments exceeds the preset warning threshold, the control execution is determined to be abnormal.
[0079] The construction method of the preset window specifically includes: taking the physical time node that triggers the execution of the control command as the starting point, acquiring continuous sampling data within the fixed sampling period of the electricity meter to construct the window, and the window length can be set according to actual needs.
[0080] Among them, the historical adjustment amplitude corresponding to the control command is the ideal control expectation value actually issued to the terminal equipment; the actual response value is the active power or current sampling data with timestamps that is obtained from the terminal in real time through the edge gateway.
[0081] Optionally, in this embodiment of the invention, the preset safety threshold can be set to 5%, the preset warning threshold can be set to 3%, and the number of consecutive samplings exceeding the threshold can be set to 3. The specific settings can be made according to actual needs.
[0082] For example, when an abnormality is determined in the control execution, the system can perform the following abnormality handling operations: In one scenario, a control deviation log can be recorded. The system will persistently store the target value, actual response value, calculated relative deviation rate, and corresponding dynamic conversion delay at the time of the anomaly, forming a traceable control anomaly record for subsequent manual auditing or offline analysis.
[0083] In another scenario, the data can be reported to the cloud-integrated base. The edge gateway uploads anomaly indicators and key operating parameters to the cloud-integrated base via a standard communication interface. The cloud then performs macro-level situational awareness and multi-site collaborative analysis, and, if necessary, directly issues emergency control strategies.
[0084] In another scenario, real-time operational data is reacquired and the real-time protocol feature entropy is updated. The edge gateway immediately triggers a high-frequency lossless image capture mechanism to reacquire the original bitstream, CPU utilization, buffer queue length, and number of concurrent protocols at the current sampling moment, and recalculates the real-time protocol feature entropy to calibrate the model drift caused by sudden changes in field conditions.
[0085] In addition, it can execute a safe rollback or maintain the current command. Before the recalibration is completed, the system suspends the issuance of new feedforward compensation control commands, maintains the current execution state of the terminal device, or outputs according to a preset conservative safety strategy to prevent continuous control instability caused by model inaccuracies.
[0086] When the control is determined to be normal, that is, when the relative deviation rate of all sampling times within the preset window is within the allowable range, the system maintains the current real-time protocol characteristic entropy benchmark, does not perform recalibration, and directly enters the next control cycle.
[0087] Thus, by using conventional deviation rate verification and anomaly handling operations, this embodiment of the invention effectively reduces the complexity of engineering implementation and on-site operation and maintenance while maintaining the integrity of the control closed loop, thereby providing a reliable execution guarantee for the efficient operation of the new power system control.
[0088] This invention also discloses a flexible control system for a new energy power grid based on load forecasting, including a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement a flexible control method for a new energy power grid based on load forecasting provided by this invention.
[0089] The system also includes other components well known to those skilled in the art, such as communication buses and communication interfaces, the settings and functions of which are known in the art and will not be described in detail here.
[0090] In this invention, the aforementioned memory can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0091] The above are all preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Therefore, all equivalent changes made in accordance with the structure, shape and principle of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A flexible control method for a new energy power grid based on load forecasting, characterized in that, include: S1, acquire the real-time operating data of the edge gateway at each sampling time; S2, based on real-time running data, calculates the real-time protocol feature entropy at each sampling moment. The real-time protocol feature entropy is used to characterize the dynamic basic time complexity required for parsing the corresponding protocol. S3, based on the real-time protocol feature entropy, combined with the number of concurrent protocols of the edge gateway, the buffer queue length and CPU utilization, calculates the dynamic conversion delay of the edge gateway at the current sampling time; S4 responds to control commands issued from the cloud and, based on dynamic conversion latency, enhances the adjustment amplitude of the control commands in advance to achieve flexible scheduling.
2. The flexible control method for new energy power grids based on load forecasting according to claim 1, characterized in that, The acquisition of real-time operational data of the edge gateway at each sampling time includes: Through the physical driver interface of the edge gateway, the raw data streams on all active communication links are monitored and recorded in real time at each sampling moment; the raw data streams are preprocessed to obtain real-time running data; The real-time running data includes at least the message length, function code, number of concurrent protocols, buffer queue length, and CPU utilization at the current sampling time.
3. The flexible control method for new energy power grids based on load forecasting according to claim 1, characterized in that, The calculation of the real-time protocol feature entropy at each sampling moment based on real-time operational data includes: Based on the sliding window statistics of the function code distribution of the protocol at the current sampling time, the Shannon information entropy of the protocol is calculated using the information entropy formula; the ratio of the message length of the protocol at the current sampling time to the rated processing speed of the edge gateway is multiplied by the Shannon information entropy to obtain the real-time protocol feature entropy of the protocol at the current sampling time.
4. The flexible control method for new energy power grids based on load forecasting according to claim 1, characterized in that, The calculation of the dynamic conversion delay of the edge gateway at the current sampling time includes: The theoretical parsing time is obtained by multiplying the real-time protocol feature entropy of each concurrent protocol at the current sampling time with the corresponding weight factor and summing the results; the basic queuing time is obtained by dividing the buffer queue length at the current sampling time by the hardware forwarding throughput; and the dynamic conversion delay at the current sampling time is obtained by multiplying the sum of the theoretical parsing time and the basic queuing time by a linear penalty factor constructed from the CPU utilization at the current sampling time.
5. A flexible control method for a new energy power grid based on load forecasting according to claim 4, characterized in that, The linear penalty factor is obtained by multiplying the environmental disturbance coefficient by the CPU utilization rate at the current sampling time and then adding 1; the weight factor is used to characterize the priority coefficient of the corresponding protocol, and the weight factor of the control protocol is greater than that of the acquisition protocol.
6. The flexible control method for new energy power grids based on load forecasting according to claim 1, characterized in that, The adjustment amplitude of the aforementioned enhanced control command includes: The time corresponding to the future load exceeding the limit is obtained according to the LSTM load prediction algorithm as the target execution time; the difference between the target execution time and the dynamic conversion delay is used as the physical time node to trigger execution; when the system natural time reaches the physical time node, the control command after adjustment and amplitude enhancement is issued.
7. A flexible control method for a new energy power grid based on load forecasting according to claim 6, characterized in that, The method for obtaining the adjustment amplitude includes: Obtain the time interval covered by the dynamic conversion delay duration, starting from the target execution time and tracing back to the target execution time; sum the load change rate within the time interval to obtain the cumulative delay energy value; calculate the compensation operator based on the ratio of the dynamic conversion delay to the fixed sampling period of the meter; multiply the cumulative delay energy value by the compensation operator to obtain the adjustment amplitude.
8. A flexible control method for a new energy power grid based on load forecasting according to claim 7, characterized in that, The compensation operator is the reciprocal of the ratio relative to the complement of 1.
9. A flexible control method for a new energy power grid based on load forecasting according to claim 1, characterized in that, The implementation of flexible scheduling also includes: Within a fixed sampling period of the meter after the control command is issued, the actual response value transmitted back by the terminal is continuously collected through the edge gateway. For each sampling moment, the absolute value of the difference between the historical adjustment amplitude corresponding to the control command and the actual response value is calculated, and the absolute value of the difference is divided by the historical adjustment amplitude corresponding to the control command to obtain the relative deviation rate of the current sampling moment. Within a preset window range, the relative deviation rate of all sampling moments is statistically analyzed. If the relative deviation rate of any sampling moment exceeds the preset safety threshold, or the relative deviation rate of multiple consecutive sampling moments exceeds the preset warning threshold, the control execution is determined to be abnormal.
10. A flexible control system for a new energy power grid based on load forecasting, characterized in that, include: A processor and a memory, wherein the memory stores computer program instructions that, when executed by the processor, implement a flexible control method for a new energy power grid based on load forecasting as described in any one of claims 1-9.
Citation Information
Patent Citations
Method and system for improving multi-user regulation and control response time efficiency of photovoltaic transformer area
CN121584771A
