Converter semi-physical simulation verification method, device, equipment, medium and product

CN122592931APending Publication Date: 2026-08-18SHENZHEN POWER SUPPLY BUREAU
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611019235.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-09
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

然而,这样的仿真测试方法存在测试效率低下的问题

Benefits of technology

[0050] The aforementioned hardware-in-the-loop (HIL) simulation verification method, apparatus, computer equipment, storage medium, and computer program product for converters first receive test task instructions for the converter control strategy to be verified in the physical controller, parse the test task instructions, and generate a sequence of subtasks. Then, based on the subtask sequence and the capability characteristics of each skill agent, target agents matching each subtask in the subtask sequence are determined from multiple skill agents with different functions. The subtask sequence is then arranged to obtain a workflow, which includes the calling order of the target agents. Following the calling order of the target agents in the workflow, each subtask is distributed to its corresponding target agent, so that each target agent executes its received subtask. Finally, the execution results returned by each target agent are received, and based on multiple execution results, a hardware-in-the-loop (HIL) simulation verification result for the converter control strategy to be verified is generated. The method described above can greatly reduce the reliance on manual operation in processes such as data flow management, thereby significantly improving the efficiency of hardware-in-the-loop simulation verification. Moreover, since the workflow is generated based on the user's specific test task instructions, the converter hardware-in-the-loop simulation verification method of this application has good flexibility and adaptability compared to existing pre-set fixed scripts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122592931A_ABST
    Figure CN122592931A_ABST
Patent Text Reader

Abstract

The application relates to a converter semi-physical simulation verification method, device, equipment, medium and product, wherein the method comprises the following steps: receiving a test task instruction for a to-be-verified converter control strategy in a real controller, analyzing the test task instruction, and generating a subtask sequence; based on the subtask sequence and the ability characteristic information of each skill intelligent agent, determining a target intelligent agent matched with each subtask in the subtask sequence from a plurality of skill intelligent agents with different functions; arranging the subtask sequence to obtain a work flow; the work flow comprises a calling sequence of the target intelligent agents; according to the calling sequence of the target intelligent agents in the work flow, each subtask is respectively sent to the corresponding target intelligent agent; receiving the execution results returned by each target intelligent agent, and generating a semi-physical simulation verification result for the to-be-verified converter control strategy based on the execution results. The application can improve the efficiency of semi-physical simulation verification by using the above method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of power distribution network technology, and in particular to a method, apparatus, equipment, medium and product for hardware-in-the-loop simulation verification of converters. Background Technology

[0002] Before being put into operation in the distribution network, the converter control strategy needs to undergo thorough testing and verification to ensure the power quality of the distribution network. Currently, the commonly used verification method is Hardware-in-the-Loop (HIL) semi-physical simulation technology, which connects the real converter physical controller with a virtual distribution network model running on a real-time simulator to form a closed-loop test environment.

[0003] In related technologies, when using hardware-in-the-loop (HIL) simulation technology for verification, a manually configured workflow-based automated simulation framework is typically employed. This framework uses a scripting language to connect the various stages of the HIL simulation in a fixed sequence, allowing operators to perform simulation verification simply by executing the script. However, this simulation testing method suffers from low testing efficiency. Summary of the Invention

[0004] Therefore, it is necessary to provide a converter hardware-in-the-loop simulation verification method, apparatus, computer equipment, computer-readable storage medium, and computer program product to address the above-mentioned technical problems.

[0005] Firstly, this application provides a hardware-in-the-loop (HIL) simulation verification method for a converter. This method is applied to a multi-agent cooperative system, which includes a physical controller and multiple skilled agents with different functions. The method includes:

[0006] Receive test task instructions for the converter control strategy to be verified in the physical controller, parse the test task instructions, and generate a sequence of subtasks;

[0007] Based on the sub-task sequence and the capability feature information of each skill agent, the target agent matching each sub-task in the sub-task sequence is determined from multiple skill agents with different functions.

[0008] The subtask sequence is arranged to obtain the workflow; the workflow includes the calling order of the target agent;

[0009] According to the calling order of the target agents in the workflow, each subtask is sent to the corresponding target agent so that each target agent can execute its own received subtask.

[0010] It receives the execution results returned by each target agent and generates hardware-in-the-loop simulation verification results for the converter control strategy to be verified based on multiple execution results.

[0011] In one embodiment, the workflow also includes data transfer relationships between various skill agents; the workflow is obtained by orchestrating the sequence of subtasks, including:

[0012] Based on the execution order of each subtask and the data dependencies between each subtask, determine the calling order and data transfer relationship of each target agent;

[0013] The workflow is determined based on the calling order and data transmission relationship of each target agent.

[0014] In one embodiment, the execution results returned by each target agent are received, and based on multiple execution results, a hardware-in-the-loop simulation verification result for the converter control strategy to be verified is generated, including:

[0015] The execution status of each subtask is monitored in real time. For each subtask, if the execution status of the subtask is detected as failure, and if the correction feedback information of the target agent corresponding to the subtask is obtained within the preset correction time, the execution status of the subtask is updated.

[0016] If the execution status of each subtask is successful or the preset termination condition is met, the execution results returned by each target agent are received, and the execution results of multiple subtasks are summarized to generate hardware-in-the-loop simulation verification results.

[0017] In one embodiment, the method further includes:

[0018] For each subtask, if the target agent corresponding to the subtask determines that the execution status of the subtask is execution failure or an error occurs during the execution process, the execution status of the subtask is determined to be execution failure, and the type of task failure is determined.

[0019] The target agent corresponding to the subtask determines the target correction strategy corresponding to the task failure type from the preset correction strategy set, and executes the target correction strategy to re-execute the failed subtask.

[0020] In one embodiment, the test task instruction includes an instruction type identifier and a test task; the test task instruction is parsed to generate a subtask sequence, including:

[0021] Based on the instruction type identifier, determine the parsing strategy corresponding to the test task instruction;

[0022] Based on the parsing strategy, the test task instructions are parsed to obtain the parsing results;

[0023] Based on the analysis results, the test task is divided into at least one subtask, resulting in a sequence of subtasks.

[0024] In one embodiment, the multiple execution results include an executable code file and a distribution network model. The executable code file is obtained by generating code for the converter control strategy to be verified. Based on the multiple execution results, a hardware-in-the-loop simulation verification result for the converter control strategy to be verified is generated, including:

[0025] The physical controller is invoked to perform closed-loop interaction with the power distribution network model to verify the executable code file through hardware-in-the-loop simulation, and the results of the hardware-in-the-loop simulation are obtained.

[0026] Secondly, this application also provides a converter hardware-in-the-loop simulation verification device, which includes:

[0027] The task sequence generation module is used to receive test task instructions for the converter control strategy to be verified in the physical controller, parse the test task instructions, and generate a sub-task sequence.

[0028] The target agent determination module is used to determine the target agent that matches each subtask in the subtask sequence from multiple skill agents with different functions, based on the subtask sequence and the capability feature information of each skill agent.

[0029] The workflow generation module is used to orchestrate the sequence of subtasks to obtain a workflow; the workflow includes the calling order of the target agent;

[0030] The subtask allocation module is used to distribute each subtask to the corresponding target agent according to the calling order of the target agents in the workflow, so that each target agent can execute its own received subtask.

[0031] The verification report generation module is used to receive the execution results returned by each target agent and, based on multiple execution results, generate hardware-in-the-loop simulation verification results for the converter control strategy to be verified.

[0032] Thirdly, this application also provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0033] Receive test task instructions for the converter control strategy to be verified in the physical controller, parse the test task instructions, and generate a sequence of subtasks;

[0034] Based on the sub-task sequence and the capability feature information of each skill agent, the target agent matching each sub-task in the sub-task sequence is determined from multiple skill agents with different functions.

[0035] The subtask sequence is arranged to obtain the workflow; the workflow includes the calling order of the target agent;

[0036] According to the calling order of the target agents in the workflow, each subtask is sent to the corresponding target agent so that each target agent can execute its own received subtask.

[0037] It receives the execution results returned by each target agent and generates hardware-in-the-loop simulation verification results for the converter control strategy to be verified based on multiple execution results.

