Method, apparatus, device, and medium for generating function block for engineering tool

By using a pattern-based and AI-based code generation approach, the method addresses the challenges of creating customized function blocks, ensuring accurate and compliant code generation for engineering tools, enhancing automation engineer efficiency.

WO2026044727A1PCT designated stage Publication Date: 2026-03-05SIEMENS AG +1
View PDF 6 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2026-03-05

AI Technical Summary

Technical Problem

Automation engineers face challenges in creating customized function blocks for engineering tools due to steep learning curves, limited programming skills, and difficulties in testing and verifying control algorithms, while existing generative AI systems struggle to understand complex interfaces and constraints of function blocks used in real-time control environments.

Method used

A method involving a pattern-based code generator and an AI-based code generator is employed to generate function blocks by feeding a semi-finished code into a generative AI model, using input and output port descriptions to improve accuracy and compliance with engineering tool disciplines.

Benefits of technology

The method enables the generation of function blocks that can be successfully compiled and validated, meeting user requirements accurately, thereby simplifying the creation and testing process for automation engineers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024116047_05032026_PF_FP_ABST
    Figure CN2024116047_05032026_PF_FP_ABST
Patent Text Reader

Abstract

The implementations of the present disclosure relate to a method, apparatus, electric device, and computer readable storage medium for generating a function block for an engineering tool. The method comprises obtaining a description of the function block, information of an input port, and information of an output port. The method further comprises generating, by a pattern-based code generator, a first code of the function block based on the description of the function block, the information of the input port, and the information of the output port. The method further comprises generating, by an artificial intelligence (AI) -based code generator, a second code of the function block by feeding the first code as a prompt into a generative AI model. Furthermore, the method further comprises generating the function block based on the second code. In this way, the accuracy of the generated code of the function block can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

METHOD, APPARATUS, DEVICE, AND MEDIUM FOR GENERATING FUNCTION BLOCK FOR ENGINEERING TOOLField

[0001] The present disclosure relates to automation system, and more specifically relates to a method, apparatus, device, and medium for generating a function block for an engineering tool.BACKGROUND

[0002] Control logic is one of the most important components of modern automation systems. The control logic defines the logic and algorithms governing the controlled process. In most cases, the control logic is written in International Electro-technical Commission (IEC) -61131-3 languages, such as Structured Text (ST) , Sequential Function Chart (SFC) , Continuous Function Chart (CFC) , Function Block Diagram (FBD) , and Ladder Diagram (LD) .

[0003] A function block is a fundamental concept in control systems and automation, which is commonly used in industrial automation systems. A function block encapsulates a specific functionality that can be reused across different parts of a control program. A function block consists of input ports, output ports, and a set of instructions that describe how the inputs are processed to produce the outputs.SUMMARY

[0004] In a first aspect of the present disclosure, a method for generating a function block for an engineering tool is provided. The method comprises obtaining a description of the function block, information of an input port, and information of an output port. The method further comprises generating, by a pattern-based code generator, a first code of the function block based on the description of the function block, the information of the input port, and the information of the output port. The method further comprises generating, by an artificial intelligence (AI) -based code generator, a second code of the function block by  feeding the first code as a prompt into a generative AI model. Furthermore, the method further comprises generating the function block based on the second code. In this way, the second code of the function block can be compiled successfully by the engineering tool because it conforms to the disciplines of the engineering tool. Furthermore, by providing the first code as a prompt for the generative AI model, the accuracy of the second code of the function block can be improved, thereby meeting the requirements of the user more accurately.

[0005] In conjunction with the first aspect, in some implementations, the information of the input port comprises a name of the input port and a data type of the input port, and the information of the output port comprises a name of the output port and a data type of the output port. In this way, the AI-based code generator can generate the code of the function block based on the variables corresponding to the input ports and the output ports, thereby the accuracy and usability of the code generated by the generative AI model can be improved.

[0006] In conjunction with the first aspect, in some implementations, the information of the input port further comprises a description of the input port, and the information of the output port further comprises a description of the output port. In this way, the AI-based code generator can understand these variables better, thereby the accuracy and usability of the code generated by the generative AI model can be improved.

[0007] In conjunction with the first aspect, in some implementations, the method may further comprise generating a comment for the function block based on the description of the function block, the information of the input port, and the information of the output port. The method may further comprise generating a target function based on the description of the function block, the information of the input port, and the information of the output port. The method may further comprise generating the first code of the function block based on the comment for the function block and the target function. In this way, the AI-based code generator can understand the purpose of the function block better, and generate the algorithm into the target function.

[0008] In conjunction with the first aspect, in some implementations, the method may further comprise generating a formatted comment for the input port based on the information of the input port. The method may further comprise generating a formatted  comment for the output port based on the information of the output port. The method may further comprise generating the comment for the function block by merging the description of the function block, the formatted comment for the input port, and the formatted comment for the output port. In this way, the comment can help the AI-based code generator understand the purpose and usage of different parts of the first code.

[0009] In conjunction with the first aspect, in some implementations, the method may further comprise generating a function signature of the target function in the initial code, the function signature comprising an interface data object. The method may further comprise generating a first local variable for the input port in the target function based on the information of the input port and the interface data object. The method may further comprise generating a second local variable for the output port in the target function based on the information of the output port and the interface data object. The method may further comprise generating a finishing statement in the target function for setting a value of the second local variable for the output port back to the interface data object. In this way, the AI-based code generator can generate the algorithm according to the local variables and the finishing statement.

[0010] In conjunction with the first aspect, in some implementations, the method may further comprise generating a comment for the first local variable in the target function based on the information of the input port. The method may further comprise generating a comment for the second local variable in the target function based on the information of the output port. The method may further comprise generating a comment for the finishing statement to describe an effect of the finishing statement in the target function. In this way, these comments can help the AI-based code generator understand the local variables and the finishing statement better.

[0011] In conjunction with the first aspect, in some implementations, the method may further comprise generating an infill tag indicating a location of an algorithm to be generated by the generative AI model, where a location of the infill tag is after the first local variable for the input port and the second local variable for the output port and before the finishing statement. In this way, the AI-based code generator can more clearly understand the location of the generated algorithm.

[0012] In conjunction with the first aspect, in some implementations, in the second code of the function block, the infill tag is replaced with the algorithm for the function block generated by the generative AI model, and an effect of the algorithm satisfies the description of the function block. In this way, the second code can be compile successfully, and the generated function can meets the need of the user.

