Method and device for generating parameterized unit script, computer device and storage medium
By acquiring parameterized unit query information, analyzing runtime errors, and dynamically updating solutions, the problem of repeatedly generating error codes in electronic design is solved, achieving efficient script generation and repair, and improving the accuracy and speed of electronic design.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN RES INST THE CHINESE UNIV OF HONG KONG
- Filing Date
- 2026-01-16
- Publication Date
- 2026-06-02
Smart Images

Figure CN122132523A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic design technology, and in particular to a method, apparatus, computer device, computer-readable storage medium, and computer program product for generating parameterized unit scripts. Background Technology
[0002] With the development of technology, the integration of chips has increased from dozens of transistors to hundreds of billions. Relying on manual design can no longer quickly complete electronic design tasks. Therefore, in order to improve the efficiency of electronic design, artificial intelligence technology is used for electronic design.
[0003] However, current traditional methods typically rely on static prompt word engineering, which uses preset fixed prompt words to analyze the electronic design questions input by the user and obtain the corresponding electronic design script. This can easily lead to a cycle of repeatedly generating error codes, making it impossible to ensure the accuracy of the generated electronic design script. Summary of the Invention
[0004] Therefore, it is necessary to provide a method, apparatus, computer device, computer-readable storage medium, and computer program product for generating parameterized unit scripts that can improve the success rate and accuracy of automatically generating parameterized unit code, in order to address the above-mentioned technical problems.
[0005] Firstly, this application provides a method for generating parameterized unit scripts, including:
[0006] Obtain parameterized unit query information; generate parameterized unit script based on parameterized unit query information; run parameterized unit script and obtain execution results;
[0007] If the execution result corresponds to an error, obtain the execution error information from the execution result, determine the current solution from the solution set corresponding to the execution error information, update the parameterized unit script based on the current solution, and obtain the updated execution result corresponding to the updated parameterized unit script;
[0008] If the updated execution result corresponds to an error, obtain the updated execution error information from the updated execution result, determine the error change trend corresponding to the updated execution error information based on the execution error information, generate a target solution based on the current solution and the error change trend, modify the parameterized unit script based on the target solution, and run the modified parameterized unit script to obtain the modified execution result;
[0009] If the corrected execution result corresponds to a successful execution, the target solution is added to the solution set corresponding to the execution error message, and the parameterized unit response information corresponding to the parameterized unit question information is generated based on the corrected parameterized unit script.
[0010] In one embodiment, determining the error change trend corresponding to the updated runtime error information based on runtime error information, and generating a target solution based on the current solution and the error change trend, includes: extracting a first error feature and a second error feature from the runtime error information and the updated runtime error information respectively using a first network in the repair agent; calculating the difference feature between the first error feature and the second error feature; determining the target type of the error change trend corresponding to the difference feature; the target type is used to characterize the state transition direction of the error in different dimensions; inputting the target type into a second network in the repair agent to generate a target repair scheme matching the target type; obtaining the modified code segment and the modification method corresponding to the modified code segment based on the target repair scheme; locating the target code segment matching the modified code segment in the current solution, modifying it according to the modification method, and obtaining the target solution.
[0011] In one embodiment, the target type is input into a second network in the repair agent to generate a target repair scheme that matches the target type. This includes: matching each label in the repair scheme database with the target type to obtain a target label that matches the target type; processing the repair schemes that match the target label in the repair scheme database based on the error change trend to obtain a target repair scheme that matches the target type; and / or generating target prompt words based on the error change trend, the target type, and the current solution; and inputting the target prompt words into a neural network model to obtain the target repair scheme through the neural network model.
[0012] In one embodiment, generating a parameterized unit script based on parameterized unit question information includes: invoking a type recognition agent to extract key question parameters from the parameterized unit question information; matching the key question parameters with the index corresponding to each template in a preset template set to obtain a parameterized unit type that matches the key question parameters; obtaining a target template that matches the parameterized unit type from the preset template set; obtaining a structure template and example script that match the parameterized unit question information from the target template; invoking a strategy planning agent to parse the structure template and parameterized unit question information to obtain a corresponding execution plan; invoking a context management agent to generate a corresponding structured context according to the execution plan; and invoking a script generation agent to input the structured context into a large language model to generate a parameterized unit script.
[0013] In one embodiment, the context management agent generates a corresponding structured context according to the execution plan, including: obtaining each execution step in the execution plan; for each execution step, determining the step type corresponding to the execution step; if the step type corresponds to a repair type, obtaining the historical script fragment corresponding to the execution step and the historical error information corresponding to the historical script fragment; and constructing a structured context based on the historical script fragment and the historical error information.
[0014] In one embodiment, the method of this application further includes: if the modified running result fails, obtaining the corresponding modified running error information, obtaining relevant context information based on the parameterized unit query information, the target solution, the current solution, and the modified running error information; regenerating the parameterized unit script based on the relevant context information to obtain the updated parameterized unit script; and running the updated parameterized unit script to update the modified running result.
[0015] Secondly, this application also provides an apparatus for generating parameterized unit scripts, comprising:
[0016] The acquisition module is used to acquire parameterized unit query information; generate parameterized unit scripts based on the parameterized unit query information; and run the parameterized unit scripts to obtain the execution results.
[0017] The solution module is used to obtain the running error information from the running result if the running result corresponds to a running error, determine the current solution from the solution set corresponding to the running error information, update the parameterized unit script based on the current solution, and obtain the updated running result corresponding to the updated parameterized unit script;
[0018] The correction module is used to obtain the update error information from the update result if the update result corresponds to an error, determine the error change trend corresponding to the update error information based on the error information, generate a target solution based on the current solution and the error change trend, correct the parameterized unit script based on the target solution, and run the corrected parameterized unit script to obtain the corrected result.
[0019] The response module is used to add the target solution to the solution set corresponding to the running error message if the corrected running result corresponds to a successful running result, and to generate parameterized unit response information corresponding to the parameterized unit question information based on the corrected parameterized unit script.
[0020] Thirdly, this application also provides a computer device, 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.
[0021] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the steps in the above-described method embodiments.
[0022] Fifthly, this application also provides a computer program product, including a computer program that is executed by a processor to implement the steps in the above-described method embodiments.
[0023] The aforementioned method, apparatus, computer device, computer-readable storage medium, and computer program product for generating parameterized unit scripts analyze the error change trends of runtime error information before and after repair, and generate target solutions based on these trends. They can dynamically generate targeted repair rules based on runtime error information, thereby significantly improving the accuracy of repairing complex errors. This, in turn, increases the success rate and accuracy of parameterized unit script generation and repair. Furthermore, after successfully correcting the runtime results, the target solution is added to the solution set, enhancing the system's adaptive evolution capability. Consequently, the repair speed for common errors becomes increasingly faster, and processing capabilities are enhanced. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is an application environment diagram of a method for generating parameterized unit scripts in one embodiment;
[0026] Figure 2 This is a flowchart illustrating a method for generating parameterized unit scripts in one embodiment;
[0027] Figure 3 This is a flowchart illustrating the method for generating parameterized unit scripts in another embodiment;
[0028] Figure 4 This is a flowchart illustrating the steps of creating a task object in one embodiment;
[0029] Figure 5 This is a flowchart illustrating the steps involved in generating an execution plan in one embodiment;
[0030] Figure 6 This is a flowchart illustrating the code generation steps in one embodiment;
[0031] Figure 7This is a flowchart illustrating the code modification steps in one embodiment;
[0032] Figure 8 This is a flowchart illustrating the steps of generating a parameterized unit script according to the execution steps in one embodiment;
[0033] Figure 9 This is a flowchart illustrating the steps of repairing the parameterized unit script in one embodiment;
[0034] Figure 10 This is a flowchart illustrating the steps to be executed after a task is completed in one embodiment.
[0035] Figure 11 This is a flowchart illustrating the steps related to obtaining the target solution in one embodiment.
[0036] Figure 12 This is a structural block diagram of a device for generating parameterized unit scripts in one embodiment;
[0037] Figure 13 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0038] 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.
[0039] The method for generating parameterized unit scripts provided in this application embodiment can be applied to, for example, Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on a cloud or other network server. The user inputs parameterized unit query information, i.e., PCell query information, through terminal 102. After receiving the parameterized unit query information, terminal 102 sends it to server 104. Then, server 104 receives the parameterized unit query information, generates a parameterized unit script based on the query information, runs the script, and obtains the execution result. In this embodiment, if there are execution errors in the execution result, server 104 can self-evolvingly analyze and update the corresponding solution. That is, if the execution result corresponds to an error, the execution error information is obtained from the execution result, and the current solution is determined from the solution set corresponding to the execution error information; the parameterized unit script is updated based on the current solution to obtain the updated execution result corresponding to the updated parameterized unit script; if the updated execution result corresponds to an error, the updated execution error information is obtained from the updated execution result, the error change trend corresponding to the updated execution error information is determined based on the execution error information, and a target solution is generated based on the current solution and the error change trend; the parameterized unit script is corrected based on the target solution; the corrected parameterized unit script is run to obtain the corrected execution result; if the corrected execution result corresponds to a successful execution, the target solution is added to the solution set corresponding to the execution error information, and parameterized unit answer information corresponding to the parameterized unit question information is generated based on the corrected parameterized unit script. The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can be smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, projection devices, etc. Portable wearable devices can be smartwatches, smart bracelets, head-mounted devices, etc. Headset devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. Server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0040] In one exemplary embodiment, such as Figure 2 As shown, a method for generating parameterized unit scripts is provided, which can be applied to... Figure 1 Taking server 104 as an example, the explanation includes the following steps 202 to 208. Wherein:
[0041] Step 202: Obtain parameterized unit query information; generate parameterized unit script based on parameterized unit query information; run parameterized unit script and obtain running results.
[0042] Among them, parameterized unit query information refers to the natural language description or instructions input by the user, which contains the design or repair requirements for specific function codes (parameterized units), such as "generate a PCell for a certain device under the new process version" or "repair a specific violation of a certain PCell in DRC".
[0043] A parameterized unit script is a code snippet or script file that is generated based on the query information and can be executed by a computer, with the aim of implementing the function specified in the query.
[0044] The execution result refers to the feedback data returned after the script is executed, including program output, status code, or exception stack.
[0045] In this embodiment, after obtaining the query information from the parameterized unit, the server obtains the running result through the cooperation of multiple agents. For example, refer to... Figure 3 To ensure the orderly execution of tasks, the server first manages the parameterized unit (PMU) query information through the task management module, determining the specific task corresponding to each PMU query. This specific task is then input into the multi-agent processing module, where multiple agents process the PMU query information (e.g., task understanding, planning, context construction, script generation / modification) to generate a PMU script. This PMU script is then input into a PMU interpretation / verification tool (e.g., Synopsys CustomCompiler, Cadence Virtuoso Layout Suite), which provides the execution result. Since the execution result may be successful or error-prone (i.e., the generated PMU script may be correct or contain vulnerabilities), a logging and solution configuration module is required. This module records the execution results and task trajectory (e.g., at least one PMU script generated for the PMU query, and solutions corresponding to PMU scripts that malfunctioned). Based on historical log analysis, the current solution is continuously adjusted, thereby influencing the planning and execution of subsequent tasks.
[0046] It is understood that the aforementioned parameterized unit interpretation / verification tool can be deployed on a server or off-server. The server sends the generated parameterized unit script to the parameterized unit script interpretation / verification tool, which then runs the parameterized unit script and sends the results back to the server.
[0047] Optionally, a large language model can be invoked to input the parameterized unit query information into the large language model, and the large language model can analyze the parameterized query information to obtain the corresponding parameterized unit script.
[0048] Step 204: If the running result corresponds to a running error, obtain the running error information from the running result, determine the current solution from the solution set corresponding to the running error information, update the parameterized unit script based on the current solution, and obtain the updated running result corresponding to the updated parameterized unit script.
[0049] Among them, runtime errors refer to abnormal, crash, or logical error states that do not achieve the expected results during the execution of parameterized unit scripts.
[0050] Runtime error messages refer to the specific error descriptions thrown, such as syntax errors, undefined variables, and logical infinite loops.
[0051] A solutions collection refers to a pre-built or dynamically maintained database used to store historical fixes or general fix strategies for specific error types.
[0052] The current solution refers to the solution initially selected from the solution set to attempt to fix the current runtime error.
[0053] In existing technologies, there is often a lack of dynamic correction mechanisms for runtime errors in closed EDA environments. Systems lacking a "generate-verify-repair" closed-loop control are prone to getting stuck in a cycle of repeatedly generating erroneous scripts, failing to achieve automated closed-loop repair. Therefore, to correct parameterized unit scripts that malfunction during runtime, this embodiment's system can store a set of solutions. By querying this set, solutions matching the runtime error can be obtained, thereby attempting dynamic correction. For example, if the runtime result corresponds to a runtime error, runtime error information is obtained from the result. Runtime error information may include error type, error log, and error location. For instance, if the runtime result is "ValueError: Geometry Error: Invalid bounding box coordinates," then the runtime error information can be determined from this result as a parameter error. Then, the current solution is determined from the set of solutions corresponding to the runtime error information. For example, this could be based on retrieving a matching solution (i.e., the current solution) from the solution set based on the error type, or it could be by inputting the runtime error information into a pre-trained solution selection model, which then analyzes the multi-dimensional runtime error information to select the best solution from the set. Finally, update the parameterized unit script based on the current solution. That is, modify the parameterized unit script based on the current solution to obtain the updated parameterized unit script. To ensure that the updated parameterized unit script can run successfully, it also needs to be input into the parameterized unit interpretation / verification tool to obtain the corresponding updated execution results.
[0054] Step 206: If the updated running result corresponds to a running error, obtain the updated running error information from the updated running result, determine the error change trend corresponding to the updated running error information based on the running error information, generate a target solution based on the current solution and the error change trend, modify the parameterized unit script based on the target solution, and run the modified parameterized unit script to obtain the modified running result.
[0055] Among them, the error change trend refers to analyzing the direction of error status change (e.g., from syntax error to logical error, or the error line number being moved) by comparing the error information before and after the "current solution" is fixed, in order to determine whether the current fix is effective.
[0056] The target solution refers to an optimized and repaired solution that is generated based on the error change trend and the current solution, and is used to completely solve the problem.
[0057] Parameterized unit response information refers to the final result or confirmation message displayed to the user after a script has run successfully. For example, the parameterized unit response information is the parameterized unit script corresponding to the final running cost.
[0058] This embodiment addresses the situation where, after modifying the parameterized unit script based on the current solution, the updated parameterized unit script still produces errors. In this case, the server will redetermine the solution and modify the updated parameterized unit script based on the redefined solution until a parameterized unit script is obtained that executes successfully.
[0059] For example, if the updated execution result corresponds to an error, the updated execution error information is obtained from the updated execution result, and the error change trend corresponding to the updated execution error information is determined based on the execution error information. The error change trend is used to confirm the impact of the current solution (i.e., the solution corresponding to the previous version of the parameterized unit script) on resolving the execution error. For example, it is determined that the error change trend is: the previous error has been corrected, but a new error has appeared. In this case, the current solution can be analyzed to obtain a new target solution. Another example is that the error change trend is determined that the previous error has not been corrected, but the specific data of the error has changed. In this case, the updated parameterized unit script may be rolled back to the original parameterized unit script based on the current solution, or the original parameterized unit script may be obtained directly based on the stored historical logs. After obtaining the new target solution, the original parameterized unit script is updated. Therefore, a target solution is generated based on the current solution and the error change trend. Then, the parameterized unit script is corrected based on the target solution. The corrected parameterized unit script is then run to obtain the corrected execution result.
[0060] It is understandable that the corrected execution result may correspond to either a successful execution or a failed execution. If it corresponds to a failed execution, the above steps continue, that is, repeating the process of "obtaining updated execution error information from the updated execution result corresponding to the failed execution, determining the error change trend corresponding to the updated execution error information based on the execution error information, generating a target solution based on the current solution and the error change trend; correcting the parameterized unit script based on the target solution; running the corrected parameterized unit script to obtain the corrected execution result." In other words, if the corrected execution result results in a failed execution, the corresponding corrected execution error information is obtained, and relevant context information is obtained based on the parameterized unit query information, the target solution, the current solution, and the corrected execution error information; the parameterized unit script is regenerated based on the relevant context information to obtain an updated parameterized unit script; the updated parameterized unit script is run to update the corrected execution result, until the corrected execution result corresponds to a successful execution. To avoid getting stuck in an execution loop, a target number of times to generate corrected execution results can be preset. After each generation of corrected execution results, the correction count is recorded (i.e., the correction count is incremented by 1). When the correction count reaches the target number, and the corrected execution result still corresponds to an error, the parameterized unit's response information is determined to be "script generation failed." Optionally, the corresponding parameterized unit query information and the log information recorded during the script generation process (e.g., the execution plan described later, the step history information corresponding to each step, etc.) can be sent to the configuration terminal so that the staff can query the reason for the error in generating the parameterized unit query information through the configuration terminal, and then improve the built-in library or algorithm in this embodiment to improve the robustness of the system in this embodiment.
[0061] After correcting the execution result to indicate that the execution was successful, perform the following steps:
[0062] Step 208: If the corrected running result corresponds to a successful run, then add the target solution to the solution set corresponding to the running error information, and generate parameterized unit answer information corresponding to the parameterized unit question information based on the corrected parameterized unit script.
[0063] Here, the runtime error message refers to the execution result corresponding to the initial parameterized unit script. The target solution that ultimately succeeds is added to the solution set corresponding to the runtime error message. This allows for quick selection of an efficient solution from the solution set when encountering the same problem again. Furthermore, based on the target solution that ultimately succeeds, parameterized unit response information corresponding to the parameterized unit question is generated.
[0064] In the above-described method for generating parameterized unit scripts, after generating the corresponding parameterized unit script, the script is run, and errors are corrected based on the running results. This enables dynamic correction during the parameterized unit script generation process. Furthermore, by continuously recording the best solutions for each running error, the multi-agent module can continuously accumulate and update corresponding solutions while completing specific tasks, thereby gradually improving the success rate and robustness of automatic PCell script generation and repair.
[0065] In an exemplary embodiment, after determining the error change trend, a target solution matching the error change trend can be queried from the solution set. However, in some embodiments, the solutions in the solution set may not be able to resolve the updated runtime error information. In this case, it is necessary to use an inference model to try to generate a new solution. Exemplarily, the steps of determining the error change trend corresponding to the updated runtime error information based on the runtime error information and generating a target solution based on the current solution and the error change trend include: using a first network in the repair agent to extract a first error feature and a second error feature from the runtime error information and the updated runtime error information, respectively; calculating the difference features between the first error feature and the second error feature; determining the target type of the error change trend corresponding to the difference features; the target type is used to characterize the state transition direction of the error in different dimensions; inputting the target type into a second network in the repair agent to generate a target repair scheme matching the target type (dynamic retrieval: partial modification, rollback, regeneration, or large model generation); obtaining the modified code segment and the modification method corresponding to the modified code segment based on the target repair scheme; locating the target code segment matching the modified code segment in the current solution, modifying it according to the modification method, and obtaining the target solution.
[0066] In this context, the repair agent refers to an AI module integrating deep learning models or algorithmic logic, specifically responsible for analyzing errors and generating code repair strategies. The first network refers to the feature extraction subnetwork within the repair agent, typically employing CNN, RNN, or Transformer architectures, used to transform unstructured error logs into structured numerical feature vectors. The second network refers to the decision generation subnetwork within the repair agent, which, based on the error type input, outputs specific repair operation instructions.
[0067] The first error feature and the second error feature refer to the vectorized representations of the initial runtime error and the updated runtime error, respectively, and are used to capture key information such as the semantics, type, and stack location of the error.
[0068] The difference feature refers to the difference or distance between the first error feature and the second error feature, which is used to quantify the degree and direction of error variation.
[0069] The target type refers to the category label after classifying the differential features, such as "type unchanged", "position offset", "logical transformation", etc., which represent the state transition of the error in the multidimensional space.
[0070] The target repair scheme refers to the specific repair strategy output by the second network, such as partial modification, rollback, regeneration, or large model generation.
[0071] Modifying a code segment refers to the specific line or block of code in a script that needs to be modified. The modification method refers to the specific operation performed on the code segment, such as insertion, deletion, replacement, or wrapping.
[0072] For example, if it is determined that no target solution matching the updated runtime error information can be found in the solution set, a target solution can be generated based on the current solution and the error change trend using an inference model (e.g., a subsequent repair agent).
[0073] First, the first network (e.g., a feature extraction model) in the repair agent is used to deeply analyze the "running error information" before and after the update, extracting vector data that characterizes the nature of the error, namely the "first error feature" and the "second error feature". Next, by calculating the difference between these two feature vectors, the specific changes in the error before and after the update are quantified; this difference is called the "difference feature". Based on this difference feature, the system further determines the "target type" of the error, which is essentially a qualitative judgment of the direction of error evolution. For example, has the error type fundamentally changed, or has the error location shifted, or has the error severity increased? In this way, it can be determined whether the runtime impact of the updated parameterized unit script has improved, worsened, or created new problems.
[0074] After identifying the error's changing trend (e.g., target type), this trend is fed into a second network (e.g., a decision generation model) of the repair agent. Based on the current evolution of the error, the second network dynamically retrieves or generates the most suitable response from a pre-defined policy library—the "target repair plan." The key to this step is dynamic matching: if the error trend shows improvement, the plan may only require "partial code modification"; if the trend shows deterioration, the plan may choose to "roll back" to the previous version; if the attempt is ineffective, it may trigger "regeneration" or invoke entirely new logic for "large model generation." This feedback-based policy selection mechanism avoids blind trial and error and improves the targeted nature of the repair.
[0075] Finally, the abstract "target repair solution" is transformed into concrete code operation instructions. First, the solution is parsed to determine the specific code content to be modified (the code segment to be modified) and the operation type (modification method, such as insertion, deletion, or replacement). Then, among the currently tried solution code, the "target code segment" that matches the "modified code segment" is precisely located. Following the preset modification method, the system performs substantive modifications on this part of the code, thereby generating the final "target solution" aimed at solving the problem. This stage completes the implementation from logical strategy to concrete code entities, ensuring that the repair intent is accurately written into the script.
[0076] In this embodiment, by identifying the differences in different running results, the error change trend is identified, and the abstract error change trend is concretized into calculable difference features and target types, thereby improving the accuracy of script repair. Furthermore, by using fine-grained control methods such as locating target code segments and selecting modification methods, the scope of code modification is minimized, reducing the risk of introducing new errors and demonstrating a very high level of automation and intelligence.
[0077] In some embodiments, during the process of generating a target repair scheme that matches the target type using a repair agent, each label in the repair scheme database can be matched with the target type to obtain a target label that matches the target type; the repair schemes that match the target label in the repair scheme database are processed based on the error change trend to obtain a target repair scheme that matches the target type.
[0078] The remediation database refers to a structured data source that stores known remediation cases. Each record contains a tag and the corresponding remediation code or logic. Tags are used to index keywords or metadata of the remediation plan, such as "null pointer exception" or "array out of bounds," and are associated with error types or target types. Target tags are database index tags that match the "target type" of the current analysis.
[0079] Specifically, firstly, in the retrieval and localization phase, the analyzed error "target type" (i.e., the general direction of error evolution, such as changing from "syntax error" to "logic error" or "error position shift") is compared with various preset "tags" in the "remediation solution database." By performing an index search in the database, the aim is to quickly narrow down the scope and filter out a set of successful cases that have historically dealt with similar error categories from massive amounts of data, i.e., "target tags," thereby determining the general direction of the remediation.
[0080] Secondly, during the solution generation phase, specific "error change trends" (such as the specific magnitude of error code changes, location offsets, and other micro-features) are used to perform secondary processing on the retrieved repair solutions. That is, based on the specific dynamic details of the current error, the matched historical repair strategies are fine-tuned, parameters are modified, or logic is adapted. Ultimately, a target repair solution is generated that both draws on past successful experiences and accurately adapts to the current actual error state.
[0081] In this embodiment, the target repair solution can be quickly obtained by searching the repair solution database based on the target type.
[0082] In other embodiments, target prompts can be generated based on error change trends, target types, and current solutions; the target prompts are then input into a neural network model to obtain a target repair solution.
[0083] The target prompt is the input instruction built for the large language model, integrating error trends, types, and the current code context to guide the model in generating correct code. Neural network models refer to large language models based on the Transformer architecture (such as GPT-4, Llama, etc.), which have powerful code understanding and generation capabilities.
[0084] Specifically, the current solution, error change trend, and target type are organized according to their corresponding logical relationships to obtain target prompts. For example, after using the "current solution," an error change trend corresponding to the "target type" is generated. Please modify the "current solution" so that the modified solution does not contain the runtime error corresponding to the "target type." Then, the constructed target prompts are input into a pre-trained neural network model. This model then uses its inherent code understanding and logical reasoning capabilities to analyze the error evolution process described in the target prompts, understand the reason why the current solution is ineffective, and deduce a "target repair solution" tailored to the specific error state.
[0085] In this implementation, by using a large model to generate target solutions, it is possible to compensate for the deficiency that the corresponding solutions may not exist in the solution set, and to infer the target solutions through the capabilities of the model, thereby improving the accuracy of the generated target repair solutions.
[0086] In some embodiments, such as Figure 4As shown, since multiple users may initiate questions about parameterized units within a certain period, the server can process the task request after receiving it, obtaining the corresponding task object, to facilitate the management of parameterized question tasks for each user. For example, the task request can be parsed into a unified internal task object. This internal task object includes the parameterized question information parsed from the task request, a unique task identifier assigned to the task request, the task creation time, and the initial task state. Then, the task object is added to the task queue, awaiting collaborative processing by multiple agents. The specific steps are as follows:
[0087] For example, the steps of generating parameterized unit scripts based on parameterized unit question information include: invoking a type recognition agent to extract key question parameters from the parameterized unit question information; matching the key question parameters with the index corresponding to each template in a preset template set to obtain the parameterized unit type matching the key question parameters; obtaining a target template matching the parameterized unit type from the preset template set; obtaining a structure template and example script matching the parameterized unit question information from the target template; invoking a policy planning agent to parse the structure template and parameterized unit question information to obtain the corresponding execution plan; invoking a context management agent to generate the corresponding structured context according to the execution plan; and invoking a script generation agent to input the structured context into the large language model to generate the parameterized unit script.
[0088] The type recognition agent is used to determine the type of parameterized unit that matches the parameterized unit script input by the user. The type recognition agent performs semantic analysis on the parameterized unit query information, extracts key query parameters, and matches these parameters with a built-in set of parameterized unit templates to output a standardized parameterized unit type (e.g., "NMOS unit device," "metal interconnect," "contact hole structure"). The parameterized unit type identifier output by the type recognition agent is used in subsequent processes. For example, based on this parameterized unit type identifier, the corresponding parameterized unit structure template and example script are loaded from a preset template set to obtain initial context information matching the parameterized unit query information. This initial context information serves as input for subsequent step planning and script generation.
[0089] The strategy planning agent is used to generate an execution plan. This execution plan is displayed as a sequence of steps. Each step in the sequence includes at least a step number, a step name, and a natural language description of the step's purpose. Furthermore, the strategy planning agent categorizes the steps into different types, with each type corresponding to a different agent, to guide the coordinated execution of different agents. For example... Figure 5 As shown, the parameterized unit's query information and the initial context information (e.g., structural templates, example scripts, etc.) obtained by the type recognition agent are input into the policy planning agent. This agent then summarizes and organizes this information to generate a corresponding sequence of steps (i.e., an execution plan). The step types corresponding to these steps are then labeled (e.g., generation type, repair type, verification type). Next, the execution plan is bound to the previously obtained task object, and the current step pointer is initialized to the first step in the execution plan, so that subsequent generation, verification, and repair processes can be driven sequentially.
[0090] The context management agent is used to acquire context information corresponding to each step in the execution plan. Context information includes, for example, the step type, the initial parameterized unit query information, the identified parameterized unit type, example resources (such as the example script mentioned above), structure templates, etc. In other words, the structured context corresponding to each step includes: a description of the purpose of the current step; the parameterized unit type, structure template, and example script identified by the type recognition agent; historical script fragments and brief descriptions associated with the current step; and optional process rules or API description text.
[0091] The script generation agent is used to generate parameterized unit scripts (i.e., PCell scripts). In this embodiment, the script generation agent includes at least a first script generation agent and a second script generation agent. Since the processing procedures for generating the script are different from those for modifying the script, to improve processing accuracy, the first script generation agent can be used to process the generation-type steps to generate parameterized unit script fragments, and the second script generation agent can be used to process the repair-type steps to correct the previously generated parameterized unit scripts. For example, refer to... Figure 6 and Figure 7For generation-type steps, a structured context corresponding to the step is obtained through a context management agent, such as the step purpose, structure template, and historical fragments (e.g., example scripts). This structured context is then input into a first script generation agent, which generates parameterized unit script fragments and writes these fragments into the step history information corresponding to the step. For repair-type steps, a structured context corresponding to the step is obtained through a context management agent, such as the script to be repaired and runtime error information. This structured context is then input into a second script generation agent, which incrementally modifies the script fragments (i.e.,...) Figure 7 (The code snippet in the code) is used to update the step history information corresponding to that step (for example, to overwrite old code in the step history).
[0092] Specifically, after retrieving a task object from the task queue, the task object is input into a type recognition agent. The type recognition agent extracts key query parameters from the parameterized unit query information included in the task object. These key query parameters are matched against the indices of each template in a preset template set to obtain the parameterized unit type that matches the key query parameters. A target template matching the parameterized unit type is then retrieved from the preset template set; this target template includes a structure template and an example script. Next, a strategy planning agent is invoked, inputting the task object and the loaded target template. This agent outputs a structured execution plan, which includes at least one step. Each step has a corresponding step number, step name, step purpose description, and step type. A verification step is included in the execution plan. This verification step can correspond to a specific step and be used to verify the script fragment generated by that step. Alternatively, it can summarize and verify all script fragments generated before that step. Therefore, when the verification step is executed, the corresponding script fragment to be verified is retrieved, and a corresponding run request is generated based on this script fragment. The code interpreter and execution agent is invoked. This agent submits the execution request to the connected parameterized unit interpretation / verification tool, which then loads and runs the script fragment to be verified, obtaining the corresponding execution result. This result includes at least whether the script executed successfully, whether it passed the built-in verification in the current environment, the error message text and location in case of failure, etc. Afterwards, the code interpreter and execution agent organizes these results to obtain a standardized execution result. For example... Figure 8As shown, if the execution result of the current step is successful, it means that the script fragment generated or repaired in the current step meets the tool-level requirements under the existing context. The step is marked as successful, and the step pointer is advanced to the next step to continue execution. If the execution result of the current step is a failure, the execution error message returned by the parameterized unit interpretation / verification tool and the relevant context are recorded in the step history. In subsequent "repair-type steps", the error information is used as one of the inputs. The context management agent constructs a repair context, which is then handed over to the second script generation agent to make local incremental adjustments to the existing code under the constraints of the context. This forms a multi-round closed loop of "generation-interpretation-repair" together with the tool-level interpretation and execution.
[0093] like Figure 8 As shown, when all the key verification steps preset in the execution plan have been successfully completed, the task status is marked as successful. The final parameterized unit script corresponding to this task object and the corresponding step history are summarized, and certain execution statistics (such as the number of generation / repair attempts, major errors and repair summaries, etc.) can be extracted based on the step history to obtain the response information.
[0094] The server then returns the above response information to the terminal via an interface. The terminal can import the output final parameterized unit script into the PDK system, write it into the internal version control library, or display the execution process and key information on the interface. In other implementations, it can also be integrated into the CI / CD process as a service, with the pipeline script automatically calling the interface to trigger tasks and consume the results.
[0095] If the critical verification steps cannot be passed within the preset maximum number of retries, the task will be marked as failed. However, the complete execution trajectory, including each round of generation, interpretation, and repair, will still be saved on the server side in the form of logs or result files, providing a data foundation for subsequent statistical analysis and solution adjustments.
[0096] In this embodiment, the well-defined logical links can greatly improve the structural integrity and logical correctness of the generated code, and solve the problems of loose logic and context breakage that are easy to occur when directly using large models to generate complex code.
[0097] In one exemplary embodiment, such as Figure 9 As shown, the server determines whether the current solution can solve the problem based on historical task execution data in the background. If it cannot solve the problem, it calls the inference model to generate a new solution and replace the original solution, so that the system exhibits the self-evolutionary characteristic of "getting better with use" in long-term operation.
[0098] Specifically, after each task is completed (whether successful or not), the execution process of the task is saved in the form of a structured log, which includes, but is not limited to: 1) basic task information, such as PCell type, task type (generate or repair), and input natural language description; 2) key error information, such as error messages returned by the tool, error location, and error type after simple classification; 3) the current solution identifier used in this task, such as repair prompts, planning schemes, or context configuration methods corresponding to a certain type of error; 4) execution result information, including whether the repair was ultimately successful, the number of attempts, and whether manual intervention was required.
[0099] For recurring typical error types, maintain a corresponding "current solution," which can be understood as a default set of repair strategies or prompt configurations for that error type. The initial solution can be set by developers based on experience, and then updated in subsequent tasks based on actual results. The specific process is as follows: Figure 10 As shown.
[0100] When a task triggers a specific error type during execution, the system first checks if a solution already exists for that error type.
[0101] 1) If a solution already exists, drive one or more "generate-interpret-repair" closed loops based on that solution (corresponding to the above update of the parameterized unit script based on the current solution, obtaining the update running result corresponding to the updated parameterized unit script; if the update running result still corresponds to running error, continue to generate the target solution, correct the parameterized unit script after the last update based on the target solution, until the running result corresponding to the corrected parameterized unit script corresponds to running success).
[0102] 2) If there is no solution yet, proceed directly to the inference model solution stage.
[0103] After completing one closed-loop iteration according to the current solution, the system determines whether the problem has been resolved based on the results of the tool-level interpreted execution:
[0104] 1) If the error is successfully eliminated within the preset number of retries (i.e. the script passes the verification), the current solution is considered effective for this error type, and only one successful sample needs to be recorded in the log for subsequent statistics.
[0105] 2) If the error cannot be resolved within the preset number of retries, the current solution is considered insufficient to handle the current scenario under this error type.
[0106] For problems that cannot be solved, the system invokes the inference model (e.g., through code generation and modification processes involving multi-agent collaboration) to attempt to generate new solutions.
[0107] 1) Based on the error log, the current script, and historical attempts, the inference model provides new repair ideas or new configuration methods to form candidate solutions;
[0108] 2) The system drives the "generate-interpret-repair" closed loop again according to the candidate solution, and observes whether it successfully passes the tool-level verification.
[0109] like Figure 11 As shown, if a candidate solution successfully resolves the error, the system registers it as the "new current solution" for that error type, overwriting the original solution, and records the evolution process of "old solution failing, new solution taking effect" in the log. When encountering the same error type subsequently, the updated solution will be used first, reducing the overhead of calling the inference model again. If the candidate solution still cannot resolve the problem, the system records the error and all attempts as an "unresolved case" for developers to analyze offline and manually design new solutions. Once a new solution is verified to be effective, it can also be configured and written into the system to replace the original solution.
[0110] Through the above steps, by introducing a self-evolving mechanism into the Rule Manager, the system no longer rigidly uses fixed prompts. Instead, it can dynamically retrieve or generate targeted repair rules (such as API usage corrections, geometric attribute access security rules, etc.) based on runtime error information, and feed these rules back into the generation process, thus achieving dynamic optimization of the prompt strategy. Figure 1As shown, in a benchmark test containing 55 typical PCell development tasks, relying solely on static prompt engineering, this invention improved the accuracy of PCell code generation from 36.36% to 78.55%. However, by introducing a self-evolving prompting mechanism and dynamically adjusting strategies based on past task failures, this invention significantly improved the final pass rate of code generation from 78.55% with static prompt engineering to 98.18%. This effect demonstrates the system's ability to handle complex geometry generation that is difficult to solve with existing technologies, achieving highly reliable automated generation of PCell code under industrial standards. Secondly, the system possesses the "trial and error-learning" capabilities of human engineers. By capturing interpreter error messages, using LLM to analyze the root causes of errors and generate specific rules, the system can avoid similar errors in subsequent attempts, significantly reducing the need for manual debugging. Compared to using static prompt engineering, the dynamic rule generation mechanism of this invention improved the repair rate for complex geometry errors from 21.43% to 66.96%. The system can automatically learn the implicit rule of "acquiring attributes first and then performing calculations." For context variable loss errors, the repair rate improved from 45.45% to 72.73%. The system can automatically generate persistence rules that force variable passing, effectively solving the parameter "forgetting" problem in long code logic. Furthermore, in complex PCell repair tasks, historical dialogues are often extremely lengthy. This application introduces an intelligent context engineering strategy through a context manager, which does not mechanically retain all historical records but cleans and prunes the input information, removing irrelevant intermediate error codes and redundant API documentation, retaining only the information necessary for the current step, significantly reducing the average number of input tokens, lowering inference costs, and improving response speed. Simultaneously, addressing the "Lost-in-the-Middle" phenomenon in large models, this invention strategically restructures the Prompt structure, placing key error stack information and core process constraints at the beginning or end of the Prompt, ensuring that the model always focuses on the critical error to be resolved when processing complex repair tasks involving multiple historical steps. This allows the system to maintain logical coherence and the effectiveness of repairs even after going through multiple rounds of "generate-interpret-repair" cycles.
[0111] It should be understood that although the steps in the flowcharts of the above embodiments 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 above embodiments 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.
[0112] Based on the same inventive concept, this application also provides a parameterized unit script generation apparatus for implementing the parameterized unit script generation method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more parameterized unit script generation apparatus embodiments provided below can be found in the limitations of the parameterized unit script generation method described above, and will not be repeated here.
[0113] In one exemplary embodiment, such as Figure 12 As shown, a parameterized unit script generation apparatus 1200 is provided, including: an acquisition module 1201, a solution module 1202, a correction module 1203, and a response module 1204, wherein:
[0114] The acquisition module 1201 is used to acquire parameterized unit query information; generate parameterized unit scripts based on the parameterized unit query information; and run the parameterized unit scripts to obtain the running results.
[0115] Solution module 1202 is used to obtain running error information from the running result if the running result corresponds to a running error, determine the current solution from the solution set corresponding to the running error information, update the parameterized unit script based on the current solution, and obtain the updated running result corresponding to the updated parameterized unit script.
[0116] The correction module 1203 is used to obtain updated running error information from the updated running result if the updated running result corresponds to a running error, determine the error change trend corresponding to the updated running error information based on the running error information, generate a target solution based on the current solution and the error change trend, correct the parameterized unit script based on the target solution, and run the corrected parameterized unit script to obtain the corrected running result.
[0117] The response module 1204 is used to add the target solution to the solution set corresponding to the running error information if the corrected running result corresponds to running success, and to generate parameterized unit response information corresponding to the parameterized unit question information based on the corrected parameterized unit script.
[0118] In some embodiments, in determining the error change trend corresponding to the updated runtime error information based on runtime error information, and generating a target solution based on the current solution and the error change trend, the correction module 1203 is specifically used to: extract a first error feature and a second error feature from the runtime error information and the updated runtime error information respectively using a first network in the repair agent; calculate the difference feature between the first error feature and the second error feature; determine the target type of the error change trend corresponding to the difference feature; the target type is used to characterize the state transition direction of the error in different dimensions; input the target type into the second network in the repair agent to generate a target repair scheme matching the target type; obtain the modified code segment and the modification method corresponding to the modified code segment based on the target repair scheme; locate the target code segment matching the modified code segment in the current solution, modify it according to the modification method, and obtain the target solution.
[0119] In some embodiments, in generating a target repair scheme that matches the target type by inputting the target type into the second network of the repair agent, the correction module 1203 is specifically used to: match each label in the repair scheme database with the target type to obtain a target label that matches the target type; process the repair schemes that match the target label in the repair scheme database based on the error change trend to obtain a target repair scheme that matches the target type; and / or generate target prompt words based on the error change trend, the target type, and the current solution; input the target prompt words into the neural network model to obtain the target repair scheme through the neural network model.
[0120] In some embodiments, in generating parameterized unit scripts based on parameterized unit question information, the acquisition module 1201 is specifically used for: invoking a type recognition agent to extract key question parameters from the parameterized unit question information; matching the key question parameters with the index corresponding to each template in a preset template set to obtain the parameterized unit type matching the key question parameters; obtaining a target template matching the parameterized unit type from the preset template set; obtaining a structure template and example script matching the parameterized unit question information from the target template; invoking a strategy planning agent to parse the structure template and parameterized unit question information to obtain the corresponding execution plan; invoking a context management agent to generate the corresponding structured context according to the execution plan; and invoking a script generation agent to input the structured context into the large language model to generate the parameterized unit script.
[0121] In some embodiments, in generating a corresponding structured context according to the execution plan by the context management agent, the acquisition module 1201 is specifically used to: acquire each execution step in the execution plan; for each execution step, determine the step type corresponding to the execution step; if the step type corresponds to a repair type, acquire the historical script fragment corresponding to the execution step and the historical error information corresponding to the historical script fragment; and construct a structured context based on the historical script fragment and the historical error information.
[0122] In some embodiments, the parameterized unit script generation device 1200 is further configured to: if the correction execution result fails, obtain the corresponding correction execution error information, obtain relevant context information based on the parameterized unit query information, the target solution, the current solution, and the correction execution error information; regenerate the parameterized unit script based on the relevant context information to obtain an updated parameterized unit script; and run the updated parameterized unit script to update the correction execution result.
[0123] Each module in the aforementioned parameterized unit script generation 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 memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0124] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 13As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores templates, example scripts, and other data related to parameterized units, used for generating parameterized unit scripts. The I / O interfaces allow the processor to exchange information with external devices. The communication interface allows communication with external terminals via a network connection. The computer program is executed by the processor to implement a method for generating parameterized unit scripts.
[0125] Those skilled in the art will understand that Figure 13 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.
[0126] In one exemplary 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.
[0127] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program being executed by a processor to implement the steps in the above method embodiments.
[0128] In one embodiment, a computer program product is provided, including a computer program that, when run by a processor, implements the steps in the above method embodiments.
[0129] 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, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0130] 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, and when running, it 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 memory 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, artificial intelligence (AI) processors, etc., and are not limited to these.
[0131] 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 application.
[0132] 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 method for generating parameterized unit scripts, characterized in that, The method includes: Obtain parameterized unit query information; generate parameterized unit script based on the parameterized unit query information; run the parameterized unit script and obtain the running result; If the running result corresponds to a running error, the running error information is obtained from the running result, and the current solution is determined from the solution set corresponding to the running error information; the parameterized unit script is updated based on the current solution to obtain the updated running result corresponding to the updated parameterized unit script; If the update execution result corresponds to an execution error, obtain the update execution error information from the update execution result, determine the error change trend corresponding to the update execution error information based on the execution error information, generate a target solution based on the current solution and the error change trend, correct the parameterized unit script based on the target solution, and run the corrected parameterized unit script to obtain the corrected execution result; If the corrected execution result corresponds to a successful execution, the target solution is added to the solution set corresponding to the execution error information, and parameterized unit answer information corresponding to the parameterized unit question information is generated based on the corrected parameterized unit script.
2. The method according to claim 1, characterized in that, The step of determining the error change trend corresponding to the updated runtime error information based on the runtime error information, and generating a target solution based on the current solution and the error change trend, includes: The first network in the repair agent is used to extract a first error feature and a second error feature from the runtime error information and the updated runtime error information, respectively; the difference feature between the first error feature and the second error feature is calculated; the target type of the error change trend corresponding to the difference feature is determined; the target type is used to characterize the state transition direction of the error in different dimensions. The target type is input into the second network in the repair agent to generate a target repair scheme that matches the target type. Based on the target repair scheme, obtain the modified code segment and the modification method corresponding to the modified code segment; locate the target code segment that matches the modified code segment in the current solution, modify it according to the modification method, and obtain the target solution.
3. The method according to claim 2, characterized in that, The step of inputting the target type into the second network of the repair agent to generate a target repair scheme matching the target type includes: Match each tag in the repair scheme database with the target type to obtain target tags that match the target type; process the repair schemes that match the target tags in the repair scheme database based on the error change trend to obtain the target repair scheme that matches the target type; and / or Based on the error change trend, the target type, and the current solution, target prompt words are generated; the target prompt words are input into a neural network model, and the target repair solution is obtained through the neural network model.
4. The method according to claim 1, characterized in that, The step of generating a parameterized unit script based on the parameterized unit query information includes: A type recognition agent is invoked to extract key question parameters from the parameterized unit question information. The key question parameters are then matched with the index corresponding to each template in a preset template set to obtain the parameterized unit type that matches the key question parameters. A target template that matches the parameterized unit type is then obtained from the preset template set. Finally, a structure template and example script that match the parameterized unit question information are obtained from the target template. The strategy planning agent is invoked, and the strategy planning agent parses the query information of the structure template and the parameterized unit to obtain the corresponding execution plan; Invoke the context management agent, and generate the corresponding structured context according to the execution plan through the context management agent; A script is invoked to generate an intelligent agent, which then inputs the structured context into the large language model to generate the parameterized unit script.
5. The method according to claim 4, characterized in that, The generation of the corresponding structured context by the context management agent according to the execution plan includes: Obtain each execution step in the execution plan; For each execution step, determine the step type corresponding to that execution step; If the step type corresponds to the repair type, then obtain the historical script fragment corresponding to the execution step and the historical error information corresponding to the historical script fragment; construct the structured context based on the historical script fragment and the historical error information.
6. The method according to claim 1, characterized in that, The method further includes: If the corrective execution result fails, the corresponding corrective execution error information is obtained. Based on the parameterized unit query information, the target solution, the current solution, and the corrective execution error information, relevant context information is obtained. Based on the relevant context information, the parameterized unit script is regenerated to obtain the updated parameterized unit script. The updated parameterized unit script is run to update the corrective execution result.
7. A device for generating parameterized unit scripts, characterized in that, The device includes: The acquisition module is used to acquire parameterized unit query information; generate parameterized unit scripts based on the parameterized unit query information; and run the parameterized unit scripts to obtain the running results. The solution module is used to, if the running result corresponds to a running error, obtain running error information from the running result, determine the current solution from the solution set corresponding to the running error information, and update the parameterized unit script based on the current solution to obtain the updated running result corresponding to the updated parameterized unit script; The correction module is used to: if the update execution result corresponds to an execution error, obtain update execution error information from the update execution result; determine the error change trend corresponding to the update execution error information based on the execution error information; generate a target solution based on the current solution and the error change trend; correct the parameterized unit script based on the target solution; and run the corrected parameterized unit script to obtain the corrected execution result. The answer module is used to add the target solution to the solution set corresponding to the running error information if the corrected running result corresponds to running success, and to generate parameterized unit answer information corresponding to the parameterized unit question information based on the corrected parameterized unit script.
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, The computer program is executed by a processor to implement 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, The computer program is executed by a processor to implement the steps of the method according to any one of claims 1 to 6.