[0038] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0039] Receive test task instructions for the converter control strategy to be verified in the physical controller, parse the test task instructions, and generate a sequence of subtasks;

[0040] Based on the sub-task sequence and the capability feature information of each skill agent, the target agent matching each sub-task in the sub-task sequence is determined from multiple skill agents with different functions.

[0041] The subtask sequence is arranged to obtain the workflow; the workflow includes the calling order of the target agent;

[0042] According to the calling order of the target agents in the workflow, each subtask is sent to the corresponding target agent so that each target agent can execute its own received subtask.

[0043] It receives the execution results returned by each target agent and generates hardware-in-the-loop simulation verification results for the converter control strategy to be verified based on multiple execution results.

[0044] Fifthly, this application also provides a computer program product comprising a computer program that, when executed by a processor, performs the following steps:

[0045] Receive test task instructions for the converter control strategy to be verified in the physical controller, parse the test task instructions, and generate a sequence of subtasks;

[0046] Based on the sub-task sequence and the capability feature information of each skill agent, the target agent matching each sub-task in the sub-task sequence is determined from multiple skill agents with different functions.

[0047] The subtask sequence is arranged to obtain the workflow; the workflow includes the calling order of the target agent;

[0048] According to the calling order of the target agents in the workflow, each subtask is sent to the corresponding target agent so that each target agent can execute its own received subtask.

[0049] It receives the execution results returned by each target agent and generates hardware-in-the-loop simulation verification results for the converter control strategy to be verified based on multiple execution results.

[0050] The aforementioned hardware-in-the-loop (HIL) simulation verification method, apparatus, computer equipment, storage medium, and computer program product for converters first receive test task instructions for the converter control strategy to be verified in the physical controller, parse the test task instructions, and generate a sequence of subtasks. Then, based on the subtask sequence and the capability characteristics of each skill agent, target agents matching each subtask in the subtask sequence are determined from multiple skill agents with different functions. The subtask sequence is then arranged to obtain a workflow, which includes the calling order of the target agents. Following the calling order of the target agents in the workflow, each subtask is distributed to its corresponding target agent, so that each target agent executes its received subtask. Finally, the execution results returned by each target agent are received, and based on multiple execution results, a hardware-in-the-loop (HIL) simulation verification result for the converter control strategy to be verified is generated. The method described above can greatly reduce the reliance on manual operation in processes such as data flow management, thereby significantly improving the efficiency of hardware-in-the-loop simulation verification. Moreover, since the workflow is generated based on the user's specific test task instructions, the converter hardware-in-the-loop simulation verification method of this application has good flexibility and adaptability compared to existing pre-set fixed scripts. Attached Figure Description

[0051] Figure 1 A diagram illustrating the application environment of the converter hardware-in-the-loop simulation verification method provided in some embodiments of this application;

[0052] Figure 2 Flowcharts of converter hardware-in-the-loop simulation verification methods provided in some embodiments of this application;

[0053] Figure 3 Flowcharts for determining workflows provided in some embodiments of this application;

[0054] Figure 4 Flowcharts for generating hardware-in-the-loop simulation verification results provided in some embodiments of this application;

[0055] Figure 5 A flowchart illustrating the re-execution of a failed subtask provided in some embodiments of this application;

[0056] Figure 6A flowchart illustrating the process of obtaining a sequence of subtasks provided in some embodiments of this application;

[0057] Figure 7 A flowchart of a converter hardware-in-the-loop simulation verification method provided in a detailed embodiment of this application;

[0058] Figure 8 This application provides schematic diagrams of the architecture of a multi-agent cooperative system for some embodiments.

[0059] Figure 9 Structural block diagram of a converter hardware-in-the-loop simulation verification device provided in some embodiments of this application;

[0060] Figure 10 This is an internal structural diagram of a computer device provided in some embodiments of this application. Detailed Implementation

[0061] 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 and not intended to limit the scope of this application.

[0062] The converter hardware-in-the-loop simulation verification method provided in this application embodiment can be applied to, for example... Figure 1 The multi-agent collaborative system shown includes a physical controller 102, a scheduling agent 104, and multiple skill agents 106 with different functions. The physical controller 102 is typically the controller of the converter under test. For example, the physical controller 102 can be a control board containing a DSP (Digital Signal Processor) or FPGA (Field Programmable Gate Array) to load the code or compiled files of the converter control strategy to be verified. The converter control strategy to be verified is a pre-designed control algorithm for controlling the on / off state of power switching devices in a power distribution network converter. The scheduling agent 104 is the core of the multi-agent collaborative system, responsible for global task orchestration and coordination. The skill agents 106 are independently operable functional modules within the multi-agent collaborative system. Each skill agent 106 encapsulates a specific processing program for a particular stage of the hardware-in-the-loop simulation verification process and can provide a standard API (Application Programming Interface) for other agents to call. For example, skill agent 106 may include a code generation agent, which is responsible for generating, compiling and deploying the code for the converter control strategy to be verified.

[0063] The hardware-in-the-loop simulation verification method for converters provided in this application embodiment can be executed by a scheduling agent 104. During execution, the scheduling agent 104 first receives a test task instruction for the converter control strategy to be verified in the physical controller 102, parses the test task instruction, and generates a sub-task sequence. Then, based on the sub-task sequence and the capability feature information of each skill agent 106, it determines the target agent matching each sub-task in the sub-task sequence from multiple skill agents 106 with different functions. The sub-task sequence is then arranged to obtain a workflow. The workflow includes the calling order of the target agents. Then, according to the calling order of the target agents in the workflow, each sub-task is sent to the corresponding target agent so that each target agent executes its received sub-task. Finally, the execution results returned by each target agent are received, and based on multiple execution results, a hardware-in-the-loop simulation verification result for the converter control strategy to be verified is generated. In this way, the reliance on manual operation in processes such as data flow management can be greatly reduced, thereby significantly improving the efficiency of hardware-in-the-loop simulation verification. Moreover, since the workflow is generated based on the user's specific test task instructions, the converter hardware-in-the-loop simulation verification method of this application has good flexibility and adaptability compared to the existing pre-set fixed scripts.

[0064] In one embodiment, such as Figure 2 As shown, this method is applied to Figure 1 This embodiment uses a multi-agent cooperative system as an example for illustration. The method includes the following steps:

[0065] Step 202: Receive test task instructions for the converter control strategy to be verified in the physical controller, parse the test task instructions, and generate a sub-task sequence.

[0066] As mentioned earlier, the converter control strategy to be verified is a pre-designed control algorithm used to control the on / off state of power switching devices in a distribution network converter. For example, the converter control strategy to be verified can be a combination of a maximum power point tracking (MPPT) control algorithm, a reactive power compensation algorithm, and a harmonic suppression algorithm for a photovoltaic grid-connected converter. The test task instruction is the input information submitted by the user to the multi-agent collaborative system, used to describe the specific test task information. For example, the test task instruction can be a natural language instruction, such as "verify the mitigation effect of a photovoltaic converter control strategy under broadband harmonic background"; the test task instruction can also be a structured task script instruction in JSON or other formats, including the target distribution network topology file path, the converter control strategy model path, and the parameters of the operating conditions to be tested (such as illuminance, load size, fault type, harmonic spectrum distribution, etc.).

[0067] Optionally, based on the format of the test task instructions input by the user (natural language or structured script), the corresponding parsing strategy can be invoked to split the test task into multiple functionally independent subtasks, forming a subtask sequence.

[0068] Step 204: Based on the sub-task sequence and the capability feature information of each skill agent, determine the target agent that matches each sub-task in the sub-task sequence from multiple skill agents with different functions.

[0069] The subtask sequence is a task list formed by the scheduling agent breaking down the user-input test task instructions into multiple independently executable subtasks. Each subtask can be a functional step in the entire simulation verification process. For example, subtask 1 can generate an electromagnetic transient model of the distribution network based on the power grid description file; subtask 2 can generate executable code for the control strategy to be verified and deploy it to the physical controller; subtask 3 can perform power flow initialization processing on the distribution network model; subtask 4 can call the physical controller and the distribution network model to perform closed-loop semi-physical simulation; and subtask 5 can calculate and evaluate power quality indicators based on the simulation waveforms obtained from subtask 4.

