Cartesian genetic programming energy scheduling method and related equipment
By employing a Cartesian genetic programming method based on an activity-aware sampling strategy, active nodes in the energy management system are identified, and symbolic scheduling strategies are generated. This solves the model dependency problem of traditional energy scheduling methods and the local optima problem of deep reinforcement learning, achieving efficient, robust, and interpretable energy optimization scheduling.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SOUTH CHINA UNIV OF TECH
- Filing Date
- 2025-12-15
- Publication Date
- 2026-05-12
AI Technical Summary
Traditional energy dispatch methods suffer from insufficient model dependence, heavy computational burden, and susceptibility to local optima when dealing with high-proportion renewable energy systems. Deep reinforcement learning methods, on the other hand, have low search efficiency and lack policy interpretability in energy dispatch.
The Cartesian genetic programming method employing an activity-aware sampling strategy identifies active nodes in the energy management system, dynamically allocates mutation budgets, generates fully symbolic scheduling strategies, and improves search efficiency and interpretability by combining explicit action selection and elite selection strategies.
It achieves efficient, robust, and interpretable energy-optimized scheduling, improving exploration efficiency and convergence speed. The generated scheduling policy is transparent and easy to deploy, and is suitable for resource-constrained embedded controllers.
Smart Images

Figure CN122021815A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of energy scheduling and evolutionary computing, and in particular to a Cartesian Genetic Programming (CGP) energy scheduling method and related equipment. Background Technology
[0002] The global energy system is transitioning towards integrating a high proportion of renewable energy, which places higher demands on the real-time dispatch and control of the power grid. Traditional model-based optimization methods (such as mixed-integer linear programming) rely on accurate physical models and uncertain prior knowledge, which are insufficiently adaptable to highly nonlinear and volatile environments, and also have a heavy computational burden.
[0003] Deep reinforcement learning (DRL), as a model-free method, optimizes a single policy through trial and error. However, its search process is prone to getting trapped in local optima, and the policy is a "black box" model that is difficult to interpret, which poses a trust barrier when deployed in energy systems where safety is critical.
[0004] Evolutionary algorithms, particularly Cartesian genetic programming (CGP), possess a natural ability to balance exploration and exploitation by maintaining a population for parallel search and can generate transparent policies composed of simple arithmetic logic primitives. However, traditional CGP typically employs blind, uniform random mutation, resulting in low search efficiency, slow convergence, and difficulty in discovering high-quality policies within limited resources in complex energy scheduling problems.
[0005] Therefore, there is an urgent need for a new method that can maintain the robustness and interpretability advantages of evolutionary algorithms while significantly improving their search efficiency and performance in complex energy scheduling problems. Summary of the Invention
[0006] The main objective of this application is to overcome the shortcomings of existing deep reinforcement learning methods, such as being prone to getting trapped in local optima and having uninterpretable strategies, as well as the low exploration efficiency and slow convergence of traditional Cartesian genetic programming algorithms. This application proposes a Cartesian genetic programming energy scheduling method, electronic device, storage medium, and program product based on an activity-aware sampling strategy. By introducing an activity-aware mechanism to intelligently guide the mutation process and output a fully symbolic scheduling strategy, this method achieves efficient, robust, and interpretable energy optimization scheduling.
[0007] To achieve the above objectives, one aspect of this application proposes a Cartesian genetic programming energy scheduling method, the method comprising: S1: Acquire environmental status data, discrete action sets, and training scenario data of the energy management system; S2: Initialize the Cartesian genetic programming CGP population, which contains multiple CGP individuals, and the genotype of each CGP individual is represented as a directed acyclic graph composed of computation nodes arranged in a two-dimensional grid; S3: For the current decision-making moment, obtain the environmental state vector. An explicit action selection strategy is adopted to select the environmental state vector. The vector is concatenated with each candidate action in the discrete action set to construct the corresponding augmented input vector. ; S4: Evaluate the fitness of individuals in the population: For each augmented input vector... Input the CGP individual to be evaluated, and obtain the scalar score of the individual for each candidate action through forward propagation; select the action with the lowest score as the control instruction at the current moment, and calculate the fitness value of the individual based on the cumulative reward in the training scenario; S5: Determine whether the evolution termination condition is met. If it is met, proceed to step S9; otherwise, proceed to step S6. S6: Based on the fitness assessment results, an elite selection strategy is used to select parent individuals from the current population; S7: Apply the liveness-aware sampling mutation operator to the selected parent individuals to generate offspring individuals, including: S71: By starting from the output node of a CGP individual and traversing its genotype map in reverse, the set of active nodes that actually contribute to the output is identified. S72: Based on the number of nodes in the set of active nodes and the number of inactive nodes Dynamically calculate the mutation budget allocated to active nodes. and the mutation budget allocated to inactive nodes ,in, The calculated value is greater than ; S73: Based on the mutation budget determined in step S72, randomly select a corresponding number of nodes from the set of active nodes and the set of inactive nodes as nodes to be mutated; S8: Perform mutation operation on each node to be mutated selected in step S73. The mutation operation includes at least one of the following: randomly replacing the function of the node, randomly reconnecting the input index of the node, and adding random perturbation to the weight parameters of the node. After generating offspring individuals, merge the offspring individuals with the elite parent individuals to update the population, and return to step S3. S9: Output the CGP individual with the highest fitness in the population after evolution, as the optimal energy scheduling strategy.
[0008] In some embodiments, in step S1, the environmental status data of the energy management system The data is a D-dimensional vector, including data from at least one of the following scenarios: Multi-energy microgrid (MEMG) scenario: Electricity load demand Heat load demand Real-time electricity price Available photovoltaic power State of charge of energy storage unit and and the current time step ; Active distribution network ADN-EES scenario: Net load of network nodes State of charge of energy storage unit Real-time electricity price Current time step Node voltage amplitude and available photovoltaic power .
[0009] In some embodiments, in step S1, the discrete action set These correspond to the discharge, idle, and charging behaviors of the energy storage unit, or the shutdown, partial load operation, and full load operation states of the controllable generator set, respectively.
[0010] In some embodiments, in step S2, the function set of the CGP individual is The genotype of each functional node is encoded as a tuple. ,in, For the functionalities of a node, Connect the node's input index. These are the weight parameters of the node.
[0011] In some embodiments, in step S4, the action with the lowest score is selected. The calculation formula is: ,in For CGP individuals, augmented input vector The calculated scalar score; the individual's fitness value. Accumulated rewards across all training scenarios Average value: , This represents the number of training scenarios.
[0012] In some embodiments, in step S72, the active node mutation budget Inactive node mutation budget Calculated dynamically using the following formula:
[0013]
[0014] in, The preset activity intensity parameters, and These are the lower and upper limits of the preset total number of mutated nodes, respectively.
[0015] In some embodiments, in step S8, the mutation operation is performed on the selected node to be mutated, specifically by: using a preset mutation probability. Perform at least one of the following operations: (1) From the function set A new function is randomly selected uniformly to replace the original function of the node. ; (2) Randomly select new connection indices from the set of feasible input connection indices to replace the original input connections of the node. ; (3) The original weight parameters of the node Add a Gaussian distribution Random noise is removed, and the results are truncated to a preset weighted interval. Inside.
[0016] To achieve the above objectives, another aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described above.
[0017] To achieve the above objectives, another aspect of the embodiments of this application proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described above.
[0018] To achieve the above objectives, another aspect of the embodiments of this application proposes a computer program product, including a computer program that, when executed by a processor, implements the method described above.
[0019] Compared with the prior art, the technical solution provided in this application has at least the following beneficial effects: 1) Significantly Improved Exploration Efficiency and Solution Quality: The activity-aware sampling mutation operator introduced in this application dynamically identifies "active nodes" in the genotype that actually contribute to the output and allocates the main mutation budget to these key nodes, achieving an "intelligent" and guided search. This effectively overcomes the problem of low efficiency caused by blind mutation in traditional CGP, enabling the algorithm to more effectively conduct local development and global exploration in complex dynamic search spaces, thereby significantly improving convergence speed and final solution quality. Experiments demonstrate that its performance is significantly better than standard CGP and many mainstream DRL algorithms.
[0020] 2) The strategy is fully interpretable and easy to deploy: The explicit action selection strategy adopted in this application uses candidate actions as part of the input, allowing the CGP network to output a comparable scalar score. This makes the final evolved optimal strategy a fully symbolic mathematical expression composed of simple arithmetic and logical primitives. This expression is highly transparent, can be understood and verified by human experts without approximation, and due to its low computational cost and simple structure, it can be directly deployed in resource-constrained embedded controllers or programmable logic controllers, greatly reducing the threshold for practical application.
[0021] 3) Strong robustness and generalization ability: This application belongs to the model-free method, which does not rely on a precise physical system model or prior probability distribution assumptions for uncertainties. Its population-based evolutionary search mechanism exhibits stronger robustness and generalization ability when facing highly nonlinear and non-stationary environments such as photovoltaic fluctuations, load changes, and electricity price jumps, and can adaptively discover effective scheduling rules.
[0022] 4) Resolves the contradictions between existing technologies: This application ingeniously combines the interpretability and robustness advantages of evolutionary algorithms with an efficient directional search mechanism, which not only solves the "black box" and local convergence problems of DRL, but also overcomes the low search efficiency of traditional evolutionary algorithms, providing a new high-performance, interpretable and easy-to-deploy solution for dynamic energy scheduling. Attached Figure Description
[0023] Figure 1 This is a flowchart of a Cartesian genetic programming energy scheduling method in an embodiment of this application.
[0024] Figure 2 This is a schematic diagram of the genotype and phenotype of CGP individuals in the embodiments of this application.
[0025] Figure 3 This is a schematic diagram of a single interaction evaluation between CGP heuristics and the environment in an embodiment of this application.
[0026] Figure 4This is a comparison of the convergence curves of CGP using an activity-aware sampling strategy and the standard CGP in the ADN-EES 25-node system of this application.
[0027] Figure 5 This is a schematic diagram of the hardware structure of the electronic device in the embodiments of this application. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit it. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this application; they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this application as detailed in the appended claims.
[0029] 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 belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0030] Before providing a detailed description of the embodiments of this application, some of the nouns and terms involved in the embodiments of this application will be explained first. The nouns and terms involved in the embodiments of this application are subject to the following interpretations.
[0031] 1) Cartesian Genetic Programming (CGP) is a genetic programming technique proposed by Miller et al. for automatically generating programs or circuit designs. It uses a directed acyclic graph (DAG) or feedforward network structure to represent the program, where nodes are arranged in a two-dimensional grid, divided into active nodes (contributing to the output) and inactive nodes (not contributing). This representation optimizes connections by pre-describing the genotypes of all nodes, avoiding the "bloat" problem caused by excessive genetic operations in traditional tree-structured genetic programming, and supports compact representation of complex functions by reusing some subtrees.
[0032] 2) A Dynamic Energy Management System (DEMS) is an information management platform capable of real-time monitoring, analysis, and optimization of energy use. It continuously collects energy consumption data and dynamically adjusts energy allocation and usage strategies to improve energy efficiency, reduce costs, and support sustainable development.
[0033] The global transition to sustainable energy systems is driving the large-scale integration of intermittent renewable energy sources such as solar and wind power. Simultaneously, various energy storage technologies, including electric vehicles as mobile energy storage and stationary electrothermal storage units, are being widely deployed. While this transition is crucial for decarbonization, it also introduces significant volatility and uncertainty into the power grid, posing challenges to its operational stability and reliability. Therefore, Dynamic Energy Management Systems (DEMS) are essential for the real-time coordination of heterogeneous and tightly coupled components such as smart homes, building clusters, multi-energy microgrids, and active distribution networks.
[0034] Early research on DEMS primarily relied on model-based optimization techniques, particularly mixed-integer linear programming, stochastic programming, and robust optimization. These methods depend on accurate models and prior knowledge of uncertainties such as the probability distributions, forecast intervals, or scenario sets of renewable energy generation and load demand. However, this dependence severely limits their adaptability and effectiveness in real-time decision-making, especially when faced with large forecast errors, highly nonlinear dynamic changes, rapidly fluctuating electricity prices, or sudden events. Furthermore, the computational burden of solving large-scale optimization problems also makes them difficult to apply in real-time control.
[0035] As a model-free approach, Deep Reinforcement Learning (DRL) has become the dominant paradigm in recent years. By iteratively optimizing a single policy through trial-and-error interaction with the environment, DRL eliminates the explicit modeling and prediction requirements of model-based methods. However, because the search process focuses on a single policy, DRL often exhibits limited exploration capabilities in vast or misleading reward spaces, making it prone to premature convergence to local optima. Furthermore, its sample efficiency remains low in complex long-horizon energy management tasks, and its performance is highly sensitive to reward function design and hyperparameter selection. These problems become particularly acute when multiple control actions must be tightly coordinated over long timeframes.
[0036] Another increasingly competitive approach is the use of evolutionary algorithms. Unlike gradient-guided single-policy methods, evolutionary search naturally balances exploration and exploitation within a policy population, often resulting in robust performance. Studies have shown that evolutionary algorithms can match or outperform state-of-the-art reinforcement learning algorithms by maintaining diverse populations. Furthermore, the population-based characteristics of evolutionary search have proven particularly effective in automatically discovering scheduling and control heuristics in dynamic, non-stationary environments. Among these, the Cartesian Genetic Programming Algorithm (CGP) is particularly suitable for many DEMS applications. Its grid-based representation naturally supports the reuse of intermediate and high-level features, enabling the evolutionary process to automatically discover the optimal coupling between actions. The generated policies consist of only simple arithmetic and logical primitives, producing fully symbolic, transparent, and potentially interpretable expressions.
[0037] In view of this, this application provides a Cartesian genetic programming energy scheduling method, electronic device, storage medium, and program product based on an activity-aware sampling strategy. The scheme includes: acquiring environmental state data and discrete action sets of the energy management system; initializing a Cartesian genetic programming population; using an explicit action selection strategy, concatenating the current state with candidate actions to construct an augmented input vector, and selecting the optimal control action based on the scalar score output by the CGP individual; during the evolutionary process, employing an activity-aware sampling mutation operator to identify active nodes that actually contribute to the output by traversing the genotype map in reverse, dynamically allocating the mutation budget accordingly, tilting mutation resources towards active nodes while retaining a small number of inactive node mutations; iteratively updating the population until the termination condition is met, and outputting a symbolic optimal scheduling strategy. This application significantly improves the algorithm's exploration efficiency in complex dynamic search spaces through an activity-aware mechanism, effectively solving the problem of deep reinforcement learning easily getting trapped in local optima. Furthermore, the generated scheduling rules are completely transparent mathematical expressions, possessing high interpretability and portability, and are suitable for real-time economic and safe scheduling of multi-energy microgrids and active distribution networks.
[0038] This application provides a Cartesian genetic programming energy scheduling method, relating to the intersection of smart energy management and evolutionary computing. This Cartesian genetic programming energy scheduling method can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, or in-vehicle terminal, but is not limited to these. The server can be configured as an independent physical server, a server cluster consisting of multiple physical servers, or a distributed system. It can also be configured as a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network. The software can be an application implementing a Cartesian genetic programming energy scheduling method, but is not limited to the above forms.
[0039] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0040] like Figure 1 As shown, this embodiment provides a Cartesian genetic programming energy scheduling method to address the technical problems of DRL's susceptibility to local optima and the low exploration efficiency of the traditional CGP algorithm in existing technologies. The method includes the following steps: Step 1: Obtain environmental status data, discrete action set, and training scenario data of the energy management system.
[0041] Specifically, the environmental status data acquired from the energy management system For one Dimensional vector. For example, taking a multi-energy microgrid system as an example, the obtained... Time-space state vector Includes 7 dimensions: , representing electrical load, thermal load, real-time electricity price, available photovoltaic power, state of charge of electrical energy storage, state of charge of thermal energy storage, and the current time step, respectively. Defined discrete action set. For energy storage devices, these correspond to discharging, idle, and charging, respectively; for controllable generator sets, they correspond to shutdown, partial load, and full load operation. Training scenario data. It includes historical load, photovoltaic, and electricity price data sequences.
[0042] Step 2: Initialize the CGP population. Required parameters include the number of grid rows and columns, the function set, and the population size. The genotype of each CGP individual consists of the function, input, and weights. The phenotype of a CGP individual is a directed acyclic graph structure formed by computational nodes arranged in a two-dimensional grid.
[0043] Specifically, the initialization of the CGP function set The genotype encoding of the CGP individual is determined by... It consists of several functional nodes, among which For the number of rows, Number of columns. Index is The gene representation of a functional node is a tuple. ;in, For arithmetic or logical primitives selected from the set of function functions; This is the input connection index, and its value range includes the system status input index. Or subject to backtracking parameters Restricted preceding node index; The weight parameter has a range of values. .
[0044] See Figure 2 In this embodiment, the population size is set. The CGP mesh structure is set to a single-row structure, meaning the number of rows is... , number of columns (That is, a maximum of 60 function nodes), the backtracking parameter is set to 60 to allow arbitrary forward connections. Function set Defined as Each functional node The genotype is encoded as a tuple. ,in , For the input join index, For connection weights.
[0045] Step 3: Obtain the environmental vector of the current energy management system An explicit action selection strategy is adopted, which concatenates the current environment state with each candidate action in the discrete action set to construct an augmented input vector.
[0046] Specifically, at each decision-making time step For discrete action sets Each candidate action in Compare it with the current environment state vector Concatenate the vectors to construct an augmented input vector. For example, if the state vector dimension is 7, and the action set is... Then, construct three augmented input vectors with a dimension of 8.
[0047] Step 4: Perform fitness evaluation on individuals in the population: Input the augmented input vector into the CGP individual for calculation, obtain the scalar score of each component for the candidate action, select the action with the lowest score as the control command at the current moment, and calculate the fitness value of the individual based on the cumulative reward in the training scenario.
[0048] See Figure 3 Specifically, each augmented input vector generated in step 3... Inputting a CGP individual, performing forward propagation calculations, and having the output node return a scalar score for each component (such as an electrical storage device, thermal storage device, or photovoltaic panel)... After iterating through all candidate actions, select the action with the lowest score as the optimal action to execute. ,Right now ; upon completion After simulating each training scenario, the individual's fitness value Calculated as the average of cumulative rewards across all scenarios: ,in For the first Cumulative rewards for each scenario.
[0049] Step 5: Determine if the termination condition is met. If it is, proceed to step 10; otherwise, proceed to step 6.
[0050] Specifically, determine whether the current evolution generation is less than the preset maximum generation (or whether the running time has not reached the upper limit). If the condition for "continue evolution" is met, proceed to step 6 to enter the next generation of reproduction; if not (i.e. the termination condition has been met), proceed to step 10 to output the result.
[0051] Step 6: Based on the fitness assessment results, use an elite selection strategy to select parent individuals from the current population and retain them for the next generation.
[0052] Specifically, adopt The elite selection strategy, based on fitness ranking, directly retains the best-performing members of the population. Individuals (e.g.) ,in (As the elite rate) as the parent generation, generating Each individual is then directly replicated into the next generation of the population.
[0053] Step 7: Apply the active sensing sampling mutation operator to the selected parent individuals to generate offspring: First, identify the set of active nodes that actually contribute to the output by traversing the genotype map in reverse from the output nodes; dynamically calculate the mutation budget based on the number of active nodes, tilt mutation resources toward active nodes, and at the same time retain a small amount of mutation budget for inactive nodes, so as to enhance local development capabilities while maintaining global exploration capabilities.
[0054] Specifically, the set of active nodes is obtained by reversing the genotype map from the output node to identify the nodes that actually participated in the computation. Based on the number of active nodes Number of inactive nodes Dynamically calculate the mutation budget of active nodes Inactive node mutation budget The calculation formula is as follows:
[0055]
[0056] In the formula, This is an activity intensity parameter used to control the degree to which mutations are tilted towards active nodes; and These represent the lower and upper limits of the total number of mutated nodes, respectively.
[0057] Step 8: Based on the budget determined in Step 7, perform mutation operations on the selected nodes, including randomly replacing the function, reconnecting the input index or perturbing the weight parameters, to generate new offspring individuals.
[0058] Specifically, for each selected node to be mutated, perform one or a combination of the following operations: with probability From the function set A new function is randomly selected uniformly to replace the original function. ; with probability A new connection index is randomly and uniformly selected from the set of feasible inputs to replace the original input. ; in terms of probability For the original weight parameters Add Gaussian noise And multiply by the scaling factor The results were then truncated to Interval.
[0059] Step 9: Update the population and repeat steps 2 through 9.
[0060] Specifically, the elite parents retained in step 6 are merged with the offspring generated in step 8 to form a new generation population. The generation number is incremented by 1, and the process returns to step 3 (Note: Usually, it is not necessary to repeat the initialization in step 2, but rather to evaluate the new population; however, in practice, this should be understood as entering the evaluation cycle for the next generation).
[0061] Step 10: Output the individual with the highest fitness as the optimal scheduling strategy, and decode it into a symbolic mathematical expression for real-time energy scheduling.
[0062] Specifically, after evolution is complete, the individual with the highest fitness in the population is selected. The process involves symbolic decoding: All inactive nodes are pruned from the output node, and the remaining active nodes and their connections are converted into mathematical expressions. For example, the final scheduling strategy might be in explicit formulaic form: ,in This is the output of the intermediate computing node. This expression can be directly written into the embedded controller for real-time scheduling.
[0063] The solutions of the embodiments of this application will be described in detail and explained below with reference to specific application examples.
[0064] This embodiment provides a Cartesian genetic programming energy dispatching method based on an activity-aware sampling strategy. Taking the voltage and economic coordination dispatching problem of an active distribution network with energy storage as an example, the method specifically includes the following steps: Step 1: Construct the environmental model and state space of the multi-energy microgrid system. Obtain the topology information of the multi-energy microgrid, which includes three energy carriers: power grid, gas grid, and heat grid, as well as five types of equipment: photovoltaic, combined heat and power units, gas boilers, electric energy storage, and thermal energy storage. Define the system's state space. At each time step Obtain the 7-dimensional state vector:
[0065] in, and These are the electrical load and thermal load requirements, respectively. For real-time electricity prices; The available power of photovoltaics; and These represent the states of charge of electrical energy storage and thermal energy storage, respectively. This is the current time (normalized).
[0066] Step 2: Initialize the CGP population. Set the population size. (For example, 100). Construct a genotype with a two-dimensional grid structure and set the number of grid rows. , number of columns Each individual contains 60 functional nodes. Set backtracking parameters. This allows nodes to connect to any predecessor or input node. Define the set of functions. Each functional node The genotype code is ,in Enter the connection index. For connection weights.
[0067] Step 3: Construct augmented input vectors based on explicit action selection strategies. Define discrete action sets. For controllable equipment (such as photovoltaic, combined heat and power units, gas boilers, electric energy storage, and thermal energy storage), the action value is... These represent discharging / shutdown, idle / partial load, and charging / full load, respectively. At each decision point... To evaluate the optimal action, instead of directly outputting the action value from the neural network, a traversal evaluation method is used. The current state vector is... With each candidate action in the action set Concatenate the vectors to construct an augmented input vector. : For example, if the state vector dimension is 7, and the action set is... Then, construct three augmented input vectors with a dimension of 8.
[0068] Step 4: Perform CGP forward computation and action optimization. For each augmented input generated in Step 3... The input is fed into the computational graph of the CGP individual. The computational graph performs forward propagation based on the genotype-defined connections and functions, ultimately returning a scalar score from the output node. Based on a greedy strategy that prioritizes lower scores, the action with the lowest score is selected as the optimal control command for the current moment. :
[0069] System Execution The reward is calculated based on environmental feedback. The reward function is set to the negative of the operating cost (i.e., minimizing the cost), and the total cost function... This includes the cost of purchasing electricity and gas, the cost of equipment operation and maintenance, and the cost of carbon emissions.
[0070] Individual fitness Defined as The average cumulative reward across all training scenarios.
[0071] Step 5: Parent selection based on an elite retention strategy. Evolutionary strategy. Based on fitness. Sort the population and select the one with the highest fitness. Individuals as elite parents (e.g., elite rate) One type is directly passed on to the next generation, while the remaining individuals are produced through mutation.
[0072] Step 6: Perform Activity-Aware Sampling Variation – Active Node Identification and Budget Allocation. When generating offspring from parent individuals, the first step is to perform "activity detection": starting from the output node, traverse the genotype map in reverse order, marking all nodes that contribute to the output value to form a set of active nodes. The rest are sets of inactive nodes. Based on the number of active nodes Dynamically calculate the mutation budget. Number of mutations in active nodes. :
[0073] Number of inactive nodes :
[0074] in For activity intensity parameters (e.g.) ), These are the upper and lower limits for the number of mutations. This step ensures that mutations are concentrated at key nodes that can alter the trait.
[0075] Step 7: Perform liveness-sensing sampling variation—structural and parameter perturbation.
[0076] Based on the budget determined in Step 6, the selected nodes are processed with mutation probability. (For example Perform the following operations: 1) Function Reset: From Replacement of random sampling function ; 2) Connection Reconnection: Randomly sample new indexes from the feasible input range and replace them. ; 3) Weight perturbation: Add Gaussian noise to the weights and truncate them:
[0077] in This is a noise scaling factor (e.g., 0.2).
[0078] Step 8: Decode and generate a symbolic scheduling strategy. Repeat Steps 3-7 until the termination condition is met (e.g., reaching the maximum training time). Output the optimal individual and perform symbolic decoding. Prune all inactive nodes and convert the remaining structure into a mathematical expression. For example, in an active power distribution network scenario, the symbolic scheduling strategy generated in this embodiment for a certain energy storage unit is as follows:
[0079] Among them, intermediate variables Defined as a function of the input state:
[0080]
[0081]
[0082]
[0083]
[0084] in, These represent 52 input features respectively. The action value is either -1, 0, or 1. This formula contains only simple arithmetic and logical operations and can be directly deployed on embedded controllers.
[0085] In this embodiment, to verify the effectiveness of the algorithm, the CGP algorithm was developed based on the Python DEAP library, and the DRL algorithm for comparison was developed based on PyTorch. The hardware environment used an AMD EPYC 9754 CPU and an NVIDIA RTX 4090D GPU. The parameter settings are as follows: population size... The maximum training time for a Multi-Energy Microgrid (MEMG) system is set to 12 hours, and the maximum training time for an Active Distribution Network with Electrical Energy Storage Unit (ADN-EEStep) is set to 48 hours. (Activity intensity) Probability of mutation .
[0086] To evaluate the effectiveness of the proposed Activity-Aware Stepampled Mutation operator (AAStepM), we compared it with the standard probabilistic mutation operator widely used in CGP: in the standard operator, each gene mutates independently with a small, fixed probability, regardless of whether the gene currently affects fitness assessment.
[0087] Table 1: Performance comparison of the AASM operator proposed in this invention on the test set
[0088] Table 1 shows the average test performance across all scenarios in each real-world dataset. AASM consistently outperforms the benchmark method, particularly in the complex ADN-EES case: for the Node-25 system, AASM achieves an average target value of 3.23, a significant improvement of 83.52% compared to the benchmark method's 1.76. For the complex Node-34 system, AASM significantly outperforms the benchmark method (0.53 vs. -0.03). Figure 4 As shown, the training convergence curve on the ADN-EES Node-25 system clearly demonstrates the superiority of AASM. The baseline method stalls after approximately 20 hours, with its target value remaining around 2.0 due to premature convergence. In contrast, AASM triggers a dramatic performance leap after approximately 22 hours, ultimately reaching approximately 3.5. This decisive improvement confirms the effectiveness of the activity-aware mechanism: by focusing mutations on nodes that actually affect the output (i.e., active nodes), AASM performs more targeted structural perturbations and enables CGP to escape local optima in a complex dynamic search space.
[0089] Table 2: Performance Comparison of the Invention Method with Existing Mainstream Deep Reinforcement Learning Algorithms
[0090] To verify the effectiveness of the CGP method based on the liveness-aware sampling strategy proposed in this embodiment, it was compared with the current mainstream DRL algorithm in this embodiment. The comparison algorithms cover algorithms based on continuous action space, including Deep Deterministic Policy Gradient (DDPG), Twin Delayed DDPG (TD3), and Soft Actor-Critic (SAC); and algorithms based on discrete action space, including Deep Q-Network (DQN) and Double Deep Q-Network (DDQN). Table 2 reports the average test performance of CGP and mainstream deep reinforcement learning algorithms in all scenarios of each dataset. (1) In terms of overall performance, the CGP method proposed in this embodiment achieved the best or tied-best scheduling effect in all test datasets. Especially in the more challenging ADN-EES scenario, this application demonstrates significant performance advantages: in the Node-25 node system, compared with the best-performing DRL benchmark algorithm, the objective function value of the method in this embodiment is improved by about 4.8%; in the more complex Node-34 node system, the method in this embodiment successfully improves the near-zero ineffective performance of the benchmark algorithm into a significant positive gain, proving the algorithm's optimization ability in complex solution spaces. (2) In terms of action space adaptability, although this embodiment uses a discrete action space for computation, its performance is still significantly better than traditional discrete action algorithms (DQN / DDQN) and continuous action algorithms (DDPG / SAC / TD3). This result excludes the possibility that the discretization operation itself is the main source of performance improvement, confirming that the activity-aware sampling strategy based on population evolution in this application is the core reason for achieving high-performance scheduling.
[0091] In summary, the method of this embodiment has the following advantages and beneficial effects compared with the prior art: 1) This application introduces an activity-aware sampling mutation operator, which dynamically identifies functionally active nodes in the genotype and allocates mutation resources preferentially to these key structures, while retaining a small amount of mutation for inactive nodes to maintain neutral drift. This mechanism significantly improves the algorithm's exploration efficiency in complex dynamic search spaces, effectively solving the problems of traditional deep reinforcement learning methods easily getting trapped in local optima and the slow convergence caused by blind mutation in traditional genetic programming, thus greatly improving the solution quality. 2) This application employs an explicit action selection strategy, directly utilizing scalar scores generated by Cartesian genetic programming to evaluate and select discrete actions, thus avoiding the interpretability loss caused by nonlinear mappings in deep neural networks. The scheduling rules generated based on this strategy are fully symbolic mathematical expressions, possessing high transparency and interpretability. They can be directly deployed on resource-constrained embedded controllers without approximation, greatly reducing the storage and computing resource requirements for model deployment.
[0092] 3) This application falls under the category of model-free evolutionary computation, freeing it from the dependence of traditional optimization methods on precise physical models and uncertain prior knowledge (such as probability distributions). Through population-based evolutionary search, this application exhibits stronger robustness and generalization ability in highly nonlinear dynamic environments such as photovoltaic fluctuations and electricity price changes. Experiments demonstrate that in practical and complex scenarios such as multi-energy microgrids and active distribution networks, this application achieves lower optimality gaps and better economic benefits compared to existing mainstream deep reinforcement learning algorithms.
[0093] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described method. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.
[0094] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0095] Please see Figure 5 , Figure 5 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes: The processor 501 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application. The memory 502 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 502 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 502 and is called and executed by the processor 501 using the methods described in the embodiments of this application. The input / output interface 503 is used to implement information input and output; The communication interface 504 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 505 transmits information between various components of the device (e.g., processor 501, memory 502, input / output interface 503, and communication interface 504); The processor 501, memory 502, input / output interface 503, and communication interface 504 are connected to each other within the device via bus 505.
[0096] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.
[0097] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0098] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0099] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0100] It is understood that the content of the above method embodiments is applicable to the embodiments of this program product. The specific functions implemented in the embodiments of this program product are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments. The executable computer program code or "code" used to perform the various embodiments can be written in high-level programming languages such as C, C++, Python, Smalltalk, Java, JavaScript, Visual Basic, Structured Query Language (e.g., Transact-SQL), Perl, or in various other programming languages.
[0101] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0102] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0103] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0104] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0105] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0106] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0107] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0108] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0109] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0110] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0111] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A Cartesian genetic programming energy scheduling method, characterized in that, The method includes the following steps: S1: Acquire environmental status data, discrete action sets, and training scenario data of the energy management system; S2: Initialize the Cartesian genetic programming CGP population, which contains multiple CGP individuals, and the genotype of each CGP individual is represented as a directed acyclic graph composed of computation nodes arranged in a two-dimensional grid; S3: For the current decision-making moment, obtain the environmental state vector. An explicit action selection strategy is adopted to select the environmental state vector. The vector is concatenated with each candidate action in the discrete action set to construct the corresponding augmented input vector. ; S4: Perform fitness assessment on individuals in the population: For each augmented input vector... Input the CGP individual to be evaluated, and obtain the scalar score of the individual for each candidate action through forward propagation; select the action with the lowest score as the control instruction at the current moment, and calculate the fitness value of the individual based on the cumulative reward in the training scenario; S5: Determine whether the evolution termination condition is met. If it is met, proceed to step S9; otherwise, proceed to step S6. S6: Based on the fitness assessment results, an elite selection strategy is used to select parent individuals from the current population; S7: Apply the liveness-aware sampling mutation operator to the selected parent individuals to generate offspring individuals, including: S71: By starting from the output node of a CGP individual and traversing its genotype map in reverse, the set of active nodes that actually contribute to the output is identified. S72: Based on the number of nodes in the set of active nodes and the number of inactive nodes Dynamically calculate the mutation budget allocated to active nodes. and the mutation budget allocated to inactive nodes ,in, The calculated value is greater than ; S73: Based on the mutation budget determined in step S72, randomly select a corresponding number of nodes from the set of active nodes and the set of inactive nodes as nodes to be mutated; S8: Perform mutation operation on each node to be mutated selected in step S73. The mutation operation includes at least one of the following: randomly replacing the function of the node, randomly reconnecting the input index of the node, and adding random perturbation to the weight parameters of the node. After generating offspring individuals, merge the offspring individuals with the elite parent individuals to update the population, and return to step S3. S9: Output the CGP individual with the highest fitness in the population after evolution, as the optimal energy scheduling strategy.
2. The method according to claim 1, characterized in that, In step S1, the environmental status data of the energy management system The data is a D-dimensional vector, including data from at least one of the following scenarios: Multi-energy microgrid (MEMG) scenario: Electricity load demand Heat load demand Real-time electricity price Available photovoltaic power State of charge of energy storage unit and and the current time step ; Active distribution network ADN-EES scenario: Net load of network nodes State of charge of energy storage unit Real-time electricity price Current time step Node voltage amplitude and available photovoltaic power .
3. The method according to claim 1, characterized in that, In step S1, the discrete action set These correspond to the discharge, idle, and charging behaviors of the energy storage unit, or the shutdown, partial load operation, and full load operation states of the controllable generator set, respectively.
4. The method according to claim 1, characterized in that, In step S2, the function set of the CGP individual is: The genotype of each functional node is encoded as a tuple. ,in, For the functionalities of a node, Connect the node's input index. These are the weight parameters of the node.
5. The method according to claim 1, characterized in that, In step S4, select the action with the lowest score. The calculation formula is: ,in For CGP individuals, augmented input vector The calculated scalar score; the individual's fitness value. Accumulated rewards across all training scenarios Average value: , This represents the number of training scenarios.
6. The method according to claim 1, characterized in that, In step S72, the active node mutation budget Inactive node mutation budget Calculated dynamically using the following formula: in, The preset activity intensity parameters, and These are the lower and upper limits of the preset total number of mutated nodes, respectively.
7. The method according to claim 1 or 6, characterized in that, In step S8, a mutation operation is performed on the selected node to be mutated, specifically: with a preset mutation probability. Perform at least one of the following operations: (1) From the function set A new function is randomly selected uniformly to replace the original function of the node. ; (2) Randomly select new connection indices from the set of feasible input connection indices to replace the original input connections of the node. ; (3) The original weight parameters of the node Add a Gaussian distribution Random noise is removed, and the results are truncated to a preset weighted interval. Inside.
8. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method according to any one of claims 1 to 7.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.