[0013] In conjunction with the first aspect, in some implementations, the method may further comprise generating a WebAssembly of the function block based on the second code. The method may further comprise, in response to generating the WebAssembly of the function block, loading the WebAssembly of the function block into a browser frontend for validation of the function block. In this way, the computing device may compile the function block code into a WebAssembly and run the WebAssembly directly in the engineering tool. Therefore, the user can easily set up different scenarios for the function block to run, making it easy to test and validate the behavior of the function block.

[0014] In a second aspect of the present disclosure, an apparatus for generating a function block for an engineering tool is provided. The apparatus comprises a description obtaining module, configured to obtain a description of the function block, information of an input port, and information of an output port. The apparatus further comprises a first code generation module, configured to generate, by a pattern-based code generator, a first code of the function block based on the description of the function block, the information of the input port, and the information of the output port. The apparatus further comprises a second code generation module, configured to generate, by an artificial intelligence (AI) -based code generator, a second code of the function block by feeding the first code as a prompt into a generative AI model. Furthermore, the apparatus further comprises a function block generation module, configured to generate the function block based on the second code.

[0015] In a third aspect of the present disclosure, an electric device is provided. The device comprises one or more processors. The device further comprises a memory storing computer-executable instructions, and the computer-executable instructions, when executed by the one or more processors, cause the device to implement the method according to the first aspect.

[0016] In a fourth aspect of the present disclosure, a computer readable storage medium is provided. The computer readable storage medium stores computer-executable instructions,  and the computer-executable instructions, when executed by a processor, implement the method according to the first aspect.

[0017] The Summary is provided to introduce selection for concepts in a simplified form, and the concepts will be further described below in the Detailed Description. The Summary is not intended to identify key features or essential features of the present disclosure, nor is it intended to limit the scope of the present disclosure.BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Implementations of the present disclosure may be understood from the following Detailed Description when read with the accompanying figures. In accordance with the standard practice in the industry, various features are not drawn to scale. In fact, the dimensions of the various features may be arbitrarily increased or reduced for clarity of discussion. Some examples of the present disclosure are described with reference to the following figures.

[0019] FIG. 1 illustrates an example environment in which example implementations of the present disclosure may be implemented;

[0020] FIG. 2 is a flow chart illustrating an example process of generating a function block for an engineering tool according to some implementations of the present disclosure;

[0021] FIG. 3 is a schematic diagram illustrating an example of information for generating a function block provided by a user according to some implementations of the present disclosure;

[0022] FIG. 4 is a schematic diagram illustrating an example semi-finished code generated by the pattern-based code generator according to some implementations of the present disclosure;

[0023] FIG. 5 is a schematic diagram illustrating an example finished code generated by the AI-based code generator according to some implementations of the present disclosure;

[0024] FIG. 6 is a schematic diagram illustrating an example of generating a WebAssembly of the function block for validation and loading the generated WebAssembly into a browser frontend according to some implementations of the present disclosure;

[0025] FIG. 7 is a schematic diagram illustrating an example of validating the function block according to some implementations of the present disclosure;

[0026] FIG. 8 is a schematic diagram illustrating an example apparatus for generating a function block for an engineering tool according to some implementations of the present disclosure; and

[0027] Fig. 9 shows a schematic block diagram of an example device 900 of an implementation that may be used to implement the content of the present disclosure.

[0028] Reference numeral list:

[0029] 100: environment

[0030] 102: computing device

[0031] 104: pattern-based code generator

[0032] 106: AI-based code generator

[0033] 110: function block

[0034] 112-1: input port

[0035] 112-2: input port

[0036] 112-N: input port

[0037] 114-1: output port

[0038] 114-2: output port

[0039] 114-N: output port

[0040] 120: description

[0041] 122: information

[0042] 124: information

[0043] 126: semi-finished code

[0044] 128: finished code

[0045] 202: obtain a description of the function block, information of an input port, and information of an output port

[0046] 204: generate, by a pattern-based code generator, a first code of the function block based on the description of the function block, the information of the input port, and the information of the output port

[0047] 206: generate, by an artificial intelligence (AI) -based code generator, a second code of the function block by feeding the first code as a prompt into a generative AI model

[0048] 208: generate the function block based on the second code

[0049] 300: example

[0050] 310: function block

[0051] 312-1: input port

[0052] 312-2: input port

[0053] 312-N: input port

[0054] 314-1: output port

[0055] 314-2: output port

[0056] 314-N: output port

[0057] 320: description

[0058] 322: information

[0059] 324: information

[0060] 332: name

[0061] 334: data type

[0062] 336: description

[0063] 342: name

[0064] 344: data type

[0065] 346: description

[0066] 400: semi-finished code

[0067] 402: header files

[0068] 404: comment

[0069] 406: description

[0070] 408: comment

[0071] 410: comment

[0072] 412: target function

[0073] 414: function signature

[0074] 416: local variables

[0075] 418: local variables

[0076] 420: infill tag

[0077] 422: finishing statement

[0078] 500: finished code

[0079] 502: header files

[0080] 504: comment

[0081] 506: description

[0082] 508: comment

[0083] 510: comment

[0084] 512: target function

[0085] 514: function signature

[0086] 516: local variables

[0087] 518: local variables

[0088] 520: generated algorithm

[0089] 522: finishing statement

[0090] 600: example

[0091] 602: finished code

[0092] 604: WebAssembly builder

[0093] 606: WebAssembly binary file

[0094] 608: browser frontend

[0095] 610: function block

[0096] 612: input port

[0097] 614: input port

[0098] 616: output port

[0099] 618: function block

[0100] 620: input port

[0101] 622: input port

[0102] 624: output port

[0103] 700: example

[0104] 702: browser frontend

[0105] 712: input field

[0106] 714: input field

[0107] 716: output field

[0108] 800: apparatus

[0109] 802: description obtaining module

[0110] 804: first code generation module

[0111] 806: second code generation module

[0112] 808: function block generation module

[0113] 900: device

[0114] 901: CPU

[0115] 902: ROM

[0116] 903: RAM

[0117] 904: bus

[0118] 905: I / O interface

[0119] 906: input unit

[0120] 907: output unit

[0121] 908: storage unit

[0122] 909: communication unitDETAILED DESCRIPTION