[0070] The capability characteristics of a skill agent are descriptive information reported by the skill agent to the skill registry center in the scheduling agent, allowing the scheduling agent to understand the capabilities of each skill agent and how to invoke it. For example, the capability characteristics of a skill agent include API interface address, input parameter format, output data format, and performance indicators (such as processing power, supported file formats, supported hardware platform types, etc.). For example, in addition to the aforementioned code generation agent, skill agents may also include model generation agents, power flow initialization agents, hardware-in-the-loop simulation agents, and power quality assessment agents. Specifically, the model generation agent is used to automatically construct the electromagnetic transient model of the distribution network; the power flow initialization agent is used for power flow calculation and distribution network model initialization; the hardware-in-the-loop simulation agent is used to perform closed-loop hardware-in-the-loop simulation; and the power quality assessment agent is used for calculating power quality indicators and verifying hardware-in-the-loop simulation results, such as generating hardware-in-the-loop simulation verification reports.

[0071] Optionally, each subtask in the subtask sequence can be traversed, and based on the capability characteristics of each skill agent, such as API interface, input / output format, and supported function types, a skill agent capable of executing the subtask can be matched as the target agent.

[0072] Step 206: Arrange the subtask sequence to obtain the workflow.

[0073] The workflow is a task execution plan dynamically determined by the scheduling agent based on the sub-task sequence and the capability characteristics of each skill agent. The workflow includes the calling order of the target agent (e.g., serial / parallel / cyclic), the data transfer relationship between sub-tasks (e.g., the output of the previous sub-task is the input of the next sub-task), and the parallel execution strategy. For example, the workflow for verifying a converter control strategy could be as follows: the model generation agent executes first, outputting a model file; simultaneously, the code generation agent executes in parallel with the model generation agent, generating a code file corresponding to the converter control strategy to be verified; then the power flow initialization agent executes, outputting an initialization model; then the hardware-in-the-loop simulation agent executes, outputting simulation waveforms; finally, the power quality assessment agent outputs the hardware-in-the-loop simulation verification results based on the simulation waveforms.

[0074] Optionally, the calling order and data transfer relationship of each target intelligent agent can be determined based on the execution order of each subtask, data dependencies, and capability characteristics of each target intelligent agent, thereby generating an executable workflow.

[0075] Step 208: According to the calling order of the target agents in the workflow, each subtask is sent to the corresponding target agent so that each target agent can execute its own received subtask.

[0076] Optionally, each subtask and its input data can be sent to the corresponding target agent via a communication coordination bus according to the calling order determined in the workflow; in addition, for subtasks that can be parallelized, they can be sent in parallel.

[0077] Step 210: Receive the execution results returned by each target agent, and based on multiple execution results, generate hardware-in-the-loop simulation verification results for the converter control strategy to be verified.

[0078] The execution result is the output data returned to the scheduling agent by the skill agent after completing the received sub-task. For example, the execution result of the model generation agent is a structured model file of the power grid topology and component parameters; the execution result of the power flow initialization agent is an initialization model file containing power flow results, such as steady-state voltage and power distribution of each node; the execution result of the code generation agent is the embedded C code / compiled file corresponding to the converter control strategy to be verified; the execution result of the hardware-in-the-loop simulation agent is simulation waveform data, including voltage, current, and power time-domain waveforms at each measurement point; and the execution result of the power quality assessment agent is the quantified values ​​and comparison conclusions of indicators such as THD (Total Harmonic Distortion) and power factor under various operating conditions, as well as other hardware-in-the-loop simulation verification results. The power quality assessment agent can also output the hardware-in-the-loop simulation verification results in the form of a hardware-in-the-loop simulation verification report.

[0079] The hardware-in-the-loop (HILL) simulation verification result is the final output generated by the scheduling agent after summarizing the execution results of each skill agent. The HILL verification result can be presented in the form of a HILL verification report, allowing users to modify the converter control strategy to be verified. For example, the HILL verification report may include quantitative comparison values ​​of power quality indicators before and after applying the control strategy to be verified under various operating conditions, such as a decrease in THD from 5.8% to 1.5% and an increase in power factor from 0.86 to 0.98.

[0080] Optionally, the system can receive the execution results returned by each target agent, summarize them, and generate a hardware-in-the-loop simulation verification report containing quantitative comparison results of power quality indicators based on a preset report template.

[0081] The aforementioned hardware-in-the-loop (HIL) simulation verification method for converters first generates a sequence of sub-tasks based on the user's specific test task instructions. Then, it dynamically matches and arranges the sub-tasks according to the capability characteristics of each skill agent. Finally, based on the execution results of multiple target agents, it automatically generates HIL simulation verification results for the converter control strategy to be verified. This can greatly reduce the dependence on manual operation in processes such as data flow management, thereby significantly improving the efficiency of HIL simulation verification. Moreover, since the workflow is generated based on the user's specific test task instructions, compared with existing pre-set fixed scripts, the HIL simulation verification method for converters in this application also has good flexibility and adaptability.

[0082] In one embodiment, such as Figure 3 As shown, based on the capability characteristics of each skill agent, the sub-task sequence is arranged to obtain the workflow, including:

[0083] Step 302: Determine the calling order and data transfer relationship of each target agent based on the execution order of each subtask and the data dependencies between each subtask.

[0084] Data dependencies describe the preconditions between subtasks, specifying which preconditions a subtask must complete before it can begin execution, as it relies on the output data of those preconditions as its input. For example, the power flow initialization subtask depends on model generation as a precondition, requiring a structured model file containing the power grid topology and component parameters; the hardware-in-the-loop simulation subtask depends on power flow initialization and code generation as preconditions, requiring an initialization model file and executable code already deployed in the physical controller; and the power quality assessment subtask depends on hardware-in-the-loop simulation as a precondition, requiring simulation waveform data obtained from the hardware-in-the-loop simulation.

[0085] Data transfer relationships describe how the output data of the previous subtask becomes the input data of the next subtask. For example, the data flow may be from the model intelligent generator to the power flow initialization intelligent generator, and the content transferred is a structured model file. That is, the output of the model generation is directly used as the input for power flow initialization, and the transferred data is a model file containing complete information such as grid topology, line impedance, transformer parameters, and load parameters.

[0086] Optionally, the data dependencies between each subtask can be traversed to establish a directed acyclic graph, with subtasks as nodes and dependencies as edges, to determine the topological execution order (serial, parallel, or cyclic) of each subtask; at the same time, a data mapping relationship can be established based on the source of input data and the destination of output data of each subtask, that is, to determine how the output data structure of the previous subtask is converted into the input data structure required by the next subtask, and to generate a data transmission path.

[0087] Step 304: Determine the workflow based on the calling order and data transmission relationship of each target agent.

[0088] Optionally, based on the calling order and data transfer relationship obtained in step 302, an executable workflow file containing the execution order of each target agent, data flow path, and exception handling strategy can be generated; after the workflow is distributed to the corresponding target agents, each target agent will collaboratively complete the task according to the order and rules defined in the workflow.

[0089] In this embodiment, by traversing the subtask sequence and matching the target agent based on the capability feature information of each skill agent, and then determining the calling order and data transmission relationship according to the data dependency relationship between each subtask, an executable workflow is finally generated, realizing the dynamic orchestration and automated execution of the simulation verification process.

[0090] In one embodiment, such as Figure 4 As shown, the system receives the execution results returned by each target agent and, based on multiple execution results, generates hardware-in-the-loop simulation verification results for the converter control strategy to be verified, including:

[0091] Step 402: Monitor the execution status of each subtask in real time. For each subtask, if the execution status of the subtask is detected as execution failure, and if the correction feedback information of the target intelligent agent corresponding to the subtask is obtained within the preset correction time, then the execution status of the subtask is updated.

[0092] The preset correction time is the maximum waiting time pre-set by the multi-agent collaborative system, allowing a specific skill agent to perform autonomous feedback correction operations. Correction feedback information is a status notification returned to the scheduling agent by the skill agent after autonomous recovery through its own feedback correction capabilities following a sub-task failure. Correction feedback information may include the corrected execution status, correction method, correction time, and other information.

