Iterative methods, devices, and storage media for power trading intelligent agents
By generating counterexamples of field-level knowable task contracts and transaction relationships, analyzing path impact, and generating a set of repair constraints, the problem of difficulty in quantifying evaluation feedback in the iteration of power trading algorithms is solved, and the quantifiability and reliability of iteration are realized.
Patent Information
- Application Number
- CN202611279530.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-21
- Publication Date
- 2026-11-17
AI Technical Summary
In the iteration of existing power trading algorithms, the evaluation feedback is difficult to quantify and constrain, which leads to the problem that the agent's historical capabilities are easily degraded during iteration.
By acquiring prediction task information and field catalog, we perform knowledge processing to generate field-level knowledgeable task contracts, structure the basic algorithm route, perform pre-execution verification, generate transaction relationship counterexamples, analyze path impact, generate repair constraint sets, and perform structured modification patch generation and verification to ensure the quantifiability and reliability of iteration.
It achieves quantifiability and reliability in the iteration of power trading algorithms, improves the reliability of iteration, and avoids the degradation of historical capabilities.
Smart Images

Figure CN123118255A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power trading algorithm iteration, and in particular to an iterative method, device and storage medium for a power trading intelligent agent. Background Technology
[0002] With the advancement of the electricity spot market, prediction algorithms for day-ahead, real-time, and nodal prices need continuous iteration to adapt to changes in market supply and demand structures and trading rules. Existing agents are already capable of reading data descriptions, model code, experimental results, and evaluation metrics, and proposing solutions such as adding features, adjusting training windows, changing models, modifying loss functions, or adding post-processing based on natural language objectives. Some systems further allow agents to call training scripts, execute experiments, read evaluation results, and continue to modify them, thus forming an automated algorithmic iterative process of generating solutions, executing experiments, returning scores or reporting errors, and generating solutions again.
[0003] However, the aforementioned general constraint enforcement framework lacks a unified constraint representation for data release time, incorrect trading relationships, and degradation of high-value scenarios in power trading forecasting tasks. The natural language suggestions output by the agent lack definite data fields, making them unsuitable for direct conversion into repeatable algorithmic routes. Evaluation results are limited to scores or descriptive text, failing to specify the minimum necessary changes to the forecast output and thus failing to formulate machine-executable repair targets. Even after receiving feedback, the agent still needs to guess which module should be modified and to what extent. Even if new results improve the outcome, it cannot determine which modification caused it, and this may disrupt already correct trading relationships, leading to historical capability degradation. Therefore, a new technology is needed to address the technical problem of difficulty in quantifying constraints on agent iterations through evaluation feedback during power trading algorithm iterations, which easily leads to historical capability degradation. Summary of the Invention
[0004] The main objective of this invention is to solve the technical problem that evaluation feedback is difficult to quantify and constrain the iteration of intelligent agents in the iteration of power trading algorithms, which easily leads to the degradation of historical capabilities.
[0005] The first aspect of this invention provides an iterative method for an electricity trading intelligent agent, comprising the steps of: Obtain prediction task information, field directory, task dataset, basic algorithm route, and repair method pool; Based on the prediction task information and the field catalog, the candidate fields in the task dataset are subjected to awareness processing to obtain a field-level awareness task contract, wherein the field-level awareness task contract includes: available input range and post-evaluation range. Based on the field-level known task contract, the basic algorithm route is structured to obtain the current algorithm route, and based on the field-level known task contract, the current algorithm route is pre-execution verified to obtain an executable algorithm route. Based on the executable algorithm route, the data within the available input range is subjected to prediction processing to obtain the prediction result and the route execution record corresponding to the prediction result; Based on the post-evaluation scope, the prediction results are checked for transaction relationships to obtain counterexamples of transaction relationships, wherein the counterexamples of transaction relationships represent the differences between the actual transaction relationships and the predicted transaction relationships; Based on the counterexamples of the transaction relationship and the route execution records, the path impact analysis of the current algorithm route is performed to obtain a set of repair constraints, wherein the set of repair constraints includes: target relationship boundary, route modification range, and relationship regression range; Based on the set of repair constraints and the pool of repair methods, the current algorithm route is subjected to constrained patch generation processing to obtain a structured modification patch; Based on the set of repair constraints, the structured modification patch is subjected to compliance verification to obtain the verification result. When the verification result is qualified, the structured modification patch is merged with the current algorithm route to obtain the next generation algorithm route. Based on the field-level knowability task contract, the next-generation algorithm route is executed and verified to obtain the execution result. Based on the repair constraint set, the execution result is subjected to relational regression verification to obtain the route verification result. Based on the route verification result, the version status of the next-generation algorithm route and the repair method pool are updated to obtain the algorithm route and repair method pool for subsequent iterations.
[0006] Optionally, in a first implementation of the first aspect of the present invention, the step of performing awareness processing on candidate fields in the task dataset based on the prediction task information and the field directory to obtain field-level awareness task contracts includes: Based on the prediction task information, the prediction starting point and prediction step size of the prediction task are determined to obtain the task time boundary. Based on the task time boundary, the release time and release batch of each candidate field in the field directory are verified to obtain the time-aware status of each candidate field; Based on the prediction step size in the task time boundary, the applicability of the candidate fields with the time-known state is checked to obtain the task availability state of each candidate field. Based on the task availability status, the reference time and statistics window of each candidate field are checked to obtain the field reference range; Based on the field reference range, the consistency of the field usage in the training and prediction phases is checked to obtain the usable input range; Based on the task time boundary, data used to evaluate the prediction results but not as input to the algorithm route are isolated to obtain the post-evaluation range. Based on the available input range and the post-evaluation range, a field-level knowable task contract is generated.
[0007] Optionally, in a second implementation of the first aspect of the present invention, the steps of performing structured processing on the basic algorithm route according to the field-level knowable task contract to obtain the current algorithm route, and performing pre-execution verification on the current algorithm route according to the field-level knowable task contract to obtain an executable algorithm route include: Based on the preset route description structure, the basic algorithm route is processed into nodes to obtain route nodes with input and output interfaces. Based on the data transmission relationship between the route nodes, the route nodes are connected to obtain a structured execution graph, and the structured execution graph is determined as the current algorithm route; Based on the field-level knowability task contract, the field references in the current algorithm route are checked node by node to obtain the field reference check results; Based on the input and output interfaces of the route nodes, the integrity of the data transmission relationship between the route nodes is checked to obtain the route interface check result; Based on the field reference verification results and the route interface verification results, the execution permission determination is performed on the current algorithm route to obtain an executable algorithm route.
[0008] Optionally, in a third implementation of the first aspect of the present invention, the step of performing prediction processing on the data within the available input range according to the executable algorithm route to obtain the prediction result and the route execution record corresponding to the prediction result includes: Data within the available input range is extracted from the task dataset to obtain route input data; Based on the executable algorithm route, the route input data is processed and transferred between nodes to obtain the intermediate outputs of each route node. Based on the prediction output interface in the executable algorithm route, the intermediate outputs are aggregated to obtain the prediction result; Based on the execution order of the route nodes, the field versions, node parameters, and data transfer relationships between nodes used during the execution process are recorded to obtain the route execution record, so that the route execution record can be used to determine the route influence path corresponding to the prediction result.
[0009] Optionally, in a fourth implementation of the first aspect of the present invention, the step of verifying the transaction relationship based on the post-evaluation range to obtain counterexamples of the transaction relationship includes: Based on the aforementioned post-evaluation scope, electricity price periods with transaction associations are paired to obtain transaction period pairs; The actual transaction relationship is obtained by calculating the relationship between the actual electricity prices of the transaction period pairs; Based on the transaction time period pair, the predicted electricity price for the corresponding time period in the prediction result is calculated to obtain the predicted transaction relationship; Based on the preset transaction relationship boundaries, the actual transaction relationship and the predicted transaction relationship are compared and processed to obtain the relationship difference type; Based on the relationship difference type and the preset transaction relationship boundary, the distance of the predicted transaction relationship is calculated to obtain the boundary violation amount; Based on the transaction time period pair, the relationship difference type, and the boundary violation amount, generate a transaction relationship counterexample.
[0010] Optionally, in a fifth implementation of the first aspect of the present invention, the step of performing path impact analysis on the current algorithm route based on the counterexamples of the transaction relationship and the route execution record to obtain the set of repair constraints includes: Based on the relationship difference type and boundary violation amount in the counterexamples of the transaction relationship, the boundary repair amount of the predicted transaction relationship is calculated to obtain the target relationship boundary; Based on the transaction time period corresponding to the counterexample of the transaction relationship and the route execution record, the route nodes that form the corresponding prediction results are traced back to obtain the path affected by the counterexample; Based on the negative example impact path, the route nodes that can affect the target relationship boundary are filtered to obtain the set that can be modified. Based on the allowed modification set, route nodes in the current algorithm route that do not belong to the path affected by the counterexample and are used to maintain the correct transaction relationship are determined to obtain the frozen set; Based on the field-level knowability task contract, the prohibited modification objects are determined to obtain the prohibited set; Based on the negative examples of the transaction relationship, the transaction time periods that meet the preset transaction relationship boundary and are associated with the negative examples of the transaction relationship are filtered to obtain a relationship regression set; A set of repair constraints is generated based on the target relation boundary, the allowed modification set, the frozen set, the prohibited set, and the relation regression set.
[0011] Optionally, in a sixth implementation of the first aspect of the present invention, the step of generating a constrained patch for the current algorithm route based on the set of repair constraints and the pool of repair methods to obtain a structured modification patch includes: Based on the counterexamples of transaction relationships in the repair constraint set, the repair operators in the repair method pool are matched to obtain candidate repair operators. Based on the allowed modification set in the repair constraint set, the action path nodes of the candidate repair operator are filtered to obtain the first repair operator; Based on the target relation boundary, the expected boundary effect of the first repair operator is checked for direction to obtain a second repair operator whose boundary action direction conforms to the target relation boundary. Based on the current algorithm route and the field-level knowability task contract, the preconditions and exclusion conditions of the second repair operator are checked to obtain the available repair operator; Based on the historical execution results of the available repair operators and the required modification range, the available repair operators are selected to obtain the target repair operator; Based on the target repair operator, the route nodes in the current algorithm route that are within the allowed modification set are modified to obtain candidate node change information; Based on the frozen set and the prohibited set, the candidate node change information is constrained to obtain a structured modification patch.
[0012] Optionally, in the seventh implementation of the first aspect of the present invention, the steps of performing execution verification on the next-generation algorithm route according to the field-level knowability task contract to obtain execution results, performing relational regression verification on the execution results according to the repair constraint set to obtain route verification results, and updating the version status of the next-generation algorithm route and the repair method pool according to the route verification results to obtain algorithm routes and repair method pools for subsequent iterations include: Based on the field-level knowability task contract, the next-generation algorithm route is executed within a preset prediction window to obtain candidate prediction results; Based on the target relationship boundary in the repair constraint set, the transaction relationships to be repaired in the candidate prediction results are checked to obtain the target relationship repair results; Based on the relation regression set in the repair constraint set, the historical correct transaction relations in the candidate prediction results are verified to obtain the historical relation preservation result; Based on the evaluation criteria determined by the field-level knowability task contract, the prediction performance of the candidate prediction results is checked to obtain the prediction performance preservation result. Based on the target relationship repair results, the historical relationship preservation results, and the prediction performance preservation results, the next-generation algorithm route is subjected to acceptance processing to obtain route verification results; When the route verification result is passed, the current algorithm route is replaced according to the next generation algorithm route to obtain the algorithm route for subsequent iterations. The repair method pool is positively updated according to the boundary improvement result and historical relationship preservation result corresponding to the target repair operator to obtain the updated repair method pool. When the route verification result is unsuccessful, the current algorithm route is determined as the algorithm route for subsequent iterations, and the repair method pool is negatively updated according to the route verification result to obtain the updated repair method pool.
[0013] A second aspect of the present invention provides an iterative device for an electricity trading agent, comprising: a memory and at least one processor, wherein the memory stores instructions, and the memory and the at least one processor are interconnected via a line; the at least one processor invokes the instructions in the memory to cause the iterative device for the electricity trading agent to execute the above-described iterative method for the electricity trading agent.
[0014] A third aspect of the present invention provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the iterative method of the power trading agent described above.
[0015] In this embodiment of the invention, by performing knowability processing on candidate fields, a field-level knowable task contract is obtained, including the range of available inputs and the range of post-evaluation, ensuring the authenticity of the iterative data used. Transaction relationship verification is performed on the prediction results to obtain transaction relationship counterexamples, and path impact analysis is performed using route execution records to generate a repair constraint set. Evaluation feedback in score or text form is converted into machine-executable repair objectives, and the objects allowed for modification are limited to the route range associated with the counterexamples. Based on the repair constraint set, the generation and verification of structured modification patches are constrained throughout the entire process, ensuring that the repair effect is quantified and accepted by the target relationship boundary, and that historically correct transaction relationships remain valid through relationship regression verification. This ensures that the iteration and repair of the power trading algorithm are quantifiable, improves the reliability of the power trading algorithm iteration, and solves the technical problem that evaluation feedback is difficult to quantify to constrain agent iteration and easily leads to historical capability degradation. Attached Figure Description
[0016] Figure 1 This is a schematic diagram of an embodiment of the iterative method for the power trading intelligent agent in this invention; Figure 2This is a schematic diagram of a specific embodiment of step 102 of the iterative method for the power trading intelligent agent in this invention. Figure 3 This is a schematic diagram of a specific embodiment of step 103 of the iterative method for the power trading intelligent agent in this invention. Figure 4 This is a schematic diagram of a specific embodiment of the 104 steps of the iterative method for the power trading intelligent agent in this invention; Figure 5 This is a schematic diagram of one embodiment of the iterative device for the power trading intelligent agent in this invention. Detailed Implementation
[0017] This invention provides an iterative method, device, and storage medium for power trading intelligent agents.
[0018] The embodiments of the present invention will now be described in more detail with reference to the accompanying drawings. While some embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the accompanying drawings and embodiments are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.
[0019] In the description of the embodiments disclosed in this invention, the term "comprising" and similar terms should be understood as open-ended inclusion, i.e., "including but not limited to". The term "based on" should be understood as "at least partially based on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc., may refer to different or the same objects. Other explicit and implicit definitions may also be included below.
[0020] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 A schematic diagram of an embodiment of the iterative method for a power trading intelligent agent in this invention includes: 101. Obtain prediction task information, field directory, task dataset, basic algorithm route, and repair method pool; In this embodiment, the prediction task information includes the market type, node, prediction release time, target execution date, prediction step size, and algorithm objective corresponding to the prediction task, such as day-ahead electricity price prediction task and real-time electricity price prediction task. The field directory records the release information of each candidate field in the task dataset, such as the earliest release time, release batch, and applicable prediction step size for each candidate field. The task dataset provides the data foundation for the training and evaluation of the prediction task, and the basic algorithm route is the algorithm version to be iterated. The repair method pool stores the repair operators accumulated in each iteration, and each repair operator is stored in a unified interface format.
[0021] 102. Based on the prediction task information and the field catalog, perform awareness processing on the candidate fields in the task dataset to obtain a field-level awareness task contract, wherein the field-level awareness task contract includes: available input range and post-evaluation range; In this embodiment, the electricity market data has a clear release time and release batch. There may be multiple batches of supply and demand forecasts and revised data for the same target trading period. If only the field is selected according to the target time, data that has not yet been released at the forecast time may be mixed into the historical backtesting, making the model obtain unrealistic prediction capabilities. The candidate fields are divided into the usable input range and the ex-post evaluation range and a field-level knowable task contract is formed to ensure the authenticity of the iteration from the perspective of data usage behavior.
[0022] For details, please refer to Figure 2 , Figure 2 This is a schematic diagram of a specific embodiment of step 102 of the iterative method for the power trading intelligent agent in this invention. Step 102 includes the following specific implementation methods: 1021. Based on the prediction task information, determine the prediction starting point and prediction step size of the prediction task to obtain the task time boundary; 1022. Based on the task time boundary, verify the release time and release batch of each candidate field in the field directory to obtain the time-aware status of each candidate field; 1023. Based on the prediction step size in the task time boundary, the applicable scope of the candidate fields with the time-known state is checked to obtain the task-available state of each candidate field. 1024. Based on the available status of the task, verify the reference time and statistical window of each candidate field to obtain the field reference range; 1025. Based on the field reference range, perform consistency checks on the field usage caliber between the training and prediction phases to obtain the usable input range; 1026. Based on the task time boundary, isolate the data used to evaluate the prediction results but not as input to the algorithm route to obtain the post-evaluation range; 1027. Generate a field-level knowable task contract based on the available input range and the post-evaluation range.
[0023] In steps 1021-1027, based on the prediction task information, the prediction starting point is determined as t0, and the prediction step size is determined to obtain the task time boundary, such as day-ahead prediction or D+2 prediction.
[0024] Based on the task time boundary, the applicability of candidate field f in the field catalog is verified. If the earliest available time of candidate field f is not later than the prediction start point t0 and the release batch meets the task requirements, the time-aware status of candidate field f is determined to be time-aware; otherwise, it is determined to be time-unaware, thus obtaining the time-aware status of each candidate field. When the prediction step size of candidate field f covers the task prediction step size, the task-available status of candidate field f is determined to be task-available. The task-available status of each candidate field is confirmed sequentially according to this logic.
[0025] For each candidate field f in an available task state, the reference time and statistical window are checked, and the right endpoint of the statistical window and the latest original time of each candidate field f are counted in a rolling manner to ensure that the latest original time and the right endpoint of the statistical window are not later than the prediction start point t0, thus obtaining the field reference range.
[0026] Consistency verification ensures that the feature definitions of training samples and inference samples are consistent, and that the release batch version that meets the task requirements is selected for the same target date. Fields that pass verification are converted into usable input ranges.
[0027] The data included in the post-evaluation scope include the label field, the actual clearing data of the target execution date, and the revised data of the release batches that are later than the prediction start point. The label field must not be included in the current prediction input and is only used for post-evaluation. That is, the validation set data is divided from each candidate field f within the same task time boundary.
[0028] Based on the above-described data combination, the available input range and post-evaluation range are obtained, and a field-level knowable task contract is generated.
[0029] 103. Based on the field-level known task contract, the basic algorithm route is structured to obtain the current algorithm route, and based on the field-level known task contract, the current algorithm route is pre-execution verified to obtain an executable algorithm route. In this embodiment, structured processing is used to limit the agent's method expression, ensuring that the algorithm output by the agent is expressed in a unified and validated form. When the agent proposes adding features, it must provide field identifiers, field awareness references, alignment methods, and access positions. When proposing to modify training, it must provide the modified training stage, parameter range, and stopping conditions. Pre-execution validation is performed by a deterministic validation module independent of the agent; the agent itself cannot modify or skip the validation results. Based on the field-level awareness task contract, pre-execution validation is performed on the current algorithm route to obtain an executable algorithm route.
[0030] For details, please refer to Figure 3 , Figure 3 This is a schematic diagram of a specific embodiment of step 103 of the iterative method for the power trading intelligent agent in this invention. Step 103 includes the following specific implementation methods: 1031. Based on the preset route description structure, the basic algorithm route is processed into nodes to obtain route nodes with input and output interfaces; 1032. Based on the data transmission relationship between the route nodes, the route nodes are connected to obtain a structured execution graph, and the structured execution graph is determined as the current algorithm route; 1033. Based on the field-level knowability task contract, perform node-by-node verification of the field references in the current algorithm route to obtain the field reference verification results; 1034. Based on the input and output interfaces of the route nodes, perform an integrity check on the data transmission relationship between the route nodes to obtain the route interface check result; 1035. Based on the field reference verification result and the route interface verification result, perform execution permission determination on the current algorithm route to obtain an executable algorithm route.
[0031] In steps 1031-1035, the preset route description structure requires that data references, operator connections, training windows, output formats, and evaluation targets are all mandatory fields. Execution will not proceed if any field is missing. After node-based processing, route nodes with input and output interfaces are obtained. It should be noted that route node types include data operators, processing operators, training operators, prediction operators, and evaluation operators. Node types are used to distinguish between data nodes, processing nodes, training nodes, prediction nodes, and evaluation nodes.
[0032] The route nodes are connected in a directed manner according to the data transmission relationship between them. Each connection represents the transmission of the output of the previous node to the input of the next node, thus obtaining a structured execution graph, which is then used as the current algorithm route.
[0033] Based on the field-level knowability task contract, the field references in the current algorithm route are checked node by node. When a field referenced by a certain route node is not within the range of available inputs, the corresponding field reference check result is failed. The field reference check result is obtained after traversal.
[0034] The integrity of data transmission relationships between nodes is checked based on their input and output interfaces. If an input interface has no data source, an output interface has no receiving node, or the data types of connected interfaces are inconsistent, the route interface check result is "failed," and the route interface check result is obtained after traversal.
[0035] Execution is permitted only if both the field reference verification result and the route interface verification result pass, and the current algorithm route is determined to be an executable algorithm route. Otherwise, execution is rejected, and a data reference rejection record is output. The data reference rejection record includes the node identifier where the non-compliant reference occurred, the referenced field, the prediction starting point, the earliest available time of the field, and the reason for rejection.
[0036] 104. Based on the executable algorithm route, perform prediction processing on the data within the available input range to obtain the prediction result and the route execution record corresponding to the prediction result; In this embodiment, the predictive processing is executed in an isolated operating environment, which is isolated from the production environment. The executable algorithm route, which is verified before execution, runs in the isolated operating environment. All data actually called during the execution process is recorded to form a traceable execution process.
[0037] For details, please refer to Figure 4 , Figure 4 This is a schematic diagram of a specific embodiment of the iterative method for the power trading intelligent agent in this invention, which includes the following specific implementation methods in step 104: 1041. Extract data within the available input range from the task dataset to obtain route input data; 1042. Based on the executable algorithm route, perform node-to-node transfer and node processing on the route input data to obtain the intermediate output of each route node; 1043. Based on the prediction output interface in the executable algorithm route, the intermediate outputs are aggregated to obtain the prediction results; 1044. Based on the execution order of the route nodes, record the field versions, node parameters, and data transfer relationships between nodes used during the execution process to obtain the route execution record, so that the route execution record can be used to determine the route influence path corresponding to the prediction result.
[0038] In steps 1041-1044, the extracted route input data comes only from the available input range and does not include data within the post-evaluation range. Data within the available input range is extracted from the task dataset. Following the topological order determined by the structured execution graph, each route node undergoes inter-node transfer and node processing to obtain the intermediate outputs of each route node. The intermediate outputs of the prediction nodes are then aggregated using the prediction output interface to obtain the prediction result. Based on the execution order of the route nodes, the field versions used during execution, node parameters, and inter-node data transfer relationships are recorded to form a route execution record. This route execution record is used to subsequently trace back from the prediction result to the route node that generated the prediction result, establishing a traceable association between the prediction result and the route execution record.
[0039] 105. Based on the post-evaluation scope, the prediction results are checked for transaction relationships to obtain counterexamples of transaction relationships, wherein the counterexamples of transaction relationships represent the differences between the actual transaction relationships and the predicted transaction relationships; In this embodiment, the actual and predicted electricity prices are first converted into structured labels that reflect the sequential relationship between trading periods. Then, counterexamples of trading relationships are generated based on the differences in these structured labels, transforming the evaluation feedback from scores or text into machine-processable corrective evidence. It should be noted that the point-by-point prediction indicators serve only as a parallel baseline and do not replace the verification of trading relationships.
[0040] Specifically, step 105 includes the following specific implementation methods: 1051. Based on the aforementioned post-evaluation scope, the electricity price periods with transaction associations are paired to obtain transaction period pairs; 1052. Calculate the relationship between the actual electricity prices for the aforementioned trading period pairs to obtain the actual trading relationship; 1053. Based on the transaction time period pair, perform relationship calculation on the predicted electricity price for the corresponding time period in the prediction result to obtain the predicted transaction relationship; 1054. Based on the preset transaction relationship boundaries, compare and process the actual transaction relationship and the predicted transaction relationship to obtain the relationship difference type; 1055. Based on the relationship difference type and the preset transaction relationship boundary, perform distance calculation on the predicted transaction relationship to obtain the boundary violation amount; 1056. Generate a counterexample of the transaction relationship based on the transaction time period pair, the relationship difference type, and the boundary violation amount.
[0041] In steps 1051-1056, in step 1051, the electricity price period with transaction association refers to two periods in the same market, the same node, or the same settlement unit that have a sequential relationship in terms of transaction time; the period that comes first in the time sequence is recorded as the preceding period. The later time period is called the subsequent time period. , and As an index for trading periods, based on the actual clearing data within the post-evaluation range, time periods that satisfy the above trading associations are paired up to obtain trading period pairs. .
[0042] In step 1052, the trading session is configured. The actual electricity price is used to calculate the relationship, and the relationship execution cost required to form the transaction relationship is deducted to obtain the actual transaction relationship represented by the actual net price difference:
[0043] In step 1053, the transaction is processed according to the trading session. The predicted electricity prices for the corresponding time periods in the forecast results are calculated using the same caliber to obtain the predicted transaction relationship represented by the predicted net price difference:
[0044] in, Indicates the index of the preceding time period. This indicates the index for subsequent time periods. The superscript "real" represents the actual clearing result, and the superscript "pred" represents the prediction result generated by the algorithm route to be evaluated within the same prediction window. This indicates the actual electricity price during the pre-load period. This indicates the actual electricity price for subsequent periods. This indicates the predicted electricity price for the leading period. This indicates the predicted electricity price for subsequent periods. This refers to the pre-defined relationship execution cost, based on market rules or business terminology, when a transaction relationship is formed from the initial period to the subsequent period. This cost serves only as an external parameter for relationship evaluation, and the internal implementation of the downstream transaction module is not required to be disclosed. This represents the actual net price difference after deducting the relationship execution costs. This represents the projected net price difference after deducting relationship execution costs. Electricity prices, relationship execution costs, and net price difference are measured in the same unit.
[0045] In step 1054, the preset transaction relationship boundaries include a relationship execution threshold and a threshold buffer. For any actual net price difference or predicted net price difference, a three-state relationship label is generated according to the preset transaction relationship boundaries:
[0046]
[0047]
[0048] in, Indicates the trading session The three-state relationship label, This represents the input net price difference. The actual net price difference is used for actual evaluation, while the predicted net price difference is used for predictive evaluation. Indicates the trading session Relationship execution threshold This represents a pre-defined threshold buffer size that is not less than zero. Indicates the upper boundary. The upper and lower boundaries are indicated by the relationship label 1, which indicates that the net price difference is at or above the upper boundary; the lower boundary is indicated by the relationship label -1; and the buffer zone between the upper and lower boundaries is indicated by the relationship label 0. It should be noted that setting the threshold buffer size is to prevent the system from repeatedly changing its feedback direction due to small numerical fluctuations.
[0049] Substituting the actual net price difference and the projected net price difference into the three-state relationship labels above, we obtain the actual relationship labels. And predictive relationship labels Based on the preset transaction relationship boundaries, actual and predicted transaction relationships are compared to obtain relationship difference types. Relationship difference types include: underreporting, i.e. and This indicates that a significant price difference had actually formed over a period of time but was not identified in the forecast; a false alarm, i.e. and This indicates that the forecast reported a significant price difference over a specific period, but this did not actually occur; the direction is reversed, meaning... This indicates that the predicted price order is the opposite of the actual order. Represents a symbolic function. This indicates the result of substituting the actual relationship label (i.e., the actual net price difference) into the three-state relationship label. This indicates the result of substituting the predicted net price difference into the three-state relationship label.
[0050] In step 1055, distance is calculated for the predicted transaction relationship based on the relationship difference type and the preset transaction relationship boundary to obtain the boundary violation amount. The boundary violation amounts corresponding to missed reports, false reports, and direction reversals are as follows:
[0051]
[0052]
[0053] in, , and These represent the trading sessions respectively. The false negative boundary violation, false positive boundary violation, and reversed direction boundary violation are all non-zero values. The subscripts `miss`, `false`, and `rev` correspond to false negatives, false positives, and reversed direction violations, respectively. Indicates in 0 and The larger value is selected to ensure that the boundary violation is not less than zero.
[0054] When the difference within the parentheses is not greater than zero, it indicates that the prediction result has met the boundary of that type of target, and the corresponding boundary violation amount is 0. The underreported boundary violation amount indicates how far the predicted net price difference is from the upper boundary, the false positive boundary violation amount indicates how much the predicted net price difference exceeds the boundary that should be exited, and the direction reversed boundary violation amount indicates how much the predicted net price difference needs to move at least to restore the direction consistent with the actual direction.
[0055] In step 1056, for the first All target counterexamples from each round of the algorithm are aggregated using scene weights to obtain the weighted total violation count: ,in, This indicates the number of iterations in the algorithm's path. Indicates the first The set of target counterexamples to be repaired. express Any counterexample in, Indicate counterexample Boundary violation amount calculated based on the type of relational difference. Indicate counterexample Non-negative scenario weights can be configured based on the importance of the scenario, the scarcity of counterexamples, or market rules. Indicates the first The weighted total violation of the current algorithm route across all target counterexamples is represented by the summation symbol. Summing all the counterexamples.
[0056] Based on the transaction time pair, relationship difference type, and boundary violation amount, a counterexample of the transaction relationship is generated. Each counterexample of the transaction relationship is stored in the form of a quintuple, which includes the transaction time pair, relationship difference type, target direction, current boundary violation amount, and market scenario. This allows subsequent steps to determine the target relationship boundary based on the quintuple, without having to reinterpret it manually.
[0057] 106. Based on the counterexamples of the transaction relationship and the route execution record, perform path impact analysis on the current algorithm route to obtain a set of repair constraints, wherein the set of repair constraints includes: target relationship boundary, route modification range, and relationship regression range; In this embodiment, path impact analysis refers to tracing back the data transmission relationship along the current algorithm route to form the corresponding prediction result route nodes based on the transaction time period pairs corresponding to the counterexamples of the transaction relationship, determining the path of the counterexamples, and then determining the range of route nodes that can be modified and the range of route nodes that must remain unchanged. The repair constraint set encapsulates "what needs to be repaired" and "how to repair" in the same machine-executable object. Having only the target relationship boundary without modification permission would allow the agent to arbitrarily change the route, while having modification permission without quantification boundaries would make it impossible to determine whether the repair is complete.
[0058] Specifically, the 106 steps include the following specific implementation methods: 1061. Based on the relationship difference type and boundary violation amount in the counterexamples of the transaction relationship, calculate the boundary repair amount for the predicted transaction relationship to obtain the target relationship boundary; 1062. Based on the transaction period corresponding to the counterexample of the transaction relationship and the route execution record, the route nodes that form the corresponding prediction result are traced in reverse to obtain the path affected by the counterexample; 1063. Based on the negative example impact path, filter the route nodes that can affect the target relationship boundary to obtain a set that can be modified; 1064. Based on the allowed modification set, determine the route nodes in the current algorithm route that do not belong to the path affected by the counterexample and are used to maintain the correct transaction relationship, and obtain the frozen set; 1065. Based on the field-level knowability task contract, determine the objects that are prohibited from being modified to obtain the prohibited set; 1066. Based on the counterexamples of the transaction relationship, filter the transaction time periods that meet the preset transaction relationship boundary and are associated with the counterexamples of the transaction relationship to obtain a relationship regression set; 1067. Generate a set of repair constraints based on the target relation boundary, the allowed modification set, the frozen set, the prohibited set, and the relation regression set.
[0059] In steps 1061-1067, step 1061 determines the direction of the target relationship boundary based on the relationship difference type in the counterexamples of the transaction relationship. For underreported counterexamples, the target relationship boundary is to make the predicted net price difference reach the upper boundary, i.e. For false positive counterexamples, the target relation boundary is to cause the predicted net price spread to exit to the lower boundary or below, i.e. ,in, Indicates the trading session The predicted net price difference, Indicates the threshold for relationship execution. Indicates the threshold buffer size. Indicates the upper boundary. This represents the lower boundary. For counterexamples with reversed direction, the target relation boundary is a directional constraint that makes the sign of the predicted net price difference consistent with the sign of the actual net price difference. The boundary repair amount is the boundary violation amount of the corresponding counterexample, i.e., the minimum distance the predicted net price difference needs to move, and is determined solely based on whether the final relation crosses the target relation boundary.
[0060] In step 1062, the route execution record contains the field versions, node parameters, and data transmission relationships between nodes used during the execution process. Based on the transaction time period pairs corresponding to the transaction relationship counterexamples, the route nodes that form the corresponding prediction results are traced backward along the data transmission relationships between nodes to obtain the counterexample impact path. The counterexample impact path is the set of route nodes that extend upstream from the prediction node that generates the prediction result for the corresponding time period to the data access node.
[0061] In step 1063, route nodes in the counterexample impact path that can affect the target relationship boundary are filtered into the allowed modification set. In step 1064, the frozen set includes route nodes in the current algorithm route that are not part of the counterexample impact path and are used to maintain the correct transaction relationship. Route nodes in the frozen set must inherit the parent route during iteration, and their identifiers, parameters, and output interfaces must remain unchanged. In step 1065, prohibited modification objects are determined based on the field-level knowability task contract. The prohibited set includes data fields, actual labels, evaluation procedures, and version advancement status that can only be obtained after the prediction release time. Objects in the prohibited set must not be modified by any patch. In step 1066, the relationship regression set includes historical correct transaction time pairs that have satisfied the preset transaction relationship boundary and share the same time period or market scenario as the transaction relationship counterexample. The relationship regression set is used to check whether the repair breaks the existing correctness capability. In step 1067, the target relationship boundary, allowed modification set, frozen set, prohibited set, and relationship regression set are assembled into a machine-executable repair constraint set.
[0062] 107. Based on the set of repair constraints and the pool of repair methods, perform constrained patch generation processing on the current algorithm route to obtain a structured modification patch; In this embodiment, each repair operator in the repair method pool is stored using a unified interface. The agent generates structured modification patches only within the allowed modification set defined by the repair constraint set. Whether execution is allowed is determined by a deterministic verification module independent of the agent. The agent cannot bypass the verification to directly modify the evaluation result or candidate version status.
[0063] Specifically, step 107 includes the following specific implementation methods: 1071. Based on the counterexamples of transaction relationships in the repair constraint set, perform matching processing on the repair operators in the repair method pool to obtain candidate repair operators; 1072. Based on the allowed modification set in the repair constraint set, the action path nodes of the candidate repair operator are filtered to obtain the first repair operator; 1073. Based on the target relation boundary, the expected boundary effect of the first repair operator is checked for direction to obtain a second repair operator whose boundary action direction conforms to the target relation boundary; 1074. Based on the current algorithm route and the field-level knowability task contract, the preconditions and exclusion conditions of the second repair operator are checked to obtain the usable repair operator; 1075. Based on the historical execution results and required modification range of the available repair operators, select the available repair operators to obtain the target repair operator; 1076. Based on the target repair operator, perform change processing on the route nodes in the current algorithm route that are within the allowed modification set to obtain candidate node change information; 1077. Based on the frozen set and the prohibited set, the candidate node change information is constrained to obtain a structured modification patch.
[0064] In steps 1071-1077, in step 1071, based on the counterexample signatures of the counterexamples in the repair constraint set, repair operators matching the counterexample signatures are retrieved from the repair method pool to obtain candidate repair operators. In step 1072, the action modules of each candidate repair operator are checked one by one, and only candidate repair operators whose action modules all belong to the allowed modification set are retained to obtain the first repair operator. In step 1073, the expected boundary effect of the first repair operator is directionally checked, and the operator that passes the directional check is used as the second repair operator. When the target relationship boundary requires the predicted net price difference to cross the upper boundary upwards, only operators whose expected boundary effect is to increase the price difference in the corresponding time period are retained. When the target relationship boundary requires the predicted net price difference to exit to the lower boundary or below, only operators whose expected boundary effect is to decrease the price difference in the corresponding time period are retained.
[0065] In step 1074, based on the structured execution graph and field-level known task contract of the current algorithm route, the preconditions of the second repair operator are checked to see if they are met and whether the exclusion conditions are hit by the current market scenario or route structure. Operators whose preconditions are met and whose exclusion conditions are not hit are considered available repair operators. Operators that hit the exclusion conditions are not allowed to enter the candidate list to avoid repeated execution in a falsified scenario.
[0066] In step 1075, when multiple available repair operators coexist, the operator whose historical success scenario is closer to the current counterexample, requires a smaller modification range, has fewer historical regression degradations, or has lower execution cost is preferentially selected, and the selection rules and sorting basis are written into the candidate patch record. When there is no applicable operator in the repair method pool, the agent may generate a new repair operator according to the unified interface, but the new repair operator must specify the preconditions, modification template, expected boundary effect and regression set, and a new repair operator lacking any of the above fields must not be executed.
[0067] In step 1076, according to the modification template of the target repair operator, add, delete, replace or update parameters for the route nodes in the allowable modification set in the current algorithm route, to obtain candidate node change information. When a combination of multiple repair operators is adopted, check whether the action module, target boundary direction and parameter range of each operator conflict. If there is a conflict, split them into two sequentially executed candidate routes for separate verification, and it is not allowed to directly merge mutually offsetting modifications for one-time execution.
[0068] In step 1077, constraint processing is performed on the candidate node change information according to the freeze set and the prohibition set. Change items that touch the freeze set or the prohibition set are deleted, and route nodes not declared in the candidate node change information inherit the parent route by default. The structured modification patch obtained thereby at least includes the route nodes added, deleted and modified, the changed parameters, the used repair operators, the counterexample of the target transaction relationship and the expected impact, rather than a complete rewrite of the current algorithm route.
[0069] 108. Perform compliance verification on the structured modification patch according to the repair constraint set to obtain a verification result, and when the verification result is qualified, merge the structured modification patch with the current algorithm route to obtain a next-generation algorithm route; In this embodiment, the verification result is qualified when all route nodes involved in the structured modification patch belong to the allowable modification set, the route nodes in the freeze set remain unchanged, no object in the prohibition set is touched, the input and output interfaces between the nodes are complete, and the estimated resource consumption does not exceed the resource budget of the repair constraint set. Otherwise, the verification result is unqualified, the system retains the current algorithm route, and feeds back the specific violation item to the agent or the repair method pool. In the next round, the agent can only modify the patch for the clear violation item, and cannot expand the modification range under any pretext.
[0070] 109. Perform execution verification on the next-generation algorithm route according to the field-level knowability task contract to obtain an execution result, perform relationship regression verification on the execution result according to the repair constraint set to obtain a route verification result, and update the version status of the next-generation algorithm route and the repair method pool according to the route verification result, so as to obtain the algorithm route and repair method pool for subsequent iterations.
[0071] In this embodiment, the next-generation algorithm route is executed at a fixed starting point of training, verification, and test prediction. It regenerates the predicted electricity price, transaction relationship, and transaction relationship counterexamples. Only when the current transaction relationship counterexample is repaired and the relationship regression set remains valid can the relationship regression closure be formed. Only then can the next-generation algorithm route enter the next iteration round or wait for manual confirmation to advance. The agent cannot directly mark the next-generation algorithm route as the production version.
[0072] Specifically, step 109 includes the following specific implementation methods: 1091. Based on the field-level knowability task contract, execute the next-generation algorithm route within a preset prediction window to obtain candidate prediction results; 1092. Based on the target relation boundary in the repair constraint set, verify the transaction relations to be repaired in the candidate prediction results to obtain the target relation repair results; 1093. Based on the relation regression set in the repair constraint set, verify the historical correct transaction relations in the candidate prediction results to obtain the historical relation preservation result; 1094. Based on the evaluation criteria determined by the field-level knowability task contract, the prediction performance of the candidate prediction results is checked to obtain the prediction performance preservation result. 1095. Based on the target relationship repair results, the historical relationship preservation results, and the prediction performance preservation results, the next-generation algorithm route is subjected to acceptance processing to obtain route verification results; 1096. When the route verification result is passed, the current algorithm route is replaced according to the next generation algorithm route to obtain the algorithm route for subsequent iterations. The repair method pool is positively updated according to the boundary improvement result and historical relationship preservation result corresponding to the target repair operator to obtain the updated repair method pool. 1097. When the route verification result is unsuccessful, the current algorithm route is determined as the algorithm route for subsequent iterations, and the repair method pool is negatively updated according to the route verification result to obtain the updated repair method pool.
[0073] In steps 1091-1097, step 1091 includes a preset prediction window that includes a fixed starting point for training, validation, and testing predictions, as well as a rolling prediction window that is not involved in the current repair training. The next-generation algorithm route is executed within the preset prediction window to obtain candidate prediction results.
[0074] In step 1092, based on the target relation boundary in the repair constraint set, the weighted total violation amount of the transaction relations to be repaired in the candidate prediction results is recalculated, and the target relation repair result satisfies:
[0075] in, This indicates that the current algorithm route before the repair is at the [number]th position. The weighted total violation on the target counterexample set, This represents the weighted total violation amount recalculated in the next-generation algorithm route after applying the structured modification patch, under the same target counterexample set, the same weights, and the same evaluation window. This represents the minimum improvement percentage that is pre-written into the repair constraint set, satisfying... For high-priority counterexamples, the acceptance criterion can be further set to the corresponding boundary violation amount being equal to 0, that is, the counterexample must completely cross the target relation boundary.
[0076] In step 1093, based on the relation regression set in the repair constraint set, the historically correct transaction relations in the candidate prediction results are verified. The historical relation preservation result is displayed as the historical relation regression loss, which is the weighted proportion of the historically correct relations whose relation labels have degraded.
[0077] in, Indicates the first The relationship regression set used during the round of acceptance is the set of historical correct transaction relationships. express Any correct historical transaction relationship in the data. Represents the correct historical transaction relationship Non-negative importance weights, Indicates the first Wheel route to correct historical trading relationship The generated predicted relation labels, Represents the correct historical transaction relationship Corresponding actual relationship tags; The characteristic function takes the value 1 if the condition within the parentheses is true, and 0 otherwise. This represents the proportion of historical relation weights that have experienced predicted relation label degradation to the total weights of historical relations.
[0078] Historical relationships maintain outcome satisfaction ,in, This represents the historical relation regression loss calculated on the relation regression set by the next-generation algorithm. This represents the pre-set upper limit of the regression loss for non-negative historical relationships.
[0079] In step 1094, the candidate prediction results are checked point-by-point based on the evaluation criteria determined by the field-level knowability task contract; in one implementation, the point-by-point prediction loss is represented by the mean absolute error. ,in, This indicates the number of iterations in the evaluated algorithm path. This indicates the time index of the electricity price within the evaluation window. This indicates the total number of electricity price points included in the evaluation window. Indicates the first Wheel route relative timing The generated predicted electricity price, Indicates time point The corresponding actual electricity price, Indicates the first The mean absolute loss of the wheel route is predicted point by point within the evaluation window.
[0080] Mean absolute error can also be replaced by other pointwise losses pre-fixed in the task contract, but the evaluation criteria must not be changed by the agent before or after an iteration. Prediction performance maintains the following results:
[0081] in, This represents the point-by-point prediction loss of the next-generation algorithm path. This represents the point-by-point prediction loss of the parent or baseline route fixed before the iteration begins. This indicates the allowable increase in non-negative point-by-point prediction loss tolerance for the next-generation algorithm route relative to the parent or baseline route.
[0082] In step 1095, the route verification result is passed only if the target relationship repair result, the historical relationship preservation result, and the prediction performance preservation result simultaneously meet the corresponding quantitative conditions, and the field awareness, modification range, and resource budget verification are all valid. Otherwise, the route verification result is failed.
[0083] In step 1096, when the route verification result is successful, the repair method pool is updated in a positive direction for any repair operator used in this round. Calculate its boundary improvement and regression cost:
[0084]
[0085] in, This indicates any repair operator used in this round of structured modification patches. and These represent the application of the repair operator. The weighted total violation calculated before and after the same set of counterexamples with the same target and the same weight. Indicates the repair operator The resulting boundary improvement, with a value greater than 0, indicates a decrease in the weighted total violation. and These represent the application of the repair operator. Historical relationship regression losses calculated before and after on the same relationship regression set. Indicates the repair operator The increment of historical relationship regression loss caused by the event; a value less than or equal to 0 indicates that the historical relationship regression loss has not increased. and When other contractual conditions are met, the success evidence of the repair operator, actual boundary changes, applicable scenarios, and regression results are written into the repair method pool, and the success count and applicable conditions of the operator are updated. That is, the positive evidence of the operator under the current counterexample signature and route structure is recorded. The positive update is based on the computable results from the same evaluation procedure, rather than the agent summarizing whether the modification is effective.
[0086] In step 1097, when the route verification result is unsuccessful, the current algorithm route is retained for subsequent iterations, and the reason for failure is recorded.
[0087] In this embodiment of the invention, by performing knowability processing on candidate fields, a field-level knowable task contract is obtained, including the range of available inputs and the range of post-evaluation, ensuring the authenticity of the iterative data used. Transaction relationship verification is performed on the prediction results to obtain transaction relationship counterexamples, and path impact analysis is performed using route execution records to generate a repair constraint set. Evaluation feedback in score or text form is converted into machine-executable repair objectives, and the objects allowed for modification are limited to the route range associated with the counterexamples. Based on the repair constraint set, the generation and verification of structured modification patches are constrained throughout the entire process, ensuring that the repair effect is quantified and accepted by the target relationship boundary, and that historically correct transaction relationships remain valid through relationship regression verification. This ensures that the iteration and repair of the power trading algorithm are quantifiable, improves the reliability of the power trading algorithm iteration, and solves the technical problem that evaluation feedback is difficult to quantify to constrain agent iteration and easily leads to historical capability degradation.
[0088] Figure 5This is a schematic diagram of the structure of an iterative device 500 for a power trading intelligent agent according to an embodiment of the present invention. The iterative device 500 can vary significantly due to different configurations or performance characteristics, and may include one or more central processing units (CPUs) 510 and memory 520, and one or more storage media 530 for storing application programs 533 or data 532. The memory 520 and storage media 530 can be temporary or persistent storage. The program stored in the storage media 530 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the iterative device 500 for the power trading intelligent agent. Furthermore, the processor 510 may be configured to communicate with the storage media 530 and execute the series of instruction operations in the storage media 530 on the iterative device 500 for the power trading intelligent agent.
[0089] The iterative device 500 based on a power trading intelligent agent may also include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input / output interfaces 560, and / or one or more operating systems 531, such as Windows Server, Mac OS X, Unix, Linux, Free BSD, etc. Those skilled in the art will understand that... Figure 5 The iterative device structure of the power trading agent shown does not constitute a limitation on iterative devices based on power trading agents. It may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0090] The present invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when the instructions are executed on a computer, cause the computer to perform the steps of the iterative method of the power trading agent.
[0091] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0092] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. An iterative method for an intelligent agent in power trading, characterized in that, Including the following steps: Obtain prediction task information, field directory, task dataset, basic algorithm route, and repair method pool; Based on the prediction task information and the field catalog, the candidate fields in the task dataset are subjected to awareness processing to obtain a field-level awareness task contract, wherein the field-level awareness task contract includes: available input range and post-evaluation range. Based on the field-level known task contract, the basic algorithm route is structured to obtain the current algorithm route, and based on the field-level known task contract, the current algorithm route is pre-execution verified to obtain an executable algorithm route. Based on the executable algorithm route, the data within the available input range is subjected to prediction processing to obtain the prediction result and the route execution record corresponding to the prediction result; Based on the post-evaluation scope, the prediction results are checked for transaction relationships to obtain counterexamples of transaction relationships, wherein the counterexamples of transaction relationships represent the differences between the actual transaction relationships and the predicted transaction relationships; Based on the counterexamples of the transaction relationship and the route execution records, the path impact analysis of the current algorithm route is performed to obtain a set of repair constraints, wherein the set of repair constraints includes: target relationship boundary, route modification range, and relationship regression range; Based on the set of repair constraints and the pool of repair methods, the current algorithm route is subjected to constrained patch generation processing to obtain a structured modification patch; Based on the set of repair constraints, the structured modification patch is subjected to compliance verification to obtain the verification result. When the verification result is qualified, the structured modification patch is merged with the current algorithm route to obtain the next generation algorithm route. Based on the field-level knowability task contract, the next-generation algorithm route is executed and verified to obtain the execution result. Based on the repair constraint set, the execution result is subjected to relational regression verification to obtain the route verification result. Based on the route verification result, the version status of the next-generation algorithm route and the repair method pool are updated to obtain the algorithm route and repair method pool for subsequent iterations.
2. The iterative method for a power trading intelligent agent according to claim 1, characterized in that, The step of performing awareness processing on candidate fields in the task dataset based on the predicted task information and the field directory to obtain field-level awareness task contracts includes: Based on the prediction task information, the prediction starting point and prediction step size of the prediction task are determined to obtain the task time boundary. Based on the task time boundary, the release time and release batch of each candidate field in the field directory are verified to obtain the time-aware status of each candidate field; Based on the prediction step size in the task time boundary, the applicability of the candidate fields with the time-known state is checked to obtain the task availability state of each candidate field. Based on the task availability status, the reference time and statistics window of each candidate field are checked to obtain the field reference range; Based on the field reference range, the consistency of the field usage in the training and prediction phases is checked to obtain the usable input range; Based on the task time boundary, data used to evaluate the prediction results but not as input to the algorithm route are isolated to obtain the post-evaluation range. Based on the available input range and the post-evaluation range, a field-level knowable task contract is generated.
3. The iterative method for a power trading intelligent agent according to claim 1, characterized in that, The steps of structuring the basic algorithm route according to the field-level known task contract to obtain the current algorithm route, and performing pre-execution verification on the current algorithm route according to the field-level known task contract to obtain an executable algorithm route include: Based on the preset route description structure, the basic algorithm route is processed into nodes to obtain route nodes with input and output interfaces. Based on the data transmission relationship between the route nodes, the route nodes are connected to obtain a structured execution graph, and the structured execution graph is determined as the current algorithm route; Based on the field-level knowability task contract, the field references in the current algorithm route are checked node by node to obtain the field reference check results; Based on the input and output interfaces of the route nodes, the integrity of the data transmission relationship between the route nodes is checked to obtain the route interface check result; Based on the field reference verification results and the route interface verification results, the execution permission determination is performed on the current algorithm route to obtain an executable algorithm route.
4. The iterative method for a power trading intelligent agent according to claim 1, characterized in that, The step of performing prediction processing on the data within the available input range according to the executable algorithm route to obtain the prediction result and the route execution record corresponding to the prediction result includes: Data within the available input range is extracted from the task dataset to obtain route input data; Based on the executable algorithm route, the route input data is processed and transferred between nodes to obtain the intermediate outputs of each route node. Based on the prediction output interface in the executable algorithm route, the intermediate outputs are aggregated to obtain the prediction result; Based on the execution order of the route nodes, the field versions, node parameters, and data transfer relationships between nodes used during the execution process are recorded to obtain the route execution record, so that the route execution record can be used to determine the route influence path corresponding to the prediction result.
5. The iterative method for a power trading intelligent agent according to claim 1, characterized in that, The step of verifying the transaction relationship based on the post-evaluation range and obtaining counterexamples of the transaction relationship includes: Based on the aforementioned post-evaluation scope, electricity price periods with transaction associations are paired to obtain transaction period pairs; The actual transaction relationship is obtained by calculating the relationship between the actual electricity prices of the transaction period pairs; Based on the transaction time period pair, the predicted electricity price for the corresponding time period in the prediction result is calculated to obtain the predicted transaction relationship; Based on the preset transaction relationship boundaries, the actual transaction relationship and the predicted transaction relationship are compared and processed to obtain the relationship difference type; Based on the relationship difference type and the preset transaction relationship boundary, the distance of the predicted transaction relationship is calculated to obtain the boundary violation amount; Based on the transaction time period pair, the relationship difference type, and the boundary violation amount, generate a transaction relationship counterexample.
6. The iterative method for a power trading intelligent agent according to claim 5, characterized in that, The step of performing path impact analysis on the current algorithm route based on the counterexamples of the transaction relationship and the route execution record to obtain the set of repair constraints includes: Based on the relationship difference type and boundary violation amount in the counterexamples of the transaction relationship, the boundary repair amount of the predicted transaction relationship is calculated to obtain the target relationship boundary; Based on the transaction time period corresponding to the counterexample of the transaction relationship and the route execution record, the route nodes that form the corresponding prediction results are traced back to obtain the path affected by the counterexample; Based on the negative example impact path, the route nodes that can affect the target relationship boundary are filtered to obtain the set that can be modified. Based on the allowed modification set, route nodes in the current algorithm route that do not belong to the path affected by the counterexample and are used to maintain the correct transaction relationship are determined to obtain the frozen set; Based on the field-level knowability task contract, the prohibited modification objects are determined to obtain the prohibited set; Based on the negative examples of the transaction relationship, the transaction time periods that meet the preset transaction relationship boundary and are associated with the negative examples of the transaction relationship are filtered to obtain a relationship regression set; A set of repair constraints is generated based on the target relation boundary, the allowed modification set, the frozen set, the prohibited set, and the relation regression set.
7. The iterative method for a power trading intelligent agent according to claim 6, characterized in that, The step of generating a structured modification patch by performing constrained patch generation on the current algorithm route based on the set of repair constraints and the pool of repair methods includes: Based on the counterexamples of transaction relationships in the repair constraint set, the repair operators in the repair method pool are matched to obtain candidate repair operators. Based on the allowed modification set in the repair constraint set, the action path nodes of the candidate repair operator are filtered to obtain the first repair operator; Based on the target relation boundary, the expected boundary effect of the first repair operator is checked for direction to obtain a second repair operator whose boundary action direction conforms to the target relation boundary. Based on the current algorithm route and the field-level knowability task contract, the preconditions and exclusion conditions of the second repair operator are checked to obtain the available repair operator; Based on the historical execution results of the available repair operators and the required modification range, the available repair operators are selected to obtain the target repair operator; Based on the target repair operator, the route nodes in the current algorithm route that are within the allowed modification set are modified to obtain candidate node change information; Based on the frozen set and the prohibited set, the candidate node change information is constrained to obtain a structured modification patch.
8. The iterative method for a power trading intelligent agent according to claim 7, characterized in that, The steps of performing execution verification on the next-generation algorithm route based on the field-level knowability task contract to obtain execution results, performing relational regression verification on the execution results based on the repair constraint set to obtain route verification results, and updating the version status of the next-generation algorithm route and the repair method pool based on the route verification results to obtain the algorithm route and repair method pool for subsequent iterations include: Based on the field-level knowability task contract, the next-generation algorithm route is executed within a preset prediction window to obtain candidate prediction results; Based on the target relationship boundary in the repair constraint set, the transaction relationships to be repaired in the candidate prediction results are checked to obtain the target relationship repair results; Based on the relation regression set in the repair constraint set, the historical correct transaction relations in the candidate prediction results are verified to obtain the historical relation preservation result; Based on the evaluation criteria determined by the field-level knowability task contract, the prediction performance of the candidate prediction results is checked to obtain the prediction performance preservation result. Based on the target relationship repair results, the historical relationship preservation results, and the prediction performance preservation results, the next-generation algorithm route is subjected to acceptance processing to obtain route verification results; When the route verification result is passed, the current algorithm route is replaced according to the next generation algorithm route to obtain the algorithm route for subsequent iterations. The repair method pool is positively updated according to the boundary improvement result and historical relationship preservation result corresponding to the target repair operator to obtain the updated repair method pool. When the route verification result is unsuccessful, the current algorithm route is determined as the algorithm route for subsequent iterations, and the repair method pool is negatively updated according to the route verification result to obtain the updated repair method pool.
9. An iterative device for an intelligent power trading agent, characterized in that, The iterative device of the power trading intelligent agent includes: a memory and at least one processor, wherein the memory stores instructions, and the memory and the at least one processor are interconnected via a line; The at least one processor invokes the instructions in the memory to cause the iterative device of the power trading agent to execute the iterative method of the power trading agent as described in any one of claims 1-8.
10. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is executed by the processor, it implements the iterative method for the power trading agent as described in any one of claims 1-8.