[0123] The principles of the present disclosure will be described below with reference to several example implementations illustrated in the accompanying drawings. Although the preferred implementations of the present disclosure are shown in the drawings, it should be understood that these implementations are only described to enable those skilled in the art to better understand and implement the present disclosure, but not to limit the scope of the present disclosure in any way.

[0124] The term “comprising” and its variants used herein represent open inclusion, i.e., “including but not limited to” . The term “or” means “and / or” unless otherwise stated. The term “based on” means “based at least in part on” . The terms “one example implementation” and “one implementation” mean “at least one example implementation. ” The term “another implementation” means “at least one further implementation” . Other definitions, both express and implied, may also be included below. Some example implementations of the present disclosure are described below with reference to FIGS. 1-9.

[0125] Control logic is usually designed by automation engineers who have a strong understanding of both control theory and the target process but limited programming experience. Consequently, automation system vendors provide a variety of encapsulated function blocks along with their engineering tools (e.g., TIA Portal or PCS 7 / neo) . With these function blocks, automation engineers can implement control logic simply by connecting different blocks together.

[0126] However, this approach requires automation engineers to be very familiar with the function blocks provided by their engineering tools. The learning curve can be steep, as it involves thoroughly reading and understanding the documentation of the function blocks. Additionally, to meet the needs of most users, these function blocks often include features or use cases that may not be beneficial for specific applications. For engineering tool providers, on the other hand, it is challenging to customize function block libraries for thousands of different users. Managing the requirements and implementation of these function blocks is already a labor-intensive task.

[0127] To address this problem, some control logic engineering tools offer programming Application Programming Interfaces (APIs) that allow engineers to build their own function blocks. However, with limited programming skills, it can be challenging for automation  engineers to write control algorithms in languages like C / C++. Furthermore, testing and verifying the function blocks they create is even more difficult.

[0128] In recent years, the industry has seen significant progress in generative artificial intelligence (AI) . One of the remarkable capabilities of generative AI is its ability to write code. However, several obstacles need to be overcome before the generative AI can assist automation engineers in composing the code for function blocks. For example, function blocks are used in control charts that are executed in real-time environments (e.g., a programmable logic controller runtime) . As part of a real-time program, certain disciplines must be followed. Generative AI needs to understand and conform to these constraints. Furthermore, compared to functions in traditional software, function blocks used in control charts typically have more complex interfaces, e.g., with more than 10 input and output ports. Providing such complex interface information to the generative AI and making the generative AI understand these information are significant challenges.

[0129] Therefore, the implementations of the present disclosure provide a scheme for generating a function block for an engineering tool. In this scheme, a computing device may obtain a description of the function block, information of an input port, and information of an output port. Then, a pattern-based code generator deployed on the computing device may generate a semi-finished code (also referred to as a first code herein) of the function block based on the description of the function block, the information of the input port, and the information of the output port. Then, an AI-based code generator deployed on the computing device may generate a finished code (also referred to as a second code herein) of the function block by feeding the semi-finished code as a prompt into a generative AI model. In addition, the computing device may generate the function block based on the finished code.

[0130] In this way, the patter-based code generator can generate a framework of the code of the function block. The framework can conform the disciplines of the development environment of the engineering tool. Furthermore, variables corresponding to the input ports and the output ports can be clearly defined in the framework. Then, the generative AI model can understand the effect of the function block and the definitions of the input ports and the output ports through the framework, and generate a code of the function block based on the framework. Therefore, the generated code of the function block can be compiled  successfully by the engineering tool. Furthermore, the accuracy of the generated code of the function block can be improved, thereby meeting the requirements of the user more accurately.

[0131] FIG. 1 illustrates an example environment 100 in which example implementations of the present disclosure may be implemented. As shown in FIG. 1, the environment 100 includes a computing device 102. The computing device 102 may include a pattern-based code generator 104 and an AI-based code generator 106. The computing device 102 may be any device with computing capability. For example, the computing device 102 may include, but are not limited to, personal computers, server computers, handheld or laptop devices, mobile devices (such as mobile phones, personal digital assistants (PDAs) , media players, etc. ) , multiprocessor systems, consumer electronics, computer wearable electronic devices, smart home devices, minicomputers, mainframe computers, edge computing devices, distributed computing environments including any of the above systems or devices, etc.

[0132] As shown in FIG. 1, in the environment 100, a user (e.g., an automation engineer) may want to design a custom function block 110. The function block 110 may include one or more input ports (e.g., input ports 112-1, 112-2, …, and 112-N, also collectively referred to as input ports 112) and one or more output ports (e.g., output ports 114-1, 114-2, …, and 114-N, also collectively referred to as output ports 114) . In a control process, the function block 110 may receive input data through the input ports 112. The input data may be processed by a predefined algorithm within the function block 110. Then, the function block 110 may generate output data, and the output data may be transmitted to other function blocks through the output ports 114.

[0133] In order to generate the function block 110 through an engineering tool, the user may start with an empty function clock in the engineering tool. Then, the user may provide a description 120 of the function block 110, where the description 120 may describe a goal or an effect of the function block 110. For example, the description 120 may be “Output a sum of all input float numbers. ” Then, the user may add the input ports 112 and the output ports 114 to the function block 110. Furthermore, the user may provide information 122 of the input ports 112 and information 124 of the output ports 114 through the engineering tool. In some implementations, the information 122 of the input ports 112 may include a name and a data type of each of the input ports 112, and the information 124 of the output ports 114  may include a name and a data type of each of the output ports 114. For example, a name of the input port 112-1 may be “IN1” , a data type of the input port 112-1 may be float, a name of the input port 112-2 may be “IN2” , and a data type of the input port 112-2 may be float as well. Furthermore, a name of the output port 114-1 may be “OUT” , and a data type of the output port 114-1 may be float.

[0134] As shown in FIG. 1, the computing device 102 may obtain the description 120 of the function block 110, the information 122 of the input ports 112, and the information 124 of the output ports 114, and feed these information into the pattern-based code generator 104. The pattern-based code generator 104 may be configured with a predefined pattern (or template) of a function block. The pattern may be determined based on disciplines to which a function block should conform. For example, the disciplines may include header files should be included in a code of the function block, a format of an argument of a function in the code of the function block, and a return type of the function in the code of the function block, etc. Therefore, the pattern-based code generator 104 may generate, based on the description 120 of the function block 110, the information 122 of the input ports 112, and the information 124 of the output ports 114, a semi-finished code 126 by following the predefined pattern.