[0093] For example, the preset correction time for the power flow initialization agent can be set to 30 seconds. That is, when the power flow initialization agent encounters a "power flow non-convergence" error, the multi-agent collaborative system gives it a 30-second time window to autonomously correct itself (such as adjusting initial values ​​and recalculating, simplifying the model and retrying, etc.). If feedback of successful correction is received within 30 seconds, the process continues; if feedback of successful correction is not received after 30 seconds, the subtask is determined to have timed out and failed, and a preset exception handling process is entered. For example, the process may skip the current condition, record a failure log and continue to execute other conditions, or trigger a system-level alarm.

[0094] Optionally, the scheduling agent can monitor the execution status messages returned by each target agent in real time. For any subtask, if a subtask execution failure message is received, a timer is started to wait for the correction feedback from the target agent corresponding to the subtask. If feedback information containing a correction success indicator is received within the preset correction time, the execution status of the subtask is updated to execution success, and a correction log is recorded. If no correction success feedback is received after the timeout, the corresponding processing is carried out according to the preset strategy (such as retry, skip, or termination).

[0095] Step 404: If the execution status of each subtask is either successful or has reached the preset termination condition, receive the execution results returned by each target agent, summarize the execution results of multiple subtasks, and generate a hardware-in-the-loop simulation verification result.

[0096] The preset termination conditions are pre-set conditions in the multi-agent collaborative system used to determine whether to terminate the entire simulation verification process prematurely, even if some subtasks have not been completed or have failed. Preset termination conditions may include the maximum number of retries, user-initiated cancellation, and the occurrence of a fatal error.

[0097] Optionally, the scheduling agent continuously checks the execution status of all subtasks. When all subtasks are successfully executed, it receives the execution results returned by each target agent and can summarize them according to a preset data report template to generate a hardware-in-the-loop simulation verification result containing the output data of each stage. If the preset termination condition is met (such as exhaustion of retries or user cancellation), it stops waiting, summarizes the completed execution results, marks the status of incomplete or failed subtasks, and generates a verification result report with exception records.

[0098] In this embodiment, by monitoring the execution status of each subtask in real time and allowing the corresponding skill agent a time window for autonomous correction when the subtask fails, it helps to achieve the workflow's self-healing capability, thereby further reducing manual intervention and improving simulation verification efficiency. At the same time, by setting the termination condition, the system is prevented from waiting indefinitely or looping ineffectively, which helps to save system resources.

[0099] In one embodiment, such as Figure 5 As shown, the method also includes:

[0100] Step 502: For each subtask, if the target agent corresponding to the subtask determines that the execution status of the subtask is execution failure or an error occurs during the execution process, the execution status of the subtask is determined to be execution failure, and the task failure type is determined.

[0101] This refers to a series of preconditions that the target agent must meet before it can begin executing a subtask. Only when all these conditions are met can the target agent successfully initiate the execution of the subtask. For example, for a model-generating agent, specifically for the model-generating subtask, the corresponding execution conditions are: the existence and readable format of the power grid description file; the component types in the file being defined in the system component library; and complete electrical connections with no isolated nodes.

[0102] An error during execution means that a subtask has started execution, but due to some abnormal situation, execution cannot continue or the execution result is invalid. For example, during model generation, the electromagnetic transient model of a component in the system component library fails to be called, or there is insufficient disk space when the generated model file is written to disk.

[0103] Task failure types categorize the reasons for execution failures to facilitate the selection of targeted corrective strategies. Each skill agent needs to define different failure types based on its own task characteristics. For example, for the model generation subtask, task failure types include file format parsing failure, incomplete topology data, and failure to complete missing parameters.

[0104] Optionally, before starting to execute the corresponding subtask, the target intelligent agent can first check whether the various execution conditions meet the preset requirements; if the execution conditions are not met, or if an anomaly occurs during the execution process, such as the algorithm not converging, hardware communication timeout, or insufficient resources, the anomaly information is captured and the anomaly is classified according to the preset failure classification rules, and the task failure type is determined.

[0105] Step 504: The target agent corresponding to the subtask determines the target correction strategy corresponding to the task failure type from the preset correction strategy set, and executes the target correction strategy to re-execute the failed subtask.

[0106] The preset correction strategy set is a collection of error handling schemes pre-defined within each skill agent, with each scheme designed for a specific type of failure. These preset correction strategies are also the aforementioned exception handling strategies. The target correction strategy is a specific correction scheme determined from the preset correction strategy set based on the specific task failure type that has occurred, used to handle the current error.

[0107] For example, for the failure type of power flow non-convergence in the power flow initialization subtask, the preset correction strategy set could be to recalculate after adjusting the power flow constraints (relaxing the convergence accuracy), recalculate after modifying the initial power flow settings (setting different initial voltage amplitudes / phase angles), and recalculate after simplifying the model (equivalent to constant impedance for some loads). One could first try modifying the initial power flow settings; if that still fails, try relaxing the convergence accuracy; if that still fails, try simplifying the model.

[0108] Optionally, the target agent can query its locally stored set of correction strategies to find a correction strategy that matches the determined task failure type. If a matching strategy is found, i.e., the target correction strategy, the agent will perform the correction according to the preset correction operations in the target correction strategy, such as adjusting parameters, switching algorithms, or retrying, and re-execute the subtask. If there is no corresponding correction strategy for the failure type, or if the correction strategy still fails after execution, the agent will return an execution failure message and the reason for failure to the scheduling agent so that the scheduling agent can optimize the correction strategy.

[0109] In this embodiment, each skill agent checks the execution conditions before executing a subtask, captures anomalies during execution, and autonomously matches and executes correction strategies. This enables each skill agent to shift from passively reporting errors to actively repairing them, thus allowing the multi-agent collaborative system to autonomously repair most common errors without human intervention, thereby helping to reduce the frequency of human intervention in the simulation verification process.

[0110] In one embodiment, such as Figure 6 As shown, the test task instruction includes an instruction type identifier and a test task; parsing the test task instruction generates a sequence of subtasks, including:

[0111] Step 602: Determine the parsing strategy corresponding to the test task instruction based on the instruction type identifier.

[0112] The instruction type identifier is a piece of information carried in the test task instruction that indicates the format or language in which the instruction is described. The instruction type identifier can be a natural language type identifier, such as a text-based script; or it can be a structured script type identifier, such as a JSON-formatted task script.

[0113] Optionally, the scheduling agent can first extract preset fields from the received test task instructions, such as the type field in the message header or the instruction prefix, to obtain the instruction type identifier; then match the identifier with the pre-stored parsing strategy mapping table to determine the parsing strategy corresponding to the current instruction type. If it is a natural language type, the natural language parsing strategy is matched; if it is a structured script type, the structured script parsing strategy is matched.

[0114] Step 604: Based on the parsing strategy, parse the test task instructions to obtain the parsing results.

[0115] The parsing strategy is a processing method or process corresponding to the instruction type identifier, used to convert the raw instruction into a structured task description. For example, for test task instructions in natural language, a Natural Language Processing (NLP) engine can be invoked to perform intent recognition, entity extraction (related to power distribution network scenarios, converter types, operating conditions, etc.), and task decomposition on the user-input Chinese / English text, converting the unstructured natural language into a structured task description.

[0116] Optionally, the scheduling agent can call the parsing engine corresponding to the parsing strategy determined in step 602. If it is a natural language type, the natural language processing engine is called to perform semantic parsing on the instruction text, including intent recognition, entity extraction, and task type classification, to extract structured information from unstructured text. If it is a structured script type, the script parsing engine is called to perform format verification and field extraction on the structured script to obtain task parameters and configuration information. After parsing is completed, a structured parsing result is output.

[0117] Step 606: Based on the analysis results, the test task is split into at least one subtask to obtain a subtask sequence.

[0118] The parsing result is the structured task description information obtained after parsing the original test task instructions. It transforms unstructured natural language or formatted structured scripts into data structures that the system can understand and process. The parsing result may include task description content, information about the object under test, operating parameters, and output requirements.

