Power decision-making method, system and equipment and medium
By combining a dynamic communication scheduling module and a lock-free buffer, the problem of low communication efficiency in modular power decision-making systems is solved, enabling low-latency, high-throughput data interaction and improving the real-time performance and reliability of power decision-making systems.
Patent Information
- Application Number
- CN202511571788.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-30
- Publication Date
- 2026-01-16
AI Technical Summary
Existing modular power decision-making methods suffer from low communication efficiency and rigid resource allocation due to static interaction mechanisms. This makes it impossible to achieve efficient data interaction with low latency and high throughput in complex scenarios with high concurrency and mixed services, thus affecting the real-time performance and accuracy of decision-making.
A dynamic communication scheduling module is adopted to allocate communication channels based on feature information tuples. The matching degree is calculated by preset balance factor and real-time load factor, and the communication path is dynamically selected. Combined with lock-free buffer and standardized interface design, low-latency and high-throughput communication between modules is achieved.
It significantly improves the real-time performance, reliability, and portability of power decision-making systems, reduces development and maintenance costs, and ensures efficient data interaction and accurate decision-making in complex scenarios.
Smart Images

Figure CN121355883A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power systems, and more particularly to a power decision-making method, system, device, and medium. Background Technology
[0002] As the power grid expands and its structure becomes increasingly complex, the sources, grids, and loads all exhibit the "dual high" characteristics of high proportion of renewable energy access and high degree of power electronics, leading to a surge in the variability, uncertainty, and complexity of the system's operating status.
[0003] Currently, existing technologies employ a modular power decision-making method based on deep reinforcement learning. This method uses a modular design approach, encapsulating functions such as data acquisition, environmental simulation, agent training, and decision generation into independent modules. These modules connect and exchange data through predefined, statically bound communication interfaces, collaboratively completing the decision-making process from grid state perception to control command generation. Its core lies in utilizing a deep reinforcement learning agent to autonomously learn and output scheduling decisions through interaction with the grid simulation environment (one of the modules).
[0004] However, the biggest drawback of this existing technical solution lies in its static and fixed interaction mechanism between modules. Specifically, the communication paths, communication protocols, and resource allocation methods between modules are predetermined during the system design or coding phase, and cannot be dynamically adjusted according to the actual business load, data characteristics, and system status during runtime. Summary of the Invention
[0005] This invention provides a power decision-making method, system, device, and medium that can overcome the problems of low communication efficiency and rigid resource allocation caused by static interaction mechanisms in existing modular power decision-making methods. In this way, it can achieve low latency, high throughput, and adaptive high-efficiency data interaction in complex scenarios with high concurrency and multiple services, so as to ensure the real-time performance and accuracy of decision-making.
[0006] This invention provides a power decision-making method, comprising:
[0007] Acquire power grid operation data;
[0008] The power grid operation data is input into the power system decision model to obtain a power decision scheme, and the power system is controlled according to the power decision scheme. The decision model includes a model framework, multiple middleware components, and a communication scheduling module. The communication scheduling module dynamically allocates communication channels based on the feature information tuples in the communication request, so that the model framework and the middleware can communicate with each other based on the communication channels.
[0009] This invention provides a closed-loop system from raw power grid data to executable scheduling / control strategies by acquiring power grid operation data, inputting it into a decision model, and obtaining a power decision-making scheme. This supports real-time or day-ahead auxiliary decision-making. The decision model includes a model framework, multiple middleware modules, and a communication scheduling module. This decouples the complex decision-making system into clearly defined, reusable, and scalable modular components, reducing development and maintenance costs. The communication scheduling module dynamically allocates communication channels based on "feature information tuples," breaking through the traditional static binding communication mechanism and achieving runtime adaptive bandwidth / priority scheduling to avoid high-density data crowding out critical signaling channels. The model framework and middleware communicate via the allocated communication channels, ensuring low latency, high throughput, and on-demand communication between modules, improving the overall system response speed and stability. Overall, this embodiment proposes a modular, scalable, and communication-adaptive power decision-making system architecture. It introduces a communication scheduling center into the underlying layer of the power auxiliary decision-making intelligent agent for the first time, solving the problems of static communication, bandwidth waste, and response lag in traditional applications, and significantly improving the real-time performance, reliability, and portability of the decision-making system.
[0010] Furthermore, the dynamic allocation of communication channels based on the feature information tuples in the communication request specifically includes:
[0011] Based on the preset balance factor and the real-time load factor of each channel, the channel feature information and the feature information tuple of each channel are calculated to obtain the matching degree with each channel. The channel corresponding to the maximum value of each matching degree is used as the communication channel for data communication. The channel feature information includes delay feature parameters and bandwidth feature parameters, and the feature information tuple includes priority weight, data density weight, target middleware port, communication mode identifier and communication persistence identifier.
[0012] This feature information tuple includes: priority weight, data density, target port, communication mode, and persistence identifier. It comprehensively characterizes the urgency, data volume, direction, interaction method, and lifecycle of a communication task using five dimensions, providing a calculable basis for scheduling decisions. Channel feature information includes: delay feature parameters and bandwidth feature parameters, abstracting underlying network resources into quantifiable and matchable capability indicators, achieving semantic alignment between tasks and resources. A preset balancing factor and a real-time load factor are introduced to balance task requirements and real-time network status, preventing "high-priority but low-data-volume" tasks from being blocked by "large data blocks" for extended periods. The matching degree is calculated, and the channel with the maximum value is selected, achieving millisecond-level, uninterrupted communication path optimization, ensuring that critical control commands always use the fastest channel. Overall, this embodiment transforms the communication scheduling problem into a quantifiable and optimizable mathematical decision-making problem. Through a feature-resource matching degree model, it achieves dynamic routing at runtime, significantly improving the real-time performance of control signaling and the throughput efficiency of large data blocks without increasing hardware bandwidth. This is the core mechanism for high-performance communication in the entire system.
[0013] Furthermore, each of the aforementioned channels is pre-allocated by the communication scheduling module based on communication resources, specifically as follows:
[0014] Based on preset business requirements, the communication resources are statically divided into multiple channels, and the channel characteristic information of each channel is determined. The delay characteristic parameter of the first channel is greater than that of the second and third channels, and the priority of the first channel is greater than that of the second and third channels. The bandwidth characteristic parameter of the third channel is greater than that of the first and second channels, and the third channel includes a lock-free buffer.
[0015] This statically divides communication resources into three channels: the first (high priority, low latency), the second (regular), and the third (high bandwidth). Logical isolation prevents interference between different types of traffic, ensuring deterministic transmission of control signaling. The third channel includes a "lock-free buffer," replacing the traditional TCP / IP protocol stack with shared memory and lock-free algorithms. This eliminates overhead such as kernel-mode switching, serialization, and copying, achieving throughput close to the memory bandwidth limit. The characteristic parameters of each channel are pre-calibrated, providing stable and reusable input for matching degree calculations and avoiding frequent network state probing during runtime. Overall, this embodiment provides a structured and differentiated physical foundation for adaptive scheduling at the resource layer. In particular, the lock-free buffer enables high-density, zero-latency data exchange, addressing the pain point of drastic throughput drops in traditional networks under high-concurrency scenarios. This provides robust support for bandwidth-intensive applications such as large-scale power grid digital twins and online training.
[0016] Furthermore, the lock-free buffer is implemented based on a pre-allocated, physically contiguous shared memory region, specifically as follows:
[0017] In the shared memory region, concurrent read and write operations between the first component and the second component are achieved through atomic operations. The first component is used to generate and write data, and the second component is used to read and process data.
[0018] This pre-allocation of contiguous shared memory regions reduces TLB misses and page faults, improves memory access locality, and further reduces latency. Based on atomic operations (CAS), it achieves lock-free concurrency for multiple producers and consumers, completely avoiding lock contention, context switching, deadlocks, and priority inversion, and scaling linearly in multi-core environments. Write process: First, atomically allocate slots, then atomically commit pointers, ensuring data consistency while ensuring write threads never block. Read process: Atomically read and commit pointers, then atomically consume; consumers pull on demand, eliminating busy waiting and maximizing CPU utilization. Overall, this embodiment provides a hardware-level high-performance data exchange mechanism, making large data block transmission between middleware no longer a bottleneck, reducing latency from milliseconds to microseconds, and increasing throughput by more than 10 times, providing memory-level speed communication guarantees for scenarios such as real-time digital twins and online DRL training.
[0019] Furthermore, the power decision-making method further includes:
[0020] The framework and middleware, as well as the middleware itself, communicate based on a preset communication interface. The preset communication interface includes a control port, a status port, a data input / output port, and a log port. The middleware includes a power grid digital twin interface middleware, a status awareness calculation middleware, a predictive analysis middleware, a status inference middleware, and a target and constraint middleware.
[0021] This approach defines four standard logical ports: control, status, data I / O, and log. These ports are semantically clear and have single responsibilities, preventing control signaling from being overwhelmed by logs or large amounts of data from blocking the command channel. The middleware list includes PS-DTI, SPEM, PAM, SDEM, and OCDM, covering the complete decision-making loop from perception to prediction, inference, optimization, and deployment. These are plug-and-play and support rapid switching between different algorithms / models / simulation environments. All communication must pass through standard ports, forcibly decoupling and hiding internal implementation details, thus improving the framework's versatility and portability. Overall, this embodiment, through standardized interface design, transforms complex intelligent agent systems into a modular, replaceable, and scalable "Lego-like" architecture, significantly lowering the development threshold. This allows non-DRL experts to quickly build auxiliary decision-making agents for specific power grid scenarios, significantly accelerating the implementation of DRL in the power grid.
[0022] Furthermore, the formula for calculating the matching degree is as follows:
[0023]
[0024] Among them, W p For the priority weight, W d L represents the data density weights. ch Let B be the delay characteristic parameter. ch The bandwidth characteristic parameter, α is the preset balance factor, tanh() is the hyperbolic tangent function, and ∈ is a very small positive constant used to avoid W... d When λ is 0, the denominator is zero. ch (t) represents the real-time load factor.
[0025] This approach elevates communication scheduling strategies to a quantifiable, optimizable, and interpretable mathematical model, taking into account both task urgency and network health. It ensures that the system can automatically make optimal route decisions under any load scenario, which is a key guarantee for the stability, efficiency, and engineerability of the entire system.
[0026] Another embodiment of the present invention provides a power decision-making system, including: an acquisition module and a decision-making module;
[0027] The acquisition module is used to acquire power grid operation data;
[0028] The decision module is used to input the power grid operation data into the power system decision model to obtain a power decision scheme, and control the power system according to the power decision scheme. The decision model includes a model framework, multiple middleware components, and a communication scheduling module. The communication scheduling module dynamically allocates communication channels based on the feature information tuples in the communication request, so that the model framework and the middleware can communicate data through the communication channels.
[0029] This invention provides a closed-loop system from raw power grid data to executable scheduling / control strategies by acquiring power grid operation data, inputting it into a decision model, and obtaining a power decision-making scheme. This supports real-time or day-ahead auxiliary decision-making. The decision model includes a model framework, multiple middleware modules, and a communication scheduling module. This decouples the complex decision-making system into clearly defined, reusable, and scalable modular components, reducing development and maintenance costs. The communication scheduling module dynamically allocates communication channels based on "feature information tuples," breaking through the traditional static binding communication mechanism and achieving runtime adaptive bandwidth / priority scheduling to avoid high-density data crowding out critical signaling channels. The model framework and middleware communicate via the allocated communication channels, ensuring low latency, high throughput, and on-demand communication between modules, improving the overall system response speed and stability. Overall, this embodiment proposes a modular, scalable, and communication-adaptive power decision-making system architecture. It introduces a communication scheduling center into the underlying layer of the power auxiliary decision-making intelligent agent for the first time, solving the problems of static communication, bandwidth waste, and response lag in traditional applications, and significantly improving the real-time performance, reliability, and portability of the decision-making system.
[0030] Furthermore, the dynamic allocation of communication channels based on the feature information tuples in the communication request specifically includes:
[0031] Based on the preset balance factor and the real-time load factor of each channel, the channel feature information and the feature information tuple of each channel are calculated to obtain the matching degree with each channel. The channel corresponding to the maximum value of each matching degree is used as the communication channel for data communication. The channel feature information includes delay feature parameters and bandwidth feature parameters, and the feature information tuple includes priority weight, data density weight, target middleware port, communication mode identifier and communication persistence identifier.
[0032] Another embodiment of the present invention provides a terminal device, including: a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, it implements the steps of the power decision method of the present invention.
[0033] Another embodiment of the present invention provides a computer-readable storage medium item, including: a stored computer program, which, when the computer program is running, controls the device where the computer-readable storage medium is located to perform steps of the power decision method of the present invention. Attached Figure Description
[0034] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0035] Figure 1 This is a flowchart illustrating a power decision-making method provided in an embodiment of the present invention;
[0036] Figure 2 This is a schematic diagram of a framework and its middleware structure provided in an embodiment of the present invention;
[0037] Figure 3 This is a schematic diagram of the structure of a power decision-making system provided in an embodiment of the present invention. Detailed Implementation
[0038] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0039] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.
[0040] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.
[0041] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0042] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.
[0043] In the description of the embodiments of this application, the term "multiple" refers to two or more (including two), similarly, "multiple sets" refers to two or more (including two sets), and "multiple pieces" refers to two or more (including two pieces).
[0044] In the description of the embodiments of this application, unless otherwise expressly specified and limited, technical terms such as "installation," "connection," "joining," and "fixing" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. For those skilled in the art, the specific meaning of the above terms in the embodiments of this application can be understood according to the specific circumstances.
[0045] See Figure 1 To address the issues of low communication efficiency and rigid resource allocation caused by static interaction mechanisms in existing modular power decision-making methods, and to achieve low-latency, high-throughput, and adaptive high-efficiency data interaction in complex scenarios with high concurrency and mixed services, thereby ensuring the real-time performance and accuracy of decision-making, an embodiment of the present invention provides a power decision-making method, comprising:
[0046] S101. Obtain power grid operation data.
[0047] In this embodiment, the power grid operation data can be real-time measurement data from an external physical power grid, or simulated data generated by a power grid digital twin simulation model. The data format is acquired and standardized through the power grid digital twin interface middleware (PS-DTI) in the decision model. The specific steps are as follows:
[0048] Data access: The power grid digital twin interface middleware serves as a standardized portal between the intelligent agent framework and the external environment (including the physical power grid and simulation environment), receiving raw operational data from data sources (such as SCADA systems and PMU devices) or simulation platforms.
[0049] Data standardization: This middleware parses, cleans, and formats the received raw data, converting it into an internal standard common information model format to form a regular data flow, providing usable input for upper-layer middleware.
[0050] S102. Input the power grid operation data into the power system decision model to obtain a power decision scheme, and control the power system according to the power decision scheme. The decision model includes a model framework, multiple middleware components, and a communication scheduling module. The communication scheduling module dynamically allocates communication channels based on the feature information tuples in the communication request, so that the model framework and the middleware can communicate data based on the communication channels.
[0051] In this embodiment, as Figure 2 The diagram illustrates a framework and its middleware structure. The power grid operation data enters the decision model through the power grid digital twin interface middleware and is then transmitted to other middleware for collaborative processing. Each middleware processes and analyzes the data based on its specialized functions. For example, the state-aware computing middleware performs real-time analysis of the input data to generate a snapshot of the current power grid state; the predictive analysis middleware performs trend prediction based on the input data and outputs the prediction results of key variables; the system dynamic simulation middleware uses the input data to perform power grid simulation, providing a simulation environment for decision-making; and the objective and constraint middleware receives configuration instructions to form the optimization objective and boundary conditions for decision-making. The model framework is responsible for coordinating the execution flow of each middleware and integrating the output results of each middleware.
[0052] Before engaging in non-real-time data exchange (especially interactions involving data I / O ports), all middleware must adhere to a "request-scheduling-execution" handshake protocol. The initiating middleware first sends a request containing the core characteristics of the current communication to the communication scheduling center. This request is encapsulated as a standardized feature information tuple, which includes several core elements characterizing the specific features of the communication. Based on the content of this feature information tuple, the communication scheduling module dynamically selects and allocates the most suitable communication channel, returning the allocation result to the initiator. The model framework and middleware then communicate via the allocated communication channel, ensuring efficient and reliable data transmission.
[0053] After integrating the outputs of various middleware components, the model framework uses an ensemble algorithm to generate the optimal control action sequence, forming a power decision scheme. The generated decision scheme is converted into executable operation instructions through the power grid digital twin interface middleware and sent to the power system or simulation environment to achieve power system control or simulation verification.
[0054] As an example of an embodiment of the present invention, the dynamic allocation of communication channels based on the feature information tuple in the communication request specifically involves: calculating the channel feature information and the feature information tuple of each channel based on a preset balance factor and the real-time load factor of each channel to obtain the matching degree with each channel; and using the channel corresponding to the maximum value among the matching degrees as the communication channel for data communication. The channel feature information includes delay feature parameters and bandwidth feature parameters, and the feature information tuple includes priority weight, data density weight, target middleware port, communication mode identifier, and communication persistence identifier.
[0055] As an example of an embodiment of the present invention, the formula for calculating the matching degree is as follows:
[0056]
[0057] Among them, W p For the priority weight, W d L represents the data density weights. ch Let B be the delay characteristic parameter. ch The bandwidth characteristic parameter, α, is the preset balance factor, tanh() is the hyperbolic tangent function, and ∈ is a constant, used to avoid when W d When λ is 0, the denominator is zero. ch (t) represents the real-time load factor.
[0058] In this embodiment, when the model starts, the communication scheduling module first completes the initialization configuration. Specifically, it determines the preset balance factor α, which is the balance coefficient between priority and bandwidth requirements, used to adjust whether the urgency of the task or the amount of data is given more importance in the decision-making process. The value range is [0,1]. A channel feature information database is also established to create a database of inherent feature parameters for each communication channel, including the delay feature parameter L. ch (Characteristics of the transmission delay characteristics of the channel, i.e., the inherent parameters of speed) and bandwidth characteristic parameter B ch (Inherent parameters characterizing the data transmission capacity of a channel), and a real-time monitoring system for the dynamic load factor of each channel is established through a real-time monitoring mechanism. When any middleware needs to initiate communication, a standardized feature information tuple is first constructed, including the following core elements: priority weight W. p (Weight values are set according to the urgency of the business; for example, fault recovery instructions have a much higher priority than regular data reporting), data density weight W d(Density index calculated based on the total amount of data transmitted), target middleware port (clearly defining the target receiver and port for communication), communication mode identifier (M) (identifying one-way communication (e.g., data reporting) or two-way communication (e.g., requests requiring a response) mode), and communication persistence identifier (D) (identifying short-term or continuous communication needs). The core of the communication scheduling center lies in its built-in adaptive channel allocation algorithm. After receiving the feature information tuple, the communication scheduling module extracts W from the feature information tuple. p and W d Obtain the L of each channel from the channel feature information database. ch and B ch Obtain the current λ of each channel from the real-time monitoring system. ch (t) (representing the channel's busy level), for each available channel, calculate the match score according to the formula above to determine the channel occupied by data transmission after a successful handshake. Compare the match scores S of all channels. ch Select the channel with the highest score as the transmission channel for this communication, record the selection result, and update the channel load status.
[0059] During operation, the communication scheduling module continuously performs: load factor updates (real-time monitoring of the occupancy rate of each channel to update λ). ch (t)), balance factor optimization (dynamically adjusting the α value according to the system operating status), and channel characteristic calibration (periodically evaluating and updating the L of each channel). ch and B ch parameter).
[0060] As an example of an embodiment of the present invention, each of the channels is pre-divided by the communication scheduling module according to the communication resources. Specifically, based on preset service requirements, the communication resources are statically divided into multiple channels, and the channel characteristic information of each channel is determined. The delay characteristic parameter of the first channel is greater than that of the second and third channels, and the priority of the first channel is greater than that of the second and third channels. The bandwidth characteristic parameter of the third channel is greater than that of the first and second channels, and the third channel includes a lock-free buffer.
[0061] In this embodiment, during the design phase, based on an in-depth analysis of power system auxiliary decision-making services, and considering key indicators such as data priority, real-time performance, and throughput based on the transmission characteristics requirements of the service scenario, the available communication resources are statically divided into three different types of logical channels under the resource allocation principle of ensuring resource isolation and performance guarantee between channels.
[0062] The first (Class A) channel (information type: high priority, low density): has the lowest transmission latency and the highest preemption priority, but has a smaller bandwidth capacity. It is specifically used to transmit high-importance, low-data-volume information such as feature information tuples, control commands, and status heartbeats.
[0063] The second (Category B) channel (information type: regular priority, medium density): provides regular transmission delay and large bandwidth capacity, suitable for most medium data volume service transmissions, such as the transmission of collaborative calculation results between modules.
[0064] The third (Category C) channel (information type: regular priority, high density): provides regular latency and ultra-large bandwidth capacity, specifically designed for handling batch transmission tasks of massive data. It consists of a high-speed lock-free buffer and enables interactive full data synchronization.
[0065] As an example of an embodiment of the present invention, the lock-free buffer is implemented based on a pre-allocated shared memory region with contiguous physical addresses. Specifically, in the shared memory region, concurrent read and write operations between the first component and the second component are implemented through atomic operations. The first component is a component for generating and writing data, and the second component is a component for reading and processing data.
[0066] In this embodiment, a high-speed lock-free buffer for storing data is created on a high-speed server to enable high-density information exchange between middleware that requires high information throughput. Its features are as follows: the buffer is a shared memory area with a specific structure and access mechanism that is deeply optimized for multi-core, multi-threaded environments and has a high-performance data exchange structure.
[0067] (1) Overall architecture and data structure:
[0068] Logically, this buffer is a multi-producer, multi-consumer (MPMC) circular queue. Upon creation, the system pre-allocates a contiguous block of physical memory to reduce page table cache (TLB) misses and avoid performance fluctuations caused by dynamic memory allocation during runtime. The queue consists of data slots, a head pointer, a tail pointer, and a commit pointer.
[0069] (2) "Lockless" mechanism:
[0070] The "lock-free" feature of this invention is reflected in its complete abandonment of traditional multi-threaded synchronization mechanisms, such as mutexes and semaphores, which can lead to thread blocking and context switching. All concurrent access to and modification of the queue pointer can be accomplished through atomic operations directly supported by the CPU hardware.
[0071] Write process: When a thread in a producer middleware (first component) needs to write data, it first prefetches and increments the tail pointer in a non-blocking manner using atomic instructions such as Compare-And-Swap (CAS), thereby "claiming" ownership of a data slot. After writing data to the slot, it atomically updates the commit pointer to indicate that the data is ready to be read.
[0072] Read process: The consumer middleware thread atomically reads the commit pointer to know how much data is readable, and then consumes the data by atomically incrementing the head pointer.
[0073] This lock-free mechanism based on atomic operations fundamentally eliminates the possibility of threads being suspended while waiting for locks, avoids problems such as deadlock and priority inversion, and enables multiple threads to concurrently read and write at speeds close to the theoretical limit of memory bus bandwidth without conflict.
[0074] As an example of an embodiment of the present invention, the power decision-making method further includes: realizing communication between the framework and middleware, and between middleware and middleware based on a preset communication interface, wherein the preset communication interface includes a control port, a status port, a data input / output port and a log port, and the middleware includes a power grid digital twin interface middleware, a status awareness calculation middleware, a predictive analysis middleware, a status inference middleware and a target and constraint middleware.
[0075] In this embodiment, the power grid digital twin interface middleware serves as a standardized portal for the intelligent agent framework to interact with the external physical world or high-precision simulation environment. It performs bidirectional translation and proxy functions: on the one hand, it collects raw measurement data from systems such as SCADA and PMU, parses and unifies it into an internally standardized Common Information Model (CIM), providing a structured data flow to the upper layers; on the other hand, it translates the abstract control commands generated by the decision engine into specific operational commands that can be recognized by specific devices or simulation software and securely distributes them. During the training phase, this interface acts as a proxy for interacting with the simulation environment, managing the simulation's stepping and resetting, thereby completely decoupling the core algorithm of the intelligent agent from the specific underlying implementation, ensuring the framework's universality and portability.
[0076] State-aware computing middleware acts as the "perception system" for intelligent agents. It transforms the massive, heterogeneous, and potentially noisy raw data provided by PS-DTI into a globally consistent, complete, and accurate snapshot of the current state of the power grid. It first identifies the current operating topology of the power grid by analyzing switch status information in real time. Then, based on this, it integrates various measurement data and calculates the key state variables (such as voltage amplitude and phase angle) of all nodes in the system by solving an optimization problem. Simultaneously, it integrates functions for identifying and removing bad data, as well as dynamic state estimation using high-frequency PMU data, thereby providing high-quality, highly reliable information for upper-level decision-making.
[0077] The predictive analytics middleware incorporates a flexibly configurable library of forecasting models, enabling high-precision short-term and ultra-short-term forecasts for key external variables such as grid load, output from renewable energy sources like wind and solar, and electricity market prices. Through a unified interface, the middleware receives data and relevant external information (such as meteorological data) from the grid digital twin interface middleware and outputs quantitative forecasts of future trends.
[0078] The system dynamic inference middleware provides a lightweight power grid "sandbox" for the agent, which is the core of improving training and inference efficiency. It encapsulates various power grid analysis and computation engines, enabling rapid execution of power flow calculations, contingency (N-1) analysis, and simplified dynamic simulations. During reinforcement learning training, the agent can utilize this sandbox for extensive trial-and-error exploration; during actual inference, the agent can use it to quickly infer and evaluate multiple candidate strategies, thereby shortening the time to find the optimal decision.
[0079] The Objective and Constraint Definition Middleware (OCDM) serves as the configuration center for agent decision-making, formalizing and modularizing the optimization objectives and physical rules of the power grid. This component provides a dynamically configurable library containing various standardized sets of objective functions (e.g., minimum electricity purchase cost, minimum grid loss, minimum carbon emissions) and constraint sets (e.g., generator output limits, line power flow safety limits, node voltage stability limits). Schedulers or higher-level strategies can flexibly combine these objectives and constraints according to different power grid operating states (e.g., normal, alert, emergency). This design achieves a complete separation of "what to do" and "how to do it." When the task objective changes, only the OCDM configuration needs adjustment, without modifying the core decision optimization algorithm, achieving the goal of freely combinable modules.
[0080] The intelligent agent model framework adopts a highly modular plug-in architecture, capable of integrating and managing decision-making algorithms of various paradigms. Algorithm plug-ins include traditional mathematical programming solvers for accurate solutions, metaheuristic algorithms for complex nonlinear problems, and deep reinforcement learning agents (such as PPO and SAC) for sequential decision-making and uncertain environments. The framework is responsible for orchestrating the entire decision-making process: such as obtaining the current state from SPEM, obtaining future predictions from PAM, clarifying the objectives and constraints from OCDM, calling SDEM for policy deduction, and finally calculating the optimal sequence of control actions, ensuring the efficient and stable operation of the entire model framework and middleware.
[0081] Considering the characteristics of each middleware component, standard communication interfaces are defined to enable communication between the framework and middleware, and between middleware components themselves. Specifically, this involves implementing communication between each middleware component and the model framework (power grid digital twin interface).
[0082] This invention standardizes, modularizes, and interoperates PS-DTI, State-Aware Computation SPEM, Predictive Analytics PAM, System Dynamics Modeling SDEM, Objective and Constraint Modeling OCDM, and Agent Model Framework (IAMF), and supports the multi-mode communication dynamic scheduling mechanism proposed in this invention. Each middleware employs a design with four standard logical ports to handle information interactions of different natures. Communication between the framework and middleware, and between middleware components, must all be conducted through these standard ports, specifically defined as follows:
[0083] (1) Control Port:
[0084] This port is the sole entry point for the middleware to receive and send external commands, configurations, and synchronization signals. It handles low-density, high-priority command-type information. Examples include receiving start / stop commands from the Model Framework (IAMF), policy update notifications from the Objective and Constraint Middleware (OCDM), or scheduling and coordination commands from the communication scheduling center. The control port is typically implemented using the lightweight, request-response gRPC communication protocol, ensuring reliable command delivery and an explicit response mechanism.
[0085] Among them, gRPC is a high-performance, general-purpose open-source RPC framework based on HTTP / 2 and...
[0086] The design and development of the ProtoBuf protocol standard allows communication between clients and servers to focus more on business-level content, reducing the need to concern themselves with the underlying communication implemented by the gRPC framework.
[0087] (2) Status Port:
[0088] This port is used by middleware to publish its own running status, health status, key performance indicators (KPIs), and heartbeat signals. The published information is also low-density, such as current task processing progress, CPU / memory usage, and internal queue length. Status ports typically employ an asynchronous publish / subscribe pattern: flexible communication is achieved through message queues and specific message classes. Status ports are the information source for dynamic scheduling by the communication scheduling center described in S3. By subscribing to the status ports of all middleware, the scheduling center can perceive the overall system's operating status in real time, thereby making adaptive and intelligent adjustments to information transmission priorities.
[0089] (3) Data I / O Port:
[0090] This port serves as a dedicated channel for middleware to exchange core business data and handle large volumes of data throughput. It primarily handles the transmission of massive amounts of raw or intermediate-processed data, such as full telemetry data streams acquired by PS-DTI, complete power grid cross-section snapshots generated by SPEM, or batch result data generated after large-scale SDEM simulations. To address the performance bottleneck issues of traditional network transmissions when processing high-density information, this port is designed to directly interact with the high-speed, lock-free buffer established on the high-performance server as described in section S4 of this invention.
[0091] (4) Log Port:
[0092] This port is dedicated to outputting detailed, unstructured operational log information for system debugging, auditing, and fault analysis. The log port pushes log information to a unified log aggregation system, the ELK Stack, completely separating it from other business data and control signaling. By separating the log channel, the integrity of diagnostic information is ensured, while avoiding interference from excessive log output to the other three business ports, especially the control and data I / O ports that require low latency.
[0093] The ELK Stack is a log management and analysis technology stack consisting of three open-source tools: Elasticsearch, Logstash, and Kibana. It is commonly used to collect, store, analyze, and visualize large-scale logs and data.
[0094] like Figure 3 As shown, based on the above method embodiments, corresponding system embodiments are provided; one embodiment of the present invention provides a power decision system, including: an acquisition module 301 and a decision module 302;
[0095] The acquisition module 301 is used to acquire power grid operation data;
[0096] The decision module 302 is used to input the power grid operation data into the power system decision model to obtain a power decision scheme, and control the power system according to the power decision scheme. The decision model includes a model framework, multiple middleware components, and a communication scheduling module. The communication scheduling module dynamically allocates communication channels based on the feature information tuples in the communication request, so that the model framework and the middleware can communicate data based on the communication channels.
[0097] It is understood that the above system item embodiments correspond to the method item embodiments of the present invention, and can implement the power decision method provided by any of the above method item embodiments of the present invention.
[0098] It should be noted that the system embodiments described above are merely illustrative, and some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the system embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.
[0099] For ease of description and brevity, the system embodiments of the present invention include all the implementation methods described in the above embodiments of the UAV-based information recognition method, and will not be repeated here.
[0100] Based on the above-described embodiments of the power decision-making method, another embodiment of the present invention provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the power decision-making method of any embodiment of the present invention.
[0101] For example, in this embodiment, the computer program can be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the terminal device.
[0102] The terminal device may be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.
[0103] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal device, connecting all parts of the terminal device via various interfaces and lines.
[0104] Based on the above-described method embodiments, another embodiment of the present invention provides a computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to execute the power decision method described in any of the above-described method embodiments of the present invention.
[0105] The modules / units integrated in the device / terminal equipment, if implemented as software functional units and sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.
[0106] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A power decision method, characterized by, The method comprises: acquiring power grid operation data; inputting the power grid operation data into a decision model of a power system to obtain a power decision scheme, and controlling the power system according to the power decision scheme, wherein the decision model comprises a model framework, a plurality of middlewares and a communication scheduling module, and the communication scheduling module dynamically allocates a communication channel based on a feature information tuple in a communication request, so that the model framework and the middlewares perform data communication based on the communication channel.
2. The power decision method of claim 1, wherein, The dynamic allocation of the communication channel based on the feature information tuple in the communication request is specifically: calculating, based on a preset balance factor and real-time load factors of each channel, channel feature information of each channel and the feature information tuple to obtain matching degrees of each channel, and taking a channel corresponding to a maximum value in the matching degrees as a communication channel for data communication, wherein the channel feature information comprises delay feature parameters and bandwidth feature parameters, and the feature information tuple comprises priority weights, data density weights, target middleware ports, communication mode identifiers and communication persistence identifiers.
3. The power decision method of claim 2, wherein, Each channel is obtained by the communication scheduling module based on pre-divided communication resources, and is specifically: based on a preset business requirement, statically dividing the communication resources into a plurality of channels, and determining the channel feature information of each channel, wherein a delay feature parameter of a first channel is greater than those of a second channel and a third channel, a priority of the first channel is greater than those of the second channel and the third channel, a bandwidth feature parameter of the third channel is greater than those of the first channel and the second channel, and the third channel comprises a lock-free buffer.
4. The power decision method of claim 3, wherein, The lock-free buffer is implemented based on a pre-allocated shared memory region that is continuous in terms of physical addresses, and is specifically: in the shared memory region, concurrent reading and writing between a first component and a second component are implemented through atomic operations, wherein the first component is a component for generating and writing data, and the second component is a component for reading and processing data.
5. The power decision method of claim 1, wherein, The power decision method further comprises: implementing communication between the framework and the middlewares, between the middlewares and the middlewares based on a preset communication interface, wherein the preset communication interface comprises control ports, state ports, data input / output ports and log ports, and the middlewares comprise a power grid digital twin interface middleware, a state awareness calculation middleware, a prediction analysis middleware, a state deduction middleware and a target and constraint middleware.
6. The power decision method of claim 2, wherein, The calculation formula of the matching degrees is specifically: wherein W p is the priority weight, W d is the data density weight, L ch is the latency characteristic parameter, B ch is the bandwidth characteristic parameter, a is the preset balance factor, tanh() is the hyperbolic tangent function, and ∈ is a constant, used to avoid the denominator being zero when W d is 0, λ ch (t) is the real-time load factor.
7. A power decision system characterized by, comprises: an acquisition module and a decision module; the acquisition module is configured to acquire power grid operation data; the decision module is configured to input the power grid operation data into a decision model of a power system to obtain a power decision scheme, and control the power system according to the power decision scheme, wherein the decision model comprises a model framework, a plurality of middlewares and a communication scheduling module, and the communication scheduling module dynamically allocates a communication channel based on a feature information tuple in a communication request, so that the model framework and the middlewares perform data communication based on the communication channel.
8. The electric power decision system of claim 7, wherein, The dynamic allocation of the communication channel based on the feature information tuple in the communication request is specifically: Based on a preset balance factor and real-time load factors of each channel, channel characteristic information of each channel and the characteristic information tuple are calculated to obtain matching degrees of each channel, and a channel corresponding to a maximum value in the matching degrees is taken as a communication channel for data communication, wherein the channel characteristic information includes delay characteristic parameters and bandwidth characteristic parameters, and the characteristic information tuple includes a priority weight, a data density weight, a target middleware port, a communication mode identifier and a communication persistence identifier.
9. A terminal device, comprising: The computer program is stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, the power decision method in any one of claims 1-6 is implemented.
10. A computer-readable storage medium, characterized in that, The computer program is stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, the power decision method in any one of claims 1-6 is implemented. The computer program is stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, the power decision method in any one of claims 1-6 is implemented.