[0135] In the semi-finished code 126, a code framework of the function block 110 may be generated. For example, the code framework may include references of required header files, a comment describing the effect of the function block 110, the input ports 112, and the output ports 114, and a target function implementing the effect of the function block 110. In the semi-finished code 126, variables corresponding to the input ports 112 and the output ports 114 may be generated. However, the algorithm part of the target function may be missed.

[0136] In the environment 100, the generated semi-finished code 126 may be input into the AI-based code generator 106. The AI-based code generator 106 may include a generative AI model. The generative AI model is AI model designed to generate new, original content based on the data it has learned during training. Unlike discriminative models, which classify input data into predefined categories, the generative AI model aims to create new data that resembles the training data. In the environment 100, the generative AI model may be trained to generate programming code. For example, the generative AI model may be a  large language model (LLM) fine-tuned for programming tasks. The generative AI model may understand the context provided by a prompt or a partially written code.

[0137] In the environment 100, the semi-finished code 126 may be fed into the generative AI model in the AI-based code generator as a prompt. Then, the generative AI model may generate a finished code 128. In the finished code 128, the algorithm part in the target function may be completed. Therefore, the computing device 102 may generate the function block 110 based on the finished code 128. For example, the computing device 102 may compile the finished code 128 to obtain a binary file of the function block 110, and load the binary file into the engineering tool.

[0138] In this way, the finished code 128 of the function block 110 can be compiled successfully by the engineering tool because it conforms to the disciplines of the engineering tool. Furthermore, by providing the semi-finished code 126, which includes description of the function block 110 and definitions of input variables and output variables, as a prompt for the generative AI model, the accuracy of the finished code 128 of the function block 110 can be improved, thereby meeting the requirements of the user more accurately.

[0139] FIG. 2 is a flow chart illustrating an example method 200 of generating a function block for an engineering tool according to some implementations of the present disclosure. The method 200 may be implemented by a computing device, for example, the computing device 102 in FIG. 1. At block 202, the computing device may obtain a description of the function block, information of an input port, and information of an output port. For example, as shown in FIG. 1, a user is designing the function block 110 through an engineering tool, and the user may provide the description 120 of the function block 110, the information 122 of the input ports 112, and the information 124 of the output ports 114. The computing device 102 may obtain the description 120 of the function block 110, the information 122 of the input ports 112, and the information 124 of the output ports 114.

[0140] At block 204, the computing device may generate, by utilizing a pattern-based code generator, a semi-finished code of the function block based on the description of the function block, the information of the input port, and the information of the output port. For example, as shown in FIG. 1, the pattern-based code generator 104 may generate the semi-finished code 126 based on the description 120 of the function block 110, the information  122 of the input ports 112, and the information 124 of the output ports 114. In the semi-finished code 126, a part of the code is already completed, and another part of the code is not yet completed. The completed part of the code is generated by following a predefined pattern of function block.

[0141] At block 206, the computing device may generate, by utilizing an AI-based code generator, a finished code of the function block by feeding the semi-finished code as a prompt into a generative AI model. For example, as shown in FIG. 1, the AI-based code generator 106 may include a generative AI model. The AI-based code generator 106 may feed the semi-finished code 126 as a prompt into the generative AI model. Then, the generative AI model may generate the finished code 128 based on the semi-finished code 126. In the finished code 128, the unfinished part of the code may be generated.

[0142] At block 208, the computing device may generate the function block based on the finished code. For example, as shown in FIG. 1, the computing device 102 may generate the function block 110 based on the finished code. For example, the computing device 102 may compile the finished code 128 to obtain a binary file of the function block 110, and load the binary file into the engineering tool.

[0143] In this way, the finished code of the function block can be compiled successfully by the engineering tool because it conforms to the disciplines of the engineering tool. Furthermore, by providing the semi-finished code as a prompt for the generative AI model, the accuracy of the finished code of the function block can be improved, thereby meeting the requirements of the user more accurately.

[0144] In some implementations, the information of the input port may include a name of the input port and a data type of the input port, and the information of the output port comprises a name of the output port and a data type of the output port. Therefore, the pattern-based code generator may generate variables corresponding to the input port and the output port based on the names and the data types. In some implementations, the information of the input port may further include a description of the input port, and the information of the output port further comprises a description of the output port. Therefore, the pattern-based code generator may generate comments related to the input port and the output port based on the description of the input port and the description of the output port.  These comments can help the AI-based code generator to understand the context of the input port and the output port.

[0145] FIG. 3 is a schematic diagram illustrating an example 300 of information for generating a function block provided by a user according to some implementations of the present disclosure. As shown in FIG. 1, the example 300 includes a function block 310 to be generated. For example, the function block 310 may be the function block 110 in FIG. 1. The function block 310 may include input ports 312-1, 312-2, …, and 312-N (also collective referred to as input ports 312) and output ports 314-1, 314-2, …, and 314-N (also collective referred to as output ports 314) . The user may provide, for example through a user interface of the engineering tool, a description 320 of the function block 310, information of each input port of the input ports 312, and information of each output port of the output ports 314. For example, information 322 of the input port 312-1 and information 324 of the output port 314-1 are shown in FIG. 3. The description 320 of the function block 310 may introduce the goal or effect of the function block 310. The description 320 may be used by the pattern-based code generator to generate a comment for introducing, to the AI-based code generator, the effect of the function block 310. In this way, the AI-based code generator can generate the algorithm of the function block 310 based on the description 320.

[0146] As shown in FIG. 3, the information 322 of the input port 312-1 may include a name 332, a data type 334 (e.g., integer, float, etc. ) , and a description 336, and the information 324 of the output port 314-1 may include a name 342, a data type 344, and a description 346. In some implementations, the name 332 and the data type 334 may be used by the pattern-based code generator to generate variables corresponding to the input port 312-1. Furthermore, the name 342 and the data type 344 may be used by the pattern-based code generator to generate variables corresponding to the output port 314-1. In this way, the AI-based code generator can generate the code of the function block 310 based on the variables corresponding to the input ports and the output ports, thereby the accuracy and usability of the code generated by the generative AI model can be improved.