[0119] Optionally, the scheduling agent can decompose the overall test task into multiple functionally independent subtasks, such as model generation subtask, code generation subtask, power flow initialization subtask, hardware-in-the-loop simulation subtask, and power quality assessment subtask, according to the task type, verification target, and specific parameters in the parsing result obtained in step 604 and the preset task decomposition rules, and establish the logical relationship between each subtask; finally, a subtask sequence containing all subtasks is generated.

[0120] In this embodiment, the corresponding parsing strategy is determined based on the instruction type identifier, which can achieve compatible parsing of user input instructions of different formats and split them into sub-task sequences. This can improve the operability of the multi-agent collaborative system and make it easier for users to use.

[0121] In one embodiment, multiple execution results include an executable code file and a distribution network model. The executable code file is obtained by generating code for the converter control strategy to be verified. Based on the multiple execution results, a hardware-in-the-loop simulation verification result for the converter control strategy to be verified is generated, including:

[0122] The physical controller is invoked to perform closed-loop interaction with the power distribution network model to verify the executable code file through hardware-in-the-loop simulation, and the results of the hardware-in-the-loop simulation are obtained.

[0123] The executable code file is a binary or object file that can run on the target embedded hardware, obtained by the code generation agent after performing code generation processing on the converter control strategy to be verified. The distribution network model is an electromagnetic transient model of the distribution network constructed by the model generation agent based on the power grid description file and initialized by the power flow initialization agent, and can run on the electromagnetic transient real-time simulator. The electromagnetic transient real-time simulator is a high-performance real-time computing device specifically designed for electromagnetic transient simulation of power systems within a multi-agent collaborative system. It can perform detailed simulation calculations of electrical quantities such as voltage and current in the power system on a microsecond-scale time scale, and can accurately simulate rapid electromagnetic phenomena such as faults, harmonics, and switching actions.

[0124] Optionally, after receiving the executable code file returned by the code generation agent and the distribution network model returned by the model generation agent, the scheduling agent loads the distribution network model into the electromagnetic transient real-time simulator for operation and burns the executable code file into the physical controller. Then, the scheduling agent calls the communication interface module in the multi-agent collaborative system through the semi-physical simulation agent to establish a signal transmission link between the simulator and the physical controller. The power grid state variables calculated by the simulator are converted from digital to analog and output to the physical controller. The switch drive signals output by the physical controller are digitally acquired and fed back to the power electronic switch model in the simulator, forming a closed loop. During the operation of this closed loop, the scheduling agent collects the simulation waveform data of each measurement point through the semi-physical simulation agent. After all preset operating conditions are completed, the simulation data is transmitted to the power quality assessment agent for index calculation and comparative analysis, and finally, the semi-physical simulation verification results are generated.

[0125] In this embodiment, by calling the physical controller to perform closed-loop interaction with the power distribution network model, the executable code file is verified through semi-physical simulation. This can truly reflect the operating effect of the control strategy on the actual hardware platform, thereby ensuring the accuracy and reliability of the final simulation verification results.

[0126] In a detailed embodiment, such as Figure 7 As shown, Figure 7 A flowchart illustrating the workflow of a multi-agent system is provided, describing the complete execution process of the converter hardware-in-the-loop (HILL) simulation verification method of this application, from user submission of test tasks to the final generation of HILL verification results, such as a HILL verification report. This workflow is dynamically orchestrated by a scheduling agent, with each skill agent cooperating according to the calling order and data transfer relationships defined in the workflow. The entire process covers the complete verification chain of model building → initialization → code generation → HILL simulation → quantitative evaluation. Furthermore, each agent possesses autonomous feedback and correction capabilities during execution, allowing for autonomous recovery without manual intervention when errors occur.

[0127] S1: User inputs natural language / structured instructions;

[0128] For example, users submit test task instructions via natural language or structured scripts, which are then sent to a multi-agent collaborative system.

[0129] S2: Schedule agent execution, including:

[0130] S2.1: Parse the task instructions and generate a sequence of subtasks.

[0131] S2.2: Generate workflow based on skill and ability list.

[0132] The input is the task instructions, and the output is the standard power grid description file required for the model to generate the intelligent agent.

[0133] S3: Model-generated agent execution, including:

[0134] S3.1: Analyze the topology and component connection relationships.

[0135] For example, the model-generating agent reads the SVG (Scalable Vector Graphics) single-line diagram and the CIM / E (Common Information Model / Efficient XML Interchange) XML configuration file of the target distribution network, parses the power grid topology, component types, electrical parameters and connection relationships, and automatically generates the corresponding electromagnetic transient model.

[0136] S3.2: Component parameter mapping, calculate and complete missing electromagnetic transient parameters.

[0137] For example, for missing parameters in a file, the model-generating agent intelligently infers and completes them based on known component parameters.

[0138] The input is a standard power grid description file, and the output is a structured model file required by the power flow initialization agent and a model file of the control system under test required by the code generation agent. After execution, the model generation agent sends the structured model file (containing topology and component parameters) to both the power flow initialization agent and the code generation agent.

[0139] S4: Stream initialization agent execution, including:

[0140] S4.1: System decomposition, identifying the new energy sources and load black box models in the distribution network, and equating them with ideal voltage sources.

[0141] For example, the power flow initialization agent decomposes the distribution network system into the traditional AC system part of the distribution network and the new energy and load black box model parts, and equates the black box model to an ideal voltage source, and confirms the active and reactive power injected by the black box model at the grid connection point.

[0142] S4.2: Call the power flow calculation kernel and write the power flow results back to the electromagnetic transient model parameters to achieve steady-state initialization.

[0143] For example, the power flow calculation kernel is invoked, and the Newton-Raphson method is used to solve the power flow of the system. The power flow calculation results (including the voltage magnitude, phase angle, active power, and reactive power of each node) are written back to the electromagnetic transient model as the initial values ​​for simulation, i.e., the initial parameters for simulation.

[0144] The input is a structured model file, and the output is an initialization model file containing power flow results, required by the hardware-in-the-loop simulation agent. After execution, the power flow initialization agent outputs the initialization model containing the power flow results to the hardware-in-the-loop simulation agent.

[0145] S5: Code generation agent execution, including:

[0146] S5.1: The converter control strategy under test is converted into embedded C code optimized for embedded development hardware using automatic code generation technology, and then compiled according to the target hardware configuration.

[0147] For example, the code generation agent converts the converter control strategy under test into embedded C code optimized for the target embedded hardware (such as DSP) using automatic code generation technology, compiles it according to the target hardware configuration, and downloads the compiled file to the physical controller.

[0148] The input is the model file of the control system under test, and the output is the embedded C code or compiled file required by the physical controller. After the code-generating agent is executed, the embedded C code or compiled file is deployed to the physical controller.

[0149] S6: Semi-physical simulation of intelligent agent execution, including:

[0150] S6.1: Calls the electromagnetic transient real-time simulation kernel, runs electromagnetic transient simulation, starts with the black box model connected to an ideal voltage source, and switches to the detailed model after running to steady state.

[0151] S6.2: Enables data interaction between the simulator and the physical controller under test via a communication interface.

[0152] For example, a closed-loop data interaction with the physical controller under test is achieved through a communication interface module. The electromagnetic transient real-time simulator outputs analog signals to the physical controller through digital-to-analog conversion of voltage and current data. The physical controller calculates and outputs digital signals such as switching signals and PWM signals according to its internal control algorithm. The communication interface module collects these digital signals and inputs them to the power electronic switches in the electromagnetic transient simulation model of the power distribution network to form a closed loop.

[0153] The input is an initialization model file containing power flow results, and the output is simulation waveform data. After execution, the hardware-in-the-loop simulation agent outputs the simulation waveform results to the power quality assessment agent.

[0154] S7: Power quality assessment agent execution, including:

[0155] S7.1: Calculate the power quality index based on the simulation results, and compare the index values ​​before and after applying the control strategy.

[0156] For example, the power quality assessment agent automatically calculates power quality indicators such as THD, power factor, and three-phase imbalance based on the simulated waveform, and compares the indicator values ​​after applying the control strategy with the indicator values ​​without enabling the control strategy.