[0147] In some implementations, the name 332, the data type 334, and the description 336 may be used by the pattern-based code generator to generate comments for introducing, to the AI-based code generator, the variable corresponding to the input port 312-1. Furthermore, the name 342, the data type 344, and the description 346 may be used by the  pattern-based code generator to generate comments for introducing, to the AI-based code generator, the variable corresponding to the output port 314-1. In this way, the AI-based code generator can understand these variables better, thereby the accuracy and usability of the code generated by the generative AI model can be improved.

[0148] In some implementations, the semi-finished code of the function block may include a comment and a target function, where the target function may implement the algorithm of the function block. The pattern-based code generator may generate a comment for the function block based on the description of the function block, the information of the input port, and the information of the output port. Furthermore, the pattern-based code generator may generate a target function based on the description of the function block, the information of the input port, and the information of the output port. Then, the pattern-based code generator may generate the semi-finished code of the function block based on the comment for the function block and the target function.

[0149] In some implementations, in order to generate the comment for the function block, the pattern-based code generator may generate a formatted comment for the input port based on the information of the input port, and generate a formatted comment for the output port based on the information of the output port. Then, the pattern-based code generator may generate the comment for the function block by merging the description of the function block, the formatted comment for the input port, and the formatted comment for the output port.

[0150] In some implementations, in order to generate the target function, the pattern-based code generator may generate a function signature of the target function in the initial code, the function signature comprising an interface data object, generate a first local variable for the input port in the target function based on the information of the input port and the interface data object, and generate a second local variable for the output port in the target function based on the information of the output port and the interface data object. Furthermore, the pattern-based code generator may generate a finishing statement in the target function for setting a value of the second local variable for the output port back to the interface data object.

[0151] In some implementations, in order to provide more hints to the AI-based code generator, the pattern-based code generator may generate a comment for the first local  variable in the target function based on the information of the input port, generate a comment for the second local variable in the target function based on the information of the output port, and generate a comment for the finishing statement to describe an effect of the finishing statement in the target function.

[0152] In some implementations, in order to hint the AI-based code generator a location of the code to be generated by the generative AI model, the pattern-based code generator may generate an infill tag indicating a location of an algorithm to be generated by the generative AI model, where a location of the infill tag is after the first local variable for the input port and the second local variable for the output port and before the finishing statement.

[0153] FIG. 4 is a schematic diagram illustrating an example semi-finished code 400 generated by the pattern-based code generator according to some implementations of the present disclosure. To explain the semi-finished code 400 more clearly, an example of the semi-finished code 400 is provided below.

[0154] #include “SUM_R. h”

[0155] #include “SFCCommonDB. h”

[0156] #include “SFCTime. h”

[0157] #include “SFCLib. h”

[0158] / **

[0159] *Adds all input float numbers from pData and put the sum result back to pData

[0160] *@param pData->__In1_inpvar (float) is the first float input

[0161] *@param pData->__In2_inpvar (float) is the second float input

[0162] *@param pData->__Out_outvar (float) is the output sum

[0163] * /

[0164] void SUM_R (SSUM_RData*pData)

[0165] {

[0166] float In1 = pDatat->__In1_inpvar;  / / The first float input

[0167] float In2 = pDatat->__In2_inpvar;  / / The second float input

[0168] float Out;  / / The output sum

[0169] <FILL_ME>

[0170] pData->__Out_outvar = Out;  / / Put result of Out back to the pData structure

[0171] }

[0172] As shown in FIG. 4, the semi-finished code 400 may include header files 402, a comment 404, and a target function 412. The header files 402 may be generated based on a template of function block. For example, in the example code, the header files 402 may correspond to the following statements.

[0173] #include “SUM_R. h”

[0174] #include “SFCCommonDB. h”

[0175] #include “SFCTime. h”

[0176] #include “SFCLib. h”

[0177] In the semi-finished code 400, the comment 404 may include a description 406 for the function block, a comment 408 for the input ports, and a comment 410 for the output ports. The description 406 may be generated based on the description of the function block provided by the user (e.g., the description 320 in FIG. 3) . In some implementations, the description 406 may be the same as the description of the function block provided by the user. Therefore, the AI-based code generator can learn the effect of the function block from the description 406. For example, in the example code, the description 406 may be “adds all input float numbers from pData and put the sum result back to pData. ”

[0178] The comment 408 for the input ports may be generated based on the information of the input ports provided by the user (e.g., the information 322 in FIG. 3) . The comment 408 may include knowledge relating to the variables corresponding to the input ports of the function block. Therefore, the AI-based code generator can learn the information of the input ports from the comments 408. In some implementations, the comment 408 may be a Doxygen comment. Doxygen comments are a special type of comment used in source code to generate documentation automatically. By using Doxygen, the comment 408 can keep consistent with the code, as it is directly derived from the code itself. Furthermore, by using Doxygen, the comment 408 can help the AI-based code generator understand the purpose and usage of different parts of the semi-finished code 400. For example, in the example code, the comment 408 in the Doxygen format may include “@param pData->__In1_inpvar  (float) is the first float input” and “@param pData->__In2_inpvar (float) is the second float input. ”

[0179] The comment 410 for the output ports may be generated based on the information of the output ports provided by the user (e.g., the information 324 in FIG. 3) . The comment 410 may include knowledge relating to the variables corresponding to the output ports of the function block. Therefore, the AI-based code generator can learn the information of the output ports from the comments 410. In some implementations, the comment 410 may also be a Doxygen comment. For example, in the example code, the comment 410 in the Doxygen format may include @param pData->__Out_outvar (float) is the output sum. ”

[0180] In the semi-finished code 400, the target function 412 may include a function signature 414, local variables 416 for the input ports, local variables 418 for the output ports, an infill tag 420, and a finishing statement 422. The function signature 414 may be generated based on the description of the function block, and may include a function name and an interface data object. For example, in the example code, the function signature may be “void SUM_R (SSUM_RData*pData) . ”

[0181] The local variables 416 for the input ports may be generated based on the information of the input ports provided by the user. The definitions of the local variables 416 may include names of the local variables 416, data types of the local variables 416, and an association between the local variables 416 and the interface data object. Therefore, the AI-based code generator can generate the algorithm of the function block by using the local variables 416. For example, in the example code, the local variables 416 may include “float In1 = pDatat->__In1_inpvar” and “float In2 = pDatat->__In2_inpvar. ”