[0157] Next, it will determine whether all operating conditions have been tested. If all operating conditions have been tested, then step 7.2 will be executed; if any operating condition has not been tested, then return to execute S4: Flow initialization agent execution, until the semi-physical simulation test of all operating conditions is completed.

[0158] S7.2: Generate a hardware-in-the-loop simulation verification report of the control strategy under each operating condition, including the conclusions of power quality quantification.

[0159] The inputs are simulation waveform results data and completion indicators for all operating conditions. The outputs are completion indicators for a single operating condition and a test evaluation report containing quantitative conclusions. After execution, the power quality assessment agent sends the test evaluation report containing quantitative conclusions, i.e., the hardware-in-the-loop simulation verification report, to the user terminal.

[0160] In one embodiment, such as Figure 8As shown, this application also provides a multi-agent collaborative system, which includes four parts: a physical access platform, a communication collaboration bus, a cluster of skill agents, and a scheduling agent. The physical access platform, located at the lowest level of the system, serves as the physical hardware foundation for the hardware-in-the-loop simulation. Its core component is an electromagnetic transient real-time simulator, which can be equipped with high-performance CPU, FPGA, or GPU computing resources. It has a built-in power flow calculation kernel and an electromagnetic transient real-time simulation kernel, and provides API interfaces for upper-layer skill agents to call, receiving power flow calculation task and electromagnetic transient real-time simulation task instructions, thus providing the system with real-time computing resources. The physical access platform also includes a communication interface module and a physical controller. The communication interface module consists of a digital-to-analog converter (D / A), an analog-to-digital converter (A / D), and a digital input / output (DIO) board, responsible for data interaction between the electromagnetic transient real-time simulator and the physical controller. For example, this module converts the voltage and current data calculated by the electromagnetic transient simulator into analog signals (such as a small voltage signal of ±10V), which are then output to the physical controller. After acquiring these model quantities, the controlled strategy under test in the physical controller performs calculations based on its internal control algorithm, outputting digital signals such as switching signals and PWM. The communication interface module acquires these digital signals and inputs them to the power electronic switch model in the electromagnetic transient real-time simulator, forming a closed loop. This module integrates a high-speed serial communication protocol (such as the Aurora protocol) and an FPGA-based hardware clock synchronization mechanism, ensuring microsecond-level real-time data interaction and precise synchronization of sampling times with the electromagnetic transient real-time simulator. The physical controller is the controller of the converter under test (which can be a control board containing a DSP or FPGA), loading control strategy code or compiled files automatically generated by the code-generating agent.

[0161] The skill agent cluster is the core functional module layer for realizing the hardware-in-the-loop simulation verification of power distribution network converters. This cluster contains multiple independently operating skill agents and can be expanded through registration. Each agent provides a standard API interface and interacts with the scheduling agent via a communication and coordination bus. The skill agents include at least a model generation agent, a power flow initialization agent, a code generation agent, a hardware-in-the-loop simulation agent, and a power quality assessment agent.

[0162] The model generation agent is responsible for parsing power grid description files (such as SVG single-line diagrams or CIM / E XML configuration files). Based on the component parameters and connection relationships contained in these files, it automatically generates distribution network topology and parameter information, forming an electromagnetic transient simulation model that can run on a real-time simulator. It can also intelligently complete missing parameters and output a structured model file. The key difference between the model generation agent's model generation function and existing technologies lies in its ability to not only parse graphics and topology but also automatically map the electrical parameters (line impedance, transformer ratio, capacity, etc.) configured in the CIM file to the component parameters of the electromagnetic transient model. It also incorporates an electromagnetic transient parameter completion algorithm, calculating and completing missing parameters based on existing parameters. The agent's feedback and correction capabilities include, but are not limited to: attempting to call a backup parser if the file format is incorrect; identifying missing components and prompting the user to supplement or replace them with typical components if the topology is incomplete; and recording error information and attempting alternative modeling schemes if model generation fails. The model generation agent's input is power grid data (including SVG, CIM / E, XML, and other format files), and its output is the distribution network model topology and parameters.

[0163] The power flow initialization agent is used to calculate system initialization parameters. It employs a three-step method—"voltage source equivalence - steady-state power flow calculation - model switching"—to process the black-box model and output an initialization model containing power flow results. Specifically, the power flow initialization agent can call the power flow calculation kernel of the real-time simulator to perform steady-state power flow calculations based on the acquired distribution network model topology and parameters. The resulting power flow results provide a scenario and operating condition basis for subsequent electromagnetic transient simulation and control strategy testing. Power flow initialization refers to writing the power flow results (node ​​voltage amplitude, phase angle, active power, and reactive power) back to the electromagnetic transient model as the initial values ​​for electromagnetic transient simulation, enabling the electromagnetic transient simulation to run on a specified power flow section. Since the distribution network with new sources and loads contains black-box models of traditional AC systems, new energy sources, and loads, and the internal structure of these black-box models is unknown, direct power flow calculation is difficult. Therefore, power flow initialization is divided into two parts. For the traditional AC system part, the Newton-Raphson method is used to solve the power flow and perform initialization. For the black-box model part, such as new energy sources and loads, a three-step method of "voltage source equivalence - steady-state power flow calculation - model switching" is used for power flow initialization, namely:

[0164] 1. First, use an ideal voltage source equivalent black box model;

[0165] 2. Use an equivalent voltage source to participate in the power flow solution of the entire system to obtain the voltage amplitude, phase angle, active power and reactive power of the black box model and the connection point of the distribution network (i.e., the grid connection point);

[0166] 3. The black box model is driven by a voltage source to run and complete initialization. After the black box model reaches steady state, the voltage source is switched to the actual black box model and connected to the distribution network model.

[0167] The power flow initialization function ensures that all electrical parameters of the distribution network system are near their steady-state values ​​at the start of electromagnetic transient simulation. Compared to the traditional initialization method where all electrical parameters start from 0, this method allows the system to reach steady state faster, thereby improving the efficiency of electromagnetic transient simulation and control strategy verification. The agent's feedback correction capabilities include, but are not limited to: automatically adjusting power flow constraints, modifying initial power flow settings, and retrying after model simplification if power flow does not converge; and attempting to match similar models from the historical database if a black-box model is missing. The input to the power flow initialization agent is the distribution network topology and parameters, and the output is a distribution network initialization model containing power flow results.

[0168] The code generation agent is responsible for converting the converter control model under test into embedded C code optimized for the target embedded hardware and compiling it, outputting the embedded C code or compiled files required by the physical controller. Specifically, the code generation agent is responsible for converting the converter control system model built during the development phase (including control strategies such as maximum power point tracking, reactive power compensation, and harmonic suppression) into embedded C code optimized for the target embedded development hardware (such as a DSP) through automatic code generation technology, and compiling it according to the target hardware configuration. The compiled files are downloaded to the physical controller as the object of semi-physical simulation testing and verification. The code generation function implemented by this agent differs from existing code generation technologies in that its code template and optimization direction are deeply coupled with a specific power quality control algorithm architecture, and the generated code can be directly used for semi-physical simulation testing. The feedback and correction capabilities of this agent include, but are not limited to: if code generation fails, checking model compliance, providing repair suggestions, automatically repairing and retrying; if compilation fails, analyzing error logs, trying to modify compilation options and downgrade the optimization level; if download fails, checking hardware connections, automatically retrying, and switching download interfaces. The input to the code-generating agent is a converter control system model, and the output is embedded C code or a compiled file.