[0182] In some implementations, the pattern-based code generator may generate comments for the local variables 416 based on the descriptions of the input ports (e.g., the description 336 in FIG. 3) . These comments for the local variables 416 can help the AI-based code generator understand the purpose of the local variables 416. For example, in the example code, the local variables 416 with comments may include “float In1 = pDatat->__In1_inpvar;  / / The first float input” and “float In2 = pDatat->__In2_inpvar;  / / The second float input” .

[0183] In some implementations, the pattern-based code generator may generate comments for the local variables 418 based on the descriptions of the output ports (e.g., the description  346 in FIG. 3) . These comments for the local variables 418 can help the AI-based code generator understand the purpose of the local variables 418. For example, in the example code, the local variables 418 with comments may include “float Out;  / / The output sum. ”

[0184] In the semi-finished code 400, the infill tag 420 may indicate a location of an algorithm to be generated by the generative AI model. The location of the infill tag 420 may be after the definitions of the local variables 416 and 418. Therefore, the AI-based code generator can recognize the infill tag 420, and replace it with the generated algorithm. In some implementations, the generative AI model may be fun-tuned to recognize the infill tag 420, thereby the generative AI model can more clearly understand the location of the generated algorithm. For example, in the example code, the infill tag 420 may be “<FILL_ME>. ”

[0185] If the infill tag 420 is replaced with the generated algorithm, the value of the local variables 418 for the output ports may be updated by the algorithm. Therefore, in the target function 412, the finishing statement 422 may be placed after the infill tag 420, and it may be used for setting the updated value of the local variables 418 for the output ports back to the interface data object. For example, in the example code, the finishing statement 422 may be “pData->__Out_outvar = Out. ”

[0186] In some implementations, the pattern-based code generator may generate a comment for the finishing statement 422 based on the local variables 418 for the output ports. The comment for the finishing statement 422 can help the AI-based code generator understand the location of the generated algorithm. For example, in the example code, the finishing statement 422 with a comment may be “pData->__Out_outvar = Out;  / / Put result of Out back to the pData structure. ”

[0187] The generated semi-finished code may be fed into the AI-based code generator as a prompt. The AI-based code generator may read the code and the comments, and generate a finished code of the function block based on its understanding of the code and the comments. In some implementations, in the finished code of the function block, the infill tag may be replaced with the algorithm for the function block generated by the generative AI model, and an effect of the algorithm may satisfy the description of the function block.

[0188] FIG. 5 is a schematic diagram illustrating an example finished code 500 generated by the AI-based code generator according to some implementations of the present disclosure. To explain the finished code 500 more clearly, an example of the finished code 500 is provided below.

[0189] #include “SUM_R. h”

[0190] #include “SFCCommonDB. h”

[0191] #include “SFCTime. h”

[0192] #include “SFCLib. h”

[0193] / **

[0194] *Adds all input float numbers from pData and put the sum result back to pData

[0195] *@param pData->__In1_inpvar (float) is the first float input

[0196] *@param pData->__In2_inpvar (float) is the second float input

[0197] *@param pData->__Out_outvar (float) is the output sum

[0198] * /

[0199] void SUM_R (SSUM_RData*pData)

[0200] {

[0201] float In1 = pDatat->__In1_inpvar;  / / The first float input

[0202] float In2 = pDatat->__In2_inpvar;  / / The second float input

[0203] float Out;  / / The output sum

[0204] Out = In1 + In2;  / / Calculate the sum of In1 and In2

[0205] pData->__Out_outvar = Out;  / / Put result of Out back to the pData structure

[0206] }

[0207] As shown in FIG. 5, the finished code 500 may include header files 502, comments 504, and a target function 512. The comments 504 may include a description 506 for the function block, a comment 508 for the input ports, a comment 510 for the output ports. The target function 512 may include a function signature 514, local variables 516 for the input ports, local variables 518 for the output ports, a generated algorithm 520, and a finishing statement 522. In some implementations, the generative AI model of the AI-based code  generator may be trained to modify only the part of the semi-finished code that corresponds to the infill tag. It means that, compared to the semi-finished code (e.g., the semi-finished code 400 in FIG. 4) , the only change in the finished code 500 may be the replacement of the infill tag 420 with the generated algorithm 520. For example, in the example code, the generated algorithm 520 may be “Out = In1 + In2;  / / Calculate the sum of In1 and In2” , and the other parts of the finished code 500 are not changed by the generative AI model. In this way, the accuracy of the finished code 500 can be improved. However, in some implementations, minor changes to other parts of the finished code are also acceptable.

[0208] After generating the finished code, the computing device may generate the function block based on the finished code. In traditional schemes, the user may compile the code of the function block in an integrated development environment (IDE) to obtain a function block file. Then, the user may import the function block file into a function block library of the engineering tool. Then, the user may drag the function block from the library to a control chart through a user interface of the engineering tool. However, this process is complex and time-consuming. In addition, automation engineers often lack the tools needed to thoroughly test and verify the function blocks they create. In many cases, they need to integrate the function blocks into a control chart and download the chart to a runtime environment to validate its behavior.

[0209] Therefore, in some implementations, the computing device may generate a WebAssembly of the function block based on the finished code, and load the WebAssembly of the function block into a browser frontend for validation of the function block. FIG. 6 is a schematic diagram illustrating an example 600 of generating a WebAssembly of the function block for validation and loading the generated WebAssembly into a browser frontend according to some implementations of the present disclosure. As shown in FIG. 6, the example 600 may include a finished code 602 of a function block (e.g., the finished code 500 in FIG. 5) . The finished code 602 may be input into a WebAssembly builder 604.

[0210] The WebAssembly builder 604 may be configured to compile, optimize, and package code into WebAssembly modules. WebAssembly is a low-level, binary instruction format that allows code written in languages such as C, C++, Rust, and others to run on the web at near-native speed. The WebAssembly builder 604 can facilitate the process of converting  high-level source code into this efficient binary format that can be executed within a web browser or other environments that support WebAssembly.