[0169] The hardware-in-the-loop (HIL) simulation agent is used to call the electromagnetic transient real-time simulation kernel to execute simulations. It can autonomously select input / output interfaces, add fault points or deploy measurement points, process multiple operating conditions in batches, and output simulation waveform results. Specifically, the HIL simulation agent can call the electromagnetic transient real-time simulation kernel of the electromagnetic transient simulator. It can autonomously select the HIL simulation input / output interfaces according to user needs, add fault points or deploy measurement points at appropriate nodes, and achieve batch simulation of multiple operating conditions and scenarios by modifying model parameters and issuing simulation task commands. The agent's feedback correction capabilities include, but are not limited to: autonomously calibrating the bias and zero drift of the communication interface input / output; increasing the simulation step size or adopting a multi-rate scheme if real-time simulation times out; retrying by changing the numerical integration method if numerical oscillation occurs; automatically reconnecting the hardware if a communication interruption is detected; and recording the failed operating condition, analyzing the cause of the failure, adjusting parameters, or continuing to execute other operating conditions if a simulation of a certain operating condition fails. The HIL simulation agent's input is the power distribution network initialization model, and its output is the simulation waveform results.

[0170] The intelligent power quality assessment agent is used to post-process simulation results, automatically calculating indicators such as THD, power factor, and three-phase imbalance. It compares the indicator values ​​before and after applying control strategies and generates a test evaluation report containing quantitative conclusions. Specifically, this agent is responsible for post-processing and analyzing simulation results, storing simulation waveforms of key nodes according to operating condition tags. The agent has a built-in power quality indicator calculation kernel that can automatically calculate indicators such as total harmonic distortion (THD), power factor, voltage deviation, three-phase imbalance, and voltage sag depth based on simulation waveforms. It automatically compares the indicator values ​​after applying mitigation strategies with those without, generating a detailed test report containing quantitative conclusions. Specific indicators and calculation formulas are as follows:

[0171] 1. Total Harmonic Distortion (THD): Used to measure the degree of distortion of voltage or current waveforms.

[0172] The formula for calculating the THD of voltage is:

[0173] ;

[0174] In the formula, This is the effective value of the fundamental voltage. For the first Effective value of subharmonic voltage; This represents the highest harmonic order that needs to be considered.

[0175] Similarly, the formula for calculating the THD of current is:

[0176] ;

[0177] In the formula, This represents the effective value of the fundamental current. For the first Effective value of the second harmonic current.

[0178] 2. Power factor (PF): Reflects the efficiency of electrical energy utilization. The calculation formula is:

[0179] ;

[0180] In the formula, This represents the measured active power. This is the actual measured reactive power; This represents apparent power.

[0181] 3. Voltage Deviation: Measures the degree to which the actual voltage deviates from the rated voltage. The calculation formula is:

[0182] ;

[0183] In the formula, This is the measured effective value of the voltage; This is the effective value of the rated voltage.

[0184] 4. Three-phase unbalance: describes the degree of asymmetry in three-phase voltage or current, usually calculated using the symmetrical component method. The formula for calculating the three-phase voltage unbalance is:

[0185] ;

[0186] In the formula, It is the positive sequence voltage component; It is the negative sequence voltage component.

[0187] Similarly, the formula for calculating the three-phase unbalance of current is:

[0188] ;

[0189] In the formula, It is the positive sequence current component; It is the negative sequence current component.

[0190] 5. Voltage Sag Depth: Measures the degree of voltage drop during a voltage sag event. The calculation formula is:

[0191] ;

[0192] In the formula, This is the effective value of the rated voltage; This represents the minimum effective voltage value during the voltage sag.

[0193] The intelligent agent's feedback and correction capabilities include, but are not limited to: automatically identifying and removing abnormal data if waveform data is abnormal; analyzing the cause of failure and adjusting calculation parameters or trying alternative algorithms if index calculation fails; and simplifying the report format to ensure core data output if report generation fails. The input to the power quality assessment intelligent agent is the simulation waveform result, and the output is a test evaluation report containing quantitative conclusions, i.e., a hardware-in-the-loop simulation verification report.

[0194] The communication and coordination bus consists of three parts: an API gateway that uniformly exposes the API interfaces of each skill agent, supports RESTful / gRPC protocols, and enables service discovery and load balancing; a message bus based on MQTT or Kafka event bus that supports asynchronous communication and state synchronization between agents, ensuring reliable message transmission; and a data bus that is a shared storage or distributed file system used for exchanging data files between agents, such as model files, power flow initialization results, code files, simulation waveform data, evaluation reports, etc.

[0195] The scheduling agent is the control core of the system, responsible for global task orchestration and coordination. Internally, it includes a task parsing engine (supporting the parsing of natural language instructions or structured task scripts, decomposing user requirements into executable task sequences), a task orchestrator (dynamically generating workflows based on task sequences and capability lists, determining the calling order, data transfer relationships, and parallel / serial execution strategies), a skill registry (maintaining the capability list of each skill agent, including API interfaces, input parameter formats, output data formats, performance metrics, etc., supporting the addition of new skill agents through registration, with the scheduling agent automatically recognizing and adding them to the capability pool), and a status monitor (monitoring the execution status of each subtask in real time, handling abnormal situations such as timeout retries and failure rollbacks, and summarizing execution results).

[0196] The connection relationships and working mechanisms between the various layers of the system are as follows: Users submit test task instructions to the scheduling agent. The scheduling agent parses the user instructions through the task parsing engine to generate a sequence of sub-tasks. The task orchestrator dynamically arranges the workflow based on the capability description information of each skill agent in the skill registry center. Then, each sub-task is distributed to the corresponding skill agent through the communication coordination bus. After receiving the task, each skill agent executes it autonomously. It provides standard interfaces to the outside world through the API gateway of the communication coordination bus, realizes asynchronous communication and state synchronization between agents through the message bus, and transmits model files, simulation data, and other files through the data bus. When a skill agent needs to call the underlying physical access platform during execution, it calls its power flow calculation kernel or electromagnetic transient real-time simulation kernel through the API interface provided by the electromagnetic transient real-time simulator to complete the calculation task. The execution results are returned to the scheduling agent through the communication coordination bus, and the scheduling agent summarizes and outputs the final hardware-in-the-loop simulation verification report.

[0197] Thus, a complete automated toolchain based on multi-agent collaboration, covering the stages of "model building → initialization → hardware-in-the-loop simulation → quantitative evaluation," is constructed. Compared with related technologies where users need to manually operate multiple tools and manage data flow, the converter hardware-in-the-loop simulation verification method and multi-agent collaborative system of this application automatically parse tasks, orchestrate workflows, invoke skills, and summarize results through a scheduling agent. This solves the problems of complex processes and fragmented stages in existing technologies, significantly shortening the cycle from design to verification of converter control strategies, and providing key technical support for building high-quality, high-reliability new power distribution systems. In addition, unlike the automated processes of traditional workflow frameworks, the proposed method does not terminate the workflow when encountering errors, but rather enables each agent to achieve self-healing through independent feedback correction capabilities. The system no longer requires manual intervention to investigate errors, but autonomously analyzes errors, selects alternative solutions, and continuously retryes until the task is completed.

[0198] Furthermore, in the skill agent responsible for power flow initialization, a three-step method of "voltage source equivalence - steady-state power flow calculation - model switching" is adopted to achieve power flow initialization of the black-box model, solving the problem of accurate power flow initialization for distribution networks containing black-box models such as new energy sources and load converters. Compared with traditional initialization methods, the power flow initialization of this application ensures that all electrical parameters of the distribution network system are near their steady-state values ​​at the start of electromagnetic transient simulation, enabling the system to reach steady state faster and thus improving the efficiency of electromagnetic transient simulation and control strategy verification. In the skill agent responsible for code generation, the tested control strategy can be automatically converted into embedded C code optimized for the target embedded development hardware and compiled according to the target hardware configuration. The built-in code templates and optimization directions are deeply coupled with the specific power quality control algorithm architecture, and the generated code can be directly used for hardware-in-the-loop simulation testing, opening up a rapid implementation path from control strategy model design to embedded engineering verification. The hardware-in-the-loop simulation agent can autonomously add fault points, deploy measurement points, and modify model parameters to achieve automated batch simulation of multiple operating conditions by calling the electromagnetic transient real-time simulation kernel. Compared to traditional manual testing, the application of this intelligent agent can significantly improve the adaptability verification capability of control strategies in different scenarios. For the specific scenario of comprehensive power quality management in distribution networks facing new power sources and loads, the power quality assessment intelligent agent has built-in automatic quantitative calculation functions for indicators such as THD, power factor, and imbalance, and generates test reports containing quantitative conclusions. Compared with traditional hardware-in-the-loop (HIL) simulation verification platforms, this system can directly output quantitative conclusions on the improvement effect of control strategies on power quality, rather than just providing raw waveform data, greatly improving the readability of test results and decision-making efficiency. Each intelligent agent provides a standard API interface, supporting both CLI and SDK calling methods. When new functions need to be added, new intelligent agents can be added to the system through registration. The scheduling agent automatically identifies and includes them in the capability pool, realizing the modularity and scalability of the system.

[0199] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0200] Based on the same inventive concept, this application also provides a converter hardware-in-the-loop simulation verification device for implementing the converter hardware-in-the-loop simulation verification method described above. The solution provided by this device is similar to the solution described in the above method. Therefore, the specific limitations of one or more embodiments of the converter hardware-in-the-loop simulation verification device provided below can be found in the limitations of the converter hardware-in-the-loop simulation verification method described above, and will not be repeated here.

[0201] In one embodiment, such as Figure 9 As shown, a hardware-in-the-loop (HIL) simulation verification device for a converter is provided, comprising: a task sequence generation module 902, a target agent determination module 904, a workflow generation module 906, a subtask allocation module 908, and a verification report generation module 910, wherein:

[0202] The task sequence generation module 902 is used to receive test task instructions for the converter control strategy to be verified in the physical controller, parse the test task instructions, and generate a sub-task sequence.

[0203] The target agent determination module 904 is used to determine the target agent that matches each subtask in the subtask sequence from multiple skill agents with different functions, based on the subtask sequence and the capability feature information of each skill agent;

[0204] Workflow generation module 906 is used to arrange the sequence of subtasks to obtain a workflow; the workflow includes the calling order of the target intelligent agent;

[0205] The subtask allocation module 908 is used to distribute each subtask to the corresponding target intelligent agent according to the calling order of the target intelligent agents in the workflow, so that each target intelligent agent can execute its own received subtask.

[0206] The verification report generation module 910 is used to receive the execution results returned by each target intelligent agent and generate hardware-in-the-loop simulation verification results for the converter control strategy to be verified based on multiple execution results.

[0207] In one embodiment, the workflow generation module 906 is further configured to determine the calling order and data transmission relationship of each target agent based on the execution order of each subtask and the data dependency relationship between each subtask; and to determine the workflow based on the calling order and data transmission relationship of each target agent.

[0208] In one embodiment, the verification report generation module 910 is also used to monitor the execution status of each subtask in real time. For each subtask, if the execution status of the subtask is detected as execution failure, and if the correction feedback information of the target intelligent agent corresponding to the subtask is obtained within the preset correction time, the execution status of the subtask is updated. If the execution status of each subtask is execution success or reaches the preset termination condition, the execution results returned by each target intelligent agent are received, and the execution results of multiple subtasks are summarized to generate a hardware-in-the-loop simulation verification result.

[0209] In one embodiment, the apparatus further includes a correction module, which is used to determine the execution status of each subtask as execution failure and determine the task failure type when the target agent corresponding to the subtask determines that the execution conditions of the subtask do not meet the preset conditions or an error occurs during the execution process; and to determine the target correction strategy corresponding to the task failure type from a preset correction strategy set by the target agent corresponding to the subtask, and to execute the target correction strategy to re-execute the failed subtask.

[0210] In one embodiment, the task sequence generation module 902 is further configured to: determine the parsing strategy corresponding to the test task instruction based on the instruction type identifier; parse the test task instruction based on the parsing strategy to obtain the parsing result; and split the test task into at least one subtask based on the parsing result to obtain a subtask sequence.

[0211] In one embodiment, the verification report generation module 910 is also used to call the physical controller to perform closed-loop interaction with the power distribution network model in order to perform semi-physical simulation verification on the executable code file and obtain the semi-physical simulation verification result.

[0212] Each module in the aforementioned converter hardware-in-the-loop simulation verification device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the computer device's memory as software, so that the processor can call and execute the corresponding operations of each module.

[0213] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 10As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a converter hardware-in-the-loop simulation verification method. The display screen can be an LCD screen or an e-ink display screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.

[0214] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0215] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0216] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.

[0217] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0218] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0219] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0220] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0221] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A hardware-in-the-loop simulation verification method for a converter, characterized in that, The method is applied to a multi-agent cooperative system, which includes a physical controller and multiple skill-based agents with different functions. The method includes: Receive test task instructions for the converter control strategy to be verified in the physical controller, parse the test task instructions, and generate a sub-task sequence; Based on the sub-task sequence and the capability feature information of each skill agent, a target agent matching each sub-task in the sub-task sequence is determined from the multiple skill agents with different functions. The subtask sequence is arranged to obtain a workflow; the workflow includes the invocation order of the target agent. According to the calling order of the target agents in the workflow, each subtask is sent to the corresponding target agent so that each target agent executes its own received subtask. The system receives the execution results returned by each of the target intelligent agents and generates a hardware-in-the-loop simulation verification result for the converter control strategy to be verified based on the multiple execution results.

2. The method according to claim 1, characterized in that, The workflow also includes the data transfer relationships between the various skill agents; The arrangement of the subtask sequence to obtain the workflow includes: Based on the execution order of each subtask and the data dependencies between each subtask, determine the calling order and data transfer relationship of each target agent; The workflow is determined based on the calling order and data transmission relationship of each target intelligent agent.

3. The method according to claim 1, characterized in that, The step of receiving the execution results returned by each of the target intelligent agents and generating a hardware-in-the-loop simulation verification result for the converter control strategy to be verified based on multiple execution results includes: The execution status of each subtask is monitored in real time. For each subtask, if the execution status of the subtask is detected as execution failure, and if the correction feedback information of the target agent corresponding to the subtask is obtained within a preset correction time, the execution status of the subtask is updated. If the execution status of each subtask is successful or the preset termination condition is met, the execution results returned by each target agent are received, and the execution results of multiple subtasks are summarized to generate the hardware-in-the-loop simulation verification result.

4. The method according to claim 3, characterized in that, The method further includes: For each subtask, if the target agent corresponding to the subtask determines that the execution condition of the subtask is not met or an error occurs during the execution process, the execution status of the subtask is determined to be execution failure, and the task failure type is determined. The target agent corresponding to the subtask determines the target correction strategy corresponding to the task failure type from a preset set of correction strategies, and executes the target correction strategy to re-execute the failed subtask.

5. The method according to claim 1, characterized in that, The test task instruction includes an instruction type identifier and a test task; parsing the test task instruction to generate a sub-task sequence includes: Based on the instruction type identifier, determine the parsing strategy corresponding to the test task instruction; Based on the parsing strategy, the test task instructions are parsed to obtain the parsing results; Based on the analysis results, the test task is divided into at least one subtask to obtain the subtask sequence.

6. The method according to claim 1, characterized in that, The plurality of execution results include an executable code file and a distribution network model, wherein the executable code file is obtained by performing code generation processing on the converter control strategy to be verified; The process of generating hardware-in-the-loop simulation verification results for the converter control strategy to be verified based on multiple execution results includes: The physical controller is invoked to perform closed-loop interaction with the power distribution network model to perform semi-physical simulation verification on the executable code file, and the semi-physical simulation verification result is obtained.

7. A converter hardware-in-the-loop simulation verification device, characterized in that, The device includes: The task sequence generation module is used to receive test task instructions for the converter control strategy to be verified in the physical controller, parse the test task instructions, and generate a sub-task sequence. The target agent determination module is used to determine the target agent that matches each subtask in the subtask sequence from multiple skill agents with different functions, based on the subtask sequence and the capability feature information of each skill agent. A workflow generation module is used to arrange the subtask sequence to obtain a workflow; the workflow includes the calling order of the target agent; The subtask allocation module is used to distribute each subtask to the corresponding target intelligent agent according to the calling order of the target intelligent agents in the workflow, so that each target intelligent agent executes its own received subtask. The verification report generation module is used to receive the execution results returned by each of the target intelligent agents, and generate a hardware-in-the-loop simulation verification result for the converter control strategy to be verified based on the multiple execution results.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.