[0211] As shown in FIG. 6, the WebAssembly builder 604 may build the finished code 602 to obtain a WebAssembly binary file 606 for the user defined function block. Then, the WebAssembly binary file 606 may be automatically loaded to a browser frontend 608 of the engineering tool. Then, a function block 610 corresponding to the WebAssembly binary file 606 may be displayed in the browser frontend 608. The function block 610 may include an input port 612 (e.g., IN1 in the finished code 500) , an input port 614 (e.g., IN2 in the finished code 500) , and an output port 616 (e.g., Out in the finished code 500) . As shown in FIG. 6, another function block 618 may be included in the browser frontend 608. The function block 618 may include input ports 620 and 622, and an output port 624. The output port 616 of the function block 610 may be connected to the input port 620 of the function block 618.

[0212] In this way, the computing device may compile the function block code into a WebAssembly and run the WebAssembly directly in the engineering tool. Therefore, the user can easily set up different scenarios for the function block to run, making it easy to test and validate the behavior of the function block.

[0213] In some implementations, in order to validate the function block, the computing device may receive, through a browser frontend, input data corresponding to the input port, and display output data corresponding to the output port. FIG. 7 is a schematic diagram illustrating an example 700 of validating the function block according to some implementations of the present disclosure. As shown in FIG. 7, the example 700 includes a browser frontend 702 of the engineering tool, and the browser frontend 702 is presented with the function block 610 to be validated (i.e., the user defined function block) and the function block 618. In the example 700, an input field 712 is connected to the input port 612 of the function block 610, an input field 714 is connected to the input port 614 of the function block 610, and an output field 716 is connected to the output port 616 of the function block 610. In the example 700, the user may provide input data in the input fields 712 and 714. Then, the function block 610 may automatically generate output data based on the values in the input fields 712 and 714, and display the output data in the output field 716.  In this way, the user can easily validate the function block 610 by providing various input data and observing the output data without running the full control process.

[0214] FIG. 8 is a schematic diagram illustrating an example apparatus 800 for generating a function block for an engineering tool according to some implementations of the present disclosure. As shown in FIG. 8, the apparatus 800 comprises a description obtaining module 802, configured to obtain a description of the function block, information of an input port, and information of an output port. The apparatus 800 further comprises a first code generation module 804, configured to generate, by a pattern-based code generator, a first code of the function block based on the description of the function block, the information of the input port, and the information of the output port. The apparatus 800 further comprises a second code generation module 806, configured to generate, by an artificial intelligence (AI) -based code generator, a second code of the function block by feeding the first code as a prompt into a generative AI model. Furthermore, the apparatus 800 further comprises a function block generation module 806, configured to generate the function block based on the second code.

[0215] In some implementations, the information of the input port may comprise a name of the input port and a data type of the input port, and the information of the output port comprises a name of the output port and a data type of the output port.

[0216] In some implementations, the information of the input port may further comprise a description of the input port, and the information of the output port further comprises a description of the output port.

[0217] In some implementations, the first code generation module 804 may be further configured to generate a comment for the function block based on the description of the function block, the information of the input port, and the information of the output port. The first code generation module 804 may be further configured to generate a target function based on the description of the function block, the information of the input port, and the information of the output port. The first code generation module 804 may be further configured to generate the first code of the function block based on the comment for the function block and the target function.

[0218] In some implementations, the first code generation module 804 may be further configured to generate a formatted comment for the input port based on the information of the input port. The first code generation module 804 may be further configured to generate a formatted comment for the output port based on the information of the output port. The first code generation module 804 may be further configured to generate the comment for the function block by merging the description of the function block, the formatted comment for the input port, and the formatted comment for the output port.

[0219] In some implementations, the first code generation module 804 may be further configured to generate a function signature of the target function in the initial code, the function signature comprising an interface data object. The first code generation module 804 may be further configured to generate a first local variable for the input port in the target function based on the information of the input port and the interface data object. The first code generation module 804 may be further configured to generate a second local variable for the output port in the target function based on the information of the output port and the interface data object. The first code generation module 804 may be further configured to generate a finishing statement in the target function for setting a value of the second local variable for the output port back to the interface data object.

[0220] In some implementations, the first code generation module 804 may be further configured to generate a comment for the first local variable in the target function based on the information of the input port. The first code generation module 804 may be further configured to generate a comment for the second local variable in the target function based on the information of the output port. The first code generation module 804 may be further configured to generate a comment for the finishing statement to describe an effect of the finishing statement in the target function.

[0221] In some implementations, the first code generation module 804 may be further configured to generate an infill tag indicating a location of an algorithm to be generated by the generative AI model, wherein a location of the infill tag is after the first local variable for the input port and the second local variable for the output port and before the finishing statement.

[0222] In some implementations, in the second code of the function block, the infill tag is replaced with the algorithm for the function block generated by the generative AI model, and an effect of the algorithm satisfies the description of the function block.

[0223] In some implementations, wherein the function block generation module 806 may be further configured to generate a WebAssembly of the function block based on the second code. The apparatus 800 may further comprise a function block validation module 810, configured to, in response to generating the WebAssembly of the function block, load the WebAssembly of the function block into a browser frontend for validation of the function block.

[0224] According to the above implementations, the finished code of the function block can be compiled successfully by the engineering tool because it conforms to the disciplines of the engineering tool. Furthermore, by providing the semi-finished code as a prompt for the generative AI model, the accuracy of the finished code of the function block can be improved, thereby meeting the requirements of the user more accurately.

[0225] Fig. 9 shows a schematic block diagram of an example device 900 of an implementation that may be used to implement the content of the present disclosure. For example, a computing device 910 according to the embodiment of the present disclosure may be implemented by the device 900. As shown in the figure, the device 900 includes a central processing unit (CPU) or graphics processing unit (GPU) 901, which may execute various appropriate actions and processing according to computer program instructions stored in a read-only memory (ROM) 902 or computer program instructions that are loaded from a storage unit 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data necessary for the operations of the device 900 may also be stored. The CPU / GPU 901, the ROM 902 and the RAM 903 are connected to each other by means of a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0226] A plurality of components in the device 900 are connected to the I / O interface 905, including: an input unit 906, such as a keyboard and a mouse; an output unit 907, such as various types of displays and loudspeakers; a storage unit 908, such as a magnetic disk and an optical disk; and a communication unit 909, such as a network card, a modem and a wireless communication transceiver. The communication unit 909 allows the device 900 to  exchange information / data with other devices by means of a computer network such as the Internet and / or various telecommunication networks.

[0227] The various processes and processing described above, for example, the method 200, may be executed by the processing unit 901. For example, in some embodiments, the method 200 may be implemented as computer software programs, which are tangibly embodied in a machine-readable medium, such as the storage unit 908. In some embodiments, part or all of the computer programs may be loaded and / or installed on the device 900 via the ROM 902 and / or the communication unit 909. When the computer programs are loaded into the RAM 903 and executed by the CPU / GPU 901, one or more actions of the method 200 described above may be executed.

[0228] The present disclosure may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for executing various aspects of the present disclosure.

[0229] The computer-readable storage medium may be a tangible device that may hold and store instructions for use by an instruction execution device. The computer-readable storage medium may be, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing devices. More specific examples (non-exhaustive list) of the computer-readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM) , a read-only memory (ROM) , an erasable programmable read-only memory (EPROM) or flash memory) , a static random access memory (SRAM) , a portable compact disk read-only memory (CD-ROM) , a digital versatile disk (DVD) , a memory stick, a floppy disk, a mechanical encoding device, such as protrusion structures in punched cards or grooves with instructions stored thereon, and any suitable combinations thereof. The computer-readable storage medium, as used herein, is not to be interpreted as a transient signal per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating via waveguides or other transmission media (e.g., light pulses propagating via optical fiber cables) , or electrical signals transmitted via electrical wires.

[0230] Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order or that all illustrated operations be performed to achieve desirable results. In certain circumstances, multitasking and parallel processing may be advantageous. Certain features that are described in the context of separate implementations may also be implemented in combination in a single implementation. Conversely, various features that are described in the context of a single implementation may also be implemented in multiple implementations separately or in any suitable sub-combination.

[0231] In the foregoing Detailed Description of the present disclosure, reference is made to the accompanying drawings that form a part hereof, and in which is shown by way of illustration how examples of the disclosure may be practiced. These examples are described in sufficient detail to enable those of ordinary skill in the art to practice the examples of this disclosure, and it is to be understood that other examples may be utilized and that process, electrical, and / or structural changes may be made without departing from the scope of the present disclosure. Independent of the grammatical term usage, individuals with male, female or other gender identifies are included within the term.

Claims

1.A method (200) for generating a function block for an engineering tool, comprising:obtaining (202) a description of the function block, information of an input port, and information of an output port;generating (204) , by a pattern-based code generator, a first code of the function block based on the description of the function block, the information of the input port, and the information of the output port;generating (206) , by an artificial intelligence (AI) -based code generator, a second code of the function block by feeding the first code as a prompt into a generative AI model; andgenerating (282) the function block based on the second code.2.The method (200) of claim 1, wherein the information of the input port comprises a name of the input port and a data type of the input port, and the information of the output port comprises a name of the output port and a data type of the output port.3.The method (200) of claim 2, wherein the information of the input port further comprises a description of the input port, and the information of the output port further comprises a description of the output port.4.The method (200) of claim 1, wherein generating (204) , by the pattern-based code generator, the first code of the function block based on the description of the function block, the information of the input port, and the information of the output port comprises:generating a comment for the function block based on the description of the function block, the information of the input port, and the information of the output port;generating a target function based on the description of the function block, the information of the input port, and the information of the output port; andgenerating the first code of the function block based on the comment for the function block and the target function.5.The method (200) of claim 4, wherein generating the comment for the function block based on the description of the function block, the information of the input port, and the information of the output port comprises:generating a formatted comment for the input port based on the information of the input port;generating a formatted comment for the output port based on the information of the output port; andgenerating the comment for the function block by merging the description of the function block, the formatted comment for the input port, and the formatted comment for the output port.6.The method (200) of claim 4, wherein generating the target function based on the description of the function block, the information of the input port, and the information of the output port comprises:generating a function signature of the target function in the initial code, the function signature comprising an interface data object;generating a first local variable for the input port in the target function based on the information of the input port and the interface data object;generating a second local variable for the output port in the target function based on the information of the output port and the interface data object; andgenerating a finishing statement in the target function for setting a value of the second local variable for the output port back to the interface data object.7.The method (200) of claim 6, wherein generating the target function based on the description of the function block, the information of the input port, and the information of the output port further comprises:generating a comment for the first local variable in the target function based on the information of the input port;generating a comment for the second local variable in the target function based on the information of the output port; andgenerating a comment for the finishing statement to describe an effect of the finishing statement in the target function.8.The method (200) of claim 6, wherein generating the target function based on the description of the function block, the information of the input port, and the information of the output port further comprises:generating an infill tag indicating a location of an algorithm to be generated by the generative AI model, wherein a location of the infill tag is after the first local variable for the input port and the second local variable for the output port and before the finishing statement.9.The method (200) of claim 8, wherein, in the second code of the function block, the infill tag is replaced with the algorithm for the function block generated by the generative AI model, and an effect of the algorithm satisfies the description of the function block.10.The method (200) of claim 1, wherein generating (208) the function block based on the second code comprises:generating a WebAssembly of the function block based on the second code, andthe method (200) further comprising:in response to generating the WebAssembly of the function block, loading the WebAssembly of the function block into a browser frontend for validation of the function block.11.An apparatus (800) for generating a function block for an engineering tool, comprising:a description obtaining module (802) , configured to obtain a description of the function block, information of an input port, and information of an output port;a first code generation module (804) , configured to generate, by a pattern-based code generator, a first code of the function block based on the description of the function block, the information of the input port, and the information of the output port;a second code generation module (806) , configured to generate, by an artificial intelligence (AI) -based code generator, a second code of the function block by feeding the first code as a prompt into a generative AI model; anda function block generation module (808) , configured to generate the function block based on the second code.12.An electric device (900) comprising:one or more processors (901) ; anda memory storing computer-executable instructions, the computer-executable instructions when executed by the one or more processors (901) , cause the device (900) to implement the method according to any of claims 1-10.13.A computer readable storage medium (903) , the computer readable storage medium (903) stores computer-executable instructions, the computer-executable instructions when executed by a processor (901) , implement the method according to any of claims 1-10.

Citation Information

Patent Citations

  • Code generation and defect repair method and device

    CN116909532A

  • Code generation and compiling deployment method, platform and equipment based on AI large model

    CN117008923A

  • Generation method and generation device of controller program, controller and storage medium

    CN117193158A

  • Hybrid front-end framework migration method based on AST and LLM

    CN117608656A

  • Method and system for code maintenance

    US20220244938A1